Repository: incubator-groovy Updated Branches: refs/heads/master bedd8b4f9 -> ea17fa1fd
cosmetic corrections Project: http://git-wip-us.apache.org/repos/asf/incubator-groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-groovy/commit/ea17fa1f Tree: http://git-wip-us.apache.org/repos/asf/incubator-groovy/tree/ea17fa1f Diff: http://git-wip-us.apache.org/repos/asf/incubator-groovy/diff/ea17fa1f Branch: refs/heads/master Commit: ea17fa1fdb56f7f118b6c48f1eef307c569af66c Parents: bedd8b4 Author: pascalschumacher <pascalschumac...@gmx.net> Authored: Mon Aug 31 08:03:34 2015 +0200 Committer: pascalschumacher <pascalschumac...@gmx.net> Committed: Mon Aug 31 08:03:34 2015 +0200 ---------------------------------------------------------------------- src/spec/doc/core-semantics.adoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-groovy/blob/ea17fa1f/src/spec/doc/core-semantics.adoc ---------------------------------------------------------------------- diff --git a/src/spec/doc/core-semantics.adoc b/src/spec/doc/core-semantics.adoc index ceb89f9..a05ca5d 100644 --- a/src/spec/doc/core-semantics.adoc +++ b/src/spec/doc/core-semantics.adoc @@ -168,7 +168,7 @@ Switch supports the following kinds of comparisons: NOTE: `default` must go at the end of the switch/case. While in Java the default can be placed anywhere in the switch/case, the default in Groovy is used more as an else than assigning a default case. -NOTE: when using a closure case value, the default `it` parameter is actually the switch value (in our example, variable `x`) +NOTE: When using a closure case value, the default `it` parameter is actually the switch value (in our example, variable `x`). ==== Looping structures ===== Classic for loop @@ -400,11 +400,11 @@ We can decompose the expression `this.class.methods.name.grep(~/.*Bar/)` to get `this.class.methods.name`:: apply a property accessor on each element of an array and produce a list of the results. `this.class.methods.name.grep(...)`:: call method `grep` on each element of the list yielded by `this.class.methods.name` and produce a list of the results. -WARNING: a sub-expression like `this.class.methods` yields an array because this is what calling `this.getClass().getMethods()` in Java -would produce : `GPath` expressions have not invented a convention where a `s` means a list or anything like that. +WARNING: A sub-expression like `this.class.methods` yields an array because this is what calling `this.getClass().getMethods()` in Java +would produce. `GPath` expressions do not have a convention where a `s` means a list or anything like that. One powerful feature of GPath expression is that property access on a collection is converted to a _property access on each element of the collection_ with -the results collected into a collection. Therefore, the expression `this.class.methods.name` could be expressed as follows in Java: +the results collected into a collection. Therefore, the expression `this.class.methods.name` could be expressed as follows in Java: [source,java] ---- List<String> methodNames = new ArrayList<String>();