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: InterpreterSeverity: 2 - Minor
Priority: 1 - LaterItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: John TrenholmeOriginator Email: -unavailable-
Open/Closed: OpenRelease: 3.8.2
Operating System: Microsoft Windows

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'.



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

Attach File(s):

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 rik5 (Posted a comment)
  • -unavailable- added by pantxo (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 17 Apr 2015 04:14:59 PM UTCrik5Severity3 - Normal=>2 - Minor
      Priority5 - Normal=>1 - Later
    Fri 17 Apr 2015 10:35:54 AM UTCpantxoItem 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.1-cleanup1