Interning a symbol means to store it in an obarray so that it can be found in the future: all variables and named-functions are stored in interned symbols.
When a symbol is interned a hash function is applied to its print name to determine which bucket in the obarray it should be stored in. Then it is simply pushed onto the front of that bucket's chain of symbols.
Normally all interning is done automatically by the Lisp reader. When it
encounters the name of a symbol which it can't find in the default obarray
(the value of the variable obarray) it creates a new symbol of that
name and interns it. This means that no two symbols can have the same print
name, and that the read syntax of a particular symbol always produces the
same object (unless the value of obarray is altered).
(eq 'some-symbol 'some-symbol)
=> t
find-symbol to search the obarray (or the
standard obarray) for a symbol called symbol-name. If a symbol of
that name is found it is returned, otherwise a new symbol of that name is
created, interned into the obarray, and returned.
(intern "setq")
=> setq
(intern "my-symbol" my-obarray)
=> my-symbol
(intern-symbol (make-symbol "foo"))
=> foo
(intern-symbol 'foo)
error--> Error: Symbol is already interned, foo
Beware! this function must be used with extreme caution -- once you unintern a symbol there's no way to recover it.
(unintern 'setq) ;This is extremely stupid
=> setq
Go to the first, previous, next, last section, table of contents.