Better slicing

Tom Tom_member at pathlink.com
Wed Mar 8 10:47:06 PST 2006


In article <dun61g$30be$1 at digitaldaemon.com>, NN says...
>
>What about more powerful slicing, like e.g. in Python ?
>
>char[] x;
>
>char[] y = x[0 : x.size : 1];
>char[] y = x[x.size : 1]; // Same
>
>char[] z = x[x.size : 0 : -1]; // Reverse
>char[] z = x[x.size :: -1]; // Same
>
>// Maybe with D syntax
>char[] x;
>
>char[] y = x[0 .. x.size .. 1];
>char[] y = x[x.size .. 1]; // Same
>
>char[] z = x[x.size .. 0 .. -1]; // Reverse
>char[] z = x[x.size .. .. -1]; // Same

I think it's enough how it is now. We'll never reach 1.0 if we keep adding
"luxuries" to the language, of course it's my humble oppinion. Instead I would
suggest to complete unfinished features, fix bugs and, if it is possible, to
make the almighty constness implementation in some way ;-). 

Tom;



More information about the Digitalmars-d mailing list