texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] memoizing macros


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] memoizing macros
Date: Tue, 4 Nov 2003 14:29:52 +0100 (CET)

On Tue, 4 Nov 2003, David Allouche wrote:
> 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.

Well, since the fix temporarily works, let's leave it like that
for a while, but please put it on the wish-list with medium priority.
But you are rightthat we might try harder to use closures.

> > > 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.

I wonder whether there are any other parts in the code where
I require macros to be non-memoizing. As you know, many of them
are not "hygienic" either. On the other hand, Guile is so slow that
I refrain from adding code for really exceptional cases which may
even further slow down startup. We really should try MzScheme once...





reply via email to

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