[your code here] Pure RPN calculator

Seb via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 25 19:37:43 PDT 2017


On Tuesday, 25 July 2017 at 21:13:54 UTC, Max Haughton wrote:
> Semi-Functional/pure RPN calculator: 
> https://run.dlang.io/is/JGkBZx
>
> This is probably too long, but it demonstrates the compiler 
> enforced safety and purity (State is passed through the fold), 
> while also showing off the higher level parts of Phobos (Use of 
> fold).

Max, this is a great example!
However, as you noticed it's a bit long and in fact in its 
current state it wouldn't look good:

http://imgur.com/a/KwczM

If there's no chance to make it shorter, my suggestion 
considering that there are two other ideas in the queue with a 
similar length problem:

https://github.com/dlang/dlang.org/pull/1759
https://github.com/dlang/dlang.org/pull/1762

would be to find a new home for such "one-page" D example. We 
plan to restructure the DTour (tour.dlang.org) anyways, so how 
about adding a new section like "D in action" to it?

-> I have opened a discussion: 
https://github.com/dlang-tour/english/issues/194


More information about the Digitalmars-d mailing list