<< Back to previous view

[LOGIC-151] partitiono in c.c.logic.bench is emitting calls to 1-ary version of partition Created: 15/Dec/13  Updated: 20/Dec/13  Resolved: 20/Dec/13

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nicola Mometto Assignee: David Nolen
Resolution: Completed Votes: 0
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.



 Comments   
Comment by David Nolen [ 20/Dec/13 12:18 PM ]

fixed, https://github.com/clojure/core.logic/commit/dba36dd1219ee45812aaa3ffb558f176072e7d3a

Generated at Fri Aug 29 05:09:22 CDT 2014 using JIRA 4.4#649-r158309.