digitalmars.D.bugs - recursive template sends dmd on vacation...
- Regan Heath (24/24) Mar 30 2005 --[test34.d]--
- Regan Heath (5/28) Mar 30 2005 I forgot to say, at this point dmd continues to run, use cpu/memory and ...
- Thomas Kuehne (12/16) Mar 31 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Thomas Kuehne (12/43) Apr 27 2005 -----BEGIN PGP SIGNED MESSAGE-----
- Walter (21/44) May 09 2005 The recursive problem is now fixed, but the example isn't syntactically
- Sean Kelly (5/7) May 10 2005 Related question--what is the recursion limit for template code? Is it
--[test34.d]-- import std.stdio; template Blah(int a, alias B) { mixin Blah!(a-1, B); } template Blah(int a:0, alias B) { writefln(B); } void main() { int a; mixin Blah!(5,a); } C:\Library\D\src\temp>dmd test34.d test34.d(5): mixin test34.main.Blah!(5,a) Blah__5__10__Dmain1ai.Blah!(...) Blah_ _4__10__Dmain1ai.Blah!(3,a) Blah__3__10__Dmain1ai.Blah!(2,a) Blah__2__10__Dmain1 ai.Blah!(1,a) Blah__1__10__Dmain1ai.Blah!(0,a) matches more than one template de claration Regan
Mar 30 2005
On Wed, 30 Mar 2005 22:23:46 +1200, Regan Heath <regan netwin.co.nz> wrote:--[test34.d]-- import std.stdio; template Blah(int a, alias B) { mixin Blah!(a-1, B); } template Blah(int a:0, alias B) { writefln(B); } void main() { int a; mixin Blah!(5,a); } C:\Library\D\src\temp>dmd test34.d test34.d(5): mixin test34.main.Blah!(5,a) Blah__5__10__Dmain1ai.Blah!(...) Blah_ _4__10__Dmain1ai.Blah!(3,a) Blah__3__10__Dmain1ai.Blah!(2,a) Blah__2__10__Dmain1 ai.Blah!(1,a) Blah__1__10__Dmain1ai.Blah!(0,a) matches more than one template de clarationI forgot to say, at this point dmd continues to run, use cpu/memory and does not come back.. at least for as long as I cared to wait which was a minute or two. Regan
Mar 30 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Regan Heath schrieb am Wed, 30 Mar 2005 22:37:20 +1200:On Wed, 30 Mar 2005 22:23:46 +1200, Regan Heath <regan netwin.co.nz> wrote:<snip>I forgot to say, at this point dmd continues to run, use cpu/memory and does not come back.. at least for as long as I cared to wait which was a minute or two.Is there any way to call a programm with a given cycle-limit instead of the setitimer kludge? Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCTJP23w+/yD4P9tIRAiH4AKDBAzuC9tpgf7sXrXXhxvvfsKpXgQCgjezC 2tb/Un5E191UGt4vFH7Q8CM= =JjOi -----END PGP SIGNATURE-----
Mar 31 2005
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Regan Heath schrieb am Wed, 30 Mar 2005 22:37:20 +1200:On Wed, 30 Mar 2005 22:23:46 +1200, Regan Heath <regan netwin.co.nz> wrote:I finally added the time-out code to DStress. http://dstress.kuehne.cn/nocompile/bug_20050330_A.d http://dstress.kuehne.cn/run/bug_20050330_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFCb4Sz3w+/yD4P9tIRAtq8AJ0UrRkZQ4tPOIurI4Cb0gbdT9L0TACguSv0 U7ZcP7lEWypY3lgT75bVWdw= =SQgO -----END PGP SIGNATURE-------[test34.d]-- import std.stdio; template Blah(int a, alias B) { mixin Blah!(a-1, B); } template Blah(int a:0, alias B) { writefln(B); } void main() { int a; mixin Blah!(5,a); } C:\Library\D\src\temp>dmd test34.d test34.d(5): mixin test34.main.Blah!(5,a) Blah__5__10__Dmain1ai.Blah!(...) Blah_ _4__10__Dmain1ai.Blah!(3,a) Blah__3__10__Dmain1ai.Blah!(2,a) Blah__2__10__Dmain1 ai.Blah!(1,a) Blah__1__10__Dmain1ai.Blah!(0,a) matches more than one template de clarationI forgot to say, at this point dmd continues to run, use cpu/memory and does not come back.. at least for as long as I cared to wait which was a minute or two.
Apr 27 2005
"Regan Heath" <regan netwin.co.nz> wrote in message news:opsof4hwgy23k2f5 nrage.netwin.co.nz...--[test34.d]-- import std.stdio; template Blah(int a, alias B) { mixin Blah!(a-1, B); } template Blah(int a:0, alias B) { writefln(B); } void main() { int a; mixin Blah!(5,a); } C:\Library\D\src\temp>dmd test34.d test34.d(5): mixin test34.main.Blah!(5,a) Blah__5__10__Dmain1ai.Blah!(...) Blah_ _4__10__Dmain1ai.Blah!(3,a) Blah__3__10__Dmain1ai.Blah!(2,a) Blah__2__10__Dmain1 ai.Blah!(1,a) Blah__1__10__Dmain1ai.Blah!(0,a) matches more than one template de clarationThe recursive problem is now fixed, but the example isn't syntactically correct. This works: import std.stdio; template Blah(int a, alias B) { mixin Blah!(a-1, B); } template Blah(int a:0, alias B) { void foo() { writefln(B); } } void main() { int a = 3; mixin Blah!(5,a); foo(); }
May 09 2005
In article <d5pg0t$dqt$1 digitaldaemon.com>, Walter says...The recursive problem is now fixed, but the example isn't syntactically correct.Related question--what is the recursion limit for template code? Is it something I could theoretically run up against calculating Fibonacci numbers at compile-time or anything like that? Sean
May 10 2005