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

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

[Octave-bug-tracker] [bug #45835] interpreter does not search for anonym


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #45835] interpreter does not search for anonymous function variables within a string
Date: Fri, 28 Aug 2015 15:50:09 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.1.0

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

I don't think Matlab is looking at strings for additional variable names.  For
example, the following should produce 42 as a result, and at the time of
parsing the anonymous function, there is no way to guess what string will be
passed to the eval function:


f = @(s, t) eval (s)
f ('t', 42)


So I think the issue is that when evaluating anonymous functions, the
parameters to the anonymous functions are not considered.  I haven't looked at
this carefully, but my guess would be that the function parameters are in a
separate scope but the body of the function is being evaluated in whatever
scope it appears in, and that doesn't include the function parameters.  The
fix that is needed is probably just a small change in the way variables are
looked up in this case so that the function parameters are also searched and
found first.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45835>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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