From pdalgd at gmail.com  Sat Oct  9 17:24:07 2010
From: pdalgd at gmail.com (Peter Dalgaard)
Date: Sat, 09 Oct 2010 17:24:07 +0200
Subject: [Rd] What do you call the value that represents a missing
	argument?
In-Reply-To: <AANLkTi==+Wsx-6fZMEquZtrwWmK2vLK3-6rbaRS6NLsw@mail.gmail.com>
References: <AANLkTinE7+NhYw=8hxHi5nW+pWYWdRVjgJScm0ky_W1W@mail.gmail.com>	<Pine.LNX.4.64.1010082003070.10738@tajo.ucsd.edu>
	<AANLkTi==+Wsx-6fZMEquZtrwWmK2vLK3-6rbaRS6NLsw@mail.gmail.com>
Message-ID: <4CB08917.7040807@gmail.com>

On 10/09/2010 01:51 PM, Hadley Wickham wrote:
>> It is a 'dotted pair list'
> 
> But:
> 
>> is.pairlist(formals(plot)$x)
> [1] FALSE
> 
> Hadley
> 

Vitaly is right that it is implemented as as.symbol(""), although
there's a safeguard against doing just that (and it is not like it is
imperative to have that particular implementation). It isn't really
supposed to live in the wild, but as you have noticed there are a couple
of ways to circumvent the safeguards, mainly due to the need to be able
to manipulate a function's argument list.

We did at some point play around with the idea of making "missing arg"
an official first-class object, but found ourselves in the same position
as the man who invented the acid that dissolves everything: These things
are hard to store....

> y <- alist(x=)$x
> z <- y
Error: argument "y" is missing, with no default

(I have forgotten whether there's a reason that the above doesn't fail
already on the assignment to y. Somehow it would have been more logical
if missing values could _only_ appear inside lists. Except in actual
function arguments, of course.)

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] What do you call the value that represents a missing argument?
Peter Dalgaard