Skip to content

Instantly share code, notes, and snippets.

@honewatson
Created January 18, 2015 22:46
Show Gist options
  • Save honewatson/7f0cee4f0c6454721d5a to your computer and use it in GitHub Desktop.
Save honewatson/7f0cee4f0c6454721d5a to your computer and use it in GitHub Desktop.
Closure example ( nimlang, nimrod, nim lang )
proc tc(a:int): proc =
return proc (b:int): int =
return a + b
var x: proc = tc(1)
echo x(2)
@jabbalaci
Copy link

Output: 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment