From: Sean O'Dell Date: 2004-06-07T02:25:35+09:00 Subject: Re: How to ducktype a Hash? On Sunday 06 June 2004 05:33, Jeff Mitchell wrote: > I would certainly not advocate checking kind_of? Map. Instead, one blindly > calls #fetch and #store and then relies on ruby to raise an exception when > a method doesn't exist. The problem is, it's not a matter of whether or not the methods exist, it's a matter of what they do. Methods exist everywhere that do completely different things, and which take completely different arguments. Simply identifying a method's existence or non-existence, whether through pre-checking or allowing an exception to occur, is not enough. Method existence is no guarantee of functionality, nor is it even a guarantee of a proper exception from unexpected behavior. Often, unexpected behavior is quietly skipped past. Sean O'Dell