From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Dr. Peter Ivanyi" Newsgroups: gmane.lisp.guile.user Subject: module system Date: Thu, 15 May 2003 13:42:38 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: <3EC38B3E.690B441@carme.sect.mce.hw.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053002695 15549 80.91.224.249 (15 May 2003 12:44:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 15 May 2003 12:44:55 +0000 (UTC) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu May 15 14:44:53 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 19GI4f-0003u8-00 for ; Thu, 15 May 2003 14:43:05 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GI5Y-0005nl-06 for guile-user@m.gmane.org; Thu, 15 May 2003 08:44:00 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19GI58-0005Pb-00 for guile-user@gnu.org; Thu, 15 May 2003 08:43:34 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19GI4k-00050d-00 for guile-user@gnu.org; Thu, 15 May 2003 08:43:12 -0400 Original-Received: from carme.sect.mce.hw.ac.uk ([137.195.68.1]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19GI4Q-0004X1-00 for guile-user@gnu.org; Thu, 15 May 2003 08:42:51 -0400 Original-Received: from carme.sect.mce.hw.ac.uk (mercury.sect.mce.hw.ac.uk [137.195.68.189])h4FD4qjX023151 for ; Thu, 15 May 2003 14:04:52 +0100 X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.15-3SGI_39 i686) X-Accept-Language: en Original-To: "guile-user@gnu.org" X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1952 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1952 Hi, I would like to be able to define a module in the "same" way for guile, bigloo and plt-scheme, but mostly the first two. I know guile a little better so I thought I will try to modify the behaviour of guile. In bigloo a module is defined with (module ...) format. So I thought I will write a macro which transforms the bigloo module definition to guile format. And here I have a little problem. I have two files: ------------------------------ l.scm ---------------------------- (define-macro (module args) `(define-module ',@args) ) (use-modules (m m)) (display var)(newline) (set! var 5) (display var)(newline) ------------------------------------------------------------------ ------------------------------- m/m.scm -------------------------- (module (m m)) (export var) (define var #f) ------------------------------------------------------------------ Running this gives the following: peteri@mercury $ guile -s l.scm ERROR: no code for module (m m) If in "l.scm" I use (defmacro module args `(define-module ',@args) ) it gives: peteri@mercury $ guile -s l.scm ERROR: In procedure variable-set-name-hint!: ERROR: Wrong type argument in position 2 (expecting SYMBOLP): (m m) However if I copy the define-module from "boot-9.scm" into "l.scm" and rename it to "module" it works. I would like to avoid copying macro from "boot-9.scm". Can somebody help me to sort out what I am doing wrong? With the first variation why could it not find the code? The module macro should expand into the define-module macro which expands further and then I should have the same effect. But obviously something else is happening. Thanks for any help. Peter Ivanyi _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user