140

I have seen some code which uses the <= operator. Can you explain what is the use of having lambda in reverse direction?

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
user215675
  • 4,991
  • 9
  • 36
  • 40
  • 44
    I'll admit... I did laught at this one... – LorenVS Dec 03 '09 at 10:26
  • 5
    Now, be honest. You're kidding, aren't you? http://stackoverflow.com/questions/1642028 – Kobi Dec 03 '09 at 10:26
  • 26
    Having looking at 1000 lines of code,I got confused.sorry guys. – user215675 Dec 03 '09 at 10:27
  • 4
    This is a quality question! Made my day. – Simon May 03 '13 at 13:19
  • 3
    no it isn't, it's a low quality question, but because it's 'funny' it's allowed to be kept? – user3791372 Jul 24 '14 at 17:24
  • 13
    Easy to answer != Low Quality. I'm not sure what is with the compulsion to close everything. Every developer has moments where they need to search something that should be obvious... Why not allow an actual answer instead of the first three pages of search results being "Google It". – Kelly Robins Sep 12 '16 at 19:18
  • OP built a significant part of his reputation on this question. He's my hero! Give your votes and honor your breaks! :-) – Henk van Boeijen Dec 15 '21 at 23:49

3 Answers3

171

That's just less than or equal. I don't think C# lambdas work like that. It's too early in the morning. You need coffee.

Dave Markle
  • 95,573
  • 20
  • 147
  • 170
42

That's not a lambda at all. That's less than or equal to

(Except when it's actually a reverse lambda)

David Hedlund
  • 128,221
  • 31
  • 203
  • 222
14

It is only used as 'less than or equal to' operation, as in:

if (i <= 5) {
    // ...
}
Skully
  • 2,882
  • 3
  • 20
  • 31
Razzie
  • 30,834
  • 11
  • 63
  • 78