Re: [Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Jürg Billeter
On Mon, 2010-03-01 at 13:07 +0100, Dr. Michael Lauer wrote: > Am 01.03.2010 um 11:21 schrieb Frederik: > > T get (int index) -> indexer access ('[index]') > > What about the string lookup, i.e. gee's foo["bar"] ? It's not limited to a single int parameter. The parameter can be of any ty

Re: [Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Dr. Michael Lauer
Am 01.03.2010 um 11:21 schrieb Frederik: > Jürg Billeter wrote: >> Hi, >> >> On Mon, 2010-03-01 at 03:31 -0600, Sandino Flores Moreno wrote: >>> I noticed that Vala allows with Gee sequences the next mapping: >>>array_list[index]---> array_list.get(index) >>> >>> However, shouldn't

Re: [Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Jürg Billeter
On Mon, 2010-03-01 at 11:21 +0100, Frederik wrote: > Can you give us a list of the compile-time "duck typing" protocols? > > Iterator iterator () -> 'foreach' > T? next_value () -> alternative 'foreach' iterator protocol > > T get (int index)-> indexer access ('[in

Re: [Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Frederik
Jürg Billeter wrote: > Hi, > > On Mon, 2010-03-01 at 03:31 -0600, Sandino Flores Moreno wrote: >> I noticed that Vala allows with Gee sequences the next mapping: >> array_list[index]---> array_list.get(index) >> >> However, shouldn't it be possible in non-gee objects? > > This is alre

Re: [Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Jürg Billeter
Hi, On Mon, 2010-03-01 at 03:31 -0600, Sandino Flores Moreno wrote: > I noticed that Vala allows with Gee sequences the next mapping: > array_list[index]---> array_list.get(index) > > However, shouldn't it be possible in non-gee objects? This is already the case, there is nothing Gee

[Vala] Feature request: Syntactic sugar to map foo[index] to foo.get(index)

2010-03-01 Thread Sandino Flores Moreno
Hi. I noticed that Vala allows with Gee sequences the next mapping: array_list[index]---> array_list.get(index) However, shouldn't it be possible in non-gee objects? Maybe introducing decorators would make it easier, so classes with those decorators, would allow such syntactic sugar.