groovy/groovy-core — pull request #355 by tkruse (2014-03-16 19:00:57+00:00)
Title: [GROOVY-6623] Interpreter mode for groovysh, with caveats

Now works:

groovy:000> def x = 3
===> 3
groovy:000> x
Unknown property: x
groovy:000> :set interpreterMode true
groovy:000> def x = 3
===> 3
groovy:000> x
===> 3

Now fails (Type/method declaration on same line as statement):

x = 3; class Foo{}
x = 3; def foo() {}