Willi Egger via ntg-context schrieb am 23.06.2022 um 21:16:
Good evening gurus!

Why is the minimal example failing? i.e. executing always the else-branch?

\doifempty(else) doesn't expand the argument and any argument counts as not empty. To satisfy the command you can expand the first argument (\normalexpanded) or you use \doifnothing(else) which expands the argument.

\starttext

\startbuffer
\doifemptyelse{}{YES}{NO}

\doifemptyelse{\empty}{YES}{NO}

\normalexpanded{\doifemptyelse{}}{YES}{NO}

\normalexpanded{\doifemptyelse{\empty}}{YES}{NO}

\doifnothingelse{}{YES}{NO}

\doifnothingelse{\empty}{YES}{NO}
\stopbuffer

\typebuffer \getbuffer

\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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to