Why doesn't Scheme support first class environments?

后端 未结 4 1706
慢半拍i
慢半拍i 2021-01-31 20:04

I\'ve been reading through SICP (Structure and Interpration of Computer Programs) and was really excited to discover this wonderful special form: \"make-environment\", which the

4条回答
  •  粉色の甜心
    2021-01-31 20:22

    Scheme has no first-class environments because of performance reasons. When Scheme was created, it wasn't the fastest language around due to nifty stuff like first-class functions, continuations, etc. Adding first-class environments would have crippled the performance even further. So it was a trade-off made in the early Scheme days.

提交回复
热议问题