Skip to content
Prev 45166 / 63424 Next

quote() vs quote(expr=)

On Feb 18, 2013, at 19:31 , <luke-tierney at uiowa.edu> <luke-tierney at uiowa.edu> wrote:

            
Yes. I think we at some point played around with the idea of making the missing object a genuine first class object. However, the semantics are too irregular, as in
Error: argument "b" is missing, with no default

An R object than can be referenced, but (sometimes) not dereferenced is just weird.

On the other hand, if we want to be able to compute on things like argument lists, there needs to be a way of representing an absent default. Also, a functions evaluation frame will contain objects representing arguments, even if they are missing, as in
[1] "x"

So it seems that there is no way around letting lists and environments have missing components. It is a quirk that it happens to be implemented as as.name(""), though.

Come to think of it, there are a few oddities in the current design: 

- why can't we check for a missing list component with missing(a$x)?

- why does a$x above not throw an error? (I can see that it is necessary to be able to shuffle argument lists around, and probably also to subset them, but direct dereference could be avoided, I think.)