DIP26: properties defined

deadalnix deadalnix at gmail.com
Sat Feb 9 07:30:13 PST 2013


On Saturday, 9 February 2013 at 12:44:35 UTC, Michel Fortin wrote:
> One problem we currently have is that the way properties are 
> defined with @property is that there's no way to distinguish 
> module-level properties from UFCS properties. Instead of fixing 
> that, many people are trying to disallow one or the other. So 
> instead of fixing the real problem, people have divided into 
> two camps: one that likes module-level properties and one that 
> likes UFCS ones. Both sides wanting to disallow the other's 
> side pet feature. I find the situation somewhat ridiculous. 
> Whatever side we choose, it'll break the language coherency 
> while alienating many people.
>
> I believe both module-level properties and UFCS properties to 
> be desirable. So is the idea put forward in DIP26 that reduces 
> boilerplate code. The question is how do we put all that 
> together.

Well design is a balance between conflicting goals. Allowing both 
cause an extra complication. So the win have to actually be 
carefully considered.

@properties as UFCS are almost mandatory. They are used 
everywhere, especially for arrays. I don't really know what is 
the state of thing in module level @property, but I never used 
them or required them. Can you give use cases of desirables 
module level properties ?


More information about the Digitalmars-d mailing list