From: Christopher S. <cs...@dt...> - 2012-04-25 19:59:00
|
Global variables are used as the simplest implementation of the "singleton pattern". People use them often for bootstrapping, as a database, fixed enumerations, etc. There is no need to fetishly implement a superfluous container (such as a class instance, whose pointer you need to pass around) for things like that, when you could just as easily refer to the plist or hash table *global-reasons-for-global-variables*. A related concept you should look into are "special" variables, which have different scope. You should read these: http://www.flownet.com/ron/specials.pdf http://www.gigamonkeys.com/book/variables.html |