<html><head></head><body><div style="font-family:courier new, courier, monaco, monospace, sans-serif;font-size:medium;"><div>Hello,</div><div><br></div><div>I have studied a bit the source code of XeTeX and luaTeX. XeTex defines</div><div>a procedure that is used to insert primitive commands into a hash table.</div><div>The procedure;s declaration is as follows:</div><div><br></div><div>procedure primitive(@!s:str_number;@!c:quarterword;@!o:halfword);</div><div><br></div><div>This is not exactly Pascal but I think one understands what is going on.</div><div>Now luaTeX inserts the TeX primitives with the following command</div><div><br></div><div>#  define primitive_tex(a,b,c,d)    primitive((a),(b),(c),(d),tex_command)</div><div><br></div><div>where function primitive is declared as follows:</div><div><br></div><div>extern void primitive(const char *ss, quarterword c, halfword o, halfword off,<br><div>                      int cmd_origin);</div><div><br></div><div>XeTeX uses catcodes to compare commands, while luaTeX has special command codes</div><div>which are different from catcodes. I think this approach is better. However, it</div><div>is my understanding that the problem that started this thread cannot be solved </div><div>trivially.</div><div><br></div><div>A.S.<br></div><div><br></div></div>----------------------<br>Apostolos Syropoulos<br>Xanthi, Greece<br><br><br><br><br><br><br><br> </div></body></html>