Title: In Lua, should a functions arguements be (re)localised in the function?
Tags: function;lua;local-variables
Question: Consider:
function function_name(var_one, var_two)
var_one = var_two
return var_one
print( function_name("string_one", "string_two") )
As appose to local var_one = var_two
Is var_one now a global variable or is it still in the functions local scope?
Should local var_one be used or is it already in the scope?
Comment: Edited to explain that I am asking whether `var_one` would become global or not.

Comment: What are you trying to achieve? It's hard to tell what it is this should be doing. And without that, there's nothing to say that what you have there is in any way wrong.

Here is the accepted answer: No, there's no need for this. The name var_one is already local. You are simply wiping out the original value. You must use _G.var_one if you wish to explicitly refer to the global.

Here is another answer: The argument is a local variable (already).
When you reference it (the assignment), it looks for a lexically scoped variable with that name. It finds the local variable and uses it.
It's this local variable that becomes an "upvalue" (a non-local variable) if the function is a closure.
If it doesn't find the local variable, it instead performs a global lookup. If you want to force a global lookup, you just manually go into the globals table, since that's what a global lookup is.
If you change the assignment of the variable to declare it as local, you're actually creating a new local variable, lexically scoped, which is distinct from the argument, but hiding it lexically.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:05/29/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<function><lua><local-variables>', 'Title': 'In Lua, should a functions arguements be (re)localised in the function?', 'ViewCount': 76, 'id': 10806018, 'user_AboutMe': None, 'user_AccountId': None, 'user_DisplayName': None, 'user_Reputation': None, 'user_Views': None, 'user_id': None}}