<commit_before>#include <b9/ExecutionContext.hpp>

#include <iostream>

using namespace b9;

/// ( number -- 0 )
extern "C" void b9_prim_print_number(ExecutionContext *context) {
  StackElement number = context->pop();
  std::cout << number << std::endl;
  context->push(OMR::Om::Value(0));
}

/// ( string -- 0 )
extern "C" void b9_prim_print_string(ExecutionContext *context) {
  auto value = context->pop();
  assert(value.isInteger());
  auto string = context->virtualMachine()->getString(value.getInteger());
  std::cout << string << std::endl;
  context->push(OMR::Om::Value(0));
}

extern "C" void b9_prim_print_stack(ExecutionContext *context) {
  std::cout << "----------stack begin\n";
  printStack(std::cout, context->stack());
  std::cout << "----------stack end" << std::endl;
  context->push(OMR::Om::Value(0));
}
<commit_msg>b9_prim_print_number assert that we have an integer<commit_after>#include <b9/ExecutionContext.hpp>

#include <iostream>

using namespace b9;

/// ( number -- 0 )
extern "C" void b9_prim_print_number(ExecutionContext *context) {
  auto number = context->pop();
  assert(number.isInteger());
  std::cout << number << std::endl;
  context->push(OMR::Om::Value(0));
}

/// ( string -- 0 )
extern "C" void b9_prim_print_string(ExecutionContext *context) {
  auto value = context->pop();
  assert(value.isInteger());
  auto string = context->virtualMachine()->getString(value.getInteger());
  std::cout << string << std::endl;
  context->push(OMR::Om::Value(0));
}

extern "C" void b9_prim_print_stack(ExecutionContext *context) {
  std::cout << "----------stack begin\n";
  printStack(std::cout, context->stack());
  std::cout << "----------stack end" << std::endl;
  context->push(OMR::Om::Value(0));
}

{'fraction_non_alphanumeric': 0.20804597701149424, 'fraction_numerical': 0.01206896551724138, 'mean_word_length': 4.598070739549839, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 23, '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': '6471918', 'n_tokens_mistral': 574, 'n_tokens_neox': 571, 'n_words': 115}