> Do you by the way know if Nim supports static constructors? I want to do
> something like the following:
type
Matrix[M, N: static[int], T] = object
data: array[M * N, T]
proc newIdentityMatrix(T: typedesc; N: static[int]): Matrix[N, N, T] =
type Out = T
# fill result with zeroes?
for row in 0 .. <N:
for col in 0 .. <N:
result.data[(row * N) + col] = Out(1.0) # Scalar product identity of
type
let x = newIdentityMatrix(float, 4) # Static square matrix set to identity
- Code generation from AST with annotations in Nim like in C komerdoor
- Re: Code generation from AST with annotations in Nim like ... komerdoor
- Re: Code generation from AST with annotations in Nim l... Arrrrrrrrr
- Re: Code generation from AST with annotations in N... Krux02
- Re: Code generation from AST with annotations ... komerdoor
- Re: Code generation from AST with annotat... Krux02
- Re: Code generation from AST with ann... komerdoor
- Re: Code generation from AST with... sleepyqt
- Re: Code generation from AST with... komerdoor
- Re: Code generation from AST with... Krux02
- Re: Code generation from AST with... komerdoor
- Re: Code generation from AST with... komerdoor
- Re: Code generation from AST with... Krux02
- Re: Code generation from AST with... komerdoor
- Re: Code generation from AST with... Krux02
- Re: Code generation from AST with... Krux02
