[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: macros, procedure->macro
From: |
Marius Vollmer |
Subject: |
Re: macros, procedure->macro |
Date: |
07 Jul 2002 20:15:02 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
Dirk Herrmann <address@hidden> writes:
> So what is so special about the uses of procedure->macro at the places
> above?
>
> [checking for redefinitions.]
We need to restrict this redefining behavior of 'define-class' et all
to the top-level. Local class definitions should not redefine classes
outside of their scope (that would lead to a funny version of dynamic
scoping of classes, eew), and redefinitions directly in one scope
should be an error, just like any other definitions.
For example,
(let ((foo (find-class "<moo>")))
(define-class foo ...)
...)
should not try to redefine the class that is the value of the location
bound to foo by the let. It should simply shadow the outer foo.
Also,
(let ()
(define-class foo ...)
(define-class foo ...)
...)
should be an error, just like
(let ()
(define foo ...)
(define foo ...))
Redefinitions on the top-level do make sense and can be supported by a
normal macro via explicit module manipulations, i.e.
(define-class foo ...)
=>
(module-define-class (current-module) 'foo ...)
with
(define (module-define-class mod sym ...)
(let* ((var (module-ensure-local-variable! mod 'foo))
(class (make-class ...)))
(if (variable-bound? var)
(redefine-class (variable-ref var) class))
(variable-set! var class)))
- Re: macros, procedure->macro, (continued)
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/13
- Re: macros, procedure->macro, Neil Jerram, 2002/07/14
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/14
- Re: macros, procedure->macro, Marius Vollmer, 2002/07/15
- Re: macros, procedure->macro, Neil Jerram, 2002/07/15
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/16
Re: macros, procedure->macro, Dirk Herrmann, 2002/07/03
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/04
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/10
- Re: macros, procedure->macro, Dirk Herrmann, 2002/07/13
- Re: macros, procedure->macro, Marius Vollmer, 2002/07/13