[MLton-commit] r5221
Wesley Terpstra
wesley at mlton.org
Fri Feb 16 08:54:49 PST 2007
aggregates type-check
----------------------------------------------------------------------
U mltonlib/trunk/ca/terpstra/sqlite3/demo.sml
----------------------------------------------------------------------
Modified: mltonlib/trunk/ca/terpstra/sqlite3/demo.sml
===================================================================
--- mltonlib/trunk/ca/terpstra/sqlite3/demo.sml 2007-02-16 16:47:48 UTC (rev 5220)
+++ mltonlib/trunk/ca/terpstra/sqlite3/demo.sml 2007-02-16 16:54:49 UTC (rev 5221)
@@ -16,13 +16,13 @@
fun debug v = Vector.app (fn s => print (s ^ "\n")) v
fun glom (s & i) = if i = 0 then raise SQL.Error "bad integer" else s ^ Int.toString i
val sum2 = { init = fn () => 0,
- step = fn (i, (j & k)) => i+j+k,
- finish = fn x => x }
+ step = fn (i, (j & k)) => i + Int64.fromInt j + k,
+ finish = fn x => Int64.toString x }
val () = SQL.registerFunction (db, "wes", fnS iS iS $ concat)
val () = SQL.registerFunction (db, "debug", fnN iAS $ debug)
val () = SQL.registerFunction (db, "glom", fnS iS iI $ glom)
val () = SQL.registerCollation (db, "sless", String.compare)
- val () = SQL.registerAggregate (db, "sum2", aggrI iI iI $ sum2)
+ val () = SQL.registerAggregate (db, "sum2", aggrS iI iZ $ sum2)
end
local
More information about the MLton-commit
mailing list