Edited, memorised or added to reading queue

on 12-Sep-2014 (Fri)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 149631244

Tags
#odersky-programming-in-scala-2ed #scala
Question
How can you simplify this class?

class ArrayElement(conts: Array[String]) extends Element {
  val contents: Array[String] = conts
}
Answer
Create a parametric field:

class ArrayElement(
  val contents: Array[String]
) extends Element

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 149632101

Tags
#odersky-programming-in-scala-2ed #scala
Question
How come an abstract method can call super? It would certainly fall for classes.

trait Doubling extends IntQueue {
  abstract override def put(x: Int) { super.put(2 * x) }
}
Answer
Since super calls in a trait are dynamically bound, the super call in trait Doubling will work so long as the trait is mixed in after another trait or class that gives a concrete definition to the method.

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 149632691

Tags
#odersky-programming-in-scala-2ed #scala
Question
How can I write import p.n using full import selectors?
Answer
import p.{n}

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 149632789

Tags
#odersky-programming-in-scala-2ed #scala
Question
What does access modifier private[this] mean? Is it more or less restrictive than private ?
Answer
It is more restrictive, because it allows access only from the same object. Same class, different object is not allowed (think: typical implementation of equals() in Java has this.x == that.x; it wouldn't work with private[this] in Scala)

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







possible
statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Wikipedia, the free encyclopedia
ree encyclopedia that anyone can edit. 4,601,665 articles in English ArtsBiographyGeography HistoryMathematicsScience SocietyTechnologyAll portals From today's featured article The problem of religious language considers whether it is <span>possible to talk about God meaningfully if the traditional conceptions of God as being incorporeal, infinite, and timeless, are accepted. Various theories of religious language either attempt to