I’m probably going to cut “repeat..until” from gen2 Slag.
- I used it literally 4 times in the 10,000 lines of the Slag standard library.
- It can easily be replaced with a while() loop.
- I always forget it’s there until I try and use “repeat” as a variable name.
- Likewise, I’d kind of like to use “repeat” as a variable name again.
I guess it’s just one of those things that sounded cool but never proved itself.
Murphy mentioned the other day that every feature proposal in C# starts out with negative 100 points. People then try to come up useful cases for the feature, each rated with some number of points to offset the initial score. Only features that end up with a net positive score are actually implemented.
It’s a neat idea, although thankfully since Slag is just a little fish (but growing!) I can afford to just put things in & rip ‘em out later. Anyways, “repeat..until” is currently at (-99), so I’m gonna ditch it.
Oh wait – let’s look at the MadStone source code! Here we go. Hmm…. zero uses. Yep.
November 27, 2008 at 11:38 pm
Addendum: furthermore, for situations where you do need repeat-until functionality, this code:
repeat
body
until (condition)
converts nicely into this:
loop
body
if (condition) escapeLoop
endLoop
November 27, 2008 at 11:41 pm
PLUS the syntax isn’t consistent with the other structures. Everything else is “structure”…”endStructure”. Contrast that with “repeat”…”until”. Ungh!