From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9vue?=) Date: 2010-05-28T03:50:14+09:00 Subject: Re: Module methods Jes�s Gabriel y Gal�n wrote: > I guess you are doing something like this: > > irb(main):001:0> module PlaySound > irb(main):002:1> def PlaySound.rand > irb(main):003:2> rand > irb(main):004:2> end > irb(main):005:1> end > => nil > irb(main):006:0> PlaySound.rand > SystemStackError: stack level too deep > from (irb):3:in `rand' > from (irb):3:in `rand' > from (irb):6 > from :0 RIGHT ! ))) > The rand that you call inside the PlaySound.rand is itself, not > Kernel's rand. Try this instead: > > irb(main):007:0> module PlaySound > irb(main):008:1> def PlaySound.rand > irb(main):009:2> Kernel.rand > irb(main):010:2> end > irb(main):011:1> end > => nil > irb(main):012:0> PlaySound.rand > => 0.821838053097397 i thought i had tried that too but may be with another error... right know, after your advice, it works ! thanks ! -- � L� o� la v�rit� n'est pas libre, la libert� n'est pas vraie. � (Jacques Pr�vert)