hy/hy/extra/reserved.hy

24 lines
657 B
Hy
Raw Normal View History

;;; Get a frozenset of Hy reserved words
2020-01-03 19:47:51 +01:00
;; Copyright 2020 the authors.
;; This file is part of Hy, which is free software licensed under the Expat
;; license. See the LICENSE.
(import hy sys keyword)
(setv _cache None)
(defn names []
"Return a frozenset of reserved symbol names.
The result of the first call is cached."
(global _cache)
(if (is _cache None) (do
(setv _cache (frozenset (map unmangle (+
2018-02-27 20:53:23 +01:00
hy.core.language.EXPORTS
hy.core.shadow.EXPORTS
(list (.keys hy.core.macros.__macros__))
keyword.kwlist
(list (.keys hy.compiler._special_form_compilers))
(list hy.compiler._bad_roots)))))))
_cache)