2014-11-13 16:00:44 -05:00
|
|
|
USING: accessors kernel sequences system vocabs ;
|
2013-11-16 14:58:37 -05:00
|
|
|
IN: alien.libraries.finder
|
2013-11-07 18:30:23 -05:00
|
|
|
|
2014-06-07 23:48:09 -04:00
|
|
|
HOOK: find-library* os ( name -- path/f )
|
|
|
|
|
|
|
|
: find-library ( name -- path/library-not-found )
|
|
|
|
dup find-library* [ nip ] when* ;
|
2014-07-08 13:40:33 -04:00
|
|
|
|
|
|
|
! Try to find the library from a list, but if it's not found,
|
|
|
|
! try to open a library that is the first name in that list anyway
|
2015-07-18 23:14:22 -04:00
|
|
|
! or "library_not_found" as a last resort for better debugging.
|
2014-07-08 13:21:50 -04:00
|
|
|
: find-library-from-list ( seq -- path/f )
|
2014-07-08 14:58:34 -04:00
|
|
|
dup [ find-library* ] map-find drop
|
2014-07-08 14:13:41 -04:00
|
|
|
[ nip ] [ ?first "library_not_found" or ] if* ;
|
2013-11-04 11:28:45 -05:00
|
|
|
|
2014-11-13 16:00:44 -05:00
|
|
|
"alien.libraries.finder." os name>> append require
|