Specifying function argument names in lua -


i load body of function string (with c api), default, arguments passed function accessed .... best way specify argument list? can think of prepending line following string before parsing (assume arguments should self, x, y):

local self, x, y = ... 

however, i'm not sure if best way this, or whether has unintended side effects.

update: in 1 of functions, need argument list of form self, type, .... following wouldn't work, right?

local self, type, ... = ... 

should use instead?

text = "return function(self, type, ...)" + text + " end"; lual_loadbufferx(l, text, text.length(), filename, "t"); lua_call(l, 0, 1); 

prepending line excellent way create named arguments. if use local declaration have, there won't side effects (except ones rest of code).


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -