Am 20.03.10 18:49, schrieb Hans Hagen:
\chardef\d!pt\plusone
\chardef\d!pc\plusone
\chardef\d!in\plusone
\chardef\d!bp\plusone
\chardef\d!cm\plusone
\chardef\d!mm\plusone
\chardef\d!dd\plusone
\chardef\d!cc\plusone
\chardef\d!sp\plusone
\chardef\d!ex\plusone
\chardef\d!em\plusone
\def\test@@ifdimunt#1%
{\ifcsname d!#1\endcsname
\donetrue
\else
\donefalse
\fi}
\testfeatureonce{100000}{\ifdimen{34cm}{}{}}
10% faster ... anyhow, quite ugly code
And I thought you show us a Lua solution.
i'll have a look at why the normal one fails
\doifdimensionelse expects a dimension or a number but not characters.
\starttext
\doifdimensionelse{12pt}{yes}{no} % works
\doifdimensionelse{0}{yes}{no} % works
\doifdimensionelse{}{yes}{no} % fails
\doifdimensionelse{`a}{yes}{no} % works
\doifdimensionelse{a}{yes}{no} % fails
\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
___________________________________________________________________________________