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

 
 

bug #37056: struct syntax error in array

Submitter:  None
Submitted:  Wed 08 Aug 2012 12:59:02 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Lev Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.6.1
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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


[struct ("nam","ee")]


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


[struct, ("nam","ee")]


and


("nam","ee")


is not valid syntax.

John W. Eaton <jwe>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-08-08 jwe Item GroupRegression None
        StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code