Calling object functions using dot instead of colon?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling object functions using dot instead of colon?

Kristoffer Danielsson
Stumbled upon this:
http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html
 
Looking at the images, it seems a dot (".") is used instead of a colon (":") when calling functions inside an object/module?
 
How do you accomplish this? I'm used to colon:
 
myObject:foo()
vs
myObject.bar() <--?
 
Thanks


Lägg till karta och vägbeskrivning för din fest. Visa vägen!
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Calling object functions using dot instead of colon?

Tom McCubbin-2
. operator is basically just for scope. 

: operator is ALWAYS for object instances and is a simple syntactic shortcut for .<method>( self, ... ).

The Lua book details this all...you might want to check it out at www.lua.org


On Wed, Jun 10, 2009 at 11:01 AM, Kristoffer Danielsson <[hidden email]> wrote:
Stumbled upon this:
http://google-opensource.blogspot.com/2009/06/introducing-android-scripting.html
 
Looking at the images, it seems a dot (".") is used instead of a colon (":") when calling functions inside an object/module?
 
How do you accomplish this? I'm used to colon:
 
myObject:foo()
vs
myObject.bar() <--?
 
Thanks


Lägg till karta och vägbeskrivning för din fest. Visa vägen!

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user