C# lambda operator
Last updated on June 7, 2013, 23:54 by Sebastian Mihai
I feel that Microsoft .NET creators could have come up with a better operator for lambda expressions than =>. The reason for this is that under certain circumstances, lambda expressions can be made to look goofily. Here's an example:

Func<long, bool> lambda = x => x <= 3;

I think that my problem with this syntax is that the = sign is already overloaded quite a bit. We use it for assignment, as well as ordinal and equality comparisons, such as <= and >=.
-> would be a great one, but, unfortunately, is taken.

I think a better operator could have been -->, improving, in my opinion, the appearance above statement:

Func<long, bool> lambda = x --> x <= 3;

If you use the materials on this page, or any other page on this web site, you do so at your own risk. They are provided "as is". No warranty is provided or implied. I neither guarantee that the materials will work, nor that they will not be harmful in any way.

.Net development - C# from C#

The naming convention of the C standards is Y2K-susceptible

Missing stack trace entries in Release mode assemblies in .Net 4.0 (C#)

Public constants across assemblies and default parameter values in C#

C# lambda operator

Simple two-column, three-panel web site template

An easy to use random number generator

Puppy Linux on a computer without a hard drive (on a USB stick!)

(My) Useful settings for fresh Windows installations on new computers

How to use multiple versions of Firefox on the same computer

How indexes work

Trivialization of history through technology

Entropy in code

Basic Linux tricks

MSSQL tips for production databases

Keep your computer clean with VMware