2023-12-11 13:42:14 +01:00
|
|
|
~~~
|
2024-09-09 20:18:25 +02:00
|
|
|
:HOME (:-s) here #4096 + ;
|
2023-12-11 13:42:14 +01:00
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
'%s/.config/retroforth/library/%s.retro 'library:.CONFIG s:const (:-s)
|
|
|
|
'./library/%s.retro 'library:CWD s:const (:-s)
|
2023-12-11 13:42:14 +01:00
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:library:cwd (:s-s) library:CWD s:format ;
|
2023-12-11 13:42:14 +01:00
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:library:.config (:-s)
|
2024-01-10 23:26:59 +01:00
|
|
|
'HOME HOME unix:getenv
|
|
|
|
HOME library:.CONFIG s:format ;
|
2023-12-11 13:42:14 +01:00
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:library:filename (:s-s)
|
2023-12-11 13:42:14 +01:00
|
|
|
dup library:cwd
|
2024-09-09 20:07:02 +02:00
|
|
|
dup file:exists? &nip if; drop
|
2023-12-11 13:42:14 +01:00
|
|
|
library:.config dup file:exists? [ ] if; drop s:empty ;
|
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:library:contains? (:s-f)
|
2023-12-11 13:42:14 +01:00
|
|
|
&library:cwd &library:.config bi &file:exists? bi@ or ;
|
|
|
|
|
2024-09-09 20:07:02 +02:00
|
|
|
:library:load (:s-)
|
2023-12-11 13:42:14 +01:00
|
|
|
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 ;
|
2024-01-08 19:24:08 +01:00
|
|
|
|
|
|
|
'interface/library.retro s:dedup
|
|
|
|
dup 'library:load d:set-source
|
|
|
|
dup 'library:contains? d:set-source
|
|
|
|
dup 'library:filename d:set-source
|
|
|
|
dup 'library:.config d:set-source
|
|
|
|
dup 'library:cwd d:set-source
|
|
|
|
dup 'library:CWD d:set-source
|
|
|
|
dup 'library:.CONFIG d:set-source
|
|
|
|
dup 'HOME d:set-source
|
|
|
|
drop
|
2023-12-11 13:42:14 +01:00
|
|
|
~~~
|