2016-12-12 09:11:42 +01:00
|
|
|
;;; Get a frozenset of Hy reserved words
|
2020-01-03 19:47:51 +01:00
|
|
|
;; Copyright 2020 the authors.
|
2017-04-27 23:16:57 +02:00
|
|
|
;; This file is part of Hy, which is free software licensed under the Expat
|
|
|
|
;; license. See the LICENSE.
|
2016-12-12 09:11:42 +01:00
|
|
|
|
|
|
|
(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
|
2018-10-23 20:41:20 +02:00
|
|
|
(list (.keys hy.core.macros.__macros__))
|
2016-12-12 09:11:42 +01:00
|
|
|
keyword.kwlist
|
2018-04-22 21:48:37 +02:00
|
|
|
(list (.keys hy.compiler._special_form_compilers))
|
|
|
|
(list hy.compiler._bad_roots)))))))
|
2016-12-12 09:11:42 +01:00
|
|
|
_cache)
|