This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-06-08
Channels
- # admin-announcements (3)
- # arachne (1)
- # aws (2)
- # beginners (10)
- # boot (287)
- # cider (5)
- # clara (2)
- # cljs-dev (150)
- # cljsjs (2)
- # clojure (99)
- # clojure-austin (1)
- # clojure-brasil (1)
- # clojure-dev (13)
- # clojure-greece (55)
- # clojure-japan (1)
- # clojure-nl (2)
- # clojure-russia (24)
- # clojure-spec (184)
- # clojure-taiwan (1)
- # clojure-uk (45)
- # clojurescript (55)
- # clojurex (1)
- # cursive (20)
- # datascript (16)
- # datomic (1)
- # devcards (4)
- # events (10)
- # figwheel (1)
- # funcool (7)
- # hoplon (48)
- # immutant (1)
- # jobs (6)
- # lambdaisland (2)
- # lein-figwheel (19)
- # mount (36)
- # off-topic (37)
- # om (16)
- # om-next (17)
- # onyx (29)
- # planck (53)
- # proton (1)
- # pure-frame (1)
- # re-frame (40)
- # reagent (44)
- # remote-jobs (1)
- # ring (2)
- # robots (2)
- # rum (5)
- # slack-help (4)
- # spacemacs (27)
- # specter (82)
- # test-check (18)
- # test200 (1)
- # untangled (17)
@gfredericks: splittable random number stuff is going to work out well for us. Also considerably faster than the Mersenne twister algo we had been using. Thanks for the tip.
dave.dixon: np; are you just using the one in test.check?
(let [{:strs [a b c] :keys [a b c] :syms [a b c]}
{:a 1 "a" 2 'a 3
:b 10 "b" 20 'b 30
:c 100 "c" 200 'c 300}]
[a b c])
;;=> [3 30 300]
Are there any circumstances under which (name :my.ns/foo)
would return nil
if the input is a regular fully-qualified, namespaced keyword? I get this behavior in a sofware of mine and it puzzles me.
also (namespace (keyword nil "my.ns/foo"))
oh, you were asking about name, so no then :)
if you are you can do a 'lein install' from the other project / namespace to make it available to your other projects
alternatively, you can place code in primary project's lib directory which is part of the leiningen managed classpath
but it fails to find a :use I am calling from my file snake.clj (which is the one I have just put into lib)
though I copied the directory examples (which contains import-static.clj) into my lib
and then if you copy the generated jar over to your primary project lib directory, does that work?
the only caveat is you'll need to run 'lein install' from the dependent project any time you make a code change
so, I copied the .jar of the project (containing the examples directory) to the lib of my primary project
I'd recommend the leiningen tutorial at https://github.com/technomancy/leiningen/blob/master/doc/TUTORIAL.md
Someone posted something on the web that explained the different position of the collection in calls like (get col key) vs (map fn col). Do you know what the resource is that explained that, or does someone have a easy to communicate rule in their head about it
(i.e. why the col position is sometimes first, and sometimes last)
I go over this in Clojure Applied
in collection functions (take a coll / return a coll), the coll goes first
you are operating a data structure and returning it
in sequence functions (take a seqable / return a seqable), the seqable goes last
collection functions chain well with ->, sequence functions chain well with ->>
that’s where I read it!
yay, ty alex
you can extend the collection analogy even to things like clojure.string where the string is the "collection" and in almost every case goes first
except for a few places where something else goes first to enable partial-ing
they make great holiday gifts - I recommend buying 10-15 at a time
@arkh: Clojure Applied is very good. I go through it with a highlighter so I can reference patterns in the future. I also have been refactoring existing code after “AH HA” moments from the book.
thanks, I assumed so. we’re starting our first cljs <-> clj app, so I was curious if others were still using it
to be clear, http://dev.clojure.org/jira/browse/CLJ-1910 will require changes to the edn-format right? To indicate that there are new built in tagged elements?
yes, 1910 will carry over to edn
Hello all! Is there any library to make queries (a la select) to clojure data strucutres? (nested maps, vectors...)
@caio: thanks!
Hey guys, I am curious about some techniques you use to achieve a good design in clojure and TDD, someone has a good resource of knowledge for this ?
@mbrum: You may be interested in https://github.com/jakemcc/lein-test-refresh
@hrathod: Thansk man, this is a good things.
But do you know something about TTD, some videos, some patterns to implement a more expressive test and program in clojure ?
Huh; is ^”[B”
a valid alternative to ^bytes from the compiler’s POV? as in:
(defn ^"[B” some-fn
@lvh yes
user> (Class/forName "[B")
[B
user> (set! *warn-on-reflection* true)
true
user> (fn [b] (String. b))
Reflection warning, *cider-repl staging-service*:63:14 - call to java.lang.String ctor can't be resolved.
#function[user/eval48179/fn--48180]
user> (fn [^bytes b] (String. b))
#function[user/eval48183/fn--48184]
user> (fn [^"[B" b] (String. b))
#function[user/eval48189/fn--48190]
JVM internals leaking out?
I know that [B is the JVM name for a byte array; I guess I was just surprised that it worked as a tag
I originally wanted reflection-free dispatch for caesium but it looks like that’s not happening unless I write some java; so I might as well settle on a consistent-but-easy interface that converts to ByteBuffer (since that seems to be the obvious lingua franca) and then have specialized APIs that don’t dispatch
have you looked at ztellman/byte-streams?
can anyone remind me how to modify the results of (s/conform (s/or :kw keyword? :uuid uuid?) :something) so it returns only the value and not the label?
(specifically, it’ll switch on type; so I’m just trading in finding the right method to call on my libffi binding)
Maybe that is what I want I suppose, assuming I can consistently discern the right length from the bytebuffer (or expose an API that lets you specify it)
@dg: I think all matches must have be labeled, I don't think there's a way around it.
I'd swear I read something in an article where you could apply a function to the result before it's returned, and there was a warning to be careful about doing that
@dg that’s in the tutorial somewhere I think