mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
add let-in as experimental sintax sugar over case
This commit is contained in:
parent
120eccba66
commit
7c3687b65b
3 changed files with 27 additions and 0 deletions
11
regression/orig/test112.log
Normal file
11
regression/orig/test112.log
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
1
|
||||
2
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
3
|
||||
0
regression/test112.input
Normal file
0
regression/test112.input
Normal file
16
regression/test112.lama
Normal file
16
regression/test112.lama
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
-- let A (x,y) be A(5,6) in write(x); write(y) ni;
|
||||
-- case A(5,6) of A(x,y) -> write(x); write(y) esac;
|
||||
-- let A (x,y) be A(5,6) in ....
|
||||
-- let A (x,y) be A(5,6) <----- void then ;
|
||||
|
||||
fun f (x) {
|
||||
write(x)
|
||||
}
|
||||
|
||||
f(let x = A(1,2) in x[0]);
|
||||
f(let x = A(1,2) in x[1]);
|
||||
|
||||
let A (x,y) = A(5,6) in let B(z,e) = B(7,8) in write(x); write(y); write(z); write(e);
|
||||
let A (x,y) = A(5,6) in (let B(z,e) = B(7,8) in write(x); write(y); write(z); write(e));
|
||||
|
||||
let x = (let x = C(1,2) in x[1]) + (let x = C(1,2) in x[0]) in write(x)
|
||||
Loading…
Add table
Add a link
Reference in a new issue