On Sun, Jan 6, 2013 at 6:17 PM, Stuart Sierra
<the.stuart.sie...@gmail.com> wrote:
> 1. `refer`. Define a public function that `refer`s all the symbols you want.
> It's an extra step for the user, but that's good because it makes it evident
> that extra symbols are being added.

Forcing all users of a library to refer a whole slew of symbols from
another library that they don't even know they're using is horrible
usability and really not a useful suggestion. The user should be able
to (:require [main-library :refer [what i want]) without being forced
to know about a transitive dependency and know which symbols come from
which library, if the main-library developer wishes to provide a
single, simple API.

Could you explain exactly how this "breaks dynamic binding,
with-redefs, and the ability to redefine functions at the REPL" given
the scenario we're discussing? Remember that the whole purpose of this
discussion is to essentially hide the underlying namespace from which
symbols originate, and to present a single namespace with the desired
API.

> 2. `load`. If you have N namespaces with no clashing symbols, then you only
> need one namespace. If you want to split it across multiple files, use
> `load`. `clojure.core` does this.

Fine if you control all of the source yourself.

In the case of FW/1, I want a portion of Enlive available directly and
easily to users of FW/1. Enlive is a transitive dependency - users of
FW/1 don't need to know about it, and shouldn't really care.

Since this appears to be a relatively common use case for library
developers, perhaps a native Clojure solution that doesn't have the
downsides you list would be worth adding? Perhaps some sort of (export
some-ns/some-symbol) that makes *ns*/some-symbol appear like an exact
public alias of some-ns/some-symbol? So users of the library see those
exported symbols exactly as if they were declared in the library
itself, rather than the third-party dependency, and could interact
with them as such.
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

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