guile-user
[Top][All Lists]
Advanced

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

Re: define-typed: checking values on proc entry and exit


From: Vivien Kraus
Subject: Re: define-typed: checking values on proc entry and exit
Date: Sat, 11 May 2024 10:18:06 +0200
User-agent: Evolution 3.48.4

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

reply via email to

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