The Artima Developer Community


Errata for Programming in Scala, Third Edition
Chapter 26: Extractors
Return to errata index.

Page 445 (PDF page 483):
Email extractor accepts strings like "John@epfl.ch@" as a valid email
address

scala> EMail.unapply("John@epfl.ch@")
res78: Option[(String, String)] = Some((John,epfl.ch))

which is unexpected and likely incorrect. 
As well it looks inconsistent with a treatment of "@John@epfl.ch" as
non-email

scala> EMail.unapply("@John@epfl.ch")
res80: Option[(String, String)] = None

Note: This is a good point, but too much for fixing in a reprint. Will
look at this for the 4th edition.

Page number: Book type: Paperback book PDF eBook
Book version: (Or build date. Found on back of title page.)
Your feedback:
Your name: (optional)
Your email address: (optional) (will not be published)

Copyright © 2021 Artima, Inc. All rights reserved.