std lib load code reformat

This commit is contained in:
VaclavT 2021-03-07 19:12:30 +01:00
parent 01a16802da
commit e0ec884394
1 changed files with 11 additions and 10 deletions

21
ml.cpp
View File

@ -1633,16 +1633,17 @@ void repl(MlEnvironment &env) {
} }
void load_std_lib(MlEnvironment &env) { void load_std_lib(MlEnvironment &env) {
std::string loader = R"( (define ___lib_path '("/usr/local/var/mlisp")) std::string loader =
(for d ___lib_path R"( (define ___lib_path '("/usr/local/var/mlisp"))
(if (is-dir? d) (for d ___lib_path
(for f (ls-dir d) (if (is-dir? d)
(if (regex-search? f "^.*\.l(i)?sp$") (for f (ls-dir d)
(include (+ d "/" f)) (if (regex-search? f "^.*\.l(i)?sp$")
'()) (include (+ d "/" f))
) '())
'())) )
)"; '()))
)";
run(loader, env); run(loader, env);
} }