about summary refs log blame commit diff stats
path: root/global.mu
blob: 7e0c042f8e7464ac9706aee0c3f8bd922928d23d (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                                                      
          
                                    
                                            
                                          
                              


     
         
                                
                                       
 
# example program: creating and using global variables

def main [
  # allocate 5 locations for globals
  global-space:space <- new location:type, 5
  # read to globals by using /space:global
  1:num/space:global <- copy 3
  foo
]

def foo [
  # ditto for writing to globals
  $print 1:num/space:global, 10/newline
]