summaryrefslogtreecommitdiff
path: root/Values/values.b
diff options
context:
space:
mode:
authorhenesy <henesy.dev@gmail.com>2019-02-25 16:59:36 -0600
committerhenesy <henesy.dev@gmail.com>2019-02-25 16:59:36 -0600
commit0f3db39e37962190a1ab913039c344ae40bd1713 (patch)
treec70bffc8d03863e3549a5be661873a3bdbd05eaa /Values/values.b
parenteb83423d255d652e4f8fa4ad5e1b1fc1c722f54c (diff)
add values example
Diffstat (limited to 'Values/values.b')
-rw-r--r--Values/values.b35
1 files changed, 35 insertions, 0 deletions
diff --git a/Values/values.b b/Values/values.b
new file mode 100644
index 0000000..a3732d6
--- /dev/null
+++ b/Values/values.b
@@ -0,0 +1,35 @@
+implement Values;
+
+include "sys.m";
+include "draw.m";
+
+sys: Sys;
+print, sprint: import sys;
+
+Values: module {
+ init: fn(nil: ref Draw->Context, nil: list of string);
+};
+
+init(nil: ref Draw->Context, nil: list of string) {
+ sys = load Sys Sys->PATH;
+
+ n := 7;
+ b := big 8;
+ f := real 3.2;
+ str := "String!";
+
+ print("%d\n", 0 || 1);
+ print("%d\n", 0 && 1);
+
+ print("%d\n", n / int f);
+ print("%f\n", real n / f);
+ print("%bd\n", b / big 8);
+
+ print("%s\n", str[:len str-1]);
+ print("%s\n", str[2:]);
+
+ print("%s", "inferno " + "os " + sprint("%c", '\n'));
+ print("limbo" + " " + "lang\n");
+
+ exit;
+}