proto-package             package:proto             R Documentation

_O_b_j_e_c_t-_O_r_i_e_n_t_e_d _P_r_o_g_r_a_m_m_i_n_g _w_i_t_h _t_h_e _P_r_o_t_o_t_y_p_e _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     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).

_D_e_t_a_i_l_s:

     '"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'

_N_o_t_e:

     See '?graph.proto' for the solution to a common Linux installation
     problem with 'Rgraphviz' that 'proto' depends on.

_E_x_a_m_p_l_e_s:

     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)

