On Thu, 18 Nov 2010, Wolfgang Schuster wrote:
\<name>parameter use the value from \current<name> while \named<name>parameter has two argument where the first argument is the name of a command or environment created with \define<name>. \detokenized... is important when you pass values from tex to lua and the value contains a tex command, e.g. \thinspace which is normally expanded in this case.
Thanks.
The command key has like the setup key the two values yes and list, with „command=yes“ you can write
\define<NAME>[two][one]
I did not know that cloning was possible. The \defineenumeration commands allows for
\defineenumeration[new][old][..=..]
This clones a selected options from old to new (using copyparamters) and then sets the values of the third arguments.
\copyparameters is only used for code which doesn’t use the new parameter command with the parent handling but this method isn’t necessary in mkiv
I am not sure how this is supposed to work. Consider this example: \definenamespace [one] [type=module, name=one, setup=yes, parent=] \definenamespace [two] [type=module, name=two, command=yes, parent=one] \setupone[whatever=one] \definetwo[test1] \definetwo[test2][something=two] \definetwo[test3][test2] \starttext \startlines
\namedtwoparameter{test1}{whatever}<< \namedtwoparameter{test2}{whatever}<< \namedtwoparameter{test2}{something}<< \namedtwoparameter{test3}{something}<< \stoplines \stoptext
This gives
one<< << two<< <<
Why is the value of whatever not set for test2? Why is the value of something not set for test3?
Would it make sense to add support for
\define<name>[two,three][one][..=..]?
You can redefine \define<name> or leave it out from \definenamespace.
I meant that why not \define<name> as follows: \def\define<name>% {\dotripleargument\dodefine<name>} \def\dodefinename<name>[#1][#2][#3]% {\doifassignmentelse{#2} {\getparameters[<name>#1][parent=<name>, #2]} {\getparameters[<name>#1][parent=<name>#2, #3]}}
What’s also is to write \define<name>[clone][parent=\????parent].
For parent it’s the best to give as argument always the same value as you defined for the namespace, e.g. for the fancybreak module one should write „parent=fancybreak“.
I thought that you have to write "parent=\????fancybreak".
That happens in the backend hidden from the user/author.
Ah, I see. Thanks. Aditya