about summary refs log tree commit diff stats
path: root/global.mu
blob: 7f117c0cb93e9715a53039aaa3e170a459aff210 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# example program: creating and using global variables

def 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
]

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