In functional programming, what terminology is used to distinguish between avoiding modifying what a variable refers to, and avoiding modifying an object itself?
For example, in Ruby,
name += title
avoids modifying the object previously referred to by name
, instead creating a new object, but regrettably makes name
refer to the new object, whereas
full_title = name + title
not only avoids modifying objects, it avoids modifying what name
refers to.
What terminology would you use for code that avoids the former?