Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread ROGER GRAYDON CHRISTMAN
On Tue, Sep 26, 2017 11:00 PM, Steve D'Aprano wrote: > The critical distinction here is whether the names refer to each other: > >a <---> b > >or whether they merely refer to the same value: > >a ---> [ value ] <--- b > > >Python uses the second model. Var parameters

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 09:38 schreef Steven D'Aprano: No, the model that C++ and Pascal use is not different in this aspect. > that Pascal var parameters and C++ reference variables operate the same > way as Python variable assignment, the *kindest* thing I can say is that > you are ignorant. The

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 10:11 schreef Chris Angelico: > On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano > wrote: >> Twice you have claimed to be able to write such a swap procedure for >> lists. You can't. If you think you can, it is only because you have >>

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Chris Angelico
On Wed, Sep 27, 2017 at 5:38 PM, Steven D'Aprano wrote: > Twice you have claimed to be able to write such a swap procedure for > lists. You can't. If you think you can, it is only because you have > misunderstood the problem and are writing something else

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Steven D'Aprano
On Wed, 27 Sep 2017 08:56:03 +0200, Antoon Pardon wrote: >> But that's not enough for the variable b to be an alias for the >> variable a. > > Yes it is! Since you seem to be intent on inventing your own meanings for well established words, for the confusion and misinformation of all, I can

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 04:58 schreef Steve D'Aprano: > A pedantic difference that makes no difference to my argument. > > I see that you ignored the later assignment: > > b = 2; > > which also assigned to a. *That** is the fundamental point: b is certainly an > alias for a, and assigning to b assigns to

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-27 Thread Antoon Pardon
Op 27-09-17 om 04:58 schreef Steve D'Aprano: > On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote: > >> Steve D'Aprano writes: >>> On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: at that moment, but it still needed correction. If the assignment is an alias

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread Bill
Steve D'Aprano wrote: On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote: Steve D'Aprano writes: On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: at that moment, but it still needed correction. If the assignment is an alias operator then after the statements

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread Steve D'Aprano
On Wed, 27 Sep 2017 02:03 am, Stefan Ram wrote: > Steve D'Aprano writes: >>On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: >>>at that moment, but it still needed correction. If the assignment is >>>an alias operator then after the statements >>Here's some C++ code

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread ROGER GRAYDON CHRISTMAN
On Tue, Sep 26, 2017 12:00 PM, Steve D'Aprano wrote: > > a = 1 >> b = a >> b = 2 >> >> a is not 2. > < snip > int main () { > int a; > int& b = a; // reference variable or alias > > a = 1; > printf("a: %d, alias b: %d\n", a, b); > b = 2; > printf("a:

Re: Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread Antoon Pardon
On 26-09-17 14:28, Steve D'Aprano wrote: > On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: > >> Sorry, what he wrote contradicts that. Maybe he was just really confused >> at that moment, but it still needed correction. If the assignment is >> an alias operator then after the statements >> >>

Aliasing [was Re: [Tutor] beginning to code]

2017-09-26 Thread Steve D'Aprano
On Tue, 26 Sep 2017 03:26 am, Antoon Pardon wrote: >>> I'm not sure that Steve knows how it works. When he denies that the >>> assignment is an alias operation in Python that casts an important doubt. >> >> I can assure you that Steve knows how it works. Again, the disagreement is >> almost