"Daniel L. Rall" wrote:
>
> >From a C programmer's view, 'if' is a flow control statement, and 'FOO'
> is a macro.
I am going to drop this, but suppose I had a #include that defined the
macro, and FOO was lowercase. (Poor style, I admit...).
A casual reader of the proggie wouldn't have a clue.
And there are many examples (MSFT Win32) where that is done all the
time, for example for threading support (beginthread()), Unicode support
(tchar_t), etc.
My point is simply that the language gets richer for the end user in an
end-user controllable fashion (they can add velocimacros) w/o making
the language bigger internally.
> > So the art major then sets up look and feel thing, and that is captured
> > and formalized into Velocimacros, so his/her art minions can code the
> > content templates. Then, when fashion changes, you can modify the
> > velocimacros for a wholesale change.
>
> Who captures and formalizes it? Surely not the art major. I don't want
> to have anything to do with that part of the process, I have way too
> much work to do on various core engineering activities. Let's stick
> with the KISS philosophy.
Surely the art major! If the art major can decide, for example, on a
given visual representation of something, and is able to use the
template engine to express that, using all sorts of things like loops,
including other templates, setting variables, checking variables,
remembering that $!foo means #if($foo) { $foo } :) , then I believe
they could handle defining a macro.
Surely someone, maybe not the core engineers, wants to prevent the evil
menace of cut and paste?
> > I guess if this doesn't happen, one can always write a template
> > preprocessor to do exactly this (expand macros into velocicode) but that
> > seems to be one of the purposes of a template engine anyway.
>
> The context is meant to supply the tools to do this sort of thing.
You then move something which can [by definition, if the Velocimacro
expands to velocity directives...] and should be expressed in the
template language away from the template language back into Java code.
>From a performance perspective, you can expand the velocimacros out
before caching, and focus on making the language directives as fast as
possible.
geir
--
Geir Magnusson Jr.
[EMAIL PROTECTED]