unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Zelphir Kaltstahl <zelphirkaltstahl@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: Guile assert macro
Date: Mon, 22 Apr 2019 20:54:59 -0400	[thread overview]
Message-ID: <87bm0xsfpd.fsf@netris.org> (raw)
In-Reply-To: <5017489f-1e55-a3db-07c9-c1158c3160f8@gmail.com> (Zelphir Kaltstahl's message of "Mon, 22 Apr 2019 20:57:32 +0200")

Hi Zelphir,

Zelphir Kaltstahl <zelphirkaltstahl@gmail.com> 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



  parent reply	other threads:[~2019-04-23  0:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-22 18:57 Guile assert macro Zelphir Kaltstahl
2019-04-22 19:36 ` Mike Gran
2019-04-22 21:52   ` Zelphir Kaltstahl
2019-04-23  0:54 ` Mark H Weaver [this message]
2019-04-23 20:47   ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bm0xsfpd.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).