load stdlib code bit simplyfied

This commit is contained in:
2021-03-22 06:52:10 +01:00
parent 48ad953648
commit f0fab9a9ec
2 changed files with 12 additions and 13 deletions

18
ml.h
View File

@@ -10,16 +10,14 @@
const std::string VERSION = "mi 0.1 (" __DATE__ " " __TIME__ ")";
const std::string STDLIB_LOADER =
R"( (define ___lib_path '("/usr/local/var/mlisp"))
(for d ___lib_path
(if (is-dir? d)
(for f (ls-dir d)
(if (string-regex? f "^.*\.l(i)?sp$")
(include (+ d "/" f))
'())
)
'()))
)";
R"(
(do (define ___lib_path "/usr/local/var/mlisp")
(if (is-dir? ___lib_path)
(for file (ls-dir ___lib_path)
(if (string-regex? file "^.*\.l(i)?sp$")
(include (+ ___lib_path "/" file)))
)))
)";
// Forward declaration for MlEnvironment class definition