Rikki's Borrow Checker

xoxorwr xororwr at gmail.com
Sun Aug 30 08:07:34 UTC 2026


On Sunday, 30 August 2026 at 06:16:32 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 30/08/2026 6:14 PM, xoxorwr wrote:
>> Precisely. If it can already be expressed cleanly as with 
>> existing D constructs, why bother making it a language feature 
>> to begin with? And if does become a language feature, it 
>> should integrate with |switch|, bnot introduce a second 
>> mechanism.
>
> It cannot be expressed cleanly with existing D constructs.
>
> I.e. by-ref parameters in the handlers cannot be made safe.
>
> And all those extra function calls are not the cheapest thing, 
> its overhead that can be eliminated.

Nothing stops that in switch itself, dmd just doesn't do it there 
yet. Fix it there.

That's the whole problem with D, and a common frustration for new 
users, too many constructs doing the same job, none of them 
finished, none of them talking to each other.



More information about the Digitalmars-d mailing list