Re: nameclashes with java.lang

2013-03-12 Thread Stuart Sierra
Actually, simply creating a namespace imports all of java.lang. The `ns` 
macro is responsible only for referring clojure.core. That's been true 
since 1.0.

The only workaround right now is ns-unmap.

-S


On Wednesday, March 6, 2013 8:33:34 AM UTC-5, Jim foo.bar wrote:

 On 06/03/13 10:41, Phillip Lord wrote: 
  Is there no equivalent to :refer-clojure for java.lang? 

 I think java.lang is imported by the ns macro...if you don't use it then 
 you don't get java.lang.* 

 Jim 


-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




nameclashes with java.lang

2013-03-06 Thread Phillip Lord



Is there no equivalent to :refer-clojure for java.lang? 

I've built a library for building OWL ontologies. It does this by
liberal use of Clojure vars, each pointing to a Java object representing
an ontology concept.

The difficulty is that I can and do get name clashes. Sometimes these
are with clojure.core, but they can be avoided; in fact, in practice,
these are often fewer because I use an different naming scheme
(CamelCase) for ontology terms. But I can't do this for java.lang. 

I *could* change the names of the vars that I create, but unfortunately
there are some names in java.lang that are hard to replace; so Process
and Object being the most obvious ones (both having very different and
more general meanings in my case). 


Currently I am limited to the ugliness of this:

(ns-unmap *ns* 'Process)
(defclass Process)

This is particularly unfortunate as I need to use *no* classes from
Java.lang. 

I guess I could write a general function which does this for all the
class names in java.lang. 

Phil

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nameclashes with java.lang

2013-03-06 Thread Jim - FooBar();

On 06/03/13 10:41, Phillip Lord wrote:

Is there no equivalent to :refer-clojure for java.lang?


I think java.lang is imported by the ns macro...if you don't use it then 
you don't get java.lang.*


Jim

--
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups Clojure group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.