Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E5984200B8D for ; Fri, 9 Sep 2016 02:39:51 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E477D160AD1; Fri, 9 Sep 2016 00:39:51 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3ECF2160AAD for ; Fri, 9 Sep 2016 02:39:51 +0200 (CEST) Received: (qmail 15436 invoked by uid 500); 9 Sep 2016 00:39:50 -0000 Mailing-List: contact commits-help@groovy.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@groovy.apache.org Delivered-To: mailing list commits@groovy.apache.org Received: (qmail 15427 invoked by uid 99); 9 Sep 2016 00:39:50 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2016 00:39:50 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1208FDFD9F; Fri, 9 Sep 2016 00:39:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jwagenleitner@apache.org To: commits@groovy.apache.org Date: Fri, 09 Sep 2016 00:39:51 -0000 Message-Id: <1503cf3497e747c988a837cdb5fafa7b@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/2] groovy git commit: Documentation fixes to [The Groocy Development Kit](http://groovy-lang.org/groovy-dev-kit.html) section on Working with collections - property access comment targets entry instead of key - two introductions followed by two corres archived-at: Fri, 09 Sep 2016 00:39:52 -0000 Documentation fixes to [The Groocy Development Kit](http://groovy-lang.org/groovy-dev-kit.html) section on Working with collections - property access comment targets entry instead of key - two introductions followed by two corresponding code sections Project: http://git-wip-us.apache.org/repos/asf/groovy/repo Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/97f74ed2 Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/97f74ed2 Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/97f74ed2 Branch: refs/heads/GROOVY_2_4_X Commit: 97f74ed20f34469d2c08e54a208dc18784b0ccdd Parents: 776ea2c Author: Karsten Tinnefeld Authored: Fri Sep 9 00:49:06 2016 +0200 Committer: John Wagenleitner Committed: Thu Sep 8 17:38:59 2016 -0700 ---------------------------------------------------------------------- src/spec/doc/working-with-collections.adoc | 5 +++++ src/spec/test/gdk/WorkingWithCollectionsTest.groovy | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/groovy/blob/97f74ed2/src/spec/doc/working-with-collections.adoc ---------------------------------------------------------------------- diff --git a/src/spec/doc/working-with-collections.adoc b/src/spec/doc/working-with-collections.adoc index 9fb2d14..859a535 100644 --- a/src/spec/doc/working-with-collections.adoc +++ b/src/spec/doc/working-with-collections.adoc @@ -431,6 +431,11 @@ include::{projectdir}/src/spec/test/gdk/WorkingWithCollectionsTest.groovy[tags=s It is worth noting that negative indices are allowed, to extract more easily from the end of a collection: +[source,groovy] +--------------------------------- +include::{projectdir}/src/spec/test/gdk/WorkingWithCollectionsTest.groovy[tags=subscript_3,indent=0] +--------------------------------- + You can use negative indices to count from the end of the List, array, String etc. http://git-wip-us.apache.org/repos/asf/groovy/blob/97f74ed2/src/spec/test/gdk/WorkingWithCollectionsTest.groovy ---------------------------------------------------------------------- diff --git a/src/spec/test/gdk/WorkingWithCollectionsTest.groovy b/src/spec/test/gdk/WorkingWithCollectionsTest.groovy index 5d22dd8..3b432d3 100644 --- a/src/spec/test/gdk/WorkingWithCollectionsTest.groovy +++ b/src/spec/test/gdk/WorkingWithCollectionsTest.groovy @@ -443,7 +443,7 @@ class WorkingWithCollectionsTest extends GroovyTestCase { void testMapPropertyNotation() { // tag::map_property[] def map = [name: 'Gromit', likes: 'cheese', id: 1234] - assert map.name == 'Gromit' // can be used instead of map.get('Gromit') + assert map.name == 'Gromit' // can be used instead of map.get('name') assert map.id == 1234 def emptyMap = [:] @@ -721,10 +721,12 @@ class WorkingWithCollectionsTest extends GroovyTestCase { text = "nice cheese gromit!" x = text[-1] assert x == "!" + // end::subscript_4[] + // tag::subscript_4a[] def name = text[-7..-2] assert name == "gromit" - // end::subscript_4[] + // end::subscript_4a[] // tag::subscript_5[] text = "nice cheese gromit!"