On this page:
symbol
symbolp

6 Symbols

type

symbol

procedure

(symbolp v)  boolean

  v : all
Produces t if v is a symbol, nil otherwise.

> (symbolp 'apple)

t

> (symbolp 'pear)

t

> (symbolp 'antigo)

t

> (symbolp 't)

t

> (symbolp 'nil)

t

> (symbolp 5)

nil

> (symbolp "I'm a string")

nil

> (symbolp (cons 'water (cons 'melon nil)))

nil

> (symbolp 'watermelon)

t

Warning: t and nil happen to be both symbols and booleans, and nil is a list as well. This means when you’re using symbolp on something that could be a boolean or a list, you might get t even if you didn’t intend for it to be interpreted that way. Be careful when mixing symbols with booleans or lists.

> (symbolp nil)

t

> (booleanp nil)

t

> (listp nil)

t

> (symbolp t)

t

> (booleanp t)

t