Re: Function literals can't be class members

2013-07-09 Thread JS
On Monday, 8 July 2013 at 22:41:41 UTC, JS wrote: trying to use a lambda inside a sub template gives an error. mixin template a { template b() { enum b = { }(); } mixin(b!()); } gives the error in the subject, removing the nesting or using a function instead of a lamda

Re: Function literals can't be class members

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 09:44:17 UTC, JS wrote: Anyone have any ideas? Yes and I will answer once you start asking question in D.learn newsgroup.

Re: Function literals can't be class members

2013-07-09 Thread John Colvin
produces no error, yet all are essentially semantically equivalent... just the lamda version requires less typing. (in fact, it would be nice to have a simplification of template b() = { ... }();) This belongs in D.learn. The code you provided is never going to give any Function literals can't

Re: Function literals can't be class members

2013-07-09 Thread JS
On Tuesday, 9 July 2013 at 10:10:10 UTC, Dicebot wrote: On Tuesday, 9 July 2013 at 09:44:17 UTC, JS wrote: Anyone have any ideas? Yes and I will answer once you start asking question in D.learn newsgroup. Thanks... I'll just keep posting in here then...

Re: Function literals can't be class members

2013-07-09 Thread JS
is never going to give any Function literals can't be class members error, although it does have a lot of other things wrong with it. 1) The mixin template has no parameter list. 2) enum b = { }(); isn't valid without a function body. Did you mean (){} ? 3) and it definitely isn't going

Re: Function literals can't be class members

2013-07-09 Thread John Colvin
On Tuesday, 9 July 2013 at 10:45:40 UTC, JS wrote: On Tuesday, 9 July 2013 at 10:10:10 UTC, Dicebot wrote: On Tuesday, 9 July 2013 at 09:44:17 UTC, JS wrote: Anyone have any ideas? Yes and I will answer once you start asking question in D.learn newsgroup. Thanks... I'll just keep posting

Re: Function literals can't be class members

2013-07-09 Thread John Colvin
() = { ... }();) This belongs in D.learn. The code you provided is never going to give any Function literals can't be class members error, although it does have a lot of other things wrong with it. 1) The mixin template has no parameter list. 2) enum b = { }(); isn't valid without a function body. Did you mean

Re: Function literals can't be class members

2013-07-09 Thread Dicebot
On Tuesday, 9 July 2013 at 11:06:22 UTC, John Colvin wrote: P.S. Dicebot's responses to your questions have been by-and-large correct and informative. I'm sure he genuinely means he will try to help you if you post in the correct place. I am always ready to help when it makes sense. But there

Re: Function literals can't be class members

2013-07-09 Thread Joseph Rushton Wakeling
On 07/09/2013 12:45 PM, JS wrote: Thanks... I'll just keep posting in here then... You know, most people, when they get informed there's a dedicated newsgroup/mailing list for language questions, are polite enough to say thank you for the information, and take their question over to the

Re: Function literals can't be class members

2013-07-09 Thread Maxim Fomin
On Tuesday, 9 July 2013 at 10:45:40 UTC, JS wrote: On Tuesday, 9 July 2013 at 10:10:10 UTC, Dicebot wrote: On Tuesday, 9 July 2013 at 09:44:17 UTC, JS wrote: Anyone have any ideas? Yes and I will answer once you start asking question in D.learn newsgroup. Thanks... I'll just keep posting

Function literals can't be class members

2013-07-08 Thread JS
trying to use a lambda inside a sub template gives an error. mixin template a { template b() { enum b = { }(); } mixin(b!()); } gives the error in the subject, removing the nesting or using a function instead of a lamda produces no error, yet all are essentially semantically