The toString method is used in Java/Scala for user readable representations. I don't think we should used it with different meaning. I suggest parts.map(_.name).mkString(".") instead.