groovysh null output

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

groovysh null output

Hassan Schroeder-2
Returning to experimenting with Groovy after being sidetracked by
other work, I figured I was pretty downlevel, so I'd better upgrade.
But trying the simple examples to confirm basic operation, I see the
following difference:

/* original install */
Version: 1.0-jsr-02 JVM: 1.5.0_06-b05

groovy> x = ['James', 'Bob', 'Brian']
groovy> x.each { println("hello " + it) }
groovy> go
hello James
hello Bob
hello Brian

groovy>

/* latest install */
Version: 1.0-JSR-06 JVM: 1.5.0_06-b05

groovy> x = ['James', 'Bob', 'Brian']
groovy> x.each { println("hello " + it) }
groovy> go
hello James
hello Bob
hello Brian

===> null

groovy>

What's the '===> null' trying to tell me here?  :-)

TIA!
--
Hassan Schroeder ------------------------ [hidden email]

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: groovysh null output

Guillaume Laforge
Administrator
Type "foo", 1, or any expression as the last statement, and it'll be printed.
That's the return value of the executed script.
You don't need anymore to do a println for the last executed expression.

On 9/9/06, Hassan Schroeder <[hidden email]> wrote:

> Returning to experimenting with Groovy after being sidetracked by
> other work, I figured I was pretty downlevel, so I'd better upgrade.
> But trying the simple examples to confirm basic operation, I see the
> following difference:
>
> /* original install */
> Version: 1.0-jsr-02 JVM: 1.5.0_06-b05
>
> groovy> x = ['James', 'Bob', 'Brian']
> groovy> x.each { println("hello " + it) }
> groovy> go
> hello James
> hello Bob
> hello Brian
>
> groovy>
>
> /* latest install */
> Version: 1.0-JSR-06 JVM: 1.5.0_06-b05
>
> groovy> x = ['James', 'Bob', 'Brian']
> groovy> x.each { println("hello " + it) }
> groovy> go
> hello James
> hello Bob
> hello Brian
>
> ===> null
>
> groovy>
>
> What's the '===> null' trying to tell me here?  :-)
>
> TIA!
> --
> Hassan Schroeder ------------------------ [hidden email]
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>


--
Guillaume Laforge
Groovy Project Manager
http://glaforge.free.fr/blog/groovy

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: groovysh null output

Hassan Schroeder-2
On 9/9/06, Guillaume Laforge <[hidden email]> wrote:
> Type "foo", 1, or any expression as the last statement, and it'll be printed.
> That's the return value of the executed script.

Ah, got it. Thanks!

--
Hassan Schroeder ------------------------ [hidden email]

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email