This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (13)
- # aws-lambda (19)
- # babashka (11)
- # beginners (90)
- # calva (35)
- # chlorine-clover (16)
- # cider (8)
- # clj-kondo (6)
- # cljsrn (10)
- # clojure (44)
- # clojure-australia (1)
- # clojure-europe (35)
- # clojure-nl (6)
- # clojure-norway (7)
- # clojure-uk (101)
- # clojurescript (79)
- # community-development (40)
- # conjure (1)
- # contributions-welcome (4)
- # core-logic (2)
- # cursive (6)
- # datomic (4)
- # figwheel-main (5)
- # fulcro (18)
- # girouette (1)
- # graalvm (3)
- # hoplon (2)
- # hugsql (2)
- # jobs (5)
- # malli (26)
- # off-topic (74)
- # pathom (36)
- # portal (4)
- # reagent (10)
- # reitit (23)
- # remote-jobs (1)
- # shadow-cljs (27)
- # spacemacs (10)
- # sql (3)
- # startup-in-a-month (6)
- # tools-deps (55)
- # vim (11)
- # xtdb (15)
writing an "idiomatic" wrapper but that can be more taxing than using the lib directly
i'm really newbie in clojure (i don't have any code exp, except vba & ms. Excel). I'd like to asked several questions
lein new app asdf, i do this in my cmd, but how can i do this in atom? is it possible? if not, that's okay.
2. then i create suspects.csv and want to slurp it. but it gives an error. below is the screenshot. I've put this csv in resources, or in src/asdf along with the core.clj, but give same error.
PS : I placed my lein.bat & atom repl run in this directory
thanks a lot for the help
If you do this in your program, or a REPL, it will tell you what the JVM thinks is the current directory (or what it thought was the current directory when your REPL started at least -- it can be changed later):
(println (System/getProperty "user.dir"))
That is the directory it is probably trying to read the file from, unless you direct it differently somehow.
If you want to get it from your
resources directory, you can do
(require '[ in the REPL, or add a similar thing into your
ns form of your program's namespace that looks like
(:require [, then do
(slurp (io/resource "suspects.csv"))
Someone else might know the answer to your question about creating new Leiningen projects from within Atom -- I do not. You could also ask in the #atom-editor channel, if no one here knows.
@seancorfield whoops, i really didn't know that, should i change IDE? is there any recommendations?
It hasn't been updated in nearly three years now. I was an Atom/ProtoREPL user and I switched to Atom/Chlorine, but that expects you to start the REPL separately, via a terminal (or cmd.exe window in your case).
I will caution that Windows is very much a second-class citizen in the Clojure world. If you're on Windows 10 and willing to use WSL2 you'll fare much better.
All of the tools and libraries are designed for macOS/Linux because that's what most Clojure developers use.
The Clojure CLI (the official offering from Cognitect, rather than Leiningen) has an alpha approach to Windows: https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows via Powershell, but it's just so much easier to give up on Windows and use WSL2/Ubuntu (which is what Microsoft increasingly expect developers to do).
And VS Code has a Remote-WSL2 mode that lets you run "everything" on Ubuntu while VS Code runs on Windows so it's super-slick.
I use VS Code on both Windows and macOS (and it auto-synchronizes the entire setup between the two systems), and on both systems I run everything on the *nix side (Ubuntu on WSL2 on Windows 10 and macOS Terminal).
I'll try to digest this... since i really had no idea, I'm still on progress learning https://www.braveclojure.com/core-functions-in-depth/ 😅, once i got more deeper knowledge then I'll try to move on to macOS. Thanks a lot for the suggestion
My primary dev env is macOS but my secondary env is Windows with WSL2 (and Ubuntu). I've recently switched from Atom (after several years) to VS Code.
That gives you the option of Calva which is very feature-rich and well-maintained or Clover -- which is essentially Chlorine (for Atom, but ported to VS Code). So that's allowed me to port my exact workflow from Atom to VS Code.
@andy.fingerhut it works...
(println (System/getProperty "user.dir")) after locate the REPL
I'll try the
(require '[ now.
cool. The http://clojure.java.io/resource function is useful if you want to get a file handle to a file in your
resources directory, but it isn't really needed if you prefer to put the file in the current directory (the one that "user.dir" property shows)
Hello, I'm looking for a way to seperate strings without a specific term and store them. The separation works, but it seems nothing is stored...
(let [mapsx (remove nil? (map #(if-not (clojure.string/includes? % "jpg") ( println % ) ) prae))] (println mapsx mapsx))
Any suggestions? Solved it by my own 😊
( whats the problem here )()
(let [mapsx (remove nil? (map #(if-not (clojure.string/includes? % "jpg") (conj % ) ) prae))] (println mapsx mapsx))
Nice, you solved it, but you might want to look into
group-by, as it might make sense for this use case.
this would get you all of the ones that dont include jpg
while group-by would give you a map with those who do and don’t include jpg.
(filter #(not (clojure.string/includes? % "jpg")) prae)
I mean remove was used in the original, so I assumed knowledge of it was present. Although, It is good to point out that remove is very much useable as well (since it’s basically the same as filter with the predicate reversed).
hi, what's the terminology for this dot notation and is it conventional or intrinsic? ex:
(use (. express (logger)) ^
I believe it’s called the Dot special form, for more reading: https://clojure.org/reference/java_interop#_the_dot_special_form
Hey! I remember seeing a list of OSS clojure/clojurescript repos with issues good for beginners. Could somebody please point me to it?
When I use clojure.string/replace, is it possible to get the times something was found? Maybe this example helps:
I would like to know how many times A was found in a row and use it. Is this possible in regex? I have to code with lots of take-while, count and drop. But this would be a lot more compact
(def teststring "AAABBC") (str/replace testcode #"\D+" "$1")
@christiaaan You can pass a function as the last arg:
$ bb -e '(str/replace "foo" #"(o)+" (fn [& args] (prn args) "x"))' (["oo" "o"]) "fx"
Then I'd still have to count them manually. I was hoping that the regex would somehow offer the amount of replacements, like I can access the groups
I would say the most typical thing in Clojure is to simply (count …) the sequence that (re-seq …) returns
@christiaaan A little hacky, but you could have a side-effect in the replacement function that increments a counter
With spec, can I have the same namespace qualified keyword speced differently in two different contexts? For example in one map I’d want
:foo/bar to be
string? and in another I’d want
:foo/bar to be
int? . Ideally they’d be different keywords if they were different types, but curious if something like this is possible.
No, spec encourages you to register a single, well namespaced spec that applies globally
When I understand correctly, this doesn’t just apply to spec, but is a more general issue about namespaces and namespaced keywords and what they mean right?
Shouldn’t we provide context with metadata generally speaking? I don’t think this is possible with keywords as they are interned. But conceptually this would seem useful.
But yeah, thinking about this it makes more sense to put metadata on a symbol (that points to something) rather than a keyword, which is just a value.
hi, anyone using spacemacs? been stuck in here forever, why it didn't download? can anyone help?
Use this in the meantime: https://github.com/thanhvg/spacemacs/tree/feature/evil-collection
maybe i'll use emacs instead spacemacs... idk what to do (totally clueless), i'll learn it on the go
If you are a previous vim user/like vim’s modal editing then Doom Emacs is another distribution of emacs which might meet what you need. It predownloads/compiles (if you want) packages for you so you get a quick startup (< 1s). It has a prebuilt clojure configuration as well which has worked really well for me out of the box. Repo: https://github.com/hlissner/doom-emacs YouTube series on use/setup: https://www.youtube.com/playlist?list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj
alrite, i'll look into it as well.. I never use any of this before hahhaa.. total newbie... my previous experience is Ms. Excel & VBA.... I'll learn slowly
Starting from scratch in non-VBA programing and Clojure and Emacs is a lot to chew in a single bite!
If you are a (neo)vim user, I can't rate highly enough the #conjure plugin for Vim that really is amazing for developing Clojure with Vim.
@U0105JJK1L3 how's it going so far? How long have you been learning Clojure? you inspired me to learn more!!! awesome!
@U01J6LMKF2L just installed DOOM, and tried to run repl for clojure, SPC-o-r there's 2 options : Clojure (default), when run said - symbol's function definition is void: cider-current-repl Clojure (cljs)
@UCCHXTXV4 i've tried
SPC m ' it showed like this, i didn't see any REPL windows... thanks a lot for the help
i've tried to create projects, run the core.clj, but still the repl doesn't show up.
okay, found the solutions https://stackoverflow.com/questions/65566706/error-in-process-sentinel-could-not-start-nrepl-server-java-lang-numberformate 1. start git cmd 2. type >> lein repl >> it'll start repl in git cmd 3. goto doom emacs type [SPC m c] >> cider-connect-clj 4. choose local host 5. type port local host as shown in step 2
Hey guys, has anyone successfully used miner.ftp library with ftps? I can't find out where to use the function encrypt-channel on the client.... if local data transfer is not forced to SSL, just using the ftps protocol works, but when data should be encrypted it seems compulsory to use this encrypt-channel function.
Is no one interacting using ftp or is my lack of profile picture detrimental to getting any feedback 🙂 ?