3 ms·
Unfortunately it get's lots of pushback instead. It seems very likely that syntax will get changed to `return continue fn()` https://github.com/tc39/proposal-pt
by chr1 11y ago
Unfortunately it get's lots of pushback instead. It seems very likely that syntax will get changed to `return continue fn()` https://github.com/tc39/proposal-ptc-syntax https://github.com/tc39/proposal-ptc-syntax
Somewhat related there is no optimization for passing arbitrary length arrays with `...` to function having `...rest` as the last argument, which means [].splice is still a footgun:(
- jzwinck 11y agoThat explicit tail recursion syntax is pretty gross. Is there a precedent in any other language?
- endgame 11y agoClojure's recur is kinda-close, I guess?
- preek 11y agoIt is, but Clojure uses it, because it cannot really do Tail Call Optimization due to constraints on the JVM. Therefore "recur" is required to keep the Stack from overflowing.
- Havvy 11y agoRust has plans for a `become` operator for tail call optimization.