mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-24 07:38:46 +00:00
Constructors capitalized
This commit is contained in:
parent
3bf36ae719
commit
4879a02753
18 changed files with 147 additions and 145 deletions
|
|
@ -1,17 +1,17 @@
|
|||
fun f (x) {
|
||||
case x of
|
||||
`nil -> write (0)
|
||||
| `cons (_, `nil) -> write (1)
|
||||
| `cons (_, `cons (_, `nil)) -> write (2)
|
||||
| `cons (_, `cons (_, `cons (_, `nil))) -> write (3)
|
||||
| _ -> write (4)
|
||||
Nil -> write (0)
|
||||
| Cons (_, Nil) -> write (1)
|
||||
| Cons (_, Cons (_, Nil)) -> write (2)
|
||||
| Cons (_, Cons (_, Cons (_, Nil))) -> write (3)
|
||||
| _ -> write (4)
|
||||
esac
|
||||
}
|
||||
|
||||
x := read ();
|
||||
y := `nil;
|
||||
y := Nil;
|
||||
|
||||
for i := 0, i < 10, i := i + 1 do
|
||||
f (y);
|
||||
y := `cons (i, y)
|
||||
y := Cons (i, y)
|
||||
od
|
||||
Loading…
Add table
Add a link
Reference in a new issue