digitalmars.D - macro keyword taken?
- Andrej Mitrovic <andrej.mitrovich gmail.com> Aug 07 2011
- Robert Clipsham <robert octarineparrot.com> Aug 07 2011
- Andrej Mitrovic <andrej.mitrovich gmail.com> Aug 08 2011
- bearophile <bearophileHUGS lycos.com> Aug 08 2011
So I wanted to make myself a template called "macro", but it turns out
it's a keyword:
template macro()
{
}
test.d(7): TemplateIdentifier expected following template
test.d(7): Declaration expected, not 'macro'
Is there something planned with this keyword?
Aug 07 2011
On 07/08/2011 23:59, Andrej Mitrovic wrote:So I wanted to make myself a template called "macro", but it turns out it's a keyword: template macro() { } test.d(7): TemplateIdentifier expected following template test.d(7): Declaration expected, not 'macro' Is there something planned with this keyword?
It was originally going to be used in D2 for AST macros, however it was found that string mixins (an already existing feature) were already as powerful as the proposed AST macros. As such, the keyword is reserved for future use, possibly in D3 once the details have been reconsidered. There's a video lying around somewhere of Walter presenting what would have been macros somewhere if you're interested. -- Robert http://octarineparrot.com/
Aug 07 2011
On 08-08-2011 01:07, Robert Clipsham wrote:On 07/08/2011 23:59, Andrej Mitrovic wrote:So I wanted to make myself a template called "macro", but it turns out it's a keyword: template macro() { } test.d(7): TemplateIdentifier expected following template test.d(7): Declaration expected, not 'macro' Is there something planned with this keyword?
It was originally going to be used in D2 for AST macros, however it was found that string mixins (an already existing feature) were already as powerful as the proposed AST macros. As such, the keyword is reserved for future use, possibly in D3 once the details have been reconsidered. There's a video lying around somewhere of Walter presenting what would have been macros somewhere if you're interested.
Would you happen to have a link? My Google-fu seems to be weak today. - Alex
Aug 08 2011
I think he means the "The Future of D" videos found here: http://prowiki.org/wiki4d/wiki.cgi?Videos What I'm wondering about is whether something like this is still planned though. I don't mind the keyword being taken that much.
Aug 08 2011
Andrej Mitrovic:What I'm wondering about is whether something like this is still planned though. I don't mind the keyword being taken that much.
Like "goto" keyword in Java :o) Bye, bearophile
Aug 08 2011









=?ISO-8859-1?Q?Alex_R=F8nne_Petersen?= <xtzgzorex gmail.com> 