Changes all around - objects and GC

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-16 18:46:09 -04:00
parent a15dde0fc2
commit d5cf39108b
15 changed files with 223 additions and 203 deletions

View File

@@ -4,6 +4,13 @@ pub mod dict;
pub mod error;
pub mod fun;
//pub mod num;
pub mod ns {
use crate::{mem::ptr::DynRef, obj::Sym};
use std::collections::BTreeMap;
/// A namespace
pub type Ns = BTreeMap<Sym, DynRef>;
}
pub mod str;
pub mod sym {
pub type Sym = usize;
@@ -12,22 +19,21 @@ pub mod sym {
pub mod prelude {
pub use crate::{
obj::{
Attrs, Dict, DictRef, Fun, NativeFun, Str, StrRef, Sym, ObjCtx, Obj,
},
mem::{
ptr::{ObjRef, DynRef},
intern::Intern,
gc::Gc,
}
intern::Intern,
ptr::{DynRef, ObjRef},
},
obj::{Attrs, AttrsRef, Dict, DictRef, Fun, NativeFun, Ns, Obj, ObjCtx, Str, StrRef, Sym},
};
}
pub use self::{
attrs::Attrs,
attrs::{Attrs, AttrsBuilder, AttrsRef},
ctx::ObjCtx,
dict::{Dict, DictRef},
fun::{NativeFun, Fun},
fun::{Fun, NativeFun},
ns::Ns,
str::{Str, StrRef},
sym::Sym,
};