Joe Strout <[EMAIL PROTECTED]> writes: >> Q. What type of calling semantics do Python and Java use? >> >> A. Call-by-sharing. > > Fair enough, but if the questioner then says "WTF is call-by-sharing," > we should answer "call-by-sharing is the term we prefer for call-by- > value in the case where the value is an object reference (as is always > the case in Python)."
Personally, I think that it is much preferable to leave "call-by-value" completely out of any such discussion, as it provably leads to a great deal of confusion and endless, pointless debate. It's better to just start from a clean slate and explain how call-by-sharing works, and to assert that it is quite different from the calling semantics of languages such as C or Pascal or Fortran, so the student must set aside any preconceptions about how argument passing works. Call-by-sharing is technically a type of call-by-value only for those who are devotees of academic programming language zoology. For everyone else, call-by-sharing is its own beast. One might point all of this out in the discussion, however, if it will help the other person understand. You never know -- they might be a fan of academic programming zoology. |>oug -- http://mail.python.org/mailman/listinfo/python-list