groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject groovysh and local variables
Date Wed, 24 May 2017 07:49:32 GMT
Hi,

a User on the user-list mentioned it is currently not possible to define 
a local variable in one evaluation and use it in the next. So for example

 > def x = 10

 > println x

this fails because the eval for println x has no knowledge about x=10.

Is this correct, did we have any plans to change this? I mean I know why 
it behaves like that and as a script you would get the same. But in the 
context of groovysh I really wonder if that makes sense. We could 
extract the top level local variables using a transform and make them 
and their values available to the next evaluation

bye Jochen

Mime
View raw message