When i try execute the following code, which should just print a slashy string in groovy console version 1.7.4 i get a compilation error:
println /slashy string/
if i change this to:
def s = /slashy string/;
println s
everything is fine and the expected string is printed.
Any ideas what i am doing wrong?
The final gotcha (on the linked doc) says, a slashy string cannot be used with
assert, because of a grammar limitation. Since println is also a part of the grammar (afaik, since its not a classical java function), I would guess this applies here, too.It says to use braces around it:
This worked fine in my groovy shell.