Mercurial > urweb
comparison src/prim.sml @ 582:66463006f893
Source containing an int
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 01 Jan 2009 10:08:22 -0500 |
parents | 1901db85acb4 |
children | 395a5d450cc0 |
comparison
equal
deleted
inserted
replaced
581:e955d50c389d | 582:66463006f893 |
---|---|
45 if Int64.compare (n, Int64.fromInt 0) = LESS then | 45 if Int64.compare (n, Int64.fromInt 0) = LESS then |
46 "-" ^ Int64.toString (Int64.~ n) ^ "LL" | 46 "-" ^ Int64.toString (Int64.~ n) ^ "LL" |
47 else | 47 else |
48 Int64.toString n ^ "LL" | 48 Int64.toString n ^ "LL" |
49 | 49 |
50 fun int2s' n = | |
51 if Int64.compare (n, Int64.fromInt 0) = LESS then | |
52 "-" ^ Int64.toString (Int64.~ n) | |
53 else | |
54 Int64.toString n | |
55 | |
50 fun float2s n = | 56 fun float2s n = |
51 if Real64.compare (n, Real64.fromInt 0) = LESS then | 57 if Real64.compare (n, Real64.fromInt 0) = LESS then |
52 "-" ^ Real64.toString (Real64.~ n) | 58 "-" ^ Real64.toString (Real64.~ n) |
53 else | 59 else |
54 Real64.toString n | 60 Real64.toString n |
55 | 61 |
56 fun toString t = | 62 fun toString t = |
57 case t of | 63 case t of |
58 Int n => int2s n | 64 Int n => int2s' n |
59 | Float n => float2s n | 65 | Float n => float2s n |
60 | String s => s | 66 | String s => s |
61 | 67 |
62 fun p_t_GCC t = | 68 fun p_t_GCC t = |
63 case t of | 69 case t of |