summary refs log tree commit diff stats
path: root/tests/run/tclosure.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-06-15 23:18:52 +0200
committerAraq <rumpf_a@web.de>2012-06-15 23:18:52 +0200
commit15dad22a0adec4e93e062b54fa4ff06281f089ad (patch)
tree41332b4bdb1dc5f3f5a9025db14444d0e4975f4e /tests/run/tclosure.nim
parent70c283ac6490907940510f643c6e7d9923e93aa7 (diff)
downloadNim-15dad22a0adec4e93e062b54fa4ff06281f089ad.tar.gz
first implementation of new lambda lifting
Diffstat (limited to 'tests/run/tclosure.nim')
-rwxr-xr-xtests/run/tclosure.nim12
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)