<< Back to previous view

[CLJ-1116] More REPL-friendly 'ns macro Created: 29/Nov/12  Updated: 01/Mar/13  Resolved: 11/Dec/12

Status: Closed
Project: Clojure
Component/s: None
Affects Version/s: Release 1.3, Release 1.4
Fix Version/s: Release 1.5

Type: Defect Priority: Major
Reporter: Laurent Petit Assignee: Unassigned
Resolution: Completed Votes: 3
Labels: None

Attachments: File dynamic-ns-patch2.diff    
Patch: Code
Approval: Ok


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

Comment by Rich Hickey [ 29/Nov/12 9:31 AM ]

screeners, please make sure this has tests before passing on

Comment by Laurent Petit [ 29/Nov/12 10:41 AM ]

Tests added

Comment by Timothy Baldridge [ 30/Nov/12 11:35 AM ]

Patch applies, fixes the bug. All tests pass.


Comment by Herwig Hochleitner [ 03/Dec/12 7:52 AM ]

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

Generated at Tue Oct 24 06:37:15 CDT 2017 using JIRA 4.4#649-r158309.