From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/67919 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Macro argument handling problem! Date: Thu, 21 Apr 2011 13:41:55 +0200 Message-ID: <53BEC192-B178-43FB-9B08-DF3305027213@googlemail.com> References: <4DB006DD.9090605@ziggo.nl> <8C4141FF-A2DD-4EFB-B508-9E8A72975503@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1303386133 14813 80.91.229.12 (21 Apr 2011 11:42:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Apr 2011 11:42:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 21 13:42:09 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QCsGt-0003Ud-F6 for gctc-ntg-context-518@m.gmane.org; Thu, 21 Apr 2011 13:42:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C6524CABFE; Thu, 21 Apr 2011 13:42: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 TvWivEXLoRfy; Thu, 21 Apr 2011 13:42:03 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2A5C4CABD9; Thu, 21 Apr 2011 13:42:03 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 99D82CABD9 for ; Thu, 21 Apr 2011 13:42:01 +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 ZWOhU1LeKpXX for ; Thu, 21 Apr 2011 13:41:59 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id B64E3CABD2 for ; Thu, 21 Apr 2011 13:41:59 +0200 (CEST) Original-Received: from mail-bw0-f41.google.com (mail-bw0-f41.google.com [209.85.214.41]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p3LBfw7Y029944 for ; Thu, 21 Apr 2011 13:41:59 +0200 Original-Received: by bwz17 with SMTP id 17so2064624bwz.14 for ; Thu, 21 Apr 2011 04:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=1+rbelbBx7EFxrvB63eGkpazVtylSj8y4XPfEY6M0yg=; b=BUwagJYcFI2Le/KqW+0za9McCSOXMG7vSWJSiTc3XzERQRiqhfCiwJmWNebo2UGpIn HnLhTXUQDXLChGcA5G+TZEM8/Ldjwgu+YtY55V+NXHNfLhyrdtt6AQ+E2VKYylbPWdhw F/2Az3a1T/QjI0Q+MFOrAhypdUlZ7QnsgTPVY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=EftNsaT2NPzxGLBC5tZLcPkd14Fvmt9xbrYm8971Z2lhF99Wk7Y39I9WdzIl0HgkCU 67a+msIKVFiKpwN9lx3KgmMulUA6S3iIQXx20AO98lOfdhJabdkLWxZV+hQ0r5mK6LdH deCw9ckQHzlUV69VIUF1skddE5V9SH3ltY5go= Original-Received: by 10.204.29.21 with SMTP id o21mr195191bkc.97.1303386118640; Thu, 21 Apr 2011 04:41:58 -0700 (PDT) Original-Received: from [192.168.2.31] (p5B2956D6.dip.t-dialin.net [91.41.86.214]) by mx.google.com with ESMTPS id c11sm1075997bkc.2.2011.04.21.04.41.56 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 21 Apr 2011 04:41:57 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0bEybFXVU - 529d3b8efd5f - 20110421 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:67919 Archived-At: Am 21.04.2011 um 13:35 schrieb luigi scarso: > On Thu, Apr 21, 2011 at 1:32 PM, Wolfgang Schuster > wrote: >> >> Am 21.04.2011 um 12:28 schrieb Verhaag, G.C.H.M.: >> >> Hi, >> >> I try this example from the wiki page System Macros/Argument handling: >> >> \def\dodefinesomething[#1][#2]% >> {\getparameters[\??xx#1][#2]} >> >> \def\definesomething% >> {\dodoubleargumentwithset\dodefinesomething} >> >> \starttext >> \definesomething[alfa][variable=test] >> \stoptext >> >> >> Running this yields >> >> ! Undefined control sequence >> >> I'm trying to write a few macros with optional delimited arguments with >> key-value sets and started reading the appropriate pages, but can't figure >> out why this example fails to run. >> >> Anybody any idea? >> >> I guess the message comes from your namespace which is in this form >> only allowed in unprotected mode, to enter you need \unprotect before >> and \protect after your command declarations > > > > ! Undefined control sequence. > > system > tex > error on line 8 in file test.tex: Undefined > control sequence ... > > 1 \unprotect > 2 \def\definesomething% > 3 {\dodoubleargumentwithset\dodefinesomething} > 4 \def\dodefinesomething[#1][#2]% > 5 {\getparameters[\??xx#1][#2]} > 6 \protect > 7 \starttext > 8 >> \definesomething[alfa][variable=test] > 9 \stoptext > 10 > 11 > 12 > > \??xx > alfa > \setsomevalue #1#2->\@EA \def \csname #1 > #2\endcsname > \p!doassign ...EAEA \setsomevalue \fi \fi {#1}{#2} > {#3} > \xprocesscommaitem ...@relax@ #1==\empty \@relax@ > \@EAEAEA \xprocesscommaite... > \xdogetparameters #1]->\xprocesscommaitem #1,] > ,\@relax@ > \next1 #1,->\@@dodowithsetcommand {#1} > \doprocesscommaitem > ... > l.8 \definesomething[alfa][variable=test] \definenamespace [something] [ type=module, name=something, command=yes] \starttext \definesomething[alfa][variable=test] \stoptext Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________