David Mitchell <[EMAIL PROTECTED]> writes:
>Has anyone given thought to how an SV can contain both a numeric value
>and string value in Perl6?
>Given the arbitrary number of numeric and string types that the vatble
>scheme of Perl6 support it will be unviable to to have special types
>for all permuations (eg, utf8_nv, unicode32_iv, ascii_bitint, ad nauseum).
>
>It seems to me the following options are poossible:
>
>1. We no longer save conversions, so
> $i="3"; $j+=$i for (...);
>does an aton() or similar each time round the loop
Well just the 1st time - then it is a number...
>
>2. Each SV has 2 vtable pointers - one for it's numeric representation
>(if any), and one for its string represenation (if any). Flexible, but
>may require an extra 4/8 bytes per SV.
This is my favourite.
>
>3. We decree that all string to numeric conversions should return
>a particular numeric type (eg NV), and that all numeric to string
>conversions should similary convert to a fixed string type (eg utf8).
>(Although I'm not sure that really helps.)
I can't see how that helps.
--
Nick Ing-Simmons <[EMAIL PROTECTED]>
Via, but not speaking for: Texas Instruments Ltd.