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 13:54:39 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/07/2013 01:17 PM, John W. Eaton wrote:
On  7-Jan-2013, Michael D. Godfrey wrote:

| 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.

I've considered this in the past but it presents some memory
management issues.  With a language like Octave, it would be easy to
chew up all available memory with a stack of mostly useless values.

Apart from the memory issues, what should the syntax be?  Currently,
ans is a variable that is automatically created.  I think it has to
stay that way for compatibility with Matlab.  So maybe there would be
another function to access the contents of the "answer stack"?

jwe
I doubt if memory usage is the worst problem.  The stack could be limited
to some fixed depth. But, I am not sure this is really worth it. Giving it some
other name would be OK, I think.  But then it is just another feature.  Ugh.

What would be the implications of just making "ans" global? If there is nothing
that this would break, it could be useful.

mg



reply via email to

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