The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

lutzhank (61) [Avatar] Offline
MEAP 11/02/2010

1) First paragraph 3rd sentence
"The loop will get executed..."

Here I hesitated a few seconds, because I thought the iteration depends on the guard and not the execution of the Expr.

Be more specific the like "The Expr (form Fig. 2.2) will be executed..."

2) End of same line as in 1)
" we’ll get the same result as the previous example."

" we’ll get the same result as in the previous example."

3) First paragraph last sentence
"...that all the variables created inside a for expression are of the val type..."

Writing about Scala uses the word "type" very often. I suggest to not use the word "type" in this context because it could be easily be mixed up with types like "String". Therefore my suggestion:
"...that all the value definitions inside a for expression bind names as immutable val,..."

4) Second paragraph, 2nd sentence
"The following example executes the loop for each generator and adds them."

As in 1) the Expr is executed, but here I did not understand, that the generators are added.
Be more specific:
"The following example executes the Expr for each binding generated by the enumerators and adds the values of the bound variables."

<meta>I found it difficult to phrase it otherwise like in the specification of Scala without loosing precision</meta>

5) Third paragraph first sentence
"The generators in this case are aList and bList,..."

I was confused because the list is not just the generator like defined on page 35.
""The generators in this case are a <- aList and b <- bList,...""

6) End of same sentence as in 5)
"...each generator is repeated for the other generator. So when a=1 for each value of b, that is, b= 4, b=5, b=6, the loop will be executed, and so on"

"generator" is used IMHO too generally here
"...each binding of a generator is invariant for any binding in a following generator. So the bound variable a = 1 stays for all following bindings of b from 4 to 6. footnore: Like i,j in nested Java loops.

7) Third paragraph 3rd sentence
"I used curly braces to surround the for expression...I tend to use curly braces"

I didn't knew this either, but they are called "braces or curly brackets"

smilie Third paragraph second last line
"... you could have used ()."

"()" could be mixed with the Unit value ().
" could have used parentheses ( and )."

9) 4th paragraph second last sentence
"..., and it does return value."

Confusing ending of sentence.

"..., and this form returns a value."

10) Last paragraph before the code block:
"We’re using the same aList and bList instances in the loop control..."

I am not sure what you want to say here, why mentioning the two lists here?

11) last Code block
"for(r <- result) println(r)"

reason for comment: Wish for more concise output

for(r <- result) print(r + " "smilie

Corrected MEAP version
Message was edited by: lutzhank