in reply to Re^5: Accessing lexicals in other scopes dynamically by name
in thread Accessing lexicals in other scopes dynamically by name
I have never really looked at the Perl-internals, but I can vagly remember having seen an implementation of Scheme in Scheme.
If I remember correctly there was a data-structure containing all the variable-bindings for any lexical scope and every closure would simply keep a reference to this.
So in this approach there is not a "capturing of all lexicals" but simply remembering one data-structure regardless of how many variables were defined it.
Perl evidently does this differently and I even think that the inaccessabilty of certain lexial variables of which Perl could not see that the are going to be used in a closure is a weakness.
I will try this in Rakudo.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Accessing lexicals in other scopes dynamically by name
by ikegami (Patriarch) on Jul 30, 2010 at 22:20 UTC | |
by morgon (Priest) on Jul 30, 2010 at 22:37 UTC | |
by ikegami (Patriarch) on Jul 31, 2010 at 00:15 UTC | |
by morgon (Priest) on Jul 31, 2010 at 15:22 UTC | |
by ikegami (Patriarch) on Jul 31, 2010 at 18:49 UTC | |
|