diff --git a/runtime/src/scm.rs b/runtime/src/scm.rs index 1c39ca1..1528046 100644 --- a/runtime/src/scm.rs +++ b/runtime/src/scm.rs @@ -5,7 +5,7 @@ use std::slice; use internment::Intern; -use crate::{gc}; +use crate::gc; pub type scm_bits = u64; diff --git a/runtime/src/var.rs b/runtime/src/var.rs index d9a6f7d..be2ba9c 100644 --- a/runtime/src/var.rs +++ b/runtime/src/var.rs @@ -1,26 +1,26 @@ use std::{collections::HashMap, ops::DerefMut as _, sync::{LazyLock, RwLock}}; use crate::scm::scm_bits; -// struct Vars ( -// LazyLock >> -// ); +struct Vars ( + LazyLock >> +); -// impl Vars { -// pub const fn new () -> Vars { -// Vars (LazyLock::new (|| RwLock::new (HashMap::new ()))) -// } +impl Vars { + pub const fn new () -> Vars { + Vars (LazyLock::new (|| RwLock::new (HashMap::new ()))) + } -// pub fn lookup (&self, name : SymbolU32) -> Option { -// // let r = self.0.write ().unwrap (); -// // (*r).get (&name).map (|x| *x) -// todo! () -// } + pub fn lookup (&self, name : String) -> Option { + // let r = self.0.write ().unwrap (); + // (*r).get (&name).map (|x| *x) + todo! () + } -// pub fn define (&self, name : SymbolU32, value : scm_bits) { -// // let mut r = self.0.write ().unwrap (); -// // r.deref_mut ().insert (name, value); -// todo! () -// } -// } + pub fn define (&self, name : String, value : scm_bits) { + // let mut r = self.0.write ().unwrap (); + // r.deref_mut ().insert (name, value); + todo! () + } +} -// static vars : Vars = Vars::new (); +static vars : Vars = Vars::new ();