www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D mixin expansion too verbose

This is just about 1/100th of what is output for a near empty 
project:


// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HHOOK;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HGLOBAL;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HLOCAL;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* GLOBALHANDLE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* LOCALHANDLE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HGDIOBJ;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HACCEL;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HBITMAP;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HBRUSH;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HCOLORSPACE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HDC;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HGLRC;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HDESK;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HENHMETAFILE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HFONT;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HICON;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HINSTANCE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HKEY;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HMENU;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HMETAFILE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HMODULE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HMONITOR;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HPALETTE;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HPEN;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HRGN;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HRSRC;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HSTR;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HTASK;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HWND;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HWINSTA;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HKL;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HCURSOR;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HTERMINAL;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\basetsd.d(48)
alias void* HWINEVENTHOOK;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\druntime\import\core\sys\windows\w32api.d(90)
alias STARTUPINFOW STARTUPINFO;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\bitmanip.d(740)
private uint _fraction_exponent_sign; property uint fraction() 
 safe pure nothrow  nogc const { auto result = 
(_fraction_exponent_sign & 8388607U) >>0U; return cast(uint) 
result;}
 property void fraction(uint v)  safe pure nothrow  nogc { 
assert(v >= fraction_min, "Value is smaller than the minimum 
value of bitfield 'fraction'"); assert(v <= fraction_max, "Value 
is greater than the maximum value of bitfield 'fraction'"); 
_fraction_exponent_sign = cast(typeof(_fraction_exponent_sign)) 
((_fraction_exponent_sign & 
(-1-cast(typeof(_fraction_exponent_sign))8388607U)) | 
((cast(typeof(_fraction_exponent_sign)) v << 0U) & 8388607U));}
enum uint fraction_min = cast(uint)0U;  enum uint fraction_max = 
cast(uint)8388607U;  property ubyte exponent()  safe pure nothrow 
 nogc const { auto result = (_fraction_exponent_sign & 
2139095040U) >>23U; return cast(ubyte) result;}
 property void exponent(ubyte v)  safe pure nothrow  nogc { 
assert(v >= exponent_min, "Value is smaller than the minimum 
value of bitfield 'exponent'"); assert(v <= exponent_max, "Value 
is greater than the maximum value of bitfield 'exponent'"); 
_fraction_exponent_sign = cast(typeof(_fraction_exponent_sign)) 
((_fraction_exponent_sign & 
(-1-cast(typeof(_fraction_exponent_sign))2139095040U)) | 
((cast(typeof(_fraction_exponent_sign)) v << 23U) & 
2139095040U));}
enum ubyte exponent_min = cast(ubyte)0U;  enum ubyte exponent_max 
= cast(ubyte)255U;  property bool sign()  safe pure nothrow  nogc 
const { return (_fraction_exponent_sign & 2147483648U) != 0;}
 property void sign(bool v)  safe pure nothrow  nogc { if (v) 
_fraction_exponent_sign |= 2147483648U;else 
_fraction_exponent_sign &= 
cast(typeof(_fraction_exponent_sign))(-1-cast(typeof(_fraction_exponent_sign))2147483648U);}

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\bitmanip.d(821)
private ulong _fraction_exponent_sign; property ulong fraction() 
 safe pure nothrow  nogc const { auto result = 
(_fraction_exponent_sign & 4503599627370495UL) >>0U; return 
cast(ulong) result;}
 property void fraction(ulong v)  safe pure nothrow  nogc { 
assert(v >= fraction_min, "Value is smaller than the minimum 
value of bitfield 'fraction'"); assert(v <= fraction_max, "Value 
is greater than the maximum value of bitfield 'fraction'"); 
_fraction_exponent_sign = cast(typeof(_fraction_exponent_sign)) 
((_fraction_exponent_sign & 
(-1-cast(typeof(_fraction_exponent_sign))4503599627370495UL)) | 
((cast(typeof(_fraction_exponent_sign)) v << 0U) & 
4503599627370495UL));}
enum ulong fraction_min = cast(ulong)0U;  enum ulong fraction_max 
= cast(ulong)4503599627370495UL;  property ushort exponent() 
 safe pure nothrow  nogc const { auto result = 
(_fraction_exponent_sign & 9218868437227405312UL) >>52U; return 
cast(ushort) result;}
 property void exponent(ushort v)  safe pure nothrow  nogc { 
assert(v >= exponent_min, "Value is smaller than the minimum 
value of bitfield 'exponent'"); assert(v <= exponent_max, "Value 
is greater than the maximum value of bitfield 'exponent'"); 
_fraction_exponent_sign = cast(typeof(_fraction_exponent_sign)) 
((_fraction_exponent_sign & 
(-1-cast(typeof(_fraction_exponent_sign))9218868437227405312UL)) 
| ((cast(typeof(_fraction_exponent_sign)) v << 52U) & 
9218868437227405312UL));}
enum ushort exponent_min = cast(ushort)0U;  enum ushort 
exponent_max = cast(ushort)2047U;  property bool sign()  safe 
pure nothrow  nogc const { return (_fraction_exponent_sign & 
9223372036854775808UL) != 0;}
 property void sign(bool v)  safe pure nothrow  nogc { if (v) 
_fraction_exponent_sign |= 9223372036854775808UL;else 
_fraction_exponent_sign &= 
cast(typeof(_fraction_exponent_sign))(-1-cast(typeof(_fraction_exponent_sign))9223372036854775808UL);}

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\format.d(1128)
private ubyte 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_; property bool 
flDash()  safe pure nothrow  nogc const { return 
(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 1U) != 0;}
 property void flDash(bool v)  safe pure nothrow  nogc { if (v) 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 1U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))1U);}
 property bool flZero()  safe pure nothrow  nogc const { return 
(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 2U) != 0;}
 property void flZero(bool v)  safe pure nothrow  nogc { if (v) 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 2U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))2U);}
 property bool flSpace()  safe pure nothrow  nogc const { return 
(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 4U) != 0;}
 property void flSpace(bool v)  safe pure nothrow  nogc { if (v) 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 4U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))4U);}
 property bool flPlus()  safe pure nothrow  nogc const { return 
(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 8U) != 0;}
 property void flPlus(bool v)  safe pure nothrow  nogc { if (v) 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 8U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))8U);}
 property bool flHash()  safe pure nothrow  nogc const { return 
(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 16U) != 0;}
 property void flHash(bool v)  safe pure nothrow  nogc { if (v) 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 16U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))16U);}
 property bool flSeparator()  safe pure nothrow  nogc const { 
return (_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ & 32U) 
!= 0;}
 property void flSeparator(bool v)  safe pure nothrow  nogc { if 
(v) _flDash_flZero_flSpace_flPlus_flHash_flSeparator_ |= 32U;else 
_flDash_flZero_flSpace_flPlus_flHash_flSeparator_ &= 
cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))(-1-cast(typeof(_flDash_flZero_flSpace_flPlus_flHash_flSeparator_))32U);}

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(469)
a < b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(472)
a < b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(443)
cast(T)a < cast(T) b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(469)
a < b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(472)
a < b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(213)
alias a = __a ;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(214)
alias b = __b ;

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\functional.d(215)
a == b

