[stringtemplate-interest] ST 3.1 release imminent
Terence Parr
parrt at cs.usfca.edu
Thu Nov 15 11:08:11 PST 2007
On Nov 14, 2007, at 9:12 PM, John Snyders wrote:
> I'm glad to hear that 3.1 is nearly ready. I hope it is not too
> late to bring up these issues. Sorry I have been busy with other
> things and have not been following the ST list.
>
> The most important bug that needs to be fixed in my opinion is
> passing iterators to templates. I did a quick scan of the bug list
> both open and recently resolved and didn't find a mention of this.
> Passing an iterator to a template just won't work.
Correct. I see no way around this as they violate ST's requirement
of no side effects.
> Something like Java 5 Iterable must be passed instead. I wrote
> about this here:
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2007-
> May/001073.html
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2007-
> May/001074.html
> The problem of "using a list up" is also mentioned here
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2007-
> January/000915.html
Do you have a solution? I'm all ears :)
> It is a coincident that just this weekend I was trying to use ST
> on a quick project to create some address labels from a CSV file.
> I was going to turn the CSV file into JSON (using python) and use
> STST from the command line. The trouble is that the address label
> document (OOo XML) was a table and the first column needed to be
> different than the first. This meant using the first and rest
> functions on a list that was passed as a parameter to a template.
> The above bug made it impossible to do what I wanted. Sadly I had
> to fall back on XML and XSLT.
I'm eager to fix this. Perhaps we simply copy the data? Expensive.
> Even if this can't be fixed now I think it should go in the bug
> database. Not sure if I have access to enter bugs or not.
I have a unit test that fails...i'll add
http://www.antlr.org:8888/browse/ST-30
> I also think that there should be a bug report to Remove definition
> of INT from the grammar.
http://www.antlr.org:8888/browse/ST-31
which grammar is it?
> Any interest in including STST in the distribution?
sure.
> I'll mention some other feature requests just in case they were
> forgotten. I know that 3.1 is just a point release.
>
> Support programming in the large by allowing .stg and .st files to
> refer to other .stg and .st files.
>
> List comprehensions?
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2007-
> June/001116.html
>
> List slice?
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2007-
> June/001090.html
I'd rather not add this w/o more thought.
> Support for really large input data?
> http://www.antlr.org:8080/pipermail/stringtemplate-interest/2006-
> December/000891.html
existing bug report about this...
>> o added elseif. $if(x)$...$elseif(y)$...$else$...$endif$
>>
> I really like this
hooray!
>> o updated some unit tests (names, guts) to make more sense.
>>
>> o updated group.g and eval.g so that list literals can have empty
>> atoms like $["a",,"b"]:{n | ...}; null="nullstring"$.
>>
> Why this syntax rather than having a literal representation for
> null. Like
>
> $["a",null,"b"]:{n | ...}; null="nullstring"$
>
> A literal null may find other uses since it can be passed as the
> argument to a template.
Yeah, I thought about that...wasn't sure that adding a keyword was
worth it. Passing null to template for attribute x is achieved by
not setting a value for x at the moment. ;) Hmm...another case?
THanks for your excellent analysis and time invested in ST, John!
Ter
More information about the stringtemplate-interest
mailing list