in reply to Re^5: Nesting Functions
in thread Nesting Functions
I've edited my post after seeing your update FYI.
> while in python it must have been defined before chronologically.This was what my example above was meant to demonstrate. The print(a) is fine because a=x has been executed first chronologically, although it was done after lexically (ie, below).
not sure what you mean. Example?
I'm saying it has to match the semantic of the definitionBut definition are different between language aren't they? Like a closure can just be an anonymous function in some languages. Or do you consider that there is one true definition, and incorrect uses? You say that "Scoping rules are different", but you might just consider that the definition of a scope is different between languages. I could then argue that python doesn't have a definition for lexical variables. But I see it's a very poor argument, as you can't say that a language doesn't have a feature simply because the feature has another name :).
But what matters here is the visibility of lexicalsThat makes sense. And IMHO it's an argument for calling our variable lexical aliases rather than just package variables :D.
I still don't think calling python variables lexical is really helpful, especially when comparing it to perl. But I see your points and accept them as valid. I won't discuss much further, or at all, because who cares about python anyway?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Nesting Functions
by hippo (Archbishop) on Jul 19, 2019 at 14:38 UTC | |
by Anonymous Monk on Jul 21, 2019 at 22:32 UTC | |
|
Re^7: Nesting Functions
by LanX (Saint) on Jul 19, 2019 at 14:39 UTC | |
by Eily (Monsignor) on Jul 19, 2019 at 14:58 UTC | |
by LanX (Saint) on Jul 19, 2019 at 15:11 UTC | |
|
Re^7: Nesting Functions
by LanX (Saint) on Jul 19, 2019 at 22:42 UTC |