// expansion at 
C:\D\dmd-2.086.1\windows\bin\..\..\src\phobos\std\uni.d(6999)

             static if (getValue)
                 grapheme ~= ch;





It makes it hard to find one's own mixins in the output.

2 suggestions:

1. consolidate outputs, this should reduce the file size by over 
50%!!!
2. Ignore phobos mixins(rarely will one need to see the output of 
phobos mixins as they are generally going to be valid)

Of course, these could be optional.

Also, one gets a lot like


// expansion at
size_t h = 0;foreach (i, T; typeof(p.tupleof))    static if(is(T* 
: const(.object.Object)*))         h = h * 33 + 
typeid(const(.object.Object)).getHash(cast(const 
void*)&p.tupleof[i]);    else         h = h * 33 + 
typeid(T).getHash(cast(const void*)&p.tupleof[i]);return h;

// expansion at
size_t h = 0;foreach (i, T; typeof(p.tupleof))    static if(is(T* 
: const(.object.Object)*))         h = h * 33 + 
typeid(const(.object.Object)).getHash(cast(const 
void*)&p.tupleof[i]);    else         h = h * 33 + 
typeid(T).getHash(cast(const void*)&p.tupleof[i]);return h;

// expansion at
size_t h = 0;foreach (i, T; typeof(p.tupleof))    static if(is(T* 
: const(.object.Object)*))         h = h * 33 + 
typeid(const(.object.Object)).getHash(cast(const 
void*)&p.tupleof[i]);    else         h = h * 33 + 
typeid(T).getHash(cast(const void*)&p.tupleof[i]);return h;


"expansion at"??????? Where is it?
Jun 22 2019