Clojure

Re-loading a namespace ignores metadata specified for the namespace

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: Release 1.5
  • Fix Version/s: None
  • Component/s: None

Description

Using the REPL I added some metadata to a namespace and reloaded it.

(ns io.aviso.rook-test5)

to

(ns io.aviso.rook-test5
  "A testing namespace"
  {:inherted   :namespace
   :overridden :namespace})

But requesting the meta data yields nil:

(-> 'io.aviso.rook-test5 find-ns meta)
=> nil

I have tested a few variations, such as putting the metadata on the symbol instead of providing an attribute map. In all cases, the metadata from before the load persists.

Using remove-ns before re-loading the namespace does the right thing ... the metadata shows up as expected.

Activity

Alex Miller made changes -
Field Original Value New Value
Description Using the REPL I added some meta-data to a namespace and reloaded it.

{code}
(ns io.aviso.rook-test5)
{code}

to

{code}
(ns io.aviso.rook-test5
  "A testing namespace"
  {:inherted :namespace
   :overridden :namespace})
{code}

But requesting the meta data yields nil:


{code}
(-> 'io.aviso.rook-test5 find-ns meta)
=> nil
{code}


I have tested a few variations, such as putting the meta-data on the symbol instead of providing a attribute map. In all cases, the meta-data from before the load persists.

Using {{ns-remove}} before re-loading the namespace does the right thing ... the meta data shows up as expected.
Using the REPL I added some metadata to a namespace and reloaded it.

{code}
(ns io.aviso.rook-test5)
{code}

to

{code}
(ns io.aviso.rook-test5
  "A testing namespace"
  {:inherted :namespace
   :overridden :namespace})
{code}

But requesting the meta data yields nil:


{code}
(-> 'io.aviso.rook-test5 find-ns meta)
=> nil
{code}


I have tested a few variations, such as putting the metadata on the symbol instead of providing a attribute map. In all cases, the metadata from before the load persists.

Using {{remove-ns}} before re-loading the namespace does the right thing ... the metadata shows up as expected.
Summary Re-loading a namespace ignores meta-data specified for the namespace Re-loading a namespace ignores metadata specified for the namespace
Alex Miller made changes -
Priority Major [ 3 ] Minor [ 4 ]
Howard Lewis Ship made changes -
Description Using the REPL I added some metadata to a namespace and reloaded it.

{code}
(ns io.aviso.rook-test5)
{code}

to

{code}
(ns io.aviso.rook-test5
  "A testing namespace"
  {:inherted :namespace
   :overridden :namespace})
{code}

But requesting the meta data yields nil:


{code}
(-> 'io.aviso.rook-test5 find-ns meta)
=> nil
{code}


I have tested a few variations, such as putting the metadata on the symbol instead of providing a attribute map. In all cases, the metadata from before the load persists.

Using {{remove-ns}} before re-loading the namespace does the right thing ... the metadata shows up as expected.
Using the REPL I added some metadata to a namespace and reloaded it.

{code}
(ns io.aviso.rook-test5)
{code}

to

{code}
(ns io.aviso.rook-test5
  "A testing namespace"
  {:inherted :namespace
   :overridden :namespace})
{code}

But requesting the meta data yields nil:


{code}
(-> 'io.aviso.rook-test5 find-ns meta)
=> nil
{code}


I have tested a few variations, such as putting the metadata on the symbol instead of providing an attribute map. In all cases, the metadata from before the load persists.

Using {{remove-ns}} before re-loading the namespace does the right thing ... the metadata shows up as expected.
Howard Lewis Ship made changes -
Comment [ Can't edit: that should be {{remove-ns}}. ]

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated: