Hi Thomas,

in latest:

since you're in 'latest mode' ... here is an experimental feature that you can test in the mkiv version of your modules

\starttext

\startbuffer

\getcheckedparameters[MyTest][MyNamespace][a=1,b=2,c=3,d=4,crap=whatever]

    \MyNamespacea\quad
    \MyNamespaceb\quad
    \MyNamespacec\quad
    \MyNamespaced\quad
    crap is \ifdefined\MyNamespacecrap\else un\fi defined
\stopbuffer

\enablecheckparameters

\setvalidparameterkeys[MyTest][a,b,c,d] \getbuffer \par
\addvalidparameterkeys[MyTest][crap]    \getbuffer \par

\stoptext

in due time we can add such testing to all mkiv commands but then we get the key info from the xml database

technically we can check for values as well, but since for many commands
values can be anything tex, we'd get too many errors reported so only keys can be checked

when enabled this checker also intercept spaces as in a = b but not trailing spaces (i.e. before the comma or ]) because that would break compatibility with for instance label settings and such

the overhead of this mechanism if small (some .1 sec on 10K calls)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to