From 87845d69835cc74cb4c7b7d16869b1e5ee481908 Mon Sep 17 00:00:00 2001 From: henesy Date: Mon, 25 Feb 2019 17:42:16 -0600 Subject: add constants example --- Constants/const.b | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Constants/const.b (limited to 'Constants/const.b') 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; +} -- cgit v1.2.3