Updating stuff on the Wiki
View Single Post
04/13/14, 06:15 AM
Join Date: Apr 2014
Originally Posted by
I guess all of your were right.
However, for "beginner" it is not immediately recognizable that Lua has the ":" operator which causes in this case the eventCode as first Argument.
The list of parameter are correct, however it should be mentioned at the top of the EVENT site, that there will be always the eventCode as first argument.
myfunc(object, param1, param2)
That's the signature.
That LUA allows myfunc to be called in three ways, as:
obj.myfunc(otherobj, param1, param2)
obj.myfunc(obj, param1, param2)
does not suddenly change the signature of myfunc.
The signature for string.len is string.len(string s).
It is not string.len(), just because you can use name:len() as shorthand for name.len(name). And I have never seen a documentation that pretends that string.len(string s) would be string.len(). And LUA documentation is obviously even older than WoW addon documentation.
You can easily see the difference if you take the opposite example and make a function
Calling this function with obj:myfunc(param1, param2) will
work and you would never call this function with obj.myfunc(obj, param1, param2), because you see immediately that it violates the signature.
View Public Profile
Send a private message to Iyanga
Find More Posts by Iyanga