Pretty much the subj. Is it safe to use leading underscores in function naming and could it possibly have any collisions with pol internals?
I have a number of functions starting with _p_ to indicate its private and some of those display a rather odd behavior.
Could the naming be the case?
Thank you.
Is it safe to use leading underscore in var/func naming?
Re: Is it safe to use leading underscore in var/func naming?
Hello,
it should be completely safe to use underlines in function/variable names. The name '_p_' should be ok.
OWHorus
it should be completely safe to use underlines in function/variable names. The name '_p_' should be ok.
OWHorus
Re: Is it safe to use leading underscore in var/func naming?
Sometimes it is.
If you are in a 'foreach' loop there is a _(var)_iter variable that comes with it.
Example:
If you are in a 'foreach' loop there is a _(var)_iter variable that comes with it.
Example:
Code: Select all
var beer := array{"Yum", "Yay", "Good", "Superb", "Fantastic", "Bacon", "Hell Yeah!"};
foreach word in ( beer )
print ("Entry "+_word_iter+" contains "+word);
Sleepms(10);
endforeach
Re: Is it safe to use leading underscore in var/func naming?
I actually found that _*_iter is prone to the same dictionary glitch as for loop (a short version), such that it wouldn't insert Integer keys inside the foreach if _*_iter is used. I wonder if the explicit calls dictionary::insert(key, value) could help to avert this.
Re: Is it safe to use leading underscore in var/func naming?
Interesting... Ill look into this when I get time. It looks like a run-time issue with the scripts, rather than compile-time. I went through the compiler code last night.