On 08/27/14 11:00, Peter Bex wrote: > On Wed, Aug 27, 2014 at 01:50:13AM +0400, Oleg Kolosov wrote: >> On 08/26/14 11:06, Peter Bex wrote: >> But what if I'm writing something like a shell scripts ... > > It sounds like you're looking for condition-case. I think this takes > care of the handling of various different kinds of exceptions in a very > elegant way, and it's actually my favorite part of the whole condition > system in CHICKEN (though, strictly speaking, not part of SRFI-12): > http://wiki.call-cc.org/man/4/Exceptions#additional-api >
Yes, looks like the condition-case is the way to go for the mentioned use cases. I've never seen it in real code though. Not sure why people avoid it. >> The essential part is the "type" of the error that happened, ideally a >> list of symbols. It is equally important for the caller and the handler. >> The symbols are words that form vocabulary. It is easier to agree on >> than data structures. > > That's exactly what condition-case leverages in order to offer its > convenience. I was trying to prove the point that having the simplest data model will pay off in the end, because I find the conditions (and records) very awkward to use in Scheme. This can be improved with macros and special forms of course, but isn't the LISP is all about manipulating a lists of things? Let's stop this. I feel guilty of taking the discussion too far from it's intended subject. Could you please look at an adjacent thread by Mario about the behaviour of set! on unbound variables? -- Regards, Oleg _______________________________________________ Chicken-hackers mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/chicken-hackers
