use crate::ast::Value; use std::collections::HashMap; pub struct Builtins {} impl Builtins { pub fn new() -> HashMap { let mut map = HashMap::new(); map.insert("+".to_string(), Value::Prim("+".to_string())); map } } pub fn plus(v: Value) -> Value { match v { Num(i) => Lam(gensym(), } } pub fn builtins(sym: &String) -> Option Value>> { match sym.as_str() { "+" => Some(Box::new(plus)), _ => None, } }