-2
votes
1answer
61 views

How to make Lambda real

So I use a command to save variables into a serialized file. I save the following data: data.Save("ships", this.ships.Select(x => x.Name)); This is supposed to output an IEnumerable but instead ...
0
votes
2answers
47 views

What is different between First-class function and Anonymous function?

I saw two concepts First-class function Anonymous function It seems that these two concepts are the same? (lambda) I'm confused?
2
votes
1answer
58 views

what is the name of that in python

I know what are closures and what are lambda functions but I want to know what is the name of that : >>> def foo(a, b): >>> return a + b >>> >>> bar = foo ...
4
votes
2answers
108 views

How can I write a Func without Lambde expression?

I am just thinking how to convert this: List.Where(X=>X>5); to non-lambda expression code. I cannot figure out how to get Func working here.
2
votes
2answers
2k views

C# Lambda Functions: returning data

Am I missing something or is it not possible to return a value from a lambda function such as.. Object test = () => { return new Object(); }; or string test = () => { return "hello"; }; I ...
6
votes
2answers
395 views

Haskell Lambda functions — two seemingly equivalent functions, one works and the other is erroneous

This Lambda function returns 1: (\x y -> 1) 1 p where p = (\x y -> 1) Okay, that makes sense to me -- the Lambda function returns 1, independent of its arguments. Now, this Lambda function ...
4
votes
1answer
160 views

Can I immediately evaluate an anonymous function? [duplicate]

Possible Duplicate: Immediately executing anonymous functions I want to immediately evaluate an anonymous function rather than it appearing as a Closure object in method args. Is this ...
10
votes
2answers
3k views

Are lambda functions faster than delegates/anonymous functions?

I assumed lambda functions, delegates and anonymous functions with the same body would have the same "speed", however, running the following simple program: static void Main(string[] args) { ...
21
votes
14answers
9k views

How to make an anonymous function in Python without Christening it?

Is it possible to put a function in a data structure, without first giving it a name with def? # This is the behaviour I want. Prints "hi". def myprint(msg): print msg f_list = [ myprint ] ...
13
votes
2answers
5k views

Ruby: Can lambda function parameters have default values?

I want to do something similar to this: def creator() return lambda { |arg1, arg2 = nil| puts arg1 if(arg2 != nil) puts arg2 ...
1
vote
6answers
529 views

How do I pass argument to anonymous Javascript function?

I am writing a simple counter, and I would like to make installation of this counter very simple for users. One of the simplest counter code (for users who install it) I ever see was Google Analytics ...