I think the second definition of \char_set_mathcode:nn should
be a global one: \char_gset_mathcode:nn

Ciao
Andreas


--- l3token.dtx.orig    2007-05-09 15:46:41.000000000 +0200
+++ l3token.dtx 2007-05-11 18:26:38.000000000 +0200
@@ -807,7 +807,7 @@
   \char_set_mathcode:w #1 = \int_eval:n{#2}
 }
 \def_protected_new:Npn \char_gset_mathcode:w {\pref_global:D\tex_mathcode:D}
-\def_new:Npn \char_set_mathcode:nn #1#2{
+\def_new:Npn \char_gset_mathcode:nn #1#2{
   \char_gset_mathcode:w #1 = \int_eval:n{#2}
 }
 \def_new:Npn \char_value_mathcode:w {\int_use:N\tex_mathcode:D}