From: Wolfgang Schuster <wolfgang.schuster@gmail.com>
To: hajtmar@gyza.cz, mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Working with variables in MkIV (\ setvariables, \getparameters etc)
Date: Sun, 9 Sep 2012 11:35:07 +0200 [thread overview]
Message-ID: <8B71799E-2E78-44D0-B821-49EC2326BC44@gmail.com> (raw)
In-Reply-To: <504C565D.9040405@gyza.cz>
Am 09.09.2012 um 10:42 schrieb Jaroslav Hajtmar <hajtmar@gyza.cz>:
> Hello ConTeXist,
>
> Is it possible go through all the keys of \setvariables (getvariable) macro and create the appropriate macros, as in the case of \getparameters macro?
>
> I mean macro like \getallvariablesfrom[myfirstnamespace], which return contents of brackets macro \setvariables[myfirstnamespace] (it mean list of all assignments key=value ...)
>
> In addition, you can assign all the variables one namespace to another namespace (or to create a loop which all variables passed and placed into the other namespace.)?
>
> Thanx Jaroslav Hajtmar
>
> Here is my inspiration of example :
>
>
> \setvariables[myfirstnamespace][id=1, value={text}]
>
> \starttext
>
> % \getparameters[myfirstnamespace][\getallvariablesfrom[myfirstnamespace]]
>
> % Now would be defined macros \myfirstnamespaceid (1) and \myfirstnamespacevalue (text)
>
>
> % Assign all the variables of [myfirstnamespace] namespace to [myotherspace] namespace?
> %\setvariable[myotherspace][\getallvariablesfrom[myfirstnamespace]]
>
> \stoptext
There is no way to access the list with the parameters from \setvariables but the question why you
want a command for each variable. In MkIV direct use of values in the form \myfirstnamespaceid
are replaced with something like \mynamespaceparameter{id} which has the advantage that you
can even use keys which haven’t been assigned before.
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
___________________________________________________________________________________
next prev parent reply other threads:[~2012-09-09 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-09 8:42 Jaroslav Hajtmar
2012-09-09 9:35 ` Wolfgang Schuster [this message]
2012-09-09 10:35 ` Jaroslav Hajtmar
2012-09-09 10:45 ` Wolfgang Schuster
2012-09-09 11:56 ` Jaroslav Hajtmar
2012-09-09 12:44 ` Wolfgang Schuster
2012-09-09 13:11 ` Jaroslav Hajtmar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8B71799E-2E78-44D0-B821-49EC2326BC44@gmail.com \
--to=wolfgang.schuster@gmail.com \
--cc=hajtmar@gyza.cz \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).