[stringtemplate-interest] Maps with object keys

Terence Parr parrt at cs.usfca.edu
Wed Nov 28 11:09:57 PST 2007


On Nov 28, 2007, at 2:12 AM, Caleb Lyness wrote:

> Terence Parr wrote:
>>
>> Hi Caleb! :) Heh, yeah, you're right...this is weird, though  
>> consistent with what (x) means..(x) means "take the value of" or  
>> "immediately eval" rather than lazy eval. Sometimes you need to  
>> render an expression such as for keys with maps. It's an  
>> indirection and immediate eval. m.x gives m.get("x") m.(x) gives  
>> m.get(x.toString()) m.(x+"foo") gives m.get(x + "foo") hmm...we do  
>> need a map look up with an object...i wonder what to do...
> Well as a step toward resolving the problem have a look at the  
> attached test case.
> Perhaps you would like to add it to TestStringTemplate and create  
> an issue report
> for the problem?

Well, i should probably figure out what the "right" answer is before  
adding an issue report...hmm...i don't see how to maintain (...)  
functionality and backward compat and add obj-based key lookup.

Ter


More information about the stringtemplate-interest mailing list