From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/113477 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Joey McCollum via ntg-context Newsgroups: gmane.comp.tex.context Subject: \doifanydefinedelse, \doifallundefinedelse Date: Fri, 19 Nov 2021 10:26:33 -0500 Message-ID: Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0663861770645309567==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2887"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joey McCollum To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 19 16:27:43 2021 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mo5ni-0000IV-K8 for gctc-ntg-context-518@m.gmane-mx.org; Fri, 19 Nov 2021 16:27:42 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 17A212895A7; Fri, 19 Nov 2021 16:27:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5MnjUZrwQfXm; Fri, 19 Nov 2021 16:27:04 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 563FE2895A8; Fri, 19 Nov 2021 16:27:04 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id CFC572895A5 for ; Fri, 19 Nov 2021 16:27:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uPuyDZI7JgTW for ; Fri, 19 Nov 2021 16:27:01 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.51; helo=mail-io1-f51.google.com; envelope-from=jmccollum20140511@gmail.com; receiver= Original-Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 273A4289539 for ; Fri, 19 Nov 2021 16:27:01 +0100 (CET) Original-Received: by mail-io1-f51.google.com with SMTP id w22so13242421ioa.1 for ; Fri, 19 Nov 2021 07:27:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=CE5ejSf13nJRQQqR71LxgnFrC85MFAU47wsDIIX1HFo=; b=PDQmb08vPYnUXZIeCHwVL1Q9MdQBqlH0EpSPavevQ8pu3Eq7lLChwqq2ybh/ki3sAD iq8UwaHIxMvM8g5bXdORMV1aG69XBjxGvYe26FsS+ZDoOFI+prCvsdjpSv9ZziagKuWm Psb6kkyj5+ioMkXL1Q+KxhhoTRnDoKNFcrr/VZo3ijC/tHQA3NuMNA0p7zX7PzlVLuke bovt4uT3sGR+oiNe/zJWawYuy0J8drauwKpsvsHTjy/y+edcpfXCAcqVzrd64s1IsH0N LS307IhO2p33pkTgrnvDAYXjKjdx11Ixk0hCg6yo8jhxfx6SvhOnQbijs+TgjQ4+BSA0 ZLsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=CE5ejSf13nJRQQqR71LxgnFrC85MFAU47wsDIIX1HFo=; b=T64z22ciXxzJA1OJcvsVnXTgrVX0/ksLP5FF1HGvD1iBtsFuUXL6U7QFJLWeFtlKW9 +yGYn1C0d2R4jBQEXMRpjcsysEzSfrCp3hsO96AjkYZRdDHpzfdBLVvH/LXjQ5aw72P7 4KoB6dtWwWtqWw1F9e871BAyKcdMQA3hlh3rsVri6ReY//s6AgVpibwl5qiTviy0P5Df cpHtVbUgv/jyT64N9Q8w9rgMvlzZBlNAM15fLhSC6/D7QpRpuR9+jKvhEepba0EaJFzG ymzHYdAu/5gUZHm2dFrkV6mRqGYAdm5LqavmQb4gfox1UTiIReSrDTFuxv6RkLgxmqKo Ddyg== X-Gm-Message-State: AOAM53321NFykenzQ54+C7B5gLn4jNWSY4Z1G1JNcx2vy4XG8xRKK4kt GOniV8YdREOW3a/caYCPxOG5j2RlwY6h3gXEc5bT2jA+MEM= X-Google-Smtp-Source: ABdhPJwvhiOZQy8Yzv1RtD02FJX3sTZiabigf8WGFnnujtB7KqsRP6MVJ2riB5N+XQHWw9Iyc0k2TMv0gks0JoFnbKk= X-Received: by 2002:a05:6638:140c:: with SMTP id k12mr28502186jad.89.1637335619211; Fri, 19 Nov 2021 07:26:59 -0800 (PST) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.io gmane.comp.tex.context:113477 Archived-At: --===============0663861770645309567== Content-Type: multipart/alternative; boundary="000000000000f6148f05d125e7b4" --000000000000f6148f05d125e7b4 Content-Type: text/plain; charset="UTF-8" I was checking the "Branches and Decisions" wiki entry at 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. Joey --000000000000f6148f05d125e7b4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I was checking the "Branches and Decisions" wiki= entry at=C2=A0https://wiki.contextgarden.net/System_Macros/Branches_a= nd_Decisions, and I saw that ConTeXt has a useful=C2=A0\doifalldefinede= lse=C2=A0macro that checks a comma-separated list of macro names and procee= ds according to whether or not all of the macros with those names are defin= ed. I was curious as to whether or not there is also a \doifanydefinedelse = (or, equivalently, a \doifallundefinedelse) macro that would check if an= y 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 woul= d be much cleaner than doing a bunch of nested if-else blocks.

Joey
--000000000000f6148f05d125e7b4-- --===============0663861770645309567== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============0663861770645309567==--