Array syntax for collections [was Re: Extended arrays declaration and access syntax with use of enumerated types]
Marek Kozieł
develop4lasu at gmail.com
Sat Mar 14 19:44:19 PDT 2009
2009/3/14 Mark Mahieu <markmahieu at googlemail.com>
> Stephen,
>
...
> That's interesting. Did you get any feeling for *why* it was disliked?
>
> I get the impression that a lot of 'mostly sugar' suggestions receive
> a more negative reaction at first blush. I'm pretty sure even
> foreach was initially greeted with a certain amount of disdain by
> some people.
>
> Mark
>
>
> @Mark
I'll tell you my reason:
I barely use List or Map because they are to weak.
So while I have my own implementation which is able to handle both List and
Map I would be unable to use this syntax.
Some interesting solution would be introducing interface:
interface Array<T> {
T get(int index);
// T get(T element); // array[ element ];
T set(int index,T element);
// boolean add(T element); // array[]=element;
}
... replaceable with [], but I doubt about it.
What's more I almost do not use indexes.
--
Pozdrowionka. / Regards.
Lasu aka Marek Kozieł
http://lasu2string.blogspot.com/
More information about the coin-dev
mailing list