From: Eric Hodel Date: 2006-05-23T05:49:58+09:00 Subject: Re: I call Ducktype Violation on #to_proc! :) On May 20, 2006, at 12:10 PM, transfire@gmail.com wrote: > Trying to be just ducky... > > class X > def to_proc > self > end > end > > TypeError: X#to_proc should return Proc > from (irb):14 > > Why isn't it enough that it x responds to #call? There's a convention where to_XXX requires the receiver to return an X instance while to_X doesn't. See [ruby-talk:96567]. -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com