This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-15
Channels
- # aws (4)
- # beginners (98)
- # boot (23)
- # cider (63)
- # cljsrn (3)
- # clojure (259)
- # clojure-boston (1)
- # clojure-dev (2)
- # clojure-italy (6)
- # clojure-nl (17)
- # clojure-russia (1)
- # clojure-serbia (1)
- # clojure-spec (36)
- # clojure-uk (74)
- # clojurescript (11)
- # cursive (2)
- # datascript (12)
- # datomic (36)
- # defnpodcast (1)
- # devops (1)
- # docs (1)
- # emacs (15)
- # euroclojure (3)
- # fulcro (13)
- # graphql (1)
- # juxt (2)
- # lumo (27)
- # off-topic (46)
- # onyx (23)
- # pedestal (6)
- # planck (2)
- # portkey (27)
- # re-frame (18)
- # reagent (12)
- # remote-jobs (2)
- # ring-swagger (11)
- # rum (4)
- # shadow-cljs (104)
- # spacemacs (4)
- # sql (3)
- # tools-deps (5)
- # vim (45)
so i was playing around with the let-if
macro that would only branch if the bindings succeeded. the strategy is to check the keys of &env
before the binding and then after the binding and remove the ones from before the binding . then its a simple (every? some? bindings)
and the macro is done. is there any obvious problem with this?
(let-if [{:a/keys [a b]} {:a/a 1 :a/b 2}]
(+ a b))
3
clojure.tools.analyzer.jvm>
(let-if [{:a/keys [a not-found]} {:a/a 1 :a/b 2}]
(+ a not-found))
nil
i’m still learning stuff about macros. how do you get access to &env
before and after the bindings?
Have the wrapping macro emit an inner macro ?
also, that assumes that your let statement is introducing a new binding when that’s not necessarily the case. for example
(let [not-found "haha"]
(let-if [{:a/keys [a not-found]} {:a/a 1 :a/b 2}]
(+ a not-found)))
I’m sure Alex will say this is a bad idea, but I’d probably have chosen to use spec to parse the bindings vector and tried to extract the expected locals that way, but that &env approach sounds plausible. difference of closures is the emitted let.
Sounds like a great idea
Are books like code complete and clean code useful for functional programming? Are they agnostic of paradigms? They seem to use OO examples though some stuff are common like meaningful variable names.
I still find a lot to learn from Code Complete, much of what it talks about is independent of any one paradigm or separate from the technicalities of programming languages. There's crossover to good practice in Clojure as well, e.g. the section on table-driven methods to avoid sprawling logic (which the book explains is not solved by OO.)
But I do think the books you mentioned add value regardless of language, although things like “the chain rule”, “train wreck”, etc. do apply more to typed/OO langs.
I’m struggling to set up nginx/letsencrypt on fedora for a clojure server. Any chance someone can help? Happy to pay in beer and/or money
I’ve done it on a VPS where I run clojure with java -jar uberjar.jar
. I basically followed a bunch of instructions I found online
@martinklepsch I think I used these: https://certbot.eff.org/lets-encrypt/debianstretch-nginx and sudo certbot --nginx
@martinklepsch so for your system: https://certbot.eff.org/lets-encrypt/fedora24-nginx
and in nginx I use a reverse proxy to the clojure server, so I didn’t have to change anything there
yeah, I followed these to a degree and have certificates (that part worked) but now I can’t get nginx to serve my thing. Let me gist my config
the error I’m getting is 502 Bad Gateway
@martinklepsch Here’s one that I use: https://gist.github.com/borkdude/97365509675c9cdc1449fa5d972fef85
duh, this was the issue: https://unix.stackexchange.com/questions/196907/proxy-nginx-shows-a-bad-gateway-error
@martinklepsch glad it’s fixed
next time 😄
Been doing some research on GraalVM, and I was wondering if they mentioned which architectures support the native-image features
"Effectively, it's converting bytecode that runs on the JVM (on any platform) to native code for a specific OS/platform"
Unfortunately, I can't seem to find any information on what OS/platform's are supported with this feature. I'm particularly interested in compiling on raspberrypi/arm. It would be interesting to see if more clojure development could veer in that direction, since the memory footprints would be significantly less
for native-images I asked a different question, but part of their answer was that the compilation target is the platform you are compiling on
From the gitter, it seems like support is only on Linux+MacOS on Arm64, with support for other platforms in the future
If anyone’s interested in a unique approach to doing code reviews, my wife Stacy just did a talk at PyCon about it (it’s totally language-neutral): https://youtu.be/lpWvYxEW09k
non-video info here: http://codecrit.com/