[Top][All Lists]

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

Re: Guile assert macro

From: Zelphir Kaltstahl
Subject: Re: Guile assert macro
Date: Tue, 23 Apr 2019 22:47:58 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

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

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 ; )


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 <some Scheme dialect here>?". Thanks to
standardization of Scheme.


On 4/23/19 2:54 AM, Mark H Weaver wrote:
> 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?
> 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

reply via email to

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