Campbell Ritchie (59) [Avatar] Offline
#1
All on page 77:
Three code blocks end #A. Is this supposed to be a 1 in a blob?
If the first code block says > 320, shouldn't the result be rice, chicken, French fries?
A bit further on, two lines before 2nd code block, it says takeWhile is useful in a large (or finite) stream. Should that read infinite?
In the second code block, it has takeWhile ...> 320 and the result is fruit, prawns. Shouldn't you get an empty Stream and 0‑element List from takeWhile?
At the bottom of the page it has dropWhile and that produced rice, chicken, fries. Surely dropWhile ...> 320 will also produce a 0‑element List as the result. I think you have got < and > swapped round.
CR