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
#1
MEAP 11/02/2010

1) First paragraph 3rd sentence
orig:
"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.

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

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

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

3) First paragraph last sentence
orig:
"...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
orig:
"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.
suggestion:
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
orig:
"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.
suggestion:
""The generators in this case are a <- aList and b <- bList,...""

6) End of same sentence as in 5)
orig:
"...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
suggestion:
"...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
orig:
"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"
(http://en.wikipedia.org/wiki/Bracket#Curly_brackets_.7B_.7D)

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

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


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

Confusing ending of sentence.

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

10) Last paragraph before the code block:
orig:
"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
orig:
"for(r <- result) println(r)"

reason for comment: Wish for more concise output

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

------------------------------
Corrected MEAP version
Message was edited by: lutzhank