The Artima Developer Community


Errata for Programming in Scala, Third Edition
Chapter 35: The SCells Spreadsheet
Return to errata index.

Page 753 (PDF page 777):
Hi,

The SCells example in last chapter does not compile. After performing
following changes:
1. Class Cell:
from:
case class Cell(row: Int, column: Int) extends Publisher
to:
case class Cell(row: Int, column: Int) extends Component with Publisher
2. Class Cell - method value_=:
from:
publish(ValueChanged(this))
to:
publish(new ValueChanged(this))
3. Class Spreadsheet - reactions:
from:
case ValueChanged(cell) => updateCell(cell.row, cell.column)
to:
case ValueChanged(cell) => cell match {
  case c: Cell => updateCell(c.row, c.column)
}

code compiles and application behaves as expected.


Regards

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 © 2024 Artima, Inc. All rights reserved.