From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/71008 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: How to properly handle synonyms in \getparameters? Date: Sat, 3 Sep 2011 04:45:27 +0200 Message-ID: <485745FA-6D25-4821-8944-9B7A36410D78@googlemail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1315017948 16719 80.91.229.12 (3 Sep 2011 02:45:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Sep 2011 02:45:48 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 03 04:45:44 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 1QzgEo-0002fY-1s for gctc-ntg-context-518@m.gmane.org; Sat, 03 Sep 2011 04:45:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 03732CAF4F; Sat, 3 Sep 2011 04:45: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 lvsII8JeiQQz; Sat, 3 Sep 2011 04:45:36 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A5C52CAF4B; Sat, 3 Sep 2011 04:45:36 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CF868CAF4B for ; Sat, 3 Sep 2011 04:45:34 +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 hxwy4zD+Afls for ; Sat, 3 Sep 2011 04:45:32 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 836B5CAF3D for ; Sat, 3 Sep 2011 04:45:32 +0200 (CEST) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p832jVpe009984 for ; Sat, 3 Sep 2011 04:45:31 +0200 Original-Received: by fxg9 with SMTP id 9so2896246fxg.14 for ; Fri, 02 Sep 2011 19:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; 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; bh=7cBMLqPHr/i6JeFRbuDBenvi7nLmn/fZ81iIU2KPiCA=; b=B5a4Fd7kB/cVbUyrKM+hXFwEO4JZg7BOM3v8MkDb+2PZ0PJNEI1UUFNaGkm3zG2vqN rIOz3ZRR6pm/SjDOF7qUIuRDy1dz5jeGzz/U4/cWpqpTUp1BhLOfcQcc+v31TV7uTOPb yPE+xv4xiu38UgPRwPi+1fTcUyQQB1jM//5wo= Original-Received: by 10.223.55.209 with SMTP id v17mr397911fag.77.1315017931217; Fri, 02 Sep 2011 19:45:31 -0700 (PDT) Original-Received: from [192.168.2.31] (pD9EA7FA2.dip.t-dialin.net [217.234.127.162]) by mx.google.com with ESMTPS id p25sm477236fap.26.2011.09.02.19.45.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Sep 2011 19:45:30 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1244.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.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: 0dFs2Jvyi - 29ee3f712c18 - 20110903 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:71008 Archived-At: Am 03.09.2011 um 02:46 schrieb Mojca Miklavec: > Dear gurus, > > This question concerns both MKII and MKIV (I need the functionality in > both, even though I will try to rewrite the MKIV part as soon as I > have time). > > I have a command: > \mycommand[a][newparam=value] > with more or less the following definition: > \def\mycommand[#1][#2]{% > \getparameters[@@mycommand@#1@][#2] > % ... some extra code ... > } > > However I used to use > \mycommand[a][oldparam=value] > and now I would like to switch the syntax to > \mycommand[a][newparam=value] > but I would like the oldparam to keep working normally. > > I will read the value with \@@mycommand@a@newparam. > > My question: what is the most elegant value to do that? > > I can imagine something like > \def\mycommand[#1][#2]{% > \undefinecommand\@@mycommand@a@oldparam % pseudocode > \getparameters[@@mycommand@#1@][#2] > \doifdefined{\@@mycommand@a@oldparam} > \let\@@mycommand@a@newparam\@@mycommand@a@oldparam > % ... some extra code ... > } > > but there is most probably some more elegant solution to that? MkIV: \definenamespace [mojca] [type=module, name=mojca, command=yes, setup=yes, parent=mojca] \starttext \setupmojca [oldkey=OLD, newkey=\mojcaparameter{oldkey}] \starttabulate \NC Old \EQ \mojcaparameter{oldkey} \NC\NR \NC New \EQ \mojcaparameter{newkey} \NC\NR \stoptabulate \setupmojca [newkey=NEW] \starttabulate \NC Old \EQ \mojcaparameter{oldkey} \NC\NR \NC New \EQ \mojcaparameter{newkey} \NC\NR \stoptabulate \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 ___________________________________________________________________________________