2023-12-11 13:42:14 +01:00
|
|
|
~~~
|
|
|
|
'HOME d:create #1025 allot
|
|
|
|
|
|
|
|
'%s/.config/retroforth/library/%s.retro 'library:.CONFIG s:const
|
|
|
|
'./library/%s.retro 'library:CWD s:const
|
|
|
|
|
|
|
|
:library:cwd library:CWD s:format ;
|
|
|
|
|
|
|
|
:library:.config
|
|
|
|
'HOME &HOME unix:getenv
|
|
|
|
&HOME library:.CONFIG s:format ;
|
|
|
|
|
|
|
|
:library:filename (s-s)
|
|
|
|
dup library:cwd
|
|
|
|
dup file:exists? [ nip ] if; drop
|
|
|
|
library:.config dup file:exists? [ ] if; drop s:empty ;
|
|
|
|
|
|
|
|
:library:contains? (s-f)
|
|
|
|
&library:cwd &library:.config bi &file:exists? bi@ or ;
|
|
|
|
|
|
|
|
:library:load
|
|
|
|
dup library:contains? [ library:filename include ]
|
2024-01-06 23:57:29 +01:00
|
|
|
[ 'ERROR:_Library_`%s`_was_not_found s:format s:put nl ] choose ;
|
2023-12-11 13:42:14 +01:00
|
|
|
~~~
|