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

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

[Octave-bug-tracker] [bug #56187] Support local functions at end of scri


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #56187] Support local functions at end of scripts like Matlab
Date: Mon, 22 Apr 2019 01:08:12 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

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

I think we can detect the Matlab-style local functions by noting that all the
functions definitions occur at the end of the script and that once a function
definition is parsed, the only thing that we see in the file are more function
definitions and no other code.  Otherwise, we could proceed as we do now and
make functions in the script globally visible.  That still leaves a change in
behavior for scripts that begin with some trivial code like "1;" and then
simply define functions.  We could recognize that as a special case (it's been
the recommended way to do this forever) though I'm not sure that's a good
thing to do.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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