From: Paul Brannan Date: 2002-12-18T04:45:55+09:00 Subject: Re: help -- persuade my boss to adopt ruby On Wed, Dec 18, 2002 at 03:30:12AM +0900, Florian Frank wrote: > In Ruby you would program someting like this: > > class Vector > > ... > > def print > each { |elm| $stdout << elm << " " } > $stdout << "\n" > end > > end > > You wouldn't have any problems with types. In a real C++ application, I would have written: template void print_vector(vector const & v) { std::vector::iterator it = v.begin(); for(; it != v.end(); ++it) { std::cout << *it << std::endl; } } but the purpose of the example wasn't to show good coding practice; it was to show that type errors are real and can actually happen. Whether getting the compiler to find these errors is outweighed by the cost of static typing is a separate issue. Paul