Mercurial > urweb
comparison src/compiler.sml @ 280:fdd7a698be01
Compiling a parametrized query the inefficient way
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Sep 2008 17:31:45 -0400 |
parents | e4baf03a3a64 |
children | 0236d9412ad2 |
comparison
equal
deleted
inserted
replaced
279:8bb46d87b074 | 280:fdd7a698be01 |
---|---|
91 NONE => (NONE, pmap) | 91 NONE => (NONE, pmap) |
92 | SOME v => #time tr2 (v, pmap) | 92 | SOME v => #time tr2 (v, pmap) |
93 end | 93 end |
94 } | 94 } |
95 | 95 |
96 fun run (tr : ('src, 'dst) transform) = #func tr | 96 fun run (tr : ('src, 'dst) transform) x = (ErrorMsg.resetErrors (); |
97 #func tr x) | |
97 | 98 |
98 fun runPrint (tr : ('src, 'dst) transform) input = | 99 fun runPrint (tr : ('src, 'dst) transform) input = |
99 case #func tr input of | 100 (ErrorMsg.resetErrors (); |
100 NONE => print "Failure\n" | 101 case #func tr input of |
101 | SOME v => | 102 NONE => print "Failure\n" |
102 (print "Success\n"; | 103 | SOME v => |
103 Print.print (#print tr v); | 104 (print "Success\n"; |
104 print "\n") | 105 Print.print (#print tr v); |
106 print "\n")) | |
105 | 107 |
106 fun time (tr : ('src, 'dst) transform) input = | 108 fun time (tr : ('src, 'dst) transform) input = |
107 let | 109 let |
108 val (_, pmap) = #time tr (input, []) | 110 val (_, pmap) = #time tr (input, []) |
109 in | 111 in |