From: Yusuke ENDOH Date: 2010-02-02T12:44:45+09:00 Subject: [ruby-core:28003] Re: [Bug #2495](Open) Matrix: Vector#each2 should check its argument Hi, 2010/2/2 Marc-Andre Lafortune : > Finally, I feel it would be superior to raise a TypeError instead of a NoMethodError in a case where duck typing fails, in a similar fashion to "$stdout = nil" which raises TypeError: $stdout must have write method, NilClass given I really understand your intuition and even wrote the patch once, but to achieve it, I guess that very many type checks will be needed, not only in Vector#each2 but also in other libraries. It may not be realistic. I think that `the fate of duck typing' includes such a error. Now that I think about it, a type means "what methods its instance responds to." Thus, it may be strange to distinguish TypeError and NoMethodError. That's just my personal opinion, though. Matz or Keiju, will you give us your opinion? -- Yusuke ENDOH