Abstract
Programming paradigms help us understand the differences and similarities between fundamental choices in language design. This paper looks at R in the context of three paradigms of object oriented programming: mutable versus immutable objects, generic-function versus message-passing methods, and class-based versus prototype-based inheritance. The paper also describes a new OO package for R, mutatr, which provides mutable objects with message-passing methods and prototype-based inheritance. The mutatr package is available on CRAN.
Similar content being viewed by others
References
Agesen O, Bak L, Chambers C, Chang B-W, Hölzle U, Maloney J, Smith RB, Ungar D, Wolczko M (2000) The SELF 4.1 programmer’s reference manual. Sun Microsystems, Inc
Bates D, Maechler M (2009) Matrix: sparse and dense matrix classes and methods, R package version 0.999375-29
Bengtsson H (2003) The R.oo package—object-oriented programming with references using standard R code. In: Hornik K, Leisch F, Zeileis A (eds) Proceedings of the 3rd international workshop on distributed statistical computing (DSC 2003), Vienna, Austria, March 2003
Chambers C (1992) Object-oriented multi-methods in cecil. In: ECOOP’92 conference proceedings
Chambers JM, Temple Lang D (2001) Object-oriented programming in r. R-news 1(3): 17–19
Courtney A, Elliott C (2001) Genuinely functional user interfaces. In: 2001 Haskell workshop, September 2001
Danenberg P, Eugster M (2008) Roxygen: literate programming in R. http://roxygen.org. R package version 0.1
Dekorte S (2005) Io, a small programming language. In: OOPSLA05
DeMichiel LG, Gabriel RP (1987) The common lisp object system: an overview. In: ECOOP’ 87 European conference on object-oriented programming. Springer, Berlin. http://www.dreamsongs.com/NewFiles/ECOOP.pdf
Driscoll JR, Sarnak N, Sleator DD, Tarjan RE (1986) Making data structures persistent. In: STOC ’86: proceedings of the eighteenth annual ACM symposium on theory of computing. ACM, New York, pp 109–121. ISBN 0-89791-193-8
Elliott C, Hudak P (1997) Functional reactive animation. In: International conference on functional programming
Feinberg N, Keene SE, Mathews RO, Withington PT (1997) Dylan programming: an object-oriented and dynamic language. Addison Wesley Longman Publishing Co., Inc., Redwood City. ISBN 0-201-47976-1.
Gentleman R, Ihaka R (2000) Lexical scope and statistical computing. J Comput Graph Stat 9: 491–508
Hickey R (2008) The clojure programming language. In: Proceedings of the 2008 symposium on dynamic languages. ACM. New York
Hofstadter D (1979) Gödel, escher, bach: an eternal golden braid. Basic Books, London
Ihaka R, Gentleman R (1996) R: a language for data analysis and graphics. J Comput Graph Stat 5(3): 299–314
Kaplan H (1995) Persistent data structures. In: Handbook on data structures and applications. CRC Press, Boca Raton
Kates L, Petzoldt T (2007) Proto: prototype object-based programming, R package version 0.3-8
Okasaki C (1999) Purely functional data structures. Cambridge University Press, Cambridge
Rice B, Salzman L (2004) The slate programmer’s reference manual
Salzman L, Aldrich J (2005) Prototypes with multiple dispatch: an expressive and dynamic object model. In: European Conference on Object-Oriented Programming. Springer, Berlin, pp 312–336
Smith RB, Ungar D (1995) Programming as an experience: the inspiration for self. In: European Conference on Object-Oriented Programming. Springer, Berlin, pp 303–330
Smith WR (1995) Using a prototype-based language for user interface: the newton project’s experience. In: OOPSLA
Tierney L (1990) Lisp-stat: an object-oriented environment for statistical computing and dynamic graphics. Wiley, New York
Ungar D, Chambers C, Chang B-W, Hölzle U (1991) Organizing programs without classes. Lisp Symb Comput 4(3): 223–242
Ungar D, Smith RB (1987) Self: the power of simplicity. Lisp Symb Comput 22(12): 227–241
Van Roy P (2009) Programming paradigms for dummies: what every programmer should know. In: Assayag G, Gerzso A (eds) New Computational Paradigms for Computer Music. http://www.info.ucl.ac.be/~pvr/VanRoyChapter.pdf
Van Roy P, Haridi S (2004) Concepts, techniques and models of computer programming. The MIT Press, Cambridge
Verzani J (2007) gwidgets: a toolkit-independent api for building guis in r. In: useR! 2007. http://wiener.math.csi.cuny.edu/pmg/gWidgets/useR2007_presentation.pdf
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Wickham, H. Mutable objects in R. Comput Stat 26, 405–418 (2011). https://doi.org/10.1007/s00180-011-0235-7
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00180-011-0235-7