title: Get a consistent vector of list element names
body: <p>A list with no names returns NULL for its names:</p>
  
  <pre><code>&gt; names(list(1,2,3))
  NULL
  </code></pre>
  
  <p>but add one named thing and suddenly the names has the length of the list:</p>
  
  <pre><code>&gt; names(list(1,2,3,a=4))
  [1] ""  ""  ""  "a"
  </code></pre>
  
  <p>because this is now a <em>named list</em>. What I'd like is a function, rnames say, to make any list into a named list, such that:</p>
  
  <pre><code>rnames(list(1,2,3)) == c("","","")
  identical(rnames(list()), character(0))
  length(rnames(foo)) == length(foo) # for all foo
  </code></pre>
  
  <p>and the following, which is what names() does anyway:</p>
  
  <pre><code>rnames(list(1,2,3,a=3)) == c("","","","a")
  rnames(list(a=1,b=1)) == c("a","b")
  </code></pre>
  
  <p>My current hacky method is to add a named thing to the list, get the names, and then chop it off:</p>
  
  <pre><code>rnames = function(l){names(c(monkey=1,l))[-1]}
  </code></pre>
  
  <p>but is there a better/proper way to do this?</p>