Re: Couple of questions regarding handling exceptions

2025-02-08 Thread Maxime Devos
e for representing otherwise unconverted 'old' exceptions, of which I assume there is a method to extract all the relevant information (a bit more cumbersome perhaps, but it avoids the potential unwinding & re-raising/throwing trouble). Although, that doesn't seem backwards-compatible

Re: Couple of questions regarding handling exceptions

2025-02-07 Thread Tomas Volf
Maxime Devos via General Guile related discussions writes: > On 5/02/2025 1:38, Tomas Volf wrote: >> Hello, >> >> I would like to dispatch exceptions based on errno, in particular to >> return #f on ENOENT, and re-raise the exception otherwise. My current >&

Re: Couple of questions regarding handling exceptions

2025-02-05 Thread Maxime Devos via General Guile related discussions
On 5/02/2025 1:38, Tomas Volf wrote: Hello, I would like to dispatch exceptions based on errno, in particular to return #f on ENOENT, and re-raise the exception otherwise. My current (working as far as I can tell) solution is: (with-exception-handler (λ (exc) (and (not

Couple of questions regarding handling exceptions

2025-02-04 Thread Tomas Volf
Hello, I would like to dispatch exceptions based on errno, in particular to return #f on ENOENT, and re-raise the exception otherwise. My current (working as far as I can tell) solution is: --8<---cut here---start->8--- (with-exception-handler

Re: Example of defining and using exceptions

2020-10-24 Thread Zelphir Kaltstahl
exception style in guile, i.e. define- > exception-type and friends. However, I don't understand how compound > exceptions work. Do you have an example of using exceptions, showing > what compound exceptions can bring? > > Best regards, > > divoplade > > -- repositories: https://notabug.org/ZelphirKaltstahl

Example of defining and using exceptions

2020-10-24 Thread divoplade
Dear guile hackers, I would like to use the "new" exception style in guile, i.e. define- exception-type and friends. However, I don't understand how compound exceptions work. Do you have an example of using exceptions, showing what compound exceptions can bring? Best regards, divoplade

Re: Exceptions that pass continuations

2013-07-19 Thread Thien-Thi Nguyen
() Panicz Maciej Godek () Fri, 19 Jul 2013 15:52:30 +0200 > In this case, are OpenGL "lights" not amenable to wrapping as a SMOB? I've been considering making new type for lights -- perhaps that would be a little more introspective -- but it turned out more efficient to represent the

Re: Exceptions that pass continuations

2013-07-19 Thread Taylan Ulrich B.
I agree with Thien on that all resource-management should be delegated to the garbage collector via smob types. However, I found this supply-demand pattern quite neat (could have other uses perhaps), was kind of bored, with a little free time on my hands, and enjoy an occasional exercise in delimi

Re: Exceptions that pass continuations

2013-07-19 Thread Panicz Maciej Godek
2013/7/19 Thien-Thi Nguyen > () Panicz Maciej Godek > () Fri, 19 Jul 2013 12:39:55 +0200 > >and the whole thing can be used as follows > >(let ((resources '())) > (supply (((release-resource r) > (set! r (cons r resources >(let ((r (allocate-resource)))

Re: Exceptions that pass continuations

2013-07-19 Thread Thien-Thi Nguyen
() Panicz Maciej Godek () Fri, 19 Jul 2013 12:39:55 +0200 and the whole thing can be used as follows (let ((resources '())) (supply (((release-resource r) (set! r (cons r resources (let ((r (allocate-resource))) (demand 'release-resource r)

Exceptions that pass continuations

2013-07-19 Thread Panicz Maciej Godek
Recently I had to solve the following design problem: I was implementing a high-level wrapper for OpenGL lights. In order to use the lights, I had to allocate them before drawing an OpenGL scene, and then release them after the scene has been drawn. Initially, I wrote a comment in the function tha

C++ exceptions

2010-12-06 Thread Hans Aberg
There is an option gcc -fexceptions that the manual says generates exception frames for all functions. As Guile is a library that may open C++ files (and of other languages that may throw exceptions), should it not have it in available at least in some form? (Guile depends on some other

Re: eval and exceptions

2008-08-13 Thread Maciek Godek
cedric cellier: > For the concern about malicious users I will address this later, when > and if eventually there will be any actual user :) OK, let me know how's the progress sometime, because I'm extremely interested in the topic >> I've been trying to address this problem by implementing a ne

Re: eval and exceptions

2008-08-11 Thread cedric cellier
> Well, you can call your "eval-string" inside a catch, for example: > (catch #t (lambda()(eval-string packet)) (lambda (key . args) #f)) Yes, it works ! I've tried it with srfi-34 extention module (guard) but for some reason guard does not catch this kind of errors, while the genuine catch works.

Re: eval and exceptions

2008-08-11 Thread Maciek Godek
Cedric Cellier: > In the attempt to drastially reduce the work required for a little > project (a small wargame), I want to use guile to "box" the game engine > (that is to be) written in C. I also want the players GUI to be > connected to the game via sockets established by guile (15 lines of > c

eval and exceptions

2008-08-10 Thread Cedric Cellier
Hi you all in there ! In the attempt to drastially reduce the work required for a little project (a small wargame), I want to use guile to "box" the game engine (that is to be) written in C. I also want the players GUI to be connected to the game via sockets established by guile (15 lines of code,

C++ Exceptions + Guile = ?

2007-01-15 Thread Lucas (a.k.a T-Bird or bsdfan3)
to have C++ exceptions that may be thrown by the library unwind correctly through calls to its C API? Please CC me, as I am not subscribed to the list. ___ Guile-user mailing list Guile-user@gnu.org http://lists.gnu.org/mailman/listinfo/guile-user

Re: Exceptions

2005-09-27 Thread Vorfeed Canal
On 9/27/05, Ludovic Courtès <[EMAIL PROTECTED]> wrote: > Hello, > > Vorfeed Canal <[EMAIL PROTECTED]> writes: > > > 1. Not really: > > A. They are usually useless for programs not linked to guile - and > > such programs will know where to find them anyway since libguile will > > know this. > > Li

Re: Exceptions

2005-09-27 Thread Ludovic Courtès
Hello, Vorfeed Canal <[EMAIL PROTECTED]> writes: > 1. Not really: > A. They are usually useless for programs not linked to guile - and > such programs will know where to find them anyway since libguile will > know this. Libguile knows where _any_ third party library (the shared object) gets in

Re: Exceptions

2005-09-27 Thread Vorfeed Canal
On 9/27/05, Ludovic Courtès <[EMAIL PROTECTED]> wrote: > Hi, > > Vorfeed Canal <[EMAIL PROTECTED]> writes: > > > But what about GUILE extensions written in C ? Lack of sane > > place to put C glue libraries bothers me. > > Extension libraries written in C can also be thought of as actual > librarie

Re: Exceptions

2005-09-27 Thread Ludovic Courtès
Hi, Vorfeed Canal <[EMAIL PROTECTED]> writes: > But what about GUILE extensions written in C ? Lack of sane > place to put C glue libraries bothers me. Extension libraries written in C can also be thought of as actual libraries (for example, they may export C functions that wrap/unwrap Scheme ob

Re: Exceptions

2005-09-26 Thread Vorfeed Canal
o use Guile. :-) > Not yet. At least with object hierarchy of exceptions answer now looks clear: there are different but equally sane solution OUTSIDE of GUILE core. Ok. But what about GUILE extensions written in C ? Lack of sane place to put C glue libraries bothers me. Not since this is such a

Exceptions

2005-09-26 Thread Ludovic Courtès
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 fr