CTFE and DI: The Crossroads of D

Steven Schveighoffer schveiguy at yahoo.com
Thu May 10 12:12:42 PDT 2012


On Thu, 10 May 2012 14:32:27 -0400, deadalnix <deadalnix at gmail.com> wrote:

> Le 10/05/2012 20:22, Timon Gehr a écrit :
>> On 05/10/2012 08:15 PM, Adam Wilson wrote:
>>> On Thu, 10 May 2012 11:10:15 -0700, David Gileadi
>>> <gileadis at nspmgmail.com> wrote:
>>>
>>>> On 5/10/12 11:01 AM, Adam Wilson wrote:
>>>>> It does require some semantic information. And the solution I've seen
>>>>> seen most talked about here is some kind of attribute similar to  
>>>>> @pure
>>>>> that tells the compiler to include the implementation in the DI file.
>>>>
>>>> I may be off-base here, but this strikes me as a good case for a
>>>> pragma. No?
>>>
>>> Well, it's needs to be at a function level to be useful.
>>>
>>
>> pragmas can apply to declarations.
>>
>> The syntax is
>>
>> pragma(identifier,...) Declaration
>>
>> (Where Declaration can be the empty declaration, ';')
>>
>> pragma(keepImplementation) void foo(){ ... }
>
> You want to specify strip implementation, not keep implementation.

No, it's definitely keep implementation.  By default, I want .di files to  
contain nothing but interface.  If I wanted the source by default, I  
wouldn't be using .di files.

> Strip implementation may break things. Keeping it cannot. The default  
> behavior should be on the safe side of the medal.

Current behavior is junk, there is no reason to save it.

-Steve


More information about the Digitalmars-d mailing list