Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Kibit confuses (:foo bar) and [:foo bar] #49

Open
duck1123 opened this Issue Sep 5, 2012 · 2 comments

Comments

Projects
None yet
4 participants

duck1123 commented Sep 5, 2012

Given the code:

(fn [bar] [:foo bar])

Kibit will suggest replacing with

:foo

which is not equivalent.

It seems that kibit can't tell the two forms apart and is giving the suggestion for:

(fn [bar] (:foo bar))

magnars commented Jan 25, 2013

I came here to report the same issue. So +1.

mkremins commented Jun 5, 2014

The same issue is present for all anonymous function forms resembling (fn [] [foo]), where foo is a symbol or keyword. See also issue #92. Relevant rule code is here.

Haven't had time to fully understand the semantics of the core.logic code in the relevant rule, but it seems like this could potentially have something to do with how core.logic handles unification of sequential things; the suspicious bit seems to involve clojure.core.logic/llist.

@thomasmulvaney thomasmulvaney added a commit to thomasmulvaney/kibit that referenced this issue Jun 27, 2014

@thomasmulvaney thomasmulvaney Fixes #49
Anonymous functions rules now work.

The only failing tests now are to do with java interop.
16d1eca

@danielcompton danielcompton added the bug label Nov 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment