local function foo(arg)
return function()
-- this is the actual function that is being ran
-- ...
print(arg) -- prints "Bar"
end
end
DoSomething(foo("Bar"))
-- the `foo` call will return a function, and that function is called by the `DoSomething` function