This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-10
Channels
- # beginners (9)
- # boot (8)
- # calva (9)
- # cider (11)
- # cljs-dev (6)
- # clojure (21)
- # clojure-austin (1)
- # clojure-spec (55)
- # clojure-uk (24)
- # clojurescript (30)
- # cursive (1)
- # datomic (3)
- # defnpodcast (1)
- # emacs (3)
- # figwheel-main (9)
- # fulcro (8)
- # jobs-discuss (3)
- # nrepl (7)
- # pathom (8)
- # pedestal (4)
- # perun (4)
- # planck (79)
- # shadow-cljs (46)
- # sql (5)
- # vim (29)
is there anything like a static analysis tool to add type hints to a clojure file?
or at leas try
Hi! The following code:
(ns my-ns
(:refer-clojure :exclude [def]))
(alias 'c 'clojure.core)
(c/def test 1)
Gives an error: RuntimeException No such var: c/def
. What am I doing wrong here?If you take a look at the publics for clojure.core you will see that def is not included.
(sort (keys
(ns-publics 'clojure.core)))
That's because def is actually a special form. https://clojure.org/reference/special_forms#def:refer-clojure
is outside ns
hi everyone. I have a list of lists -
((1 2 3) (1 0 6) (3 9 8))
and I’d like to interleave
these and put them in lists again, so basically my end result to be
((1 1 3) (2 0 9) (3 6 8))
I’m a bit stuck, because I ended up with something like
(apply list (apply interleave my-list))
and it obviously doesn’t work@bravilogy (->> (apply interleave my-list) (partition 3))
An alternative that should work for more then 3 lists of lists (I am not saying shaun's does not -- I just suspect perhaps maybe it is limited to that because of the (partition 3)):
user=> (apply map list '((1 2 3) (1 0 6) (3 9 8)))
((1 1 3) (2 0 9) (3 6 8))
👍 nice one. they both work actually 🙂 I love the fact that there are many different ways you can approach things
Why does using a nested j.u.H cause a reflection warning? How can I do this properly?
(defn foo
[]
(java.util.HashMap.
{"baz" (java.util.HashMap.
{"foo" "bar"})}))
Reflection warning, NO_SOURCE_PATH:3:3 - call to java.util.HashMap ctor can't be resolved.
I don’t think that’s it
specifically the inner one does not reflect, only the outer one
TBH, I can’t explain that without digging into the compiler more
@bravilogy another one 😉
(require '[core.matrix :as matrix])
(matrix/transpose '((1 2 3) (1 0 6) (3 9 8)))
;; => ((1 1 3) (2 0 9) (3 6 8))