Luke Palmer <[EMAIL PROTECTED]> writes:
> Oh no! Someone doesn't understand continuations! How could this
> happen?! :-)
Yes, well, I've only just started reading up on them recently...
> A continuation doesn't save data. It's just a closure that closes
> over the execution stack
Ah. That helps a lot. For some reason, I hadn't realize that yet
from reading about them in Dybvig.
>> You could make the programmer specify which variables he wants delta
>> data for, and then any *others* wouldn't keep it and wouldn't be
>> undoable.
>>
> A much more useful way to do this would be:
>
> use undo << $foo $bar $baz >>;
> my $foo = 41;
> my $state = undo.save;
> $foo++; $foo.undo($state); # or perhaps $state.remember;
That seems reasonable to me.
> I don't want to think about what happens when you write:
>
> use undo << $state >>;
Something terribly inefficient, I suppose. There could be a warning
in the documentation about that.
Or something could try to be clever and detect this sort of thing; I'm
not entirely certain whether that's equivalent to the halting problem,
but either way it sounds like all kinds of excitement, or something.
--
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"[EMAIL PROTECTED]/ --";$\=$ ;-> ();print$/