From francoisromain at free.fr  Wed Feb  8 09:33:50 2006
From: francoisromain at free.fr (Romain Francois)
Date: Wed, 08 Feb 2006 09:33:50 +0100
Subject: [Rd] NAMESPACE Q: does import as exist?
In-Reply-To: <m2mzh2edjq.fsf@ziti.local>
References: <D79013E40FEF254AAF0D72DFC94F274816B00B@extas4-hba.tas.csiro.au>
	<m2mzh2edjq.fsf@ziti.local>
Message-ID: <43E9ACEE.9060909@free.fr>

Le 08.02.2006 04:26, Seth Falcon a ?crit :

>On  7 Feb 2006, Mark.Bravington at csiro.au wrote:
>
>  
>
>>>On 2/7/2006 8:48 PM, Seth Falcon wrote:
>>>      
>>>
>>>>Is there a way to rename a function when importing it?  I 
>>>>        
>>>>
>>>want to say, 
>>>      
>>>
>>>>"import yourFunc from Foo as myFunc" in the NAMESPACE file.
>>>>        
>>>>
>>I don't think Seth's facility exists yet, but it has occurred to me
>>previously that it would be useful when you need to import two
>>different functions with the same name from two different
>>packages. (Rare but does happen.) Duncan's solution won't get around
>>that. So it would be nice to be able to do this
>>
>>ImportFromAs( 'pack1', 'funca', 'pack1.funca')
>>ImportFromAs( 'pack2', 'funca', 'different.name.altogether')
>>
>>in a NAMESPACE file. Useful-- yes. Possible-- I don't know!
>>    
>>
>
>Yes, this is along the lines of what I was thinking.  
>
>An unpleasant work around would be to create a translation package
>that does something along the lines of Duncan M.'s suggestion,
>importing, renaming, exporting.
>  
>
What about :

bar <- pack::foo
kok <- otherpack::foo


Romain

-- 
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques
mixmod 1.7 is released : http://www-math.univ-fcomte.fr/mixmod/index.php
+---------------------------------------------------------------+
| Romain FRANCOIS - http://francoisromain.free.fr               |
| Doctorant INRIA Futurs / EDF                                  |
+---------------------------------------------------------------+



[Rd] NAMESPACE Q: does import as exist?
Romain Francois