From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: Guile assert macro Date: Tue, 23 Apr 2019 22:47:58 +0200 Message-ID: <8bbf931a-1ad8-83a3-022c-6d8c775e8a3f@gmail.com> References: <5017489f-1e55-a3db-07c9-c1158c3160f8@gmail.com> <87bm0xsfpd.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="241920"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 Cc: guile-user@gnu.org To: Mark H Weaver Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Apr 23 22:48:36 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hJ2LD-0010go-G6 for guile-user@m.gmane.org; Tue, 23 Apr 2019 22:48:35 +0200 Original-Received: from localhost ([127.0.0.1]:59307 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJ2LC-0002PT-BM for guile-user@m.gmane.org; Tue, 23 Apr 2019 16:48:34 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJ2Kl-0002PD-8F for guile-user@gnu.org; Tue, 23 Apr 2019 16:48:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJ2Kj-0007bi-TQ for guile-user@gnu.org; Tue, 23 Apr 2019 16:48:07 -0400 Original-Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:38402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJ2Kg-0007YJ-NA for guile-user@gnu.org; Tue, 23 Apr 2019 16:48:04 -0400 Original-Received: by mail-ed1-x542.google.com with SMTP id c1so7969152edk.5 for ; Tue, 23 Apr 2019 13:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=TN21BoRJn11C9MWr3JkhNLw9+4rsvmnE4hEKX1Jl354=; b=fLnNzvWeIWEvEhvXG8Nzm83+6otsELoOx7wKnkqGYPb4FeSqsz9PiqTG132z/7ZgcW 9oosR5caHu/JBUMCHE3rU3sXEw7L/5nfBvoMo4gAgwVrodfd86RBbnBUXDavOkDNHxbX tP7nX5I0AXoVgWoqhlb90pNGtiB98FwpD7ZKa7vjvCmkMy0w03OOqa78Ey2ziiltAHFM LBjwEYLzK9l47BRwFBAxxLdMJnUWleIE6fnmnY5EA0cZk7pz7SeHl1ZdKmBesAkExono gr0kGfwTjziyMUgfqNHzVjxxnGkUBbUtRfZalapV8NQUDkyzVJc6eKPMLnQi+g1QjowF gXYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=TN21BoRJn11C9MWr3JkhNLw9+4rsvmnE4hEKX1Jl354=; b=iFpL70Woo8U/P8tqn+sIi6Xg6BjeZuXkpmPC+UUQrjRjUhTYqNIMGUovsf2SgojhbE 9ijAcIWCRh6/UdhJzNZR14b2Ryc3knQzPTRh1TrPaqSB8L0DPB5dyT5niBj9JGqsN3i7 8EmKtD/i4BLwvByPiJQeKUNPStTwc62e4I7T6AbpV6/okCUepSm2IQ8mGPitVpfsVfJk rrBtudpyjkmi93XMV3q1pZ2QcOz+aquYk5WPMaAVOfkfIVTJJaGo4SoiILmr+o5y52vi 9l0fVzCOD/8HznSewM/JDUatzJtYORu4OLnAzhYB//875VmAkdyFFQ/OgeCHz0J2o6dB SGJA== X-Gm-Message-State: APjAAAWk47mKuom1WVT9Tw5iKL4SjjjtY6YIxYZOJz1AKQjSl7UNBk1K 5/AmLFfx+n2AFFF3j3fzeCt3wDZHIr4= X-Google-Smtp-Source: APXvYqzlmlDwyHesZ01iykMPQ92MBsDIWF5ATA1ZjOHyyHL8O2BFAo6TPa3Xx1nf3vxJjbW9Hg/P3Q== X-Received: by 2002:a17:906:6d99:: with SMTP id h25mr14196560ejt.187.1556052480059; Tue, 23 Apr 2019 13:48:00 -0700 (PDT) Original-Received: from [10.8.0.15] ([193.138.218.170]) by smtp.googlemail.com with ESMTPSA id i12sm1374423ejc.27.2019.04.23.13.47.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Apr 2019 13:47:59 -0700 (PDT) In-Reply-To: <87bm0xsfpd.fsf@netris.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::542 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15419 Archived-At: Hi Mark! Thanks for answering that question about the macro being implemented. I was maybe wrongly assuming, that, since it is on Oleg's website, many of the very proficient schemers know it. It seems to be a nice macro, but I have no idea how much time Oleg spent on it. I got the feeling though, that he sometimes revises articles on his website. I think this article about assertion macro also has been revised. It not being in Guile, I will have to make a choice of using that macro and adding it as a sort of dependency or simply using the standard library one's assert macro. It will probably not be a big issue to use a macro that is not in the standard library, as long as I note that somewhere and make it clear, that it might work differently, if one does not use that macro. I don't really find the R6RS assert macro unsatisfactory. It is only that I saw something else that looked nice ; ) Thanks! I also recently had a thought: "How can he just put the code like that on a website and not in some repository instead?" – I think the answer is, that the code is concise, short and works in most Schemes, since they mostly have a lot in common, so that he does not need to put much info there about "What if I use ?". Thanks to standardization of Scheme. Zelphir On 4/23/19 2:54 AM, Mark H Weaver wrote: > Hi Zelphir, > > Zelphir Kaltstahl writes: > >> I was looking for an assert facility in Guile and found the following: >> >> https://www.gnu.org/software/guile/manual/html_node/rnrs-base.html#rnrs-base >> >> (Search for assert there to find it on the page.) >> >> However, while searching, I also found something that looks even better: >> >> http://okmij.org/ftp/Scheme/assert-syntax-rule.txt >> >> Is that anywhere implemented in Guile already? > No. > >> (In case it is not implemented: What are the reasons for not providing >> that one? It looks a little bit more useful than the one I found.) > Well, no one has suggested it until now, and moreover I didn't even know > it existed :) Do you know if it's seen much use? Do any other Scheme > implementations include it? > > Correct me if I'm wrong, but I get the impression that this is something > that Oleg hacked up in an hour and posted ~15 years ago, but that it's > never seen much use. Also, I'm personally not fond of the API, which is > quite unconventional. > > The thing about assertion macros is that (1) they are usually trivial, > and (2) I'm not aware of any consensus in the Scheme community on what a > non-trivial assertion API should look like. I suspect this is why > there's no SRFI for assertion macros, despite the fact that anyone can > write a SRFI. > > For those who find the R6RS 'assert' macro unsatisfactory, I'm inclined > to suggest that each project should feel free to define their own > assertion macro according to their needs and preferences. > > Having said that, if you think you know a non-trivial assert API that > other Schemers would like to use, feel free to publish a library or > write a SRFI. If it becomes popular, we could consider including it > with Guile. > > Regards, > Mark