From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: =?iso-8859-1?Q?"Dirk=20E=DFer"?= Newsgroups: gmane.lisp.guile.user Subject: Re: I can't seem to get throw/catch to work Date: Wed, 30 Jul 2003 16:22:17 +0200 Organization: http://freemail.web.de/ Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <200307301422.h6UEMGQ22684@mailgate5.cinetic.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1059576077 13750 80.91.224.249 (30 Jul 2003 14:41:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 30 Jul 2003 14:41:17 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jul 30 16:41:10 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19hry6-0002FD-00 for ; Wed, 30 Jul 2003 16:30:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19hrwF-0006DN-C6 for guile-user@m.gmane.org; Wed, 30 Jul 2003 10:28:23 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19hrvK-0005o7-7A for guile-user@gnu.org; Wed, 30 Jul 2003 10:27:26 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19hrtX-00054H-Sp for guile-user@gnu.org; Wed, 30 Jul 2003 10:25:36 -0400 Original-Received: from mailgate5.cinetic.de ([217.72.192.165]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19hrqN-0003iY-Q9 for guile-user@gnu.org; Wed, 30 Jul 2003 10:22:20 -0400 Original-Received: from web.de (fmomail02.dlan.cinetic.de [172.20.1.46]) by mailgate5.cinetic.de (8.11.6p2/8.11.2/SuSE Linux 8.11.0-0.4) with SMTP id h6UEMGQ22684 for guile-user@gnu.org; Wed, 30 Jul 2003 16:22:17 +0200 Original-To: guile-user@gnu.org Precedence: fm-user X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.2 List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:2120 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:2120 Tim Brown schrieb am 30.07.03 13:25:12: [ ... ] > guile> (catch #t (throw 'foo) (lambda (key . args) (display key) (newlin= e))) > guile> (catch #t (/ 1 0) (lambda (key . args) (display key) (newline))) AFAIK, catch is not a special form (as it is in CL), but a procedure, whic= h takes procedures as arguments: (catch THE-KEY-TO-CATCH BODY-THUNK HANDLER-THUNK) where BODY-THUNK is a procedure (lambda () ...), and HANDLER-THUNK is something like (lambda (key . rest) ...) So, (catch #t (lambda () (throw =B4foo)) (lambda (key . rest) ...)) (catch #t (lambda () (/ 1 0)) (lambda (key . rest) ...)) should actually do, what you expect. The mistake in the original examples was, that due to catch being a proced= ure, (throw =B4foo) and (/ 1 0) are actually evaluated as part of the standard ar= gument evaluation process, which happens before the actual call; the catch-handle= r is installed during execution of BODY-THUNK inside catch. But since evaluatin= g arguments fails, catch itself is never actually called. -- dirk =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F Spam-Filter fuer alle - bester Spam-Schutz laut ComputerBild 15-03 WEB.DE FreeMail - Deutschlands beste E-Mail - http://s.web.de/=3Fmc=3D021120 _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user