You are right that (currently, at least) this subtopic has nothing to
do with programming - so I've moved it to chat.

The question I am trying to resolve, for myself, is whether the
referenced wiki page
(http://www.jsoftware.com/jwiki/Guides/Lexical%20Closure) needs to be
changed.  And, if so, what needs to be changed about it.

Currently the gist of the argument which puzzles me is:

(a) "functions" in the context of computer programming are not
expected to be mathematical functions - they can be stateful, and,
thus

(b) "closure" as used in the context of computer programming is thus
expected to be purely functional -

In other words, this seems [to me] to be an argument that there's
nothing about lexical closures (which are defined in terms of
functions) which is stateful because obviously functions are allowed
to be stateful.

So far I have two people that seem to be saying that this line of
reasoning makes sense.

I have proposed, as a counter argument, that there are two relevant
definitions for functions - one which is used in the context of
lexical closures (which allows for state) and another which is used in
"purely functional" contexts, and that the purely functional case is a
restriction on the general case.

And I have two people explicitly disagreeing with the idea that this
is a rational argument.

Until I can either (a) make sense of their argument, or (b) reject
their argument, I am not comfortable with simply dropping the
discussion.

Does this (at least the part about why I am continuing to participate)
make sense?

Thanks,

-- 
Raul

On Wed, Feb 20, 2013 at 8:45 AM, Eldon Eller <[email protected]> wrote:
> I fail to see what this discussion about closure has to do with J
> programming. The faultmay be entirely mine; I am an old man and an amateur
> programming. If this discussion is about J programming, please inform me of
> the connection. If not, I suggest that you guys get together and discuss
> this among yourselves.
>
>
> On 02/20/2013 09:37 PM, William Tanksley, Jr wrote:
>>
>> Reading back through this discussion was difficult but enlightening.
>>
>> Here's how it started:
>>
>> 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.
>>
>> Specifically, this was mentioned in a wiki edit credited to DanBron.
>> Dan is largely right, except in the part Boyko is quoting; Boyko is
>> exactly correct that Dan has allowed "stateful" and "closures" to mix
>> up his words. In context, Dan's contribution is OK, since he's
>> actually addressing Graham's challenge which implies the same error.
>>
>> Raul then claims that Boyko's statement is "not meaningful" because
>> his usage of the word "function" "conflicts with the usual meaning of
>> the word".
>>
>> Raul is incorrect. Boyko was correct to use the word "function" in the
>> same sense that Dan (and Graham) used it, and in fact he was
>> considerate enough to explain why he felt the need to disagree with
>> them. Furthermore, he did not disagree with them because he used a
>> different definition of the word "function", but rather because they
>> (collectively) incorrectly claimed that closures would render a
>> language not functional.
>>
>> Raul Miller <[email protected]> wrote:
>>>
>>> As I understand it, if closures *are* purely functional they would not
>>> allow state change.
>>> I think I would use a different tense (for example, subjunctive tense)
>>> to express that they have the potential of being purely functional.
>>
>> Here Raul makes a statement that means exactly what Boyko said, which
>> Raul said was "not meaningful".
>>
>> I don't see a reason to carry this conversation on. Anyone else?
>>
>>> Raul
>>
>> -Wm
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to