@seancorfield splendid! Thanks a lot 🙂
@rextruong Let me know if version 1.0.206 addresses your needs.
Will do once I'm back at my station 🙂
@seancorfield Can confirm that it's working great now! Thanks again 🙂
@seancorfield Thanks a lot for the tools.cli updates :)
Any of you have experiences with Gorilla REPL, do you still use it? And in what situations.
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.
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.
If you use Homebrew, you could do brew upgrade clojure/tools/clojure
to get the latest released version.
That should work for macOS and LInux
No, not yet, still not convinced to use homebrew on LInux 🙂 Maybe it's time to give it a try.
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). @alexmiller would know.
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
Nice! Thank you:)
I use brew on Ubuntu - so much nicer than dealing with shell script installation every time.
@jsmesami You could also scrape the brew recipe and then use that to get the newest linux script ;)
It's important to know which distribution you're using, as each distro (family) has it's own package managers
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?
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]
That returns the same value you describe that would be read if you typed '[?a :example ?b]
at a REPL
yeah that seems to work, thanks! I was a little bit confused about the '[?a ?b ?c]
vs ['?a b '?c]
thanks 🙂 somehow my mind was tricked into thinking the position of the quotes mattered in this case
If you put quote before the [
of a vector, the entire thing is quoted, and will not be evaluated.
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
The position of the quotes DO matter
yes of course, the problem is that the thing I want to put that in is itself quoted
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?
yes exactly
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.
Quoting an entire collection with '
does not let you pick and choose pieces of it to be evaluated.
I think I got it now 😄 thanks!
(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@joelkuiper 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]
that download link above is NOT something we officially publish or guarantee will work
it is possible for it to be out of sync with the numbered versions
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
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
wow, TIL 😄