We're updating the issue view to help you get more done. 

Defining a record with defrecord twice breaks record equality

Description

If I spin up a fresh repl and type the following four lines, I consistently get this unexpected behavior. I discovered it because it was breaking a unit test.

1 2 3 4 5 6 7 8 9 user> (defrecord Foo [bar]) user.Foo user> (= (->Foo 42) #user.Foo{:bar 42}) ;;expect this to evaluate to true true user> (defrecord Foo [bar]) user.Foo user> (= (->Foo 42) #user.Foo{:bar 42}) ;;expect this to evaluate to true also -- but it doesn't! false user>

This may be related to http://dev.clojure.org/jira/browse/CLJ-1457.

You may also find the following interesting (posted by a fellow irc chatter, reproducible on my machine):

1 2 3 4 5 6 7 8 user=> (defrecord Foo [a]) user.Foo user=> #user.Foo[1] #user.Foo{:a 1} user=> (defrecord Foo [b]) user.Foo user=> (Foo. 1) #user.Foo{:a 1}

Environment

None

Status

Assignee

Unassigned

Reporter

import

Labels

Approval

None

Patch

None

Affects versions

Release 1.5
Release 1.7
Release 1.6

Priority

Minor