top | item 23937471

Self-assigning Method Call Syntax (C#)

2 points| ivankahl | 5 years ago |twitter.com

1 comment

order

LandR|5 years ago

Would there be issues with IEnumerables deferred execution?

e.g.

    var xs = new List<int>{1, 2, 3, 4, 5};
    xs.Select(Inc)
      .Where(IsEven);
If I run that, nothing happens, neither Inc or IsEven is called... Its not until the results are realised that they will be called. If Select was writing back to xs, would this break?