Mercurial > urweb
annotate tests/ms.ur @ 1893:9a1097954188
compileC: Link libraries in the right order
This is needed, at least on recent Ubuntu, to fix this linker error
when compiling any Ur/Web application:
ld: /tmp/webapp.o: undefined reference to symbol 'uw_write'
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
src/compiler.sml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Thu, 21 Nov 2013 14:32:11 -0500 |
parents | 17393c5e2b90 |
children |
rev | line source |
---|---|
adam@1447 | 1 table ms : {Client : client, Channel : channel xbody} |
adam@1447 | 2 |
adam@1447 | 3 val hitMe = |
adam@1447 | 4 me <- self; |
adam@1447 | 5 ch <- oneRowE1 (SELECT (ms.Channel) |
adam@1447 | 6 FROM ms |
adam@1447 | 7 WHERE ms.Client = {[me]}); |
adam@1447 | 8 |
adam@1447 | 9 s <- source 0; |
adam@1447 | 10 send ch <xml> |
adam@1447 | 11 <dyn signal={n <- signal s; return <xml>{[n]}</xml>}/> |
adam@1447 | 12 <button value="Inc" onclick={n <- get s; set s (n + 1)}/> |
adam@1447 | 13 </xml> |
adam@1447 | 14 |
adam@1447 | 15 fun main' () = |
adam@1447 | 16 me <- self; |
adam@1447 | 17 ch <- channel; |
adam@1447 | 18 dml (INSERT INTO ms (Client, Channel) VALUES ({[me]}, {[ch]})); |
adam@1447 | 19 |
adam@1447 | 20 s <- source <xml/>; |
adam@1447 | 21 |
adam@1447 | 22 return <xml><body onload={let |
adam@1447 | 23 fun loop () = |
adam@1447 | 24 x <- recv ch; |
adam@1447 | 25 set s x; |
adam@1447 | 26 loop () |
adam@1447 | 27 in |
adam@1447 | 28 loop () |
adam@1447 | 29 end}> |
adam@1447 | 30 <button value="Another" onclick={rpc hitMe}/> |
adam@1447 | 31 <dyn signal={signal s}/> |
adam@1447 | 32 </body></xml> |
adam@1447 | 33 |
adam@1447 | 34 fun main () = |
adam@1447 | 35 return <xml><body><form><submit action={main'}/></form></body></xml> |