绑定(binding),即把对象的接口与对象实例结合在一起的方法 晚绑定(late binding),指的是编译器或解释器程序在运行前,不知道对象的类型。使用晚绑定,无需检查对象的类型,只需要检查对象是否支持特性和方法即可。ECMAScript所有变量都采用晚绑定方法,这样就允许执行大量的对象操作,而无任何惩罚。
不像大多数语言——要么总使用晚绑定,要么从来不用,Boo允许开发者声明特定的变量来进行晚绑定。
Unlike most languages that either always or never use late binding, Boo allows developers to declare specific variables as late bound.
其最能引起大家兴趣的地方在于它处理“晚绑定(late binding)”的方式,现在我们通常称其为“duck typing”。
Of particular interest is the way it handles late binding, more commonly known today as "duck typing".
应用推荐