This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-23
Channels
- # beginners (114)
- # cljsrn (19)
- # clojure (35)
- # clojure-austin (1)
- # clojure-italy (9)
- # clojure-russia (8)
- # clojure-spec (6)
- # clojure-uk (5)
- # clojurescript (32)
- # datomic (12)
- # editors (3)
- # emacs (1)
- # hoplon (4)
- # jobs (6)
- # jobs-discuss (1)
- # luminus (2)
- # onyx (11)
- # parinfer (2)
- # portkey (6)
- # re-frame (7)
- # reagent (9)
- # remote-jobs (3)
- # schema (2)
- # shadow-cljs (23)
- # spacemacs (2)
- # specter (13)
- # vim (3)
- # yada (6)
Hello everyone, cascalog looks very nice,you can use it to query/update etc a relational database throw jdbc taps?
let's say i have a collection of elements in map and I'l like that mutable and I'ld like to change one element. How do I do that?
@aptr322 could you give an example? I am not exactly sure what you mean. If you are talking about update the value under a key in a map, check functions like assoc
https://clojuredocs.org/clojure.core/defmulti <-- is defmulti dispatch function not allowed to return ":default" ?
@qqq I don't think so
hey folks, I'm encouraged a friend who is a python dev to learn clojure. what book do you recommend for a python dev to learn clojure ?
Coming from Python, it hit the sweet spot for me
If your friend is a web dev Web Development With Clojure is good. My first Clojure book was Clojure Programming.
Hello. Is there a way to go from output of clojure.tools.reader/read
(called all till EOF I mean) back to Clojure source file?
@andrewboltachev rewrite-clj can do this
thanks @dominicm . I've just had a look at it
In fact, clojure.tools.reader
itself doesn't perserve exact shape of code read. E.g. ::foo
might become :current-ns/foo
@andrewboltachev rewrite-clj fixes that
@dominicm ah cool, thanks
Is there a way to insert into a vector, e.g. having [1 2 3]
and 42
get [1 42 2 3]
? 🙂
Is anyone here familiar with core.cache? I'm trying to determine whether I have a use case for it, but I suspect the maps I'm working with are far too small. For example, microbenchmarks show memoize
decreases performance by ~10%. Are there any guidelines other than comparing the size of your data to L1 + L2 cache?
@andrewboltachev Why would 42
go into the 2nd spot in the result?
@cddr just an example
I'm looking to insert a particular element to particular position of a vector. In this case 2nd (position 1).
Gotcha. With clojure, you'd probably construct a new vector with the element added in the correct position. Something like
(defn insert-at [v item pos]
(concat
(subvec v 0 pos)
[item]
(subvec v pos)))
@cddr yes, thanks. Only there's a problem https://stuartsierra.com/2015/04/26/clojure-donts-concat
ok. got it
@sophiago memoize implies a hashmap lookup on with the key being a seq of the arguments to the function. This adds a fair amount of overhead.
Probably has little to do with cache lines, and more to do with inlining and memory allocations
Makes sense. I was testing it on a function that performs a heavy amount of insertion. My use case doesn't do a whole lot of lookup and when it does I've found Nathan Marz's Specter library to be very useful.
I did try inlining some of the small functions on the lookup side, but it didn't make much of a difference and in some cases slowed things down.
Btw, @tbaldridge this is the library I stole a bunch of your core.async code to use for source transformation. I'm not focusing on that part right now, but am hoping to ask you some questions about it when I do as I definitely don't fully understand how it works.