From: Mathieu Bouchard Date: 2001-01-15T06:34:14+09:00 Subject: [ruby-talk:9303] Re: Fast, loose, and out of control > Ruby is *not* loosely typed. It is dynamically typed. It's type > checking is better than C++'s, which has holes in it, making it > _weakly_ typed. This is all relative. Here is a procedure that requires a String as a parameter; it does not work on big-endian machines; it depends on the implementation of String; it depends on the memory layout of String. def iconoclast (datum) foo = [2*datum.id + 12].pack("l").unpack("P4")[0] bar = (foo[0]+0x100*foo[1])+0x10000*(foo[2]+0x100*foo[3]) baz = [bar].pack("l").unpack("P4")[0] end p iconoclast "foobar" #=> "foob" p iconoclast [1,2,3] #=> ram.rb:8: [BUG] Segmentation fault (note: Any extension library could have provided the direct memory peek feature, but Matz decided to put it in the base classes, making it part of the language. Therefore Ruby has "holes" in it, with which you can bypass types and portability.) matju