From: "stephan.zimmer" Date: 2008-11-28T20:25:17+09:00 Subject: Re: Ruby's duck typing Robert, Sean, Brian, many thanks for your answers and the very interesting discussion. > Look at this approach > http://pastie.org/325446 > hopefully you find it helpful. Ya, that's really nice, also to me delegation seems more reasonable than inheritance in many cases. I will utilize it. The "factory approach" is also nice, I never thought about it. I think it gives handy code. > As Paul Graham stated, "In the message-passing model, methods are *of* > objects, while in the generic function model, they are specialized > *for* objects. It might be naive, but wouldn't it be possible to simulate a generic function by simply accessing the types of the parameters (using "is_a?") and then provide different function bodies for different parameters? Is there any document, paper, etc. which states more details about the Ruby type system, as design motives, comparisons to other languages, etc.? Best, Stephan