Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How so? Reading [1] on pass-by-name, I don't see how it applies to Python, which evaluates the function arguments before passing them.

The example given would be, in Python,

  def double(x):
    x *= 2
  a = [4]
  double(a[0])
If Python was pass-by-name, a would now be [8], but it's actually still [4].

[1] http://www.cs.sfu.ca/~cameron/Teaching/383/PassByName.html



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: