Re: Macro: chaining function calls.
- From: Ivan Boldyrev <boldyrev+nospam@xxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 12 Feb 2006 10:42:20 +0600
On 9380 day of my life Ulrich Hobelmann wrote:
OTOH, I'd prefer a macro over a function, since COMPOSE is anSee above.
obvious candidate for manual inlining.
But in what way wouldn't a normal macro expanding (COMPOSE #'a #'b
...) to #'(lambda (x) (a (b ... x))) do that inlining too? Wherever
it's called at compile time, it would expand to the same lambda and
the compiler should create and optimize it like a "normal" function
(which you could then pass to MAPCAR or whatever...).
COMPOSE is much more useful as function than as macro. For example:
(mapcar (apply #'compose list-of-function)
list-of-data)
But you can't use APPLY with macros.
Compiler macros allow you to get best of both worlds: you can use
COMPOSE as function (since defun is provided) and some calls of
COMPOSE are optimized.
There was some report on using compiler-macros... Try google.
--
Ivan Boldyrev
Assembly of a Japanese bicycle requires greatest peace of spirit.
.
- Follow-Ups:
- Re: Macro: chaining function calls.
- From: Ulrich Hobelmann
- Re: Macro: chaining function calls.
- References:
- Macro: chaining function calls.
- From: Mehmet Yavuz S. Soyturk
- Re: Macro: chaining function calls.
- From: Rob Warnock
- Re: Macro: chaining function calls.
- From: Ulrich Hobelmann
- Re: Macro: chaining function calls.
- From: Edi Weitz
- Re: Macro: chaining function calls.
- From: Ulrich Hobelmann
- Macro: chaining function calls.
- Prev by Date: SBCL & UTF-8 Errors
- Next by Date: Re: #' and lambda
- Previous by thread: Re: Macro: chaining function calls.
- Next by thread: Re: Macro: chaining function calls.
- Index(es):
Relevant Pages
|