3 ms·
> such as immutable languages that don't have loops, because loops require mutation, and so instead rely on recursion These two are not as intertwined as you m
by masklinn 5y ago
> such as immutable languages that don't have loops, because loops require mutation, and so instead rely on recursion
These two are not as intertwined as you make them. OCaml has mutation but not iteration.
- int_19h 5y agoOCaml has while- and for-loops. A better example might be Clojure, which has mutable variables (opt-in, like OCaml), but no traditional imperative loops - only recursion. However, even then, the syntax for its tail-recursive construct uses "loop" as a keyword.
- lostcolony 5y agoI said immutable -> !loops (p implies not q). You're saying !immutable -/> loops (not p does not imply q) It's a fair thing to mention, but you're not gainsaying anything I said; I never said anything about mutable languages that don't have loops. In fact, to the topic at hand, you would assume that to be the case, given that structured programming was intended to force loops on languages at the time (mostly mutable) that weren't using them (but instead were using gotos and the like)