(in-ns 'java)

3 views
Skip to first unread message

André Thieme

unread,
Oct 31, 2008, 2:57:43 PM10/31/08
to Clojure
I get a funny result when I say (in-ns 'java), on the repl.
I can’t switch back, as in (in-ns 'user).

Stuart Sierra

unread,
Oct 31, 2008, 4:49:05 PM10/31/08
to Clojure
On Oct 31, 2:57 pm, André Thieme <splendidl...@googlemail.com> wrote:
> I get a funny result when I say (in-ns 'java), on the repl.
> I can’t switch back, as in (in-ns 'user).

So don't do that. :)

Seriously, though, it looks like the Java runtime restricts the "java"
package. Clojure namespaces are (more or less) Java packages, which
is probably the source of the problem. So... don't do that.

user=> (in-ns 'java)
#=(find-ns java)
java=> (in-ns 'user)
java.lang.RuntimeException: java.lang.SecurityException: Prohibited
package name: java (NO_SOURCE_FILE:0)

user=> (in-ns 'java.lang)
#=(find-ns java.lang)
java.lang=> (in-ns 'user)
java.lang.RuntimeException: java.lang.SecurityException: Prohibited
package name: java.lang (NO_SOURCE_FILE:0)

-Stuart Sierra
Reply all
Reply to author
Forward
0 new messages