I'm reading about C# and closure, various articles, Jon Skeet's awesome "C# in Depth" and I see statements like "C# and ruby implement lexical closure".
Why do the authors include the word "lexical"? Why not just say they "implement closure"?
What would it mean if it just implemented "closure", and not "lexical closure (if that's even possible)?
Lexical closure is just a more specific name for closure.
As you know, a closure allows a function to use variables from the scope where it was created, even if is executed from a different scope. Such a scope is also called a lexical environment, and that's where the term lexical comes from here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With