The Imaginative Universal

Studies in Virtual Phenomenology -- @jamesashley

Drinking the F# Kool-Aid

January 29
by James Ashley 29. January 2011 12:31

Friend Colin Whitlatch just sent me the following C# code snippet to mess with my Saturday morning.  Note the underscore:

 

Action<object> strangeLambda = _ => 
    Console.WriteLine("F# Rules");
strangeLambda(null);
Console.ReadLine();

Tags:

C# | Anti-recipe

Comments

1/29/2011 12:56:05 PM #

Lionel

I prefer use "()=>" instead of "_=>" because "_" become a local variable in the lambda expression and we dont use it. "()" doesnt specify any variable.

Lionel France

2/6/2011 8:08:48 PM #

James Ashley

Lionel,

I agree completely.  Thanks for your comment.

James

James Ashley United States

2/11/2011 4:36:38 AM #

Tom

@Lionel, ditto

Tom Canada

Comments are closed