# core.logic

## Combining maps and finite domains in core.logic returns only one result

### Details

• Type: Defect
• Status: Closed
• Priority: Major
• Resolution: Completed
• Affects Version/s: None
• Fix Version/s: None
• Component/s: None
• Labels:
• Environment:
Clojure 1.4.0, core.logic 0.8.0-beta2

### Description

I'm trying to combine maps with finite domains with some odd results.

A simple query using finite domains correctly returns all values:

```(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q x)))

;=> (1 2 3)```

But putting this result in a map returns only the first value:

```(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q {:foo x})))

;=> ({:foo 1})```

FYI this works with vectors:

```(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q [x])))

;=> ([1] [2] [3])```

But lcons seems to fail as well:

```(run* [q]
(fresh [x]
(infd x (interval 1 3))
(== q (lcons x 'foo))))

;=> ((1 . foo))```

### Activity

Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
 Description I'm trying to combine maps with finite domains with some odd results. A simple query using finite domains correctly returns all values: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q x))) ;=> (1 2 3) But putting this result in a map returns only the first value: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q {:foo x}))) ;=> ({:foo 1}) FYI this works with vectors: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q [x]))) ;=> ([1] [2] [3]) But lcons seems to fail as well: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q (lcons x 'foo)))) ;=> ((1 . foo)) I'm trying to combine maps with finite domains with some odd results. A simple query using finite domains correctly returns all values: {code} (run* [q] (fresh [x] (infd x (interval 1 3)) (== q x))) ;=> (1 2 3) {code} But putting this result in a map returns only the first value: {code} (run* [q] (fresh [x] (infd x (interval 1 3)) (== q {:foo x}))) ;=> ({:foo 1}) {code} FYI this works with vectors: {code} (run* [q] (fresh [x] (infd x (interval 1 3)) (== q [x]))) ;=> ([1] [2] [3]) {code} But lcons seems to fail as well: {code} (run* [q] (fresh [x] (infd x (interval 1 3)) (== q (lcons x 'foo)))) ;=> ((1 . foo)) {code}
Hide
David Nolen added a comment -
 Resolution Completed [ 1 ] Status In Progress [ 3 ] Resolved [ 5 ]