Advertisement
Guest User

Untitled

a guest
Aug 24th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.22 KB | None | 0 0
  1.  
  2. type
  3.   TestType = object
  4.     p: proc(x: string, y: int): int {.closure.}
  5.  
  6. when isMainModule:
  7.   proc tproc(x: string, y: int): int =
  8.     echo x
  9.     echo $y
  10.  
  11.   let t = TestType(p: tproc)
  12.  
  13.   discard t.p("a", 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement