Re: Gee Functional iterators

On Tue, Jul 13, 2010 at 10:34 PM, Maciej Piechotka
<uzytkownik2 gmail com> wrote:
> On 13/07/10 17:50, Martin DeMello wrote:
>> On Tue, Jul 13, 2010 at 8:53 PM, Didier 'Ptitjes' <ptitjes free fr> wrote:
>>> Hi Martin,
>>> Glad that we have a potential new contributor ;)
>> Glad to potentially contribute :)
>>>> Currently no. But the bug I posted is about adding this functionality to
>>>> Vala. Currently Vala interfaces are more Java/C#-like.
>>> I personally dislike this way of extension and prefer the
>>> interface/abstract-classes way, but here I guess that this is really a
>>> question of style and habits...
>> You mean rather than decorating a class/object with methods at runtime?
> What you mean is duck typing. It is somehow different then static typing
> when compiler checks if type have the given method.
> The problem discussed is whether the interfaces should have a concrete
> implementations at all or should just specify... well interface.

Ah, I think I finally get what you mean by virtual functions in
interfaces :) Do you mean the current vala doesn't allow a concrete
function in an abstract class/interface to refer to a virtual function
that is to be implemented in a subclass?

> However it makes map simply to put into interface. I'd vote so far for
> returning iterator and adding iterator-based constructors[1]
> [1] With the methods I proposed it would be possible to do:
> new ArrayList(list.filter((x) => {return x%2 == 0;}))

I agree, this seems like an excellent design - it only allocates when
needed, and allows "lazy" iterator chaining.


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