scsh-users
[Top] [All Lists]

Macro loading problem

To: scsh-news@zurich.csail.mit.edu
Subject: Macro loading problem
From: Sławek Żak <szak@era.pl>
Date: Mon, 22 Dec 2003 16:55:21 +0100
Organization: http://news.icm.edu.pl/
I try to define structure which contains some macros. I can't figure how to
acomplish this. The code goes like this:

    ;; macrolib.scm
    (define-structure macrolib (export when)
                  (open scheme)
                  (files macros))

    ;; macros.scm
    (define-syntax when
     (syntax-rules ()
      ((_ test body ...)
       (if test
         (begin
            body ...)))))

I run it from commandline:
    
% scsh lp+ . -ll macrolib.scm -o macrolib -c '(when #f (display "ok"))'

Warning: invalid variable reference
         when
         #{Package 167 user}
ok
Error: undefined variable
       when
       (package macrolib)

I thought that `when' shouldn't bee listed in the export list, but without it 
call
to when fails too.

Thanks, /S

<Prev in Thread] Current Thread [Next in Thread>