Re: how to install the new dmd on Mac M1?

2022-08-27 Thread Johan via Digitalmars-d-learn
On Thursday, 25 August 2022 at 14:44:22 UTC, MichaelBi wrote: -iMac ~ % curl -fsS https://dlang.org/install.sh | bash -s dmd Unsupported Arch arm64 I've fixed this quite some time ago: https://github.com/dlang/installer/pull/491 Apparently it was never released? -Johan

Re: How to use a non-static objects in string `mixin`?

2022-08-27 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 27 August 2022 at 13:20:13 UTC, hype_editor wrote: I need to use function `eval` sometimes, but compiler throws an error: `Error: variable `firstOperand` cannot be read at compile time`. ```d override public double eval() { double firstOperand =

How to use a non-static objects in string `mixin`?

2022-08-27 Thread hype_editor via Digitalmars-d-learn
I need to use function `eval` sometimes, but compiler throws an error: `Error: variable `firstOperand` cannot be read at compile time`. ```d import std.array; import std.format; public class BinaryOperatorExpression { private { string operator;

Re: Casting rules

2022-08-27 Thread JG via Digitalmars-d-learn
On Friday, 26 August 2022 at 21:18:15 UTC, ag0aep6g wrote: On Friday, 26 August 2022 at 20:42:07 UTC, JG wrote: [...] Casting immutable/const away: https://dlang.org/spec/const3.html#removing_with_cast The cast itself allowed. Mutating the data is not. Casting to immutable: