<commit_before>(import repl "repl")
(import vm "vm")
(import transpile "./engine/node")

(defn evaluate [code context file callback]
  (try
    (callback null
              (.run-in-this-context
               vm
               ;; Strip out first and last chars since node repl module
               ;; wraps code passed to eval function '()'.
               (transpile (.substring code 1 (- (.-length code) 2)) file)
               file))
    (catch error (callback error))))

(defn start
  "Starts repl"
  []
  (.start repl {
          :prompt "=> "
          :ignoreUndefined true
          :useGlobal true<commit_msg>Improve repl to print lisp forms instead of JS.<commit_after>(import repl "repl")
(import vm "vm")
(import transpile "./engine/node")
(import [pr-str] "./ast")

(defn evaluate [code context file callback]
  (try
    (callback null
              (.run-in-this-context
               vm
               ;; Strip out first and last chars since node repl module
               ;; wraps code passed to eval function '()'.
               (transpile (.substring code 1 (- (.-length code) 2)) file)
               file))
    (catch error (callback error))))

(defn start
  "Starts repl"
  []
  (.start repl {
          :writer pr-str
          :prompt "=> "
          :ignoreUndefined true
          :useGlobal true
{'fraction_non_alphanumeric': 0.1175584024114544, 'fraction_numerical': 0.003014318010550113, 'mean_word_length': 1.8682505399568035, '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': '2041396', 'n_tokens_mistral': 384, 'n_tokens_neox': 356, 'n_words': 132}