On 3/24/14 8:20 PM, Terry Reedy wrote:
On 3/24/2014 7:56 PM, Mark H Harris wrote:
the list which is used for each of the adder[] functions created.
Wrong. Functions look up global and nonlocal names, such as n, when the
function is called.
hi Terry, yeah, I know; this is what's *wrong* all at once.
Functions "look up global and nonlocal names" such as n, is semantics
for "each created function 'grabs' the last number (n) in the list",
well, because that (n) is bound at call-time to (3).
Your version semantically is detailed and correct; my version
semantically is "how it is perceived" by the user, which is also
correct. Again, how the function gets the n (grab or lookup) is mute.
The user is often confused about how this happens. As you have shown,
even experts in this field disagree about how this is described, which
is also my secondary point--- the whole thing is VERY difficult to
explain to "normal" users. It often takes several sessions and goes on
and on, until Mark Lawrence calls it tedious.
marcus
--
https://mail.python.org/mailman/listinfo/python-list