Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
August 20, 2013 new operator chaining (D vs Java) | ||||
---|---|---|---|---|
| ||||
I've used D to some extent since around 2004, but I don't recall noticing this before (although I wouldn't trust 9 year old memories!): D: (new Class()).foo(); Java: new Class().foo(); Is there any particular (purposeful) reason why D cannot directly chain calls after new? (a quick Google search did not help). |
August 20, 2013 Re: new operator chaining (D vs Java) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luís Marques | On Tuesday, 20 August 2013 at 02:11:41 UTC, Luís Marques wrote:
> Is there any particular (purposeful) reason why D cannot directly chain calls after new? (a quick Google search did not help).
This syntax will work in the next release (2.064).
|
August 20, 2013 Re: new operator chaining (D vs Java) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | On Tuesday, 20 August 2013 at 02:20:27 UTC, Andrej Mitrovic wrote:
> This syntax will work in the next release (2.064).
Wow, now that is a coincidence! :-) (how it took me so long to notice it, just before it was going to be added to the language)
|
August 20, 2013 Re: new operator chaining (D vs Java) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Luís Marques | On Tuesday, 20 August 2013 at 02:25:35 UTC, Luís Marques wrote:
> On Tuesday, 20 August 2013 at 02:20:27 UTC, Andrej Mitrovic wrote:
>> This syntax will work in the next release (2.064).
>
> Wow, now that is a coincidence! :-) (how it took me so long to notice it, just before it was going to be added to the language)
That isn't coincidence ;) BTW, it is supposed to work by spec for ages.
|
August 20, 2013 Re: new operator chaining (D vs Java) | ||||
---|---|---|---|---|
| ||||
Posted in reply to deadalnix | On 2013-08-20 11:02, deadalnix wrote: > On Tuesday, 20 August 2013 at 02:25:35 UTC, Luís Marques wrote: >> On Tuesday, 20 August 2013 at 02:20:27 UTC, Andrej Mitrovic wrote: >>> This syntax will work in the next release (2.064). >> >> Wow, now that is a coincidence! :-) (how it took me so long to notice >> it, just before it was going to be added to the language) > > That isn't coincidence ;) BTW, it is supposed to work by spec for ages. I have been adding parentheses in DWT for ages :(. At least it's good that it's finally changed. -- /Jacob Carlborg |
Copyright © 1999-2021 by the D Language Foundation