[ "benchmark/sum-file" vocab-path ] unit-test
{ "resource:extra/benchmark/sum-file/" }
-[ "benchmark/sum-file/" vocab-path ] unit-test
\ No newline at end of file
+[ "benchmark/sum-file/" vocab-path ] unit-test
+
+! Would be a core/ path except the path already exists in basis
+{ "resource:basis/bootstrap/finish-bootstrap.factor" }
+[ "bootstrap/finish-bootstrap.factor" vocab-path ] unit-test
\ No newline at end of file
[ drop not-found-in-roots ]
[ nip ] if ;
+! If path exists use it, otherwise try to find a vocab that exists
M: string vocab-path
- {
- { [ dup ?last path-separator? ] [ find-root-for-vocab-pathname ] }
- { [ dup has-file-extension? ] [
- [ ensure-parent-directory-is-not-dot find-root-for-vocab-pathname ]
- [ file-name ] bi append-path
- ] }
- [ find-root-for-vocab-pathname ]
- } cond ;
+ dup find-root-for [
+ prepend-path
+ ] [
+ {
+ { [ dup ?last path-separator? ] [ find-root-for-vocab-pathname ] }
+ { [ dup has-file-extension? ] [
+ [ ensure-parent-directory-is-not-dot find-root-for-vocab-pathname ]
+ [ file-name ] bi append-path
+ ] }
+ [ find-root-for-vocab-pathname ]
+ } cond
+ ] if* ;
PRIVATE>