add let-in as experimental sintax sugar over case

This commit is contained in:
danyaberezun 2024-03-01 13:49:06 +02:00 committed by Roman Venediktov
parent 120eccba66
commit 7c3687b65b
3 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,11 @@
1
2
5
6
7
8
5
6
7
8
3

0
regression/test112.input Normal file
View file

16
regression/test112.lama Normal file
View 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)