Proposal: Embedded Expressions for String Statements

Schulz, Stefan schulz at e-Spirit.de
Thu Mar 19 01:03:17 PDT 2009


The concat-variant to me is even worse readable than the original +-notation, having three consecutive commas in between.
The proposal already mentions concatenation of any kind as alternative, although not mentioning concat(). Maybe worth expanding.

Stefan

> -----Original Message-----
> From: rssh at gradsoft.com.ua [mailto:rssh at gradsoft.com.ua] 
> Sent: Wednesday, March 18, 2009 8:58 PM
> To: Howard Lovatt
> Cc: coin-dev at openjdk.java.net; Schulz, Stefan
> Subject: Re: Proposal: Embedded Expressions for String Statements
> 
> > I like Stefan's proposed syntax and as a way of a motivating example
> > consider writing a toString method that gives the field 
> values within
> > square brackets, now you would write:
> >
> >     "[" + field1 + ", " + field2 + ", " + field3 + "]"
> >
> > With the proposal you would say:
> >
> >     "[\{field1}, \{field2}, \{field3}]"
> >
> > Which I find clearer.
> >
> 
> Just note: now we can use much cleaner
>  concat( field1, ',' , field2, ',' field3 )
> 
> 
> 
> > Many thanks to Stefan for writing this up formally.
> >
> >
> 
> 
> 
> 



More information about the coin-dev mailing list