That nim version isn’t much better IMO, but I am unfamiliar with the language.
var signal*: proc (a1: cint; a2: proc (a1: cint)): proc (a1: cint)
That reads to me as:Variable signal is a pointer to a function that that takes two arguments (an int, and a function that takes an int), and returns a function that takes one argument (an int).
Of course, I'm assuming my interpretation is correct... perhaps it's not ;)
Note that Nim uses "*" as a public symbol sigil not a pointer. Its a bit odd at first coming from C but is nice and consistent.
var signal*: (cint,(cint)->void) -> (cint)->void