10

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

dss539
  • 6,638
  • 2
  • 34
  • 63
  • http://msdn.microsoft.com/en-us/library/bb311046.aspx Refers to it as the "lambda operator" which is often read as "goes to" – dss539 May 18 '09 at 21:16
  • Rubyists might call it the "broken space ship operator" :-) – Peter Kofler Jun 30 '09 at 11:46
  • Possible duplicate of [How do I pronounce "=>" as used in lambda expressions in .Net](https://stackoverflow.com/questions/274022/how-do-i-pronounce-as-used-in-lambda-expressions-in-net) – Michael Freidgeim May 12 '18 at 11:09

5 Answers5

14

Lambda operator

Gishu
  • 130,964
  • 46
  • 219
  • 301
John Rasch
  • 60,314
  • 19
  • 104
  • 137
7

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
  • 144,904
  • 22
  • 145
  • 175
6

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

billb
  • 3,558
  • 1
  • 30
  • 36
4

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

Community
  • 1
  • 1
Ian Boyd
  • 233,966
  • 238
  • 834
  • 1,160
3

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".

user109023
  • 31
  • 1