Adding a new design constraint to D

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


On Thursday, 16 June 2022 at 11:10:33 UTC, Kagamin wrote:
> On Thursday, 16 June 2022 at 08:58:09 UTC, forkit wrote:
>> On Thursday, 16 June 2022 at 07:45:52 UTC, Kagamin wrote:
>>>
>>> ..
>>> Also memoization is a use case for varying access between 
>>> different methods of the same class. Would you address that 
>>> too?
>>
>> I got no idea what that is all about.
>>
>> I just want to make a private variable in my class, private to 
>> the class ;-)
>
> When you have a lazily initialized field, you need to use an 
> accessor, because if you read the raw field, you get an 
> uninitialized value and error as a result, so only the accessor 
> should have access to the field.

as this is a little over my head, I think, I'll answer it this 
way.

if you can memoize now in D, you can still memoize if this idea 
were implemented.

I'm happy to be corrected here.


More information about the Digitalmars-d mailing list