loading...

re: The beauty of Functional Programming VIEW POST

TOP OF THREAD FULL DISCUSSION
re: [deleted]
 

Sorry Fanny, but it would be classed as a pure function in spite of writing to a local variable. As long as the write has no side effects that are externally observable, it would satisfy the definition of a pure function.

Even a recursive function with no visible variable assignment may introduce any number of intermediate variables as part of compiler optimisation; this wouldn't make it any less pure provided these changes did not escape outside function scope.

code of conduct - report abuse