LUA Scoping Semantics
Hello,
I'm a very new to LUA programming (2 full days), tho' I do have an extensive background in C/C++ and Java. Alas, I have run into what appears to be a scoping problem and I'm confused. Here's the problem: in mylib.lua I have the function definition Code:
function parseStackTrace() Code:
function runTests() Quote:
my .toc file contains these lines Quote:
Cheers, |
I suggest to paste whole code, instead of snippets. For example, I don't see what calls runTests().
Additional issue is use of global functions. While in debugging phase it's OK but "good" add-ons try to avoid polluting global environment. If you plan to use something as an argument in a function, both the call, and function definition has to have variable (at worst case, ellipsis). Also, for WoW to know the new content of toc file, you need to restart it but you probably already knew it. |
See the reply on the WoW Forum
|
I can't help with your problem, but, I can clear up one other thing: it is "Lua" (a Portuguese word meaning "moon") not"LUA" (it is a word, not an acronym). :o Sorry, I couldn't help myself.
|
It seems like Fizzlemizz forgot to provide a link for people who might have similar problem.
|
All times are GMT -6. The time now is 01:49 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI