GNU bug report logs -
#14922
guard expression doesn't catch everything
Previous Next
Reported by: Göran Weinholt <goran <at> weinholt.se>
Date: Sun, 21 Jul 2013 09:30:04 UTC
Severity: normal
Done: Mark H Weaver <mhw <at> netris.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#14922: guard expression doesn't catch everything
which was filed against the guile package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 14922 <at> debbugs.gnu.org.
--
14922: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14922
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Sorry for the long delay on this.
Göran Weinholt <goran <at> weinholt.se> writes:
> Mark H Weaver <mhw <at> netris.org> writes:
>
>> Hello all,
>>
>> I've cooked up a patch to help improve R6RS exception handling in Guile.
>>
>> As noted by Göran Weinholt in <http://bugs.gnu.org/14922>, the R6RS
>> exception handlers in Guile are currently unable to catch native Guile
>> exceptions. To fix this, the basic approach of this patch is to convert
>> native Guile exceptions into R6RS conditions within the R6RS exception
>> handlers.
> [...]
>> I'd be grateful for any feedback.
>
> I think it's the right approach to take. I've tested the patch a little
> and it's an improvement over the current state of affairs.
I went ahead and pushed this patch to stable-2.0. We can work on
incrementally improving it from there.
I'm closing this bug <http://bugs.gnu.org/14922>.
Thanks!
Mark
[Message part 3 (message/rfc822, inline)]
[Message part 4 (text/plain, inline)]
Hello schemers,
the guard expression from (rnrs) would be a lot more useful if it
managed to catch all exceptions. As it is now, some errors will bypass
the guard:
scheme@(guile-user)> (import (rnrs))
scheme@(guile-user)> (guard (exn (else #f)) (fx+ #f #f))
$1 = #f
scheme@(guile-user)> (guard (exn (else #f)) (fx+))
;;; <stdin>:3:0: warning: possibly wrong number of arguments to `fx+'
rnrs/arithmetic/fixnums.scm:153:2: In procedure fx+:
rnrs/arithmetic/fixnums.scm:153:2: Wrong number of arguments to #<procedure fx+ (fx1 fx2)>
The background is that I'm working on a program that intentionally calls
procedures with bad arguments, and it needs to determine if the
procedure accepted the arguments or not. Ideally the object raised would
be a proper and correct R6RS condition object, but I suspect that most
of the existing Guile code doesn't raise conditions like that. I think
it would be a step forward if guard at least caught the exception, even
if the condition object might not be very useful.
Tested with Guile 2.0.9.40-824b-dirty.
Regards,
--
Göran Weinholt <goran <at> weinholt.se>
"Bring me back // to a story left untold // so we can write the ending."
-- Aly & Fila feat. Jwaydan - We Control The Sunlight
[Message part 5 (application/pgp-signature, inline)]
This bug report was last modified 11 years and 247 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.