On 8/8/2025 9:17 PM, user691586 via ntg-context wrote:
Thanks for the detailed explanations.


in the exmaple i showed, changing the amcode will make it unprotected
but i assume you checked that already

Yes, setting the amcode to zero (in a local context -sic) solved my problem.
Which is why I asked if that was considered a stable feature of context.

amcodes were introduced as replacement for the special math class (active) when we redid that part of the math engine so it has been there for quite a while now

and indeed, unprotected control sequences are not implemented as in etex
(or luatex or ...) but are real commands, so no magic macro body
prefixing (idem for \tolerant and some combinations)

from the various documentation you can deduce that luametatex has a more
extensive and granular way of dealing with these matters (some come at a
cost in performance but that is gained back on optimizations elsehere)

I am beginning to realize the differences with my routine past life are much
more extensive I would have expected.

there's plenty of subtle new stuff to discover then

also keep in mind that when overload protection is enabled you can't
even redefine ~ as it's a \permanent one in context

Good to know, thanks.
This would break the usage I had in mind, but I can take this as fact of
life.  The real life is nothing fancy,
but the sole natively active character in TeX in ascii range 32-127
being the ~ , it presented itself readily for some matters, and I was
aiming at re-using code as is in context.

in what sense natively .. all characters can be active and i bet that in plain (and maybe also latex) the quite (') is active in math

in context | is actuallly active

side note:

- in mkii (pdftex,xetex) we use what we call catcode regimes, and these vectors have plugins for active characters (think for instance interpreting xml)

- in mkiv we use catcode tables (which are an engine feature brought in at the start modelled after what context mkii liked) and again we provide some plugin mechanism in context (mkii -> mkiv transition)

- in mkxl (lmtx) we of course keep catcode tables, added some subtle catcode related features here and there in the engine and then dropped the plugin at the macro package end because no one used that anyway (we only used it internally for distinguishing text and math but that was no longer needed)

a lot in luametatex / lmtx is about cleener coding and less hacks (so as side effect there is less to show-off for a macro programmer)

Hans




-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to