From: david karapetyan Date: 2007-08-17T12:51:17+09:00 Subject: Re: Passing two functions as parameters ------=_Part_98873_1017470.1187322680706 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline I don't think what you are doing is valid code. Ruby is call by value so th= e arguments to a method get evaluated before anything happens. If your x method takes an argument then your code won't work. On 8/16/07, Pe=F1a, Botp wrote: > > [mailto:list-bounce@example.com] On Behalf Of Frank Meyer > # Subject: Re: Passing two functions as parameters > # > # I know only one way: > # > # call_fncs( Proc.new { my_fnc1 }, Proc.new { my_fnc2 } ) > > i like ruby since it treats vars and methods alike. > > this is just a simple example, > > irb(main):001:0> def x > irb(main):002:1> puts "x" > irb(main):003:1> end > =3D> nil > irb(main):004:0> def y > irb(main):005:1> puts "y" > irb(main):006:1> end > =3D> nil > irb(main):007:0> def test(x,y) > irb(main):008:1> x > irb(main):009:1> y > irb(main):010:1> end > =3D> nil > irb(main):011:0> test x,y > x > y > =3D> nil > irb(main):012:0> def test2(a=3Dx,b=3Dy,c=3Dx) > irb(main):013:1> a > irb(main):014:1> b > irb(main):015:1> c > irb(main):016:1> end > =3D> nil > irb(main):017:0> test2 > x > y > x > =3D> nil > irb(main):018:0> > > kind regards -botp > ------=_Part_98873_1017470.1187322680706--