I was thinking about this on the way in on the train :
Theo Keyzer [SMTP:[EMAIL PROTECTED]] wrote :
>
>
>> > #set $ivm = "#{$mac}()"
> [SNIP]
>
> > #set $f = "${$a}.{$b}()"
> > $f
>
> In pure velocity context you maybe don't what or need this. But once
> you start to throw xml into the picture its not scary at all, well
> maybe some small pieces you can hide somewhere.
I am not sure how much this really is needed for XML processing. I guess
Jon would be the reigning expert on Velocity-XML integration because of his
cool Anakia work.
But I guess I want to emphasize that the the Interpolation feature (as well
as VMs) don't allow you to do anything new - no new functionality can be
expressed through Interpolation or VMs that you can't do with plain old VTL
(POVTL), as they both really are no more than POVTL. They both are really
just a convenience mechanism that allow you to write cleaner, reusable
Velocity templates. [In the interest of full disclosure, something tells me
that might be an outright lie, because of the ability to recurse with VMs;
but in the spirit of the times, I'm just going to go with it :) ]
Now, this bit about 'functional interpolation' or whatever you want to call
something like '#$macroname()' might be very easy to do, but is, I believe,
currently outside of the general consensus of what VTL allows. I think that
if we do want that sort of facility, it should be a new directive, such as
#eval( ... ) or similar to both make clear what the template author intends
as well as make easy the ability to shut it off.
If you really need that sort of thing right now, there always is perl :)
geir