From: "Mauricio Fernández" Date: 2003-03-27T01:01:25+09:00 Subject: Re: What are the differences between Ruby's blocks and Python's lambdas? On Thu, Mar 27, 2003 at 12:50:04AM +0900, Chris Pine wrote: > As was mentioned, Ruby has lambdas, but they are commonly called "procs". > This rhymes with "blocks" for a reason. > > A block is really just syntax sugar for defining a proc and passing it into > a function. Ruby allows for one block to be passed in to each method > (though you can, of course, pass as many procs as you want in the parameter > list). It's a convenience, nothing more. > > So, my answer is that there is no difference but syntax between *Ruby* > lambdas and blocks. Knowing no Python, I can only assume there's no > significant difference there. For the record: There's one thing Ruby's closures do and Python's cannot, as described in [ruby-talk:67618]. Doesn't seem to make a difference in praxis and there is a workaround to solve that, though. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com BTW: I have a better name for the software .... Microsoft Internet Exploder. -- George Bonser