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

Timothee Cour thelastmammoth at gmail.com
Wed Nov 6 12:24:07 PST 2013


On Wed, Nov 6, 2013 at 10:49 AM, Dmitry Olshansky <dmitry.olsh at gmail.com>wrote:

> 06-Nov-2013 21:40, Manu пишет:
>
>> On 7 November 2013 03:14, Dmitry Olshansky <dmitry.olsh at gmail.com
>> <mailto:dmitry.olsh at gmail.com>> wrote:
>>
>>     06-Nov-2013 15:45, Dicebot пишет:
>>
>>         Reasonable proposal but I have not encountered much need in this
>>         functionality personally (std.string.format worked just fine)
>>         and thus
>>         can't really evaluate how justified such addition may be.
>>
>>
>>     +1
>>
>>     Since formatting/templates became accessible in CTFE I do not see
>>     much need for this.
>>
>>
>> Every time I use a q{} block, it's to embed some code in a different
>> language. I would like the IDE to syntax hilight properly if able.
>> HLSL/GLSL, JSON, XML are the most common embedded languages I encounter.
>>
>
> Depending on editor/IDE a decent macro/extension would detect specific
> function before the q{}. Say:
> hlsl!q{
>
> };
>
> And highlight it as appropriate.
>
> I think it's customary for good editors to highlight parts of code based
> on different scheme (say PHP/JS mixed in the HTML highlights just fine). So
> the basic blocks must be there already.
>
> All in all it's hardly a good thing to trade a language feature *only* to
> help people give "hints" to IDEs (which they may as well ignore).


the proposal in the OT is not about syntax highlight hints, it's about
embedding variables in string literals.


>
>
> --
> Dmitry Olshansky
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131106/3189ef00/attachment.html>


More information about the Digitalmars-d mailing list