Refer is not use. If you expand the use of set, it boils down to
(require '[clojure.set :as s]) (refer '[clojure.set :exclude
'[difference]]).

If you do the same expansion for clojure.core, it works fine:
(ns sample
  (:refer-clojure :exclude [reset!])
  (:require [clojure.core :as c]))
sample=> c/reset!

Likewise, if you only refer to clojure.set instead of use'ing it,
the :as clause doesn't apply.

On May 20, 4:22 pm, Ken Wesson <kwess...@gmail.com> wrote:
> => (ns foo (:refer-clojure :exclude [reset!] :as c))
> nil
> => (def bar (atom []))
> #'foo/bar
> => (reset! bar [42])
> #<CompilerException java.lang.Exception: Unable to resolve symbol:
> reset! in this context (NO_SOURCE_FILE:1)>
> => (c/reset! bar [42])
> #<CompilerException java.lang.Exception: No such namespace: c
> (NO_SOURCE_FILE:1)>
> => (clojure.core/reset! bar [42])
> [42]
>
> Contrast with:
>
> => (ns bar (:use [clojure.set :exclude [difference] :as s]))
> nil
> => (def baz #{1 2 3})
> #'bar/baz
> => (difference baz #{1 4 5})
> #<CompilerException java.lang.Exception: Unable to resolve symbol:
> difference in this context (NO_SOURCE_FILE:1)>
> => (s/difference baz #{1 4 5})
> #{2 3}
>
> IMO, either :as in :refer-clojure should work or it should throw this:
>
> #<CompilerException java.lang.Exception: Unsupported option(s)
> supplied: :as (NO_SOURCE_FILE:1)>
>
> Preferably the former.
>
> --
> Protege: What is this seething mass of parentheses?!
> Master: Your father's Lisp REPL. This is the language of a true
> hacker. Not as clumsy or random as C++; a language for a more
> civilized age.

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