From: MikkelFJ Date: 2001-08-05T20:15:11+09:00 Subject: [ruby-talk:19159] Re: My 1st look @ ruby: No prototypes and problem with String#gsub "Dave Thomas" wrote in message news:S95b7.42087$WD1.2180821@e420r-atl2.usenetserver.com... > stesch@no-spoon.de (Stefan Scholl) writes: > In Ruby, it is generally wrong to check the type of an argument by > asking about it's class. In statically typed languages, a class I agree about not making any explicit typechecking. But I believe there is some middleground: Some time back I asked a question about interfaces in Ruby. The conclusion was, that you could check the module using is_a. You could even create empty modules to define an interface. For some purposes I think this is the right approach. You could for example include a module BasicContainer in the triple class, which could be tested. A test for is_a(Array) or is_a(BasicContainer) would then be appropriate if you want to do some type checking. Mikkel