So this might be a dumb question, but i need to understand this. I have read that a function is considered a variable… So my question is, when i am deleting all my variables or nilling them out for garbage cleanup, should i also be doing the same to my functions? I have never understood if this should be done or not. any information would be appreciated, thanks! [import]uid: 19620 topic_id: 10286 reply_id: 310286[/import]
Essentially yes.
If you never need to use the function again, you could assign it to nil and the garbage collector will clean it up (assuming no other references are holding it). But if the function is going to be used again, there is probably no benefit in doing this.
[import]uid: 7563 topic_id: 10286 reply_id: 37507[/import]
lets say i have a function that is in my level 1 file, and then the player goes to the menu, and then plays level 2, which uses the same function as level 1 in its level 2 file. would it be worth while to delete the function when the player leaves level 1, and then have it recreated in level 2?
hopefully that made sense =p
[import]uid: 19620 topic_id: 10286 reply_id: 37508[/import]
I will say it is probably not worth the effort. [import]uid: 7563 topic_id: 10286 reply_id: 37518[/import]