* Josh Rosenbaum <josh at infogears.com> [2006/09/22 10:05]:
> Perrin Harkins wrote:
> > It's a matter of scope.  If want to split out some repeated code
> > that no other template will use, make it a MACRO in the current
> > template.  If you have something that other templates might
> > conceivably use too, make it a separate template and call it with
> > PROCESS.

It isn't just a matter of scope.  MACRO works a lot like a cross
between CPP and Lisp macros: The code that the MACRO resolves to is
inserted directly into the Perl version of the template (what gets
compiled).  The easiest way to see this is to set COMPILE_DIR or
COMPILE_EXT and take a look at the compiled versions of a template
that uses MACRO and PROCESS, and compare the generated code.

MACRO and PROCESS don't actually do the same thing, although they can
be used to accomplish similar goals.

Andy, IIRC, won't TT3 have compiler hooks to replace MACRO and/or
make them more like true Lisp macros?

(darren)

-- 
1. Everything depends.
2. Nothing is always.
3. Everything is sometimes.

Attachment: pgpFFccW1Ejqo.pgp
Description: PGP signature

Reply via email to