library(xfun)
(z = strict_list(aaa = "I am aaa", b = 1:5))
z$a # NULL!
z$aaa # I am aaa
z$b
z$c = "create a new element"
z2 = unclass(z) # a normal list
z2$a # partial matching
z3 = as_strict_list(z2) # a strict list again
z3$a # NULL again!
Run the code above in your browser using DataLab