From da33bf20d6907a9f783e4a3015105a353d4d956e Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Thu, 10 Jan 2013 06:16:36 -0800 Subject: Create rupval.lua --- tests/rupval.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/rupval.lua diff --git a/tests/rupval.lua b/tests/rupval.lua new file mode 100644 index 0000000..7b5a270 --- /dev/null +++ b/tests/rupval.lua @@ -0,0 +1,25 @@ +lanes = require "lanes".configure{with_timers=false} + +-- make sure we can copy functions with interdependant upvalues + +local b +local a = function( n) + print( "a", n) + return n <= 0 and n or b( n-1) +end + +local c +b = function( n) + print( "b", n) + return n <= 0 and n or c( n-1) +end + +c = function( n) + print( "c", n) + return n <= 0 and n or a( n-1) +end + +local g = lanes.gen( "*", a) + +local l = g(10) +l:join() -- cgit v1.2.3-55-g6feb