开发者

Programming Languages: Difference between ad-hoc binding and deep binding?

What is the diff开发者_JAVA技巧erence between "ad-hoc" binding and "deep" binding?


Deep binding captures the environment at the point where a lambda is constructed. As far as I know, C# and Scheme both behave this way.

Shallow binding just looks for the most recent binding of a variable on the environment chain.

Ad-hoc binding is kind of hacky: a lambda grabs the environment at the point of a call when it gets passed as an argument. It gets around the problem of lambdas inadvertently binding to local variables in the function they get passed into without the complexity of implementing deep binding, but the illusion breaks down if they get passed on further because it's still just a slight modification of shallow binding.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