Re: What happened to the alias this = identifier syntax in 2.062?

2014-09-12 Thread eles via Digitalmars-d
On Friday, 22 February 2013 at 16:47:58 UTC, deadalnix wrote: On Friday, 22 February 2013 at 15:31:43 UTC, Martin wrote: On Friday, 22 February 2013 at 15:07:29 UTC, deadalnix wrote: On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote: On Friday, 22 February 2013 at 14:55:19 UTC, bearophi

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-23 Thread deadalnix
On Saturday, 23 February 2013 at 09:24:20 UTC, Jonathan M Davis wrote: alias this is supposed to completely replace opDot, and it's far more flexible than opDot, so there's really no reason to have opDot anymore. For whatever reason, opDot doesn't appear to have been actually deprecated yet, bu

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-23 Thread Jonathan M Davis
On Saturday, February 23, 2013 09:47:54 Chris Nicholson-Sauls wrote: > On Friday, 22 February 2013 at 21:23:04 UTC, Timon Gehr wrote: > > I guess the main issue is that alias blah this; shouldn't have > > made it into the grammar in the first place. But this was > > obviously done in order to estab

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-23 Thread Chris Nicholson-Sauls
On Friday, 22 February 2013 at 21:23:04 UTC, Timon Gehr wrote: I guess the main issue is that alias blah this; shouldn't have made it into the grammar in the first place. But this was obviously done in order to establish a broken analogy to the other uses of alias. Either alias this=blah; must

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Joshua Niehus
didn't fully formulate that thought: above examples vs. the following struct Fraction { long numerator; long denominator; double value() const @property { return cast(double)numerator / denominator; } auto opPseudonym() { /* points to value() ? */ } alias op

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Joshua Niehus
On Friday, 22 February 2013 at 23:20:55 UTC, Timon Gehr wrote: auto opPseudonym() { ... } alias opPseudonym=foo; Isn't that creating multiple functions for the same thing? struct Fraction { long numerator; long denominator; double value() const @property { return ca

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Timon Gehr
On 02/23/2013 12:10 AM, Joshua Niehus wrote: On Friday, 22 February 2013 at 21:23:04 UTC, Timon Gehr wrote: [snip].. or the alias this syntax should be deprecated in favour of a specially named member function. pseudonym foo; auto opPseudonym() { ... } alias opPseudonym=foo;

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Joshua Niehus
On Friday, 22 February 2013 at 21:23:04 UTC, Timon Gehr wrote: [snip].. or the alias this syntax should be deprecated in favour of a specially named member function. pseudonym foo;

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Michael
There is no justification for this. I guess the main issue is that alias blah this; shouldn't have made it into the grammar in the first place. But this was obviously done in order to establish a broken analogy to the other uses of alias. Either alias this=blah; must be kept or the alias this

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Timon Gehr
On 02/22/2013 07:30 PM, Marco Leise wrote: Am Fri, 22 Feb 2013 09:38:48 -0800 schrieb Ali Çehreli : I appreciate everybody's contributions to D but that is not an intention, that is a change to dmd that caused a regression. A syntax that used to work in the previous version simply stopped worki

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Timon Gehr
On 02/22/2013 03:51 PM, Martin wrote: struct Test { int i; alias this = i; } Worked fine in 2.061 but in 2.062 I get the errors "Error: no identifier for declarator this" and "Error: alias cannot have initializer". Was something changed intentionally or is this a bug? It is (embarra

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Michael
Was something changed intentionally or is this a bug? It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases. Bye, bearophile I see, thanks. What was the reason for not allowing alias this = identifier? Requiring lookahead when parsing. Al

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Andrej Mitrovic
On 2/22/13, Marco Leise wrote: > That said I started using "alias this = ..." as well and was > surprised it was removed, but noticed it in time as a DFeed > line on IRC. It will be documented in the changelog once https://github.com/D-Programming-Language/d-programming-language.org/pull/284 is p

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Marco Leise
Am Fri, 22 Feb 2013 09:38:48 -0800 schrieb Ali Çehreli : > I appreciate everybody's contributions to D but that is not an > intention, that is a change to dmd that caused a regression. A syntax > that used to work in the previous version simply stopped working in > 2.062. That is the definition

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Ali Çehreli
On 02/22/2013 09:27 AM, Ali Çehreli wrote: On 02/22/2013 09:08 AM, Ali Çehreli wrote: On 02/22/2013 06:55 AM, bearophile wrote: > Martin: > >> Was something changed intentionally or is this a bug? > > It was changed intentionally, but only for alias this. That syntax is > allowed still for other

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread deadalnix
On Friday, 22 February 2013 at 17:38:49 UTC, Ali Çehreli wrote: I appreciate everybody's contributions to D but that is not an intention, that is a change to dmd that caused a regression. A syntax that used to work in the previous version simply stopped working in 2.062. That is the definition

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Rob T
On Friday, 22 February 2013 at 17:38:49 UTC, Ali Çehreli wrote: I have a feeling that there must have been some newsgroup discussions as well but unfortunately I must have been busy with other things at the time. Not all of us read github. Ali You should not have to, and this is a problem w

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Ali Çehreli
On 02/22/2013 09:28 AM, kenji hara wrote: > 2013/2/23 Ali Çehreli > >> On 02/22/2013 06:55 AM, bearophile wrote: >>> Martin: >>> Was something changed intentionally or is this a bug? >>> >>> It was changed intentionally, but only for alias this. That syntax is >>> allowed still for other alia

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Ali Çehreli
On 02/22/2013 09:08 AM, Ali Çehreli wrote: On 02/22/2013 06:55 AM, bearophile wrote: > Martin: > >> Was something changed intentionally or is this a bug? > > It was changed intentionally, but only for alias this. That syntax is > allowed still for other aliases. It is a regression at best

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread kenji hara
2013/2/23 Ali Çehreli > On 02/22/2013 06:55 AM, bearophile wrote: > > Martin: > > > >> Was something changed intentionally or is this a bug? > > > > It was changed intentionally, but only for alias this. That syntax is > > allowed still for other aliases. > > It is a regression at best because it

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Ali Çehreli
On 02/22/2013 06:55 AM, bearophile wrote: > Martin: > >> Was something changed intentionally or is this a bug? > > It was changed intentionally, but only for alias this. That syntax is > allowed still for other aliases. It is a regression at best because it is nowhere to be found in the changelo

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread deadalnix
On Friday, 22 February 2013 at 15:31:43 UTC, Martin wrote: On Friday, 22 February 2013 at 15:07:29 UTC, deadalnix wrote: On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote: On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote: Martin: Was something changed intentionally or is

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Martin
On Friday, 22 February 2013 at 15:07:29 UTC, deadalnix wrote: On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote: On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote: Martin: Was something changed intentionally or is this a bug? It was changed intentionally, but only for al

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread deadalnix
On Friday, 22 February 2013 at 14:58:02 UTC, Martin wrote: On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote: Martin: Was something changed intentionally or is this a bug? It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases. By

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread bearophile
Martin: Was something changed intentionally or is this a bug? It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases. Bye, bearophile

Re: What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Martin
On Friday, 22 February 2013 at 14:55:19 UTC, bearophile wrote: Martin: Was something changed intentionally or is this a bug? It was changed intentionally, but only for alias this. That syntax is allowed still for other aliases. Bye, bearophile I see, thanks. What was the reason for not a

What happened to the alias this = identifier syntax in 2.062?

2013-02-22 Thread Martin
struct Test { int i; alias this = i; } Worked fine in 2.061 but in 2.062 I get the errors "Error: no identifier for declarator this" and "Error: alias cannot have initializer". Was something changed intentionally or is this a bug?