tools.namespace

tools.namespace ignores ns form dependencies inside vectors

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
  • Patch:
    Code and Test

Description

Cross reference: TLOG-13

For example, tools.logging has this ns form (metadata omitted):

(ns clojure.tools.logging
  [:use
   [clojure.string :only [trim-newline]]
   [clojure.pprint :only [code-dispatch pprint with-pprint-dispatch]]]
  [:require [clojure.tools.logging.impl :as impl]])

tools.namespace ignores these dependencies, only processing those that are in list subforms of the ns form.

Not sure if the best way to handle this is to update tools.logging or tools.namespace. tools.logging seems pretty unusual in using vectors like this, but the Clojure compiler seems to accept it just fine.

Activity

Hide
Stuart Sierra added a comment -

The ns macro docstring is quite clear that references inside it should be lists. I've seen a lot of weird ns forms, and this is the first time I've seen vectors used this way.

I would say I'm surprised that vectors work here, except nothing weird about the ns macro surprises me any more.

Show
Stuart Sierra added a comment - The ns macro docstring is quite clear that references inside it should be lists. I've seen a lot of weird ns forms, and this is the first time I've seen vectors used this way. I would say I'm surprised that vectors work here, except nothing weird about the ns macro surprises me any more.
Hide
Andy Fingerhut added a comment -

Temporarily reopening the ticket just to assign a patch for possible consideration. Will return it to the state I found it in when done.

Show
Andy Fingerhut added a comment - Temporarily reopening the ticket just to assign a patch for possible consideration. Will return it to the state I found it in when done.
Hide
Andy Fingerhut added a comment -

Proposed patch tns-21-v1.patch dated Dec 22 2014 would enable tools.namespace to recognize dependencies in ns forms where the references are vectors, in addition to lists.

Show
Andy Fingerhut added a comment - Proposed patch tns-21-v1.patch dated Dec 22 2014 would enable tools.namespace to recognize dependencies in ns forms where the references are vectors, in addition to lists.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: