diff options
author | Araq <rumpf_a@web.de> | 2012-06-15 23:18:52 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-06-15 23:18:52 +0200 |
commit | 15dad22a0adec4e93e062b54fa4ff06281f089ad (patch) | |
tree | 41332b4bdb1dc5f3f5a9025db14444d0e4975f4e /tests/run/tclosure.nim | |
parent | 70c283ac6490907940510f643c6e7d9923e93aa7 (diff) | |
download | Nim-15dad22a0adec4e93e062b54fa4ff06281f089ad.tar.gz |
first implementation of new lambda lifting
Diffstat (limited to 'tests/run/tclosure.nim')
-rwxr-xr-x | tests/run/tclosure.nim | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/run/tclosure.nim b/tests/run/tclosure.nim index 372e296d0..d9e7b8ee4 100755 --- a/tests/run/tclosure.nim +++ b/tests/run/tclosure.nim @@ -34,6 +34,14 @@ myData.each do (x: int): #OUT 2 4 6 8 10 - - +type + ITest = tuple[ + setter: proc(v: Int), + getter: proc(): int] + +proc getInterf(): ITest = + var shared: int + + return (setter: proc (x) = shared = x, + getter: proc (): int = return shared) |