Returns a Symbol with the given namespace and name. Arity-1 works on strings, keywords, and vars.
;; Returns a symbol with the given namespace and name. ;; ;; (symbol name): name can be a string or a symbol. ;; ;; (symbol ns name): ns and name must both be strings. ;; ;; A symbol string begins with a non-numeric character and can contain ;; alphanumeric characters and *, +, !, -, _, and ?. (see ;; https://clojure.org/reader for details). ;; ;; symbol does not validate input strings for ns and name, and may return ;; improper symbols with undefined behavior for non-conformant ns and ;; name. user=> (symbol 'foo) foo user=> (symbol "foo") foo user=> (symbol "clojure.core" "foo") clojure.core/foo
;; some gotchas to be aware of: user=> (symbol "user" 'abc) ClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/symbol (core.clj:523) user=> (symbol *ns* "abc") ClassCastException clojure.lang.Namespace cannot be cast to java.lang.String clojure.core/symbol (core.clj:523) user=> (symbol 'user "abc") ClassCastException clojure.lang.Symbol cannot be cast to java.lang.String clojure.core/symbol (core.clj:523) ;; Warning - the following generated symbols are non-conformant and may wreak ;; serious havoc in the near/far future when least expected... user=> (symbol "abc def") abc def user=> (symbol "123def") 123def user=> (symbol "/123/def/ghi") /123/def/ghi user=> (symbol "/abc/def/ghi") /abc/def/ghi
;; but keywords and numbers are not names (symbol 3) ;; Long cannot be cast to String ;; ... and so they cannot be converted to symbols (symbol :dog) ;; Keyword cannot be cast to String
The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader ...
Returns the namespace String of a symbol or keyword, or nil if not present.
Returns a Keyword with the given namespace and name. Do not use : in the keyword strings, it will...
Also reader macro: @ref/@agent/@var/@atom/@delay/@future/@promise. Within a transaction, returns t...
symbol