Re: Macro: chaining function calls.



On 9380 day of my life Ulrich Hobelmann wrote:
OTOH, I'd prefer a macro over a function, since COMPOSE is an
obvious candidate for manual inlining.
See above.

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



Relevant Pages

  • Re: How to get to email from Word
    ... E.g., if I want to send an email to Jennifer, my ETJ macro ... So, I compose the email, then cut and paste its text ... into Outlook. ...
    (microsoft.public.word.newusers)
  • Selecting and then sorting a range
    ... Hey, I had a problem that maybe someone can help me with. ... I'm trying to sort a range in a macro. ... The columns that compose the ...
    (microsoft.public.excel)
  • Re: Macro: chaining function calls.
    ... | so some sort of chaining could be useful. ... Is there any reason that that page contains a compiler macro, ... OTOH, I'd prefer a macro over a function, since COMPOSE is an obvious candidate for manual inlining. ...
    (comp.lang.lisp)
  • Re: Dredging up patterns
    ... > probably be terrebly inefficient and need access to the lexical ... has an interesting paper entitled _Macros that Compose: Systematic Macro ...
    (comp.lang.lisp)
  • Re: Higher Order Instructions
    ... method, except it isn't ever seen by the user, only compiler writers. ... opcodes are compiled by the JIT compiler into machine code; ... delegate, and the opaqueness of a delegate to optimization - that is, ... If someone wants to compose a predicate dynamically in C#/.NET, ...
    (microsoft.public.dotnet.framework.clr)