Hi,

Vorfeed Canal <[EMAIL PROTECTED]> 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.


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-user

Reply via email to