>>>>> "Simon" == Simon Cozens <[EMAIL PROTECTED]> writes:

Simon> Randal L. Schwartz:
>> That's what I expect code2text to do.  Dump the coderef so that I can
>> restore it.  And for closures, it must dump the state of the closure
>> variables.

Simon> There isn't a "current state".

Saying there isn't one doesn't make that true.  At the time
I can possibly execute coderef2text, there *is* a current state.
Deny that.

Listen, here's the problem I want to solve, and I can't solve yet:

  I want to be able to marshall arbitrary object $x.  It may contain
  coderefs.  I want to get a serialization of the object that I can write
  to disk, then read later, and as far as I can tell, the new object responds
  in every way the same as $x.

coderef2text when hooked into Data::Dumper will do it, *as long as there
are no closures*.  When a closure gets involved (a coderef that has
captured external lexical context), coderef2text DOES NOT WORK.

Clear now?

coderef2text does not dump closures.  I wish it would.  It appears to
be a hard problem.  I hope it's not an impossible problem.  The python
boys have certainly figured it out for python.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to