Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!talisker.lacave.net!lacave.net!not-for-mail From: Brian Candler Newsgroups: comp.lang.ruby Subject: Re: anonymous closures with Proc,new, lambda and -> Date: Wed, 20 Apr 2011 10:18:51 -0500 Organization: Service de news de lacave.net Lines: 22 Message-ID: <9b174c2306ccb671f0cdd13f433067f9@ruby-forum.com> References: <03b15245deb79f0148cf821c34a7ed41@ruby-forum.com> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1303312880 945 65.111.164.187 (20 Apr 2011 15:21:20 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Wed, 20 Apr 2011 15:21:20 +0000 (UTC) In-Reply-To: X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway X-Mail-Count: 381927 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <9b174c2306ccb671f0cdd13f433067f9@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3246 Michael Edgar wrote in post #993817: > Proc > doesn't implement #initialize, so it bubbles up to Object#initialize. > Since Object#initialize just takes any number of arguments and ignores > them, providing an argument to Proc.new doesn't raise. So I think the question becomes: why does Object#initialize accept any number of arguments in 1.9? It doesn't in 1.8. $ ruby -ve 'Object.new(1,2,3)' ruby 1.8.7 (2010-06-23 patchlevel 299) [x86_64-linux] -e:1:in `initialize': wrong number of arguments (3 for 0) (ArgumentError) from -e:1:in `new' from -e:1 $ ruby192 -ve 'Object.new(1,2,3)' ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux] $ -- Posted via http://www.ruby-forum.com/.