From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/56582 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Macro with variable number of arguments Date: Sun, 28 Feb 2010 12:44:17 +0100 Message-ID: <00A159C2-A323-447C-98F9-6B4FE7094E15@gmail.com> References: <4C6F69ED-2E35-4260-B2FE-125D1EF31611@gmail.com> <4B8A349B.6040906@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1267357483 22735 80.91.229.12 (28 Feb 2010 11:44:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Feb 2010 11:44:43 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Feb 28 12:44:29 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from [195.12.62.10] (helo=balder.ntg.nl) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NlhZT-0003ck-Gr for gctc-ntg-context-518@m.gmane.org; Sun, 28 Feb 2010 12:44:27 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5A8C3C9D61; Sun, 28 Feb 2010 12:44:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id kmE4-8gUIp9e; Sun, 28 Feb 2010 12:44:27 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7FE0DC9D62; Sun, 28 Feb 2010 12:44:24 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C06E7C9D62 for ; Sun, 28 Feb 2010 12:44:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ym6Vz6l9FrEu for ; Sun, 28 Feb 2010 12:44:20 +0100 (CET) Original-Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.144]) by balder.ntg.nl (Postfix) with ESMTP id 8FC17C9D61 for ; Sun, 28 Feb 2010 12:44:20 +0100 (CET) Original-Received: by ey-out-1920.google.com with SMTP id 13so380549eye.6 for ; Sun, 28 Feb 2010 03:44:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:mime-version :subject:from:in-reply-to:date:content-transfer-encoding:message-id :references:to:x-mailer; bh=z726Mlp64miA+cJyiGSVFfeFyW4/JbzsmFVjVkHYsZQ=; b=Hho6B+INY4wh78RMYnPNYsJ2tLcK7vc4GAUgb0OWhndy6oQh6+K9xF6lpnyLGXkiq6 nLJ7z5CJY2/imBxcPu3TP8qnaelf7jfthADapPNxlnQKyrSVp9i9yXWWPVW6KV3egGgt g638VuqnjDCOmEuhjoia0+Azg8EDnPVi8SLIE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=kYkK/JccUQGrRiE5lLGBW9bRiOVg3eNsfJwHPfaM62WV1w17DgShz0V5QHNQWIZc+9 53Y1yajieuFWAOekCwpItcYDdr9N9XwMugsnY79+H9xia1fF7QfDhFT+SftrIIIj2D72 8eykNaQAKLBP+fp+l7N1AAeBcsQNChp0rdzck= Original-Received: by 10.213.52.6 with SMTP id f6mr1827007ebg.70.1267357460009; Sun, 28 Feb 2010 03:44:20 -0800 (PST) Original-Received: from ?192.168.0.11? (mna75-3-82-66-231-76.fbx.proxad.net [82.66.231.76]) by mx.google.com with ESMTPS id 28sm6897547eye.29.2010.02.28.03.44.18 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Feb 2010 03:44:19 -0800 (PST) In-Reply-To: <4B8A349B.6040906@googlemail.com> X-Mailer: Apple Mail (2.1077) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:56582 Archived-At: On 28 f=E9vr. 2010, at 10:17, Wolfgang Schuster wrote: > \def\myMacro > {\dotriplegroupempty\domyMacro} > = > \def\domyMacro#1#2#3% > {\doifelsenothing{#3} > {Name: #1\crlf Email: #2\crlf} > {Name: #1\crlf Address: #2 \crlf Email: #3\crlf}% > \thinrule\blank[small]} > = > Wolfgang Many thanks Wolfgang! Your solution solves my question. Now for a complete understanding of the solution (and before putting your s= olution on the wiki), here is another question. After reading your solution, I searched in the source files and saw that in= the file syst-gen.mkii the command \dosinglegroupempty, until \doquintuplegroupempty are defined. For instance \def\dotriplegroupempty#1% {\def\dodogetargument##1% {\def\dodogetargument####1% {\def\dodogetargument% {\dontpermitspacesbetweengroups #1{##1}{####1}}% \dogetgroupargument\thirdargumenttrue\thirdargumentfalse}% \dogetgroupargument\secondargumenttrue\secondargumentfalse}% \dogetgroupargument\firstargumenttrue\firstargumentfalse} Can one use other constructions like these, for example can one define \dosepttuplegroupempty = in order to have macros with 7 arguments, of which 5 are always present, wh= ile the sixth and seventh may be absent in some occasions? Thanks again: OK ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________