Re:Teeing, a hidden gem in the Java API
by willtim on Monday May 10, 2021 @04:12AM
(#27103766)
Side-effects do not mix with lazy on-demand streams! This is unfortunately a problem with bringing functional programming constructs to a language with idiomatic pervasive mutation.
[ Parent
| on HN ]
BTW, this is a non-issue with C# 1.0 and later due to `yield return` syntax.
Sorry, I'm skeptical -- how exactly does a 'yield return' resolve the divergences between functional programming & mutable data structures?
My layman's impression was that 'yield return' was largely syntactic sugar around an iterator, rather similar to Java.