News for hackers. Stuff that matters.
Re:Update on the Bagel language by brundolf on Tuesday January 25, 2022 @02:18PM (#30076612)
The assumption in Bagel is that pretty much all looping-like behaviors in a function context will be covered by iterators with chained methods; I’m borrowing (heh) heavily from Rust here (which doesn’t have pure-only contexts, but heavily encourages and supports doing things as expressions). A for-loop is a range, a for-each would just be iterating over an array, building up a single value would be a reduce, etc. There are some more gaps I still need to fill, but it should work pretty nicely for most cases.

Though of course, recursion is always still available as a fallback/preference

Re:Update on the Bagel language by NoahTheDuke on Thursday January 27, 2022 @01:47PM (#30104453)
I wonder if a `loop`/`recur` construct like the one Clojure has would help here. Allows for closing over data without having to pass everything into a recursive function, and can handle more complex looping constructs without having to write an explicit "for loop".