If it walks like a duck and quacks like a duck, it must be a duck.
如果它像鸭子一样走路,像鸭子一样呱呱叫,那它一定是一只鸭子。
The second meaning is that if something walks like a duck and quacks like a duck, it's probably a duck.
第二层意思是说,如果什么东西走起来像鸭子,叫起来也像鸭子,那么它很可能就是一只鸭子。
Affectionately known as "duck typing" (i.e., if it waddles like a duck and quacks like one, then it must be a duck!), polymorphism in Ruby is just a matter of matching method names.
Ruby中的多态性被亲切地称为“ducktyping”(意思是,如果它走起路来像鸭子,叫起来也像鸭子,那么它一定是鸭子!),这种多态性只是对方法名进行匹配的问题。
"If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family Anatidae on our hands," said Rose, quoting Douglas Adams.
“如果它长得像鸭子,而且像鸭子般呱呱叫,那我们至少得考虑这种可能性:我们手中得有只鸭科的小水鸟”,洛兹引述道格拉斯·亚当斯的话说。
Away, then, with quacks and organizers!
那么,让那些江湖郎中和组织者走开!
鸭子嘎嘎叫。
Of course, there were many quacks, but that was to be expected.
当然有不少庸医,但那是可以预见的。
When you go to the fair, beware of the quacks selling spurious medicinal herbs.
你赶集的时候,当心卖假草药的江湖医生。
If it looks like a duck, walks like a duck, and quacks like a duck, it must be a duck!
如果它看起来像一只鸭子,走路像一只鸭子,嘎嘎叫像一只鸭子,它一定要是一只鸭子!
If a bird looks like a duck, swims like a duck and quacks like a duck, then it's probably a duck...
如果一只鸟外表像鸭子,游起泳来像鸭子并且叫起来像鸭子,那么它可能就是鸭子。
It is a direct application of a popular idea: If it walks like a duck and quacks like a duck, it must be a duck.
它直接应用了一个很流行的理念:走起路来象鸭子和叫起来象鸭子的,那就一定是只鸭子。
In Hippocrates' day, many quacks convinced sick people to undergo dangerous, unnecessary, and expensive procedures.
在希波克拉底的时代,许多庸医都会建议病人们接受危险、毫无必要、而又昂贵的治疗过程。
They did so in order to distinguish themselves from charlatans and quacks who purvey anti-aging products and treatments that are ineffective and sometimes harmful.
他们这样做是为了把自己与那些提供抗衰老产品和疗程的吹牛大王和庸医区分开来,那些产品都是无效的,甚至是有害的。
They did so in order to distinguish themselves from charlatans and quacks who purvey anti - aging products and treatments that are ineffective and sometimes harmful.
他们这样做是为了把自己与那些提供抗衰老产品和疗程的吹牛大王和庸医区分开来,那些产品都是无效的,甚至是有害的。
They did so in order to distinguish themselves from charlatans and quacks who purvey anti - aging products and treatments that are ineffective and sometimes harmful.
他们这样做是为了把自己与那些提供抗衰老产品和疗程的吹牛大王和庸医区分开来,那些产品都是无效的,甚至是有害的。
应用推荐