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

RE: String comparison ops

Thread Previous | Thread Next
From:
Gibbs Tanton - tgibbs
Date:
October 10, 2001 06:06
Subject:
RE: String comparison ops
Message ID:
ABEE81BE08ADD311B6A1009027DE908D09E95930@conmsx03.conway.acxiom.com
>What about making an store_transcode( string, encodingtype ) function
>which
>takes a string, and stores the encodingtype version in it. Strings would
>then be able to store multiple versions of themselves, in utf32, utf8,
>etc
>format. The original format would still be remembered as the 'main'
>format,
>of course, for all printing and so on. But for internal parrot string
>ops,
>one could use these alternate representations to avoid re-transcoding
>strings.

I had thought of this as well in order to reduce the number of conversions
needed.  However, parrot really doesn't know if 1 or 100 comparsions with
unicode strings will be needed.  Therefore, I thought it might be better if
the Perl compiler did that optimization and created two string variables,
one for the string native and one for the string unicode.  Naturally, it
would only have to create one string if it was only ever used one way, but
either way it would be responsible for handling optimizations due to
encoding difficulties.

Tanton

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