-
Notifications
You must be signed in to change notification settings - Fork 10
/
test29.txt
24 lines (18 loc) · 869 Bytes
/
test29.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
*************** Source File ****************
let val [(x,y,z),a] = [("hello",1,true),("a",2,false)] in println a end
******************* AST ********************
letdec(
bindval(listpat([tuplepat([idpat('x') ,idpat('y') ,idpat('z')]) ,idpat('a')]),listcon([tuplecon([str('"hello"') ,int('1') ,bool('true')]) ,tuplecon([str('"a"') ,int('2') ,bool('false')])])),
[
apply(id('println'),id('a'))
])
.
************* Type Checking ****************
Typechecking is commencing...
Here is the AST
letdec(bindval(listpat([tuplepat([idpat(x),idpat(y),idpat(z)]),idpat(a)]),listcon([tuplecon([str("hello"),int(1),bool(true)]),tuplecon([str("a"),int(2),bool(false)])])),[apply(id(println),id(a))])
val [(x,y,z),a] : (str * int * bool) list
val it : unit
The program passed the typechecker.
********* Target Program Execution *********
('a', 2, False)