On Borrow Checking

Walter Bright newshound2 at digitalmars.com
Mon May 12 19:07:46 UTC 2025


On 5/12/2025 5:41 AM, Richard (Rikki) Andrew Cattermole wrote:
> Right, perhaps if it was a different design, say unsafe blocks I'd agree with 
> what Manu is saying.

Unsafe blocks were not chosen for D because we wanted @system code to be clearly 
delineated with thought-out interface to them, not just slapped in to shut up 
compiler complaints about unsafe code.

For a while people would use @trusted lambdas to work like unsafe blocks would. 
The result of that confirmed that we made the right decision to make the 
boundary between safe/unsafe code at the function level. One can still use 
@trusted lambdas, but that use is considered bad practice.


More information about the Digitalmars-d mailing list