summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-09-22 13:41:23 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-09-22 13:41:23 -0400
commit79db9a612f96be267d5fe38cf27afeb0d29ad2ec (patch)
tree0a42ab31375f4c36279b7488d5fedfdf549e4980 /tests
parent5e115a18d92c865318ad736ad6f243145240e9c5 (diff)
More interpreter debugging
Diffstat (limited to 'tests')
-rw-r--r--tests/jscomp.ur21
1 files changed, 18 insertions, 3 deletions
diff --git a/tests/jscomp.ur b/tests/jscomp.ur
index 7722166f..c283ae4d 100644
--- a/tests/jscomp.ur
+++ b/tests/jscomp.ur
@@ -1,15 +1,30 @@
+fun fst [a] [b] (x : a) (y : b) = x
+fun snd [a] [b] (x : a) (y : b) = y
+
fun main () =
s <- source "";
- f <- source (plus 1);
+ s' <- source "";
+ f <- source (plus 1);
+ f2 <- source fst;
+ r <- source {A = "x", B = "y"};
return <xml><body>
- <ctextbox source={s}/><br/><br/>
+ <ctextbox source={s}/> <ctextbox source={s'}/><br/><br/>
Function: <button value="+1" onclick={set f (plus 1)}/>
<button value="*3" onclick={set f (times 3)}/><br/><br/>
+ Function2: <button value="Fst" onclick={set f2 fst}/>
+ <button value="Snd" onclick={set f2 snd}/><br/><br/>
+
<button value="Echo" onclick={s <- get s; alert s}/>
+ <button value="-" onclick={s <- get s; alert (show (-(readError s : int)))}/>
<button value="+1" onclick={s <- get s; alert (show (readError s + 1))}/>
<button value="*3" onclick={s <- get s; alert (show ((readError s) * 3))}/>
- <button value="f" onclick={s <- get s; f <- get f; alert (show (f (readError s)))}/>
+ <button value="f" onclick={s <- get s; f <- get f; alert (show (f (readError s)))}/><br/><br/>
+
+ <button value="f2" onclick={s <- get s; s' <- get s'; f2 <- get f2; alert (f2 s s')}/><br/><br/>
+
+ <button value="A" onclick={r <- get r; alert r.A}/>
+ <button value="B" onclick={r <- get r; alert r.B}/>
</body></xml>