public static eValue macroexpand(eValue ast, Env env) { while (is_macro_call(ast, env)) { eSymbol a0 = (eSymbol)((eList)ast) [0]; eFunction mac = (eFunction)env.get(a0); ast = mac.apply(((eList)ast).rest()); } return(ast); }
public eValue get(eSymbol key) { Env e = find(key); if (e == null) { throw new Evil.Types.eException($"'{key.getName()}' not found"); } else { return(e.data[key.getName()]); } }
public Env find(eSymbol key) { if (data.ContainsKey(key.getName())) { return(this); } else if (outer != null) { return(outer.find(key)); } else { return(null); } }
public Env set(eSymbol key, eValue value) { data[key.getName()] = value; return(this); }