help-octave
[Top][All Lists]
Advanced

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

Re: Realtime cost of call by value


From: John W. Eaton
Subject: Re: Realtime cost of call by value
Date: Fri, 31 Oct 2003 14:43:30 -0600

On 31-Oct-2003, address@hidden <address@hidden> wrote:

| Well, then this presents itself as a golden opportunity to one-up ole'
| Matlab, eh? :-)

No.  As long-time readers of this list and observers of the Octave
project will tell you, people generally want Octave to be highly
compatible with Matlab.  So a change like this is impossible.
ong-time observers will also tell you that I have been a bit slow to
come around to the idea that one of Octave's primary strengths is its
compatibility with Matlab.  It's highly unlikely that Octave is
suddently going to take off in some new direction when it comes to
something as basic as this.  If you want Scheme, you clearly know
where to find it.

| Then, let's think of a way that would be consistent with the way
| things are, but allow for this improvement.

That's fine.  It would be nice to have a way to pass variables by
reference.  But who will decide?  Would this be a property of a
variable or a function argument?  How will it be obvious that a
particular function call can modify some of its arguments?

| I suggest that the following can be done:
| 
| nested_lexical_scope = 1;
| 
| This turns on nested lexical scoping behavior, as with what is found
| in Scheme/Lisp, etc.
| 
| The default, for compatibility with MATLAB, would be:
| 
| nested_lexical_scope = 0;
| 
| This would allow for both to live side-by-side, harmoniously ( I
| believe ). ;-)

Not even close.  The problem is that people want to run their Matlab
code without change in Octave, so they try your code, which requires
nested_lexical_scope = 1.  It fails because you forgot to save and
restore the value of this variable in all the right places.  Worse,
your code can't call any other code unless the setting is appropriate.
It's a nightmare.

If you look at what has been happening to the Octave sources lately,
variables like this have been systematically removed in favor of
Matlab-compatibility only.  Eventually, the only magic "preference"
variables that should remain will be the ones that affect things like
the appearance of the prompt or the format of output, which can't
change the way most code works (most, because you can always try to do
something stupid, like save the output in a diary file and try to read
that back in, expecting some specific format).

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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