The Artima Developer Community


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

Page 774 (PDF page 805):
Trying to create array of arrays in a way the book suggests:

  val cells = new Array[Array[Cell]](height, width)

yields compiler error:

  too many arguments for constructor Array: (_length:
Int)Array[Array[Model.this.Cell]]

So I used:

  val cells = Array.ofDim[Cell](height, width)
Page 783 (PDF page 814):
listing 35.7 :

case Coord(row, column) =>
cells(row)(column).value <-----

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.