<commit_before>(ns reply.eval-modes.standalone
  (:require [reply.conversions :refer [->fn]]
            [reply.eval-modes.shared :as eval-modes.shared]
            [reply.eval-modes.standalone.concurrency :as concurrency]
            [reply.eval-state :as eval-state]
            [reply.exit :as exit]
            [reply.initialization :as initialization]
            [reply.parsing :as parsing]
            [reply.reader.simple-jline :as simple-jline]
            [reply.signals :as signals]))

(defn make-future-read-eval [options]
  (concurrency/act-in-future
    (fn [form]
      (eval-state/with-bindings
        (fn [] (eval (read-string form)))))))

(defn make-reply-read-eval [options]
  (let [future-read-eval (make-future-read-eval options)]
    (fn [form]
      (simple-jline/shutdown)
      (future-read-eval form))))

(defn handle-ctrl-c [signal]
  (concurrency/stop-running-actions))

(defn execute [{:keys [value-to-string print-value print-out print-err] :as options}
               form]
  (let [reply-read-eval (make-reply-read-eval options)
        failure-sentinel (Object.)
        result (if (empty? form)
                 failure-sentinel
                 (do
                   (try (reply-read-eval form)
                   (catch InterruptedException e nil)
                   (catch Throwable t
                     (let [e (clojure.main/repl-exception t)]
                       ((or print-err print) e)
                       (println))
                 failure-sentinel))))]
    ;lazyseq: (1 2 3 4 5 ...)
    ;pr: "(1 2 3 4 5 ...)"
    (when (not= failure-sentinel result)
      (print-value (value-to-string result))
      (when (:interactive options) (println)))
    (eval-state/get-ns-string)))

(defn run-repl [{:keys [prompt subsequent-prompt history-file
                        input-stream output-stream read-line-fn]
                 :as options}]
  (loop [ns (eval-state/get-ns-string)]
    (let [eof (Object.)<commit_msg>Fix misleading indentation and remove useless (do ...)<commit_after>(ns reply.eval-modes.standalone
  (:require [reply.conversions :refer [->fn]]
            [reply.eval-modes.shared :as eval-modes.shared]
            [reply.eval-modes.standalone.concurrency :as concurrency]
            [reply.eval-state :as eval-state]
            [reply.exit :as exit]
            [reply.initialization :as initialization]
            [reply.parsing :as parsing]
            [reply.reader.simple-jline :as simple-jline]
            [reply.signals :as signals]))

(defn make-future-read-eval [options]
  (concurrency/act-in-future
    (fn [form]
      (eval-state/with-bindings
        (fn [] (eval (read-string form)))))))

(defn make-reply-read-eval [options]
  (let [future-read-eval (make-future-read-eval options)]
    (fn [form]
      (simple-jline/shutdown)
      (future-read-eval form))))

(defn handle-ctrl-c [signal]
  (concurrency/stop-running-actions))

(defn execute [{:keys [value-to-string print-value print-out print-err] :as options}
               form]
  (let [reply-read-eval (make-reply-read-eval options)
        failure-sentinel (Object.)
        result (if (empty? form)
                 failure-sentinel
                 (try (reply-read-eval form)
                 (catch InterruptedException e nil)
                 (catch Throwable t
                   (let [e (clojure.main/repl-exception t)]
                     ((or print-err print) e)
                     (println))
                   failure-sentinel)))]
    ;lazyseq: (1 2 3 4 5 ...)
    ;pr: "(1 2 3 4 5 ...)"
    (when (not= failure-sentinel result)
      (print-value (value-to-string result))
      (when (:interactive options) (println)))
    (eval-state/get-ns-string)))

(defn run-repl [{:keys [prompt subsequent-prompt history-file
                        input-stream output-stream read-line-fn]
                 :as options}]
  (loop [ns (eval-state/get-ns-string)]
    (let [eof (Object.)
{'fraction_non_alphanumeric': 0.13850063532401524, 'fraction_numerical': 0.005082592121982211, 'mean_word_length': 1.9931558935361218, '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': '6946432', 'n_tokens_mistral': 1244, 'n_tokens_neox': 1187, 'n_words': 285}