perl-unicode

Re: Unicode aware module

1999-04-26 08:06:42
Tim Bunce <Tim(_dot_)Bunce(_at_)ig(_dot_)co(_dot_)uk> writes:

I wonder if it would be possible to tell the compiler that there
are multiple implementations of a sub and have it pick the right
one. Sort of like what Dick described.

I have not thought this out, but maybe

sub abc : utf8 {
}

sub abc : ascii {
}

sub abc {
}

could be allowed such that the utf8 sub is only called when utf8 is in
effect, the ascii (or byte whatever) is called when we are in that mode
(which currently is when we are not in utf8 mode) and the last would be
called for any other utf8-like pragma, say if we had utf16 in effect.

Whoa! I think this whole thread is going off in the wrong direction.

Whether an _individual_ argument string contains utf8, utf16, ascii or
a gif has nothing to do with the lexical context of the sub that called
you.

The context of the caller is a very unreliable hint at best.
 
Well said.  (e.g. callbacks should be called in context of sub that registered
them not the context of the event loop.)

If we really need this kind of thing then perhaps we need a local-izable
magic variable. And a "maybe" to go with use/no

maybe utf8;



Tim.
-- 
Nick Ing-Simmons <nik(_at_)tiuk(_dot_)ti(_dot_)com>
Via, but not speaking for: Texas Instruments Ltd.

<Prev in Thread] Current Thread [Next in Thread>