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

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

[Octave-bug-tracker] [bug #53331] Can't make function output argument pe


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #53331] Can't make function output argument persistent (poor man's constant)
Date: Tue, 13 Mar 2018 12:59:14 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0

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

I don't fully understand the underlying reasons either, but I guess that it
may be described by jwe's comment

> I would prefer that we disallow making existing variables (including
function parameters) global the same as we do for persistent

IOW, when the function definition is parsed, the output parameters are already
"defined" in some sense as local variables? So then having a "persistent"
statement overriding the output argument declaration is conflicting somehow.

And here is a quote from the Matlab official docs

> MATLAB also errors if you declare any of a function's input or output
arguments as persistent within that same function

I think it would be helpful if this were mentioned in our docs, along with an
example showing the correct way to do it.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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