3 ms·
I'm convinced someone wrote a (bad) Scheme to JavaScript transpiler to convert the code. It looks like nothing anyone would actually write.
by shawn_w 2y ago
I'm convinced someone wrote a (bad) Scheme to JavaScript transpiler to convert the code. It looks like nothing anyone would actually write.
- nvlled 2y agoI've seen code like that in production, it's not as strange as you think (pretty common in reactjs codebase). After a while, you just get used to it and read past the weird syntax. It's not really that different from a switch-case or if-else block: function member(item, x) { return /* if */ is_null(x) ? /* then */ null : /* elif */ item === head(x) ? /* then */ x : /* else */ member(item, tail(x)); }