Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add aliases: ns->path and path->ns #36

wants to merge 2 commits into from

2 participants


So I added aliases for backward compatibility


I don't see any really compelling reason to add these aliases. Aliases don't work well anyways, because of metadata. I don't think either of these names are better than the other.

@Raynes Raynes closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 4 deletions.
  1. +4 −2 src/fs/core.clj
  2. +2 −2 test/fs/core_test.clj
6 src/fs/core.clj
@@ -398,7 +398,7 @@ If 'trim-ext' is true, any extension is trimmed."
of the second."
[p c] (some #{(file p)} (parents c)))
-(defn ns-path
+(defn ns->path
"Takes a namespace symbol and creates a path to it. Replaces hyphens with
underscores. Assumes the path should be relative to cwd."
@@ -408,7 +408,7 @@ If 'trim-ext' is true, any extension is trimmed."
(replace \. \/))
-(defn path-ns
+(defn path->ns
"Takes a path to a Clojure file and constructs a namespace symbol
out of the path."
@@ -448,3 +448,5 @@ If 'trim-ext' is true, any extension is trimmed."
(set! *cwd* (file path)))
+(def ns-path ns->path)
+(def path-ns path->ns)
4 test/fs/core_test.clj
@@ -301,10 +301,10 @@
(child-of? "/foo/bar/baz" "/foo/bar") => falsey)
- (path-ns "foo/bar/baz_quux.clj") => '
+ (path->ns "foo/bar/baz_quux.clj") => '
- (str (ns-path ' => (has-suffix "foo/bar/baz_quux.clj"))
+ (str (ns->path ' => (has-suffix "foo/bar/baz_quux.clj"))
(absolute? "/foo/bar") => true
Something went wrong with that request. Please try again.