Jump to page: 1 2 3
Thread overview
What happened to the alias this = identifier syntax in 2.062?
Feb 22, 2013
Martin
Feb 22, 2013
bearophile
Feb 22, 2013
Martin
Feb 22, 2013
deadalnix
Feb 22, 2013
Martin
Feb 22, 2013
deadalnix
Feb 22, 2013
Michael
Sep 12, 2014
eles
Feb 22, 2013
Ali Çehreli
Feb 22, 2013
Ali Çehreli
Feb 22, 2013
Ali Çehreli
Feb 22, 2013
kenji hara
Feb 22, 2013
Ali Çehreli
Feb 22, 2013
Rob T
Feb 22, 2013
deadalnix
Feb 22, 2013
Marco Leise
Feb 22, 2013
Andrej Mitrovic
Feb 22, 2013
Timon Gehr
Feb 22, 2013
Michael
Feb 22, 2013
Joshua Niehus
Feb 22, 2013
Timon Gehr
Feb 22, 2013
Joshua Niehus
Feb 22, 2013
Joshua Niehus
Feb 23, 2013
Jonathan M Davis
Feb 23, 2013
deadalnix
Feb 22, 2013
Timon Gehr
February 22, 2013
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?
February 22, 2013
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
February 22, 2013
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 allowing alias this = identifier?
February 22, 2013
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.
>>
>> Bye,
>> bearophile
>
> I see, thanks. What was the reason for not allowing alias this = identifier?

Requiring lookahead when parsing.
February 22, 2013
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 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.

Alright, thanks!
February 22, 2013
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 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.
>
> Alright, thanks!

Just to be clear : that was sarcastic, requiring lookahead when parsing is a drawback.

The idea is that alias and alias this are 2 different beasts. For instance you can have multiple alias this when you can only have one name per identifier.

It was wanted to distinguish the 2 with 2 different syntaxes.
February 22, 2013
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 changelog, at least not without clicking every single item in those lists.

Ali

February 22, 2013
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

Posted:

  http://d.puremagic.com/issues/show_bug.cgi?id=9569

Ali
February 22, 2013
2013/2/23 Ali Çehreli <acehreli@yahoo.com>

> 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 changelog, at least not without clicking every single item in those lists.


That is intended change. https://github.com/D-Programming-Language/dmd/issues/1413 https://github.com/D-Programming-Language/d-programming-language.org/pull/224

Kenji Hara


February 22, 2013
On 02/22/2013 09:28 AM, kenji hara wrote:
> 2013/2/23 Ali Çehreli<acehreli@yahoo.com>
>
>> 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
>> changelog, at least not without clicking every single item in those lists.
>
>
> That is intended change.
> https://github.com/D-Programming-Language/dmd/issues/1413
> https://github.com/D-Programming-Language/d-programming-language.org/pull/224

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 of a regression. Normally, regressions are fixed as quickly as possible.

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

« First   ‹ Prev
1 2 3