What's the difference between \dodoubleargument and \dodoubleempty?
Ruini Xue wrote:
It's difficult to understand them from the code.
the first one issues a warning when no argument is given ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
Hans Hagen
Ruini Xue wrote:
It's difficult to understand them from the code.
the first one issues a warning when no argument is given
You mean both of them ask the following \command to take two mandatory arguments? I try this example: ====================================== \def\test {\dodoubleargument\dotest} % use \dodoubleempty \def\dotest[#1][#2] {\iffirstargument First arg: #1 \fi \ifsecondargument Second arg: #2 \fi} \test[ok][ok] % 1. this is ok \test [ok] [] % 2. warning? \test [wrong] % 3. Error: lack one arg ================================== both 1 and 2 can print "First arg" and "Second arg", so I am confused what's "no argument is given" -- ruini
On Tue, Oct 21, 2008 at 2:03 PM, Ruini Xue
Hans Hagen
writes: Ruini Xue wrote:
It's difficult to understand them from the code.
the first one issues a warning when no argument is given
You mean both of them ask the following \command to take two mandatory arguments? I try this example:
====================================== \def\test {\dodoubleargument\dotest} % use \dodoubleempty
\def\dotest[#1][#2]
You need a comment sign at the end of the line. \def\dotest[#1][#2]%
{\iffirstargument First arg: #1 \fi \ifsecondargument Second arg: #2 \fi}
\test[ok][ok] % 1. this is ok
\test [ok] [] % 2. warning?
This is just a empty argument.
\test [wrong] % 3. Error: lack one arg ==================================
both 1 and 2 can print "First arg" and "Second arg", so I am confused what's "no argument is given"
Wolfgang
Ruini Xue wrote:
Hans Hagen
writes: It's difficult to understand them from the code.
Ruini Xue wrote: the first one issues a warning when no argument is given
You mean both of them ask the following \command to take two mandatory arguments? I try this example:
we use optimized variants for #args <=3 but the error messags still shows up for \doquadrupleargument\relax \doquadrupleargument\relax[1] \doquadrupleargument\relax[1][2] \doquadrupleempty\relax \doquadrupleempty\relax[1] \doquadrupleempty\relax[1][2] ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (3)
-
Hans Hagen
-
Ruini Xue
-
Wolfgang Schuster