Skip to content
Prev 45154 / 63424 Next

quote() vs quote(expr=)

Yes, a fix to str would be nice too :)
quote(expr =) returning missing seems like the right thing to me,
quote() throwing an error does not, because it violates the usual
semantics where f(x = ) is equivalent to f().
You do occasionally need the missing symbol when computing on the
language (see e.g.
https://github.com/hadley/pryr/blob/master/R/partial.r for an example
of where I use it).  You do have to handle it with care, but you are
limited without it.

I think it's better to have one canonical way of getting the missing
symbol when you need it, so that it's easier to recognise in code, and
to clearly illustrates that you do want the missing symbol.  I'd
certainly accept an argument that there should be a dedicated function
to do this, rather than relying on an implementation side-effect of
quote, bquote etc.

Hadley