Private visible?

Chad J gamerChad at _spamIsBad_gmail.com
Fri Jul 14 17:05:04 PDT 2006


Derek Parnell wrote:
> On Fri, 14 Jul 2006 19:30:19 +1000, Walter Bright  
> <newshound at digitalmars.com> wrote:
> 
>> Ivan Senji wrote:
>>
>>> Various 'poisoning' techniques sound a lot like C++ to me. There one  
>>> can make classes that can not be constructed, can not be inherited  
>>> from, can not be passed by value, cannot be allocated on stack and 
>>> many  different things by making something that is private. But are 
>>> these  techniques realistic or even possible in D?
>>
>>
>> Sometimes it is valuable to be able to say "you can't do this 
>> operation  with this type". I don't see why this ability should be 
>> restricted to  C++.
> 
> 
> In that case, why not directly support this concept in the language 
> rather  than use 'tricks' or side-effects to do it. If it a worthy thing 
> then say  so.
> 

Just out of personal preference I agree with Derek here.

To me it seems unintuitive to make private visible.  My typical use of 
private is intended to hide something, not just make it inaccessable. 
Would there even be a way to make an identifier invisible?  Anyhow, I'd 
rather private be invisible, and add a "poisoned" keyword or somesuch 
(better name?).

Overloads by protection also seem dubious IMO.



More information about the Digitalmars-d mailing list