type
OrderType* = enum rowMajor*, colMajor*
Matrix64*[M, N: static[int]] = object
order: OrderType
data: ref array[M * N, float64]
I have defined my own $ proc for this type. Apparently this creates a conflict with a default system.$(x: T) which I guess is defined for values of object type, so I get Error: ambiguous call; both system.$(x: T) and linalg.$(m: Matrix64) match for: (Matrix64[4, 4]) when I try to print a matrix.
Is there a way to opt out the default $ and tell Nim to use my custom $ instead?
Works for me:
type
OrderType* = enum rowMajor, colMajor
Matrix64*[M, N: static[int]] = object
order: OrderType
data: ref array[M * N, float64]
proc `$`(m: Matrix64): string = "foo"
var x: Matrix64[2, 3]
echo x
proc `$`[M, N: static[int]](m: Matrix64[M, N]): string = "foo"
@andrea What version of the compiler are you using?
@def What about you?