🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.scheme.c
Article #202

macro question

#202
From: Kardan Kaveh
Date: Sun, 24 Jan 1993 05:10
40 lines
1737 bytes
In an effort to have my macro definitions exist in all my source files,
I have placed the following code in my init file:

(define-macro (define-macro-both pattern . body)
  `(begin
     (define-macro ,pattern ,@body)
     (syntax-table-define system-global-syntax-table ',(car pattern)
       (macro ,(cdr pattern)
         ,@body))))
 
(syntax-table-define user-initial-syntax-table 'define-macro-both
  (macro (pattern . body)
    `(begin
       (define-macro ,pattern ,@body)
       (syntax-table-define system-global-syntax-table ',(car pattern)
         (macro ,(cdr pattern)
           ,@body)))))
 
(set! syntaxer/default-environment user-initial-environment)

The first two forms are from the macros.txt documentation file.

These have the desired effect when the code is interpreted, but when I compile
a file containing a macro which refers to a function defined in the same file,
or a file refering to a macro defined elsewhere, the interpreter complains
about unbound variables.

What do I need to do to make macros behave, in compiled code, the same
as in interpreted code?

Thanks,

Kaveh


-- 
------------
Kaveh Kardan                                       kaveh@taarna.UUCP
Systeme Taarna                                     kardank@eole.umontreal.qc.ca
Montreal Quebec Canada                             (514)844-8448
Technical Details
Message-ID: <1993Jan24.051036.22605@cc.umontreal.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!charnel!sifon!CC.UMontreal.CA!kardank

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!olivea!charnel!sifon!CC.UMontreal.CA!kardank
From: kardank@ERE.UMontreal.CA (Kardan Kaveh)
Newsgroups: comp.lang.scheme.c
Subject: macro question
Message-ID: <1993Jan24.051036.22605@cc.umontreal.ca>
Date: 24 Jan 93 05:10:36 GMT
Sender: news@cc.umontreal.ca (Administration de Cnews)
Organization: Universite de Montreal
Lines: 40