Operator overhaul

bearophile bearophileHUGS at lycos.com
Thu Oct 23 01:45:06 PDT 2008


Russell Lewis:
> While we're at it, we need to think about lazy slicing (with $).

If I understand what you are talking about, then you may want to look at islice() of Python and xslice() of my libs. You can give a lazy sequence and specify the slicing:

xslice(someiterable, 10, 20) => computes the first 20 items, ignores the first 10, and returns an array of the second 10.

Adding a syntax to D to do that, similar to the array slicing seems like a nice thing.

Bye,
bearophile



More information about the Digitalmars-d mailing list