From fff6f8c57ac57999c5efe70650fcd5592a2348f7 Mon Sep 17 00:00:00 2001 From: Erik Reinecke Date: Sun, 7 Jun 2015 12:06:05 -0500 Subject: Corrected link to Groovy documentatin --- groovy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index 8fb1b346..629b6d18 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -405,7 +405,7 @@ assert sum(2,5) == 7 ## Further resources -[Groovy documentation](http://groovy.codehaus.org/Documentation) +[Groovy documentation](http://www.groovy-lang.org/documentation.html) [Groovy web console](http://groovyconsole.appspot.com/) -- cgit v1.2.3 From 302723b2c5c964d805cfafefdc40924df31dd9d0 Mon Sep 17 00:00:00 2001 From: Todd Gao Date: Tue, 16 Jun 2015 22:42:55 +0800 Subject: update the groovy web site link in some docs --- groovy.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index 629b6d18..519f36ce 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -6,7 +6,7 @@ contributors: filename: learngroovy.groovy --- -Groovy - A dynamic language for the Java platform [Read more here.](http://groovy.codehaus.org) +Groovy - A dynamic language for the Java platform [Read more here.](http://www.groovy-lang.org/) ```groovy @@ -231,7 +231,7 @@ for ( e in map ) { Operators Operator Overloading for a list of the common operators that Groovy supports: - http://groovy.codehaus.org/Operator+Overloading + http://www.groovy-lang.org/operators.html#Operator-Overloading Helpful groovy operators */ @@ -249,7 +249,7 @@ def username = user?.username A Groovy Closure is like a "code block" or a method pointer. It is a piece of code that is defined and then executed at a later point. - More info at: http://groovy.codehaus.org/Closures+-+Formal+Definition + More info at: http://www.groovy-lang.org/closures.html */ //Example: def clos = { println "Hello World!" } @@ -409,7 +409,7 @@ assert sum(2,5) == 7 [Groovy web console](http://groovyconsole.appspot.com/) -Join a [Groovy user group](http://groovy.codehaus.org/User+Groups) +Join a [Groovy user group](http://www.groovy-lang.org/usergroups.html) ## Books -- cgit v1.2.3 From d810a71b76892aef7404293d6fe4bec3b9dbb31e Mon Sep 17 00:00:00 2001 From: Ribeiro Date: Tue, 6 Oct 2015 15:09:29 -0300 Subject: Added The Elvis Operator to Groovy docs --- groovy.html.markdown | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index 519f36ce..c80fcc89 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -200,6 +200,14 @@ def y = 10 def x = (y > 1) ? "worked" : "failed" assert x == "worked" +//Groovy supports 'The Elvis Operator' too! +//Instead of using the ternary operator: + +displayName = user.name ? user.name : 'Anonymous' + +//We can write like this: +displayName = user.name ?: 'Anonymous' + //For loop //Iterate over a range def x = 0 @@ -422,6 +430,3 @@ Join a [Groovy user group](http://www.groovy-lang.org/usergroups.html) [1] http://roshandawrani.wordpress.com/2010/10/18/groovy-new-feature-closures-can-now-memorize-their-results/ [2] http://www.solutionsiq.com/resources/agileiq-blog/bid/72880/Programming-with-Groovy-Trampoline-and-Memoize [3] http://mrhaki.blogspot.mx/2011/05/groovy-goodness-cache-closure-results.html - - - -- cgit v1.2.3 From 35ba352668f67de95e0dca7c2f1a284f5fa453b2 Mon Sep 17 00:00:00 2001 From: Geovanny Ribeiro Date: Tue, 6 Oct 2015 16:49:21 -0300 Subject: Update groovy.html.markdown --- groovy.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index c80fcc89..492c1ba2 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -99,7 +99,7 @@ technologies.sort() // To sort without mutating original, you can do: sortedTechnologies = technologies.sort( false ) -/*** Manipulating Lists ***/ +/*** Manipulating Lists ***/e //Replace all elements in the list Collections.replaceAll(technologies, 'Gradle', 'gradle') @@ -205,7 +205,7 @@ assert x == "worked" displayName = user.name ? user.name : 'Anonymous' -//We can write like this: +//We can write it: displayName = user.name ?: 'Anonymous' //For loop -- cgit v1.2.3 From 8bc9ebe08d792f560939db1e39077c800d15497b Mon Sep 17 00:00:00 2001 From: Mario Martinez Date: Fri, 11 Dec 2015 11:01:23 -0600 Subject: Updated to sdkman instead of GVM for installing groovy --- groovy.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index 8fb1b346..37e3b20c 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -13,8 +13,8 @@ Groovy - A dynamic language for the Java platform [Read more here.](http://groov /* Set yourself up: - 1) Install GVM - http://gvmtool.net/ - 2) Install Groovy: gvm install groovy + 1) Install SDKMAN - http://sdkman.io/ + 2) Install Groovy: sdk install groovy 3) Start the groovy console by typing: groovyConsole */ -- cgit v1.2.3 From 1d785f8e84fd5eb0dbf6b6df28044568739684fd Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Mon, 15 Feb 2016 11:03:10 -0800 Subject: memoize not memorize Let's use the correct term instead of the tongue-in-cheek term denoting the same concept. --- groovy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index ea575248..94678c39 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -280,7 +280,7 @@ def clos = { print it } clos( "hi" ) /* - Groovy can memorize closure results [1][2][3] + Groovy can memoize closure results [1][2][3] */ def cl = {a, b -> sleep(3000) // simulate some time consuming processing -- cgit v1.2.3 From 4ba201c541fb00029be1b6d245be7b4204dccf6c Mon Sep 17 00:00:00 2001 From: Jhoon Saravia Date: Fri, 27 May 2016 02:30:17 -0700 Subject: [groovy/es] Groovy translated to Spanish (#1791) * Fix extra character on Groovy documentation * Translate Groovy to Spanish --- groovy.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index 94678c39..a3a45757 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -99,7 +99,7 @@ technologies.sort() // To sort without mutating original, you can do: sortedTechnologies = technologies.sort( false ) -/*** Manipulating Lists ***/e +/*** Manipulating Lists ***/ //Replace all elements in the list Collections.replaceAll(technologies, 'Gradle', 'gradle') -- cgit v1.2.3 From 9afd4fd1bd7ea9fb32dd3957c07380d3879da753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=81opusza=C5=84ski?= Date: Wed, 4 Oct 2017 16:15:38 +0200 Subject: [groovy] small fix in iteration over a map --- groovy.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'groovy.html.markdown') diff --git a/groovy.html.markdown b/groovy.html.markdown index a3a45757..efbb2b32 100644 --- a/groovy.html.markdown +++ b/groovy.html.markdown @@ -230,10 +230,12 @@ for (i in array) { //Iterate over a map def map = ['name':'Roberto', 'framework':'Grails', 'language':'Groovy'] -x = 0 +x = "" for ( e in map ) { x += e.value + x += " " } +assert x.equals("Roberto Grails Groovy ") /* Operators -- cgit v1.2.3