ns-decl? treats (ns) as valid

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.

Environment

None

Activity

Show:
James Laver
March 28, 2016, 12:45 PM

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

Stuart Sierra
April 1, 2016, 3:33 PM

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?

Assignee

Stuart Sierra

Reporter

James Laver

Labels

None

Approval

None

Patch

Code

Priority

Minor
Configure