[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] how the second argument to ERROR is handled
From: |
Peter Bex |
Subject: |
Re: [Chicken-users] how the second argument to ERROR is handled |
Date: |
Sun, 21 Jul 2019 09:48:16 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Sun, Jul 21, 2019 at 09:03:33AM +0200, Marco Maggi wrote:
> Ciao,
>
> with CHICKEN 5.1.0, is the following correct:
>
> (import (scheme) (chicken base) (chicken condition))
>
> (call/cc
> (lambda (escape)
> (with-exception-handler
> (lambda (E)
> (escape (list (get-condition-property E 'exn 'location)
> (get-condition-property E 'exn 'message)
> (get-condition-property E 'exn 'arguments))))
> (lambda ()
> (error 1 2 3)))))
> => '(#f 1 (2 3))
>
> or should the "message" property be #f?
Hi Marco,
This looks fine to me. The first argument to "error" should always
be the message. You could argue that it should check for it to be
a string, but I'm not sure that's required.
The docs seem to suggest that the reason string is optional. I think
this is wrong.
Cheers,
Peter
signature.asc
Description: PGP signature