unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>,
	Guile User <guile-user@gnu.org>
Subject: Re: Contracts macro example
Date: Tue, 19 Jul 2022 17:20:03 +0200	[thread overview]
Message-ID: <e8153fe2a13d0cfb719abbdeba5a462832fd936c.camel@telenet.be> (raw)
In-Reply-To: <a2ac0002-b3a1-7edf-87b1-1cfddc630513@posteo.de>

Zelphir Kaltstahl schreef op do 14-07-2022 om 23:55 [+0000]:
>           (make-assertion-failure)
>           (make-exception-with-message "assertion failed")
>           (make-exception-with-irritants (quote (op args* ...)))))]

Instead of a generic 'assertion failure', I believe a more specific
&contract-failure to be better.

Also, define*-with-contract / lambda*-with-contract would be nice.  

It would also be nice to define a global 'require' and 'ensure' and
'<?>' somewhere (e.g.: (define-syntax require (identifier-syntax
(syntax-error "'require' can only be used as part of a contract
construct")))), that way, require / ensure / <?> can be renamed during
importing, so all contract things could be prefixed with, say,
contract:.

     ;; `#t`, the neutral element of `and`.

Guile supports Unicode and UTF-8, so you can write ‘#t’ here instead of
`#t`.  Additionally, maybe #t -> #true?

Greetings,
Maxime.



  reply	other threads:[~2022-07-19 15:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 23:55 Contracts macro example Zelphir Kaltstahl
2022-07-19 15:20 ` Maxime Devos [this message]
2022-07-20  8:39   ` Zelphir Kaltstahl
2022-07-20  8:55     ` Maxime Devos
2022-07-24  1:21       ` Zelphir Kaltstahl
2022-08-04 16:19         ` Maxime Devos

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=e8153fe2a13d0cfb719abbdeba5a462832fd936c.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=guile-user@gnu.org \
    --cc=zelphirkaltstahl@posteo.de \
    /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).