<commit_before>from definitions import FunctionInstance
from evaluator import nil
from values import `$`

proc run_and_print*(function_instance: ptr FunctionInstance, frame_mem: pointer) =
  let res = evaluator.evaluate(function_instance, frame_mem)
  echo "Result: ", res

when is_main_module:
  import os, sugar, tables

  from poems import nil
  from universes import nil
  from utils import with_frame_mem

  let help = "Please run `vm.nim` with a `.poem` file as the first and the entry function's name as the second argument." &
    " The entry function should be a single function."
  if param_count() >= 2:<commit_msg>VM: Print types with the result value in `vm.run_and_print`.<commit_after>from definitions import FunctionInstance
from evaluator import nil
from types import `$`
from values import `$`, get_type

proc run_and_print*(function_instance: ptr FunctionInstance, frame_mem: pointer) =
  let res = evaluator.evaluate(function_instance, frame_mem)
  echo "Result: ", res, " :: ", get_type(res)

when is_main_module:
  import os, sugar, tables

  from poems import nil
  from universes import nil
  from utils import with_frame_mem

  let help = "Please run `vm.nim` with a `.poem` file as the first and the entry function's name as the second argument." &
    " The entry function should be a single function."
  if param_count() >= 2:
{'fraction_non_alphanumeric': 0.07902511078286559, 'fraction_numerical': 0.0014771048744460858, 'mean_word_length': 4.645833333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '565854', 'n_tokens_mistral': 396, 'n_tokens_neox': 389, 'n_words': 160}