Fork me on GitHub
#tools-deps
<
2022-10-31
>
tskardal19:10:49

When I run clojure -Sdescribe I get a map with symbols as keys instead of keywords. Any idea why? (macOS, clojure installed with homebrew)

❯ clojure -Sdescribe
{ version "1.11.1.1182"
  config-files ["/usr/local/Cellar/clojure/1.11.1.1182/deps.edn" "/Users/thomas/.clojure/deps.edn" ]
  config-user "/Users/thomas/.clojure/deps.edn"
  config-project "deps.edn"
  install-dir "/usr/local/Cellar/clojure/1.11.1.1182"
  config-dir "/Users/thomas/.clojure"
  cache-dir "/Users/thomas/.clojure/.cpcache"
  force false
  repro false
  main-aliases ""
  repl-aliases ""}

hiredman19:10:48

are you sure the : just isn't printing for some reason? there is a suspicious space in front there

tskardal20:10:32

not sure at all 😛

tskardal20:10:58

the only reason it bothers me is that Cursive-IDE is not working because of this

hiredman20:10:42

if you have hexdump something like clojure -Sdescribe | hexdump -b|head -1 | awk '{print $3}' should print 072 (octal for ':')

hiredman20:10:16

but I would expect if it is just a printing issue it wouldn't bother cursive

tskardal20:10:29

the result of that command is 040

hiredman20:10:54

user=> (char 040)
\space
user=>

hiredman20:10:08

so it is what it is, weird

hiredman20:10:25

I would check your clojure script

tskardal20:10:22

looks the same

Alex Miller (Clojure team)20:10:00

that's .... pretty weird

tskardal20:10:06

oh well. thanks for helping out. I’ll leave it for a while. Not in a hurry 🙂

Alex Miller (Clojure team)20:10:26

maybe try a different terminal?

Alex Miller (Clojure team)20:10:32

something with encoding?

tskardal20:10:09

good idea. I tried both Terminal and iTerm now, but the result is the same

hiredman20:10:17

I would try editing the map in the clojure shell script (add an extra key or something) and see if it prints out when you run -Sdescribe again

tskardal20:10:59

added a :lol which becomes lol when printed 😬

hiredman20:10:16

fascinating

Alex Miller (Clojure team)20:10:35

well it is Halloween, probably a ghost

👻 2
hiredman20:10:02

is /usr/bin/env bash --version actually bash?

Alex Miller (Clojure team)20:10:03

what shell are you using ( echo $0 )?

tskardal20:10:11

I’m using fish.

❯ /usr/bin/env bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin21)
Copyright (C) 2007 Free Software Foundation, Inc.

pithyless22:10:15

Fish uses spaces to define lists (e.g. a PATH in fish is separated by spaces, not colons). To be backwards compatible with bash, there are code paths that will automagically swap between colons and spaces. From the docs: > Variables whose name ends in “PATH” are automatically split on colons to become lists. They are joined using colons when exported to subcommands. This is for compatibility with other tools, which expect $PATH to use colons. I suspect @tskardal may be hitting some weird corner case. 😅 Note: I am not a fish user, but did try looking this up out of curiosity. :)