So what does (inout int = 0) do?
Nick Treleaven via Digitalmars-d
digitalmars-d at puremagic.com
Sun Apr 17 09:44:50 PDT 2016
On Sunday, 17 April 2016 at 14:30:59 UTC, QAston wrote:
> You've got lucky with pure (modulo corner cases) and ctfe, much
> less lucky with @safe, @trusted, @system, inout, shared, scope,
> property.
The @safe troika is a good design (except @safe should be the
default), the implementation is lacking though. Ideallists want
to make @safe strict now, but break code sometimes even without
basic workarounds for memory-safe code. Pragmatists want to avoid
breakage but make the subset of @safe code wider, making the
definition more complex. There seems to be a stalemate.
scope, if implemented for reference types, wouldn't scale well.
It should be the default, with __escape meaning scope(false). I
think it's an uphill battle arguing for this, but it is crucial
to avoiding GC without runtime checks. At least for non-GC code
in a general way.
I think @property is OK. I think the controversy at the time was
about optional brackets in function calls, which is different.
More information about the Digitalmars-d
mailing list