[Rd] Error condition in evaluating a promise
Luke Tierney
luke at stat.uiowa.edu
Wed Oct 18 17:55:33 CEST 2006
Active bindings are another option (?makeActiveBinding).
It might be worth revisiting how promises are evaluated to see if at
elast a more sensible error message can be achieved, but making sure
any changes do not affect performance will be tricky.
Best,
luke
On Wed, 18 Oct 2006, Duncan Temple Lang wrote:
> -----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-----
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
--
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu
More information about the R-devel
mailing list