on the length of symbols

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue May 12 13:35:11 PDT 2015


On 05/12/2015 07:58 AM, Martin Nowak wrote:
> On Monday, 11 May 2015 at 21:18:53 UTC, Walter Bright wrote:
>> D already does (for Win32) a generic compression on names. It works a
>> lot better than poorly reinventing compression - it's far less
>> complex, less buggy, easier to implement, etc.
>>
>> I'd support adding a Win32-like compressor. The change I'd make is
>> having it only use identifier characters for the compressed result.
>
> Yeah, that would solve the problem.
> https://github.com/D-Programming-Language/dmd/blob/932e0a5c2f73b410f0a61ad721e78870ecf17510/src/backend/cgobj.c#L3760
>

Not really.

struct Kill(S,T){}

template Instantiate(size_t n){
     static if(!n) alias Instantiate=Kill!(int,int);
     else{
         alias other=Instantiate!(n-1);
         alias Instantiate=Kill!(other,other);
     }
}

void main(){ Instantiate!100 s; }

This should compile instantaneously and without errors.


More information about the Digitalmars-d mailing list