Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
September 03, 2005 Mixin and variable | ||||
---|---|---|---|---|
| ||||
<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 Re: Mixin and variable | ||||
---|---|---|---|---|
| ||||
Posted in reply to ElfQT Attachments: | 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 Re: Mixin and variable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Thomas Kühne | 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 Re: Mixin and variable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bastiaan Veelo | 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 Re: Mixin and variable | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bastiaan Veelo | 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"...
|
Copyright © 1999-2021 by the D Language Foundation