# Re: does ":" have an anolog in another language?

**URL:** <https://www.ruby-forum.com/t/re-does-have-an-anolog-in-another-language/100431>\
**Category:** Ruby\
**Created:** [July 28, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/re-does-have-an-anolog-in-another-language/100431 "2006-07-28T21:55:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [July 28, 2006, 9:55pm UTC](https://www.ruby-forum.com/t/re-does-have-an-anolog-in-another-language/100431/1 "2006-07-28T21:55:41Z")

</div>

Sorry if anyone’s beat me to this, I find it hard to keep up with such a  
busy list…

: is used to denote a symbol. The idea of a symbol has a rather broad  
interpretation, but I think that technically any identifier you make in  
a program – a variable name or function name, for instance – is a  
symbol.

Lisp languages have symbols in a similar sense that Ruby does, and they  
are usually used in much the same capacity as variable names – they get  
evaluated into any binding they currently have to a function or piece of  
data. However, if quoted with a single quote (like 'this) they are left  
unevaulated and treated as the symbols themselves.

Lisp symbols don’t have to start with :, but certain uses of them where  
they have semantic significance use that convention, which might be  
where Ruby borrows the syntax from. For example, a common idiom in  
Common Lisp is the associative list, where elements are alternated with  
symbols that must start with : and elements can be referenced by the  
:-symbol right before them. So you might have a list like (:a 1 :b 2 :c  
3) called mylist, and (getf mylist :b) will return the 2. Similarly,  
:-symbols are used a lot in argument lists for many Common Lisp  
functions, to denote values meant to be passed to named parameters (aka  
keyword parameters).

I think there’s also something like it in Smalltalk but I’m not sure.

So basically, a symbol is this little constant singleton identifier  
thing, that you can use to mean whatever 😉

–ch–

-------------- Original message ----------------------  
From: “Matt T.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
