Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is the SEXP data type in R's C API and why is it used? [closed]

Tags:

c

r

lisp

I am aware of the wikipedia page on SEXP, and I know that it stands for symbolic expression. I know (vaguely) SEXP is notation to refer to tree data structures in Lisp, but I want to know what motivated the developers to call the data type of R objects in C SEXP. Why SEXP?

I am also confused because if R was made in C and Fortran, why would notation from Lisp be used? Or is SEXP a more general term? Maybe I'm missing something here.

like image 365
Roger Ko Avatar asked Jul 04 '16 05:07

Roger Ko


1 Answers

R is, internally, kind of like Scheme with an S-compatible syntax. A lot of R's internals derive from Scheme concepts, like cons cells and lexical environments.

Back in the late 90s, I worked on a new (at the time) serialisation format for R; see my honours project paper, which explains a lot of this. (The email address on that paper isn't valid any more, so don't use that.)

like image 62
Chris Jester-Young Avatar answered Sep 20 '22 18:09

Chris Jester-Young