From: dblack@... Date: 2006-11-23T21:28:05+09:00 Subject: Re: how do I contribute to Ruby? Hi -- On Thu, 23 Nov 2006, El Gato wrote: > Giles Bowkett wrote: >> check this out, this is the whiniest change ever, but what I want is >> this to work: >> >> irb(main):001:0> "".is_a? String >> => true >> irb(main):002:0> [].is_an? Array >> NoMethodError: undefined method `is_an?' for []:Array >> from (irb):2 >> >> >> I just HATE writing "is_a? Array" because it's grammatically incorrect. >> >> I realize this is incredibly silly and anal, but the thing is, all you >> have to do is one simple alias command and you're good to go. >> >> so -- how do I contribute to Ruby itself? > > Well, unlike a lot of languages, in Ruby you can modify all sorts of > built-ins. I don't personally believe that a case such as this > warrants it though, and often in Ruby it's better to use respond_to? > (duck typing) depending on the situation of course. Or just duck typing, without respond_to?; i.e., just send messages to objects based on the semantics of the message. David -- David A. Black | dblack@wobblini.net Author of "Ruby for Rails" [1] | Ruby/Rails training & consultancy [3] DABlog (DAB's Weblog) [2] | Co-director, Ruby Central, Inc. [4] [1] http://www.manning.com/black | [3] http://www.rubypowerandlight.com [2] http://dablog.rubypal.com | [4] http://www.rubycentral.org