digitalmars.D - alias have new syntax?
- cmplx (4/4) Jan 18 2014 During the study D, I stumbled upon this design
- cmplx (7/11) Jan 18 2014 Sorry, I wrong :
- Xinok (8/12) Jan 18 2014 It seems that it's documented here, albeit not clearly:
- bearophile (6/10) Jan 18 2014 Yes, it's a recent very small syntax improvement. Eventually I
- Brian Schott (7/12) Jan 18 2014 DScanner now issues a warning when run with the --styleCheck or
- bearophile (6/9) Jan 18 2014 This should be an error in the language. Please add your
- Brian Schott (2/5) Jan 18 2014 I've added my vote.
- bearophile (7/8) Jan 18 2014 A note about your experience is probably more important than the
- Nicolas Sicard (2/12) Jan 19 2014 You meant "alias this".
During the study D, I stumbled upon this design alias myInt = int; but the specification says nothing about such use alias. Is the syntax has been changed?
Jan 18 2014
On Saturday, 18 January 2014 at 22:50:50 UTC, cmplx wrote:During the study D, I stumbled upon this design alias myInt = int; but the specification says nothing about such use alias. Is the syntax has been changed?Sorry, I wrong : AliasDeclaration: .... alias AliasInitializerList AliasInitializer: Identifier = Type
Jan 18 2014
On Saturday, 18 January 2014 at 22:50:50 UTC, cmplx wrote:During the study D, I stumbled upon this design alias myInt = int; but the specification says nothing about such use alias. Is the syntax has been changed?It seems that it's documented here, albeit not clearly: http://dlang.org/declaration.html#AliasInitializer I don't see any mention of it here: http://dlang.org/declaration.html#alias I recall there being some issues with alias this = identifier, not sure if that's been resolved. Regardless, I think the documentation at the latter link needs to be updated.
Jan 18 2014
cmplx:During the study D, I stumbled upon this design alias myInt = int; but the specification says nothing about such use alias. Is the syntax has been changed?Yes, it's a recent very small syntax improvement. Eventually I hope the older syntax will be deprecated. The old syntax is still used for the "static this" in structs. Bye, bearophile
Jan 18 2014
On Saturday, 18 January 2014 at 23:00:11 UTC, bearophile wrote:Yes, it's a recent very small syntax improvement. Eventually I hope the older syntax will be deprecated. The old syntax is still used for the "static this" in structs. Bye, bearophileDScanner now issues a warning when run with the --styleCheck or --syntaxCheck options suggesting that the user switch from "alias a b" to "alias b = a". It also warns on implicit string concatenation, which has saved me a lot of debugging in situations like this: enum someStrings = ["abc", "def" "ghi", "jkl"];
Jan 18 2014
Brian Schott:It also warns on implicit string concatenation, which has saved me a lot of debugging in situations like this: enum someStrings = ["abc", "def" "ghi", "jkl"];This should be an error in the language. Please add your experience (and vote, if you want) to this thread: http://d.puremagic.com/issues/show_bug.cgi?id=3827 Bye, bearophile
Jan 18 2014
On Saturday, 18 January 2014 at 23:13:41 UTC, bearophile wrote:This should be an error in the language. Please add your experience (and vote, if you want) to this thread: http://d.puremagic.com/issues/show_bug.cgi?id=3827I've added my vote.
Jan 18 2014
Brian Schott:I've added my vote.A note about your experience is probably more important than the vote. You can add some bugs you have had to debug, some comment about the frequency of this problem, etc. Bye, bearophile
Jan 18 2014
On Saturday, 18 January 2014 at 23:00:11 UTC, bearophile wrote:cmplx:You meant "alias this".During the study D, I stumbled upon this design alias myInt = int; but the specification says nothing about such use alias. Is the syntax has been changed?Yes, it's a recent very small syntax improvement. Eventually I hope the older syntax will be deprecated. The old syntax is still used for the "static this" in structs. Bye, bearophile
Jan 19 2014