> But one issue I encountered with defprotocol is that there appears to
> be a possible symbol table/space issue. When I compile, I get warnings
> like the following:
>
> Warning: protocol #'beanstalk.core/BeanstalkObject is overwriting
> function read
> Warning: protocol #'beanstalk.core/BeanstalkObject is overwriting
> function peek
> Warning: protocol #'beanstalk.core/BeanstalkObject is overwriting
> function use
> WARNING: read already refers to: #'clojure.core/read in namespace:
> beanstalk.core, being replaced by: #'beanstalk.core/read
> WARNING: peek already refers to: #'clojure.core/peek in namespace:
> beanstalk.core, being replaced by: #'beanstalk.core/peek
> WARNING: use already refers to: #'clojure.core/use in namespace:
> beanstalk.core, being replaced by: #'beanstalk.core/use
> WARNING: read already refers to: #'clojure.core/read in namespace:
> beanstalk.core-test, being replaced by: #'beanstalk.core/read
> WARNING: peek already refers to: #'clojure.core/peek in namespace:
> beanstalk.core-test, being replaced by: #'beanstalk.core/peek
> WARNING: use already refers to: #'clojure.core/use in namespace:
> beanstalk.core-test, being replaced by: #'beanstalk.core/use
>
> Is there something I'm can do to prevent these collisions aside from
> using a different name for the method?

You should change your toplevel ns declaration to something like this -

(ns beanstalk.core
  ;; Don't refer to the following clojure.core functions
  (:refer-clojure :exclude [read peek use])
  (:use [clojure.contrib.condition :only [raise]]
        [clojure.string :only [split lower-case]]
        [clojure.pprint :only [pprint]]
        [clojure.java.io])
  (import [java.io BufferedReader]))

This won't refer to the conflicting functions and your life will be
easy :) If you still need those functions, you can call them by
namespace-qualifying the symbols like clojure.core/read, etc.

Hope that helps.

Regards,
BG

-- 
Baishampayan Ghose
b.ghose at gmail.com

-- 
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

Reply via email to