octave-maintainers
[Top][All Lists]
Advanced

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

Re: proposed parser changes


From: Wolfgang_M
Subject: Re: proposed parser changes
Date: Thu, 20 Mar 2008 12:57:00 -0700 (PDT)



John W. Eaton wrote:
> 
> On 20-Mar-2008, Wolfgang_M wrote:
> 
> | I'm afraid of a debugging situation, if the 'bug' is only a whitespace
> to
> | much
> | together with a bad named variable, i.e. a functionname,
> | which is not in the matlab-path at my machine, but
> | on the machines of my colleagues...
> 
> I don't understand what you mean.  Can you please give an example that
> demonstrates the problem you are thinking of?
> 
> 

Given the function 'foo' which is defined like:
****
function result=foo( vect, mean)
      result=(mean -vect)

end %end of function
****

Called with only one argument, the variable 'mean' will be treated as a
function with the negative
argument 'vect'.
In this case with the matlab-function 'mean', it is clear, what happens and
you might find
this constellation. But if you have a similar function 'foo( vect, srcBar)'
and 'srcBar' is the name of a function on my machine in the matlab path but
not at your computer,
you will never be able to reconstruct the wrong results I could get with
this function.
Furthermore, if you work with objects (maybe in octave 3.1?)  you might
often use
function names as variables.

By the way another case which is already making trouble in matlab:

Try in R2007a:

mean-1
mean -1

(second comand with whitespace between 'mean' and '-1')
the first command throws an error (like expected), but the second one gives
out '47' on my computer.
I dont know whats happening there, but if this stuff makes already trouble
in matlab,
it might not be an advantage, if also octave does similar things.

W.M
-- 
View this message in context: 
http://www.nabble.com/proposed-parser-changes-tp16035583p16187418.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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