How do I do this in Moonscript?
function a:do_something(b)
print(b)
end
Nothing I tried would compile and I didn't see anything in their documentation.
How do I do this in Moonscript?
function a:do_something(b)
print(b)
end
Nothing I tried would compile and I didn't see anything in their documentation.
In Lua what you wrote is syntactic sugar for the following:
So you would do just that in MoonScript. (note the
=>as a shorthand for addingselfto the front of the function's argument list)