We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So the following code:
(arg1, arg2) -> with table_with_functions return { .fn1("work") .fn2("more work") }
My intent is to have a function return a table that is filled with values returned by functions inside table_with_functions.
Compiles fine, generates the following code:
return function(arg1, arg2) do local _with_0 = table_with_functions return { _with_0.fn1("work"), _with_0.fn2("more work") } return _with_0 end end
That last return is not valid Lua and it doesn't work.
I've ended up writing it like such:
(arg1, arg2) -> with table_with_functions return { .fn1("work") .fn2("more work") } local _
But that just seems like a hack to avoid implicit return.
Am I doing something wrong? Is there a better way? I've only been using MoonScript for about two days so I might've missed something.
The text was updated successfully, but these errors were encountered:
ce396ac
No branches or pull requests
So the following code:
My intent is to have a function return a table that is filled with values returned by functions inside table_with_functions.
Compiles fine, generates the following code:
That last return is not valid Lua and it doesn't work.
I've ended up writing it like such:
But that just seems like a hack to avoid implicit return.
Am I doing something wrong? Is there a better way? I've only been using MoonScript for about two days so I might've missed something.
The text was updated successfully, but these errors were encountered: