This commit is contained in:
Michiel Borkent 2020-04-06 20:33:50 +02:00
parent ddfce6ab12
commit e389413f6e

View file

@ -725,14 +725,13 @@ with `lein repl`:
(let [s (java.net.Socket. "localhost" port)
out (.getOutputStream s)
in (java.io.PushbackInputStream. (.getInputStream s))
_ (b/write-bencode out {"op" "eval" "code" (pr-str expr)})
value (get (b/read-bencode in) "value")]
(read-string value)))
_ (b/write-bencode out {"op" "eval" "code" expr})
bytes (get (b/read-bencode in) "value")]
(String. bytes)))
(nrepl-eval 65274 '(+ 1 2 3)) ;;=> 6
(nrepl-eval 52054 "(+ 1 2 3)") ;;=> "6"
```
## Differences with Clojure
Babashka is implemented using the [Small Clojure