velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nathan Bubna" <>
Subject Re: [PATCH] Map Support
Date Wed, 30 Oct 2002 05:28:57 GMT
Geir said:
> I like it. I was thinking of doing this anyway.  We do it for lists - I
> can't think of a good reason why we won't for a Map.
> There is no way to setup a static map of things w/o having the controller
> support it, which would be a drag for something like a VM.
> If there are no objections by tomorrow, I'll review the patch and get it
> there.  Not sure I'm overjoyed with the syntax though.  Any other
> suggestions?  Like :
>    #set($mymap = [ {"foo", $a}  {"bar", "c"} ]


however, would this support only explicit strings as keys (e.g. 'foo' or
we should be clear on what will be supported for keys and values.  what
about more creative variations?

#set( $mymap = [ { $foo, $a}
                            {   $bar   ,34}
                            {14 ,true}
                            {"$woogie", [1,'two',$three]}
                            {  $tool.arbitraryObjectOrPrimitive ,
!$trueVar }
                         ] )

not that i need, want, or even approve of all of these...  i just think this
stuff should be addressed one way or another.

> Or maybe a comma between the {}?

-1   unnecessary.  your suggestion is readable and simple as it is; more
commas would just clutter things up.  having commas serve two purposes in
the same #set syntax is a bad idea.  keep it simple and clear.

Nathan Bubna

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message