From: Josh Cheek Date: 2011-01-29T04:06:03+09:00 Subject: Re: why is overloading invalid in ruby. --00163628369c42927e049aecbdf3 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Jan 28, 2011 at 11:41 AM, Adam Prescott wrote: > On Fri, Jan 28, 2011 at 5:13 PM, Charles Oliver Nutter > wrote: > > > And it would be even cooler if Ruby supported some form of type-driven > > pattern matching, so you could have different method bodies for > > different input types rather than checking them over and over again. > > But that's a post for another day :) > > > > Not very quackish. > Well, you could reinterpret "type driven" to be "respond_to driven". Almost the same sentiment, but more embracing of OO as described in Rick's talk ( http://confreaks.net/videos/461-rubyconf2010-objects-are-just-objects-aren-t-they ). Personally, I found it weird to not have overloading when I came from Java, because I had fallen into a series of patterns based around it that I really liked (one canonical method, with several overload ones for convenience, that just take their arguments and translate them to the appropriate method call of the real one). But now, I think Ruby's bag of argument tricks are much more powerful. Initialization blocks, optional params through hash support, optional arguments, etc I think are very powerful (might be nice if the language supported the hashes a bit better), and really, I almost never miss overloading, and I think the things you would lose by supporting it would not be worth it. --00163628369c42927e049aecbdf3--