What's missing to make D2 feature complete?
via Digitalmars-d
digitalmars-d at puremagic.com
Tue Dec 23 01:29:19 PST 2014
On Tuesday, 23 December 2014 at 08:43:06 UTC, ketmar via
Digitalmars-d wrote:
> that's why we have `in` keyword, which clearly indicates that
> argument
> is "in only". making `in` default is breaking of my lovely
> principle of
> least astonishment.
"in" is "const scope"... But signatures in D are too noisy. It is
very difficult to avoid, so it is important to keep signatures
simple for increased legibility.
I think "in", "out", "inout" and "scope "should go. Make all
parameters that are by-value immutable by default. Make all
parameters that are ref scope restricted and alias free by
default. Add tuples. Add ways to express that parameters are used
in dangerous ways ("escapable", "returnable"...)
More information about the Digitalmars-d
mailing list