/*
 * Simple Object (environment)
 *
 * Author(s) : Catalin Dumitrescu (catalind@acm.org)
 *
 * File: environ.cc
 * Created: Mon Aug 27 10:15:57 CDT 2001
 *
 */

#include "hash.hh"
#include "object.hh"
#include "environ.hh"
#include "scheme_exc.hh"

object* 
environ::clone () 
{ 
  environ* en = new environ (this->parent);
  en->content = this->content;
  return en;
} 

object* 
environ::lookup (string key) throw (schemeException) 
{ 
  try { 
    return content.lookup (key); 
  } catch (...) { 
    return NULL; 
  } 
}

object* 
environ::elookup (string key) throw (schemeException) 
{
  try {
    return content.lookup (key);
  } catch (...) { }
  try {
    if (parent != NULL)
      return parent->elookup (key);
  } catch (...) { }
  return NULL;
}


