proposal: a new string litteral to embed variables in a string

Timothee Cour thelastmammoth at gmail.com
Thu Oct 31 14:47:43 PDT 2013


$ is another obvious choice (eg in shell expansion)
but # could also be good as it's very much unused in D.


On Thu, Oct 31, 2013 at 2:37 PM, Jacob Carlborg <doob at me.com> wrote:

> On 2013-10-31 22:24, Timothee Cour wrote:
>
>> the proposed new syntax
>> r{var1=@a; and var2=@foo}
>>
>> is replaced by a tuple:
>> ("var1=", a, "; and var2=", foo)
>> where @ denotes escaping symbols.
>>
>> @ itself be escaped with \@.
>>
>> optionally, expressions can be incorporated:
>> r{a2=@(a*2); and fooU=@(foo.toUpper)}
>>
>
> Would @ be the best symbol for this. It might get confusing with UDA's.
>
> --
> /Jacob Carlborg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131031/fccb86bc/attachment.html>


More information about the Digitalmars-d mailing list