From: Jim Menard Date: 2008-05-29T03:12:52+09:00 Subject: Re: The duck's backside Tobias, > as a newcomer I miss method overloading with named parameters and types > (Objective-C!). Mainly because my code is riddled with ugly "case > argument.class" and "raise unless Integer". But maybe that's the problem. > > What is the Duck way to check arguments? I have to because I'm passing > on to a rather fragile web service. Don't bother. Use your arguments, assuming they are the correct type. If they are not, then a runtime exception will be thrown. Unless the input to this function is coming from an untrusted source, the inputs will always be the correct type. If they are not, then something is seriously wrong. Jim > > I only need numbers (ids) and strings in my instance variables, but > considered making a class for each one to catch illegal data in > initialize. > > -- > Tobias Weber > > -- Jim Menard, jimm@io.com, jim.menard@gmail.com http://www.io.com/~jimm/