Monday, November 27, 2006

Multiline strings in java - more python like

I have modified the python string patch so that the patch
behaves more like python.
r" is now a raw string
ur" is now a string that denotes a raw string with unicode
escape handing.

On a side note, I see that F3 has a JSR222 implemenation,
http://blogs.sun.com/chrisoliver/entry/f3_and_jsr-223
the example given is:
String script =
"import java.util.Date;" +
"import java.lang.System;" +
" " +
"System.out.println(now:Date);";
engine.eval(script);


This could be written a little nicer like (this adds in new lines):
String script = """
import java.util.Date;
import java.lang.System;

System.out.println(now:Date);
""";
engine.eval(script);

No comments: