perl-unicode

Re: Unicode aware module

1999-04-23 16:56:19
On Fri, Apr 23, 1999 at 02:00:10PM -0500, Graham Barr wrote:
On Fri, Apr 23, 1999 at 11:44:17AM -0700, Gurusamy Sarathy wrote:
On Fri, 23 Apr 1999 11:30:27 PDT, Dick Hardt wrote:
Oh.... Hmmm....  So Graham's point about wanting to know the context of the
caller is important then.

For example, the Win32::* modules can be updated so that depending on
whether utf8 was set or not, W or A calls to the OS would be made. To do
this, the subs will need to know the context of the caller.

wantutf8() should be easy to write as an XSUB.  Here's an untested version:

It seems a shame to put something done at runtime between two things
which are determined at compile time. (ie the wrapper sub I posted)

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.

Tim.

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