REBOL3 tracker
  0.9.12 beta
Ticket #0002163 User: anonymous

Project:

Previous Next
rss
TypeWish Statussubmitted Date21-Aug-2014 02:31
Versionr3 master CategoryUnspecified Submitted byfork
PlatformAll Severityminor Prioritynormal

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 ton/a Fixed in- Last Update21-Aug-2014 06:46


Comments

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 -