Re: Better way to achieve the following

2022-06-21 Thread Ali Çehreli via Digitalmars-d-learn
On 6/21/22 10:09, JG wrote: Suppose we are often writing something like ```d theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]=x; ``` One would like to something like ```d alias shortName = theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[th

Re: Better way to achieve the following

2022-06-21 Thread Tejas via Digitalmars-d-learn
On Tuesday, 21 June 2022 at 17:09:28 UTC, JG wrote: Suppose we are often writing something like ```d theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]=x; ``` One would like to something like ```d alias shortName = theFirstName[theFirstIndex].theSecondName[theSeco

Re: Better way to achieve the following

2022-06-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/21/22 1:19 PM, JG wrote: On Tuesday, 21 June 2022 at 17:15:02 UTC, Steven Schveighoffer wrote: On 6/21/22 1:09 PM, JG wrote: Thoughts? Use a pointer? Especially if you are using `.method` calls, this just works seamlessly. Thanks for the suggestion.  My immediate reaction is that fo

Re: Better way to achieve the following

2022-06-21 Thread JG via Digitalmars-d-learn
On Tuesday, 21 June 2022 at 17:15:02 UTC, Steven Schveighoffer wrote: On 6/21/22 1:09 PM, JG wrote: Thoughts? Use a pointer? Especially if you are using `.method` calls, this just works seamlessly. -Steve Thanks for the suggestion. My immediate reaction is that for `.method` calls I wou

Re: Better way to achieve the following

2022-06-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/21/22 1:09 PM, JG wrote: Thoughts? Use a pointer? Especially if you are using `.method` calls, this just works seamlessly. -Steve

Better way to achieve the following

2022-06-21 Thread JG via Digitalmars-d-learn
Suppose we are often writing something like ```d theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]=x; ``` One would like to something like ```d alias shortName = theFirstName[theFirstIndex].theSecondName[theSecondIndex].thirdName[theThirdIndex]; shortName = x; ``