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

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

[Octave-bug-tracker] [bug #54801] Errors in inline functions defined in


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #54801] Errors in inline functions defined in scripts do not create a valid link to the source code in the command window
Date: Sun, 3 Mar 2019 14:39:02 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36

Follow-up Comment #14, bug #54801 (project octave):

Octave does not yet implement the feature of local functions in scripts at all
as Matlab describes them.

If you have a script foo.m that defines a function bar, it is *not* a script
local function in the Matlab sense. I am pretty sure the following would work
in Matlab, but does not work yet in Octave


disp('This is script foo.m')
disp('Now calling bar()')
bar()

function bar()
  disp('This is function bar()')
end


At the moment, functions defined in script files are exactly the same as
inline functions. After running the script, all functions defined in the
script file are available in the global workspace to be called as if they were
normal inline functions pasted at the command line.

If you think Octave should also support script local functions as defined by
Matlab, that is a separate discussion, and I think it may have been discussed
somewhere before.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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