feat: support map application #84
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Similar to #85.
Clojure 1.10.3 behavior:
({:k :v}) ;; => Execution error (ArityException) at user/eval1 (REPL:1). Wrong number of args (0) passed to: clojure.lang.PersistentArrayMap ({:k :v} :k) ;; => :v ({:k :v} :x :not-found) ;; => :not-found ({:k :v} :x :not-found :too-many) ;; => Execution error (ArityException) at user/eval1 (REPL:1). Wrong number of args (3) passed to: clojure.lang.PersistentArrayMap ({:k :v} ((fn [] :k))) ;; => :vbash command to generate above via the clj command-line tool
one-liner:
in a more human-friendly form:
ClojureRS prior to this PR:
({:k :v}) ;; => #Condition["Execution Error: clojure.lang.PersistentListMap cannot be cast to clojure.lang.IFn"] ({:k :v} :k) ;; => #Condition["Execution Error: clojure.lang.PersistentListMap cannot be cast to clojure.lang.IFn"] ({:k :v} :x :not-found) ;; => #Condition["Execution Error: clojure.lang.PersistentListMap cannot be cast to clojure.lang.IFn"] ({:k :v} :x :not-found :too-many) ;; => #Condition["Execution Error: clojure.lang.PersistentListMap cannot be cast to clojure.lang.IFn"] ({:k :v} ((fn [] :k))) ;; => #Condition["Execution Error: clojure.lang.PersistentListMap cannot be cast to clojure.lang.IFn"]ClojureRS with the changes in this PR applied:
({:k :v}) ;; => #Condition["Wrong number of arguments given to function (Given: 0, Expected: [1, 2])"] ({:k :v} :k) ;; => :v ({:k :v} :x :not-found) ;; => nil (todo: should be :not-found see https://github.com/clojure-rs/ClojureRS/issues/86) ({:k :v} :x :not-found :too-many) ;; => #Condition["Wrong number of arguments given to function (Given: 3, Expected: [1, 2])"] ({:k :v} ((fn [] :k))) ;; => :vbash command to generate above via the ClojureRS REPL
one-liner:
in a more human-friendly form: