|
|
|
|
|
by bad_user
2894 days ago
|
|
FP means referential transparency. For-comprehensions operate on iterators and iterators are not FP, being a very dirty and mutable protocol. Do not confuse FP with declarative programming or with laziness. FP often implies declarative APIs and laziness but not vice-versa. |
|
(expr for item in iterable if cond) is more or less another way to spell map(lambda item: expr, filter(lambda item: cond, iterable)), except readable.
You could define "functional programming" to absolutely require referential transparency, but that's not what the rest of the thread is doing.