Edited, memorised or added to reading queue

on 21-Aug-2014 (Thu)

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

Flashcard 149630506

Tags
#odersky-programming-in-scala-2ed #scala
Question
You can't reassign [vars or vals]
Answer
vals

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

Parent (intermediate) annotation

Open it
You can't reassign vals

Original toplevel document (pdf)

cannot see any pdfs







#odersky-programming-in-scala-2ed #scala
The only control structures in Scala are if, while, for, try, match, and function calls
statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

pdf

cannot see any pdfs




Flashcard 149630539

Tags
#odersky-programming-in-scala-2ed #scala
Question
How to write Unit as a literal?
Answer
()

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 149630550

Tags
#odersky-programming-in-scala-2ed #scala
Question
Why doesn't it work?

var line = ""
while ((line = readLine()) != "") // This doesn’t work!
  println("Read: "+ line)

Answer
the result of assignment expression is always Unit, so the above check Unit != "" is always true

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