use sim_kernel::{Cx, Result, Symbol};
use sim_lib_standard_core::{
LanguageProfile, OrganUse, ProfileRegistry, fidelity_badge, install_language_profile,
};
use crate::{
cl_binding_fidelity_symbol, cl_clos_mop_fidelity_symbol, cl_conformance_test_symbol,
cl_control_fidelity_symbol, cl_dispatch_fidelity_symbol, cl_lite_profile_symbol,
cl_lowering_symbol, cl_mutation_fidelity_symbol, cl_namespace_fidelity_symbol,
cl_reader_symbol,
};
pub fn cl_lite_profile() -> LanguageProfile {
let profile = cl_lite_profile_symbol();
let test = cl_conformance_test_symbol();
LanguageProfile::new(profile.clone())
.with_reader(cl_reader_symbol())
.with_lowering(cl_lowering_symbol())
.with_eval_policy(Symbol::qualified("eval", "common-lisp-lite"))
.with_organ(OrganUse::new(sim_lib_binding::binding_organ_symbol()))
.with_organ(OrganUse::new(sim_lib_control::control_organ_symbol()))
.with_organ(OrganUse::new(sim_lib_dispatch::dispatch_organ_symbol()))
.with_organ(OrganUse::new(sim_lib_namespace::namespace_organ_symbol()))
.with_organ(OrganUse::new(sim_lib_mutation::mutation_organ_symbol()))
.with_numeric_tower(Symbol::qualified("numbers", "common-lisp-lite"))
.requiring(sim_lib_mutation::standard_mutate_capability())
.with_unsupported_form(Symbol::qualified("cl", "full-clos-mop"))
.with_conformance_test(test.clone())
.with_fidelity_badge(fidelity_badge(
&profile,
cl_binding_fidelity_symbol(),
1,
&test,
))
.with_fidelity_badge(fidelity_badge(
&profile,
cl_control_fidelity_symbol(),
1,
&test,
))
.with_fidelity_badge(fidelity_badge(
&profile,
cl_dispatch_fidelity_symbol(),
1,
&test,
))
.with_fidelity_badge(fidelity_badge(
&profile,
cl_namespace_fidelity_symbol(),
1,
&test,
))
.with_fidelity_badge(fidelity_badge(
&profile,
cl_mutation_fidelity_symbol(),
1,
&test,
))
.with_fidelity_badge(fidelity_badge(
&profile,
cl_clos_mop_fidelity_symbol(),
0,
&test,
))
}
pub fn install_cl_lite_profile(
cx: &mut Cx,
registry: &mut ProfileRegistry,
) -> Result<LanguageProfile> {
install_language_profile(
cx,
registry,
cl_lite_profile(),
&[
sim_lib_binding::publish_binding_organ_claims_for_lib,
sim_lib_control::publish_control_organ_claims_for_lib,
sim_lib_dispatch::publish_dispatch_organ_claims_for_lib,
sim_lib_namespace::publish_namespace_organ_claims_for_lib,
sim_lib_mutation::publish_mutation_organ_claims_for_lib,
],
)
}