[stringtemplate-interest] Functional List Formatting
Terence Parr
parrt at cs.usfca.edu
Sun Mar 2 13:43:18 PST 2008
Hi Fred, There is no reason that front in reverse can't be provided in
that they do not violate any of the rules. You can probably fake it
with a format option for a moment and a renderer.
Ter
On Feb 25, 2008, at 10:48 AM, Fred wrote:
> 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.
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org:8080/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list