At 11:32 AM 8/23/00 -0700, Larry Wall wrote:
>Tom Christiansen writes:
>: >2) The ability to dump out a variable and all its attached state into
>: >something that can be loaded in later somewhere else.
>:
>: To hope to do this completely and correctly is courageous.
>:
>:     my @funx = ();
>:     for my $name (qw/violet purple cream/) {
>:       push @funx, sub {
>:           print "I'll take a $name one, please, with @_.\n";
>:       };
>:     }
>:
>:     dump \@funx;
>:
>: Closures will be challenging. :-)
>
>Well, scratch it hard enough and you'll see that we're just discussing
>persistent continuations.

Yup. And, since the bytecode's going to have to have ways to list 
variables, variable initializations, and lexical scope creation anyway, 
it's not that big a deal. Dumping closures is actually relatively easy, 
since they're mostly self-contained. (Assuming, of course, you ignore the 
whole package variable and package subroutines thing... :)

AUTOLOAD for methods and symbolic refs are by far a bigger issue for a 
comprehensive "Dump just what this object needs" thing.

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to