Function: intern

intern is a function defined in lread.c.

Signature

(intern STRING &optional OBARRAY)

Documentation

Return the canonical symbol whose name is STRING.

If there is none, one is created by this function and returned. A second optional argument specifies the obarray to use; it defaults to the value of obarray.

Other relevant functions are documented in the symbol group.

View in manual

Probably introduced at or before Emacs version 19.20.

Shortdoc

;; symbol
(intern "abc")
    => abc

Source Code

// Defined in /usr/src/emacs/src/lread.c
{
  Lisp_Object tem;

  obarray = check_obarray (NILP (obarray) ? Vobarray : obarray);
  CHECK_STRING (string);

  tem = oblookup (obarray, SSDATA (string), SCHARS (string), SBYTES (string));

  if (!BARE_SYMBOL_P (tem))
    tem = intern_driver (string, obarray, tem);
  return tem;
}