Constructors capitalized

This commit is contained in:
Dmitry Boulytchev 2019-03-07 19:06:04 +03:00
parent 3bf36ae719
commit 4879a02753
18 changed files with 147 additions and 145 deletions

View file

@ -1,21 +1,21 @@
fun append (x, y) {
case x of
`nil -> return y
| `cons (h, t) -> return `cons (h, append (t, y))
Nil -> return y
| Cons (h, t) -> return Cons (h, append (t, y))
esac
}
fun printList (x) {
case x of
`nil -> skip
| `cons (h, t) -> write (h); printList (t)
Nil -> skip
| Cons (h, t) -> write (h); printList (t)
esac
}
n := read ();
x := `cons (1, `cons (2, `nil));
y := `cons (3, `cons (4, `nil));
x := Cons (1, Cons (2, Nil));
y := Cons (3, Cons (4, Nil));
printList (x);
printList (y);