Clojure

Records with fields named "values"

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: Release 1.2
  • Fix Version/s: Release 1.3
  • Component/s: None
  • Labels:
    None
  • Approval:
    Ok

Description

It looks to me like there is a problem in records when the field name "values" is used:

(defrecord Foo [values])

(= (Foo. 1)
(Foo. 1))

;; -> false

Activity

Hide
Fogus added a comment -

Hi David,

This condition seems to go back to 1.2 and still exists in version 1.3.0-alpha7. We'll take a look.

Thank you

Show
Fogus added a comment - Hi David, This condition seems to go back to 1.2 and still exists in version 1.3.0-alpha7. We'll take a look. Thank you
Hide
Fogus added a comment -

The problem seems to occur whenever a field name conflicts with a name of one of the record's protocol functions:

(defrecord R [isEmpty])

(= (R. 42) (R. 42))
;=> false

(defrecord RR [count])

(= (RR. 42) (RR. 42))
;=> false

Either this should be made to work, or an error signalled regarding a name clash. Anyone have an opinion?

Show
Fogus added a comment - The problem seems to occur whenever a field name conflicts with a name of one of the record's protocol functions: (defrecord R [isEmpty]) (= (R. 42) (R. 42)) ;=> false (defrecord RR [count]) (= (RR. 42) (RR. 42)) ;=> false Either this should be made to work, or an error signalled regarding a name clash. Anyone have an opinion?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: