DEV Community

Discussion on: 20 Intriguing, Unusual, and Goofy Programming Languages

Collapse
 
mmachenry profile image
Mike MacHenry

I'm afraid you've touched on a common misconception of Lisp. It's often said that Lisp only has one type, "the list". You've expended this to two types, lists and atoms. But this simply isn't true. Lisp also has functions as first class types, it has numbers, strings, etc. The fact that the syntax uses only a subset of these types does not mean that the language doesn't have them. It just means that only a subset of the types are needed in order to represent a program in the languages own data types.

Collapse
 
awwsmm profile image
Andrew (he/him)

Aren't functions, strings, and numbers just particular kinds of atoms?

Collapse
 
mmachenry profile image
Mike MacHenry • Edited

Well, sure they're atomic values. But atom isn't a type in Lisp. I didn't want to additionally correct you on your use of the word atom, because I felt it was needlessly pedantic at the time, but I see now it's the crux of the confusion. The proper term for would be symbols. Those are the things that have the single quote in front of them and can represent identifiers when used to express the syntax of Lisp itself. Atoms, which is a term you could use to classify anything that's not an aggregate container, would include functions, strings, symbols, etc.

But if I told you that Python only had three data types, dict, array, and atom, wouldn't you wonder why I've collapsed string, int, float, etc into one type?

Thread Thread
 
awwsmm profile image
Andrew (he/him)

Thanks for the clarification, Mike! I need to do some more research...

Thread Thread
 
mmachenry profile image
Mike MacHenry

No problem. To help your research, I might write up a post from a talk I have given a couple of times about this exact topic.