Fork me on GitHub
#beginners
<
2020-10-18
>
stopa06:10:50

re: rewrite clj and other comments — love those community and language. Thanks team!

sogaiu07:10:36

@stopachka i'm also a rewrite-clj* user and think it is a fine alternative -- there is also: https://github.com/carocad/parcera (which i am also a user of)

❤️ 1
Joe15:10:49

I'm trying to launch a clj project from a main entry point using the instructions https://www.clojure.org/guides/deps_and_cli#_using_a_main, but am getting the following error

$ clj -X hello/run
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-X (No such file or directory)

Full report at:
/tmp/clojure-8241978478714474545.edn
It looks like it's trying to find the file -X. What am I doing wrong?

Joe16:10:32

Also tried with this deps.edn

{:paths ["src"]
 :aliases
 {:main {:exec-fn main/run}}}
and this main.clj
(ns main)

(defn run [opts]
  (println "Hello, World"))
running clj -X:main same result

andy.fingerhut16:10:13

What OS? What is the output of clj -Sdescribe ?

Joe16:10:18

OS is Ubuntu, -Sdescribe is

$ clj -Sdescribe
{:version "1.10.1.483"
 :config-files ["/usr/local/lib/clojure/deps.edn" "/home/joe/.clojure/deps.edn" "deps.edn" ]
 :config-user "/home/joe/.clojure/deps.edn"
 :config-project "deps.edn"
 :install-dir "/usr/local/lib/clojure"
 :config-dir "/home/joe/.clojure"
 :cache-dir ".cpcache"
 :force false
 :repro false
 :resolve-aliases ""
 :classpath-aliases ""
 :jvm-aliases ""
 :main-aliases ""
 :all-aliases ""}

andy.fingerhut16:10:47

I believe that is a version before the -X option was implemented.

Joe16:10:17

Thanks, will try upgrading

andy.fingerhut16:10:47

No facepalm required -- the Clojure CLI tools have been going through a fair number of changes this past several months, so it is easy to have an older version that doesn't have all the latest features

Joe16:10:40

Works fine now, thanks very much!

Vahe16:10:09

hi all, how can I get (in separate lines)

"hello
 world"
instead of "hello world" while running (str "hello " "world").

dpsutton16:10:42

you need a newline character then. (str "hello" "\n" "world") or just "hello\nworld"

Vahe16:10:54

@dpsutton I want to concatenate some strings and get result similar to JSON format as can be seen in this example, not all on one line

{
 "name": "John",
 "age": 30
 }

dpsutton16:10:17

(clojure.string/join "\n" ["your" "collection" "of" "strings"]) -> "your\ncollection\nof\nstrings" which will have the newlines you want

dpsutton16:10:41

or if you have a known list just put newlines in there with your str call above

Vahe16:10:05

@dpsutton thanks so much, it is what I wanted

👍 1
kozmicluis20:10:35

Hii, I was wondering if vim-fireplace is still relevant and usable or should I just migrate to neovim and vim-iced?

dharrigan20:10:48

Yes, it's still very much relevant. I would suggest popping along to #vim and ask 🙂 I would encourage trying out vim-fireplace, vim-iced, conjure and see which one you like the best 🙂