Thread overview
Mixin and variable
Sep 03, 2005
ElfQT
Sep 04, 2005
Thomas Kühne
Sep 09, 2005
Bastiaan Veelo
Sep 09, 2005
Bastiaan Veelo
Sep 09, 2005
Bastiaan Veelo
September 03, 2005
<output>
Qnittest asm_rand
Qnittest Error: 4invalid UTF-8 sequence
</output>


<code>
private import std.stdio;


int main(char[][] args)
{
    printf("Main\n");
 return 0;
}

unittest
{
 mixin UnittestMixin;

 char[] m_file =  "asm_rand" /*__FILE__*/; char[] m_testcase = "Uff";

 Test1( m_file );
 Test2();

}

template UnittestMixin()
{
 char[] m_file = "xxx";

 void Test1(char[] c)
 {
  writefln("Qnittest %s", c);
 }

 void Test2()
 {
  Unittest.Test(m_file);
 }
}

class Unittest
{
 static void Test(char[] c)
 {
  writefln("Qnittest %s", c);
 }
}
</code>

<comment>
If I use __FILE__ in  a mixin, it will always contain the only one file name
of the mixin declaration, not the place where it is included.
</comment>


September 04, 2005
ElfQT schrieb:
> <output>
> Qnittest asm_rand
> Qnittest Error: 4invalid UTF-8 sequence
> </output>
>
>
> <code>
> private import std.stdio;
>
>
> int main(char[][] args)
> {
>     printf("Main\n");
>  return 0;
> }
>
> unittest
> {
>  mixin UnittestMixin;
>
>  char[] m_file =  "asm_rand" /*__FILE__*/; char[] m_testcase = "Uff";
>
>  Test1( m_file );
>  Test2();
>
> }
>
> template UnittestMixin()
> {
>  char[] m_file = "xxx";
>
>  void Test1(char[] c)
>  {
>   writefln("Qnittest %s", c);
>  }
>
>  void Test2()
>  {
>   Unittest.Test(m_file);
>  }
> }
>
> class Unittest
> {
>  static void Test(char[] c)
>  {
>   writefln("Qnittest %s", c);
>  }
> }
> </code>

Added to DStress as http://dstress.kuehne.cn/run/m/mixin_14_A.d http://dstress.kuehne.cn/run/m/mixin_14_B.d http://dstress.kuehne.cn/run/m/mixin_14_C.d http://dstress.kuehne.cn/run/m/mixin_14_D.d

Thomas
September 09, 2005
Thomas Kühne wrote:
> 
> Added to DStress as
> http://dstress.kuehne.cn/run/m/mixin_14_A.d
> http://dstress.kuehne.cn/run/m/mixin_14_B.d
> http://dstress.kuehne.cn/run/m/mixin_14_C.d
> http://dstress.kuehne.cn/run/m/mixin_14_D.d
> 

What is the difference between A through D? Both A and B (but not C or D) appear on the webpage.

Thanks,
Bastiaan.
September 09, 2005
Bastiaan Veelo wrote:
> Thomas Kühne wrote:
> 
>>
>> Added to DStress as
>> http://dstress.kuehne.cn/run/m/mixin_14_A.d
>> http://dstress.kuehne.cn/run/m/mixin_14_B.d
>> http://dstress.kuehne.cn/run/m/mixin_14_C.d
>> http://dstress.kuehne.cn/run/m/mixin_14_D.d
>>
> 
> What is the difference between A through D? Both A and B (but not C or D) appear on the webpage.
> 
> Thanks,
> Bastiaan.


Sorry, this should have been a reply to "AAs can't contain references to interfaces"...
September 09, 2005
Bastiaan Veelo wrote:
> Thomas Kühne wrote:
> 
>>
>> Added to DStress as
>> http://dstress.kuehne.cn/run/m/mixin_14_A.d
>> http://dstress.kuehne.cn/run/m/mixin_14_B.d
>> http://dstress.kuehne.cn/run/m/mixin_14_C.d
>> http://dstress.kuehne.cn/run/m/mixin_14_D.d
>>
> 
> What is the difference between A through D? Both A and B (but not C or D) appear on the webpage.
> 
> Thanks,
> Bastiaan.

Sorry, this should have been a reply to "AAs can't contain references to interfaces"...