On Fri, Sep 21, 2001 at 11:53:33AM -0400, Guido van Rossum wrote:
> Should we really be discussing encodings this early in the game?
> Shouldn't that be a detail that is none of the engine's business (but
> belongs to the individual data type implementations)?

>From Parrot's point of view, encodings abstracted so that the interpreter
proper doesn't need to care about them. If you use a STRING* object
(it's essentially an object, even though it's just a C struct) and pass
it to one of the string handling functions in the string API, those
string handling functions will despatch the task to the appropriate function
for the STRING's encoding. That's to say, if I want to get the length of
the string in characters, I call string_length(STRING* foo) which looks
at foo's encoding and calls the appropriate length-getting function for
that encoding.

So while the interpreter doesn't have to care about string encodings, at
some point this has to bottom out and you have to get down and implement
encoding-aware functions.

-- 
>Almost any animal is capable learning a stimulus/response association,
>given enough repetition.
Experimental observation suggests that this isn't true if double-clicking
is involved. - Lionel, Malcolm Ray, asr.

Reply via email to