bugGNU Octave - Bugs: bug #44860, "hold on" in single-line...

 
 

bug #44860: "hold on" in single-line is not parsed correctly

Submitted by:  None
Submitted on:  Fri 17 Apr 2015 02:47:12 AM UTC  
 
Category:  Interpreter Severity:  2 - Minor
Priority:  1 - Later Item Group:  Matlab Compatibility
Status:  Postponed Assigned to:  None
Originator Name:  John Trenholme Originator Email:  -email is unavailable-
Open/Closed:  Open Release:  dev
Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 17 Apr 2015 04:14:59 PM UTC, comment #4:

Another way to get it to parse is to treat hold as a real function and use parentheses.

Although Octave may be incompatible, there are several workarounds and it is not clear that this is even desirable syntax as having everything on one line is a confusing coding style. We can keep the bug, but I'm going to lower the priority.

Rik <rik5>
Project Administrator
Fri 17 Apr 2015 02:55:30 PM UTC, comment #3:

Right, well Matlab is often extremely forgiving.
Do we want to mimic this? I suppose so...

Philip Nienhuis <philipnienhuis>
Project Member
Fri 17 Apr 2015 09:21:00 AM UTC, comment #2:

I just checked in Matlab 2013a this is a valid syntax.

Pantxo Diribarne <pantxo>
Project Member
Fri 17 Apr 2015 07:39:39 AM UTC, comment #1:

Are you sure it is a bug?
Simply adding a comma or semicolon between the if statement proper and the following statements makes it work:

I hit this issue myself many years ago and since then always added that semicolon. IMO it simply is better coding style as well.

IIRC it was also needed on at least older Matlab versions (but I'm not sure, never checked on newer ones)

Philip Nienhuis <philipnienhuis>
Project Member
Fri 17 Apr 2015 02:47:12 AM UTC, original submission:

The following causes a parse error:

The following does not:

This seems to be the same as the previously-reported problem using 'more off' where I use 'hold on'.

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 mtmiller (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

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

    Only project members can vote.

     

     

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-05-01 mtmiller StatusNone => Postponed
        Release3.8.2 => dev
        Operating SystemMicrosoft Windows => Any
    2015-04-17 rik5 Severity3 - Normal => 2 - Minor
        Priority5 - Normal => 1 - Later
    2015-04-17 pantxo Item GroupOther => Matlab Compatibility
        Summary"hold on" in single-line if not parsed correctly => "hold on" in single-line is not parsed correctly

    Back to the top


    Powered by Savane 3.3