3 ms·
Lisp is built on OOP: all sorts of objects that have state and functions operating on it. For instance, an I/O stream, needed to do the "read" and "print" parts
by kazinator 10y ago
Lisp is built on OOP: all sorts of objects that have state and functions operating on it. For instance, an I/O stream, needed to do the "read" and "print" parts of REPL, is a stateful object.
Lisp is not only where functional programming originated, but also object-based programming leading to OOP. Lisp was the first language which had first-class objects: encapsulated identities operated upon by functions, and having a type.
For instance, an object of CONS type could only be accessed by the "getter" functions CAR and CDR which take a reference to the object, and by the "setters" RPLACA an RPLACD.
Meanwhile, the other higher level programming language in existence, Fortran, had just procedures acting on global variables.
- dang 10y agoI was interested to notice that Steele and Sussman describe Lisp as "an object-oriented language" on page 2 of this 1979 paper: https://dspace.mit.edu/bitstream/handle/1721.1/5731/AIM-514.pdf https://dspace.mit.edu/bitstream/handle/1721.1/5731/AIM-514..... There are other places in the Lambda papers and whatnot where they talk about objects, but I don't recall seeing that exact phrase. Of course, just what they meant by it is another question.