I meant to post this question here ...
In this ChaiScript note on github
, the author (Jason Turner) says:
[quote]There is significant overhead for stepping out of the function context and searching the global context for a variable, which has particular impact in a multithreaded environment. For that, and other reasons, use of global variables is discouraged in general and currently only available to create from the C++ API.
We strongly considered not allowing them at all, but decided it was necessary to support things like for an overused example) PI=3.14159265358979323[/quote]
Is that an accurate assessment for ModScript? If so, does it apply to variables only, i.e.
global MY_TABLE_ID = Ext.TableId("USR_MY_TABLE_DBNAME");
or does it also apply to global constants
add_global_const( "USR_MY_TABLE_DBNAME", "TBL_DBNAME" );