From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 29326 invoked from network); 27 Nov 2023 00:02:00 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 27 Nov 2023 00:02:00 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Sun Nov 26 19:00:08 -0500 2023 Received: from abbatoir (pool-108-6-24-2.nycmny.fios.verizon.net [108.6.24.2]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 0e118113 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sun, 26 Nov 2023 16:00:04 -0800 (PST) Message-ID: To: 9front@9front.org Date: Sun, 26 Nov 2023 19:00:03 -0500 From: ori@eigenstate.org In-Reply-To: <98891211-9bff-441d-a1f0-f1607a99bd70@invalid.invalid> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: virtualized proven framework-oriented descriptor Subject: Re: [9front] [PATCH] Fix assert macro to not break on commas Reply-To: 9front@9front.org Precedence: bulk Quoth Blue-Maned_Hawk : > On 11/26/23 17:52, ori@eigenstate.org wrote: > > Quoth Blue-Maned_Hawk : > >> What reason have y'all for avoiding macros? > > > > Well, the fact that you need hacks like the one that started this > > thread, for one; > > I don't see how it's a hack, but maybe i've just become numb to macro > shenaniganry. > > > what if you had macro that took *two* arguments? > > > > #define assert_msg(cond, msg) \ > > ...what here? > > > > I don't see how you can avoid just saying "it's a macro, it's going > > to be weird, don't even try". > > > > Don't even try writing the macro or don't even try making it not weird? > Because i can thing of a way to define such a thing: > > #define assert_msg(cond, msg) ((cond) ? (void)0 : (print(msg), exits(msg))) > > and i don't think that that's a particularly weird way to do so. Wouldn't that fall apart on the same case that you showed above? assert_msg((Thing){0, 1}.a, "foo");