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

Re: map and siblings

    From: Todd Allen <Allen at YALE.ARPA>
    Re:   map and siblings
    I notice that, at least in the interpreter, map, mapcdr, and walk are all
    proceedures rather than macros.  Are these open coded by TC?  If not,
    why not?  It would seem to be the obvious thing to do.
The way to get open-coding in T is NOT with macros, as in some other
Lisps, but with integrable procedures.  Unfortunately, TC does not
optimize APPLY / rest-arg interactions; this will go in some day,
but not very soon.  So for now it isn't sufficient just to make MAP
et al., which have rest-arguments, be integrable.  TC could handle
them specially, but that's kludgier than the general solution, and
it's a bit of work.  Doesn't seem important enough.

A different way to fix this is to optimize downwards-only procedure
arguments, as is supposed to happen one day.  Then even if MAP wasn't
integrable, its first argument wouldn't be consed as a closure if it
had free references to local variables, as it is now.

In short: optimizing MAP et al. certainly should be done (by defining
it as an integrable procedure or by preventing closure consing), but
so should lots of other things.