I’ve expected ‘with-exception-handler’ to behave like ‘catch’, but it doesn’t.
scheme@(guile-user)> ,use (srfi srfi-34) scheme@(guile-user)> (with-exception-handler (const "got it") (lambda () (raise "boom!"))) ice-9/boot-9.scm:106:20: In procedure #<procedure 94b0e40 at ice-9/boot-9.scm:97:6 (thrown-k . args)>: ice-9/boot-9.scm:106:20: Throw to key `srfi-34' with args `("boom!")'. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> scheme@(guile-user)> (catch 'misc-error (lambda () (error "boom!")) (const "got it")) $1 = "got it" Is there an explanation that doesn’t involve diving into the land of continuations and dynamic wind? I mean, when should I use the one but not the other?
pgpcs9JMLfLYC.pgp
Description: PGP signature