|Version||alpha 97||Category||Error Handling||Submitted by||BrianH|
|Summary||Unwind functions don't propagate from WHILE condition block|
The unwind functions: RETURN, EXIT, BREAK, CONTINUE, THROW.
The unwinding process doesn't propagate from within the WHILE condition block because WHILE doesn't return the unwind values from there (or any values for that matter). If WHILE could check for unwind values returned from the condition block then it could act on BREAK and CONTINUE, or return the rest from the function so they can propagate. As it is now in R3, WHILE treats the unwind value like an untriggered error! and considers it true, which often leads to an endless loop.
This is related to bug #1509, but that refers to function argument processing by DO, while this refers to WHILE.
Note that the behavior of R2 should not be emulated: It is also in error, but a different error.
>> do does [while [return 'good] [print 'bad]] bad bad ; ... in an endless loop >> do does [while [return 'good] [return 'bad]] == bad ; should be good
|Assigned to||n/a||Fixed in||r3 master||Last Update||19-Feb-2014 20:05|
|in the core-tests suite|
|Weird: I was expecting QUIT and HALT to be caught by this as well, but they aren't, and not by #1760 either.|
|Expanded the tests for this in core-tests. As of alpha 111, BREAK and CONTINUE apparently work in the condition block, but the other unwinds aren't passed through. Doesn't work in R2 either, but it's a bug there too.|
|19-Feb-2014 20:05||BrianH||Fixedin||Modified||=> r3 master|
|19-Feb-2014 20:05||BrianH||Status||Modified||reviewed => built|
|24-Jan-2013 03:47||BrianH||Comment : 0003396||Added||-|
|23-Jan-2013 22:48||BrianH||Status||Modified||submitted => reviewed|
|11-Nov-2010 16:19||BrianH||Comment : 0002835||Added||-|
|2-Nov-2010 12:00||Ladislav||Comment : 0002756||Added||-|