From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/91802 Path: news.gmane.org!not-for-mail From: Zhichu Chen Newsgroups: gmane.comp.tex.context Subject: Re: conTeXt Mkiv: the number of parameters can not be more than 9? Date: Sun, 5 Jul 2015 11:40:47 +0800 Message-ID: <5598A73F.2030504@sinap.ac.cn> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2047716547==" X-Trace: ger.gmane.org 1436067894 10483 80.91.229.3 (5 Jul 2015 03:44:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 5 Jul 2015 03:44:54 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 05 05:44:42 2015 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZBarB-000456-If for gctc-ntg-context-518@m.gmane.org; Sun, 05 Jul 2015 05:44:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6A27210253 for ; Sun, 5 Jul 2015 05:44:40 +0200 (CEST) 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 TpEk140XR7m0 for ; Sun, 5 Jul 2015 05:44:39 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 2ADA11025D for ; Sun, 5 Jul 2015 05:44:11 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 254B010217 for ; Sun, 5 Jul 2015 05:44:06 +0200 (CEST) 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 KTlOzgJDPsWV for ; Sun, 5 Jul 2015 05:44:03 +0200 (CEST) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id CD7EF10212 for ; Sun, 5 Jul 2015 05:44:02 +0200 (CEST) Original-Received: from sinapcas01.sinap.ac.cn (sinapcas01.sinap.ac.cn [210.72.8.15]) by filter3-utr.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t653ht0C025246 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Sun, 5 Jul 2015 05:43:58 +0200 Original-Received: from [192.168.1.134] (180.162.52.114) by sinapcas01.sinap.ac.cn (210.72.8.5) with Microsoft SMTP Server id 14.1.438.0; Sun, 5 Jul 2015 11:43:47 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-Originating-IP: [180.162.52.114] X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=210.72.8.15; country=CN; region=Beijing Shi; city=Beijing; latitude=39.9289; longitude=116.3883; http://maps.google.com/maps?q=39.9289,116.3883&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08OMrHVhm - 2a98f290f727 - 20150705 (trained as not-spam) Received-SPF: pass (filter3-utr.mf.surf.net: domain of chenzhichu@sinap.ac.cn designates 210.72.8.15 as permitted sender) receiver=filter3-utr.mf.surf.net; client-ip=210.72.8.15; envelope-from=; helo=sinapcas01.sinap.ac.cn; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:91802 Archived-At: --===============2047716547== Content-Type: multipart/alternative; boundary="------------090704080604090408020801" --------------090704080604090408020801 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Hi Dillon, First of all, I'm against defining such a complex macro, since that can=20 be very confusing when you use it. I personal prefer the key-value definition: \def\DEFINETEST[#1]{% \getXXXparameters [paraA=3DdefaultValueForParameterA% ,paraB=3D% or just empty ,#1]% \doSomethingWith[\XXXparameter\paraA]% \doSomethingElse... } You might want to refer to the following link and other valuable=20 materials on the wiki for more information: http://wiki.contextgarden.net/System_Macros/Key_Value_Assignments If you insist on that, I guess you can define a temporary macro inside=20 your macro. That's very dirty, but can be a little more efficient? I'm not sure. I was given to understand that the ConTeXt MKVI now accepts parameters=20 such as #position#color rather than meaningless #1#2. I GUESS that's lua-based,=20 so maybe it'll break the TeX limitation. On 07/05/2015 09:55 AM, =E5=9C=9F=E5=8D=9C=E7=9A=BF wrote: > > hi, all > > For testing, I have a definition: > > |\define[9]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9}| > > |context test| can work fine, when I modify the above into: > > |\define[10]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9,#10}| > > I got a error: > > |test.tex: ! Illegal parameter number in definition of\DEFINETEST| > > From StackExchange, I got a answer: > > Since ConTeXt is based on TeX, the maximum number of 9 parameters is=20 > inherited > > So, in Context mkiv, what should I do for more than 9 parameters? > > Thanks! > > Best Regards > > Dillon > > > > _______________________________________________________________________= ____________ > 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 : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > _______________________________________________________________________= ____________ --=20 Best regards, =E2=84=A4h=F0=9D=95=9Achu =E2=84=82h=F0=9D=95=96n --------------090704080604090408020801 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
Hi Dillon,

First of all, I'm against defining such a complex macro, since that can be very
confusing when you use it. I personal prefer the key-value definition:
\def\DEFINETEST[#1]{%
=C2=A0 \getXXXparameters
=C2=A0=C2=A0=C2=A0 [paraA=3DdefaultValueForParameterA%
=C2=A0=C2=A0=C2=A0 ,paraB=3D% or just empty
=C2=A0=C2=A0=C2=A0 ,#1]%
=C2=A0 \doSomethingWith[\XXXparameter\paraA]%
=C2=A0 \doSomethingElse...
}
You might want to refer to the following link and other valuable materials on the
wiki for more information:
http://wiki.contextgarden.net/Syst= em_Macros/Key_Value_Assignments

If you insist on that, I guess you can define a temporary macro inside your macro.
That's very dirty, but can be a little more efficient? I'm not sure.

I was given to understand that the ConTeXt MKVI now accepts parameters such as
#position#color rather than meaningless #1#2. I GUESS that's lua-based, so maybe
it'll break the TeX limitation.

On 07/05/2015 09:55 AM, =E5=9C=9F=E5=8D=9C=E7=9A=BF wrote:

hi, all

For testing, I have a definition:

\def=
ine[9]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9}

context test=C2=A0can work fine, when I modify the above into:

\def=
ine[10]\DEFINETEST{#1,#2,#3,#4,#5,#6,#7,#8,#9,#10=
}

I got a error:

test.tex=
: ! Illegal parameter number in definition of \DEFINETEST

From StackExchange, I got a answer:

Since ConTeXt is based on TeX, the maximum number of 9 parameters is inherited

So, in Context mkiv, what should I do for more than 9 parameters?

Thanks!

Best Regards

Dillon



______________________________________________________=
_____________________________
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/mailm=
an/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________=
________


--=20
Best regards,
=E2=84=A4h=F0=9D=95=9Achu =E2=84=82h=F0=9D=95=96n
--------------090704080604090408020801-- --===============2047716547== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============2047716547==--