Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Hi all, continuing my experiments to catch exceptions in chicken, I've been working out a more core-chicken-only example. > > > Let's see. Is this correct as a minimal example? > > > --- %< tg.scm > > > (require-extension srfi-34) > > > (print (guard (ex (else 'success)) (call-with-input-st

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Ivan Raikov
What version of Chicken is this on? Your code works fine on my system (Chicken 3.3.0): $ ./tg condition-case-does-a-better-job-than-guard Jörg "F. Wittenberger" <[EMAIL PROTECTED]> writes: > > Now I tried: > > --- %< tg.scm > (require-extension ports) > (print (condition-case > (c

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 18:06 +0900 schrieb Ivan Raikov: > What version of Chicken is this on? Your code works fine on my > system (Chicken 3.3.0): > > $ ./tg > condition-case-does-a-better-job-than-guard chicken -version CHICKEN (c)2008 The Chicken Team (c)2000-2007 Felix L. Winkelmann Ver

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Ivan Raikov
I get: csi> (print (guard (ex (else 'success)) (call-with-input-string ")" read))) success The official Debian package is based on development release 3.2.7, which is identical to stable release 3.3.0. -Ivan Jörg "F. Wittenberger" <[EMAIL PROTECTED]> writes: > Ivan, could you try this one

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
i explained this already. you want with-input-from-string. not call-with-input-string -elf On Tue, 29 Jul 2008, Jörg F. Wittenberger wrote: Hi all, continuing my experiments to catch exceptions in chicken, I've been working out a more core-chicken-only example. Let's see. Is this correct

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
#;1> (condition-case (with-input-from-string ")" read) (var () "no prob")) "no prob" #;2> (condition-case (call-with-input-string ")" read) (var () "no prob")) "no prob" #;3> On Tue, 29 Jul 2008, Jörg F. Wittenberger wrote: Am Dienstag, den 29.07.2008, 18:06 +0900 schrieb Ivan Raikov: What v

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
ERR Double checked: it's SRFI-34, which is in the way! I accidentally left (require-extension srfi-34) in the code I compiled to test condition-case. Once removed, the error get caught. So we have the bug in srfi-34.egg - definately. Am Dienstag, den 29.07.2008, 11:35 +0200 schrieb Jörg

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 02:56 -0700 schrieb Elf: > i explained this already. > you want with-input-from-string. > not call-with-input-string and I answered already, that *I* pretty sure call-with-input-string should be ok too, since it's just direct passing of the port instead of passing via

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
#;1> (use srfi-34) ; loading /usr/lib/chicken/3/srfi-34.scm ... ; loading /usr/lib/chicken/3/syntax-case.so ... ; loading /usr/lib/chicken/3/syntax-case-chicken-macros.scm ... ; loading library srfi-18 ... #;2> (print (guard (ex (else 'success)) (with-input-from-string ")" read))) success #;3> (co

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 03:21 -0700 schrieb Elf: > #;1> (use srfi-34) > ; loading /usr/lib/chicken/3/srfi-34.scm ... > ; loading /usr/lib/chicken/3/syntax-case.so ... > ; loading /usr/lib/chicken/3/syntax-case-chicken-macros.scm ... > ; loading library srfi-18 ... > #;2> (print (guard (ex (els

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
the reason for the incompatibilities is that chicken uses the srfi-12 exception model, not the srfi-34, as the srfi-12 model is cleaner, more flexible, and doesnt require six other srfis in order to work. -elf On Tue, 29 Jul 2008, Jörg F. Wittenberger wrote: Am Dienstag, den 29.07.2008, 03

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 04:48 -0700 schrieb Elf: > > the reason for the incompatibilities is that chicken uses the srfi-12 > exception model, not the srfi-34, as the srfi-12 model is cleaner, > more flexible, and doesnt require six other srfis in order to work. I'm not (yet) interested in a

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
srfi-34 is meaningless without srfi-35 and srfi-36. nothing in srfi-34 details the actual format of exceptions/conditions. all of this is self-contained in srfi-12. the reason for srfi-12's withdrawl was not because of any flaws inherent in srfi-12, but because william clinger, the author,

Re: [Chicken-users] catching exceptions

2008-07-29 Thread Elf
furthermore, srfi-34 can be written entirely in terms of srfi-12, while the reverse is not true. -elf On Tue, 29 Jul 2008, Elf wrote: srfi-34 is meaningless without srfi-35 and srfi-36. nothing in srfi-34 details the actual format of exceptions/conditions. all of this is self-contained i

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 05:17 -0700 schrieb Elf: > srfi-34 is meaningless without srfi-35 and srfi-36. nothing in srfi-34 > details the actual format of exceptions/conditions. Maybe I'm the only one, but I consider this separation of concern an advantage of srfi-34 over srfi-12. While it's

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 05:26 -0700 schrieb Elf: > furthermore, srfi-34 can be written entirely in terms of srfi-12, while the > reverse is not true. Great! So far I have neither an idea how that could be done nor have I shown the mental or social capability to aquire the relevant knowledge.

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
BTW: I just compared with SRFI-18: (raise obj) ;procedure Calls the current exception handler with obj as the single argument. obj may be any Scheme object. Looks to me as if chicken was not compatible with srfi-18 either. _

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 14:55 +0200 schrieb Jörg F. Wittenberger: > Am Dienstag, den 29.07.2008, 05:26 -0700 schrieb Elf: > > furthermore, srfi-34 can be written entirely in terms of srfi-12, while the > > reverse is not true. > > Great! > > So far I have neither an idea how that could be do

Re: [Chicken-users] catching exceptions

2008-07-29 Thread felix winkelmann
On Tue, Jul 29, 2008 at 3:05 PM, Jörg F. Wittenberger <[EMAIL PROTECTED]> wrote: > BTW: I just compared with SRFI-18: > > (raise obj) ;procedure > >Calls the current exception handler with obj as the single >argument. obj may be any Scheme o

Re: [Chicken-users] catching exceptions

2008-07-29 Thread F. Wittenberger
Am Dienstag, den 29.07.2008, 18:19 +0200 schrieb felix winkelmann: > On Tue, Jul 29, 2008 at 3:05 PM, Jörg F. Wittenberger > <[EMAIL PROTECTED]> wrote: > > BTW: I just compared with SRFI-18: > > > > (raise obj) ;procedure > > > >Calls the current ex