Clojure

case* and code walkers

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: Backlog
  • Component/s: None
  • Labels:
    None
  • Approval:
    Vetted

Description

Clojure 1.2.0-master-SNAPSHOT
user=> (use 'clojure.walk)
nil
user=> (eval (macroexpand-all '(case 1 1 :test)))
java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.MapEntry (NO_SOURCE_FILE:2)

user=> (macroexpand-all '(case 1 1 :test))
(let* [G__9 1]
(case* G__9 0 1 1 1
(throw (new java.lang.IllegalArgumentException (clojure.core/str "No matching clause: " G__9)))

{1 [1 :test]}

false))

The existing code walkers convert the embedded [1 :test] into a PersistentVector that the compiler doesn't accept.
(symbol-macrolet [x :test] (case 1 1 x)) fails in the same way.

Activity

Stuart Halloway made changes -
Field Original Value New Value
Assignee Stuart Halloway [ stu ]
Rich Hickey made changes -
Reporter Assembla Importer [ importer ]
Priority Blocker [ 1 ]
Waiting On richhickey
Rich Hickey made changes -
Waiting On richhickey
Colin Jones made changes -
Rich Hickey made changes -
Resolution Completed [ 1 ]
Status In Progress [ 3 ] Closed [ 6 ]

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: