This function updates list x
by name. If x
and new.x
elements are not named, the function will not work properly. If a function is
provided to replace an element that was originally not a function, this
function will be applied to the original value.