On Fri, Feb 15, 2013 at 4:40 AM, Boyko Bantchev <[email protected]> wrote: > The 'Lexical Closure' essay > (http://www.jsoftware.com/jwiki/Guides/Lexical%20Closure) > mentioned in this thread declares lexical closures to be > 'incompatible with the functional programming model'. > Such a statement is incorrect. > > If a function returns different values for the same arguments, it > is not because closures are involved but because that function has > a changeable state.
Here, you have introduced a definition of "function" which conflicts with the usual meaning of the word when people talk about functional programming. As a general rule, it's not meaningful to say that a statement is false when you have changed the meaning of the words. Otherwise, I could start with a statement generally accepted as true, such as two equals one plus one and change the definition of the word "plus" to mean "boolean addition" and then claim that the original sentence was false. And, while it's perfectly reasonably to use this alternate definition in a constrained context, it's simply not the case that that context is the same context as the original statement. That said, if you make it clear that you are not making a blanket statement about other people's use of the word "plus" then it's entirely reasonable to talk about such statements in the context of boolean addition. For example: one equals one plus one when plus represents boolean addition FYI, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
