Re: What does func!thing mean?

2013-11-08 Thread Gary Willoughby
On Friday, 8 November 2013 at 08:59:17 UTC, Gary Willoughby wrote: For a friendly introduction to D template system please take a look at this: http://nomad.so/2013/07/templates-in-d-explained/ Then to understand why parens are optional take a look at this:

Re: What does func!thing mean?

2013-11-08 Thread ProgrammingGhost
On Friday, 8 November 2013 at 06:25:15 UTC, qznc wrote: On Friday, 8 November 2013 at 05:46:29 UTC, ProgrammingGhost wrote: 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

Re: What does func!thing mean?

2013-11-08 Thread bearophile
ProgrammingGhost: As if split.map was the template parameter. How does it know if split isn't a class (or if d has them, namespace) and map is a static function? Thats why it confused me. D doesn't have namespaces, it has modules and packages. map is a higher order function that returns a

What does func!thing mean?

2013-11-07 Thread ProgrammingGhost
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)? const wordCount = file.byLine()

Re: What does func!thing mean?

2013-11-07 Thread qznc
On Friday, 8 November 2013 at 05:46:29 UTC, ProgrammingGhost wrote: 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

Re: What does func!thing mean?

2013-11-07 Thread Philippe Sigaud
When a template argument is only one token long (ie: one number, one type, one string, one name), the parenthesis are optional and can be omitted.