Hacker News new | ask | show | jobs
by rydel 2781 days ago
It depends. As we know, FP is all about not having side effects. Having “for” loop requires to mutate the pointer of given iteration.
1 comments

As replied on another thread, you just killed a couple of FP languages with that definition.
Those are not FP languages. They are, at best, "functional-first" multi-paradigm languages. (Common Lisp and Scheme are in this category.) Unfortunately, FP is more about what is excluded (side effects) than what is included (closures, continuations, sum types, etc.), so mixing FP with any amount of imperative/procedural code tends to result in an awkward and less efficient form of imperative programming without the primary benefit of FP (referential transparency).

The "function" in "functional programming" refers to mathematical functions, which are fixed mappings from inputs to results with no side effects. If your "functions" can have side-effects then they're not functions, they're procedures. Programs composed of effectful procedures are imperative, not functional.