Re: Article: More hidden treasure in the D standard library

2015-09-08 Thread Chris via Digitalmars-d-announce

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.


Re: Article: More hidden treasure in the D standard library

2015-09-08 Thread rcorre via Digitalmars-d-announce

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...





Article: More hidden treasure in the D standard library

2015-08-31 Thread Gary Willoughby via Digitalmars-d-announce

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. :)


Re: Article: More hidden treasure in the D standard library

2015-08-31 Thread John Colvin via Digitalmars-d-announce

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?


Re: Article: More hidden treasure in the D standard library

2015-08-31 Thread Gary Willoughby via Digitalmars-d-announce

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


Re: Article: More hidden treasure in the D standard library

2015-08-31 Thread John Colvin via Digitalmars-d-announce

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.


Re: Article: More hidden treasure in the D standard library

2015-08-31 Thread wobbles via Digitalmars-d-announce

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.