core.match

Map matching is broken for keywords with periods

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.6 alpha
  • Patch:
    Code and Test

Description

The compilation generates invalid code in the case where a map keyword contains a period (which is a legal character for a keyword).

 
(match {:a.b 1}
   {:a.b _} :foo)
;; CompilerException java.lang.ClassFormatError: Illegal field name "ocr_5762_0__5765_a.b__5768"

Among other things, this precludes the use of core.match on Datomic data.

Activity

Luke VanderHart made changes -
Field Original Value New Value
Description The compilation generates invalid code in the case where a map keyword contains a period (which is a legal character for a keyword).

  (match {:a.b 1}
    {:a.b _} :foo)
  ;; CompilerException java.lang.ClassFormatError: Illegal field name "ocr_5762_0__5765_a.b__5768"

Among other things, this precludes the use of core.match on Datomic data.
The compilation generates invalid code in the case where a map keyword contains a period (which is a legal character for a keyword).

````
(match {:a.b 1}
   {:a.b _} :foo)
;; CompilerException java.lang.ClassFormatError: Illegal field name "ocr_5762_0__5765_a.b__5768"
````

Among other things, this precludes the use of core.match on Datomic data.
Hide
David Nolen added a comment -

Thanks for the report seems simple to fix.

Show
David Nolen added a comment - Thanks for the report seems simple to fix.
Luke VanderHart made changes -
Description The compilation generates invalid code in the case where a map keyword contains a period (which is a legal character for a keyword).

````
(match {:a.b 1}
   {:a.b _} :foo)
;; CompilerException java.lang.ClassFormatError: Illegal field name "ocr_5762_0__5765_a.b__5768"
````

Among other things, this precludes the use of core.match on Datomic data.
The compilation generates invalid code in the case where a map keyword contains a period (which is a legal character for a keyword).

{noformat}
(match {:a.b 1}
   {:a.b _} :foo)
;; CompilerException java.lang.ClassFormatError: Illegal field name "ocr_5762_0__5765_a.b__5768"
{noformat}

Among other things, this precludes the use of core.match on Datomic data.
Hide
Luke VanderHart added a comment -

Awesome. Are you looking at it right now? Otherwise I might dig into the code myself since this is blocking me at the moment.

Show
Luke VanderHart added a comment - Awesome. Are you looking at it right now? Otherwise I might dig into the code myself since this is blocking me at the moment.
Luke VanderHart made changes -
Patch Code and Test [ 10002 ]
Attachment 0001-test-and-fix-for-MATCH-92.patch [ 12703 ]
Hide
Luke VanderHart added a comment -

Uploaded patch

Show
Luke VanderHart added a comment - Uploaded patch
Hide
David Nolen added a comment -

Patch looks good to me. Thanks! I will apply later today and cut another release.

Show
David Nolen added a comment - Patch looks good to me. Thanks! I will apply later today and cut another release.
David Nolen made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: