chad fowler <chadfowler / yahoo.com> wrote: >> > >> >But, Josh, there isn't much "type" to overload >> based >> >on in Ruby. I know where you're coming from, >> though. >> >> Of course there are types in Ruby. Variables don't >> have a fixed type, and both types and methods can >> be created dynamically, but there are types, and >> every Ruby object has one. >That's why I said there wasn't "much" type. Variables >don't have a fixed type--including those that appear >as part of method signatures. But the context of the discussion was about adding support for overloading to Ruby. If it was overloading based on types, then the above would no longer be true in those instances. >Of course, you could add some kind of typing for >method signatures (maybe only *some* method >signatures), but imagine the resulting ambiguity of >mixing code that's not very strict about type and code >that is somewhat strict about type. Sounds like a >nightmare to me. I'm not sure what you are getting at. How about an example? >As a converting Java-to-Ruby programmer, I still get >hung up on typing. The same is true of all my Java >friends who are moving on to loosely typed languages. >Somehow, we all yearn for some strictness--especially >with regard to defining interfaces. Strange, isn't >it? It's almost like we're all obsessed with writing >contracts. Maybe we should have been lawyers. Because you are worried about run-time errors or because you like having types to help document your code? One alternative I suppose is to pass a structure or dictionary and look up the arguments by name (as opposed to calling order). -= Josh