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

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

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