2008/7/23 Jürg Billeter <[EMAIL PROTECTED]>:
> On Wed, 2008-06-04 at 13:49 +0200, Mikkel Kamstrup Erlandsen wrote:
>> I am very much enjoying array slicing[1] in Python and I am
>> contemplating having a stab at implementing it for Vala. However I
>> would like a bit of feedback before I start spending too much time on
>> it. It looks like it may require a lot of work.
>
> Sorry for the late response, I have to catch up with some mail lag. I
> like the idea of array slicing, I'm currently more concentrating on bug
> fixing and stabilization than new language features.

Yes. Understandably.

>
>> I see three cases where it can be applied, each probably having to be
>> handled separately...
>>
>>  * Libgee collections. This may require a new interface for libgee, fx
>> Slicable?
>
> We could certainly implement slicing support for classes implementing
> Gee.List without a new interface, however, it might not be the most
> efficient solution if we want to consider lazy loading.
>
>>  * Strings and GStrings
>
> It should be pretty easy for strings as it's just different syntax for
> the substring method.
>
>>  * GLib collection types, GArray, GPtrList etc.
>
> Needs to be special handled for each one of them, I wouldn't focus on
> that for now.
>
> You've missed the simple array case, however, that might also be the
> most problematic one regarding memory management. It should certainly be
> feasible for common situations, though.

Right.

It just struck me that slicing might not be entirely in the C# spirit
now that MS has introduced LINQ (which is really high-tech slicing in
my use cases). Maybe Vala should not support full linq, but still a
selection mechanism that is more advanced than slicing..? I really
don't know much about linq.

Anyway, plain old slicing would be fine for me. Just thinking aloud.

When I find the time I'll have a play in a bzr branch and let you know.

Cheers,
Mikkel
_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to