Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3303

Re: To Yield or Not to Yield: An Inferable Question

From Brian Candler <b.candler@pobox.com>
Newsgroups comp.lang.ruby
Subject Re: To Yield or Not to Yield: An Inferable Question
Date 2011-04-21 04:47 -0500
Organization Service de news de lacave.net
Message-ID <80f9bc211e7de3588b8d479bc198a014@ruby-forum.com> (permalink)
References <CA1B8DEB-7979-4D1B-8594-3BA3C72AE76F@carboni.ca> <c0656e03bb64f14a6b7f3ac7a3ab69e5@ruby-forum.com> <78681B86-AB88-4DA6-A8AA-EEA59186B407@carboni.ca> <157ee9d8e95b68bee86be7ba51ba49f1@ruby-forum.com> <4ACEA4E0-F24C-44B5-ABE9-98C5421280E3@carboni.ca>

Show all headers | View raw


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/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[ANN] To Yield or Not to Yield: An Inferable Question Michael Edgar <adgar@carboni.ca> - 2011-04-14 12:47 -0500
  Re: To Yield or Not to Yield: An Inferable Question Brian Candler <b.candler@pobox.com> - 2011-04-17 15:22 -0500
    Re: To Yield or Not to Yield: An Inferable Question Michael Edgar <adgar@carboni.ca> - 2011-04-17 16:40 -0500
      Re: To Yield or Not to Yield: An Inferable Question Ryan Davis <ryand-ruby@zenspider.com> - 2011-04-18 03:41 -0500
      Re: To Yield or Not to Yield: An Inferable Question Brian Candler <b.candler@pobox.com> - 2011-04-18 10:53 -0500
      Re: To Yield or Not to Yield: An Inferable Question Brian Candler <b.candler@pobox.com> - 2011-04-20 03:59 -0500
        Re: To Yield or Not to Yield: An Inferable Question Michael Edgar <adgar@carboni.ca> - 2011-04-20 16:46 -0500
          Re: To Yield or Not to Yield: An Inferable Question Brian Candler <b.candler@pobox.com> - 2011-04-21 04:47 -0500
            Re: To Yield or Not to Yield: An Inferable Question Robert Klemme <shortcutter@googlemail.com> - 2011-04-21 06:18 -0500
              Re: To Yield or Not to Yield: An Inferable Question Brian Candler <b.candler@pobox.com> - 2011-04-21 12:55 -0500
  Re: [ANN] To Yield or Not to Yield: An Inferable Question Robert Klemme <shortcutter@googlemail.com> - 2011-04-18 04:34 -0500
    Re: [ANN] To Yield or Not to Yield: An Inferable Question Michael Edgar <adgar@carboni.ca> - 2011-04-18 04:46 -0500
      Re: [ANN] To Yield or Not to Yield: An Inferable Question Robert Klemme <shortcutter@googlemail.com> - 2011-04-18 06:16 -0500
        Re: [ANN] To Yield or Not to Yield: An Inferable Question Michael Edgar <adgar@carboni.ca> - 2011-04-18 07:26 -0500

csiph-web