From: Hugh Sasse Date: 2006-11-25T05:07:38+09:00 Subject: Re: how do I contribute to Ruby? On Sat, 25 Nov 2006, Giles Bowkett wrote: > > class Array > > def is_an?(klass) > > return is_a?(klass) > > end > > end > > > > [].is_an? Array #=> true > > Just as an aside, to implement this, I would much rather monkeypatch > Object than Array. Otherwise it just happens again the next time I > have a class which begins with a vowel. You also have the problem that classes which don't start with vowels will inherit this. is_an? Person ??? And what about those who use an before some /h\w+/i words? is_an? HistoricEvent, but not is_an? House. It's probably best to get used to this. At least other people's code won't grate on you, once you have. Let's face it, this English language we got from the Romans, Saxons, ..., Indians and more is very irregular. I'm glad Ruby isn't that irregular. > > -- > Giles Bowkett > http://www.gilesgoatboy.org > Hugh