Currently I am taking a course on concepts of programming languages, which is where I came across an issue that had left me confused once before (when I was watching the videos of Martin Odersky's functional programming course on Coursera):
The term "call-by-value" is constantly being used in two different contexts:
Context 1: Evaluation regime (Call-by-value vs. call-by-name)
If a function is being passed an expression as an argument, is that expression being reduced to a value (i.e., evaluated) before the parameter identifiers in the function's body are substituted with it? If so, it's called call-by-value, if not, it's call-by-name. At least that's how I understand it.
Context 2: Parameter passing (Call-by-value vs. call-by-reference)
If a function is being passed an identifier as an argument, is the function's body being evaluated with a new name binding that points to a copy of what the given identifier points at, or can the function actually make changes to what the identifier points at, i.e., changes that are "visible" to the calling context? Again, the first variant would be call-by-value, whereas the second one would be call-by-reference. If I got it right, of course.
However, even though I fail to see a relation between the two use cases of the term "call-by-value", it seems too much of a coincidence for the term to be used in both scenarios by accident.
Does someone know why the same term was chosen to describle two (seemingly different) matters?