about summary refs log tree commit diff stats
path: root/html/lambda-to-mu.mu.html
diff options
context:
space:
mode:
Diffstat (limited to 'html/lambda-to-mu.mu.html')
-rw-r--r--html/lambda-to-mu.mu.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/html/lambda-to-mu.mu.html b/html/lambda-to-mu.mu.html
index 0478a1b7..d93a8b00 100644
--- a/html/lambda-to-mu.mu.html
+++ b/html/lambda-to-mu.mu.html
@@ -599,6 +599,24 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     <span class="Constant">40</span>:array:character<span class="Special"> &lt;- </span><span class="Constant">[ghi]</span>  <span class="Comment"># result.rest.rest</span>
   ]
 ]
+
+<span class="SalientComment">## convert tree of cells to mu text</span>
+
+<span class="muRecipe">def</span> to-mu in:address:cell<span class="muRecipe"> -&gt; </span>out:address:array:character [
+  <span class="Constant">local-scope</span>
+  <span class="Constant">load-ingredients</span>
+  buf:address:buffer<span class="Special"> &lt;- </span>new-buffer <span class="Constant">30</span>
+  buf<span class="Special"> &lt;- </span>to-mu in, buf
+  out<span class="Special"> &lt;- </span>buffer-to-array buf
+]
+
+<span class="muRecipe">def</span> to-mu in:address:cell, buf:address:buffer<span class="muRecipe"> -&gt; </span>buf:address:buffer, result-name:address:array:character [
+  <span class="Constant">local-scope</span>
+  <span class="Constant">load-ingredients</span>
+  <span class="Comment"># null cell? no change.</span>
+  <span class="Comment"># pair with all atoms? gensym a new variable</span>
+  <span class="Comment"># pair containing other pairs? recurse</span>
+]
 </pre>
 </body>
 </html>