Welcome! Please see the About page for a little more info on how this works.

0 votes
in Java Interop by

As raised on the mailing list: https://groups.google.com/forum/#!topic/clojure/3yGjDO2YnjQ

It's not possible to use java constants in a case statement. condp = could be used in this case but these are things which could be used in a java switch statement and so it's annoying to give up constant time dispatch. For example:

(case (.getActionMasked event)
MotionEvent/ACTION_POINTER_DOWN :down
MotionEvent/ACTION_UP :up
MotionEvent/ACTION_POINTER_UP :up
MotionEvent/ACTION_MOVE :move
MotionEvent/ACTION_CANCEL :cancel
MotionEvent/ACTION_OUTSIDE :outside
:none))

Doesn't work, but there is no reason this couldn't be resolved at compile time and dispatched in constant time.

2 Answers

0 votes
by

Comment made by: bendlas

Another solution for this problem: http://dev.clojure.org/jira/browse/CLJ-1368

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1367 (reported by adamclements)
...