about summary refs log tree commit diff stats
path: root/070text.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-29 01:00:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-29 01:00:30 -0800
commitafb467ea0270c59f9fdcad9fe5303d0ed526177c (patch)
treea8254143010d612908b9b4cc534bf4ab1da199a7 /070text.mu
parentc9b98c21ffea7a2e48e10e01b80dabad42641e57 (diff)
downloadmu-afb467ea0270c59f9fdcad9fe5303d0ed526177c.tar.gz
2606 - handle cycles inside stash
The idea is that to-text-line should truncate blindly past some
threshold, even if to-text isn't smart enough to avoid infinite loops.

Maybe I should define a 'truncating buffer' which stops once it fills
up. That would be an easy way to eliminate all infinite loops in
to-text-line.
Diffstat (limited to '070text.mu')
-rw-r--r--070text.mu10
1 files changed, 9 insertions, 1 deletions
diff --git a/070text.mu b/070text.mu
index eb3875d0..5de21e41 100644
--- a/070text.mu
+++ b/070text.mu
@@ -1,6 +1,14 @@
 # Some useful helpers for dealing with text (arrays of characters)
 
-# to-text gets called implicitly in various places
+# to-text-line gets called implicitly in various places
+# define it to be identical to 'to-text' by default
+recipe to-text-line x:_elem -> y:address:array:character [
+  local-scope
+  load-ingredients
+  y <- to-text x
+]
+
+# to-text on text is just the identity function
 recipe to-text x:address:array:character -> y:address:array:character [
   local-scope
   load-ingredients