From: Gerald Klix
Subject: Re: How can I make local bindings global ?
Date: 
Message-ID: <32860FEA.71DA75CE@mail.hassler.net>
John L. Stein wrote:

> STk>  (define-macro (make-txt-item! s e)
> `(define ,s (make <text-item>
>                 :parent c
>                 :coords (text-coords ,e)
>                 :text "<"
>                 :fill "red"
>                 :anchor "w"))
>                 )
> ...
> How can I make the binding global between the text items and members of S ?
Well thats a general scheme problem or feature.
If you define the macro like:
(define-macro (make-txt-item! s e)
  `(eval
    '(define ,s (make <text-item>
                      :parent c
                      :coords (text-coords ,e)
                      :text "<"
                      :fill "red"
                      :anchor "w"))
    ))
The variable symbol passed in s should be bound in the global
environment. 
In your example s should be rebound the envrionment of (lambda (s
e)...).
I strongly encourage you to change your macro package
to define variables in the local environment.
If the above code is part of another macro expansion program just pass
the expansion environment. It can be obtained with (the-emvironment).
Eval has a second optional argument, which can be used to specify the
evaluation environment.

Gerald Klix
PS: There is a special STk mailing list at ยทยทยท@kaolin.unice.fr.