From pgilbert at bank-banque-canada.ca  Fri Oct 27 15:55:46 2006
From: pgilbert at bank-banque-canada.ca (Paul Gilbert)
Date: Fri, 27 Oct 2006 09:55:46 -0400
Subject: [Rd] as.missing
In-Reply-To: <m0hcxq3z2a.fsf@bar.nemo-project.org>
References: <453E462C.6050103@bank-banque-canada.ca>	<971536df0610250928q615c2e4dl950e8f576c492789@mail.gmail.com>	<4540CC71.1010108@bank-banque-canada.ca>	<971536df0610261830o4d36376bk4b90d42e218eb2d0@mail.gmail.com>
	<m0hcxq3z2a.fsf@bar.nemo-project.org>
Message-ID: <45420FE2.5090000@bank-banque-canada.ca>



Bj?rn-Helge Mevik wrote:

>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.
>  
>
Yes, that is the behaviour I am looking for. That is, f  should do what 
it normal would do if it were called with x missing.
====================================================================================

La version fran?aise suit le texte anglais.

------------------------------------------------------------------------------------

This email may contain privileged and/or confidential inform...{{dropped}}




[Rd] as.missing
Paul Gilbert