| No sorry, you are incorrect and you can verify the correct answer on Wikipedia or any technical book on this subject. For example the Java Language Specification states in section 8.4.1 that Java is pass by value: https://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html... ECMAScript's Language Specification also states in section 10.6 that it uses pass by value semantics, although it's much more formal about the specific approach it uses: https://262.ecma-international.org/5.1/ I can't link to the specific section but you can review the semantics of MakeArgGetter and MakeArgSetter which are specified to produce arguments bound to the *value* associated with the name, as opposed to a reference. Python does not have a spec that I can reference, but given that its argument semantics follows those of Java, and once again the inability to write a swap function, it should not be too difficult to deduce that Python also passes by value. |