This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-08-18
Channels
- # announcements (17)
- # babashka (42)
- # beginners (34)
- # calva (78)
- # cherry (1)
- # cider (7)
- # clojure (64)
- # clojure-europe (19)
- # clojure-nl (2)
- # clojure-norway (54)
- # clojure-uk (3)
- # clojurescript (21)
- # cloverage (1)
- # conjure (1)
- # core-async (11)
- # cryogen (16)
- # cursive (1)
- # data-oriented-programming (1)
- # datahike (5)
- # fulcro (2)
- # girouette (1)
- # helix (10)
- # hyperfiddle (1)
- # jobs (1)
- # kaocha (4)
- # nbb (7)
- # off-topic (6)
- # pathom (4)
- # polylith (21)
- # rdf (9)
- # releases (2)
- # shadow-cljs (3)
- # sql (12)
- # squint (68)
- # vim (33)
- # xtdb (29)
How do I align comments in VSCode. I press TAB can aligned clojure code, but comments is not align. I press Space key every time
When working with CIDER/shadow-cljs, do you expect stuff in the browser to update when you C-x C-e?
I think so, assume that's an eval command.
In vscode use ctrl+alt+c i`` can instrument a top level function for debugging like this :
the function name add double line. How can I cancel it , exit debugging
Shift+F5 should exit the debugger, or there should be a debug toolbar that looks like, and you can click the icon on the right
what do you mean by retrieving?
if you want to iterate over array-map the order will be the same as it was when array-map was called. But if your array-map is big (> 32 elements (?), unsure about exact number) adding an element might turn array-map into hash-map which does not preserve insertion order.
Thanks for the response @U04V4KLKC
nothing from clojure core, but there is a library - https://github.com/clj-commons/ordered
i mean if I add a value in the list ( 1 2 3 4 5 6 7 8 9) does it return in same order when I try to retrieve it?
and usually when I start looking at this library it is an indicator I should be using different data structure in the first place. sequence or vector
retrieve how?
and how you add an element to the list, this is also important.
fyi, array-map has nothing to do with list
ex- if I retrieve it using for -loop or doseq does it return in the same order ? 1 - 9 or , it might shuffle the order
no, the order will be the same as it was in the list.
maybe you could explain your problem a bit more?
for
, map
, and many other Clojure functions and macros that "iterate over elements of a collection" do so by calling seq
on that collection. So it is the order of elements returned by seq
on that collection that is the implementation issue that answers your question.
seq
on lists and vectors is guaranteed to contain elements in the order that they are in that list or vector.
seq
on a Clojure map returns the same key/value pairs in the same order for the same identical Clojure map object, but if you then add a new key, or remove a key, to produce a new Clojure map, calling seq
on the new map provides no guarantees on the relative order of key/value pairs, as compared to the original map.
seq
on the ordered
library variant of maps does provide guarantees that key/value pairs will be returned in "insertion order", as described in its documentation, because its implementation is different than the built-in Clojure maps.
Hi,
I'm struggling with following the instructions to build an uberjar in https://clojure.org/guides/tools_build! It's almost certainly something laughably simple, but when I run clj -T:build uber
I get an error:
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-T:build (No such file or directory)
So I don't think it's even getting to the function defn
in my build.clj
file!
Any help would be much appreciated!That's a good point, I think the one I have is a little out of date!
ls -l `which clj`
-rwxr-xr-x 1 root root 217 Sep 15 2018 /usr/local/bin/clj