if 1 | nonsense 'hello', end

John W. Eaton jwe at bevo.che.wisc.edu
Tue Oct 21 16:13:04 CDT 2008


On 21-Oct-2008, Petr Mikulik wrote:

| It seems there is a bug in Octave 3.0.x -- the following results in error:
| 
| if 1 | nonsense 'hello', end
| a=1; if a==1 | b==7 'hello' , end
| 
| while it writes correctly 'hello' in Octave 2.x aneb Matlab 6.x.

Please read the entry in the Octave FAQ about this.  I consider it a
bug in Matlab that we will not duplicate.  If you want short circuit
behavior, use the || and && operators.

I'd be surprised if it works differently in earlier versions of
Octave.  The | and & operators in Octave have never short circuited.

jwe


More information about the Bug-octave mailing list