jastrachan | 16 Apr 19:19 2004

Re: my wish-list additions

On 8 Apr 2004, at 22:01, John Stump wrote:
> Hello, I'm on my second day of learning groovy, and I am quite
> impressed. I have devoured the web site's users guide and most
> of the mailing list archives.
> So here are some items for my groovy wishlist:
> 1) Change some of the names:
> "Closures" -> "anonymous functions"

Its mostly the capture of local variable that makes them different from 
anonymous functions - they are like anonymous functions, just a little 

> "def" -> "function"
> "Groovy" -> "Tea", a more light and sophisticated beverage than
> java (as in coffee).
> 2) add an eval command. This is a scripting language, fer
> cris'sakes. While you're at it, add a load/source command to
> eval the contents of a file in the current context.

Have you seen the GroovyShell class which has an evaluate() method?

Or inside a script you can now do

a = 1
evaluate("a = 3")
assert a == 3

evaluate(new File("foo/bar/whatnot.groovy"))

> 3) Keep semicolons *optional*, despite the many grumblings out
> there. Scripting languages should not require semis.


> 4) In addition to java.lang.String having an execute() method, I
> would like to see this method also on String[] (so we can use
> the exec(String[]) form when there are problems with parameter
> parsing).

Why not just pass all the arguments in as one string...

"ls -al *.foo".execute()

Incidentally we might wanna support the `` notation for neater 
integration with processes...


out << "files are `ls -l *.foo` and the time is `date`"

> I'm sure more will come to me as I port a lengthy javascript
> "application" to groovy.
> Good work to all involved on groovy!