texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] memoizing macros


From: David Allouche
Subject: Re: [Texmacs-dev] memoizing macros
Date: Tue, 4 Nov 2003 13:51:32 +0100
User-agent: Mutt/1.5.4i

On Mon, Nov 03, 2003 at 06:01:01PM +0100, Joris van der Hoeven wrote:
> 
> > In texmacs 1.0.2.3 I see this new comment:
> > ;; FIXME: yet another bug in Guile: for some strange reason,
> > ;; import-menu-promise and export-menu-promise are not
> > ;; reevaluated at each run. This *is* the case for top level macros,
> > ;; but apparently not for local macros or macros in a module :^(((
> >
> > Macros _should not_ execute code. They should only transform syntax.
> 
> Well, the syntax transformation has to be context-dependent for TeXmacs
> in some cases, at least for the evaluation of promises. Or do you propose
> another mechanism?

I am pretty sure there is a way to do what you want more correctly. In
the more general case, one can always wrap symbols in closures (to
preserve the lexical scoping) and evaluate the context-sensitive code at
execution time (as opposed to compilation time) by applying these
closures.

If you think this is important enough to put in front of all the things
you want me fix, I'll dig in the multiple layers of tangled macros of
the DRD code and try to figure out the specifics.

> > So language can implement a useful optimization called "macro memoization"
> > which seems to be exactly what the comment complains about.
> 
> Can we turn this stuff off?

There is a mechanism in obsolete guile releases to produce non-memoizing
macros, but I remember reading in guile-users that this is deprecated.
Memoizing macros are a Good Thing, and I believe that R5RS hygienic
macros cannot even express any logic where memoization makes a
difference.

-- 
                                                            -- ddaa




reply via email to

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