I simply don't get it. The more examples I see, the less clue I have
about (un)expansion. Well, I'm not sure if this one is connected with
it as well, but I'm stummied again.
\defineconversion[abc][a,b,c,d]
\def\tn{2}
\startMPextensions
tn := \tn;
\stopMPextensions
\startTeXtexts
\doloop{\doifelseconversionnumber{abc}{\recurselevel}
{\TeXtext{\numexpr\recurselevel\relax}{{\convertnumber{abc}{\recurselevel}}}}
{\startMPextensions % this is never seen by metapost
tn := \recurselevel;
\stopMPextensions
\exitloop}}
\stopTeXtexts
\starttext
\startMPcode
draw sometxt(tn-1);
\stopMPcode
\stoptext
Metapost needs to know the number of symbols, so that it can calculate
the proper symbol modulo that number.
Thanks for any hints,
Mojca