core.logic

partitiono in c.c.logic.bench is emitting calls to 1-ary version of partition

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Running clojure.tools.analyzer over core.logic raised an exception about an invocation of clojure.core/partition with a wrong arity.

It looks like it's partitiono's fault

(defne partitiono [a b c d]
  ([[x . l] _ [x . l1] _]
     (conda
       ((project [x b]
          (== (≤ x b) т))
        (partition l b l1 d))
       (partition l b c d))))

Here's the full macroexpansion:

(def partitiono (fn* ([a b c d] (fn* ([a7537] (fn* -inc ([] (clojure.core.logic.protocols/bind a7537 (fn* ([a__4345__auto__] (fn* -inc ([] (let* [x (clojure.core.logic/lvar (quote x)) l       
  (clojure.core.logic/lvar (quote l))] (clojure.core.logic.protocols/bind (clojure.core.logic.protocols/bind a__4345__auto__ (clojure.core.logic/== (clojure.core.logic/lcons x l) a)) (fn*       
  ([a__4345__auto__] (fn* -inc ([] (let* [l1 (clojure.core.logic/lvar (quote l1))] (clojure.core.logic.protocols/bind (clojure.core.logic.protocols/bind a__4345__auto__ (clojure.core.logic/==   
  (clojure.core.logic/lcons x l1) c)) (fn* ([a7544] (clojure.core.logic.protocols/ifa ((fn* ([a7546] (let* [x (clojure.core.logic/walk* a7546 x) b (clojure.core.logic/walk* a7546 b)] ((fn*      
  ([a__4345__auto__] (fn* -inc ([] (let* [] (clojure.core.logic.protocols/bind a__4345__auto__ (clojure.core.logic/== (clojure.lang.Numbers/lte x b) true))))))) a7546)))) a7544)                 
  [(clojure.core/partition l b l1 d)] (new clojure.lang.Delay (fn* ([] (clojure.core.logic.protocols/ifa (clojure.core/partition a7544) [l b c d] nil)))))))))))))))))))))))))))

Note the "(clojure.core/partition a7544)" near the end.

I am not familiar with core.logic so I don't know if this is simply a typo somewhere or a deeper bug so I set the priority to Major.

Activity

David Nolen made changes -
Field Original Value New Value
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: