[Tutor] beginning to code

Antoon Pardon antoon.pardon at vub.be
Mon Sep 25 08:47:37 EDT 2017


Op 25-09-17 om 14:24 schreef Steve D'Aprano:
> 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?

Python, smalltalk, scheme.

>
>
>> 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.

I think it was clear enough that I was talking about the assignment
semantics like in Pascal, where when you assign to a variable the
value in the entity refered to, is overwritten by a new value.

In contrast with assignments in Python, smalltalk, scheme where
the assignment binds the name/variable to a new entity.

-- 
Antoon Pardon. 




More information about the Python-list mailing list