From: Minseok Choi Date: 2008-04-18T08:40:12+09:00 Subject: Re: When are lambdas needed? Stedwick wrote: > I have seen many tutorials on the Internet explaining where lambdas > CAN be used, such as clever multiplication functions, but when are > they actually NEEDED? > > Sure, I can take a lambda and "pass it around" so to speak, but I can > call a function from anywhere too, right? > > Can somebody give me an extremely useful, NOT complicated, example of > when lambdas are the absolute perfect solution to a problem? > > Thanks! lambda is like a function pointer in c/c++. Let me give you an example. hello = lambda { "Hello" } hello.call => "Hello" hello = lambda { "World" } hello.call => "World" HTH, Minseok Choi