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.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 20197 invoked from network); 27 Nov 2023 11:24:46 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 27 Nov 2023 11:24:46 -0000 Received: from mail-oa1-f51.google.com ([209.85.160.51]) by 9front; Mon Nov 27 06:21:05 -0500 2023 Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-1fa22326ad0so976585fac.1 for <9front@9front.org>; Mon, 27 Nov 2023 03:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701084062; x=1701688862; darn=9front.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:user-agent:mime-version:date:message-id:from:from:to:cc :subject:date:message-id:reply-to; bh=O3unsHveSmYoS7n94RAynXfW9rZQ3U9TK3IwV1lsQzk=; b=Nev95pH9Zhdl/t1H9dwtl2Nd8inFlPDhmHcGG65Wxj5UQ8toVeEExt7XDYl1o1wPgh pSsFmaFF+C1e/HbsC6+M+qpGQHSXIdlzITS5UU47n6tOAae+P2AwHm+umpzaIVipF8hf mCIaO3+G4X2jBGb4o+n0bXFYVYH1VFNZcKPJBMeHEtLYBj5QUCS77hUAsYF41m99Qcrg i+l0yMH68W8aCXhzGQayLUZC7K5FbGagouFUwT04cNO3mVfUaO4AaXyh5SyWzp6zlR// nOeExdQUf5z8LQmQMB2PifcedF9L91hz+ykRtO8Ix8wVJ0hZ2N2xu2F6uLiC2u/dlohi oG7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701084062; x=1701688862; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O3unsHveSmYoS7n94RAynXfW9rZQ3U9TK3IwV1lsQzk=; b=Z54uUatHHcnJ9rEqyjEmTc65LvqK+9/a8vgoSU9wUgnNQTBCKq+/yb2MhI/hrR+DcG 7wf57kw8zimulX1VGAO79tfT1J+BbP/Uu7ek/yWR8gspBzMML4OyWfNMWW+7GxUXOMgm MoUmuZhTe8bu27xum65LeLSDQhJuPQKNcvdiAvYZ4HwJAJqtRQMjDrgmcEDsv5+mp9rd vJtLJtXvhp9c1OfQkYC3FMi7+tgAmlgSzNoEe5DABptCYm5a30uQ3OIDkDeACaycwK6I buCJSU3httK5lGuHsonjVFWLu5gsy2v0ddL4XOz68xGt5oOF6FSa88MPoizqVJPI6woj Rozg== X-Gm-Message-State: AOJu0YyelE41v+aWs7wcLd3GS4u4MifGzqYv2s8/iaBt3sl3YMJRP92Z /o4pQ9XzA3tmqBGWFHQ25UAJ8QUkmE1XCQ== X-Google-Smtp-Source: AGHT+IHimyiMCKeFAVggLaolrOCJaMY07KE1N34Di1sFcazbYXcut/RkSsdU0rahwOgfMjfPu4k9cg== X-Received: by 2002:a05:6871:528a:b0:1fa:1d12:e54e with SMTP id hu10-20020a056871528a00b001fa1d12e54emr10276700oac.12.1701084062007; Mon, 27 Nov 2023 03:21:02 -0800 (PST) Return-Path: Received: from ?IPV6:2600:1700:e4c0:9ea0::5f6? ([2600:1700:e4c0:9ea0::5f6]) by smtp.gmail.com with ESMTPSA id t12-20020a05683022ec00b006d7e1d3dedasm550630otc.32.2023.11.27.03.21.01 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Nov 2023 03:21:01 -0800 (PST) From: Blue-Maned_Hawk X-Google-Original-From: Blue-Maned_Hawk Message-ID: <53a49e38-03e2-4425-bbb7-25e88523153e@invalid.invalid> Date: Mon, 27 Nov 2023 06:20:59 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: 9front@9front.org References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: deep-learning map/reduce standard Subject: Re: [9front] [PATCH] Fix assert macro to not break on commas Reply-To: 9front@9front.org Precedence: bulk On 11/26/23 19:00, ori@eigenstate.org wrote: > 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"); > Aye, correct you are. In that case, it could be rearranged to #define assert_msg(msg, ...) ((__VA_ARGS__) ? (void)0 : (print(msg), exits(msg))) and it would be able to tolerate unparenthesized commas in the checked expression.