On 2002-12-18 01:49:44 +0900, Paul Brannan wrote:
>   template<typename T>
>   void print_vector(vector<T> const & v)
>   {
>     for(int j = 0; j < v.length(); ++j)
>     {
>       std::cout << v[j] << std::endl;
>     }
>   }
> 
> Here I'm comparing an int (j) to a size_t (v.length()).  The compiler
> will warn be about comparing a signed to an unsigned (since if the
> vector is large enough, this could be a serious mistake).  I won't have
> this problem in Ruby -- but only because Ruby has no notion of an
> unsigned integer, not because Ruby is dynamically typed.

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.

-- 
You had to live --did live, from habit that became instinct-- in the 
assumption that every sound you made was overheard, and, except in 
darkness, every movement scrutinized.
  -- George Orwell, "1984", 1948