Hi,

What is the right way to define a command with both mandatory and
optional arguments, e.g:

\MyCommand[optional][mandatory]

Consider the following MWE:

\unexpanded\def\MyCommand[#1]{
  \dosingleempty{\doMyCommand[#1]}}
\def\doMyCommand[#1][#2]{
  \doifsomething{#1}{number 1: #1\par}
  \doifsomething{#2}{number 2: #2}\blank[big]}
\starttext
\MyCommand[A][B]
\MyCommand[A]
\stoptext

In last year's versions of ConTeXt the output was

number 1: A
number 2: B
number 1: A

In the latest version of ConTeXt the output is

number 1: A
number 2: B
number 2: A

Is this behavior intended? How can I make a definition whose behavior
does not change in new versions of ConTeXt?

Cheers,

Christoph
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to