aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/wiki_src/coding/meta-programming.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/wiki_src/coding/meta-programming.md')
-rw-r--r--docs/wiki_src/coding/meta-programming.md8
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/wiki_src/coding/meta-programming.md b/docs/wiki_src/coding/meta-programming.md
index 334e285..716cc7a 100644
--- a/docs/wiki_src/coding/meta-programming.md
+++ b/docs/wiki_src/coding/meta-programming.md
@@ -74,4 +74,12 @@ Examples:
:test (map inc `0) (`1)
:test (map (map inc) `[0]) (`[1])
:test (map swap `[0 1]) (`[1 0])
+
+# encoding terms as numbers
+:test ((encode `(0 0)) =? (+3)) (true)
+:test ((encode `[0]) =? (+8)) (true)
+
+# decoding numbers to terms
+:test (decode (+3)) (`(0 0))
+:test (decode (+8)) (`[0])
```