tag:blogger.com,1999:blog-1368731483244051508.post3178199850552488412..comments2007-06-09T01:09:56.085+10:00Comments on while(nan): Mixins, CTFE and shell-style variable expansionDkhttp://www.blogger.com/profile/02909587337938463354noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1368731483244051508.post-39116304372266639202007-06-09T01:09:00.000+10:002007-06-09T01:09:00.000+10:00Gads man, you're right. I think I missed that sin...Gads man, you're right. I think I missed that since I think of them as being the same thing; silly me. I'll fix that now. Thanks for that.Dkhttp://www.blogger.com/profile/02909587337938463354noreply@blogger.comtag:blogger.com,1999:blog-1368731483244051508.post-51611540163261740172007-06-09T00:55:00.000+10:002007-06-09T00:55:00.000+10:00No, statement mixins (or mixin statements, as the ...No, statement mixins (or mixin statements, as the spec calls them) can only appear where statements are valid. (i.e. anywhere you can call writefln() if std.stdio is imported)<BR/><BR/>Mixin declarations on the other hand are valid anywhere declarations (surprise!) are valid, meaning they can be used to add global variables, functions, unit tests, attribute specifiers, import declarations and lots of other good stuff. Basically anything that can occur directly after a module declaration.<BR/><BR/>Take a look at the <A HREF="http://www.digitalmars.com/d/changelog.html#new1_005" REL="nofollow">changelog entry for DMD 1.005</A>, where string mixins were added. There are clearly 3 types of them defined.Frits van Bommelnoreply@blogger.comtag:blogger.com,1999:blog-1368731483244051508.post-27520277107294737742007-06-08T23:59:00.000+10:002007-06-08T23:59:00.000+10:00Those were "statement mixins" (at least, I sure ho...Those were "<EM>statement mixins</EM>" (at least, I sure hope they are!)Dkhttp://www.blogger.com/profile/02909587337938463354noreply@blogger.comtag:blogger.com,1999:blog-1368731483244051508.post-73982934663981285502007-06-08T23:45:00.000+10:002007-06-08T23:45:00.000+10:00In D, there are actually three different mixins:Yo...<I>In D, there are actually three different mixins:</I><BR/>You missed one: <A HREF="http://www.digitalmars.com/d/module.html#MixinDeclaration" REL="nofollow">mixin declarations</A>.Frits van Bommelnoreply@blogger.com