diff tests/fromString.ur @ 288:4260ad920c36

Converting string to int
author Adam Chlipala <adamc@hcoop.net>
date Sun, 07 Sep 2008 11:33:13 -0400
parents
children 0cc956a3216f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/fromString.ur	Sun Sep 07 11:33:13 2008 -0400
@@ -0,0 +1,10 @@
+fun i2s s =
+        case stringToInt s of
+          None => 0
+        | Some n => n
+
+fun main () : transaction page = return <html><body>
+        Error = {cdata (show _ (i2s "Error"))}<br/>
+        3 = {cdata (show _ (i2s "+3"))}<br/>
+</body></html>
+