From: stesch@... (Stefan Scholl) Date: 2001-08-05T21:35:15+09:00 Subject: [ruby-talk:19160] Re: My 1st look @ ruby: No prototypes and problem with String#gsub On 2001-08-05 05:52:04Z, Dave Thomas wrote: > For example, your shuffle example doesn't really need an Array > parameter. All it requires is an object that responds to #length, and > returns a value when sent #[]. If we remove the test from from your Ah, thanks! And I don't have to check the existence of #length and #[] because the interpreter will do it for me. Or is it common pratice to check these with defined?(data.[]) and defined?(data.length)? This way it's easier to find a bug when calling Shuffle#new with the wrong object.