From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78182 Path: news.gmane.org!not-for-mail From: Jaroslav Hajtmar Newsgroups: gmane.comp.tex.context Subject: Re: Working with variables in MkIV (\ setvariables, \getparameters etc) Date: Sun, 09 Sep 2012 15:11:04 +0200 Message-ID: <504C9568.4080108@gyza.cz> References: <504C565D.9040405@gyza.cz> <8B71799E-2E78-44D0-B821-49EC2326BC44@gmail.com> <504C70DA.70807@gyza.cz> <0FEE6714-FBC1-4B68-B515-0A9DB5230D83@gmail.com> <504C83E6.9090105@gyza.cz> <5A759A83-CA23-4296-8947-CD0A9D69CEA6@gmail.com> Reply-To: hajtmar@gyza.cz, mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1347196409 22592 80.91.229.3 (9 Sep 2012 13:13:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2012 13:13:29 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 09 15:13:32 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TAhKF-0005uj-6v for gctc-ntg-context-518@m.gmane.org; Sun, 09 Sep 2012 15:13:23 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6CDC510218; Sun, 9 Sep 2012 15:13:19 +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 gccZSb1NUMxr; Sun, 9 Sep 2012 15:13:17 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 9AC15101EA; Sun, 9 Sep 2012 15:13:17 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7FC8C101EA for ; Sun, 9 Sep 2012 15:13:16 +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 WcJVoYTqyptd for ; Sun, 9 Sep 2012 15:13:15 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id 73220101DF for ; Sun, 9 Sep 2012 15:13:15 +0200 (CEST) Original-Received: from psi3.forpsi.com (smtpa.forpsi.com [81.2.195.204]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q89DDEUu001885 for ; Sun, 9 Sep 2012 15:13:14 +0200 Original-Received: (qmail 30459 invoked by uid 89); 9 Sep 2012 13:13:12 -0000 Original-Received: from unknown (HELO ?192.168.20.101?) (hajtmar@88.103.230.14) by psi03 with ESMTPA; 9 Sep 2012 13:13:12 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; cs; rv:1.9.1.16) Gecko/20101125 Thunderbird/3.0.11 In-Reply-To: <5A759A83-CA23-4296-8947-CD0A9D69CEA6@gmail.com> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=81.2.195.204; country=CZ; latitude=49.7500; longitude=15.5000; http://maps.google.com/maps?q=49.7500,15.5000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VHV1deFV - 5f3170b0bfa1 - 20120909 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 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-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78182 Archived-At: Thanx Wolfgang for your explanations. Jaroslav Hajtmar Dne 9.9.2012 14:44, Wolfgang Schuster napsal(a): > Am 09.09.2012 um 13:56 schrieb Jaroslav Hajtmar: > > = >> Thanx Wolfgang. >> >> So far I have never worked with namespaces as follows. I thought that \s= etvariables macro automatically namespace for variables creates and sets th= e values in it. Setvariables somehow connected with the creation of macro v= ariables in the namespace of the given name? It appears that the following = example shows that it is not =85 >> = > The internal functioning of both methods is more or less the same, I will= begin with \getparameters. > > To set values as key-value-list you can use the \getparameters command, e= .g. > > \getparameters[namespace][key1=3Dvalue1,key2=3Dvalue2,=85] > > When ConTeXt process this list it takes each entry which till the next co= mma or the end of the list and splits it in two parts which are on the left= (the =93key=94)and the right (the =93value=94) of the =3D sign. After that= it creates a new command whose name consist of the namespace and key, e.g.= =93\namespacekye1=94 which stores the content of the key, e.g. =93value1= =94. To create the command which stores the value context uses \csname/\end= csname which allows one to use numbers, spaces etc. as part of the key. > > > The \setvariables command is a wrapper around \getparameters to store val= ues in a certain namespace which can only be accessed with the \getvariable= command. > > > With \definenamespace you can generate \setup=85 and \define=85 command w= hich use itself \getparameters to store the values but the namespace itself= uses symbols (? and @) which can=92t be normally used to create a command. > > > What you always have to keep in mind is that what we call a namespace is = nothing more than a certain string a command names which makes it possible = to distinguish them because there a many setups which have a width key, e.g= . tables can =93\tablewidth=94 to store the value of the key while figures = use =93\figurewidth=94 to store the value etc. > > In reality context uses namespace like =93@@ef=94 in MkII and in MkIV nam= espace have the form =93123>=94 where instead of letters numbers are used. > > Wolfgang > = ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________