mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 19:28:47 +00:00
Constructors capitalized
This commit is contained in:
parent
3bf36ae719
commit
4879a02753
18 changed files with 147 additions and 145 deletions
|
|
@ -1,6 +1,6 @@
|
|||
fun collect_ints_acc (v, tail) local i {
|
||||
case v of
|
||||
a@#unboxed -> return `cons (a, tail)
|
||||
a@#unboxed -> return Cons (a, tail)
|
||||
| #string -> return tail
|
||||
| _ ->
|
||||
for i := 0, i < v.length, i := i + 1 do
|
||||
|
|
@ -11,13 +11,13 @@ fun collect_ints_acc (v, tail) local i {
|
|||
}
|
||||
|
||||
fun collect_ints (v) {
|
||||
return collect_ints_acc (v, `nil)
|
||||
return collect_ints_acc (v, Nil)
|
||||
}
|
||||
|
||||
fun print_list (l) {
|
||||
case l of
|
||||
`nil -> skip
|
||||
| `cons (n, t) -> write (n); print_list (t)
|
||||
Nil -> skip
|
||||
| Cons (n, t) -> write (n); print_list (t)
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
@ -41,11 +41,11 @@ case 1 of
|
|||
| a@0 -> write (a)
|
||||
esac;
|
||||
|
||||
case `a (1, 2, 3) of
|
||||
`a (1, 3, 5) -> write (0)
|
||||
| `a (3, 4, 5) -> write (0)
|
||||
| `a (1, 2, 3) -> write (1)
|
||||
| `a (6, 7, 8) -> write (0)
|
||||
case A (1, 2, 3) of
|
||||
A (1, 3, 5) -> write (0)
|
||||
| A (3, 4, 5) -> write (0)
|
||||
| A (1, 2, 3) -> write (1)
|
||||
| A (6, 7, 8) -> write (0)
|
||||
esac;
|
||||
|
||||
case "abc" of
|
||||
|
|
@ -69,4 +69,4 @@ case [1, 2, 3] of
|
|||
| [a, b, c] -> write (a); write (b); write (c)
|
||||
esac;
|
||||
|
||||
print_list (collect_ints ([1, 2, 3, [4, 5, 6, `cons (1, 2, 3)]]))
|
||||
print_list (collect_ints ([1, 2, 3, [4, 5, 6, Cons (1, 2, 3)]]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue