On Thursday, 2 March 2023 at 15:56:35 UTC, ryuukk_ wrote:
On Thursday, 2 March 2023 at 14:40:04 UTC, Iain Buclaw wrote:
Glad to announce the first beta for the 2.103.0 release, ♥ to
the 43 contributors.
This release comes with 9 major changes, including:
- In the compiler, `-preview=dip25` is now enabled by default.
- In the standard library, std.uni Grapheme functions have
been updated to conform to Unicode 15
- In dub, the `--color` argument now accepts the values
`auto`, `never`, and `always`.
http://dlang.org/download.html#dmd_beta
http://dlang.org/changelog/2.103.0.html
As usual please report any bugs at https://issues.dlang.org
-Iain
on behalf of the Dlang Core Team
```D
@safe ref int wrongIdentity(ref int x) {
return x; // ERROR! Cannot return a ref, please use "return
ref"
}
@safe ref int identity(return ref int x) {
return x; // fine
}
```
a keyword to return a value
``return 5;``
and a keyword to tell that a reference is returnable
``return ref int x``
that's dumb, why?
return ref is probably the tipping point for me. Even if better
keyword is used the accrual of complexity never ends. Though
arguably transitive qualifiers and inout were the point of no
return. Recently I had a case where in 64-bit mode a
data-structure could be implicitly converted to immutable while
in 32-bit it wouldn’t. After some mucking around a seemingly
unrelated change fixed it, the error message gave no clue of
what’s wrong.
Anyway I’d have a hard time selling transitive qualifiers in
particular shared, as most of the time shared object is taken off
the queue and should become thread-local. The type system doesn’t
want to hear any of it. Seems like ownership system beats
transitive qualifiers here, albeit both add significant friction.
—
Dmitry Olshansky