On Wednesday, 26 June 2024 at 01:17:01 UTC, mw wrote:
On Tuesday, 25 June 2024 at 21:13:44 UTC, Nick Treleaven wrote:
I think in the next edition of D we can forbid tail mutable
initializers.
It is still (or maybe only) useful for fields of a singleton
class.
But a compiler warning
On Tuesday, 25 June 2024 at 21:13:44 UTC, Nick Treleaven wrote:
I think in the next edition of D we can forbid tail mutable
initializers.
It is still (or maybe only) useful for fields of a singleton
class.
On Tuesday, 25 June 2024 at 21:13:44 UTC, Nick Treleaven wrote:
On Tuesday, 25 June 2024 at 02:16:25 UTC, mw wrote:
Why `foo.x.saa.aa` and `foo.y.saa.aa` is the same? (and of
course print out the same contents).
`shared_AA.saa` should still be instance variable, not class
variable, right?
On Tuesday, 25 June 2024 at 02:16:25 UTC, mw wrote:
Why `foo.x.saa.aa` and `foo.y.saa.aa` is the same? (and of
course print out the same contents).
`shared_AA.saa` should still be instance variable, not class
variable, right?
`saa` is an instance variable, but both `foo.x.saa` and
On 25/06/2024 3:38 PM, mw wrote:
Why D choose to be different here? i.e. |shared_AA_class saa = new
shared_AA_class()| only evaluate only once, and even force it must be
evaluate-able at compile time?
That has nothing to do with it.
Every type in D has an initialized value, that everything
It's a bug.
On Tuesday, 25 June 2024 at 02:25:14 UTC, Richard (Rikki) Andrew
Cattermole wrote:
On 25/06/2024 2:16 PM, mw wrote:
struct shared_AA {
shared_AA_class saa = new shared_AA_class(); // by this
syntax `saa` is still instance variable?
alias saa this;
}
When you specify an initializer
On 25/06/2024 2:16 PM, mw wrote:
struct shared_AA {
shared_AA_class saa = new shared_AA_class(); // by this syntax `saa`
is still instance variable?
alias saa this;
}
When you specify an initializer like this, that instance of
``shared_AA_class`` gets put into the .init of
Sorry about the silly code, but I just tried this:
```
$ cat shared_aa.d
import std;
synchronized class shared_AA_class {
private:
int[int] aa;
alias aa this;
public:
void print() {
writeln(, aa);
}
}
struct shared_AA {
shared_AA_class saa = new shared_AA_class(); // by