On Saturday, 19 November 2016 at 13:57:26 UTC, Jonathan M Davis
wrote:
On Saturday, November 19, 2016 09:46:08 Marduk via
Digitalmars-d-learn wrote:
[...]
A string mixin literally puts the code there. So, doing
mixin("int n = 10");
double[n][n] m;
is identical to
int n = 10;
double[n][n] m;
On Saturday, November 19, 2016 09:46:08 Marduk via Digitalmars-d-learn
wrote:
> In C one can do the following:
>
> # define N 10
>
> double M[N][N];
>
>
> In D I would like to achieve the same result. I tried with:
>
> mixin("int N = 10;");
>
> double[N][N] M;
>
>
> but the compiler (DMD) complain
On Saturday, 19 November 2016 at 09:49:48 UTC, rikki cattermole
wrote:
On 19/11/2016 10:46 PM, Marduk wrote:
In C one can do the following:
# define N 10
double M[N][N];
In D I would like to achieve the same result. I tried with:
mixin("int N = 10;");
double[N][N] M;
but the compiler (DM
On 19/11/2016 10:46 PM, Marduk wrote:
In C one can do the following:
# define N 10
double M[N][N];
In D I would like to achieve the same result. I tried with:
mixin("int N = 10;");
double[N][N] M;
but the compiler (DMD) complained with Error: variable N cannot be read
at compile time.
Wh