summaryrefslogtreecommitdiff
path: root/examples/nq/list.sin
diff options
context:
space:
mode:
Diffstat (limited to 'examples/nq/list.sin')
-rw-r--r--examples/nq/list.sin6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/nq/list.sin b/examples/nq/list.sin
index 87c2509..2023a95 100644
--- a/examples/nq/list.sin
+++ b/examples/nq/list.sin
@@ -2,9 +2,13 @@
[type nil_ [kind]]
[dec = [x y]]
+[dec + [x y]]
+[dec - [x y]]
[dec !> [c a]]
+[dec inc [x]]
+
[def cons [head tail]
[list_ 0 head tail]]
@@ -28,7 +32,7 @@
[def _length [xs n]
[if [is_nil xs]
n
- [_length [tail xs] [+ n 1]]]]
+ [_length [tail xs] [inc n]]]]
[def length [xs]
[_length xs 0]]