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



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.

For example:

[Array]
class MyList<T> {
    [ItemGetter]
    public T get_by_index(int index);

    [ItemSetter]
    public void set_by_index(int index, T data);
}

Hope it could be done in the near future.

Thanks.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]