Programming Languages on Crack

Walter Bright newshound2 at digitalmars.com
Thu Jun 17 18:14:41 UTC 2021


On 6/17/2021 4:19 AM, ag0aep6g wrote:
> It still has an interface, of course. The surrounding context acts as one large 
> `ref` parameter. Strictly speaking, the programmer must ensure that the @trusted 
> nested function doesn't create unsafe values in the outer function.

You're right. I made a mistake in not thinking about that when designing 
@trusted. @trusted lambdas should be `static` so that their interface is forced 
to be spelled out.


> However, even the standard library has more than enough instances of 
> strictly-speaking-incorrect @trusted.

That's right. They should all be re-engineered.


More information about the Digitalmars-d mailing list