Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-30 Thread ataggart
On Apr 29, 10:43 pm, David Nolen dnolen.li...@gmail.com wrote: My rule of thumb is: use + :only require + :as (inc *1) -- 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

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-30 Thread Heinz N. Gies
On Apr 30, 2010, at 9:15 , ataggart wrote: On Apr 29, 10:43 pm, David Nolen dnolen.li...@gmail.com wrote: My rule of thumb is: use + :only require + :as (inc *1) (inc *1) (conj *2 Also use is handy for your own nameslaces, if you've a project that consists out of more then one

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-30 Thread Stuart Sierra
On Apr 30, 1:43 am, David Nolen dnolen.li...@gmail.com wrote: My rule of thumb is: use + :only require + :as Yes. clojure.contrib.string deliberately has short function names, which means there is some overlap with clojure.core. Note: (use '[clojure.contrib.string :as st :only ()]) also

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-30 Thread gary ng
On Thu, Apr 29, 2010 at 10:43 PM, David Nolen dnolen.li...@gmail.comwrote: My rule of thumb is: use + :only require + :as I believe this should be documented as the 'suggested usage'. As contrary to Python where 'from module import *'(which is 'use' in clojure) is right in there saying 'you

what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread gary ng
Clojure 1.2.0-master-SNAPSHOT user= (use `clojure.contrib.string) java.lang.IllegalStateException: repeat already refers to: #'clojure.core/repeat in namespace: user (NO_SOURCE_FILE:0) By going through the source, I see c.c.s deliberately exclude certain symbols but don't know how to do it in

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread ataggart
user= (defn repeat [x] x) java.lang.Exception: Name conflict, can't def repeat because namespace: user refers to:#'clojure.core/repeat (NO_SOURCE_FILE:1) user= (ns my.ns (:refer-clojure :exclude [repeat])) nil my.ns= (defn repeat [x] x) #'my.ns/repeat On Apr 29, 6:08 pm, gary ng

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread gary ng
On Thu, Apr 29, 2010 at 7:24 PM, ataggart alex.tagg...@gmail.com wrote: user= (defn repeat [x] x) java.lang.Exception: Name conflict, can't def repeat because namespace: user refers to:#'clojure.core/repeat (NO_SOURCE_FILE:1) user= (ns my.ns (:refer-clojure :exclude [repeat])) nil my.ns=

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread Meikel Brandmeyer
Hi, On Thu, Apr 29, 2010 at 08:32:12PM -0700, gary ng wrote: thanks. Though I found this behavior a bit annoying. What seems to be happening is that I need to exclude all the symbols that is excluded by c.c.string again if I use 'use ...' why would 'repeat' all of a sudden appear again if it

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread gary ng
On Thu, Apr 29, 2010 at 9:11 PM, Meikel Brandmeyer m...@kotka.de wrote: c.c.string is not designed to be used like that. Use require plus an alias: (require '[clojure.contrib.string :as s]). Then repeat is the core repeat and s/repeat is the string repeat. What would be the use case of

Re: what is wrong with (use `clojure.contrib.string) ?

2010-04-29 Thread David Nolen
On Fri, Apr 30, 2010 at 1:32 AM, gary ng garyng2...@gmail.com wrote: On Thu, Apr 29, 2010 at 9:11 PM, Meikel Brandmeyer m...@kotka.de wrote: c.c.string is not designed to be used like that. Use require plus an alias: (require '[clojure.contrib.string :as s]). Then repeat is the core