Am 10.01.25 um 19:45 schrieb Hans Hagen:
\tolerant\def\MyMacro[#1]#:#2%
   {\ifparameter#1\or
      (#1)
    \fi
    /#2/}

\MyMacro[one]{two}

\MyMacro{two}

Oops, another variant that I didn’t know.
I must unlearn my remaining MkII stuff…

When should I use brackets or other characters in a definition, when not?
optionals normally have []

Yes, of course, but I’m often surprised by funny characters like #:

Which docs should I read?

how about lowlevel-macros .. but haven't you read all of them by now ?

Apparently not diligently enough.
If at all. Can’t remember any more.

I’m not competent enough to rewrite e.g.
https://wiki.contextgarden.net/System_Macros/Handling_Arguments

Sigh.

HR
___________________________________________________________________________________
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