From 15dad22a0adec4e93e062b54fa4ff06281f089ad Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 15 Jun 2012 23:18:52 +0200 Subject: first implementation of new lambda lifting --- tests/run/tclosure.nim | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/run/tclosure.nim') 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) -- cgit 1.4.1-2-gfad0