tools.namespace

ns-decl? treats (ns) as valid

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

If you try to declare an empty namespace with `(ns)`, you get an ArityException, but ns-decl? does not test for this.

The attached patch simply tests whether it is at least two items long.

I have previously signed the Clojure CA.

Activity

Hide
James Laver added a comment -

I'm wondering if it's worth updating my patch to also check that the namespace name is a symbol.

Show
James Laver added a comment - I'm wondering if it's worth updating my patch to also check that the namespace name is a symbol.
Hide
Stuart Sierra added a comment -

I feel like I need some more context here. What is the motivation for making a change in this case? Have you encountered real code in which (ns) causes a problem because tools.namespace accepts it as a valid namespace declaration?

Show
Stuart Sierra added a comment - I feel like I need some more context here. What is the motivation for making a change in this case? Have you encountered real code in which (ns) causes a problem because tools.namespace accepts it as a valid namespace declaration?

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: