Skip to content

Instantly share code, notes, and snippets.

@Araq
Created February 3, 2012 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Araq/1730310 to your computer and use it in GitHub Desktop.
Save Araq/1730310 to your computer and use it in GitHub Desktop.
proc p =
var delta = 7
proc accumulator(start: int): proc(): int =
var x = start-1
result = proc (): int =
x = x + delta
inc delta
return x
var a = accumulator(3)
var b = accumulator(4)
echo a() + b()
p()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment