chicken-users
[Top][All Lists]
Advanced

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

Re: I'm missing something obvious about (chicken conditions)


From: Peter Bex
Subject: Re: I'm missing something obvious about (chicken conditions)
Date: Wed, 8 Mar 2023 08:35:19 +0100

On Tue, Mar 07, 2023 at 04:40:15PM -0500, T. Kurt Bond wrote:
> I've got two programs, edited down from other slightly larger programs
> for clarity.  They use condition-case to handle exceptions.  I'm
> interested in handling a (mine) condition and a (mine too)
> differently.  One of the program *does* distinguish between the two
> exceptions; one of them doesn't.  I can't figure out why.

Yeah, took me a while to spot the difference as well.  Let me highlight
the relevant lines:

> (define mine-two (condition '(mine) '(two)))
> 
...
>   (condition-case (thunk)
>     [ex (mine too)
>         (format #t "This is a (mine too) condition: ~s~%" ex)]
...
> (check (lambda () (signal mine-two)))
> (check (lambda () (signal (condition '(mine) '(two)))))

Note that in the condition-case you have "mine too", while here it's
"mine two".  One letter difference :)

Cheers,
Peter

Attachment: signature.asc
Description: PGP signature


reply via email to

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