Add memory: to null namespace, temporarily

This commit is contained in:
Jeremy Soller
2020-08-02 17:05:17 -06:00
parent 6f3094cb2b
commit ec1809e7c0

View File

@@ -121,10 +121,21 @@ impl SchemeList {
next_ns: 1,
next_id: 1
};
list.new_null();
list.new_root();
list
}
/// Initialize the null namespace
fn new_null(&mut self) {
let ns = SchemeNamespace(0);
self.names.insert(ns, BTreeMap::new());
//TODO: Only memory: is in the null namespace right now. It should be removed when
//anonymous mmap's are implemented
self.insert(ns, Box::new(*b"memory"), |_| Arc::new(MemoryScheme::new())).unwrap();
}
/// Initialize a new namespace
fn new_ns(&mut self) -> SchemeNamespace {
let ns = SchemeNamespace(self.next_ns);