X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109 Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!talisker.lacave.net!lacave.net!not-for-mail From: Brian Candler Newsgroups: comp.lang.ruby Subject: Re: To Yield or Not to Yield: An Inferable Question Date: Thu, 21 Apr 2011 04:47:53 -0500 Organization: Service de news de lacave.net Lines: 13 Message-ID: <80f9bc211e7de3588b8d479bc198a014@ruby-forum.com> References: <78681B86-AB88-4DA6-A8AA-EEA59186B407@carboni.ca> <157ee9d8e95b68bee86be7ba51ba49f1@ruby-forum.com> <4ACEA4E0-F24C-44B5-ABE9-98C5421280E3@carboni.ca> NNTP-Posting-Host: bristol.highgroove.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: talisker.lacave.net 1303379451 21681 65.111.164.187 (21 Apr 2011 09:50:51 GMT) X-Complaints-To: abuse@lacave.net NNTP-Posting-Date: Thu, 21 Apr 2011 09:50:51 +0000 (UTC) In-Reply-To: <4ACEA4E0-F24C-44B5-ABE9-98C5421280E3@carboni.ca> 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: 381989 X-Ml-Name: ruby-talk X-Rubymirror: Yes X-Ruby-Talk: <80f9bc211e7de3588b8d479bc198a014@ruby-forum.com> Xref: x330-a1.tempe.blueboxinc.net comp.lang.ruby:3303 You are of course right in your analysis. My point is more that using "block_given?" in itself is API smell. It means you have one method which can be called in two different ways, with two different behaviours. The other main example in the core library (1.8.7+) is methods like 'each' which return an Enumerator if you don't pass a block. I don't like that either. -- Posted via http://www.ruby-forum.com/.