From: Stefano Crocco Date: 2007-10-04T20:38:23+09:00 Subject: Re: (Newbie) Override * on Array Alle giovedì 4 ottobre 2007, Stefano Crocco ha scritto: > Regarding errors, you I think you can check the size of the two array at > the beginning of the method and raise TypeError if they're different. Sorry, it should be ArgumentError, not TypeError. Looking at ruby standard library, TypeError is used when an object of the wrong type is passed (for example, passing an Array to Kernel.Integer), while ArgumentError is used when the argument is of the correct type, but doesn't meet some other requirements (for example, passing a string which doesn't represent a number to Kernel.Integer). In this case, the argument is of the correct type (Array), but the requirement "having the same size of the receiver" is not met, so I think you should use ArgumentError. Stefano