<commit_before>#include "ll_type.hpp"

using namespace std;

/* getters */
template<>
double lisplike_value::get_value() const { return real_value; }
template<>
const string& lisplike_value::get_value() const { return str_value; }
template<>
const vector<lisplike_value> lisplike_value::get_value() const { return list_value; }

template<>
void lisplike_value::set_value(const string& value)
{
  type = lisplike_type::str;
  str_value = value;
}

/*
 * Warning: don't use this when you're doing regular coding - attempt to use
 * the const string& instead - this prevents unnecessary copying.
 */
template<>
void lisplike_value::set_value(string value)
{
  type = lisplike_type::str;
  str_value = value;
}

template<>
void lisplike_value::set_value(double value)
{
  type = lisplike_type::real;
  real_value = value;
}

template<>
void lisplike_value::set_value(const vector<lisplike_value>& list)
{
  type = lisplike_type::list;
  list_value = list;
}

template<>
void lisplike_value::set_value(vector<lisplike_value> list)
{
  type = lisplike_type::list;
  list_value = list;
}

ostream& operator<<(ostream& os, const lisplike_value& ll_val)
{
  switch(ll_val.get_type())
  {
    case lisplike_type::str:
      os << ll_val.get_value<const string&>();
      break;
    case lisplike_type::real:
      os << ll_val.get_value<double>();
      break;
    case lisplike_type::list:
      os << ll_val;
      break;
    case lisplike_type::dict:
      assert(false && "Unreachable code reached");
      break;
    case lisplike_type::none:
      os << "None";
  }
  return os;
}

ostream& operator<<(ostream& os, const vector<lisplike_value>& ll_vals)
{
  for(auto ll : ll_vals)
    os << ll << " ";
  return os;
}<commit_msg>Remove accidental fall-through in ostream operator<< for lisplike_value<commit_after>#include "ll_type.hpp"

using namespace std;

/* getters */
template<>
double lisplike_value::get_value() const { return real_value; }
template<>
const string& lisplike_value::get_value() const { return str_value; }
template<>
const vector<lisplike_value> lisplike_value::get_value() const { return list_value; }

template<>
void lisplike_value::set_value(const string& value)
{
  type = lisplike_type::str;
  str_value = value;
}

/*
 * Warning: don't use this when you're doing regular coding - attempt to use
 * the const string& instead - this prevents unnecessary copying.
 */
template<>
void lisplike_value::set_value(string value)
{
  type = lisplike_type::str;
  str_value = value;
}

template<>
void lisplike_value::set_value(double value)
{
  type = lisplike_type::real;
  real_value = value;
}

template<>
void lisplike_value::set_value(const vector<lisplike_value>& list)
{
  type = lisplike_type::list;
  list_value = list;
}

template<>
void lisplike_value::set_value(vector<lisplike_value> list)
{
  type = lisplike_type::list;
  list_value = list;
}

ostream& operator<<(ostream& os, const lisplike_value& ll_val)
{
  switch(ll_val.get_type())
  {
    case lisplike_type::str:
      os << ll_val.get_value<const string&>();
      break;
    case lisplike_type::real:
      os << ll_val.get_value<double>();
      break;
    case lisplike_type::list:
      os << ll_val;
      break;
    case lisplike_type::dict:
      assert(false && "Unreachable code reached");
      break;
    case lisplike_type::none:
      os << "None";
      break;
  }
  return os;
}

ostream& operator<<(ostream& os, const vector<lisplike_value>& ll_vals)
{
  for(auto ll : ll_vals)
    os << ll << " ";
  return os;
}
{'fraction_non_alphanumeric': 0.1278772378516624, 'fraction_numerical': 0.0, 'mean_word_length': 4.382262996941896, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 31, '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': '7520962', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1228, 'n_words': 282}