[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guile assert macro

From: Mark H Weaver
Subject: Re: Guile assert macro
Date: Mon, 22 Apr 2019 20:54:59 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Hi Zelphir,

Zelphir Kaltstahl <address@hidden> writes:

> I was looking for an assert facility in Guile and found the following:
> (Search for assert there to find it on the page.)
> However, while searching, I also found something that looks even better:
> Is that anywhere implemented in Guile already?


> (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]