One-shot? (was: Global variables and stuff)
 
            
            
            
            
                9 Nov
                
                    2004
                
            
            
                9 Nov
                
                '04
                
            
            
            
        
    
                6:53 a.m.
            
        I've not been following the Global variables debate too closely, it seeming to have something of a religious wars flavour, but I noticed that an example being proposed was how to achieve a "one shot" execution. Here's something I did when working on modifications to the HaXML parser: [[ -- Memoization of withSocketsDo to prevent multiple calls. -- (cf. http://tangentsoft.net/wskfaq/articles/lame-list.html) socketsInitialized :: Bool socketsInitialized = unsafePerformIO ( withSocketsDo ( return True ) ) ]] Does it work as I think it does? ARe there any problems I'm overlooking? #g ------------ Graham Klyne For email: http://www.ninebynine.org/#Contact
        7661
        
      
          Age (days ago)
        
      
        7661
        
    
          Last active (days ago)
        
        
        
        0 comments
    
    
        
        1 participants
    
    
    
    
    
    
    
    
    participants (1)
- 
                 Graham Klyne Graham Klyne