The two reasons for not supporting this feature
are portability and math'l purity. let is treated
as shorthand for a value (as in maths) which keeps
the type theory and formal reasoning simple.
Regards implementing the Scheme example in Shen,
probably the easiest is to use property lists.
(0-) (define make-withdraw
WithDraw Account -> (let Balance (get Account balance)
NewBalance (- Balance WithDraw)
(if (> NewBalance 0)
(put Account balance NewBalance)
(error "Insufficient funds"))))
(fn make-withdraw)
(1-) (put w1 balance 100)
100
(2-) (put w2 balance 100)
100
(3-) (make-withdraw 50 w1)
50
(4-) (make-withdraw 60 w2)
40
(5-) (make-withdraw 45 w1)
5
(6-) (make-withdraw 45 w2)
Insufficient funds
M.