Skip to content
Prev 38118 / 63424 Next

Plans for tighter integration of reference classes in R.

Thank you for the answer, John.

John Chambers <jmc at r-project.org> writes:
But, how about parent.env() functionality? The "S4" envelope is lost:
[1] "myenv"
<environment: 0247a650>

Here I have in mind, as an application, the "prototype" programing paradigm
(akin to JavaScript, also implemented in R's proto package).

If environment manipulation functions would not strip the "S4" envelope from
environments, a considerably wider scope for implementation of "foreign"
programing paradigms would open up. All, by using the "existing techniques"
already available in S4 system.

Proto package makes it possible by using S3 classes, because they are not
striped away. Currently I am struggling to build a prototype based system, similar to
proto,  but in S4 framework. With all the advantages of S4, I am still doubting
that I made a right decision.

Thanks,
Vitalie.