For some reason procvar (proc parameter) sometimes need some help with either 
{.closure.} or {.nimcall.}
    
    
    proc doIt(x: (string, proc(){.closure.})) =
      echo x[0]
    
    doIt(("xx", proc() {.closure.} = echo "aa"))
    
    
    Run

Be sure to check the `sugar` module as well for `->` and `=>` shortcuts
    
    
    proc passTwoAndTwo(f: (int, int) -> int): int =
      f(2, 2)
    
    passTwoAndTwo((x, y) => x + y) # 4
    
    
    Run

Reply via email to