| proto-package {proto} | R Documentation |
Object-oriented programming with the prototype model. "proto"
facilitates object-oriented programming using an approach
that emphasizes objects rather than classes (although it
is powerful enough to readily represent classes too).
"proto" allows one to write object-oriented programs using
the prototype model. It is a simple system that
uses objects rather than classes yet is powerful enough to readily
encompass classes too.
The following are sources of information on "proto":
| Home page | u <- "http://r-proto.googlecode.com"; browseURL(u) |
| Overview | README <- system.file("README", package = "proto"); file.show(README) |
| Invoking a demo file | demo("proto") |
| Referance Card | vignette("protoref") |
| Tutorial | vignette("proto") |
| Prototype OO concepts document | u <- "http://r-proto.googlecode.com/files/prototype_approaches.pdf"; browseURL(u) |
| News | file.show(system.file("NEWS", package = "proto")) |
| Wish List | file.show(system.file("WISHLIST", package = "proto")) |
| Thanks | file.show(system.file("THANKS", package = "proto")) |
| This File | package?proto |
| Help file | ?proto |
| graph.proto Help File | ?graph.proto |
See ?graph.proto for the solution to a common
Linux installation problem with Rgraphviz that proto
depends on.
cat("parent\n")
oop <- proto(x = 10, view = function(.) paste("this is a:", .$x))
oop$ls()
oop$view()
cat("override view in parent\n")
ooc1 <- oop$proto(view = function(.) paste("this is a: ***", .$x, "***"))
ooc1$view()
cat("override x in parent\n")
ooc2 <- oop$proto(x = 20)
ooc2$view()
## Not run:
g <- graph.proto()
plot(g)
## End(Not run)