[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Re: What are closures, continuations?

Gavin Kistner

10/27/2006 9:04:00 PM

From: list-bounce@example.com
> One more question -- what are lambdas? ;)

Another name for anonymous functions - functions declared on the fly
without assigning them to some method or top-level variable.

JavaScript example:
// The argument to the 'each' method here is an anonymous function.
myArray.each( function(i){ alert(i) } );

Ruby example:
# I'm making a brand new proc on the right side here
dir_watcher.on_modified = lambda{ |x| puts x }