On Tuesday, 29 July 2025 at 23:48:58 UTC, H. S. Teoh wrote:
`i` is immutable, so it's illegal to use mutating operations
like ~= on it.
@luna
The question should be if programming in d (page 177
https://ddili.org/ders/d.en/Programming_in_D.pdf) should be
authoritive here
It is possible t
On Tue, Jul 29, 2025 at 10:57:50PM +, Brother Bill via Digitalmars-d-learn
wrote:
> ```
> import std.stdio;
>
> immutable int[] i;
>
> shared static this() {
> writeln("In shared static this()");
> i ~= 43;
> }
`i` is immutable, so it's illegal to use mutating operations like ~=
On Tuesday, 29 July 2025 at 22:57:50 UTC, Brother Bill wrote:
```
import std.stdio;
immutable int[] i;
shared static this() {
writeln("In shared static this()");
i ~= 43;
}
void main()
{
writeln("In main()");
writeln("i: ", i);
}
```
Error messages:
C:\D\dmd2\w
On Tuesday, 29 July 2025 at 23:18:18 UTC, Brother Bill wrote:
Your changes do work, but at the cost of making i NOT deeply
immutable: no assignment, no changing any elements, no
appending, no setting length.
if you insit on the type id suggest this code then
```d
import std.stdio;
immutabl
On Tuesday, 29 July 2025 at 23:03:41 UTC, monkyyy wrote:
On Tuesday, 29 July 2025 at 22:57:50 UTC, Brother Bill wrote:
```
import std.stdio;
immutable int[] i;
shared static this() {
writeln("In shared static this()");
i ~= 43;
}
void main()
{
writeln("In main()");
On Tuesday, 29 July 2025 at 22:57:50 UTC, Brother Bill wrote:
```
import std.stdio;
immutable int[] i;
shared static this() {
writeln("In shared static this()");
i ~= 43;
}
void main()
{
writeln("In main()");
writeln("i: ", i);
}
```
Error messages:
C:\D\dmd2\w
```
import std.stdio;
immutable int[] i;
shared static this() {
writeln("In shared static this()");
i ~= 43;
}
void main()
{
writeln("In main()");
writeln("i: ", i);
}
```
Error messages:
C:\D\dmd2\windows\bin64\..\..\src\druntime\import\core\internal\array\appe
On Tuesday, 29 July 2025 at 21:47:05 UTC, not monkyyy wrote:
Who are you?
On Tuesday, 29 July 2025 at 20:34:27 UTC, Nick Treleaven wrote:
On Monday, 28 July 2025 at 18:51:23 UTC, monkyyy wrote:
On Monday, 28 July 2025 at 11:18:48 UTC, Nick Treleaven wrote:
The solution I offered at the time while still fundamentally
flawed was far more robust then what was merged
W
On Monday, 28 July 2025 at 18:51:23 UTC, monkyyy wrote:
The solution I offered at the time while still fundamentally
flawed was far more robust
Sounds a lot likeā¦
Whack-a-moleing
On Monday, 28 July 2025 at 18:51:23 UTC, monkyyy wrote:
On Monday, 28 July 2025 at 11:18:48 UTC, Nick Treleaven wrote:
The solution I offered at the time while still fundamentally
flawed was far more robust then what was merged
What solution?
11 matches
Mail list logo