The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

pescador_bob (5) [Avatar] Offline
listing 4.1 line 20 reads:

assert (0.0..1.0).contains(0.5)

unfortunately, this assertion fails now (even though it must have when you wrote the book).

a printout

(0.0..1.0).each { num ->
print num + ', '


0.0, 1.0,
pescador_bob (5) [Avatar] Offline
Re: Code error in listing 4.1 (range declarations)
I saw this post on this, not in the errata as I supposed it should be:

but my question then is, how would listing 4.2 then work if the age were something like 36.5

Could you use the switch statement then with containsWithin somehow?