More REPL-friendly 'ns macro

Description

The 'ns macro is not as dynamic as it could be.
For instance, the following line typed in a repl (ns a)(ns b (:require a)) currently (1.4, 1.3, etc.) fails with an exception because the (:require a) call tries to reach the filesystem for file a.clj or a__init.class.

The attached patch ( dynamic-ns-patch2.diff ) allows a successful call to (ns a) behave the same as a successful call to (require 'a), adding namespace a to the list of loaded-libs.

Discussion on googlegroup's mailing list: http://groups.google.com/group/clojure-dev/browse_thread/thread/fb231e6fab4a5ad

Environment

None

Attachments

1

Activity

Show:

Herwig Hochleitner December 3, 2012 at 1:52 PM

I see this has already been screened, but FWIW I tested the repl with this patch and the behavior works for me.

Timothy Baldridge November 30, 2012 at 5:35 PM

Patch applies, fixes the bug. All tests pass.

Screened

Laurent PETIT November 29, 2012 at 4:41 PM

Tests added

Rich Hickey November 29, 2012 at 3:31 PM

screeners, please make sure this has tests before passing on

Completed

Assignee

Reporter

Approval

Patch

Priority

Affects versions

Fix versions

Created November 29, 2012 at 3:18 PM
Updated March 1, 2013 at 3:49 PM
Resolved March 1, 2013 at 3:49 PM