about summary refs log tree commit diff stats
path: root/lambda-to-mu.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-07 13:52:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-07 13:52:48 -0700
commit7bdcbfbed978d32cf4598ad1698006796e5b958c (patch)
treead42435b80154faf2616ef8b9f938047b6aa2eec /lambda-to-mu.mu
parentc842d90bbc5ab8f4fb88fb89ebb02c0c12051396 (diff)
downloadmu-7bdcbfbed978d32cf4598ad1698006796e5b958c.tar.gz
3159 - pause the lambda->mu translator for a bit
I'm going to focus on two projects for a while:
  a) the testable interface for file system and network
  b) a compiler translating some language to x86

b) might require first gaining some experience programming in Assembly.
Diffstat (limited to 'lambda-to-mu.mu')
-rw-r--r--lambda-to-mu.mu18
1 files changed, 18 insertions, 0 deletions
diff --git a/lambda-to-mu.mu b/lambda-to-mu.mu
index fdde50ef..a65f5387 100644
--- a/lambda-to-mu.mu
+++ b/lambda-to-mu.mu
@@ -563,3 +563,21 @@ scenario parse-dotted-list-of-more-than-two-atoms [
     40:array:character <- [ghi]  # result.rest.rest
   ]
 ]
+
+## convert tree of cells to mu text
+
+def to-mu in:address:cell -> out:address:array:character [
+  local-scope
+  load-ingredients
+  buf:address:buffer <- new-buffer 30
+  buf <- to-mu in, buf
+  out <- buffer-to-array buf
+]
+
+def to-mu in:address:cell, buf:address:buffer -> buf:address:buffer, result-name:address:array:character [
+  local-scope
+  load-ingredients
+  # null cell? no change.
+  # pair with all atoms? gensym a new variable
+  # pair containing other pairs? recurse
+]