[Tutor] beginning to code
On 25-09-17 15:37, Ned Batchelder wrote:
> On 9/25/17 9:15 AM, Antoon Pardon wrote:
>> Op 25-09-17 om 14:53 schreef Ned Batchelder:
>>> On 9/25/17 8:24 AM, Steve D'Aprano wrote:
>>>> On Mon, 25 Sep 2017 08:05 pm, Antoon Pardon wrote:
>>>>> Pass by reference doesn't imply being able to
>>>>> write a swap function.
>>>> Really. Do you have a counter-example?
>>>>> A swap function as possible in pascal requires two conditions.
>>>>> 1) Pass by reference
>>>>> 2) Copy-over assignment.
>>>> I don't know what you think "copy-over assignment" means, but none of
>>>> DuckDuckGo, Google, Bing or Yahoo finds that term except in your post.
>>> Would we be able to end these interminable debates if we just agree
>>> that we all know how it works, and it isn't important to come up with
>>> a simple name for what it is?
>> 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 certainly over the semantics of the word "alias."
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
a = 1
b = a
b = 2
a is not 2. He is not using the assignment as an alias operation in
that last assignment but as a copy operation that will overwrite the
value that b refers to.
>>> It seems clear to me that "value" and "reference" are wildly vague
>>> terms, used slightly differently by each language, and by different
>>> people even in the same language if they have different perspectives.
>> Well in that case and considering your remark above, maybe the residents
>> shouldn't be so eager to deny to newbees that python has call by reference.
> You're still trying to get people to agree to a label like "call by reference." This is where the disagreement comes from.
No I'm trying to make them stop disagreeing to a label like call by reference.
They may personnaly prefer an other label but this is not about them, this
is about the newbe. And if someone can explain the newbe what is going on
in terms of "call by reference", something the newbe understands, then that
is what is important and those that prefer an other lable should at that
moment not interfere and possibly cause confusion.