got the dynaload + preload + sci kinda working, just need kaocha to co-operate.
looks like this atm:
(ns malli.sci
(:require #?(:clj [borkdude.dynaload-clj :refer [dynaload]]
:cljs [borkdude.dynaload-cljs :refer-macros [dynaload]])))
(defn evaluator [options]
(let [eval-string* @(dynaload 'sci.core/eval-string* {:default nil})
init @(dynaload 'sci.core/init {:default nil})
fork @(dynaload 'sci.core/fork {:default nil})]
(if (and eval-string* init fork)
(let [ctx (init options)]
(fn eval [s] (eval-string* (fork ctx) s))))))
the main-ns creates the evaluator with options and re-uses that.
Been there. I tried to fix the malli unit tests that are ran with koacha, but I ran into issues and decided to just write the library 😉
E.g. the preloads feature only works with clojure, not with clojurescript
😱