Type | Wish | Status | submitted | Date | 21-Aug-2014 02:31 |
---|---|---|---|---|---|
Version | r3 master | Category | Unspecified | Submitted by | fork |
Platform | All | Severity | minor | Priority | normal |
Summary | Make UNTIL a 2-arity function, add /AFTER refinement to UNTIL and WHILE |
---|---|
Description |
In requesting a 1-arity WHILE, questions of the awkwardness of naming it and its behavior drew attention to the existing awkwardness of UNTIL. This was debated a bit in #2146. I've scrapped that proposal and thus introduce a new one. This is that the existing UNTIL be made 2-arity and consistent with the layout of WHILE, and that WHILE have a refinement added to allow it to run the body once through before checking the condition. x: -1 while/after [x > 0] [ print "This would print once." ] Under this line of thinking, Rebol 3's UNTIL would become the "not" version of WHILE...somewhat similar to the relationship between IF and UNLESS. x: 1 until [x = 3] [ print "This prints twice" ++ x ] In both cases, the return result would come from the last evaluated value of the body. If the body was never evaluated, they should both return NONE consistent with IF and the current while (pointed out by @earl). |
Example code |
Assigned to | n/a | Fixed in | - | Last Update | 21-Aug-2014 06:46 |
---|
Date | User | Field | Action | Change |
---|---|---|---|---|
21-Aug-2014 06:46 | Fork | Description | Modified | - |
21-Aug-2014 02:35 | Fork | Description | Modified | - |
21-Aug-2014 02:32 | Fork | Description | Modified | - |
21-Aug-2014 02:31 | Fork | Ticket | Added | - |