Any block that creates scoped variables is a closure in my book.So, only blocks that don't create scoped variables aren't not closures? That's not a very useful definition. It's also a definition that's quite different from what other people use. Using your own definitions doesn't promote communication.
Note that the important thing of what the rest of Perl world calls closures is the reference to lexical variables defined outside of the scope. The block rovf showed, and which you label a 'closure' doesn't reference a variable outside of its scope.
Are you saying that everyone who creates a class has to build a potentially exhaustive set of classes and subclasses so that no one can see things that don't belong to them?Uhm, not at all. I commented on the technique rovf showed. I say it doesn't scale. What makes you think I promote that?
In reply to Re^8: Unable to declare local variable with "use strict".
by JavaFan
in thread Unable to declare local variable with "use strict".
by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |