beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
2020-10-18T01:11:26.152500Z

thank you. I will try clj-xchart first

2020-10-18T06:14:50.153900Z

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

2020-10-18T07:36:36.155600Z

@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
Joe 2020-10-18T15:45:49.158200Z

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?

Joe 2020-10-18T16:05:32.158300Z

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

2020-10-18T16:06:13.158500Z

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

Joe 2020-10-18T16:07:18.159Z

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 ""}

2020-10-18T16:07:47.159300Z

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

Joe 2020-10-18T16:08:00.159500Z

Oooh

Joe 2020-10-18T16:08:07.159700Z

🤦

Joe 2020-10-18T16:08:17.159900Z

Thanks, will try upgrading

2020-10-18T16:08:47.160200Z

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

Joe 2020-10-18T16:09:40.161100Z

Works fine now, thanks very much!

Karo 2020-10-18T16:11:09.162Z

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

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

dpsutton 2020-10-18T16:16:42.162600Z

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

Karo 2020-10-18T16:27:54.164100Z

@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
 }

dpsutton 2020-10-18T16:29:17.164500Z

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

dpsutton 2020-10-18T16:29:41.165Z

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

Karo 2020-10-18T16:39:05.165500Z

@dpsutton thanks so much, it is what I wanted

👍 1
kozmicluis 2020-10-18T20:04:35.166500Z

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

dharrigan 2020-10-18T20:21:48.167200Z

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 🙂