Mercurial > urweb
view tests/dlist.ur @ 1906:0d2fdc2cc46c
Allow building in a separate build directory
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
Makefile.am | 30 +++---
src/c/Makefile.am | 2 +-
src/compiler.mlb | 2 +-
src/sources | 302 +++++++++++++++++++++++++++---------------------------
4 files changed, 168 insertions(+), 168 deletions(-)
author | Anders Kaseorg <andersk@mit.edu> |
---|---|
date | Fri, 22 Nov 2013 09:36:14 -0500 |
parents | 20c083327364 |
children |
line wrap: on
line source
datatype dlist = Nil | Cons of string * source dlist fun delist dl = case dl of Nil => <xml>[]</xml> | Cons (x, s) => <xml>{[x]} :: ({delistSource s})</xml> and delistSource s = <xml><dyn signal={dl <- signal s; return (delist dl)}/></xml> fun main () : transaction page = ns <- source Nil; s <- source ns; tb <- source ""; return <xml><body> <dyn signal={s <- signal s; return (delistSource s)}/><br/> <br/> <ctextbox source={tb}/> <button value="Add" onclick={hd <- get tb; tl <- get s; s' <- source (Cons (hd, tl)); set s s'}/> <button value="Reset" onclick={set s ns}/> </body></xml>