cursive icon indicating copy to clipboard operation
cursive copied to clipboard

syntax checker does not understand `case` syntax

Open jimka2001 opened this issue 1 year ago • 0 comments

the static analyzer does not seem to understand the syntax of case. cursive claims there's an error in the (not) form. However, the code run correctly and prints 3 as expected. There's no error in the code.

(ns clojure-rte.xyzzy)
(defn x
  "docstring"
  [y]
  (case y
    (and) 1
    (or) 2
    (not) 3 ;; cursive thinks that not has the wrong number of arguments given
    4))

(print (x 'not)) ;; correctly prints 3

(not) is not a call to the not function, but rather a singleton list of literals.

Screenshot 2023-10-06 at 18 45 15

jimka2001 avatar Oct 06 '23 16:10 jimka2001