[stringtemplate-interest] Support or interface Iterable

Terence Parr parrt at cs.usfca.edu
Wed Oct 18 15:03:44 PDT 2006


On Oct 18, 2006, at 9:31 AM, John Snyders wrote:

> Is there a reason why string template does not allow the iteration  
> syntax <attribute:{template}> for things that are Iterable but not  
> a collection?

It should, I see:

	private static Object convertAnythingIteratableToIterator(Object o) {
		...
		else if ( o instanceof Iterator ) {
			iter = (Iterator)o;
		}
		...
	}

>  The methods convertAnythingToIterator and  
> convertAnythingIteratableToIterator in ASTExpr.java do allow  
> Collection but do not allow Iterable.

Ohhhhh!  You mean Iterable rather than Iterator?  That is a java 1.5  
thing, which I cannot use because 1.3, 1.4 don't have it.  E.g., I  
use 1.4 not 1.5.

Ter


More information about the stringtemplate-interest mailing list