Uknown Command
#5
(05-10-2015, 04:22 PM)xoft Wrote: The dot is there for historical reasons, static functions used the dot-binding before we decided to use the colon-binding for all functions.

As for Lua, the colon means that an invisible "self" parameter is passed to the function as its first parameter, so these two are equivalent:
object:SomeFunction(param)
object.SomeFunction(object, param)

Alright, yeah, I know how the OOP stuff works with the self parameter. I was just confused on why you would have a .bind and :bind. While we are on the subject with API design, why does the API have a c in front of every object? cBlockArea, CPluginManager, why not just PluginManager and BlockArea?
Reply
Thanks given by:


Messages In This Thread
Uknown Command - by Shadowraix - 05-10-2015, 12:10 PM
RE: Uknown Command - by xoft - 05-10-2015, 03:51 PM
RE: Uknown Command - by Shadowraix - 05-10-2015, 04:15 PM
RE: Uknown Command - by xoft - 05-10-2015, 04:22 PM
RE: Uknown Command - by Shadowraix - 05-11-2015, 04:56 AM
RE: Uknown Command - by worktycho - 05-11-2015, 05:32 AM
RE: Uknown Command - by xoft - 05-11-2015, 07:28 AM
RE: Uknown Command - by Shadowraix - 05-11-2015, 09:42 AM
RE: Uknown Command - by xoft - 05-11-2015, 04:45 PM
RE: Uknown Command - by Shadowraix - 05-12-2015, 06:49 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:02 AM
RE: Uknown Command - by Shadowraix - 05-12-2015, 07:07 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:22 AM
RE: Uknown Command - by Shadowraix - 05-12-2015, 07:27 AM
RE: Uknown Command - by xoft - 05-12-2015, 07:24 AM



Users browsing this thread: 1 Guest(s)