From: Bertram Scharpf Date: 2005-03-19T07:58:39+09:00 Subject: Re: how do you duck-type something to String, so String believes you? Hi, Am Samstag, 19. M�r 2005, 02:21:15 +0900 schrieb Sam Roberts: > Quoting flgr@ccan.de, on Tue, Mar 15, 2005 at 10:59:08PM +0900: > > class OneX; def ==(other); 1 == other; end; end > => nil > class UnityX; def ==(other); [1,1] == other; end; end > => nil > onex = OneX.new > => # > unityx = UnityX.new > => # > [1,1] == unityx > => false > 1 == onex > => true > > Huh? It always happens? Fixnum and Float will call `other.== self' if they don't find one of their relatives. File `numeric.c', Function `num_equal()', line 806. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de