UFCS for D

Nick Sabalausky a at a.a
Thu Mar 29 22:29:00 PDT 2012


"Steven Schveighoffer" <schveiguy at yahoo.com> wrote in message 
news:kgwyziwlndczqtafbvrf at forum.dlang.org...
> On Friday, 30 March 2012 at 01:55:23 UTC, Nick Sabalausky wrote:
>>
>> Yea, that occurred to me, too. <wishful musing>I've been starting to 
>> think
>> more and more that the "everything in a module is a friend" was a 
>> mistake,
>> and that we should have instead just had a "module" access specifier like 
>> we
>> have "package".</wishful musing>
>
> I don't think it was a mistake, it makes perfect sense to me.  On the 
> other hand, I fully understand why Meyers' prescription is useful for 
> humongous code bases.  However, I don't see this causing much trouble for 
> code I write.
>
> For instance, you have two classes you may have put into the same module 
> because they are categorically related (not necessarily friends in C++ 
> terms).  It's highly unlikely that you "accidentally" access private 
> information across the classes.  So how much time is "wasted" checking the 
> other class for external references?  Probably none.
>

Large portions of D's access specifiers were completely unenforced for a 
long time and it never caused me much trouble. Doesn't mean they didn't 
still need to enforced.




More information about the Digitalmars-d-announce mailing list