[stringtemplate-interest] ST# - question regarding special casingof IList

Jeremy Gray jgray at siberra.com
Thu May 25 16:39:10 PDT 2006


Re: ICollection - correct, it is IList that adds access by index. Sorry
about the confusion on that. That said, I wasn't aware that ST# needed
access by index, or even to the count exposed by ICollection. Is there
something about ST# I'm not aware of?

Re: IEnumerable - correct, virtually all .net collections are
IEnumerable. My point was that there are classes out there that are
IEnumerable but not ICollection or IList, and since it would seem that
ST# doesn't need ICollection or IList, why restrict it so that it cannot
enumerate those objects that only implement IEnumerable.

Jeremy

-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Kunle
Odutola
Sent: Thursday, May 25, 2006 4:13 PM
To: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest] ST# - question regarding special
casingof IList

Jeremy,

> Following on from Kunle's recent post regarding special casing of
IList,
> I was wondering if Kunle or someone else could comment on why IList
was
> selected for special casing as a multi-valued attribute. The .net
design
> guidelines suggest that IList be targeted if the list is to be
modified,
> ICollection if they need counts of list members and/or access by
index,
> and IEnumerable if none of these are needed.

ICollection doesn't allow access by index iirc.

> Is there a particular
> reason for ST# to target IList and/or to not target IEnumerable?

Virtually all .NET collections (including ILists, IDictionaries etc) are
IEnumerable.


Kunle


_______________________________________________
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