From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Patrick Bernaud Newsgroups: gmane.lisp.guile.user Subject: Problem with define-macro from compiled file (Guile 1.9) Date: Thu, 6 Jan 2011 19:18:52 +0100 Message-ID: <19750.1932.709386.744882@vagabond.local> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1294341285 27906 80.91.229.12 (6 Jan 2011 19:14:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 6 Jan 2011 19:14:45 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jan 06 20:14:42 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PavIG-0000XR-US for guile-user@m.gmane.org; Thu, 06 Jan 2011 20:14:41 +0100 Original-Received: from localhost ([127.0.0.1]:51858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pav83-00016G-FL for guile-user@m.gmane.org; Thu, 06 Jan 2011 14:04:07 -0500 Original-Received: from [140.186.70.92] (port=48856 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PauLn-0001pF-9B for guile-user@gnu.org; Thu, 06 Jan 2011 13:14:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PauLg-0001Eo-Bh for guile-user@gnu.org; Thu, 06 Jan 2011 13:14:15 -0500 Original-Received: from smtp-154-thursday.nerim.net ([194.79.134.154]:59465 helo=maiev.nerim.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PauLg-0001EQ-7D for guile-user@gnu.org; Thu, 06 Jan 2011 13:14:08 -0500 Original-Received: from vagabond.local (chrstn.pck.nerim.net [213.41.144.149]) by maiev.nerim.net (Postfix) with ESMTPS id AE2E52E019 for ; Thu, 6 Jan 2011 19:14:06 +0100 (CET) Original-Received: from pat by vagabond.local with local (Exim 4.69) (envelope-from ) id 1PauQG-0006r2-Vz for guile-user@gnu.org; Thu, 06 Jan 2011 19:18:53 +0100 X-Mailer: VM 8.0.9 under Emacs 22.2.1 (i486-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8340 Archived-At: Hello, I have a case where a macro is defined in a file that is then loaded by another which makes use of the macro. And it produces a 'wrong type to apply' error from the VM. (Works fine with GUILE_AUTO_COMPILE=0 and compiled files removed). For example, with the 'when' macro from the manual: -%<---- when.scm ----%<- (define-macro (when cond exp . rest) `(if ,cond (begin ,exp . ,rest))) -%<---- when.scm ----%<- -%<---- test.scm ----%<- (load "when.scm") (when #t (display "Launching missiles!\n")) -%<---- test.scm ----%<- I get: $ guile -s test.scm Launching missiles! Backtrace: In ice-9/boot-9.scm: 170: 9 [catch #t # ...] In unknown file: ?: 8 [catch-closure] In ice-9/boot-9.scm: 62: 7 [call-with-prompt prompt0 ...] In ice-9/eval.scm: 389: 6 [eval # #] In ice-9/boot-9.scm: 1863: 5 [save-module-excursion #] 1171: 4 [load "test.scm" #f] In unknown file: ?: 3 [load-compiled/vm "/home/pat/.cache/guile/ccache/2.0-0.T-LE-4/home/pat/devel/guile/test.scm.go"] In test.scm: 2: 2 [#] In ice-9/boot-9.scm: 115: 1 [# wrong-type-arg ...] In unknown file: ?: 0 [catch-closure wrong-type-arg #f ...] ERROR: In procedure catch-closure: ERROR: Wrong type to apply: # $ Am I doing wrong something wrong? Regards, Patrick