From: Minkoo Seo Date: 2007-02-05T16:00:06+09:00 Subject: Re: Proc vs lambda vs proc On Feb 4, 8:18 pm, Robert Klemme wrote: > On 04.02.2007 04:55, Minkoo Seo wrote: > > there might be some situation where Proc.new is more suitable than > > lambda. As an example, some code blocks that have to executed > > thousands times might run more faster than lambda because it does not > > have to check the # of arguments, thereby decreasing computational > > overhead. > > I usually use lambda because it most resembles the term "lambda > expression". But I guess this is just a matter of taste / personal > preference. > > Kind regards > > robert Okay. The problem is that I am writing a ruby tutorial for people from other langauges (like C++ or Java), but there are three seemingly same things: block, proc, and lambda. So I need to write about not only the differences but also the simple but effective rule for choosing one out of three. To make it worse, the functionality provided by proc and lambda is quite similar except for the differences in parameter checking and return statement handling. And many people suggest to use lambda instead of proc if one does not have any particular reason. So what I'd like to do is to verify whether the preference for lambda is correct or not. So, my intention is to find out whether there are people who prefer Proc to lambda whatever the reason is. Up to now, I see none. Any one? Sincerely, Minkoo Seo