This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-20
Channels
- # aleph (12)
- # announcements (7)
- # aws (6)
- # babashka (36)
- # beginners (161)
- # boot (1)
- # calva (6)
- # cider (21)
- # clj-kondo (13)
- # cljs-dev (28)
- # cljsrn (1)
- # clojars (3)
- # clojure (13)
- # clojure-colombia (1)
- # clojure-europe (10)
- # clojure-spec (12)
- # clojure-uk (47)
- # clojuredesign-podcast (2)
- # clojurescript (67)
- # datascript (8)
- # datomic (21)
- # duct (3)
- # emacs (6)
- # events (1)
- # fulcro (6)
- # graalvm (98)
- # jobs (1)
- # kaocha (18)
- # luminus (1)
- # malli (7)
- # off-topic (56)
- # pathom (5)
- # re-frame (18)
- # reagent (3)
- # reitit (9)
- # remote-jobs (3)
- # rewrite-clj (10)
- # ring (1)
- # shadow-cljs (155)
- # spacemacs (2)
- # sql (5)
- # tools-deps (27)
- # vim (86)
- # xtdb (2)
Hello guys. I just recently started to use clojurewerkz.machine-head.client
and I was wondering how can I connect to aws with this cool library. How can I manage connecting the ssl certificates? Can you give me any starting points? Much appreciated 🙂
Random thing I discovered today: associative destructuring works on just about any type but throws an exception with integers (`java.lang.Long`). Anyone here have any insight on why this might be?:
(let [{:keys [a] :as b} {:a 2}] [a b])
;; [2 {:a 2}]
(let [{:keys [a] :as b} "bob"] [a b])
;; [nil "bob"]
(let [{:keys [a] :as b} []] [a b])
;; [nil []]
(let [{:keys [a] :as b} \x] [a b])
;; [nil \x]
(let [{:keys [a] :as b} 1] [a b])
;; Syntax error (UnsupportedOperationException) compiling at (REPL:1:1).
;; Can't type hint a primitive local
;; user=>
That error message is bad. Don't think I've ever accidentally tried to destructure a number like that.
@alexmiller haha, I guess so. I'm destructuring the return value of actually that's not quite correct, but I digress... the "don't do that" advice is well takennext.jdbc/execute!
so I guess I'm being too paranoid: the return value of that function should never be an int anyway
Can eventually grep it myself, but anyone knows how :post
is implemented?
I would imagine that if a :post
is present, the defn
inner body is rewritten so that its return value passes by the :post
predicates before the defn
returns
e.g. (defn foo [x] {:post [x]} 42)
-> (defn foo [x] (let [ret-val 42] (assert ret-val) ret-val)) ;; demonstrates a 'rewrite-based' implementation
I'm looking at the source right now and I think its implemented right here
post (:post conds)
body (if post
`((let [~'% ~(if (< 1 (count body))
`(do ~@body)
(first body))]
~@(map (fn* [c] `(assert ~c)) post)
~'%))
body)
body (if pre
(concat (map (fn* [c] `(assert ~c)) pre)
body)
body)