Proposal: Embedded Expressions for String Statements
Stefan Schulz
schulz at e-spirit.de
Sun Mar 15 15:18:48 PDT 2009
Stephen Colebourne schrieb:
> 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!"
Right, I mentioned some related languages having this feature in the
proposal (Fan is not one of them, yet). The $-notation is quite common,
but I did not want to introduce yet another notation for the String
itself (e.g. $") that switches the meaning of a String with a single
character upfront. After all, the proposal is not that much about the
notation but the feature, so that's up for revisions.
If one goes for distinguishing new Strings that provide this (and/or
other) features from old style, I'd rather go the full line like using a
backtick (backquote) or similar.
Stefan
More information about the coin-dev
mailing list