[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Jamie Herre

1/7/2005 5:42:00 PM

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.



1 Answer

why the lucky stiff

1/7/2005 7:33:00 PM

0

Jamie Herre (jlst@gettysgroup.com) wrote:
>
> I propose that Kernel.y should demand at least one argument
>

Yeah, whoa, I just committed. Thanky.

_why