Revised RFC on range design for D2

Michel Fortin michel.fortin at michelf.com
Mon Sep 29 19:49:37 PDT 2008


On 2008-09-29 12:55:18 -0400, "Steven Schveighoffer" 
<schveiguy at yahoo.com> said:

> Stdout.newline.formatln("Hi there {}", var);
> 
> Is newline a property of Stdout, on which I'm calling formatln, or is
> newline a function that I'm calling, and then using the result of that
> function to call formatln?  Compare with:
> 
> Stdout.newline().formatln("Hi there {}", var);
> 
> There is no ambiguity.  newline is clearly a function, not a property.

Interesting. To me both of these things have exactly the same meaning. 
Perhaps it's because I'm used to D, but I think it's more because I 
can't count how many times I've seen this pattern in C++:

SomeSimgleton::Instance().doSomething();

where Instance() is simply an accessor.

In my opinion, "newline" isn't a good function name for what it does 
because it has no verb. Having no verb makes it look like an accessor 
much more than the absence or presence of parenthesis.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/



More information about the Digitalmars-d-announce mailing list