mgalgs
mgalgs

Reputation: 16799

What is the colon (:) in Emacs lisp?

I'm not talking about keyword variables (those that are prefixed with a colon), I'm talking about just :. Example from an ielm session:

ELISP> :
:

It seems to be a variable whose value is : which makes it sort of act like a noop like it does in shell. I'm just curious if there's any documentation about it. I can't look it up with describe-variable...

Upvotes: 5

Views: 4796

Answers (2)

mgalgs
mgalgs

Reputation: 16799

Looks like it's just a variable whose value is : after all. I can't look it by calling describe-variable interactively but I can look it up with (describe-variable :):

:'s value is :

Documentation:
Not documented as a variable.

Edit: no, it's not a variable. See the accepted answer.

Upvotes: 0

Drew
Drew

Reputation: 30708

: is a keyword, that is, a Lisp symbol whose print name begins with ":". It satisfies predicate keywordp.

Upvotes: 8

Related Questions