Welcome! Please see the About page for a little more info on how this works.

0 votes
in REPL by
closed by

So, i've been refreshing the language a bit since im still trying to make my clojure knowledge permanent on long-term memory. Had setup a Remote WSL 2.0 connection to an Arch Linux using VSCode on the host: Windows 11 since i default to developing in Linux for everything.

Problem is simple i guess, but im unable to pinpoint.

trying to call (read-line) from clojure.core renders an Could not resolve symbol: read-line in my Calva's output, which is using Joyride to start the REPL.

isn't core loaded by default? what's going on

;checking if ns is the problem
(ns encoder)

;repl output check
(defn queue [] 0)
(println str (queue))

(def files-list)
(do (print "Name yourself now: ")
    (read-line)) => Could not resolve symbol: read-line

;debug test
(println "Enter (literal) filename to encode> ")
(def input (read-line)) => Could not resolve symbol: read-line
(println (str "File to encode: " input))
;cant call read-line from core? wtf

;finish this
(defn add-queue-confirm [filenames]
  (println "Files to process: " filenames))
closed with the note: Problem solved.

1 Answer

+1 vote
selected by
Best answer

If you are using Joyride, this isn't JVM Clojure.

Joyride is a ClojureScript environment to script VSCode which is using SCI to interpret the ClojureScript. Like ClojureScript it has no read-line function in the core library.

edited by
Woah, i thought it supported both clj and cljs. Should i use Leiningen then? What's the recommended go-to these days? (guess i'll mess with ClojureScript later on)
Joyride is a great environment for learning Clojure. It has different constraints, like no `read-line`, as you have noticed, but generally it is a very complete Clojure implementation.

If you want to learn with JVM Clojure, I recommend creating yourself a minimal  `deps.edn` project and work from there. It can be as minimal as

    ├── deps.edn
    └── src
        └── hello.clj

And the `deps.edn` file can contain just an empty map `{}`.

Then use Calva Jack-in to start a REPL for this project (**Calva: Start a Project REPL and Connect**).
i see, many thanks to both of you