[ ArgumentList ] vs. @( ArgumentList )

deadalnix deadalnix at gmail.com
Wed Nov 7 15:10:03 PST 2012


Le 07/11/2012 22:16, Timon Gehr a écrit :
> On 11/07/2012 09:20 PM, Walter Bright wrote:
>> On 11/7/2012 9:00 AM, Timon Gehr wrote:
>>> On 11/06/2012 08:18 PM, Walter Bright wrote:
>>>>
>>>> @( ArgumentList )
>>>>
>>>> ...
>>>
>>> I do not like that one as I already use the syntax.
>>
>> That currently isn't accepted by the D compiler - what are you already
>> using it for?
>
> Text interpolation.
>
> enum d = "c";
>
> mixin(X!"abc@(d)ef"); // -> abccef
>
> I use it mostly for code generation.
>
> mixin(mixin(X!q{
> if(@(a)) @(b);
> }));

This can happen with any syntax addition. I usually use really bizantine 
stuff when I do that (like <{@a@}>) so I'm sure to avoid the issue.

Can't a convention be decided on that ?


More information about the Digitalmars-d mailing list