What do you think?
Grumpy Gamer
NOVEMBER 1, 2018
Doing testing on closures. This also makes my head hurt. What do you think this will print? local t = { bar = 100 f = function() { print(this.bar) } } t2 <- { bar = 200 } t2.f <- t.f local r = { bar = 1000 function do_call(f) { f() } } r.do_call(t2.f) Now with Answers Well, not answers in the definitive truth of the universe way… If you compile and run this code in Squirrel , the answer is 1000.
Let's personalize your content