]> gitweb.factorcode.org Git - factor.git/commitdiff
io.pathnames: remove file-directory (redundant to parent-directory).
authorJohn Benediktsson <mrjbq7@gmail.com>
Tue, 23 Oct 2012 16:47:57 +0000 (09:47 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 23 Oct 2012 16:47:57 +0000 (09:47 -0700)
core/io/pathnames/pathnames-docs.factor
core/io/pathnames/pathnames.factor

index fa9d67b09118f7790ecf8d57b7d36f5cd5c95600..0eee8e87b9546a4d1aa4fbcab64d9bd11bfbbd17 100644 (file)
@@ -39,15 +39,7 @@ HELP: file-stem
     { $example "USING: io.pathnames prettyprint ;" "\"/home/csi/gui.vbs\" file-stem ." "\"gui\"" }
 } ;
 
-HELP: file-directory
-{ $values { "path" "a pathname string" } { "directory" string } }
-{ $description "Outputs the directory of " { $snippet "path" } " with the " { $link file-name } " removed, if any." }
-{ $examples
-    { $example "USING: io.pathnames prettyprint ;" "\"/usr/bin/gcc\" file-directory ." "\"/usr/bin\"" }
-    { $example "USING: io.pathnames prettyprint ;" "\"/home/csi/gui.vbs\" file-directory ." "\"/home/csi\"" }
-} ;
-
-{ file-name file-stem file-extension file-directory } related-words
+{ file-name file-stem file-extension } related-words
 
 HELP: path-components
 { $values { "path" "a pathnames string" } { "seq" sequence } }
index a3dd04afefcc692b73592584b62fdf88d796c97f..005d73a596d0528080c312f2ff268a0a5b88a6bc 100644 (file)
@@ -76,13 +76,6 @@ ERROR: no-parent-directory path ;
         [ f ]
     } cond ;
 
-: special-path ( path -- prefix )
-    {
-        { [ dup "resource:" head? ] [ drop "resource:" ] }
-        { [ dup "vocab:" head? ] [ drop "vocab:" ] }
-        [ drop "" ]
-    } cond ;
-
 PRIVATE>
 
 : absolute-path? ( path -- ? )
@@ -132,11 +125,6 @@ PRIVATE>
 : file-extension ( path -- extension )
     file-name "." split1-last nip ;
 
-: file-directory ( path -- directory )
-    [ special-path ] [ special-path? drop ] bi
-    dup last-path-separator [ head append ] [ 2drop ] if
-    [ path-separator ] when-empty ;
-
 : path-components ( path -- seq )
     normalize-path path-separator split harvest ;