octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #58389] field key not recognized in anonymous


From: Rik
Subject: [Octave-bug-tracker] [bug #58389] field key not recognized in anonymous function handle
Date: Mon, 18 May 2020 13:21:40 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #4, bug #58389 (project octave):

The code behaves correctly now, but it still isn't printed quite correctly. 
It is missing the '.' indexing operator.  See below


octave:4> f = @(x) a.(s)(x)
f =

@(x) a(s) (x)

octave:5> f(1)
ans = 2.7183


So, it works, but I would have expected "@(x) a.(s) (x)" for the printout.

If you use a constant string as the indexing fieldname then the '.' is
printed.


octave:6> fieldnames (a)
ans =
{
  [1,1] = x
}

octave:7> f2 = @(idx) a.x(idx)
f2 =

@(idx) a.x (idx)

octave:8> f2(1)
ans = 2.7183




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58389>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]