Fork me on GitHub
#beginners
<
2021-07-19
>
zackteo07:07:34

Hello, may I know what is a good way to rename keys in a hashmap from say an underscore version like - :lu_textΒ to a dash -Β `:lu-text` ? I saw there is clojure.set/rename-keys but I don't think that's what I want?

delaguardo07:07:48

Have a look at clojure.walk namespace.

zackteo07:07:01

I realised that my use-case for this - jdbc has an inbuilt way to do this πŸ™‚ but thank you!

pavlosmelissinos08:07:33

Take a look at the camel-snake-kebab library as well: https://clj-commons.org/camel-snake-kebab/ πŸ™‚

siva14:07:52

I'm trying to clojure -Ttools, however I get -T is no longer supported

siva14:07:40

I'm using clojure 1.11 alpha

ghadi14:07:43

update your version of the clojure CLI -- you need a prerelease

ghadi14:07:47

the clojure CLI != clojure

siva14:07:56

How to update

ghadi14:07:01

the clojure CLI can launch different versions of clojure

siva14:07:00

My deps.edn, how to invoke tools

dpsutton14:07:10

you need to update the command line program clojure, not any deps of your actual project

πŸ‘ 2
ghadi14:07:55

I can't find the official link to the prerelease install docs 😞

Alex Miller (Clojure team)14:07:01

use the instructions at https://github.com/clojure/homebrew-tools#version-archive-tool-releases to download the latest prerelease version 1.10.3.916

siva14:07:07

I tried with brew head it doesn't work

Alex Miller (Clojure team)14:07:57

brew uninstall clojure
brew install clojure/tools/[email protected]

Alex Miller (Clojure team)14:07:44

there may be other steps required depending on the history of your brew installation

Alex Miller (Clojure team)14:07:53

but brew will usually tell you what to do

siva14:07:55

It works, thanks. Brew upgrade doesn't upgrade to latest version for some reason

Alex Miller (Clojure team)15:07:58

FYI, that version is buggy and there is now a 1.10.3.920 :)

Alex Miller (Clojure team)15:07:18

this is a prerelease so is not yet a stable version available to upgrade

siva15:07:34

Ohh, thanks

Alex Miller (Clojure team)15:07:55

as a prerelease, you may encounter bugs or unstable behavior - feel free to ask in #tools-deps or file questions at https://ask.clojure.org

πŸ‘ 2
Hugo Bonatto19:07:58

Hi there, I'm trying to build a RN + ClojureScript + Krell application running in a windows machine RN project working fine, clj running on windows, but when trying to implement Krell, can't pass through this:

clj -M -m cljs.main -co "{:deps-cmd \"yarn\"}" --install-deps

Hugo Bonatto19:07:14

fails with Error building classpath. Specified aliases are undeclared: [:-m]

Hugo Bonatto19:07:15

in the first attempt, and subsequent attempts results in

Hugo Bonatto19:07:19

Exception in thread "main" java.io.FileNotFoundException: cljs.main (The system cannot find the file specified)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
        at clojure.lang.Compiler.loadFile(Compiler.java:7570)
        at clojure.main$load_script.invokeStatic(main.clj:452)
        at clojure.main$script_opt.invokeStatic(main.clj:512)
        at clojure.main$script_opt.invoke(main.clj:507)
        at clojure.main$main.invokeStatic(main.clj:598)
        at clojure.main$main.doInvoke(main.clj:561)
        at clojure.lang.RestFn.applyTo(RestFn.java:137)
        at clojure.lang.Var.applyTo(Var.java:705)
        at clojure.main.main(main.java:37)

noisesmith19:07:57

clojure doesn't come with cljs, you'd need to provide it as a dep - what does your deps.edn look like? also that command line looks wrong to me, -M should be immediately followed by some option flag

Hugo Bonatto19:07:11

I'm following this:

Hugo Bonatto19:07:30

{:deps {io.vouch/krell {:git/url ""
                        :sha "08f2bfea96aa48feb8511851e37f5948453986e5"}
        io.vouch/reagent-react-native {:git/url ""
                                       :sha "0fe1c600c9b81180f76b94ef6004c2f85e7d4aa0"}
        reagent/reagent {:mvn/version "0.10.0"
                         :exclusions [cljsjs/react cljsjs/react-dom]}}}

noisesmith19:07:18

I'm surprised to not see cljs anywhere in there as a dep, and I have no idea what -M should or would do in a command line when it's followed by -m

noisesmith19:07:34

that is, in both cases I think the tutorial is wrong

noisesmith19:07:02

@hugo147 compare to this from the clojurescript quick start:

clj -M --main cljs.main --compile hello-world.core --repl
https://clojurescript.org/guides/quick-start

noisesmith19:07:23

but in their case they also add clojurescript to the deps.edn

Hugo Bonatto19:07:00

for windows, they request to run from cljs.jar

Hugo Bonatto19:07:13

which may ignore my deps.edn

noisesmith19:07:39

but you didn't specify cljs.jar on your command line and the error is that cljs.main wasn't found