{ absolute-path? windows-absolute-path? root-directory? } related-words
-HELP: resource-path
+HELP: site-resource-path
{ $values { "path" "a pathname string" } { "newpath" "a pathname string" } }
-{ $description "Resolve a path relative to the Factor source code location." } ;
+{ $description "Resolve a path relative to the Factor installation directory." } ;
+
+HELP: user-resource-path
+{ $values { "path" "a pathname string" } { "newpath" "a pathname string" } }
+{ $description "Resolve a path relative to the user's " { $snippet "HOME/.factor" } " directory." } ;
HELP: pathname
{ $class-description "Class of path name objects. Path name objects can be created by calling " { $link <pathname> } "." } ;
M: object resolve-symlinks normalize-path ;
-: resource-path ( path -- newpath )
+: site-resource-path ( path -- newpath )
"resource-path" get prepend-path ;
+ALIAS: resource-path site-resource-path
+
HOOK: home io-backend ( -- dir )
M: object home "" resource-path ;
+: user-resource-path ( path -- newpath )
+ home ".factor" append-path prepend-path ;
+
: home-path ( path -- newpath ) home prepend-path ;
GENERIC: vocab-path ( path -- newpath )