SCS
|
  |
 |
| Joined: 24 Jun 2008 |
| Total Posts: 10075 |
|
|
| 13 Apr 2012 12:21 AM |
| What is the difference between connecting functions regularly and anonymously, and which one works better? |
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 13 Apr 2012 12:31 AM |
I haven never found a situation where I *needed* to connect a function by a specific way but it really does not matter what you do. Most scripters I see use anonymous functions to save typing but the best option would probably be connecting a local function and deleting it from memory right after
local foo foo = function() --[[myCode]] end object.Event:connect(foo) foo = nil
I'd suggest not worrying about which one is better since you probably won't find a situation where using a defined function over anon(idk how to spell) would matter but yeah juust do whatever you like best/makes sense to you |
|
|
| Report Abuse |
|
|
SCS
|
  |
 |
| Joined: 24 Jun 2008 |
| Total Posts: 10075 |
|
|
| 13 Apr 2012 12:33 AM |
| Thank you for your informative reply. It was very helpful. |
|
|
| Report Abuse |
|
|