package interpreter;

import java.util.Hashtable;

public class Environment
{
    private Environment parent;
    private Hashtable<String, SchemeObject> bindings;

    public Environment()
    {
        this(null, null, null);
    }

    public Environment(Environment parent, SchemePair params, SchemePair args)
    {
        this.parent = parent;
        this.bindings = new Hashtable<String, SchemeObject>();
    }

    public void define(String name, SchemeObject value)
    {
        this.bindings.put(name, value);
    }

    public void set(String name, SchemeObject value)
    {
        if(!this.bindings.containsKey(name)) {
            // error, binding not found
        } else {
            this.bindings.put(name, value);
        }
    }
}

@@ -68,17 +68,17 @@
 ironment
-%0A
+ 
 %7B%0A    pr
@@ -182,20 +182,16 @@
 onment()
-%0A   
  %7B%0A     
@@ -302,20 +302,16 @@
 ir args)
-%0A   
  %7B%0A     
@@ -452,36 +452,32 @@
 emeObject value)
-%0A   
  %7B%0A        this.
@@ -562,20 +562,16 @@
 t value)
-%0A   
  %7B%0A     
@@ -728,11 +728,269 @@
  %7D%0A    %7D
+%0A%0A    public SchemeObject lookUp(String name) %7B%0A        SchemeObject obj = this.bindings.get(name);%0A        if(obj == null && parent != null)%0A            obj = parent.lookUp(name);%0A%0A        // TODO: check if variable still not found%0A        return obj;%0A    %7D
 %0A%7D%0A

Fix Environment brace style and add lookUp