views:

423

answers:

5

The => token is part of the C# 3.0 lambda syntax. My efforts to find the name of this token have failed so far.

+5  A: 

It's referred to as the 'goes to' operator.

billb
+11  A: 

Lambda operator

John Rasch
Yes, I should have found this fairly easily myself. http://msdn.microsoft.com/en-us/library/bb311046.aspx
dss539
Also known as the "wang" operator.
Joel Coehoorn
+2  A: 

http://msdn.microsoft.com/en-us/library/bb397687.aspx

Taken from the above: All lambda expressions use the lambda operator =>, which is read as "goes to".

+6  A: 

What it is called, in terms of how to pronounce it when reading code, is covered by Eric Lippert in Reading Code Over the Telephone.

bdukes
Thanks. This has been bugging me since it came out. I can't say it so it is harder for me to grok it.
Robert Kozak
Heh, I still read it as maps to. :)
Greg D
+4  A: 

Turns out the answer depends on the context:

c=>c+1

c goes to c plus one

(Customer c)=>c.Name

customer c becomes c dot name

(Customer c)=>c.Age > 21

customer c such that c dot age is greater than 21

Ian Boyd
Yes, good point.
dss539