> Ok, I can understand that.  But, what happens when we get to UTF16?  Aren't
> we talking about 256k per tr///, then?  That seems like a lot of memory
> that is potentially wasted and could lead to some really large footprints.

I don't understand what this discussion has to do with this mailing
list, and I don't understand what your point is.  tr/// has already
been implemented.  It uses a 256-byte table.  tr/// has already been
extended to UTF8 strings, and it takes a certain amount of memory.
Perhaps that amount is 256K, perhaps not.  If it is, what does that
have to do with us here? 

If this discussion should go on anywhere, it should be on the
perl6-internals list.  If you want to register an opinion that 256K
bytes is too expensive, you should do that on perl6-internals.  It is
up to them to figure out if the current implementation is wasteful of
memory and to devise a new implementation if so.

For the record, the UTF8 version of tr/// does not use a plain 256K
table.  It uses a data strcuture called a 'swash'; this is also the
data structure that is used by the UTF8 versions of 'uc' etc., the
\p{...} regex escapes, and the others.  The swash is based on a hash,
and the code is in utf8.c.


Reply via email to