From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78180 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Working with variables in MkIV (\ setvariables, \getparameters etc) Date: Sun, 9 Sep 2012 14:44:28 +0200 Message-ID: <5A759A83-CA23-4296-8947-CD0A9D69CEA6@gmail.com> 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> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1347194699 10562 80.91.229.3 (9 Sep 2012 12:44:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2012 12:44:59 +0000 (UTC) To: hajtmar@gyza.cz, mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 09 14:45:01 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 1TAgsh-0006bd-H8 for gctc-ntg-context-518@m.gmane.org; Sun, 09 Sep 2012 14:44:55 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D88F5101F0; Sun, 9 Sep 2012 14:44:51 +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 qFt3P4nW55Ya; Sun, 9 Sep 2012 14:44:50 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D7CA5101EA; Sun, 9 Sep 2012 14:44:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5176E101EA for ; Sun, 9 Sep 2012 14:44:48 +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 V79yuv1wQ4WO for ; Sun, 9 Sep 2012 14:44:47 +0200 (CEST) Original-Received: from filter5-til.mf.surf.net (filter5-til.mf.surf.net [194.171.167.221]) by balder.ntg.nl (Postfix) with ESMTP id 9440C101DF for ; Sun, 9 Sep 2012 14:44:47 +0200 (CEST) Original-Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by filter5-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q89ChAcE007779 for ; Sun, 9 Sep 2012 14:43:11 +0200 Original-Received: by wibhm6 with SMTP id hm6so897101wib.2 for ; Sun, 09 Sep 2012 05:44:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=hOmqS5eEQDUi7vnf06qQFZ2Vjfwj6aY99ROls34Gtq0=; b=loUxOb88bDh4WRmtVlaF9PvuItt6IYavtW21tZYTCj2EfXBoFZA83j6jgxBG160pXJ oz0aTOLY0qToN9g0CbKvkyKLoSUbbE8pbSs29NSIl0aU/q72BC3vagAss+XOJp4tjAG8 yUehdRSqEbkZu3pMnXGn1/Fnm9R33gkEY1LkfJHY8Dky281PbozWvQHj3uoUQV0DjnUi rPjMxAPwGiBeHWtglkVCVLSrk8xGA6vQsGylcYgu1IPDEBcwD+jGSYJ42YOkGvbUM/R7 fh6CfUsDPCiqoR8QJKdbDVSTCwdz8DNyeHEdtH80qTLP1UmPGgofaNP4yBxE1YPAYb1a BUHQ== Original-Received: by 10.180.81.165 with SMTP id b5mr10314185wiy.17.1347194683544; Sun, 09 Sep 2012 05:44:43 -0700 (PDT) Original-Received: from [10.141.12.77] ([89.204.138.77]) by mx.google.com with ESMTPS id fb20sm16420733wid.1.2012.09.09.05.44.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 05:44:42 -0700 (PDT) In-Reply-To: <504C83E6.9090105@gyza.cz> X-Mailer: Apple Mail (2.1486) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.212.173; 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: 0WHV0HbjF - 9ad6d4c1907e - 20120909 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.221 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:78180 Archived-At: 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 \se= tvariables macro automatically namespace for variables creates and sets the= values in it. Setvariables somehow connected with the creation of macro va= riables in the namespace of the given name? It appears that the following e= xample shows that it is not =85 The internal functioning of both methods is more or less the same, I will b= egin 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 comm= a 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 i= t 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/\endcsn= ame which allows one to use numbers, spaces etc. as part of the key. The \setvariables command is a wrapper around \getparameters to store value= s in a certain namespace which can only be accessed with the \getvariable c= ommand. With \definenamespace you can generate \setup=85 and \define=85 command whi= ch use itself \getparameters to store the values but the namespace itself u= ses 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 no= thing 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 us= e =93\figurewidth=94 to store the value etc. In reality context uses namespace like =93@@ef=94 in MkII and in MkIV names= pace 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 ___________________________________________________________________________= ________