This old post raises a good point about wanting access to both the position and value easily from the same loop.
The concept of assuming the names (value, index) is something definitely needed in Rebmu. I'm a bit reticent to put it in a "core" function. But we should make it trivially easy to make such operators if you want it.
I had a random brainstorm today about how EACH might be a generator.
>> g: each x [1 2] [print ["running" x], x + 10]
A thought I had was we might then imagine FOR as something that calls a function until it returns NULL, and returns the last non-NULL thing.
>> for each x [1 2] [print ["running" x], x + 10]
Then MAP could call the function until it returns NULL, but return the results:
>> map each x [1 2] [print ["running" x], x + 10]
== [11 12]
This thought is definitely more "minecraft of programming"...breaking FOR and MAP and EACH down into generic bricks.
Though there are a couple of sticking points with it... e.g. it doesn't generalize arbitrarily to things like remove each...and if NULL is taken to signal "done" then it can't also signal BREAK. But I'm now thinking maybe generators can return NULL if they speak a multi-return protocol...where NULL is augmented with "/BRANCHED". That's looking really desirable now.
Makes for interesting possibilities:
>> map generator [count-up x 3 [yield x], count-down 3 [yield x]]
== [1 2 3 3 2 1]
FOR would be similar to UNTIL .NULL?...but if you said until .null? [ask integer!] it would keep asking for integers until you canceled, then it would return NULL. But for [ask integer!] would keep asking and then give you the last input. map [ask integer!] would give you the list of integers.