We might want to have a member/method by which we can tell what type of 
variable we're dealing with, so that a function can be passed an arbitrary 
XV, and treat it differently if it's an SV, AV, and so on.

For SVs, we might want to have a method to determine what form of 
representation the internal data is in: string, int, double, bigint, 
reference, and so on.

For HVs, how are the keys going to be hashed?  Should the SV vtable have:

    int HASH_CODE();

Or will the HV just hash off of the string representation of the SV?

On Monday 29 January 2001 19:43, Filipe Brandenburger wrote:

>         // convert value
>         char   *STRING();           // "$this"
>         int     NUMBER();           // 0+$this
>         double  DOUBLE();           // 0.0+$this
>         int     BOOLEAN();          // $this ? $a : $b

Should there be method to tell an SV to change the internal representation of 
the data?  For example, if an SV was created as a string, but is being turned 
into a float over and over again for use in equations, it would save 
processing time to convert the internal representation to a float.  Or would 
the SV take care of stuff like that transparently?

> I also neglected references. I _think_ there should be entries like
>     SV *DEREF_SCALAR();
>     AV *DEREF_ARRAY();
>     HV *DEREF_HASH();

Brainstormed, probably useless idea: for all vtables, have a

     SV *GET_REF();

which would return a reference to the XV; this way extensions could handle 
dereferencing to their data types in weird, special ways.

-- 
Matthew Cline        | Suppose you were an idiot.  And suppose that
[EMAIL PROTECTED] | you were a member of Congress.  But I repeat
                     | myself.  -- Mark Twain

Reply via email to