|
From: | John W. Eaton |
Subject: | [Octave-bug-tracker] [bug #55995] "continue" is dynamically, not lexically scoped - callable from functions without for loops |
Date: | Mon, 25 Mar 2019 23:45:59 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 |
Follow-up Comment #4, bug #55995 (project octave): Fixing continue to work like break is fairly simple. See the attached patch. In Matlab, is this a parse error, or a run-time error? I think you could check with something like function foo (cond) if (cond) break; end end and if this fails with an error when you execute "foo (false)", then it looks like a parse error to me. If it only fails when executing "foo (true)", then we are still not compatible because Octave detects break outside of a loop when the function is parsed. I don't remember whether I asked this question when I made break error when it appears outside of a loop, but it occurs to me now... (file #46639) _______________________________________________________ Additional Item Attachment: File name: continue-diffs.txt Size:1 KB <https://savannah.gnu.org/file/continue-diffs.txt?file_id=46639> _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?55995> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |