diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-07-13 19:10:59 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-07-13 19:10:59 -0700 |
commit | fc2046a176334037507f77de382abdabf2895aae (patch) | |
tree | cbe00c6f510833bc78f2369048e5a401bd79d61c /global.mu | |
parent | dfc6e268c7685e7ea5f5cdb434e62e63d2d7c915 (diff) | |
download | mu-fc2046a176334037507f77de382abdabf2895aae.tar.gz |
1771
Diffstat (limited to 'global.mu')
-rw-r--r-- | global.mu | 14 |
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 +] |