Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!corton!ilog!barbes!davis From: davis@barbes.ilog.fr (Harley Davis) Newsgroups: comp.lang.scheme Subject: Re: catch/throw in scheme - how to ?? Message-ID: Date: 13 Jun 91 11:22:10 GMT References: <1991Jun10.124127.17926@eua.ericsson.se> <502@data.UUCP> Sender: davis@ilog.fr Organization: ILOG S.A., Gentilly, France Lines: 28 In-reply-to: raible@nas.nasa.gov's message of 12 Jun 91 08:38:33 GMT In article raible@nas.nasa.gov (Eric Raible) writes: In article <502@data.UUCP> kend@data.UUCP (Ken Dickey) writes: Just use your local syntax system to define the syntactic transformation: (catch . ) --> (call/cc (throw) ) Then you can (throw ) from within . -Ken Dickey kend@data.uucp Don't you mean this: (catch . ) --> (call/cc (lambda (throw) )) In any case, this implements BLOCK and RETURN-FROM, not CATCH and THROW. CATCH/THROW requires a dynamic scope for the THROW procedure, which is difficult (!) to implement just using CALL/CC. The other proposed solution was correct, though, if not very efficient. -- Harley Davis -- ------------------------------------------------------------------------------ nom: Harley Davis ILOG S.A. net: davis@ilog.fr 2 Avenue Gallie'ni, BP 85 tel: (33 1) 46 63 66 66 94253 Gentilly Cedex, France