Benjamin Stuhl <[EMAIL PROTECTED]> writes:
>I have one question about vtbls that I have not been able
>to figure out an answer to:
>
>  How does using a vtbl get rid of the switch(sv->sv_flags)
>with multi-valued scalars running around? That is, how does
>one write a vtbl function that can cope with the perl6
>equivalent of perl5's
>
>   sv_setiv(sv, 42);
>   sv_setpv(sv, 
>     "The answer to Life, the Universe, and Everything");
>   SvIOK_on(sv);

More or less the same way you do in perl5 

    - upgrade the sv to a dual-var type
    - call the var's set_integer entry
    - call the var's set_string entry

Then when you want the string form call the vars get_string
it has to check private internal flags I guess - the point is that 
even in perl these weird variables are rare. We have removed flag 
testing for the common cases and only have it where required. 

>
>?
>
>-- BKS
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! Mail - Free email you can access from anywhere!
>http://mail.yahoo.com/
-- 
Nick Ing-Simmons

Reply via email to