sim_lib_lang_islisp/
profile.rs1use sim_kernel::{Cx, Ref, Result, Symbol};
2use sim_lib_standard_core::{
3 FidelityBadge, LanguageProfile, OrganUse, ProfileBackingLib, ProfileRegistry,
4 install_language_profile,
5};
6
7use crate::{
8 islisp_conformance_test_symbol, islisp_dispatch_fidelity_symbol, islisp_lowering_symbol,
9 islisp_profile_symbol, islisp_reader_symbol,
10};
11
12pub fn islisp_profile() -> LanguageProfile {
18 let profile = islisp_profile_symbol();
19 let test = islisp_conformance_test_symbol();
20 LanguageProfile::new(profile.clone())
21 .with_reader(islisp_reader_symbol())
22 .with_lowering(islisp_lowering_symbol())
23 .with_eval_policy(Symbol::qualified("eval", "islisp-core"))
24 .with_organ(OrganUse::new(sim_lib_dispatch::dispatch_organ_symbol()))
25 .with_numeric_tower(Symbol::qualified("numbers", "islisp-core"))
26 .with_conformance_test(test.clone())
27 .with_fidelity_badge(FidelityBadge::new(
28 Ref::Symbol(profile),
29 islisp_dispatch_fidelity_symbol(),
30 1,
31 Ref::Symbol(test),
32 ))
33}
34
35pub fn install_islisp_profile(
55 cx: &mut Cx,
56 registry: &mut ProfileRegistry,
57) -> Result<LanguageProfile> {
58 install_language_profile(
59 cx,
60 registry,
61 islisp_profile(),
62 &[ProfileBackingLib::unresolved(
63 sim_lib_dispatch::dispatch_organ_symbol(),
64 Symbol::qualified("sim", "dispatch"),
65 )],
66 &[],
67 )
68}