On Wednesday, 19 March 2014 at 15:06:40 UTC, Andrei Alexandrescu wrote:
Pros and cons are already being discussed. Destroy!

https://github.com/D-Programming-Language/phobos/pull/2024


Andrei

User Ali Çehreli has posted in learn what I think is an interesting problem:
http://forum.dlang.org/thread/[email protected]
//----
This is a somewhat common little exercise: Write a function that takes
the size of a diamond and produces a diamond of that size.

When printed, here is the output for size 11:

     *
    ***
   *****
  *******
 *********
***********
 *********
  *******
   *****
    ***
     *

What interesting, boring, efficient, slow, etc. ways are there?

Ali
//----

The reason I bring it up is that this usually leads to a competition of whoever thinks up the most creative/concise UFCS chain.

So here's what I'm thinking: Let's do this, but also using each/tee/tap/consume/walk (and others?)!

I think this "real world" scenario is a good bench for seeing the effects of mixing imperative-style statements into a functional-style wrapper.

Maybe the result will reveal that something is awesome, or that it is useless? That maybe something that looks like it works, is actually subtly buggy? That maybe each turns out to be useful past our wildest dreams?

Who knows?

Reply via email to