[stringtemplate-interest] Applying a property to a list

Damien Cassou damien.cassou at gmail.com
Mon Jun 15 04:53:11 PDT 2009


On Mon, Jun 15, 2009 at 1:49 PM, Michael<micha-1 at fantasymail.de> wrote:
>> I would like StringTemplate to print the property of each element of a
>> list. Something along:
>>
>> $struct.fields.name$
>>
>> where:
>>
>> - a struct has a getFields() method which returns a list of fields
>> - a field as a getName() method
>
> then this should work:
>
> $struct.fields: { $it.name$ }$

That's what I did :-). But adding a specific semantic for properties
applyed to lists might also be interesting.

-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry


More information about the stringtemplate-interest mailing list