3 ms·
> Honestly, to me it is unreadable. Defining function inside a function inside yet another function where you use a for loop kind of function. Perhaps you thin
by nordsieck 4y ago
> Honestly, to me it is unreadable. Defining function inside a function inside yet another function where you use a for loop kind of function.
Perhaps you think the same thing about JS where that was (and maybe still is?) a common idiom. Except that people didn't give those functions names.
And for sure, it's possible to do it in all sorts of languages: python, ruby, js, go, and of course lisp
I get that the syntax is "weird", but honestly, the only two real difference is that the parens are "on the wrong side" for functions/expressions, and the indentation is truncated (the trailing side of the paren pyramid is accumulated and stuck to the end of the last functional line).
- wheelerof4te 4y agoDoing that stuff in Python would further slow down an already slow language to a crawl. Calling non-builtin functions in cPython is super expensive.