Ex 5.4: takeWhile