Hey all. 

I'm working on implementing the ord(i,s) and chr(s,i) opcodes I talked about
earlier, and I noticed what I consider a bug: there exist no transcode
functions to or from native.  

Also, the diagonals (identy transforms) don't exist.  This means that you
have to explicitly check that you aren't transcoding from an encoding to the
same encoding.

You can't do this:
Parrot_transcode_table->[from->encoding->transcode][to_enc](from, to);
You have to do this:
if (from->encoding != to_enc) {
   Parrot_transcode_table->[from->encoding->transcode][to_enc](from, to);

This seems like an easy error, and like it'd create more compact code.
(It'd also lower efficency slightly, by having more lookups and a function
call every time, rather then only on non-identy transforms.

(The second isn't neccesarly a bug, the first is.)

     -=- James Mastros

BTW, I finished chr(s,i), and made a test.  I havn't gotten ord(i,s)
working, because I ran across the lack of a transcode_native_to_utf32.

Reply via email to