equality of non-unique lvars broken for clojure 1.7


clojure 1.7 changes the interning of strings when creating symbols, as is described here

Therefore, two non-unique lvars with the same name don't have to be equal anymore with the current
Lvar equality method which checks (identical? name (:name o)).

This is causing expresso, which relies on non-unique lvars for the rule engine to fail with clojure 1.7

changing the identical? to a = fixes the issue.




David Nolen
July 3, 2015, 12:14 AM

When I apply this patch two tests fail. Can we fix these tests? Thanks!

July 26, 2015, 2:14 PM

Comment made by: mschuene

sorry for not responding quicker.
Which two tests are failing? It seems that they aren't always failing. I get zero failures with mvn test.
Also when I check out a fresh copy of core.logic master, apply the patch and run the tests all succeed.

~/programming $ git clone https://github.com/clojure/core.logic
Cloning into 'core.logic'...
remote: Counting objects: 14868, done.
remote: Total 14868 (delta 0), reused 0 (delta 0), pack-reused 14868
Receiving objects: 100% (14868/14868), 3.02 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (3955/3955), done.
Checking connectivity... done.
~/programming $ cd core.logic/
~/programming/core.logic $ git apply 0001-alter-equality-of-non-unique-lvars-for-clojure-1.7.patch
~/programming/core.logic $ mvn test
[INFO] Scanning for projects...
[WARNING] Some problems were encountered while building the effective model for org.clojure:core.logic:jar:0.8.11-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] ------------------------------------------------------------------------ [INFO] Building core.logic 0.8.11-SNAPSHOT
[INFO] ------------------------------------------------------------------------ [INFO]
[INFO] — maven-enforcer-plugin:1.0:enforce (enforce-maven) @ core.logic —
[INFO] — build-helper-maven-plugin:1.5:add-source (add-clojure-source-dirs) @ core.logic —
[INFO] Source directory: /home/kima/programming/core.logic/src/main/clojure added.
[INFO] — build-helper-maven-plugin:1.5:add-resource (add-clojure-source-dirs) @ core.logic —
[INFO] — build-helper-maven-plugin:1.5:add-test-source (add-clojure-test-source-dirs) @ core.logic —
[INFO] Test Source directory: /home/kima/programming/core.logic/src/test/clojure added.
[INFO] — build-helper-maven-plugin:1.5:add-test-resource (add-clojure-test-source-dirs) @ core.logic —
[INFO] — maven-resources-plugin:2.3:resources (default-resources) @ core.logic —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kima/programming/core.logic/src/main/resources
[INFO] Copying 14 resources
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ core.logic —
[INFO] Nothing to compile - all classes are up to date
[INFO] — clojure-maven-plugin:1.3.13:compile (clojure-compile) @ core.logic —
Compiling clojure.core.logic.unifier to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.nominal to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.datomic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.dcg to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.fd to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.pldb to /tmp/classes7718945366616667003.dir
Compiling cljs.core.logic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.arithmetic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.protocols to /tmp/classes7718945366616667003.dir
Compiling cljs.core.logic.pldb to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.bench to /tmp/classes7718945366616667003.dir
[INFO] — maven-resources-plugin:2.3:testResources (default-testResources) @ core.logic —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kima/programming/core.logic/src/test/resources
[INFO] Copying 3 resources
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ core.logic —
[INFO] Nothing to compile - all classes are up to date
[INFO] — maven-surefire-plugin:2.10:test (default-test) @ core.logic —
[INFO] Surefire report directory: /home/kima/programming/core.logic/target/surefire-reports

------------------------------------------------------- T E S T S
Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] — clojure-maven-plugin:1.3.13:test (clojure-test) @ core.logic —

Testing clojure.core.logic.pldb.tests

Testing clojure.core.logic.nominal.tests

Testing clojure.core.logic.tests

Ran 425 tests containing 661 assertions.
0 failures, 0 errors.
[INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------ [INFO] Total time: 33.466s
[INFO] Finished at: Sun Jul 26 14:03:54 CEST 2015
[INFO] Final Memory: 12M/300M
[INFO] ------------------------------------------------------------------------

~/programming/core.logic $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout – <file>..." to discard changes in working directory)

modified: src/main/clojure/clojure/core/logic.clj
modified: src/test/clojure/clojure/core/logic/tests.clj

no changes added to commit (use "git add" and/or "git commit -a")

August 5, 2015, 3:27 PM

Comment made by: ticking

I didn't see failing tests after applying this patch either.


David Nolen







Code and Test