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.
“如果它长得像鸭子,而且像鸭子般呱呱叫,那我们至少得考虑这种可能性:我们手中得有只鸭科的小水鸟”,洛兹引述道格拉斯·亚当斯的话说。
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.
它直接应用了一个很流行的理念:走起路来象鸭子和叫起来象鸭子的,那就一定是只鸭子。
Certainly, the timing fits to a tee, and as stated here regularly in the past: if it walks like a duck and quacks like a duck then it surely is not a peacock.
确实,时机正合适,正如我们一直在这唠叨的:如果某只秒走起来向鸭子,叫起来嘎嘎的,那么它肯定不是只孔雀。
If it walks like a duck and quacks like a duck, then they gotta be Chucks!
如果鸭子,叫起来像鸭子一样走路,那么他们得夹头!
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...
如果一只鸟外表像鸭子,游起泳来像鸭子并且叫起来像鸭子,那么它可能就是鸭子。
If a bird looks like a duck, swims like a duck and quacks like a duck, then it's probably a duck...
如果一只鸟外表像鸭子,游起泳来像鸭子并且叫起来像鸭子,那么它可能就是鸭子。
应用推荐