summaryrefslogtreecommitdiff
path: root/Constants/const.b
diff options
context:
space:
mode:
authorhenesy <henesy.dev@gmail.com>2019-02-25 17:42:16 -0600
committerhenesy <henesy.dev@gmail.com>2019-02-25 17:42:16 -0600
commit87845d69835cc74cb4c7b7d16869b1e5ee481908 (patch)
treec50e68aa2b1a9219dd5256e4899edb7f1e37ac9c /Constants/const.b
parent59602089585c48b2e319081e423c4382c2ef9bbb (diff)
add constants example
Diffstat (limited to 'Constants/const.b')
-rw-r--r--Constants/const.b26
1 files changed, 26 insertions, 0 deletions
diff --git a/Constants/const.b b/Constants/const.b
new file mode 100644
index 0000000..2868ec7
--- /dev/null
+++ b/Constants/const.b
@@ -0,0 +1,26 @@
+implement Const;
+
+include "sys.m";
+include "draw.m";
+
+sys: Sys;
+print: import sys;
+
+Const: module {
+ init: fn(nil: ref Draw->Context, nil: list of string);
+};
+
+n: con 7;
+Red, Green, Blue: con iota;
+
+init(nil: ref Draw->Context, nil: list of string) {
+ sys = load Sys Sys->PATH;
+
+ s: con "Limbo";
+
+ print(string n + "\n");
+ print("Red: %d Green: %d Blue: %d\n", Red, Green, Blue);
+ print(s + "\n");
+
+ exit;
+}