|
|
Re: Structural Subtyping Index Entry
|
Posted: Mar 17, 2009 10:37 AM
|
|
Hi Randall,
> Why does the index entry for "Structural Subtyping" refer > to http://booksites.artima.com/programming_in_scala ? I > see the tiny example there, but that hardly constitutes > coverage of the topic. Will there be a treatment of > structural subtyping there at some point? > Yes, we should flesh that out. I just put a placeholder up there for the time being. Basically the reason I put that in the index was so that people looking up structural subtyping wouldn't think we forgot to index it. Rather, the decision was made to not include it in the book. So instead I want to flesh out the description on the resources page. I have used structural subtyping in ScalaTest, so if you want some examples you can look at the source code, which is distributed in the zip file:
http://www.artima.com/scalatest
I use it so you can say object should have length (7) on any object that conforms to one of the structural types:
{ def length: Int } { def getLength(): Int } { def length(): Int }
Same for object should have size (7) .
> Oddly enough, following that "link" answered my question > from yesterday (where's the book source code and errata > list), but raises another: When will the errata be made > available? > Sorry the errata app has been ready for a couple weeks but I haven't had time to deploy it. I should have it deployed very soon.
|
|