I hope this gets the point accross. type Mat = object a: array[10, array[20, int]] proc apply(m: var Mat; op: proc (x: var int)) = # callback style for i in 0..<10: for j in 0..<20: op(m.a[i][j]) var m: Mat apply m, (proc (x: var int) = inc x, 2) template applyT(m: var Mat; op: untyped) = # template style for i in 0..<10: for j in 0..<20: op(m.a[i][j]) template opInc(x) = inc x, 2 applyT m, opInc Run
- Is there an easy way to bake in parameters at compile time? treeform
- Is there an easy way to bake in parameters at compile time? adokitkat
- Is there an easy way to bake in parameters at compile time? treeform
- Is there an easy way to bake in parameters at compile time? xigoi
- Is there an easy way to bake in parameters at compile time? xigoi
- Is there an easy way to bake in parameters at compile time? Araq
- Is there an easy way to bake in parameters at compile time? treeform
- Is there an easy way to bake in parameters at compile time? treeform
- Is there an easy way to bake in parameters at compile time? xigoi
- Is there an easy way to bake in parameters at compile time? treeform
- Is there an easy way to bake in parameters at compile time? Araq