[stringtemplate-interest] ST#-questionregardingspecialcasingofIList

Jeremy Gray jgray at siberra.com
Fri May 26 10:23:08 PDT 2006


Re: not implementing IList - doh, brain-fart on my part. Still, you're
special-casing IDictionary at a higher priority so the overall point
still stands: you need only target IEnumerable.

At the end of the day, Kunle, you're a primary maintainer on this and
I'm just an interested user, so you can do whatever you want with it.
Just consider my posts to be a friendly reminder from the peanut
gallery.

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 7:11 PM
To: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest]
ST#-questionregardingspecialcasingofIList

Jeremy,

> Re: "other issues e.g. with attributes of type Hashtable/IDictionary
for
> instance" - They too are special-cased, though at a higher level of
> priority, so I'm not sure how that presents any more of an issue given
> that they too already implement IList and it isn't a problem at the
> moment.

They don't implement IList and they aren't special cased (not in the
IList
sense in any case). They would need to be (along with many others) in an
IEnumerable-implies-multi-valued scenario.

> Re: "Template application is applicable to all attributes." - Yes, it
> is, but has different semantics for those that are (at present) IList,
> does it not?

Nope. It has different semantics for single-valued versus multi-valued
attributes. ILists are considered multi-valued.
Can't imagine that one would a different behaviour from applying a
template
to a list of values in any case.

> I have to admit that unless I'm still missing something, the position
on
> using IList for multi-valued attributes instead of the most
appropriate
> interface, that being IEnumerable, is rather like hiding a pea (in
that
> anything that would count against IEnumerable already (and still
would)
> count against IList, except that targeting of IEnumerable would allow
> multi-valued handling of objects that aren't IList)

Considering virtually all collections to be multi-valued attributes is a
little too wide ranging methinks. There are far fewer ILists than
IEnumerables so that works for me in ST# currently. Had I used
IEnumerable,
Ulf's recent post about issues with ArrayList would have also been about
issues with Hashtables (and practically any other collection type).

I did consider special casing IEnumerator instances instead of lists.
That
had greater overheads. And the possibility that the enumeratee [ok, not
a
real word;-)] could have been altered externally in the meantime
rendering
the enumerator useless.

> By the way, at the end of the day I absolutely love ST#, so do bear in
> mind that all this is just in the interest of curiosity and
exploration.
> :)

Understood. ;-)


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