From sfalcon at fhcrc.org  Wed Oct 18 17:23:26 2006
From: sfalcon at fhcrc.org (Seth Falcon)
Date: Wed, 18 Oct 2006 08:23:26 -0700
Subject: [Rd] Error condition in evaluating a promise
In-Reply-To: <9AE19AAE-9CAD-4697-82DC-07724445114C@r-project.org> (Simon
	Urbanek's message of "Wed, 18 Oct 2006 10:42:20 -0400")
References: <0359A469-1F7D-4CEF-A408-CCB185D5F90E@r-project.org>
	<6phvemixy1u.fsf@gopher4.fhcrc.org>
	<6phvemiuw3r.fsf@gopher4.fhcrc.org>
	<9AE19AAE-9CAD-4697-82DC-07724445114C@r-project.org>
Message-ID: <m2d58psl5d.fsf@ziti.local>

Simon Urbanek <simon.urbanek at r-project.org> writes:
> thanks, but this is not what I want (the symbols in the environment  
> are invisible outside) and it has nothing to do with the question I  
> posed: as I was saying in the previous e-mail the point is to have  
> exported variables in a namespace, but their value is known only  
> after the namespace was attached (to be precise I'm talking about  
> rJava here and many variables are valid only after the VM was  
> initialized - using them before is an error). 

We have a similar use case and here is one workaround:

Define an environment in your name space and use it to store the
information that you get after VM-init.

There are a number of ways to expose this:

* Export the env and use vmEnv$foo

* Provide accessor functions, getVmFooInfo()

* Or you can take the accessor function approach a bit further to make
  things look like a regular variable by using active bindings.  I can
  give more details if you want.  We are using this in the BSgenome
  package in BioC.

HTH,

+ seth




[Rd] Error condition in evaluating a promise
Seth Falcon