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

Re: Key stuff for aggregates

Thread Previous | Thread Next
From:
Benjamin Stuhl
Date:
December 5, 2001 12:10
Subject:
Re: Key stuff for aggregates
Message ID:
20011205201010.62074.qmail@web14509.mail.yahoo.com
--- Dan Sugalski <dan@sidhe.org> wrote:
> At 10:28 AM 12/5/2001 -0500, Jason Gloudon wrote:
> >Using the aggregate's vtable is another way of getting
> the job done that 
> >avoids all the extra reference PMCs. However, references
> will have to be 
> >supported.
> 
> References are interesting. I'm currently thinking that:
> 
> *) PMCs should have a get_reference vtable entry
> *) Accessing a reference should be just like accessing
> the referent. (i.e. 
> you pass in the same key stuff and the reference vtable
> does the indirect 
> lookup for you)
> *) Some references will need to be 'smart', so if you do:
> 
>     $foo = \@bar[4];
> 
> and @bar's a packed array, $foo's actually a fancy ref
> that knows it points 
> to @bar[4] and calls @bar's vtables when you access it.
> Or something like that.

This looks interesting, as far as it goes, but how will
parrot support the perl5ish 

use overload 
   '@{}' => \&deref_as_array,
   '%{}' => \&deref_as_hash;

? Do we pass in the PMC type that we want it to come back
as? But then how do we tell between the various types of
e.g. arrays. (To put it simply, how do you say "I want an
arry. No, I don't _care_ if it's a PerlPMCArray or a
PerlIntArray or a PerlWhatHaveYouArray!" ?)

-- BKS

__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About