From duncan at wald.ucdavis.edu  Wed Oct 18 17:41:01 2006
From: duncan at wald.ucdavis.edu (Duncan Temple Lang)
Date: Wed, 18 Oct 2006 08:41:01 -0700
Subject: [Rd] Error condition in evaluating a promise
In-Reply-To: <9AE19AAE-9CAD-4697-82DC-07724445114C@r-project.org>
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: <45364B0D.5060300@wald.ucdavis.edu>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi Simon.

 One approach is RObjectTables. This provides a way to
customize how variables are accessed/assigned in
an environment and so allows an operation to do something
to compute the value of a variable while still allowing
it to be used as a variable rather than an explicit function
call by the user.

Otherwise, Seth's suggestion of an accessor function is the natural way.
This does arise often and we need an extensible SEXP facility
that allows us to capture some of the idioms that continue to arise.

 D.

Simon Urbanek wrote:
> Martin,
> 
> On Oct 17, 2006, at 11:43 PM, Martin Morgan wrote:
> 
> 
>>I believe the technique is to create an environment in the  
>>namespace, and then to access that through functions:
>>
> 
> 
> 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). I have an ugly work- 
> around for that as well, the question was whether promises could be  
> used for that purpose as a more clean solution and the answer appears  
> to be no - at least for R <=2.4.0.
> 
> Thanks,
> Simon
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

- --
Duncan Temple Lang                    duncan at wald.ucdavis.edu
Department of Statistics              work:  (530) 752-4782
4210 Mathematical Sciences Building   fax:   (530) 752-7099
One Shields Ave.
University of California at Davis
Davis,
CA 95616,
USA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFNksN9p/Jzwa2QP4RAjXYAJ0cbGzw6IsCU62RWGxHDS7v1E4jzwCeOWSz
HGMaKhRjidss+7cu3gok2YU=
=3XhK
-----END PGP SIGNATURE-----




[Rd] Error condition in evaluating a promise
Duncan Temple Lang