> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
> Behalf Of Geir Magnusson Jr.
>
> > > The model it has is because of the way it evolved - we always tried to
> > > remain backwards compatible when we relized the problems in the model.
> >
> > Careful. I sure understand the motivation but some things are
> better fixed
> > early or they become unwanted bloat.
>
> There is nothing to be *fixed*.  You are unhappy because of the
> *default* was maintained for backwards compatibility....

It was just a general remark to a general remark.
("we always tried to remain backwards compatible when we relized the
 problems in the model")

>...
> > > 4) Have global ones set at startup, no new global ones at runtime, but
> > > template-local ones at runtime.
> >
> > 4 is PERFECT to me.
> > What about copying and pasting the above, together with the necessary
> > settings into the docs if you are going to "fix" them? That would make
> > their working model crystal clear.
>
> Excellent. Will do!

Great and thanks again.

> > Anyway, I must repeat that Velocity is by far the better document Open
> > Source package I use. It is also much better than some commercial
> > software I used in the past. (I mostly use OS these days.)
> >
> > > I can't think of a way to have runtime-modified globals while
> > > template-local in effect w/o changing the template syntax so you can
> > > indicate namespace, something I believe isn't the right thing to do in
> > > VTL.
> >
> > No, no. That would be unnecessary complexity.
> >
> > But are local templates with the same name as the global templates
> > allowed and used (locally) instead of the global ones?
>
> Yes!  It lets you do really cool things - you can do local overrides.
>
> Assume two global VMs, #global1() and #global2().
>
> #macro( global2 $a)
>   $a
> #end
>
> #macro(global1 $a)
>   #global2($a)
> #end
>
>
> You can 'override' global2 by simply defining one  (called global2) in
> your template with local scope, and then calling #global1() - your
> version should be called.

Cool. I think that it is just the way it should.


> I found this very cool - I noted it to the list, but didn't document as
> it's a bit advanced :)  Just getting people to accept VMs is tough
> enough.

I think that macros should not be abused (then bringing app logic into
the templates) but I think they are e very nice feature.

And people should not have a problem accepting them: it is quite easy not
to use them if they don't like them. It is a very non intrusive feature.


Thanks and have fun,
Paulo

Reply via email to