News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
possible callback inconsistency?
Author Message
Senior Member

Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
possible callback inconsistency?

I'm not sure if I'm just misunderstanding the logic in using callbacks, if there's something I'm overlooking, or if there is an inconsistency.

Let's assume you have the following pseudo function:

function funk(a,b,c)
do a command
maybe do something else

Now assume a button named "button", which is used to call funk. If you don't use any parameters, you can set it up like this:


If you need to use funk's parameters, you apparently must create a second function to use as the callback, like this for example:

function(button) funk("hay","bee","sea") end

If this seemingly redundant function is not created, the callback is done immediately when the application runs. This occurs if the callback is create like this:


It doesn't seem logical or consistent to have to change the way a callback is defined just because you want to pass a parameter to the function. It also seems unnecessary to create a function in order to call a function.
Am I missing something? Maybe I've been defining callbacks incorrectly?

05-17-2007 09:13 AM
Find all posts by this user Quote this message in a reply
Junior Member

Posts: 39
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #2
RE: possible callback inconsistency?

I've noticed the same thing. I don't believe that "pure" Lua acts that way though.

05-19-2007 03:34 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: