Clojure

defmulti should not add {:tag 'clojure.lang.MultiFn} to multimethod metatdata

Details

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

Description

defmulti's current behavior of adding a {:tag 'clojure.lang.MultiFn} to the new multimethod's metadata interferes with providing a type hint for the return value of the multimethod. This is easily fixed by deleting this behavior, as in the attached patch.

Activity

Hide
Assembla Importer added a comment -
Show
Assembla Importer added a comment - Converted from http://www.assembla.com/spaces/clojure/tickets/139 Attachments: 0003-Removed-tag-MultiFn-inserted-by-defmulti.patch - https://www.assembla.com/spaces/clojure/documents/cTOAMyzSmr3QQreJe5aVNr/download/cTOAMyzSmr3QQreJe5aVNr
Hide
Assembla Importer added a comment -

davidmiller said: [file:cTOAMyzSmr3QQreJe5aVNr]: Patch to core.clj to fix defmulti behavior

Show
Assembla Importer added a comment - davidmiller said: [file:cTOAMyzSmr3QQreJe5aVNr]: Patch to core.clj to fix defmulti behavior
Hide
Assembla Importer added a comment -

aaron said: before patch as of 167a73857a746e8dbeeb

user=> (defmulti foo "this is foo" {:author "me" :arglists '([bar])} type)
#'user/foo
user=> (meta (var foo))
{:ns #<Namespace user>, :name foo, :arglists ([bar]), :author "me", :doc "this is foo", :line 1, :file "NO_SOURCE_PATH", :tag clojure.lang.MultiFn}

after patch

user=> (defmulti foo "this is foo" {:author "me" :arglists '([bar])} type)
#'user/foo
user=> (meta (var foo))
{:ns #<Namespace user>, :name foo, :arglists ([bar]), :author "me", :doc "this is foo", :line 1, :file "NO_SOURCE_PATH"}

Show
Assembla Importer added a comment - aaron said: before patch as of 167a73857a746e8dbeeb user=> (defmulti foo "this is foo" {:author "me" :arglists '([bar])} type) #'user/foo user=> (meta (var foo)) {:ns #<Namespace user>, :name foo, :arglists ([bar]), :author "me", :doc "this is foo", :line 1, :file "NO_SOURCE_PATH", :tag clojure.lang.MultiFn} after patch user=> (defmulti foo "this is foo" {:author "me" :arglists '([bar])} type) #'user/foo user=> (meta (var foo)) {:ns #<Namespace user>, :name foo, :arglists ([bar]), :author "me", :doc "this is foo", :line 1, :file "NO_SOURCE_PATH"}
Hide
Assembla Importer added a comment -

stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

Show
Assembla Importer added a comment - stu said: Updating tickets (#139, #278, #285, #368, #443, #430)
Hide
Assembla Importer added a comment -

stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

Show
Assembla Importer added a comment - stu said: Updating tickets (#139, #278, #285, #368, #443, #430)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: