[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Exceptions
From: |
Ludovic Courtès |
Subject: |
Exceptions |
Date: |
Mon, 26 Sep 2005 14:23:29 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
Vorfeed Canal <address@hidden> writes:
> 2. No way to use standard (for modern languages like C++, PHP or Java)
> scheme with throw/catch and EXCEPTIONS HIERARCHY.
[...]
> About second problem. GNU Kawa (if we are talking about GNU GUILE it
> makes sense to borrow from GNU Kawa, right?) has the following
> solution to this problem:
>
> http://per.bothner.com/tmp/kawa/Exceptions.html
>
> primitive-throw exception
>
> Throws the exception, which must be an instance of a sub-class of
> <java.lang.Throwable>.
Well, this is the object-oriented approach to exceptions. That doesn't
mean you can't obtain a similar result using Guile's current exception
mechanism.
In particular, the KEY arg passed to `throw' and `catch' can be thought
of as the ``class'' of the exception being thrown/caught. One of the
additional arguments can be thought of as a subtype of the exception
(see, for instance, `system-error' and `system-error-errno').
Admittedly, this may sometimes be more verbose than the use of a class
hierarchy mechanism.
Fortunately, `guile-library' contains an implementation of SRFI-35's
hierarchical error conditions, and both `guile-library' and Guile (1.7)
implement SRFI-34's exception handling routines. Only SRFI-36 (I/O
error conditions) is missing.
So I guess there's no valid reason not to use Guile. :-)
Ludovic.
- Re: PHP to GUILE, (continued)
- Re: PHP to GUILE, Vorfeed Canal, 2005/09/26
- Re: PHP to GUILE, Thien-Thi Nguyen, 2005/09/26
- Message not available
- Re: PHP to GUILE, Vorfeed Canal, 2005/09/26
- Re: PHP to GUILE, Thien-Thi Nguyen, 2005/09/26
- Re: PHP to GUILE, Vorfeed Canal, 2005/09/27
- Re: PHP to GUILE, Thien-Thi Nguyen, 2005/09/27
- Re: PHP to GUILE, Vorfeed Canal, 2005/09/27
- Re: PHP to GUILE, Thien-Thi Nguyen, 2005/09/27
- Re: PHP to GUILE, Vorfeed Canal, 2005/09/27
- Re: PHP to GUILE, Thien-Thi Nguyen, 2005/09/27
Exceptions,
Ludovic Courtès <=
- Re: Exceptions, Vorfeed Canal, 2005/09/26
- Re: Exceptions, Ludovic Courtès, 2005/09/27
- Re: Exceptions, Vorfeed Canal, 2005/09/27
- Re: Exceptions, Ludovic Courtès, 2005/09/27
- Re: Exceptions, Vorfeed Canal, 2005/09/27
- Managing Guile and extensions versions, Ludovic Courtès, 2005/09/28
- Re: Managing Guile and extensions versions, Vorfeed Canal, 2005/09/28
- Re: Managing Guile and extensions versions, Ludovic Courtès, 2005/09/29
- Re: Managing Guile and extensions versions, Vorfeed Canal, 2005/09/29
- Re: Managing Guile and extensions versions, Neil Jerram, 2005/09/30