* src/lisp.h (SYMBOL_KEYWORD_P): Returns true if symbol is a keyword.
(LISP_SYMBOL_NAME): Basically the same as Fsymbol_name, a shortcut.
* src/data.c (Fsymbol_name): Use SYMBOL_KEYWORD_P.
* src/pkg.c (pkg_intern_keyword): Use SYMBOL_KEYWORD_P.
(register Lisp_Object symbol)
{
CHECK_SYMBOL (symbol);
- if (EQ (SYMBOL_PACKAGE (symbol), Vkeyword_package))
+ if (SYMBOL_KEYWORD_P (symbol))
return concat2 (build_string (":"), SYMBOL_NAME (symbol));
return SYMBOL_NAME (symbol);
}
return XSYMBOL (sym)->u.s.external;
}
+INLINE bool
+SYMBOL_KEYWORD_P (Lisp_Object sym)
+{
+ return EQ (XSYMBOL (sym)->u.s.package, Vkeyword_package);
+}
+
+INLINE Lisp_Object
+LISP_SYMBOL_NAME (Lisp_Object sym)
+{
+ if (SYMBOL_KEYWORD_P (sym))
+ return Fsymbol_name (sym);
+ return SYMBOL_NAME (sym);
+}
+
/* Value is non-zero if symbol cannot be changed through a simple set,
i.e. it's a constant (e.g. nil, t, :keywords), or it has some
watching functions. */
pkg_add_symbol (keyword, Vkeyword_package);
}
else
- eassert (EQ (SYMBOL_PACKAGE (keyword), Vkeyword_package));
+ eassert SYMBOL_KEYWORD_P (keyword);
return keyword;
}