From: Paul Brannan Date: 2002-03-12T03:54:41+09:00 Subject: Re: Interesting link on static/dynamic typing... On Sat, Mar 09, 2002 at 02:13:20PM +0900, Frank Mitchell wrote: > One of the more annoying things about Java is that, whenever you put an > object into a collection class you have to typecast it to get it out ... > and if due to some bug the wrong type of object got in, good luck > finding where. Another annoyance is having to wrap an int or float in > an object to add it to a collection. There is a similar problem in Ruby. If I have an array of Foo objects, and I pull out a Bar, good luck finding out how the Bar object got there. What's worse, if Bar implements a subset of Foo's interface, the bug may be very subtle. I've considered implementing a homogenous Array in Ruby, but there are a lot of ways an element can sneak into an array, so it's not exactly a trivial problem. Paul