`@safe` by default. What about `@pure` and `immutable` by default?

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Apr 19 21:46:20 UTC 2019


On Friday, April 19, 2019 7:52:13 AM MDT Adam D. Ruppe via Digitalmars-d 
wrote:
> On Friday, 19 April 2019 at 12:23:08 UTC, Andrei Alexandrescu
>
> wrote:
> > (There's opting out of @safe by using @system or @trusted.)
>
> This still doesn't work correctly for templates, which should be
> inferred based on input, not forced one way or another.
>
> We should be doing
>
> attr(true | false | null)
>
> three way!
>
>
> But yeah, that's where I would focus too. Then your modules can
> opt in pretty easily.

Definitely - though I'm not quite sure how allowing null would work with
allowing expressions that result in bool, which is what we really should be
doing rather than requiring an explicit true or false. It can obviously be
done, but I'm not quite sure how that would be spec-ed out.

- Jonathan M Davis





More information about the Digitalmars-d mailing list