From bhs2 at mevik.net  Fri Oct 27 11:09:17 2006
From: bhs2 at mevik.net (=?iso-8859-1?q?Bj=F8rn-Helge_Mevik?=)
Date: Fri, 27 Oct 2006 11:09:17 +0200
Subject: [Rd] as.missing
In-Reply-To: <971536df0610261830o4d36376bk4b90d42e218eb2d0@mail.gmail.com>
	(Gabor
	Grothendieck's message of "Thu, 26 Oct 2006 21:30:07 -0400")
References: <453E462C.6050103@bank-banque-canada.ca>
	<971536df0610250928q615c2e4dl950e8f576c492789@mail.gmail.com>
	<4540CC71.1010108@bank-banque-canada.ca>
	<971536df0610261830o4d36376bk4b90d42e218eb2d0@mail.gmail.com>
Message-ID: <m0hcxq3z2a.fsf@bar.nemo-project.org>

Gabor Grothendieck wrote:

> This is what I get:
>
>> as.missing <- force
>> f <- function(y, x=1) {cat(missing(x)) ; x}
>> g <- function(x=as.missing()) f(3,x)
>> g()
> FALSEError in as.missing() : argument "x" is missing, with no default
>> traceback()
> 3: as.missing()
> 2: f(3, x)
> 1: g()
>> traceback()
> 3: as.missing()
> 2: f(3, x)
> 1: g()
>
> so g did in fact pass the missing to f and it was only f that blew up,
> not g.  If that's not what you want please explain.

I _think_ what he wants is:

> g()
TRUE[1] 1

I.e., when x is missing in g, and g calls f(3,x), f will use its
default value for x.

-- 
Bj?rn-Helge Mevik




[Rd] as.missing
=?iso-8859-1?q?Bj=F8rn-Helge_Mevik?=