bugGNU Octave - Bugs: bug #37056, struct syntax error in array

 
 

bug #37056: struct syntax error in array

Submitted by:  None
Submitted on:  Wed 08 Aug 2012 12:59:02 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: InvalidAssigned to: None
Originator Name: LevOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.1
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 08 Aug 2012 01:12:09 PM UTC, comment #1:

This is not a bug. For compatibility with Matlab, spaces are treated specially inside [] and {}. Please see

http://www.gnu.org/software/octave/doc/interpreter/Matrices.html#Matrices

for more info.

Also, in the future, please use "verbatim" tags to quote code snippets. I was only able to tell that there were differences in the spacing by looking at the email that the bug tracker sent, not by looking at the report on the web.

To clarify for others who may look here later, the code that generates the error is

and Octave generates an error because the space after "struct" is handled specially and Octave parses this as if you had written

and

is not valid syntax.

John W. Eaton <jwe>
Project Administrator
Wed 08 Aug 2012 12:59:02 PM UTC, original submission:

Hi All,

I have found this bug:

Accepted commands
octave:28> params = struct ("nam","ee");
octave:29> params = [ struct("nam","ee") ]

but
octave:30> params = [ struct ("nam","ee") ];
parse error:

syntax error

>>> params = [ struct ("nam","ee") ];

^

Anonymous

 

(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 None (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 08 Aug 2012 01:12:09 PM UTCjweItem GroupRegression=>None
      StatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1