What are the allowed characters in a Clojure keyword?

后端 未结 4 2154
挽巷
挽巷 2021-02-19 01:27

I am looking for a list of the allowed characters in a clojure keyword. Specifically I am interested to know if any of the following characters are allowed: -

4条回答
  •  臣服心动
    2021-02-19 02:02

    From that list, the reader certainly allows - and _, but / has a special meaning as the delimiter between namespaces and symbol names. Period (which you didn't ask about) is problematic inside symbol names as well, since it is used in fully-qualified Java class names.

    As far as Clojure idiom goes, - is your best friend in symbol names. It takes the place of camel case in Java or the underscore in Ruby.

提交回复
热议问题