Skip to content

Comment on Is Python call-by-value or call-by-reference? Neither.parent

Comments

To add to the historical point, Pascal was made in 1970 and supports both call-by-value and call-by-reference, so I get the feeling that Liskov was just muddying the waters. Considering that in modern usage call-by-sharing is relatively unheard of (sometimes even in Python circles), I really don't see what it has going for it.

Can Haskell pass the test? If it can't, it doesn't support call-by-reference.

You do bring up an interesting line of thought with call-by-need et al. I tend to just lump them under "lazy evaluation" and I don't really view them as impacting the value/reference dichotomy. The question there, then, is at the end of the day if/when an argument is evaluated (to whatever extent), does it match call-by-value or call-by-reference semantics? (And if the behavior is achieved with macro expansion, can it even rightfully be called a "call-by-X" behavior?) Clojure is adamantly call-by-value with its lazy evaluation, is there any particular reason why another language couldn't have the same lazy evaluation semantics as Clojure but support call-by-reference? pdw elsewhere in this thread suggests this whole "call-by-X" issue is pointless once you bring in lazy evaluation, I don't think that's a bad assessment.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.