unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Vivien Kraus <vivien@planete-kraus.eu>
To: "Dr. Arne Babenhauserheide" <arne_bab@web.de>, guile-user@gnu.org
Subject: Re: define-typed: checking values on proc entry and exit
Date: Sat, 11 May 2024 10:18:06 +0200	[thread overview]
Message-ID: <691ca3a2aa40387f05bfa611983e242881aa116f.camel@planete-kraus.eu> (raw)
In-Reply-To: <871q6axg4s.fsf@web.de>

Hello!

This is an interesting approach, thank you.

Le vendredi 10 mai 2024 à 09:47 +0200, Dr. Arne Babenhauserheide a
écrit :
> │       ;; get the result
> │       (let ((res (helper)))
> │         ;; typecheck the result
> │         (unless (ret? res)
> │           (error "type error: return value ~a does not match ~a"
> │                  res ret?))
> │         ;; return the result
> │         res))

A nice improvement would be to support multiple return values, for
instance by using call-with-values, and checking the return value with
(apply ret? res) instead of (ret? res).

What do you think?

Best regards,

Vivien

  parent reply	other threads:[~2024-05-11  8:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  7:47 define-typed: checking values on proc entry and exit Dr. Arne Babenhauserheide
2024-05-10 22:49 ` Zelphir Kaltstahl
2024-05-14  1:39   ` Dr. Arne Babenhauserheide
2024-05-15  0:10     ` Dr. Arne Babenhauserheide
2024-05-21  2:30       ` Linas Vepstas
2024-05-11  2:48 ` Olivier Dion
2024-05-13  9:51   ` Ricardo Wurmus
2024-05-14  1:15   ` Dr. Arne Babenhauserheide
2024-05-11  8:18 ` Vivien Kraus [this message]
2024-05-14  1:34   ` Dr. Arne Babenhauserheide
2024-05-21  7:05 ` Damien Mattei
2024-06-19 22:29   ` Maxime Devos via General Guile related discussions

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=691ca3a2aa40387f05bfa611983e242881aa116f.camel@planete-kraus.eu \
    --to=vivien@planete-kraus.eu \
    --cc=arne_bab@web.de \
    --cc=guile-user@gnu.org \
    /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).