Code layout for range-intensive D code
Dmitry Olshansky
dmitry.olsh at gmail.com
Sun Jun 10 13:23:22 PDT 2012
On 09.06.2012 14:43, bearophile wrote:
[snip]
> import std.stdio, std.algorithm, std.string, std.range, std.conv;
>
> void main() {
>
> auto t = "table.txt"
> .File()
> .byLine()
> .map!(r => r.removechars("^01".dup))()
> .array();
>
> const transposed = t[0]
> .length
> .iota()
//hopefully I'm not alone in that this:
iota(t[0].length)
.map!(...)
...
is so much more readable.
--
Dmitry Olshansky
More information about the Digitalmars-d
mailing list