new DIP5: Properties 2

Benji Smith dlanguage at benjismith.net
Sat Aug 1 21:04:16 PDT 2009


Andrei Alexandrescu wrote:

> Thanks for these great points. As an additional example, most ranges 
> define the method
> 
> bool empty() { ... }
> 
> whereas infinite ranges define the enum
> 
> enum bool empty = false;
> 
> It follows that if a range user wants to be compatible with finite and 
> infinite ranges, they always must use no "()". It would be nice if the 
> range's definition could enforce that.
> 
> 
> Andrei

Huh. How does this reconcile with your previous posts, where you said 
it'd probably be a bad idea for the API designer to mandate the function 
calling style of the API consumer?

Is this the same issue, and you've changed your mind? Or do you see this 
as a different issue?

--benji



More information about the Digitalmars-d mailing list