develooper Front page | perl.perl6.internals | Postings from February 2001

lazy || and vtables

David Mitchell
February 21, 2001 08:15
lazy || and vtables
Message ID:
Following up from a thread a couple of weeks ago,

Dan wrote:
> > Dave wrote:
> >Hmmm, I can't quite how that trick works. How whould the following get
> >evaluated:
> >
> >$opened || open(F, ...)
> The second PMC would point to a lazy list, so it wouldn't be evaluated 
> unless its value gets fetched.

Do you have any more details how this 'lazy list' would work?
The only way I can think is to have an 'execution' vtable type,
which initially holds a pointer to a CV or an area of bytecode or somat,
but when asked for it's value, executes itself and morphs into the result
of the expression. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About