From bug-octave-request at bevo dot che dot wisc dot edu Wed Feb 12 13:41:19 2003 Subject: Re: Inline (RHS) assignment From: "Quentin H. Spencer" To: bug-octave at bevo dot che dot wisc dot edu Date: Wed, 12 Feb 2003 12:39:46 -0700 JD Cole wrote: > octave:10> clear f > octave:11> a= f*(f=10) error: `f' undefined near line 11 column 4 > error: evaluating binary operator `*' near line 11, column 5 > error: evaluating assignment expression near line 11, column 2 > octave:11> a= (f=10)*f > a = 100 > ================================ > Is this proper behaviour. While I'm not sure the way Matlab treats > this. (And I don't have a copy.) I know in C the assignment takes > precedence...but perhaps that's apples and oranges. So... > > 1) Is this proper behavior? > 2) Should the assignment take precedence? > 3) (Gulp!) What does Matlab do? For both cases, Matlab returns the following: Error: MATLAB assignment cannot be nested. As for what Octave's behavior should be, perhaps others are better qualified than I am to comment. --Quentin Spencer ------------------------------------------------------------- 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 -------------------------------------------------------------