diff src/print.sml @ 275:73456bfde988

Validating schema of a live database
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Sep 2008 14:40:57 -0400
parents 71bafe66dbe1
children fd34210bc3e5
line wrap: on
line diff
--- a/src/print.sml	Tue Sep 02 13:44:54 2008 -0400
+++ b/src/print.sml	Tue Sep 02 14:40:57 2008 -0400
@@ -59,6 +59,19 @@
         end
 fun p_list f = p_list_sep (box [PD.string ",", space]) f
 
+fun p_list_sepi sep f ls =
+    case ls of
+        [] => PD.string ""
+      | [x] => f 0 x
+      | x :: rest =>
+        let
+            val tokens = ListUtil.foldri (fn (n, x, tokens) =>
+                                             sep :: PD.cut :: f (n + 1) x :: tokens)
+                                         [] rest
+        in
+            box (f 0 x :: tokens)
+        end
+
 fun fprint f d = (PD.description (f, d);
                   PD.PPS.flushStream f)
 val print = fprint out