[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #38704] Inconsistent short-circuit behavior
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #38704] Inconsistent short-circuit behavior |
Date: |
Wed, 10 Apr 2013 19:42:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 |
URL:
<http://savannah.gnu.org/bugs/?38704>
Summary: Inconsistent short-circuit behavior
Project: GNU Octave
Submitted by: None
Submitted on: Mi 10 Apr 2013 19:42:54 UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name: Matthias Fuchs
Originator Email: address@hidden
Open/Closed: Open
Discussion Lock: Any
Release: 3.6.3
Operating System: GNU/Linux
_______________________________________________________
Details:
I ran the following script with the octave interpreter and observed that the
first if-expression is interpreted without error while the second one fails:
do_braindead_shortcircuit_evaluation (1)
% this works
util = ~0;
if util | [](:,1)
endif
% fails
if ~0 | [](:,1)
endif
In other words, it seems that in the latter case not only the first but also
the second expression is evaluated which results in an error (index out of
bounds). Unfortunately, I do not have access to Matlab so I do not know if
this behavior is the same there.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?38704>
_______________________________________________
Nachricht gesendet von/durch Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #38704] Inconsistent short-circuit behavior,
anonymous <=