Fork me on GitHub
#clojure
<
2021-02-28
>
aratare02:02:52

@seancorfield splendid! Thanks a lot 🙂

seancorfield03:02:00

@rextruong Let me know if version 1.0.206 addresses your needs.

aratare04:02:19

Will do once I'm back at my station 🙂

aratare07:02:02

@seancorfield Can confirm that it's working great now! Thanks again 🙂

👍 3
borkdude09:02:03

@seancorfield Thanks a lot for the tools.cli updates :)

👍 3
Hagenek10:02:10

Any of you have experiences with Gorilla REPL, do you still use it? And in what situations.

emilaasa15:02:55

I used it a bit for some calculations where I wanted interactive visualizations. I mostly make due without it but when doing more mathy things I'd use it again. Probably with nrepl tho.

jsmesami18:02:01

Is there a link to download the latest Linux install script for CLI tools? For example in a update-everything script I'm able to Curl https://github.com/clojure-lsp/clojure-lsp/releases/*latest*/download/clojure-lsp-native-linux-amd64.zip but for CLI tools I have to modify the script every time new version is available.

andy.fingerhut19:02:38

If you use Homebrew, you could do brew upgrade clojure/tools/clojure to get the latest released version.

andy.fingerhut19:02:50

That should work for macOS and LInux

jsmesami19:02:42

No, not yet, still not convinced to use homebrew on LInux 🙂 Maybe it's time to give it a try.

andy.fingerhut19:02:47

If you want an unchanging URL for curl, that is up to Clojure maintainers whether they plan to provide such a thing (or perhaps already do). @U064X3EF3 would know.

andy.fingerhut19:02:44

This URL exists right now, and appears to be an alias to the latest version of the install script, but I don't know if that is promised to continue to exist: https://download.clojure.org/install/linux-install.sh

jsmesami19:02:55

Nice! Thank you:)

seancorfield19:02:50

I use brew on Ubuntu - so much nicer than dealing with shell script installation every time.

👀 3
borkdude19:02:53

@U8279M970 You could also scrape the brew recipe and then use that to get the newest linux script ;)

🔥 3
dharrigan19:02:13

It's important to know which distribution you're using, as each distro (family) has it's own package managers

alexmiller22:02:19

that download link above is NOT something we officially publish or guarantee will work

👌 3
alexmiller22:02:12

it is possible for it to be out of sync with the numbered versions

alexmiller22:02:24

if it would be helpful to publish a file in a known place with the current stable version (or link), I'd be happy to think about what to do there

alexmiller22:02:00

this file is basically that https://github.com/clojure/brew-install/blob/1.10.2/stable.properties but it's branch-specific so probably not stable enough

👍 3
joelkuiper21:02:39

Silly question, probably one of those cases where the answer is obvious 😅 Say I have a keyword (def kw :example) and I want a function or macro that takes the keyword as an argument and returns a quoted list with the value of that argument in the second position, something like '[?a :example ?b] what would be the best way to do so?

andy.fingerhut21:02:55

Here is a way to write a function that returns what you describe:

user=> (defn template1 [kw] ['?a kw '?b])
#'user/template1
user=> (def kw :example)
#'user/kw
user=> (template1 kw)
[?a :example ?b]

andy.fingerhut21:02:23

That returns the same value you describe that would be read if you typed '[?a :example ?b] at a REPL

joelkuiper21:02:12

yeah that seems to work, thanks! I was a little bit confused about the '[?a ?b ?c] vs ['?a b '?c]

joelkuiper21:02:44

thanks 🙂 somehow my mind was tricked into thinking the position of the quotes mattered in this case

andy.fingerhut21:02:56

If you put quote before the [ of a vector, the entire thing is quoted, and will not be evaluated.

andy.fingerhut21:02:35

If you want some of the vector elements evaluated, and some not, then don't put a ' before the [, but do put it before any elements that you do not want to be evaluated

andy.fingerhut21:02:54

The position of the quotes DO matter

joelkuiper21:02:05

yes of course, the problem is that the thing I want to put that in is itself quoted

andy.fingerhut21:02:47

You mean, you want the return value of the function to be included in part of a larger collection, which is currently quoted in your code?

andy.fingerhut21:02:59

To do that, you must make that larger collection no longer quoted as a whole. Or use a function like vec or vector to build that collection instead of a literal [ ... ] expression, if it is a vector. Similarly hash-map or set if it is a map or set.

andy.fingerhut21:02:28

Quoting an entire collection with ' does not let you pick and choose pieces of it to be evaluated.

joelkuiper21:02:24

I think I got it now 😄 thanks!

joelkuiper21:02:00

(conj '[:find (count ?x) .
        :in $ ?table
        :with ?v
        :where
        [?table :example ?record]]
      ['?record attr '?v])
is an order of magnitude faster than
'[:find (count ?x) .
  :in $ ?table ?attr
  :with ?v
  :where
  [?table :example ?record]
  [?record ?attr ?v]]
so this silly workaround will do for now

borkdude22:02:43

@U0508P8EK There is also this, hidden in the dark corners of the clojure std libs:

$ bb -e "(require '[clojure.template :as t]) (t/apply-template '[?x] '[:foo ?x :bar] [:baz])"
[:foo :baz :bar]

👍 3
joelkuiper22:02:07

wow, TIL 😄