mu-scm: implement store->alist

Get information about the store as an alist.

Scm + cc + test + doc.
This commit is contained in:
Dirk-Jan C. Binnema
2025-07-09 21:50:31 +03:00
parent 8d46f80bb9
commit 6d72aa5c7f
5 changed files with 100 additions and 15 deletions

View File

@ -221,6 +221,13 @@ namespace Mu::Scm {
return scm_from_utf8_stringn(val.data(), val.size());
else if constexpr (is_char_array_v<Type>|| std::is_same_v<Type, const char*>)
return scm_from_utf8_string(val);
else if constexpr (std::is_same_v<Type, std::vector<std::string>>) {
SCM lst{SCM_EOL};
for (const auto& s: val)
lst = scm_append_x(scm_list_2(lst,
scm_list_1(to_scm(s))));
return lst;
}
else if constexpr (std::is_same_v<Type, bool>)
return scm_from_bool(val);
else if constexpr (std::is_same_v<Type, size_t>)