core.logic

prep does not make lvar of ?x if ?x is in a vector

Details

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

Description

In latest master:

user=> (use 'clojure.core.logic.unifier)
user=> (prep '([?x]))
([<lvar:?x>]) ;; ok. ?x turned into an lvar
user=> (prep '([?x] . ?xs))
([?x] . <lvar:?xs>) ;; fail. ?x is not an lvar

The last expression should return ([<lvar:?x>] . <lvar:?xs>)

  1. LOGIC-118-version2.diff
    09/Nov/14 11:29 PM
    2 kB
    Jennifer Smith
  2. LOGIC-118.diff
    12/Mar/13 12:10 AM
    0.9 kB
    Jonas Enlund

Activity

Hide
Jonas Enlund added a comment -

patch LOGIC-118.diff fixes this issue. I'm not sure if it does so correctly.

Show
Jonas Enlund added a comment - patch LOGIC-118.diff fixes this issue. I'm not sure if it does so correctly.
Hide
David Nolen added a comment -

It's seem to me that this should be corrected in prep*? It looks like the issue is that prep* only handles seqs and not collections in general.

Show
David Nolen added a comment - It's seem to me that this should be corrected in prep*? It looks like the issue is that prep* only handles seqs and not collections in general.
Hide
Jennifer Smith added a comment -

This should address the issue merely by swapping out (seq? ...) with (coll? ...) - passes the supplied test case.

Show
Jennifer Smith added a comment - This should address the issue merely by swapping out (seq? ...) with (coll? ...) - passes the supplied test case.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated: