Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect mistaken Java enums / symbols in case form #214

Open
pbwolf opened this issue Feb 4, 2017 · 0 comments
Open

Detect mistaken Java enums / symbols in case form #214

pbwolf opened this issue Feb 4, 2017 · 0 comments

Comments

@pbwolf
Copy link

pbwolf commented Feb 4, 2017

Clojure's case form does not evaluate test constants. This trips folks up (CLJ-1367 and CLJ-1368) who expected case to evaluate symbols that indicate constants whose value the compiler knows. Eastwood could help by pointing out case test constants which, if evaluated, would also yield constants, the latter being perhaps what the programmer had intended for case to consider. For example, the following program ought to print 42.

(defn -main
  "I don't do a whole lot ... yet."
  [& args]
  (println
   (let [a OutputKeys/DOCTYPE_SYSTEM]
     (case a
       OutputKeys/DOCTYPE_PUBLIC :oops
       OutputKeys/DOCTYPE_SYSTEM 42
       ;;else
       :oops))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants