bugGNU Octave - Bugs: bug #44793, assert([]) is valid

 
 

bug #44793: assert([]) is valid

Submitted by:  John Donoghue <lostbard>
Submitted on:  Thu 09 Apr 2015 04:06:59 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: JohnDOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 09 Apr 2015 05:54:57 PM UTC, comment #2:

The check in assert is for

If cond is an empty matrix, that returns true.

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/cbba639b956b

John W. Eaton <jwe>
Project Administrator
Thu 09 Apr 2015 04:25:43 PM UTC, comment #1:

I just checked and we have had assert([]) be a no-op since at least version 3.2.4 of Octave. Maybe we should change that? In scripting languages like Perl the empty value, such as "", is interpreted as false and so assert (false) should produce an error.

In other cases in Octave we do assume that [] is false. For example,

prints out False.

Rik <rik5>
Project Administrator
Thu 09 Apr 2015 04:06:59 PM UTC, original submission:

Is assert([]) valid?
Matlab doesn't allow it with an error about expecting an scalar logical.

I noticed this when looking at some of the uimenu tests where the result of ishghandle() is used.

It maybe that the real issue here is the test:

John Donoghue <lostbard>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by lostbard (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 09 Apr 2015 10:34:05 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1