From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: Guile assert macro Date: Mon, 22 Apr 2019 20:54:59 -0400 Message-ID: <87bm0xsfpd.fsf@netris.org> References: <5017489f-1e55-a3db-07c9-c1158c3160f8@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="46119"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: guile-user@gnu.org To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Apr 23 03:10:48 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 1hIjxP-000Bsz-R1 for guile-user@m.gmane.org; Tue, 23 Apr 2019 03:10:47 +0200 Original-Received: from localhost ([127.0.0.1]:46380 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIjxO-0002Pg-Or for guile-user@m.gmane.org; Mon, 22 Apr 2019 21:10:46 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hIjwo-0002IP-57 for guile-user@gnu.org; Mon, 22 Apr 2019 21:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hIjjl-0007xR-N6 for guile-user@gnu.org; Mon, 22 Apr 2019 20:56:43 -0400 Original-Received: from world.peace.net ([64.112.178.59]:44746) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hIjjk-0007vT-HA for guile-user@gnu.org; Mon, 22 Apr 2019 20:56:41 -0400 Original-Received: from mhw by world.peace.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hIjji-0003ia-ME; Mon, 22 Apr 2019 20:56:38 -0400 In-Reply-To: <5017489f-1e55-a3db-07c9-c1158c3160f8@gmail.com> (Zelphir Kaltstahl's message of "Mon, 22 Apr 2019 20:57:32 +0200") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.112.178.59 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:15414 Archived-At: 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