REBOL3 tracker
  0.9.12 beta
Ticket #0002223 User: anonymous

Project:

Previous Next
rss
TypeWish Statussubmitted Date17-Jul-2015 16:06
Versionr3 master CategoryUnspecified Submitted byfork
PlatformAll Severityminor Prioritynormal

Summary Rename BREAK/RETURN to BREAK/WITH (or...better idea?)
Description The unsettling nature of seeing RETURN in a function and having it not refer to returning from a function has been bothering me since I first saw it. Now, with definitionally-scoped returns, RETURN is becoming more special and I'm even more rattled by it. Not just BREAK/RETURN but also QUIT/RETURN. Which *is* it, are you quitting or returning?

(Note on that one: happily...definitionally-scoped return is leading to the end of EXIT. And my END proposal isn't going to fly either, we need a way of returning an unset... RETURN VOID or RETURN () or similar. Then EXIT can be taken for exiting the process with a code...while QUIT means EXIT 0. Ta-da.)

But in terms of fixing up BREAK/RETURN I'm not sure what the best idea is. BREAK/VALUE and BREAK/RESULT would overlap with common variable names VALUE and RESULT.

If someone can come up with a single-arity FOO which is single arity and expands the list of ways to manipulate a loop to "break, continue, foo" that would be interesting. Then it would be something that meant "break and return a value" in one word. But I can't think of any offhand.

So I'll start the bidding at BREAK/WITH. Better suggestions?

NOTE: We should be observing when a construct is used in bootstrap of Rebol and changing it will affect that. There are no usages of BREAK/RETURN in the bootstrap, and we shouldn't be introducing any. A list of such things needs to be made, and perhaps a pre-commit script to scan for them and prevent them from being added.
Example code

			

Assigned ton/a Fixed in- Last Update17-Jul-2015 16:12


Comments

Date User Field Action Change
17-Jul-2015 16:12 Fork Description Modified -
17-Jul-2015 16:12 Fork Description Modified -
17-Jul-2015 16:06 Fork Ticket Added -