[stringtemplate-interest] Force single-valued template
Terence Parr
parrt at cs.usfca.edu
Sun Nov 20 10:03:12 PST 2005
[forgot to send to list]
On Nov 20, 2005, at 10:01 AM, Terence Parr wrote:
> On Nov 20, 2005, at 9:47 AM, sohail at taggedtype.net wrote:
>> The primary motivation is implementation of right and left
>> associative
>> operators:
>>
>> power(lhs,rhs)::=<<std::power(<lhs>,<rhs>)>>
>>
>> for 2**3**5, this should give:
>>
>> std::power(2,std::power(3,5))
>>
>> I don't think there is a way to do it without forcing lhs and rhs
>> to be
>> single valued.
>
> How about using first(lhs) to get the first element?
>
> Also, I would stay away from using :: and such inside your template
> names...i'll probably use :: for group inheritance soon...
>
> Ter
More information about the stringtemplate-interest
mailing list