On Thu, Aug 28, 2014 at 09:41:01AM +0400, Oleg Kolosov wrote: > On 08/27/14 11:00, Peter Bex wrote: > > 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.
I've seen it used in several eggs, and I always use it whenever I want to catch exceptions of a specific type. Core doesn't use it because it doesn't really catch any specific exceptions, it just generates them :) > >> 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? I sort-of understand what you mean. > Let's stop this. I feel guilty of taking the discussion too far from > it's intended subject. OK, end of discussion :) > Could you please look at an adjacent thread by Mario about the behaviour > of set! on unbound variables? We've talked about this on IRC a bit. I think it is desirable to fix it, but this may be very difficult. Christian said he'd dig into it, and he also came to the conclusion that further refactorings are necessary before it is achievable. In particular, the removal of ##sys#alias-global-hook (ticket #1131), which has been a bit of a pet project of mine (the compiler modularisation is the first step towards that, strange as that may sound - this allows us to remove a small piece of functionality in ##sys#alias-global-hook, which would allow us to also fix #1077). So, we're working on it :) Cheers, Peter -- http://www.more-magic.net _______________________________________________ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers