/usr/lib/R/site-library/proto/README is in r-cran-proto 0.3-10-1build1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | Proto is an R package that facilitates prototype
programming, a type of object-oriented programming that
does not use classes as an atomic concept (but is powerful
enough to encompass them).
The package has been in development for over a year and on
CRAN since the beginning of 2005.
The package is lightweight providing a thin layer on top of
R environments. Unlike other packages which grow over time
proto has become smaller over time as it was successively
polished to reduce it to its essentials. Despite its small
size prototype-based systems can be more powerful than more
complex class-based systems.
EASE OF USE
The proto package is easy to use because:
1. few names. There is only one new function name to learn
among the core functions. The 'proto' function constructs
new proto objects. Remaining core functions include various
as.proto methods, assignment and retrieval via $ and
is.proto.
2. documentation. A 15 page report, a reference card, a demo
and help files are provided.
3. consistency. Proto objects form an subclass of the
environment class. They are and work like environments.
One can leverage everything one knows about environments
to use proto. The package is highly consistent with R and
works the way R works.
4. concise implementation. The source code, excluding
dot.proto, is about one page of code making it possible to
rapidly understand it in its entirety not only from the
documentation but also by reading its source. (This should
not be necessary but its there for those who wish.)
5. tested. The package has been independently tested by
multiple people and has no known bugs. (If you find any
please let the developers know!)
6. visualization. It includes a graphical support function,
graph.proto, which produces inheritance graphs of projects
that can be rendered using the Rgraphviz plot function,
allowing one to visualize projects.
EXAMPLE
The proto package is used like this:
library(proto)
# new object with variable a and method addtwice
oo <- proto(a = 1, addtwice = function(., x) .$a <- .$a + 2*x)
oo$addtwice(3) # add twice 3 to 1
oo$ls() # "a" "addtwice"
oo$a # 7
# create child object overriding a
ooc <- oo$proto(a = 10)
ooc$addtwice(1) # inherit addtwice from parent oo
ooc$ls() # "a"
ooc$a # 12 - addtwice from oo used "a" in ooc!
DOCUMENTATION
More information is available via:
install.packages("proto") # needs R 2.1.0 or later
library(proto)
demo(proto) # a self running demo
vignette("proto") # 15 page report
vignette("protoref") # reference card
?proto # constructs proto objects
?dot.proto # visualize a proto project
# other information
file.show(system.file("NEWS", package = "proto"))
file.show(system.file("README", package = "proto")) # this file
file.show(system.file("WISHLIST", package = "proto"))
proto is available on CRAN now for R 2.1.0 and later.
Comments are welcome.
Louis Kates <lkates@alumni.princeton.edu>
Thomas Petzoldt <thomas.petzoldt@tu-dresden.de>
September 9, 2005 (updated)
May 12, 2005
|