Proposal: Embedded Expressions for String Statements

Stephen Colebourne scolebourne at joda.org
Sun Mar 15 15:03:05 PDT 2009


Stefan Schulz wrote:
> SIMPLE EXAMPLE:
>    String name = "Dave";
>    System.out.println("Hello, \{name}!");

It shoud be noted that Groovy uses

     "Hello, ${name}!"

and Fan uses

     "Hello, $name!"

For Java, I'd always thought of going down the route of:

     $"Hello, ${name}!"

ie. a $ prefix to the string.

I know why the \{ notation is used, I ust think that staying in line 
with other close relative languages is important too.


Jeremy Manson wrote:
 > I'm sure this is obvious to everyone who isn't me, but I'm not sure
 > what the big win is here.  Basically, it looks to me as if you save a
 > very small number of keystrokes:

IMO, its a lot more readable.

Stephen



More information about the coin-dev mailing list