<commit_before>#include <ostream>

#include "env.hh"
#include "printer.hh"
#include "zs_memory.hh"

using namespace std;

Env::Env(Env* e)
  : map_(), next_(e){
}

Env::~Env(){}

pair<Lisp_ptr, bool> Env::find(Lisp_ptr s) const{
  for(auto e = this; e; e = e->next_){
    auto ei = e->map_.find(s);
    if(ei != e->map_.end()){
      return {ei->second, true};
    }
  }
  return {{}, false};
}

void Env::set(Lisp_ptr s, Lisp_ptr p){
  for(auto e = this; e; e = e->next_){
    auto ei = e->map_.find(s);
    if(ei != e->map_.end()){
      e->map_.erase(ei);
      e->map_.insert({s, p});
      return;
    }<commit_msg>cleanup env<commit_after>#include <ostream>

#include "env.hh"
#include "printer.hh"
#include "zs_memory.hh"

using namespace std;

Env::Env(Env* e)
  : map_(), next_(e){
}

Env::~Env(){}

pair<Lisp_ptr, bool> Env::find(Lisp_ptr s) const{
  for(auto e = this; e; e = e->next_){
    auto ei = e->map_.find(s);
    if(ei != e->map_.end()){
      return {ei->second, true};
    }
  }
  return {{}, false};
}

void Env::set(Lisp_ptr s, Lisp_ptr p){
  for(auto e = this; e; e = e->next_){
    auto ei = e->map_.find(s);
    if(ei != e->map_.end()){
      e->map_[s] = p;
      return;
    }
{'fraction_non_alphanumeric': 0.21991701244813278, 'fraction_numerical': 0.0, 'mean_word_length': 3.0334448160535117, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6130841', 'n_tokens_mistral': 515, 'n_tokens_neox': 514, 'n_words': 114}