Clojure

"/" in keyword leads to unexpected behavior when calling `name`

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Because `clojure.lang.Keyword` delegates it's `getName` functionality to `clojure.lang.Symbol`, there is some unexpected behavior when calling `name` on a keyword that contains a "/" in it. For example:

(name (keyword "foo/bar"))
=> "bar"

This is due to `Symbol` stripping all namespace qualifiers and considering only the content trailing the "/" as part of the name.

Activity

Hide
Darrell Hamilton added a comment -

Totally misunderstood the behavior of namespaced keywords. this can be closed.

/derp

Show
Darrell Hamilton added a comment - Totally misunderstood the behavior of namespaced keywords. this can be closed. /derp

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: