Skip to content

Instantly share code, notes, and snippets.

@0riginaln0
Last active March 28, 2026 15:35
Show Gist options
  • Select an option

  • Save 0riginaln0/b3edd75580d097cd6db27082cd593421 to your computer and use it in GitHub Desktop.

Select an option

Save 0riginaln0/b3edd75580d097cd6db27082cd593421 to your computer and use it in GitHub Desktop.
Lua... why?
pp = function(t)
print("{ " .. table.concat(t, ", ") .. " }")
end
a = function() return 1, 2 end
b = function() return 11, 12 end
pp { a(), b(), "why?"} -- { 1, 11, "why?" }
@0riginaln0
Copy link
Copy Markdown
Author

def a():
    return 1, 2

def b():
    return 11, 12

print([*a(), *b(), "because"]) # [1, 2, 11, 12, 'because']

@0riginaln0
Copy link
Copy Markdown
Author

def a = return 1, 2
def b = return 11, 12

p [*a, *b, "lua"] # => [1, 2, 11, 12, "lua"]

@0riginaln0
Copy link
Copy Markdown
Author

function a() { return [1, 2]; }
function b() { return [11, 12]; }

console.log([...a(), ...b(), "sucks"]); // [1, 2, 11, 12, "sucks"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment