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: Oliver Heimlich
Subject: [Octave-bug-tracker] [bug #53331] Can't make function output argument persistent (poor man's constant)
Date: Mon, 12 Mar 2018 16:52:26 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

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

                 Summary: Can't make function output argument persistent (poor
man's constant)
                 Project: GNU Octave
            Submitted by: oheim
            Submitted on: Mon 12 Mar 2018 09:52:25 PM CET
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Regression
                  Status: None
             Assigned to: None
         Originator Name: Oliver Heimlich
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any

    _______________________________________________________

Details:

The following is a common(?) idiom in Octave to define a constant value: To
define a function without parameters.

To prevent multiple initialization of a computed value, it can be made
persistent.  However, that fails in the current dev version.


>> function x = foo (); persistent x = 1; endfunction
>> foo
error: can't make function parameter x persistent
error: called from
    foo at line 1 column 22


I can understand that input(!) arguments cannot be made persistent.  But,
shouldn't that be possible for output arguments?




    _______________________________________________________

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]