mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-13 10:18:47 +00:00
Postfix calls
This commit is contained in:
parent
e16fb72a9e
commit
fe4e322d58
9 changed files with 87 additions and 15 deletions
3
regression/orig/test052.log
Normal file
3
regression/orig/test052.log
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
> 1
|
||||
2
|
||||
3
|
||||
24
regression/test052.expr
Normal file
24
regression/test052.expr
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
fun hd (l) {
|
||||
case l of
|
||||
h : _ -> return h
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
fun tl (l) {
|
||||
case l of
|
||||
_ : tl -> return tl
|
||||
esac
|
||||
}
|
||||
|
||||
fun print_list (l) {
|
||||
case l of
|
||||
{} -> skip
|
||||
| h : t -> write (h); print_list (t)
|
||||
esac
|
||||
}
|
||||
|
||||
n := read ();
|
||||
write ({1, 2, 3}.hd);
|
||||
print_list ({1, 2, 3}.tl)
|
||||
|
||||
1
regression/test052.input
Normal file
1
regression/test052.input
Normal file
|
|
@ -0,0 +1 @@
|
|||
0
|
||||
3
regression/x86only/orig/test004.log
Normal file
3
regression/x86only/orig/test004.log
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
1
|
||||
{2, 3, 4}
|
||||
2
|
||||
15
regression/x86only/test004.expr
Normal file
15
regression/x86only/test004.expr
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
fun hd (l) {
|
||||
case l of
|
||||
h : _ -> return h
|
||||
esac
|
||||
}
|
||||
|
||||
fun tl (l) {
|
||||
case l of
|
||||
_ : t -> return t
|
||||
esac
|
||||
}
|
||||
|
||||
printf ("%s\n", {1, 2, 3}.hd.string);
|
||||
printf ("%s\n", {1, 2, 3, 4}.tl.string);
|
||||
printf ("%s\n", {1, {2, 3, 4}, 5, 6}.tl.hd.hd.string)
|
||||
1
regression/x86only/test004.input
Normal file
1
regression/x86only/test004.input
Normal file
|
|
@ -0,0 +1 @@
|
|||
0
|
||||
Loading…
Add table
Add a link
Reference in a new issue