const wordCount = file.byLine() // Read lines.map!split // Split into words .map!(a => a.length) // Count words per line .reduce!((a, b) => a + b); // Total word count
I'm a D noob. ".map!(a => a.length)" seems like the lambda is
passed into the template. ".map!split" just confuses me. What is
split? I thought only types can be after "!". I would guess split
is a standard function but then shouldn't it be map!(split)?
- What does func!thing mean? ProgrammingGhost
- Re: What does func!thing mean? qznc
- Re: What does func!thing mean? ProgrammingGhost
- Re: What does func!thing mean? bearophile
- Re: What does func!thing mean? Jesse Phillips
- Re: What does func!thing mean? Philippe Sigaud
- Re: What does func!thing mean? Gary Willoughby
- Re: What does func!thing mean? Gary Willoughby