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

你。 提交于 2020-01-03 15:21:15

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/38177777/what-exactly-is-the-sexp-data-type-in-rs-c-api-and-why-is-it-used

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!