Kernel.y and yes,yes,yes not least surprise

Discussion in 'Ruby' started by Jamie Herre, Jan 7, 2005.

  1. Jamie Herre

    Jamie Herre Guest

    Sometimes using emacs makes me think of Molly Bloom (never a good idea
    at work) and then I just answer yes even before the question is asked.
    Today this resulted in a confusing bug.

    h.each{ |k,v|y

    did not produce an error but rather caused my script to output a bunch
    of "---"'s.

    I propose that Kernel.y should demand at least one argument

    def y(o,*x)
    puts( if x.empty?
    YAML::dump( o )
    else
    YAML::dump_stream( o, *x )
    end
    )
    end

    _why what do you think?

    maybe the convention that all one letter methods demand arguments might
    even be considered for inclusion in the ruby style guide.
    Jamie Herre, Jan 7, 2005
    #1
    1. Advertising

  2. Jamie Herre () wrote:
    >
    > I propose that Kernel.y should demand at least one argument
    >


    Yeah, whoa, I just committed. Thanky.

    _why
    why the lucky stiff, Jan 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yogesh
    Replies:
    3
    Views:
    574
    Kenny McCormack
    Feb 12, 2006
  2. AAaron123
    Replies:
    0
    Views:
    559
    AAaron123
    Oct 3, 2008
  3. Replies:
    3
    Views:
    157
  4. Einar Boson
    Replies:
    6
    Views:
    182
    Rick DeNatale
    Feb 2, 2009
  5. matt neuburg
    Replies:
    1
    Views:
    96
    Rick DeNatale
    Feb 17, 2009
Loading...

Share This Page