A Global Singleton is a class of which only one instance exists within a program.

Any attempt to use non-static members of the class involves performing operations on this one instance.




 
Class Singleton
  static sys inst 'private
  int instantiated() { return inst }
  void constructor(){ if not inst then inst=@this }
 
  'all other methods start with @this=inst
end class
 
 
'if not singleton.instantiated
  new Singleton MySingleton
'endif
 