I want a function is_named_list(lst) which returns true if all elements in the list have a name, and false otherwise. In the case where the list is empty, it should return false. What considerations do I need to account for while trying to write such a function. For example, a list with no names behaves differently to a list with incomplete names, with respect to the names function:
> tmp_list <- list(a = 1, b = 2, 3)
> names(tmp_list)
[1] "a" "b" "" # empty string for unnamed third element
> tmp_list <- list(1, 2, 3)
> names(tmp_list)
NULL # null value when no elements have names.