From: "Thomas A. Schmitz" <thomas.schmitz@uni-bonn.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: system macros/doquadrupleemtpy
Date: Thu, 4 Sep 2008 10:21:52 +0200 [thread overview]
Message-ID: <9618C0E2-4432-4724-89B9-810831ED5DB3@uni-bonn.de> (raw)
In-Reply-To: <115224fb0809032345u4c29ccf2o5b8f76df7d3535d7@mail.gmail.com>
On Sep 4, 2008, at 8:45 AM, Wolfgang Schuster wrote:
> \def\Commanda
> {\doquadrupleempty\doCommanda}
>
> \def\doCommanda[#1][#2][#3][#4]%
> {\iffourthargument
> \def\next{\doCommandafive[#1][#2][#3][#4]}%
> \else
> \def\next{\doCommandafour[#1][#2][#3]}%
> \fi\next}
>
> \def\doCommandafive[#1][#2][#3][#4]#5%
> {five arguments}
>
> \def\doCommandafour[#1][#2][#3]#4%
> {four arguments}
>
>
> \def\Commandb
> {\doquadrupleempty\doCommandb}
>
> \def\doCommandb[#1][#2][#3][#4]%
> {\iffourthargument
> \def\next{\dodoCommandb[#1][#2][#3][#4]}%
> \else
> \def\next{\dodoCommandb[#1][#2][#3][]}%
> \fi\next}
>
> \def\dodoCommandb[#1][#2][#3][#4]#5%
> {\doifelsenothing{#4}
> {four arguments}
> {five arguments}}
>
> \starttext
>
> \Commanda[1][2][3][4]{5}
>
> \Commanda[1][2][3]{4}
>
> \Commandb[1][2][3][4]{5}
>
> \Commandb[1][2][3]4
>
> \Commandb[1][2][3][]{4} % feature
>
> \stoptext
>
> Wolfgang
YES! That's the end of my suffering!! Thanks a lot, Wolfgang, you're
my hero. Makes sense, too, now that I look at it. Now I'm gonna find
out what \next does...
Thanks!
Thomas
___________________________________________________________________________________
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://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
prev parent reply other threads:[~2008-09-04 8:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 14:41 Thomas A. Schmitz
2008-09-03 16:58 ` Aditya Mahajan
2008-09-04 7:39 ` Thomas A. Schmitz
2008-09-03 18:32 ` Peter Rolf
2008-09-04 6:45 ` Wolfgang Schuster
2008-09-04 8:21 ` Thomas A. Schmitz [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9618C0E2-4432-4724-89B9-810831ED5DB3@uni-bonn.de \
--to=thomas.schmitz@uni-bonn.de \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).