Adding a new design constraint to D

forkit forkit at gmail.com
Thu Jun 16 11:40:16 UTC 2022


On Thursday, 16 June 2022 at 11:31:48 UTC, Ola Fosheim Grøstad 
wrote:
> On Thursday, 16 June 2022 at 11:26:23 UTC, forkit wrote:
>> The only real question on peoples mind, should be ->  if we 
>> allow a class to have private members (to the class), how will 
>> this fit in and affect the rest of the language (technically).
>>
>> at this stage, not a single person has bothered to even make 
>> an attempt to explore an answer to this question.
>
> I think I have, but I can do it again:
>
> Since D has meta programming capabilities it can affect meta 
> programming code that makes assumptions about access control 
> modes being fixed to the existing set.
>
> As such it will be a breaking change, but will probably not 
> break most programs.
>
> (Basically all changes that go beyond syntax sugar are breaking 
> changes in D.)

ok, except you too ;-)

I must have missed this in all the nonsense going on...

the constraint is optional, just as using meta programming is 
optional.

but if the D language requires that 'meta programming in D must 
be able to access class members that are private to the scope of 
the class', then assuming this would not be the case if the 
suggestion were implemented, then we have a first, genuine, issue 
to consider  ;-)



More information about the Digitalmars-d mailing list