3. 復習 ~ 型「→」(1)
Syntax
t ::= terms:
t variable
λx:T.t abstraction
t t application
v ::= values:
λx:T.t abstraction value
T ::= types:
T→T type of functions
Γ ::= contexts:
? empty context
Γ, x:T term variable binding
A. Miyashita (@yaggy gcv) TaPL 読書会 #9 §14 Exception 2012.11.21 3 / 17
11. 例外処理 ~ try の導入
New syntactic forms
t ::= ... terms:
try t with t trap errors
New evaluation rules t → t′
try v1 with t2 → v1 (E-TryV)
try error with t2 → t2 (E-TryError)
t1 → t′
1
(E-Try)
try t1 with t2 → try t′ with t2
1
New typing rules Γ?t:T
Γ ? t1 : T Γ ? t2 : T
(T-Try)
Γ ? try t1 with t2 : T
A. Miyashita (@yaggy gcv) TaPL 読書会 #9 §14 Exception 2012.11.21 11 / 17