11 ms·
That's interesting. I can't tell if you're joking or not (I'm pretty sure the ability to loop is a requirement for Turing-completeness). Do you mean like Lisp
by tkahn6 16y ago
That's interesting. I can't tell if you're joking or not (I'm pretty sure the ability to loop is a requirement for Turing-completeness).
Do you mean like Lisp which favors recursive function (or lambda calculus which uses the Y-combinator :)?
- chbarts 16y agoI'm pretty sure he means languages like Lisp and (especially) Haskell which reduce the number of side-effects (and, not incidentally, the amount of boilerplate code) by abstracting away the loop and replacing it with some notion of mapping a function over some sequence of values (and/or key-value pairs, etc.). The advantage is that off-by-one errors are largely eliminated, it's easier to see how to parallelize the code, and there is no visual noise associated with maintaining index variables. The problem is that it's no longer as natural to bail on a loop early: You need some notion of exceptions or, in the most general case, first-class continuations, as in Scheme.
- SkyMarshal 16y agoThat's what I assumed when I upvoted him. Recursion & lambda ftw.
- eru 16y agoIndeed, I was aiming at recursion. (Though I mostly use combinators like foldr instead of naked recursion.) On the other hand: You can see loops as a special case of recursion. Though I like languages that don't treat this special case as a special case.