www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Article: More hidden treasure in the D standard library

reply "Gary Willoughby" <dev nomad.so> writes:
I've written a new article on D here:

http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/

Hopefully to drive other programmers to investigate D. It's a 
continuation of a similar one I wrote a few months ago which 
attracted over 60k readers. It's a simple overview of some cool 
features in the D standard library hopefully to fuel curiosity.

Reddit link:

https://www.reddit.com/r/programming/comments/3j3j87/more_hidden_treasure_in_the_d_standard_library/

Up vote away. :)
Aug 31 2015
next sibling parent reply "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 31 August 2015 at 16:09:02 UTC, Gary Willoughby wrote:
 I've written a new article on D here:

 http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/

 Hopefully to drive other programmers to investigate D. It's a 
 continuation of a similar one I wrote a few months ago which 
 attracted over 60k readers. It's a simple overview of some cool 
 features in the D standard library hopefully to fuel curiosity.

 Reddit link:

 https://www.reddit.com/r/programming/comments/3j3j87/more_hidden_treasure_in_the_d_standard_library/

 Up vote away. :)
why the use of `input.text` instead of just `input` on line 14 of the fizz buzz example?
Aug 31 2015
parent reply "Gary Willoughby" <dev nomad.so> writes:
On Monday, 31 August 2015 at 16:16:15 UTC, John Colvin wrote:
 why the use of `input.text` instead of just `input` on line 14 
 of the fizz buzz example?
It doesn't compile. Error: mismatched function return type inference of int and string
Aug 31 2015
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 31 August 2015 at 16:22:36 UTC, Gary Willoughby wrote:
 On Monday, 31 August 2015 at 16:16:15 UTC, John Colvin wrote:
 why the use of `input.text` instead of just `input` on line 14 
 of the fizz buzz example?
It doesn't compile. Error: mismatched function return type inference of int and string
Doh. Ok, I see why.
Aug 31 2015
prev sibling next sibling parent reply "wobbles" <grogan.colin gmail.com> writes:
On Monday, 31 August 2015 at 16:09:02 UTC, Gary Willoughby wrote:
 I've written a new article on D here:

 http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/

 Hopefully to drive other programmers to investigate D. It's a 
 continuation of a similar one I wrote a few months ago which 
 attracted over 60k readers. It's a simple overview of some cool 
 features in the D standard library hopefully to fuel curiosity.

 Reddit link:

 https://www.reddit.com/r/programming/comments/3j3j87/more_hidden_treasure_in_the_d_standard_library/

 Up vote away. :)
Nice article. I regularly find things like this where I spend a couple hours implementing a solution, only to find its already been done for me. Mostly occurs in std.algorithm. And it's not even lack of documentation, it's me thinking "this will never be in the library, time to go do it myself". That predSwitch code is a perfect example.
Aug 31 2015
parent "Chris" <wendlec tcd.ie> writes:
On Monday, 31 August 2015 at 18:39:22 UTC, wobbles wrote:
 On Monday, 31 August 2015 at 16:09:02 UTC, Gary Willoughby 
 wrote:
 I've written a new article on D here:

 http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/

 Hopefully to drive other programmers to investigate D. It's a 
 continuation of a similar one I wrote a few months ago which 
 attracted over 60k readers. It's a simple overview of some 
 cool features in the D standard library hopefully to fuel 
 curiosity.

 Reddit link:

 https://www.reddit.com/r/programming/comments/3j3j87/more_hidden_treasure_in_the_d_standard_library/

 Up vote away. :)
Nice article. I regularly find things like this where I spend a couple hours implementing a solution, only to find its already been done for me. Mostly occurs in std.algorithm. And it's not even lack of documentation, it's me thinking "this will never be in the library, time to go do it myself". That predSwitch code is a perfect example.
Same here. I've learned to go to Phobos first (mainly std.algorithm), before I come up with my own solution. But Phobos is so vast that it's easy to miss a gem or two. I'd appreciate more articles about how common problems can be solved with Phobos. One issue I've encountered is that function names don't always reflect well what they do, so I filter them. This might be my own fault though.
Sep 08 2015
prev sibling parent "rcorre" <ryan rcorre.net> writes:
On Monday, 31 August 2015 at 16:09:02 UTC, Gary Willoughby wrote:
 I've written a new article on D here:

 http://nomad.so/2015/08/more-hidden-treasure-in-the-d-standard-library/

 Hopefully to drive other programmers to investigate D. It's a 
 continuation of a similar one I wrote a few months ago which 
 attracted over 60k readers. It's a simple overview of some cool 
 features in the D standard library hopefully to fuel curiosity.
Nice article! I've been using 'sequence' and just ignoring the state variables because I didn't realize that 'generate' existed. predSwitch is one that I know exists, but can never remember when I need it. And when I remember it exists, I've already forgotton where I last needed it...
Sep 08 2015