At 07:02 PM 12/7/00 +0000, Simon Cozens wrote:
>On Wed, Dec 06, 2000 at 03:11:33PM -0500, Dan Sugalski wrote:
> > >I'm in favour of the exact opposite: an AV is "just" an SV-alike vtable
> > >with array methods instead of scalar methods and a pointer to some
> > >storage, (probably an array of SVs) and likewise an HV. That would allow
> > >(array->length)() which seems to be what you want above.
> >
> > Currently the only difference between accessing an AV's member's value, an
> > HV's member's value, or an SV's value is an extra argument to the 
> vtable call.
>
>I wasn't thinking about accessing values, (which obviously should be as you
>say) but things like methods to implement $#array, keys %hash, and so on.

Well, I've had evil ideas that $#array would look like:

   array->get_int[IV](SCALAR);

or

   array->set_int[IV](12);

depending on whether it's used in an rvalue or lvalue context. Seems 
sensible to use the scalar versions of the vtable calls if the AV's used in 
scalar context.

Things like keys and each on hashes would likely need extra vtable entries, 
but that's fine. (I can see crocking the get_* entries for keys and each, 
but there are limits... :)

                                        Dan

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

Reply via email to