June 2018
Intermediate to advanced
310 pages
6h 32m
English
Did you ever plug a 110v US appliance into a 220v EU socket through an Adapter, and fry it totally?
That's something that may also happen to your code, if you're not careful. The following example, which uses another Adapter, compiles well:
fun <T> collectionProcessing(c: Collection<T>) { for (e in c) { println(e) }}val s = Stream.generate { 42 }collectionProcessing(s.toList())
But it never completes, because Stream.generate() produces an infinite list of integers. So, be careful, and adapt this pattern wisely.
Read now
Unlock full access