]> gitweb.factorcode.org Git - factor.git/blob - basis/alien/libraries/finder/finder.factor
7483b60488043a0cca1d5350bca0a32f534b3320
[factor.git] / basis / alien / libraries / finder / finder.factor
1 USING: accessors kernel sequences system vocabs ;
2 IN: alien.libraries.finder
3
4 HOOK: find-library* os ( name -- path/f )
5
6 : find-library ( name -- path/library-not-found )
7     dup find-library* [ nip ] when* ;
8
9 ! Try to find the library from a list, but if it's not found,
10 ! try to open a library that is the first name in that list anyway
11 ! or "library_not_found" as a last resort for better debugging. 
12 : find-library-from-list ( seq -- path/f )
13     dup [ find-library* ] map-find drop
14     [ nip ] [ ?first "library_not_found" or ] if* ;
15
16 "alien.libraries.finder." os name>> append require