4 ms·
> The core of functional programming is about avoiding mutable states, not much about anonymous functions or passing functions as data. I disagree since any pa
by znafelrif 3y ago
> The core of functional programming is about avoiding mutable states, not much about anonymous functions or passing functions as data.
I disagree since any paradigm can be done either with or without mutable state. So it is not something that defines functional programming.
In any case you can also use immutable data types with python anyway.
The main annoyance with python is in my opinion your last point: The lambda syntax is too limited. So it is necessary to define lots of nested small functions instead.
Also python syntax is not as nice in chaining function calls over multiple lines.
- elesiuta 3y ago> Also python syntax is not as nice in chaining function calls over multiple lines. Not sure if this is exactly what you meant, but I implemented something like this in reply to a similar comment a few months ago which may be of interest. https://news.ycombinator.com/item?id=35105298 https://news.ycombinator.com/item?id=35105298
- tpoacher 3y agoI use this approach [0]. Works well enough for me and is visually adequate for "piping"-style code. 0. https://sr.ht/~tpapastylianou/chain-ops-python/ https://sr.ht/~tpapastylianou/chain-ops-python/