> There is an automatic conversion from nimcall to closure but not in tuple
> constructors (for better or worse).
What are the precise conditions under which one should choose a tuple over an
object? I'd use them for points in n-space for small n, and other tasks where I
wrap up a very small
They are not the same, the proc type is `.closure` the proc is `.nimcall`.
There is an automatic conversion from nimcall to closure but not in tuple
constructors (for better or worse).
Hi!
What am I doing wrong here:
type
FooProc = proc(x: int)
Callbacks = tuple [
cb: FooProc
]
proc foo(x: int) : void = echo "foo: " & $x
let f:FooProc = foo
let c0: Callbacks = (cb: f)# works fine
let c1: Callbacks