Python syntax in Lisp and Scheme

Matthias Blume find at my.address.elsewhere
Tue Oct 14 13:38:29 EDT 2003


kaz at ashi.footprints.net (Kaz Kylheku) writes:

> Marcin 'Qrczak' Kowalczyk <qrczak at knm.org.pl> wrote in message news:<pan.2003.10.13.21.26.56.715704 at knm.org.pl>...
> > On Mon, 13 Oct 2003 13:51:22 -0700, Kaz Kylheku wrote:
> > 
> > > Secondly, it would be unoptimizeable. The result of evaluating a
> > > lambda expression is an opaque function object. It can only be called.
> > 
> > This is not true. When the compiler sees the application of a lambda,
> > it can inline it and perform further optimizations, fusing together
> > its arguments, its body and its context.
> 
> Kindly keep in mind the overall context of the discussion, which is
> HOF's versus macros. The closures being discussed are ones passed down
> into functions. Those closures typically cannot be inlined, except
> under very special circumstances taken advantage of by a compiler with
> very smart global optimizations.

If a macro works in a particular situation, then any equivalent HOF
can be inlined there as well.  Granted, not all compilers will
actually do so, but the possibility trivially exists.  This does not
depend on "very smart" global optimizations.

Matthias




More information about the Python-list mailing list