core.logic

Unified map values are returned as LVar rather than the unified value in ClojureScript

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
  • Environment:
    ClojureScript

Description

This works correctly in core.logic for clojure:

(run 1 [q]
     (fresh [v]
            (== v 1)
            (== {:x v} q)))

In ClojureScript, I get this though:

({:x <lvar:v_4>})

Activity

Norman Richards made changes -
Field Original Value New Value
Attachment 0001-logic-142-arraymap-not-correctly-walked.patch [ 13694 ]
Hide
Norman Richards added a comment -

The clojurescript code did not implement -walk-term for PersistentArrayMap.

I've copied the PersistentHashMap implementation for PersistentArrayMap. Note: the current implementation (walk-term-map*) does not actually work for hash maps due to the use of -next and -first. Changing these to next and first would fix this for hash maps, but I'm not sure if this has any implications in clojurescript or not.

Show
Norman Richards added a comment - The clojurescript code did not implement -walk-term for PersistentArrayMap. I've copied the PersistentHashMap implementation for PersistentArrayMap. Note: the current implementation (walk-term-map*) does not actually work for hash maps due to the use of -next and -first. Changing these to next and first would fix this for hash maps, but I'm not sure if this has any implications in clojurescript or not.
Hide
David Nolen added a comment -

Norman, do you mean -next, -first doesn't work for array maps?

Show
David Nolen added a comment - Norman, do you mean -next, -first doesn't work for array maps?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: