octave-maintainers
[Top][All Lists]
Advanced

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

Re: Idea: Extension of function / return syntax.


From: Michael D. Godfrey
Subject: Re: Idea: Extension of function / return syntax.
Date: Mon, 07 Jan 2013 09:47:03 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/07/2013 06:23 AM, Júlio Hoffimann wrote:
Yes, Julia is really new. ;)
Sort of interesting at first glance.  But not obviously
different from ....  (YAL)

About return values from functions: One way to
think about it might be to use ans.  Currently, the
value of ans is local to the function, so

function f(x,y)
x+y
end
produces :
f(1,2)
ans
(void)

If ans were not local, the specific behavior asked for
would (nearly) happen.

In any case, I have thought now and then of proposing that "ans"
be made into a stack.  This idea is somewhat relevant to this
discussion, so I am just mentioning it now.  It might be nice
is this feature could be part of a more general capability rather
than a special case.

By the way, Julia proudly says that you can define functions at the
command line unlike Matlab.  They do not mention that this is just
like Octave...

mdg

mdg



reply via email to

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