Translations:Extension:Scribunto/Lua reference manual/144/en

-- This returns a function that adds a number to its argument function makeAdder( n ) return function( x ) -- The variable n from the outer scope is available here to be added to x        return x + n     end end local add5 = makeAdder( 5 ) mw.log( add5( 6 ) ) -- prints 11