aboutsummaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-11-18 10:19:06 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2021-11-18 10:37:40 +0200
commit5a3bc07079b1e9d1692b15c59369f5e3871705d7 (patch)
tree5b2f391d20e9d838153d2567578c0837278a697c /samples
parenta4f91d8e4509ccacb2ad09d9ec47f77a5c01470e (diff)
WIP Rewrite to point-free style
Diffstat (limited to 'samples')
-rw-r--r--samples/sample1.code9
1 files changed, 8 insertions, 1 deletions
diff --git a/samples/sample1.code b/samples/sample1.code
index f033721..337bd6d 100644
--- a/samples/sample1.code
+++ b/samples/sample1.code
@@ -1 +1,8 @@
-my-func 1 2 \ No newline at end of file
+foo = "foo";
+bar = "bar";
+int.double = int.multiply 2;
+list.multiply-all = reduce int.multiply 1;
+
+ifelse (string.eq? foo bar)
+ (int.double 1) # if foo = bar, calc 1 * 2
+ (int.double 2) # else, calc 2 * 2