[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

proc and lambda

Sourav

9/22/2006 12:09:00 PM

What is the difference between proc function and lambda function when
they both create new Proc object? Is there any guidelines for
preferring one over another?

4 Answers

Sourav

9/22/2006 12:20:00 PM

0


Provided of course, I know the differences between Proc.new and lambda
~ both proc and lambda seems to behave the way, whereas, Proc.new
behaves slightly differently.

ts

9/22/2006 12:25:00 PM

0

>>>>> "S" == Sourav <soura.jagat@gmail.com> writes:

S> Provided of course, I know the differences between Proc.new and lambda
S> ~ both proc and lambda seems to behave the way, whereas, Proc.new
S> behaves slightly differently.

Well, if you think that proc and lambda behave the same, you'll have a
surprise one day :-)

moulon% ./ruby -ve 'proc { break }.call'
ruby 1.9.0 (2006-09-21) [i686-linux]
-e:1: break from proc-closure (LocalJumpError)
from -e:1:in `Proc#call'
from -e:1
moulon%

moulon% ./ruby -ve 'lambda { break }.call'
ruby 1.9.0 (2006-09-21) [i686-linux]
moulon%



Guy Decoux

ts

9/22/2006 1:31:00 PM

0

>>>>> "R" == Robert Dober <robert.dober@gmail.com> writes:

R> 1.8 Proc.new != proc, proc == lambda
R> 1.9 Proc.new == proc, proc!=lambda

yes,


Guy Decoux

TheZ

3/17/2010 5:58:00 PM

0

Actually the Rodney King clone the US has elected needs all the friends he
can get.
(apologies to Rodney King).

"NefeshBarYochai" <lbitflex@gmail.com> wrote in message
news:f67182f9-9fb9-4ef2-8676-56b0b6ca74df@x23g2000prd.googlegroups.com...
On Mar 16, 11:45 pm, Just Me <jpd...@gmail.com> wrote:
> On Mar 16, 11:55 pm, Jared <jared4...@gmail.com> wrote:
>
>
>
>
>
> > On Mar 16, 7:40 am, "Koolchi...@smurfsareus.xxx"
>
> > <john.kulczy...@sympatico.ca> wrote:
> > > You do realize that the US does not need Israel as an ally in the
> > > middle east anymore don't you?
>
> > Well, don't we need them _not_ to bomb Iran?
>
> > > Do we really need to be pumping all those $$$$ into Israel? What if
> > > we just set up strong diplomatic and economic relations with the
> > > Palistinians and passified them on those terms instead of the methods
> > > the Israelis have benn using? Would that work better for the USA?
>
> > It's possible that the Israelis would become less belligerent with
> > less foreign aid, but surely the Palestinians would become more so if
> > they got it instead.
>
> What's "belligerent" about Jews wanting to build their homes in
> Jerusalem for the godsake--and I mean any part of Jerusalem? What's
> belligerent is to see the progeny of a bunch of foreign Arab invaders
> trying to stop the people whose fathers built that city from living in
> it. Are these people nuts? A Jew can live anywhere in Jerusalem he
> wants to and nobody is going to tell her otherwise.
>
> The belligerence is what we see coming from Obama, Biden and the
> Hillary Youth who in their PC dreams actually have the chutzpah to
> suppose that any act of a Jew toward the defense of his people is
> "belligerence." These piggies! There's your belligerence. And Jews
> have HAD IT with these scum with that dirty lie on their lips to say
> that for a Jew to defend himself is "belligerence." The Jews are now
> showing how they are going about the business of making all these
> truly belligerent snotty-panties EAT THAT LIE. A Jewish war-bought
> claim of right to the lands of their fathers is not "belligerence", it
> came as an act of self defense and NOTHING else. So it remains, so it
> stands, over the graves of all the dead who made it so; and these Jews
> WILL NOT go trampling back over their own dead. Get that in your baby
> goy heads.
>
> Israel has ANNEXED all of Jerusalem, get used to it, and then shut up
> about it because it's none of your silly damned business.

Amen