From: Brian Candler Date: 2009-03-04T17:59:06+09:00 Subject: Re: fixnum problem plz help Pascal J. Bourguignon wrote: > In more strongly typed programming languages such as Common Lisp, > you'd get an error: > > C/USER[929]> (* "2" 365) > > *** - *: "2" is not a number This is nothing to do with "strongly typed". Ruby's concept of the difference between a string and an integer is just as strict as LISP's. Rather, Ruby provides semantics to the '*' operator/function for strings which LISP doesn't. You can get exactly the behaviour you desire by _removing_ some Ruby functionality. irb(main):001:0> String.class_eval { undef_method(:*) } => String irb(main):002:0> "2" * 365 NoMethodError: undefined method `*' for "2":String from (irb):2 from :0 -- Posted via http://www.ruby-forum.com/.