in progress commit

- fixed errors in func and vars blocking testing
- use box references in call and eval
Still need to fix the tests themselves....
This commit is contained in:
Aidan 2021-03-07 19:24:38 -08:00
parent d2f60314f9
commit 76b12a8214
No known key found for this signature in database
GPG key ID: 327711E983899316
5 changed files with 44 additions and 63 deletions

View file

@ -21,14 +21,12 @@ use crate::cell::{Ctr};
/* Mapping between a string token and a tree of Cells
* The string token can be found in any Ctr::Symbol value
*
* Considerations: should I use a structure of cells for this?
* Current thoughts: if this was a language without proper data types, yes.
* it is expected that the trees stored are already evaluated
*/
pub type VTable = HashMap<String, Box<Ctr>>;
pub fn define(
vt: Box<VTable>,
vt: &mut Box<VTable>,
identifier: String,
var_tree: Box<Ctr>
) {
@ -36,14 +34,3 @@ pub fn define(
drop(boxed_cell);
}
}
pub fn get(
vt: Box<VTable>,
identifier: String
) -> Option<Box<Ctr>> {
if let Some(c) = vt.get(&identifier) {
Some(*c)
} else {
None
}
}