One goal of Ren-C since the start has been to make sure people can write their own looping constructs that behave like the built-in loops. (That's why definitional return was so important, which paved the way for many other improvements to come.)
One loop construct requested by @gchiu was the ability to walk through blocks in parallel. It's in the tests, but I thought I'd share it here:
for-parallel: lambda [
return: [any-value?]
vars [block!]
blk1 [<opt> any-list?]
blk2 [<opt> any-list?]
body [block!]
][
while [(not empty? opt blk1) or (not empty? opt blk2)] [
(vars): pack [(try first opt blk1) (first opt blk2)]
attempt body else [ ; if pure NULL it was a BREAK
return null
]
; They either did a CONTINUE the REPEAT caught, or the body reached
; the end. ELIDE the increment, so body evaluation is WHILE's result.
;
elide blk1: next opt blk1
elide blk2: next opt blk2
]
]
You get this behavior:
>> collect [
assert [
20 = for-parallel [x y] [a b] [1 2] [
keep reduce [x y]
y * 10
]
]
]
== [[a 1] [b 2]]
There's a lot of nice little flourishes here. BREAK and CONTINUE work, thanks to the loop result protocol. Assigning the variables is handled elegantly by multi-return, where a SET-GROUP! retriggers as a SET-BLOCK!. ELIDE is put to good use to avoid a temporary variable for the loop product.
"Isn't it nice... when things just... work?"