From ec1809e7c0f5e183c68ec57af7043be371c2e02a Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 2 Aug 2020 17:05:17 -0600 Subject: [PATCH] Add memory: to null namespace, temporarily --- src/scheme/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/scheme/mod.rs b/src/scheme/mod.rs index d337a08..6638e34 100644 --- a/src/scheme/mod.rs +++ b/src/scheme/mod.rs @@ -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);