This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # announcements (21)
- # aws (6)
- # babashka (28)
- # beginners (39)
- # biff (1)
- # calva (23)
- # cider (5)
- # clj-kondo (108)
- # clojure (11)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-nlp (10)
- # clojure-uk (8)
- # clojurescript (29)
- # community-development (4)
- # conjure (20)
- # css (3)
- # datalevin (9)
- # datomic (3)
- # events (2)
- # figwheel-main (11)
- # fulcro (36)
- # honeysql (7)
- # humbleui (4)
- # interceptors (4)
- # introduce-yourself (3)
- # jobs (1)
- # lsp (51)
- # malli (1)
- # meander (71)
- # minecraft (8)
- # other-languages (18)
- # pathom (15)
- # polylith (25)
- # portal (10)
- # re-frame (5)
- # reitit (15)
- # releases (1)
- # remote-jobs (1)
- # shadow-cljs (11)
- # tools-deps (27)
Hello, if i really like lisp I should be using clojure to write production software right? It has just dawn on me. I started with scheme and right now I am using common lisp for projects. What are the books I should read to get real work done and get a job? thanks. I am trying to have an open mind but i just dont like its link with java. is clojure a real lisp? How so?
Clojure differs at least as much from common lisp and scheme as those two differ from each other
https://www.clojure.org/about/rationale is a good read if you haven't seen it yet
rhickey gave some talks (over a decade ago now?) at a New York lisp users group https://youtu.be/cPNkH-7PRTk called clojure for Lisp programmers
@U0282BF0T0W I learned Lisp at university about 40 years ago and liked it a lot but my career path led me, ultimately, to the JVM in 1997 and all my jobs have been on JVM since then, using a variety of languages -- I really haven't had to write much Java in the two and a half decades I've been paid to write software on the JVM. For more than a decade, my job has been writing Clojure. As someone who likes Lisp and also functional programming, I'm very happy that Clojure exists -- it brings me joy every day in my job (and also in my open source projects outside work).
I can only think of two downsides to the JVM:
1. It's relatively large and resource-intensive, so it's not a great fit for, say, embedded systems.
2. It lacks support for tail call elimination.
I don't do no. 1, so that doesn't matter to me. By choice, I will likely never work on systems where space, memory and energy usage are real concerns.
No. 2 is just an minor intellectual annoyance, and we have the
loop/`recur` construct as a workaround.
A third non-technical downside might be that the JVM is often lumped in with Java, with a certain stigma. Clojure is thus inextricably linked to Java in people’s minds, even though it's designed to be “platform agnostic.” And many people who are looking for something “other than” or “better than” Java might get the wrong first impression of Clojure.
Perhaps also worth a read is https://en.wikipedia.org/wiki/List_of_JVM_languages which lists a lot of languages that have implementations that target the JVM (as well as high-profile "JVM languages" -- several of which also have implementations targeting JS, CLR, and other runtimes).
Is there no stdlib function to remove an item from a vector by index?
no, most likely because of undefined result of such action
How to conditionally wrap a large block without duplicating code? Any other way besides factoring the block out to a function and
(if wrap? (wrap (my-fn)) (my-fn))?
(cond-> (my-fn) wrap? (wrap))
I don't think that works for my case because the function would initially be called outside of the wrapper. My wrapper sets execution context for the function call.
ah gotcha. your initial
if doesn’t look that verbose to me. there are somethings you could do but are generally just putting the
if in other places ¯\(ツ)/¯
@U02EA2T7FEH heh yeah, figured as much with the
if. It just seems to be a fairly common pattern for me and I was wondering if there's some sugar for it. Thanks!
(wrap (my-fn)) my-fn will be called before wrap so your wrapper can't affect the result of my-fn
@U04V4KLKC Shoot, yeah, you're right. I was looking to use this with some library code. My mistake is that I thought the wrappers were functions, but they're actually macros. The transformation happens before getting to the evaluator.
I am writing a Clojure program, and I want to call Java methods/grab objects of another program that's already running (I have the source code). The second system is way too complicated to import directly into my project though. Would RMI be the appropriate solution here? I read this blog that seems to support this: https://nakkaya.com/2009/12/05/distributed-clojure-using-rmi/ I'm curious to hear other perspectives.
@U0NCTKEV8 It's a GUI tool with a ton of dependencies. I just want to harvest a few data structures from the tool, but the data itself needs most of the rest of the system to be running for it to work.
depending on what exactly you want to do (mostly on the size and number of dependencies of the clojure program, is it kind of a one off or not), I would embed a clojure repl in the tool, and load the program into the repl and run it
if clojure is on the classpath of the tool, and the runtime is initialized (basically the clojure.lang.RT class is referenced so its static inits run) there is a system property you can set to cause clojure to run a repl socket server
This SO post https://stackoverflow.com/a/24922859/ has a way to parse all forms in a file, but is there a library that allows me to do it independent of the underlying platform? In this case I want to use nbb.
Ah thank you very much!
Let me know if this works or not for you, there's probably improvements we can make there
It works but I only get the first form.
But the hack from the SO post works 🙂
I'm considering to expose https://github.com/borkdude/edamame in babashka and nbb
That would be awesome! 🙂
Haha, you're so fast.
No rush 😀