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

Timothee Cour thelastmammoth at gmail.com
Wed Nov 6 12:33:08 PST 2013


On Wed, Nov 6, 2013 at 2:43 AM, Jacob Carlborg <doob at me.com> wrote:

> On 2013-11-05 23:26, Timothee Cour wrote:
>
>> actually an important use case of this feature is to help writing domain
>> specific language inputs, eg writing a python file inside D, or config /
>> plain text files.
>> # is common in many languages (eg python/bash etc) as a comment.
>>
>> @ would be inside string literal so should cause little confusion from
>> D's side, but for example would force one to escape '@' in email
>> addresses (more rare).
>>
>
> If we're talking about writing other languages inside D, then "@" would be
> in conflict with Objective-C which uses that for all new syntax (that isn't
> available in plain C).
>
>
How about parametrizing the escape string:
r{var=@a} //@ by default
r{@}{var=@a} //same as above
r{$}{var=$a} //same as above
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131106/b8cf5279/attachment.html>


More information about the Digitalmars-d mailing list