about summary refs log tree commit diff stats
path: root/global.mu
diff options
context:
space:
mode:
Diffstat (limited to 'global.mu')
-rw-r--r--global.mu14
1 files changed, 14 insertions, 0 deletions
diff --git a/global.mu b/global.mu
new file mode 100644
index 00000000..839926a7
--- /dev/null
+++ b/global.mu
@@ -0,0 +1,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
+]