Thread overview
D Functional garden
Feb 29, 2016
Seb
Feb 29, 2016
jmh530
Mar 01, 2016
Seb
Feb 29, 2016
asdf
Feb 29, 2016
landaire
Mar 01, 2016
sigod
February 29, 2016
I have started to learn D lately and as a part of my learning process I decided to put my insights into a new, open platform - the D Functional Garden.

It maintains a variety of snippets that can be used to learn D or help one as a quick reference.

It contrast to Guillaume Piolat's d-idioms [1], all samples are valid code and automatically tested on every run - it is basically one big unittest suite. Moreover as you might tell from the name, it focuses mostly one a functional style within D.

Have a look yourself at:

https://garden.dlang.io/

PS: This project is quite new, so contributions (ideas, snippets) are welcome ;-)

[1] https://p0nce.github.io/d-idioms/
February 29, 2016
On Monday, 29 February 2016 at 15:09:56 UTC, Seb wrote:
> I have started to learn D lately and as a part of my learning process I decided to put my insights into a new, open platform - the D Functional Garden.
>

I like.

One suggestion. It can be hard to read long chains of calls. When you do it this way, the assert part also looks a little messy. This would give:
auto result = [1,2,3,4]
                .chunks(2)
                .map!(sum)
                .array;
assert(result == [3, 7]);
February 29, 2016
On Monday, 29 February 2016 at 15:09:56 UTC, Seb wrote:
> It contrast to Guillaume Piolat's d-idioms [1], all samples are valid code and automatically tested on every run - it is basically one big unittest suite. Moreover as you might tell from the name, it focuses mostly one a functional style within D.
>
> Have a look yourself at:
>
> https://garden.dlang.io
>
> PS: This project is quite new, so contributions (ideas, snippets) are welcome ;-)
>
> [1] https://p0nce.github.io/d-idioms/

Would it be good to have both getting-used-to-syntax and more effective-problem-solving as well? Then again if the snippets are realistic that would already be there.
February 29, 2016
On Monday, 29 February 2016 at 15:09:56 UTC, Seb wrote:
> Have a look yourself at:
>
> https://garden.dlang.io/

Looks really good. Nice work.
March 01, 2016
On Monday, 29 February 2016 at 15:37:06 UTC, jmh530 wrote:
> On Monday, 29 February 2016 at 15:09:56 UTC, Seb wrote:
>> I have started to learn D lately and as a part of my learning process I decided to put my insights into a new, open platform - the D Functional Garden.
>>
>
> I like.
>
> One suggestion. It can be hard to read long chains of calls. When you do it this way, the assert part also looks a little messy. This would give:
> auto result = [1,2,3,4]
>                 .chunks(2)
>                 .map!(sum)
>                 .array;
> assert(result == [3, 7]);

Great idea. You are absolutely right! I changed the snippets accordingly.

> Would it be good to have both getting-used-to-syntax and more effective-problem-solving as well? Then again if the snippets are realistic that would already be there.

I think what you are going for is sth like grouping or categories - yep that definitely makes sense and once I find time, I will add this too :)
March 01, 2016
On Monday, 29 February 2016 at 15:09:56 UTC, Seb wrote:
> I have started to learn D lately and as a part of my learning process I decided to put my insights into a new, open platform - the D Functional Garden.
>
> It maintains a variety of snippets that can be used to learn D or help one as a quick reference.
>
> It contrast to Guillaume Piolat's d-idioms [1], all samples are valid code and automatically tested on every run - it is basically one big unittest suite. Moreover as you might tell from the name, it focuses mostly one a functional style within D.
>
> Have a look yourself at:
>
> https://garden.dlang.io/
>
> PS: This project is quite new, so contributions (ideas, snippets) are welcome ;-)
>
> [1] https://p0nce.github.io/d-idioms/

Nice idea. I like it.