d1 <- list("1" = "one")
d2 <- list("2" = "two")
d3 <- list("3" = "three")
# c() builds a new list: d1 stays as it was
d_all <- c(d1, d2)
# Not changed in place: assign the result
d_all <- c(d_all, d3)
# modifyList(): the right one wins
clash <- modifyList(d1, list("1" = "ONE"))
# Trap: c() keeps both pairs, [[ finds the first
doubled <- c(d1, list("1" = "ONE"))
first_value <- doubled[["1"]]
# first_value = one
str(d_all)
str(d1)
str(clash)
cat("length(doubled) =", length(doubled), "\n")
cat("first_value =", first_value, "\n")