You need to provide an anonymous proc. This works:
    
    
    import sugar
    
    proc calc(a: int, b: int): (int) -> int =
      let diff = a - b
      result = proc (c: int): int =
        result = c - diff
    
    
    let diff_proc = calc(5, 6)
    echo diff_proc(7)
    
    
    Run

Reply via email to