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.
Within Chapter 3, all of the Table reference numbers are incorrect. All of the Table references begin with 1.*. Please see the references on pages 64, 65, 68, 74, 82, 8, 91, 93, 104 and 106, respectively.
More missing backslash madness - one page 97, in listing 3.8, the comment
// words that end with 'ain': bw*ainb
probably should be:
// words that end with 'ain': w*ain
Likewise with the actual declaration of wordEnding & rhyme.
in listing 5.8 Investigating the closure scope, #7 is not working, because this.owner in the Closure refers to the declaring class and Mother class has no owner.
Exact message is:
Caught: groovy.lang.MissingPropertyException: No such property: owner for class: Mother
groovy.lang.MissingPropertyException: No such property: owner for class: Mother
at Mother$_birth_closure1.doCall(YAT2.groovy:45)
at YAT2.run(YAT2.groovy:5
*** Problem found... *** Missed the inheritance between classes
Listing 5.10 The visitor pattern in Groovy does not work; the script fails with the following error
Caught: groovy.lang.MissingMethodException: No signature of method: Square.accept() is applicable for argument types: (YAT3$_run_closure1) values: [YAT3$_run_closure1@2ba99347]
Possible solutions: area(), grep(), inspect(), asType(java.lang.Class), inject(groovy.lang.Closure), sleep(long)
groovy.lang.MissingMethodException: No signature of method: Square.accept() is applicable for argument types: (YAT3$_run_closure1) values: [YAT3$_run_closure1@2ba99347]
Possible solutions: area(), grep(), inspect(), asType(java.lang.Class), inject(groovy.lang.Closure), sleep(long)
at Drawing$_accept_closure1.doCall(YAT3.groovy:36)
at Drawing.accept(YAT3.groovy:36)
at Drawing$accept.call(Unknown Source)
at YAT3.run(YAT3.groovy:66)
I'm not a Groovy expert, but it seems related to the use of this
How did you execute the example in 5.10? I've executed it too using the Groovy Console 2.1.1, and I have no errors. My output is this:
The shapes in this drawing cover an area of 4.141592653589793 units.
The individual contributions are:
Square:1
Circle:3.141592653589793
Result: [Square@1835d850, Circle@770c789a]
Removing the this in the closure declaration works; there is still one issue though with #6
I stored the script in a file called YAT3 (Yet Another Test #3 ) so context[5] is not an instance of Script, but well of YAT3
I see what you mean, but I think you are mistaken here. While the class name is indeed YAT2, the context[5] is an instance of YAT2 and of Script, since YAT2 will extend Script.
That's why your script works. Though it might produce a bit different output than you would expect, since you placed it in a file, all the asserts still work, and both:
assert context[5] instanceof YAT2;
and
assert context[5] instanceof Script;
will work. Note btw that in your code, your are using a lot of semicolumns. This is very understandable coming from a Java background, but not needed!
Indeed, the semi columns come from my java tradition
for the book, it might be useful to make explicit that scripts are expected to run in the console, otherwise, you'll end up with people like me who store them in files, and then face problem (in my case, the assert failed)
After re-reading this section several times, I realized I just didn't know what was going on. The section mentions "IDE support", but I found it unclear what exact feature in the IDE (not to mention the mechanics of that feature) that this code was expected to provide. I felt I needed more context. Was this to enable code completion? If so, "how does an IDE do that" would be the context to provide, with specific-to-IDE vocabulary/nomenclature before entering the abstract generalization of input/output channels.
I mention it, because it stood out in contrast to the admirable level of clarity the rest of v12 has. Nice work, so far!
Ken
XML release date, v14, Chapter 14 "Working with XML and JSON", page 348
The chapter says "The World Wide Web Consortium (W3C) standardized the first version of XML in 1996", which is technically not correct. Yes, the very first working draft dates back to 1996. However, the first "standard" (in W3C terms: "recommendation") was published in 1998.
http://www.w3.org/TR/1998/REC-xml-19980210
Chapter 13 (Database programming)
Use of supercede on Page 343, in the text, the example and the diagram.
From http://www.merriam-webster.com/dictionary/supercede: Supercede has occurred as a spelling variant of supersede since the 17th century, and it is common in current published writing. It continues, however, to be widely regarded as an error.
Not sure why you are saying that it should be +1, instead of -1.
If there are 2 people, there is one click: 2 * (2-1) / 2 = 2*1 /2 = 1
If there are 3 people, there are 3 clicks: 3 * (3-1) / 2 = 3*2 /2 = 3
If there are 4 people, there are 6 clicks: 4 * (4-1) / 2 = 4*3 /2 = 6
Thanks for your feedback! It has been processed. I also found some other small errors in chapter 4, which are fixed now. I also checked chapter 5, and found many more dashes in words, which are fixed now.
When providing some samples, the lines are usually referenced using numbers, (#1, #2, ... in the MEAP v14) while for chapter 6, the lines are referenced by letters (#A, #B, ...)
The reason for this is that number references come back in the text below, while letter references don't. And no, this is not a convention I thought of If chapter 6 doesn't match this convention, we'll have to change it. Thanks for mentioning it.
I also fixed the 'are classes are classes'. Thanks again for the help, it's most appreciated!
At least on page 173 of MEAP v 14, there are mention of both "missingMethod" and "methodMisssing" method names. The first term is likely incorrect and should be replaced by methodMissing.
Not an error or anything but just a question: what drives the indentation style difference in some paragraphs? Some paragraphs start from the left edge of the text and some others after 4 spaces from the left edge as in (the last two paragraphs before 9.4 AST by Example:...):
"(4 spaces)When you write an AST transformation, you will need to decide which compiler phase to target. The choice depends on what you're trying to do to the AST. A full description of the different compiler phases, as well as some hints for choosing which phase to target, appears in Appendix F."
"(No spaces)Local transformations require an annotation,..."
"Remember, free standing scripts without classes still get generated into a Script subclass during complication, so adding a getCompiledTime() method to..."
This has also been fixed. I cannot answer your other question at this time, but I forwarded it to someone else of the team! Again, thanks for the great feedback!
Unwanted space and spelling error in the gray box titled, "For the geeks" in Section 8.4.1:
"...Then you can change it's default meta class by putting a m(space)eta class with the name "groovy.runtime.metaclass.custom.CustomMetaClass" on the classpath.
This device has b(space)een proven useful when inspecting large Groovy codebases in production...."
"...when calculating with measurements that have a different orders of magnitude."
"...a different orders of ..." sounds a bit strange due to the mix of singular and plural expressions one after another although the meaning is well conveyed.