guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macros, procedure->macro


From: Dirk Herrmann
Subject: Re: macros, procedure->macro
Date: Thu, 4 Jul 2002 22:16:48 +0200 (CEST)

On Wed, 3 Jul 2002, Dirk Herrmann wrote:

> On 1 Jul 2002, Gary Houston wrote:
> 
[...]
> > ./guile-core/oop/goops.scm:    (procedure->macro
> > ./guile-core/oop/goops.scm:  (procedure->macro
> > ./guile-core/oop/goops.scm:  (procedure->macro
> 
> Thanks for pointing these out.  I will take a look at them.
[...]

Except for the three places above, I think replacing procedure->macro with
procedure->memoizing-macro should be safe.

So what is so special about the uses of procedure->macro at the places
above?  They appear in the code for define-class, define-generic and
define-accessor.  In these macros, it is first checked whether the object
defined is already of the desired type.  That is, if you do a
(define-class foo ...), the define-class macro first checks if foo is
already a class.  If so, the class is re-defined, which means, already
existing objects of the former class will be re-defined together with
their class.  However, the macro define-class needs to check the
environment of the macro application in order to figure out, whether the
identifier to be defined was already bound to a class.

That is, these macros do actually make use of the dynamic nature of the
"macros".  It is not possible to simply replace them with mmacros.

Hmm?

Best regards,
Dirk




reply via email to

[Prev in Thread] Current Thread [Next in Thread]