Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
274:e4baf03a3a64 | 275:73456bfde988 |
---|---|
57 in | 57 in |
58 box (f x :: tokens) | 58 box (f x :: tokens) |
59 end | 59 end |
60 fun p_list f = p_list_sep (box [PD.string ",", space]) f | 60 fun p_list f = p_list_sep (box [PD.string ",", space]) f |
61 | 61 |
62 fun p_list_sepi sep f ls = | |
63 case ls of | |
64 [] => PD.string "" | |
65 | [x] => f 0 x | |
66 | x :: rest => | |
67 let | |
68 val tokens = ListUtil.foldri (fn (n, x, tokens) => | |
69 sep :: PD.cut :: f (n + 1) x :: tokens) | |
70 [] rest | |
71 in | |
72 box (f 0 x :: tokens) | |
73 end | |
74 | |
62 fun fprint f d = (PD.description (f, d); | 75 fun fprint f d = (PD.description (f, d); |
63 PD.PPS.flushStream f) | 76 PD.PPS.flushStream f) |
64 val print = fprint out | 77 val print = fprint out |
65 val eprint = fprint err | 78 val eprint = fprint err |
66 | 79 |