[R] Formal definitions of R-language.
mn216 at columbia.edu
Thu Jul 17 15:55:53 CEST 2003
some comments. I am still learning S/R so please let me know if I am
> Some CS-guys (the type who knows what Church formalism is) keep asking
> me questions about formal definitions of R-language that I can not
> answer (or even understand). Is there some freely available papers which
> I can throw at them where it would be explained is R
> functional/OOP/procedural language,
R is object oriented in the sense that the basic entities of the
language (data elements, language elements etc.) are complex entities
with type and defined behavior (objects). it has inheritance,
polymorphism, operator overloading etc. you can define constructors for
objects, but as far as I know no destructors (you can define clean up
routines on libraries though).
it has has elements of being a functional language like the fact that
programs are composed of expressions that are turned into function
objects that get evaluated. it also supports lambda expressions. it is
not a pure functional language because functions can and do have side
effects, it has persistent state and assignments, and it has flow of
control statements. also, recursion, as far as I know, is inefficient in
S/R. which tend to discourage purely functional programming.
> does it use weak/strong,
weak typing. variables are not typed and keep type information once
constructed. conversion between types is often automatic or can be
programmed to be so, hence operations on disparate types can often be
> dynamic/static typization,
it is dynamically typed. objects carry and supply type information at
run time. types (as well as behavior) can (only) be defined at run time.
the S-evaluator has to start first, it then constructs class and
function definitions in the run-time environment. object type can be
changed, modified and augmented at run time, at least with old style
classes, (can you add or remove slots in the new style classes?).
> does it use lazy or ...(do not know what)
uses lazy evaluation of expressions. expressions are constructed by the
S-evaluator, but not evaluated until needed.
> what sort of garbage collector it uses?
No garbage collector. uses reference counting to discard objects that
are no longer needed.
> R-help at stat.math.ethz.ch mailing list
Murad Nayal M.D. Ph.D.
Department of Biochemistry and Molecular Biophysics
College of Physicians and Surgeons of Columbia University
630 West 168th Street. New York, NY 10032
Tel: 212-305-6884 Fax: 212-305-6926
More information about the R-help