4 ms·
Some languages that have CONS cells: Common Lisp, Emacs Lisp, Scheme, Dylan, Maclisp, Interlisp, AutoLisp, Lisp Machine Lisp, EuLisp, ISLisp, *Lisp, LeLisp, Lis
by bluefox 6y ago
Some languages that have CONS cells: Common Lisp, Emacs Lisp, Scheme, Dylan, Maclisp, Interlisp, AutoLisp, Lisp Machine Lisp, EuLisp, ISLisp, *Lisp, LeLisp, Lisp 1.5.
Some languages that don't have CONS cells: Clojure, Janet, Julia, R.
Of course, that is only one attribute, and may not be the most important one, but it's an interesting separating line.
If you describe each language by a set of language feature attributes, you can perform some easy computations (e.g., Jaccard distance, or some clustering) to get more clue about how related these languages really are. I think Janet wouldn't fare so bad in relation to obvious Lisps, so I'm not strongly opposed to calling it a Lisp.
- klibertp 6y ago> Some languages that have CONS cells: Erlang and Prolog also use cons cells... Prolog is also homoiconic. I don't think I ever heard anyone calling Prolog a Lisp though. Also, Clojure has cons cells. '(3 . 4) is a valid expression in Clojure. Basically, this is an arbitrary, and rather unhelpful, classification. I don't find it interesting, but to each their own, I guess.
- harryposner 6y agouser=> (rest '(3 . 4)) (. 4) user=> (second '(3 . 4)) . user=> (nth '(3 . 4) 2) 4
- klibertp 6y agoYes, I was wrong, my bad :)
- lispm 6y ago> '(3 . 4) is a valid expression in Clojure True, just not a cons cell. It's a persistentList with three elements: 3, ., and 4. Clojure has a higher-level basic data-structure than the usual Lisp. In those Lisps cons cells are are nothing more than a two-element record, a few basic operations (CONS, CONSP, CAR, CDR, RPLACA, RPLACD) and a special data syntax for them: ( a . b ). In a typical Lisp, the dot is not a list element, but divides the car from the cdr. Additional there is simpler notation for (a . (b . nil)) in the form of (a b) .
- klibertp 6y agoI stand corrected. I used Clojure briefly a few years ago, so I don't remember much. I even ran a REPL and checked if it's a valid syntax, but it didn't occur to me to check its type. Sorry!
- disgruntledphd2 6y agoR also has cons cells, called pairlists. They are generally only used for function arguments though.
- bluefox 6y ago> I don't think I ever heard anyone calling Prolog a Lisp though. I guess we can agree that it's not a sufficient condition, but from my selection of languages you may consider that maybe I meant it as a necessary condition. Another interesting separator is: does it include "Lisp" in its name? Scheme and Dylan don't. Maybe people don't use "Lisp" in the name to indicate that they intend the language to break away in some way from the Lisp tradition. In a similar way, Racket broke away from Scheme tradition, for example. Kent Pitman, in his "Lambda the Ultimate Political Party" article, wrote that people have been writing programs to help transition code written in the older dialects to the new dialects. The fact that it's doable without expending too much energy also suggests close relationship. Some months ago I wrote some <100 lines of code, consisting mostly in a bunch of macros, to make a program using Flavors work on Common Lisp with CLOS. Are the people using Clojure, Janet, etc. doing this? Can they pick up an old program written in another Lisp dialect that's close to them and, with not too much fuss, make it run? Which dialect would that be?
- deleted 6y ago[deleted]