Discussion Thread: DIP 1042--ProtoObject--Community Review Round 1

RazvanN razvan.nitu1305 at gmail.com
Tue Jan 11 12:31:14 UTC 2022


On Tuesday, 11 January 2022 at 02:22:06 UTC, Timon Gehr wrote:
> On 10.01.22 14:48, Mike Parker wrote:
>> 
>> 
>> This is the discussion thread for the first round of Community 
>> Review of DIP 1042, "ProtoObject":
>> 
>> https://github.com/dlang/DIPs/blob/2e6d428f42b879c0220ae6adb675164e3ce3803c/DIPs/DIP1042.md
>
> I like the fact that there will be a way out of the additional 
> Object bloat without using extern(C++). (My preferred way out 
> of this would still be to change Object.)
>
> However, I strongly dislike the new interfaces with their 
> opinions about which qualifiers have to be on which methods. 
> `const` prevents any kind of lazy initialization, and 
> realistically, what's the use case of those interfaces?

I think that most code does not fall into that category. 
Moreover, the interfaces
are completely optional. You can define whatever interfaces with 
whatever
qualifiers you like. However, in the standard library we will 
provide interfaces
for the most common cases. For example, in the general case, 
comparing two items
should not allocate and should not throw; you want to implement 
something more
esoteric, that's fine, you can define your own interface.


More information about the Digitalmars-d mailing list