[Top][All Lists]

[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: Wed, 3 Jul 2002 22:08:16 +0200 (CEST)

On 1 Jul 2002, Gary Houston wrote:

> > From: Dirk Herrmann <address@hidden>
> > Date: Mon, 1 Jul 2002 21:56:23 +0200 (CEST)
> > 1) Some macro expert should check that replacing the call to
> > procedure->macro in boot-9.scm by a call to procedure->memoizing-macro is
> > safe.
> A few others worth checking:
> ./guile-core/oop/goops/save.scm:  (procedure->macro
> ./guile-core/oop/goops/stklos.scm:    (procedure->macro
> ./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.  My current
assumption is, that it should be generally safe to replace
procedure->macro by procedure->memoizing-macro if the following conditions
are met:

1) the macro procedure does not have a stateful behaviour and
2) the transformation of the macro procedure does not depend on the
content of the environment argument.

If I am not mistaken, these two conditions guarantee, that the transformer
will return the same transformed code with every execution.  Thus, it
could just memoize that code, since it would always be the same anyway.

Best regards,

reply via email to

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