basilisp-lang / basilisp

A Clojure-compatible(-ish) Lisp dialect targeting Python 3.9+
https://basilisp.readthedocs.io
Eclipse Public License 1.0
290 stars 8 forks source link

Issues with `condp` #1137

Closed chrisrink10 closed 1 day ago

chrisrink10 commented 1 day ago

There are a few different issues with Basilisp's implementation of condp:

(condp = :a :b true :c true)  ;;=> nil
basilisp.user=> (condp = "a"
                                "b" :b
                                "a" nil
                                "c" :c
                                :a)

  exception: <class 'basilisp.lang.exception.ExceptionInfo'> from <class 'basilisp.lang.compiler.exception.CompilerException'>
      phase: :macroexpansion
    message: error occurred during macroexpansion: expected result expression {:test "a"}
       form: (basilisp.core/condp = "a" "a" nil "c" :c :a)
   location: <REPL Input>:NO_SOURCE_LINE