From 12bc53bde14f45d4301b74777c4fb5f66d014707 Mon Sep 17 00:00:00 2001 From: Luke Peterson Date: Thu, 5 Oct 2023 14:00:26 +0900 Subject: [PATCH] Fixing build warnings and compile errors with minimal MeTTa --- lib/src/metta/runner/stdlib.rs | 3 +++ lib/src/metta/runner/stdlib2.rs | 12 ++++++++++++ lib/tests/metta.rs | 3 +++ 3 files changed, 18 insertions(+) diff --git a/lib/src/metta/runner/stdlib.rs b/lib/src/metta/runner/stdlib.rs index 404ca6863..28b21b75f 100644 --- a/lib/src/metta/runner/stdlib.rs +++ b/lib/src/metta/runner/stdlib.rs @@ -22,9 +22,12 @@ use super::arithmetics::*; pub const VOID_SYMBOL : Atom = sym!("%void%"); +//TODO: convert these from functions to static strcutures, when Atoms are Send+Sync +#[allow(non_snake_case)] pub fn UNIT_ATOM() -> Atom { Atom::expr([]) } +#[allow(non_snake_case)] pub fn UNIT_TYPE() -> Atom { Atom::expr([ARROW_SYMBOL]) } diff --git a/lib/src/metta/runner/stdlib2.rs b/lib/src/metta/runner/stdlib2.rs index 2a0659047..6aed1e254 100644 --- a/lib/src/metta/runner/stdlib2.rs +++ b/lib/src/metta/runner/stdlib2.rs @@ -16,6 +16,18 @@ use std::collections::HashMap; use super::arithmetics::*; +pub const VOID_SYMBOL : Atom = sym!("%void%"); + +//TODO: convert these from functions to static strcutures, when Atoms are Send+Sync +#[allow(non_snake_case)] +pub fn UNIT_ATOM() -> Atom { + Atom::expr([]) +} +#[allow(non_snake_case)] +pub fn UNIT_TYPE() -> Atom { + Atom::expr([ARROW_SYMBOL]) +} + #[derive(Clone, PartialEq, Debug)] pub struct GetTypeOp {} diff --git a/lib/tests/metta.rs b/lib/tests/metta.rs index eefa74fd7..eff89fdd5 100644 --- a/lib/tests/metta.rs +++ b/lib/tests/metta.rs @@ -1,4 +1,7 @@ +#[cfg(not(feature = "minimal"))] use hyperon::metta::runner::stdlib::UNIT_ATOM; +#[cfg(feature = "minimal")] +use hyperon::metta::runner::stdlib2::UNIT_ATOM; use hyperon::metta::text::*; use hyperon::metta::runner::new_metta_rust;