Naming of new lazy versions of existing Phobos functions

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Thu Jul 17 16:54:37 PDT 2014


On Thu, Jul 17, 2014 at 10:59:26PM +0000, Brad Anderson via Digitalmars-d wrote:
[...]
> I find the "with" prefix particularly attractive. It implies the lazy
> behavior, is short, and reads well when chained with other calls.
> Hypothetical example I gave in the Pull Request comments:
> 
>   auto contents =
>       "  FILE".withStrip()
>               .withLowercase()
>               .withExtension(".txt")
>               .readText();
> 
> At the risk of bikeshedding, I thought it would be useful to solicit
> the wider forum audience for ideas and opinions. Thoughts?
> 
> 1. https://github.com/D-Programming-Language/phobos/pull/2149

I like "with".


T

-- 
Once the bikeshed is up for painting, the rainbow won't suffice. -- Andrei Alexandrescu


More information about the Digitalmars-d mailing list