![](https://secure.gravatar.com/avatar/46562c7d27388490d62e8d7a5bc960dd.jpg?s=120&d=mm&r=g)
On 11/19/2021 4:26 PM, Joey McCollum via ntg-context wrote:
I was checking the "Branches and Decisions" wiki entry at https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions https://wiki.contextgarden.net/System_Macros/Branches_and_Decisions, and I saw that ConTeXt has a useful \doifalldefinedelse macro that checks a comma-separated list of macro names and proceeds according to whether or not all of the macros with those names are defined. I was curious as to whether or not there is also a \doifanydefinedelse (or, equivalently, a \doifallundefinedelse) macro that would check if /any /of the macros with names in the comma-separated list is defined (or, equivalently, if all of them are undefined). I don't see any mention of such a macro on the wiki page, so I wanted to ask: has something like this already been implemented, and if not, is there a simple way to do a check like this? This functionality would be useful for performing some checks on a key-value assignment, and passing a comma-separated list to a macro would be much cleaner than doing a bunch of nested if-else blocks. i'll add \doifelseallundefined
btw, you don't need to nest if's in lmtx: \ifdefined\foo \orelse\ifdefined\ofo \orelse\ifdefined\oof \else \fi sort of stays on the same level ... makes tex bit more like other programming languages (but of course also makes macros less impressive) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------