Re: type mismatch assigning function pointer? gcsafeness confusion?

2017-01-24 Thread bpr
> 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

Re: type mismatch assigning function pointer? gcsafeness confusion?

2017-01-24 Thread Araq
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).

type mismatch assigning function pointer? gcsafeness confusion?

2017-01-23 Thread luked2
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