[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #55995] "continue" is dynamically, not lexical

From: Rik
Subject: [Octave-bug-tracker] [bug #55995] "continue" is dynamically, not lexically scoped - callable from functions without for loops
Date: Tue, 26 Mar 2019 12:27:26 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Update of bug #55995 (project octave):

                  Status:          Ready For Test => Fixed                  


Follow-up Comment #9:

I think this is the right philosophical choice.  I tested with this file


for i = 1:5
  disp ("Before");
  printf ("Call #%d\n", i);
  disp ("After");

function subfcn ()
#  continue;

which now shows 

parse error near line 11 of file

  continue must appear in a loop in the same file as loop command

>>>   continue;

octave:1> tst_cont
parse error near line 11 of file

  break must appear in a loop in the same file as loop command

>>>   break;

The two loop keywords are now treated identically.

Last request would be to change the error message to be more precise.  It is
notthe case that the keyword can occur in the same file as the loop command,
it actually needs to be within the same scope or syntactic block.  The test
script I used has continue in a subfunction which is within the same file, but
that is not good enough.

Also, should there be a note in the NEWS file about this change?  I hope
nobody is actually relying on this feature, but it might be good to point out
the change.


Reply to this item at:


  Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]