Move serialisation to correct place

This commit is contained in:
Jeroen van Dijk 2021-05-27 13:09:23 +03:00
parent 085dcd326b
commit 860597cf05

View file

@ -15,7 +15,7 @@
(defn pr-code [code-str]
(let [s (pr-str (str "#_CODE_" code-str "#_CODE_"))]
(subs s 1 (dec (count s)))))
(str "\"" (subs s 1 (dec (count s))) "\"")))
(defn read-code [code]
(read-string (str "\"" code "\"")))
@ -27,7 +27,7 @@
(str "javascript:(function(){"
"var runCode = function() {
try {
scittle.core.eval_string(\"" (pr-code code-str) "\")
scittle.core.eval_string(" (pr-code code-str) ")
} catch (error) {
console.log('Error in code', error);
alert('Error running code, see console')