# HG changeset patch # User Adam Chlipala # Date 1230822502 18000 # Node ID 66463006f893c9291315832446f89f4ca12fb265 # Parent e955d50c389d36bfa064085d901c7bb347121d5d Source containing an int diff -r e955d50c389d -r 66463006f893 jslib/urweb.js --- a/jslib/urweb.js Tue Dec 30 16:11:29 2008 -0500 +++ b/jslib/urweb.js Thu Jan 01 10:08:22 2009 -0500 @@ -40,3 +40,5 @@ document.body.appendChild(x); s.h = cons(function() { x.innerHTML = s.v }, s.h); } + +function ts(x) { return x.toString() } diff -r e955d50c389d -r 66463006f893 src/jscomp.sml --- a/src/jscomp.sml Tue Dec 30 16:11:29 2008 -0500 +++ b/src/jscomp.sml Thu Jan 01 10:08:22 2009 -0500 @@ -34,6 +34,7 @@ structure U = MonoUtil val funcs = [(("Basis", "alert"), "alert"), + (("Basis", "htmlifyInt"), "ts"), (("Basis", "htmlifyString"), "escape"), (("Basis", "new_client_source"), "sc"), (("Basis", "set_client_source"), "sv")] diff -r e955d50c389d -r 66463006f893 src/prim.sml --- a/src/prim.sml Tue Dec 30 16:11:29 2008 -0500 +++ b/src/prim.sml Thu Jan 01 10:08:22 2009 -0500 @@ -47,6 +47,12 @@ else Int64.toString n ^ "LL" +fun int2s' n = + if Int64.compare (n, Int64.fromInt 0) = LESS then + "-" ^ Int64.toString (Int64.~ n) + else + Int64.toString n + fun float2s n = if Real64.compare (n, Real64.fromInt 0) = LESS then "-" ^ Real64.toString (Real64.~ n) @@ -55,7 +61,7 @@ fun toString t = case t of - Int n => int2s n + Int n => int2s' n | Float n => float2s n | String s => s diff -r e955d50c389d -r 66463006f893 tests/stypes.ur --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/stypes.ur Thu Jan 01 10:08:22 2009 -0500 @@ -0,0 +1,5 @@ +fun main () : transaction page = + sInt <- source 0; + return + {[n]}}/> Change
+ diff -r e955d50c389d -r 66463006f893 tests/stypes.urp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/stypes.urp Thu Jan 01 10:08:22 2009 -0500 @@ -0,0 +1,3 @@ +debug + +stypes