From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78179 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 13:56:22 +0200 Message-ID: <504C83E6.9090105@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> 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="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1347191923 23950 80.91.229.3 (9 Sep 2012 11:58:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Sep 2012 11:58:43 +0000 (UTC) Cc: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 09 13:58:46 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 1TAgA0-00023s-H6 for gctc-ntg-context-518@m.gmane.org; Sun, 09 Sep 2012 13:58:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF2F9101DF; Sun, 9 Sep 2012 13:58: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 i2Z3-3iIxgoF; Sun, 9 Sep 2012 13:58:39 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E5C4C101EA; Sun, 9 Sep 2012 13:58:38 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 59F58101EA for ; Sun, 9 Sep 2012 13:58:37 +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 DUKEAa51CsXe for ; Sun, 9 Sep 2012 13:58:36 +0200 (CEST) Original-Received: from filter1-utr.mf.surf.net (filter1-utr.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 87F16101DF for ; Sun, 9 Sep 2012 13:58:36 +0200 (CEST) Original-Received: from psi1.forpsi.com (smtpa.forpsi.com [81.2.195.204]) by filter1-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q89BwYaO011032 for ; Sun, 9 Sep 2012 13:58:35 +0200 Original-Received: (qmail 29705 invoked by uid 89); 9 Sep 2012 11:58:30 -0000 Original-Received: by simscan 1.4.0 ppid: 29701, pid: 29703, t: 0.8274s scanners: spam: 3.3.2 Original-Received: from unknown (HELO ?192.168.20.101?) (hajtmar@88.103.230.14) by psi01 with ESMTPA; 9 Sep 2012 11:58:29 -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: <0FEE6714-FBC1-4B68-B515-0A9DB5230D83@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: 07HUXWyOn - b72a383bd9aa - 20120909 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:78179 Archived-At: Thanx Wolfgang. So far I have never worked with namespaces as follows. I thought that \setvariables macro automatically namespace for variables creates and sets the values in it. Setvariables somehow connected with the creation of macro variables in the namespace of the given name? It appears that the following example shows that it is not ... \starttext \definenamespace[myspace][name=myspace,command=yes,setup=yes,parent=one] \setupmyspace[ id=3, graphcolor=green, ] \setvariables[myspace][ id=5, graphcolor=blue, ] \myspaceparameter{id} \myspaceparameter{graphcolor} \stoptext Thanx Jaroslav Dne 9.9.2012 12:45, Wolfgang Schuster napsal(a): > Am 09.09.2012 um 12:35 schrieb Jaroslav Hajtmar: > > >> > Thanx Wolfgang. >> > >> > I do not know anything about such a possibility. >> > What do you mean? Can you show a simple example? >> > I tried several options but nothing works. Here are some examples: >> > >> > \setvariables[myspacename][id=1, value={value}] >> > >> > \getparameters[myotherspacename][id=1, value={value}] >> > >> > \starttext >> > >> > % \myspacenameid % not work >> > % \myspacename{id} % not work >> > % \myspacenameparameter{id} % not work >> > % ??? >> > >> > \myotherspacenameid % this works only >> > >> > \stoptext >> > When you use \getparameter you have to define the command yourself, e.g. > > \def\mynamespaceid#1{\csname mynamespace#1\endcsname} > > or you use \definenamespace which creates all these commands for you: > > \starttext > > \definenamespace[one][name=one,command=yes,setup=yes,parent=one] > \definenamespace[two][name=two,command=yes,setup=yes,parent=one] > > % With this parent setting \twoparameter uses the values from \setupone > % when no value is set with \setuptwo. > > \unprotect > \setuptwo[parent=\????one] > \protect > > \setupone[one=One,two=Two] > > \starttabulate > \NC one:one \EQ \oneparameter{one} \NC\NR > \NC one:two \EQ \oneparameter{two} \NC\NR > \NC two:one \EQ \twoparameter{one} \NC\NR > \NC two:one \EQ \twoparameter{two} \NC\NR > \stoptabulate > > \setuptwo[one=1,two=2] > > \starttabulate > \NC one:one \EQ \oneparameter{one} \NC\NR > \NC one:two \EQ \oneparameter{two} \NC\NR > \NC two:one \EQ \twoparameter{one} \NC\NR > \NC two:one \EQ \twoparameter{two} \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 ___________________________________________________________________________________