This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-04-06
Channels
- # announcements (18)
- # asami (14)
- # aws (5)
- # babashka (58)
- # beginners (32)
- # calva (12)
- # cider (29)
- # clj-kondo (8)
- # cljfx (8)
- # cljs-dev (4)
- # clojure (101)
- # clojure-europe (54)
- # clojure-germany (5)
- # clojure-nl (8)
- # clojure-serbia (8)
- # clojure-spec (12)
- # clojure-uk (8)
- # clojurescript (24)
- # cursive (3)
- # datomic (17)
- # docs (2)
- # etaoin (12)
- # events (1)
- # fulcro (1)
- # google-cloud (2)
- # jobs (1)
- # jobs-discuss (6)
- # lsp (65)
- # luminus (2)
- # malli (10)
- # meander (4)
- # nrepl (1)
- # off-topic (112)
- # onyx (2)
- # pathom (6)
- # polylith (14)
- # re-frame (9)
- # reagent (36)
- # reitit (13)
- # releases (2)
- # remote-jobs (5)
- # rewrite-clj (12)
- # shadow-cljs (70)
- # specter (2)
- # startup-in-a-month (1)
- # xtdb (14)
Yes. And I'm pretty sure tests are evaluated at runtime too, unless you're doing something strange 😉
@kbosompem A reduce version
@kbosompem You're trying to do two separate things that imo don't belong together: 1. compute the list of numbers that are >=20 and divisible by 7 2. print the first of those The first one doesn't have any side-effects, the second one does (in the strict sense) Your example is a toy problem, so you wouldn't see any tangible benefits but in general I'd try to keep those apart, e.g.:
(defn gen [min q]
(->> (range)
(drop min)
(filter #(zero? (mod % q)))))
(print (first (gen 20 7)))
Of course that's not always possible or practical
edit: and obviously it's not 100% equivalent to the javascript code (it doesn't start from 20) but the result should be the sameSpecifically I want to write functions to hit apis on a client that unfortunately is running in a docker
Do you want to connect an NREPL client from outside of Docker to an NREPL server running inside Docker? Or you you want to hit HTTP endpoints?
docker run -p 3306:3306 your-thing
should forward port 3306 in your system to port 3306 inside your container.
@teodorlu nope not really - or rather am trying to figure out other things >< If you are wondering, am trying to use jepsen
to test my distributed systems project, and not too sure how to make modifications for it. And connecting a repl is another step I need make sure my http calls are correct. (can't run the server locally)
Another option is to go into the Docker container directly. If your container ships with leiningen, you could docker run ... --entrypoint /bin/bash
, run something ./jepsen? --stuff &
in the background inside your container, then lein repl :connect ...
Why bother with "direct docker"? Then you get direct container access, and don't have to bother with port mapping.
Okay let me think about that 🙂 Will be heading to sleep first but will think through it tmr. Thanks for your help 😄
@teodorlu I'd advocate for using lein to biuld a jar, but not running it inside your container, which means that in order to run NREPL one would be bundling the nrepl jar, and then providing a port as a starting argument
If I've understood the problem right, we're probably stuck with what Jepsen provides.
oh - I missed that aspect