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



                                                      
                                                                    
                                          
                                 




                                
                                          
 
# example program: creating and using global variables

recipe main [
  # allocate 5 locations for globals
  global-space:address:shared:array:location <- new location:type, 5
  # read to globals by using /space:global
  1:number/space:global <- copy 3
  foo
]

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