[antlr-interest] StringTemplate: Functional List Formatting

Fred phreed at gmail.com
Sun Feb 24 22:53:38 PST 2008


I have doing some things related to lists in string templates that tax
 the current set of functions.
 Specifically, 'first', 'last', 'rest', 'tail' aren't quite do it for me.
 In particular, I need to do things like...
  'front'  : kind of like 'rest' but basically everything but 'last'
  'reverse' : reverse the order of the list (useful for things like
 building java package names)
  'sublist(list,0,-2)+sublist(list,-1)' : all but the second to the last item.

 ok, that last one is garbage but you get the idea.
 I know this is verging on something not unlike a functional language
 and you may have good reasons for not going there.


More information about the antlr-interest mailing list