Allow :require to support a :refer clause

Description

There's been discussion previously about the complexity of the ns
macro. In particular the fact that :use causes all vars to be referred
by default is widely seen as unfortunate, and the distinction between
use and require is a source of conceptual overhead for people new to
the language.

We can't change the fact that :use refers everything by default
without breaking lots of existing code. But it would be possible to
enhance :require to support referring specified vars, leaving us free
to deprecate or otherwise discourage the use of :use.

Clojure-dev thread discussing this: http://groups.google.com/group/clojure-dev/browse_thread/thread/91b708ddb909affd

Environment

None

Attachments

1

Activity

Stuart Sierra 
February 17, 2012 at 8:18 PM

Patch applied.

Stuart Sierra 
February 17, 2012 at 8:08 PM

Not "Test." Screened. The patch is Screened. I hate this.

Stuart Sierra 
February 17, 2012 at 7:59 PM

My mistake. The docstring is included in 'require', but not in 'refer', which also changed. But the public API of 'refer' did not change. So this patch is good.

Stuart Sierra 
February 17, 2012 at 7:55 PM

Not Vetted. I can't remember what the names mean. Ready for Rich. That's "Test" right?

Stuart Sierra 
February 17, 2012 at 7:36 PM

Vetted. Patch is good, although it needs docstring updates in 'require'

Completed

Details

Assignee

Reporter

Labels

Approval

Patch

Priority

Created November 17, 2011 at 10:08 PM
Updated February 17, 2012 at 8:18 PM
Resolved February 17, 2012 at 8:18 PM