← urwebplay

testing

406d2f840183a4b4532c20f65a792cd9a04ed85f · ovidiucs · Jan 5, 2016 06:44

+31 −6 · 5 files changed

  • demo/counter.ur +12 −2
  • demo/hello.ur +8 −2
  • demo/hello.urs +1 −0
  • demo/link.ur +5 −2
  • demo/rec.ur +5 −0
diff --git a/demo/counter.ur b/demo/counter.ur
index 23768ad..897e0e0 100644
--- a/demo/counter.ur
+++ b/demo/counter.ur
@@ -4,5 +4,15 @@ fun counter n = return <xml><body>
   <a link={counter (n + 1)}>Increment</a><br/>
   <a link={counter (n - 1)}>Decrement</a>
 </body></xml>
-
-fun main () = counter 0
+(*
+fun square x = return <xml><body>
+  Current value: {[x]}<br/>
+  <a link={square (x * x)}>Square</a><br/>
+</body></xml>
+ *)
+fun acounter z = return <xml><body>
+  Current acounter: {[z]}<br/>
+  <a link={acounter (z + 1)}>Increment</a><br/>
+  <a link={acounter (z - 1)}>Decrement</a>
+</body></xml>
+fun main () =  counter (0) acounter (200)
diff --git a/demo/hello.ur b/demo/hello.ur
index 9313460..fc8edac 100644
--- a/demo/hello.ur
+++ b/demo/hello.ur
@@ -1,9 +1,15 @@
+
+fun tomain () = return <xml><body>
+     Another function
+    </body></xml>
 fun main () = return <xml>
   <head>
     <title>Hello world!</title>
   </head>
-
   <body>
-    <h1>Hello world!</h1>
+    <h1>This is a test page!</h1>
+    <h2>This is a header 2 font</h2>
+    <h3>This is a header 3 font</h3>
+    <a link={tomain ()}>Click</a>
   </body>
 </xml>
diff --git a/demo/hello.urs b/demo/hello.urs
index 6ac44e0..f078851 100644
--- a/demo/hello.urs
+++ b/demo/hello.urs
@@ -1 +1,2 @@
 val main : unit -> transaction page
+val tomain : unit -> transaction page 
diff --git a/demo/link.ur b/demo/link.ur
index f9e3396..e8db93c 100644
--- a/demo/link.ur
+++ b/demo/link.ur
@@ -1,7 +1,10 @@
 fun target () = return <xml><body>
   Welcome!
 </body></xml>
-
+fun target2 () = return <xml><body>
+ Another target
+ </body></xml>
 fun main () = return <xml><body>
-  <a link={target ()}>Go there</a>
+    <p><a link={target ()}>Go there</a></p>
+    <a link={target2 ()}>Go here</a>
 </body></xml>
diff --git a/demo/rec.ur b/demo/rec.ur
index a808446..a32cd1b 100644
--- a/demo/rec.ur
+++ b/demo/rec.ur
@@ -1,7 +1,12 @@
 fun main () = return <xml><body>
   <a link={other ()}>Go to the other one!</a>
+  <a link={others ()}>Go to the others page!</a>
 </body></xml>
 
 and other () = return <xml><body>
   <a link={main ()}>Return to <tt>main</tt>!</a>
 </body></xml>
+
+and others () = return <xml><body>
+  <a link={other ()}>Return to <tt>other</tt></a>
+  </body></xml>