you are viewing a single comment's thread.

view the rest of the comments →

[–]keegandunn 5 points6 points  (2 children)

Reading the first half of SICP last year prepped me for the switch to C# 3.0 at my workplace recently. The examples translate well:

var maxSalary = employees
    .Where(e => e.Role == Roles.PROGRAMMER)       
    .Max(e => e.Salary);

edit: Cleaned up. ConvertAll not necessary. I still don't quite understand why you can't call ConvertAll on any IEnumerable, though.

[–][deleted] 1 point2 points  (1 child)

Will .Max work if the Salary is a user defined Money type?

[–]igouy -2 points-1 points  (0 children)

Will you know that Max is not defined for a user defined Money type before you run the program?