in reply to (tye)Re: Closures and scope
in thread Closures and scope
I am curious. I think of anonymous subs in terms of the variable that is holding them, not the function that created them. So if I have 10 variables in an array that each hold a code-ref, I would say that I have 10 anon subs, and not "3 copies of this one, 2 of that, and 5 of the other". I talk about passing anon subs to functions, etc, and this only makes sense to me if I think that way.
Besides which to me using anon subs is a way of hiding information. I use them because I explicitly don't want to and don't think this code should care about where stuff came from. So the constructor is at best irrelevant so long as the function does what it is supposed to!
So how about others? Are you with Tye in thinking about the internals of what gets compiled etc, or with me in thinking about anon functions in terms of the reference you can see in your variables?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: Closures and scope
by tye (Sage) on Oct 16, 2000 at 21:26 UTC | |
by tye (Sage) on Nov 17, 2000 at 21:12 UTC |