#clojure log - Jun 11 2015

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 gko: cfleming: CSV integration?

0:01 cfleming: gko: Right. If you're using CLJS I'm hoping to integrate more tightly with all that stuff, but right now I don't. So it would just be the support for the things you mention. Essentially the standalone Cursive will be like the Community edition with the plugin installed and some stuff stripped out, and a much nicer getting started experience (no faffing with keymaps etc).

0:04 gko: cfleming: OK, not doing CLJS anyway... what will be the licence fee? like rubymine/pycharm?

0:04 cfleming: gko: Not 100% determined but I think so, yes.

0:05 gko: cfleming: OK... so companies/organizations + individual developers, then...

0:05 cfleming: gko: Right.

0:08 gko: cfleming: OK. Nice work, as it really helped doing some project when cider was somewhat unreliable on my side for a while.

0:08 cfleming: gko: Thanks, I'm glad it's working well for you!

0:14 gko: There's lots of nice functionality in yesterday's release if you're using Java interop, too.

0:26 gko: cfleming: haven't been using it in a while, but will soon be :)

1:50 mercwithamouth: does anyone actually use 'complement'?

2:01 TEttinger: mercwithamouth, yeah it's a bit verbose for what it does.

2:01 I can see it being useful

2:02 Kneiva: mercwithamouth: https://github.com/search?utf8=%E2%9C%93&q=complement+extension%3Aclj&type=Code&ref=advsearch&l= There are uses of it.

2:04 mercwithamouth: TEttinger: hmmm

2:04 Kneiva: touche...

2:05 TEttinger: ,(def anti complement)

2:05 clojurebot: #'sandbox/anti

2:05 Kneiva: ,(anti nil? nil)

2:05 clojurebot: #error {\n :cause "Wrong number of args (2) passed to: core/complement"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: core/complement"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [sandbox$eval47 invoke "NO_SOURCE_FILE" 0]\n [clojure.lan...

2:06 Kneiva: ,((anti nil?) nil)

2:06 clojurebot: false

2:06 TEttinger: ,(map (anti nil?) (repeatedly 5 #(rand-nth [:a 1 nil])))

2:06 clojurebot: (true true false false true)

2:07 TEttinger: the problem is, we already have both filter and remove

2:08 ,(filter (anti nil?) [1 2 3 nil 5 6 7 nil 8])

2:08 clojurebot: (1 2 3 5 6 ...)

2:08 TEttinger: ,(remove nil? [1 2 3 nil 5 6 7 nil 8])

2:08 clojurebot: (1 2 3 5 6 ...)

2:08 TEttinger: so primarily you want complement for stuff like partial and comp

2:09 passing a complex fn to filter or remove, that sorta thing

2:23 ,'''a

2:23 clojurebot: (quote (quote a))

2:24 TEttinger: ,'a

2:24 clojurebot: a

2:24 TEttinger: hm

2:30 WickedShell: As a general theory question for someone who's really new to clojure how worried about chasing down all instances of reflection (ie adding type hints). I've just spend the last half hour fixing various reflection warnings, but outside of a warm fuzzy (and one that I think paid off for performance) is it worth usually running with the warnings and fixing as they happen?

2:46 TEttinger: WickedShell: mostly you only need to care about reflection in code that is called very frequently

2:47 $google ztellman primitive-math

2:47 lazybot: [ztellman/primitive-math · GitHub] https://github.com/ztellman/primitive-math

2:47 TEttinger: excellent lib that will make you cry :)

2:49 WickedShell: Yeah, my only real worry is that I have a GUI that needs to do a fair amount of redrawing on a limited processor...

2:49 That primitive math... Does it just repleace all the standard math functions with optimized ones?

2:49 * WickedShell goes to read documentation

3:47 kap: hello guys...a newbie question...

3:48 I have a (defmulti fetch :kind) that troubles me

3:48 IllegalArgumentException Wrong number of args passed to keyword: :kind clojure.lang.Keyword.throwArity (Keyword.java:97)

3:48 What does it mean?

3:48 I call it like so:

3:49 (fetch {:kind :mine} )

4:00 amalloy: kap: restart your repl. there's a stale defmulti from earlier

4:01 kap: I did it, but it still doesn't take it...

4:03 I am testing with midje and autotest, maybe that can be the problem?

4:03 (defmethod fetch ::network [url-or-path options] ...)

4:03 looks ok to me...

4:04 amalloy: kap: okay so you apparently do not call it like (fetch {:kind :mine}) like you said

4:05 you call it like (fetch {:kind :mine} some other junk)

4:05 kap: yep sorry is (fetcher/fetch {:kind :mine} "" {})

4:05 amalloy: so, to dispatch, it is calling (:kind {:kind :mine} "" {})

4:05 which is clearly a problem

4:05 kap: it dispathes on the first param no?

4:06 amalloy: no

4:06 kap: lol that's the newbie problem then

4:06 :D

4:07 therefore I need to change my dispatch fn and accept three params?

4:07 amalloy: kap: generally when you have a problem you don't understand, it's great to provide a minimal reproducible example. but that only works if it's actually reproducible: if you edit your code to something simpler that you *think* would cause the same problem, you should test it first to see if that still has the problem you're asking about

4:08 anyway, yes, you should do that

4:08 kap: agree and I apologise..

4:08 ok thanks for your help...I was banging my head on the floor

4:09 kungi: Is there some kind of print friendly datomic documentation out there? There does not seem to be any on docs.datomic.com

4:14 ionthas_: Is there any function like repeatedly but taking functions with side effects?

4:16 TEttinger: ,(dorun (repeatedly 5 #(print "hi! ")))

4:16 clojurebot: hi! hi! hi! hi! hi!

4:17 mercwithamouth: has anyone gotten flycheck to work with clojure?

4:19 i'm looking at squiggly-clojure but haven't tested it out yet...

4:37 ionthas_: thanks Tettinger!

4:37 TEttinger: no prob!

6:06 jonathanj: is there an alternate spelling of (not (nil? x))?

6:06 lumafi: (some? x), introduced in clojure 1.6

6:08 jonathanj: thanks :)

6:10 l3dx: why would you use (when (some? x) ..) vs (when x ..) ?

6:12 lumafi: the first one checks if x is not nil, the second one checks if x is not nil nor false

6:20 ionthas_: I have a function that outputs a number based on a provability. I want to do "something" that takes that function and calculates the provability of the function repeating that function a certain number of times. Do I need a macro or a function? (I'm starting with macros)

6:21 and I'm a little confused

6:23 I implemented a macro and it seems to work. I will stick to the macro for the moment. :P

6:23 l3dx: lumafi: I usually use the second approach when I expect sequences, and i don't see a case where I could get either nil, false or a sequence? but I'm a clojure beginner, so what do I know :)

6:28 kwladyka: (println (str "AAAAAAAAAAA" (get-in req [:params :terms]) "BBBBBBBBBBBBBB")) return AAAAAAAAAAABBBBBBBBBBBBBB in case when :terms doesnt exist, shouldnt be AAAAAAAAAAAnilBBBBBBBBBBBBBB?

6:29 TEttinger: kwladyka: do you want the empty string as a default?

6:29 ,(println (str "AAAAAAAAAAA" (get-in {:params []} [:params :terms] "") "BBBBBBBBBBBBBB"))

6:29 clojurebot: AAAAAAAAAAABBBBBBBBBBBBBB\n

6:30 TEttinger: get-in takes an optional argument as its last arg, so does get

6:30 lumafi: ,(str nil)

6:30 clojurebot: ""

6:30 TEttinger: this is the default return if it can't find what you ask for

6:30 hm!

6:30 lumafi: str of nil isn't "nil", it's the empty string

6:30 TEttinger: ,(str nil nil)

6:30 clojurebot: ""

6:30 TEttinger: ,(println (str "AAAAAAAAAAA" (get-in {:params []} [:params :terms] "nil") "BBBBBBBBBBBBBB"))

6:30 clojurebot: AAAAAAAAAAAnilBBBBBBBBBBBBBB\n

6:30 clgv: ,(pr-str nil)

6:30 clojurebot: "nil"

6:30 TEttinger: there you go :)

6:31 clgv: (format "%s" nil)

6:31 ,(format "%s" nil)

6:31 clojurebot: "null"

6:31 clgv: back to Java ;)

6:31 TEttinger: interesting

6:32 escherize: yeah you can do these two exercises to see it in action: http://clojurescriptkoans.com/#maps/5

6:39 clgv: I guess aleph + gloss is the best method to do tcp in Clojure, isn't it? Do you know of serious alternatives?

6:53 kwladyka: TEttinger, oh thx!

6:55 TEttinger: and clgv, who has a better solution!

6:55 ,(pr-str "AAAAAAAAAAA" (get-in {:params []} [:params :terms]) "BBBBBBBBBBBBBB"))

6:55 clojurebot: "\"AAAAAAAAAAA\" nil \"BBBBBBBBBBBBBB\""

6:55 TEttinger: hm

6:56 ,(pr "AAAAAAAAAAA" (get-in {:params []} [:params :terms]) "BBBBBBBBBBBBBB"))

6:56 clojurebot: "AAAAAAAAAAA" nil "BBBBBBBBBBBBBB"

6:57 kwladyka: this AAAA and BBB was to help me see the value.... ironic :)

6:57 i watned see it is nil or empty string :)

6:58 TEttinger: oh ok

6:58 ,(pr nil)

6:58 clojurebot: nil

6:58 TEttinger: ,(print nil)

6:58 clojurebot: nil

6:58 TEttinger: ,(str nil)

6:58 clojurebot: ""

6:58 TEttinger: ,(pr-str nil)

6:58 clojurebot: "nil"

6:59 TEttinger: ,(print nil nil "hey!")

6:59 clojurebot: nil nil hey!

6:59 TEttinger: hm.

6:59 print and str act differently

7:10 TMA: ,(str 't)

7:10 clojurebot: "t"

7:11 TMA: nil is a special case apparently :-L

7:11 TEttinger: ,(str ())

7:11 clojurebot: "clojure.lang.PersistentList$EmptyList@1"

7:11 TEttinger: wow

7:11 ,(str (1))

7:11 clojurebot: #error {\n :cause "java.lang.Long cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval73 invoke "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval73 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" 6792]\n [clojure.lang.Compiler eval "Compiler.java" 6755]\n [c...

7:11 TEttinger: ,(str [])

7:11 clojurebot: "[]"

7:12 TEttinger: ,(str (()))

7:12 clojurebot: #error {\n :cause "clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.PersistentList$EmptyList cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval121 invoke "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval121 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" 6792]\n [clojur...

7:12 TEttinger: ,(str '(()))

7:12 clojurebot: "(())"

7:12 TEttinger: weird

7:13 TMA: ,(str :keyword)

7:13 clojurebot: ":keyword"

7:24 justin_smith: TEttinger: ##() has always been valid

7:24 lazybot: ⇒ ()

7:25 TEttinger: i know

7:25 but ##(str ())

7:25 lazybot: ⇒ "clojure.lang.PersistentList$EmptyList@1"

7:25 TEttinger: is a weird string

7:25 justin_smith: ahh

7:25 TEttinger: ,clojure.lang.PersistentList$EmptyList@1

7:25 clojurebot: clojure.lang.PersistentList$EmptyList

7:26 TEttinger: ,clojure.lang.PersistentList$EmptyList@2

7:26 clojurebot: clojure.lang.PersistentList$EmptyList

7:26 TEttinger: ,clojure.lang.PersistentList$EmptyList@0

7:26 clojurebot: clojure.lang.PersistentList$EmptyList

7:26 TEttinger: what is the @1 then?

7:26 mearnsh: having some trouble with this function here https://www.refheap.com/102426 : as you can see i'm shelling out to a program (csvmidi) but it's returning an error that suggests the file written in the preceeding line is incomplete. if i print tmp-path and manually invoke csvmidi afterwards, it completes successfully, so i guess sh is called before write-csv completes. any clues on what to do?

7:26 justin_smith: TEttinger: it's the specific instance of EmptyList I think?

7:26 clgv: TEttinger: identifiying the instance

7:26 TEttinger: ah

7:26 mearnsh, I haven't looked yet, sounds like it could be a laziness thing

7:27 justin_smith: TEttinger: not unless write-csv is lazy

7:28 clgv: or it uses a future or similar

7:28 justin_smith: looks like neither https://github.com/clojure/data.csv/blob/master/src/main/clojure/clojure/data/csv.clj#L123

7:29 clgv: ah might be cashing since the writer is not closed

7:29 *caching

7:29 mearnsh: that sounds about right

7:30 clgv: mearnsh: wrap the with-open only around write-csv

7:30 justin_smith: oh yeah, the file is not guaranteed to exist on disk until you exit that with-open block I think

7:30 clgv: justin_smith: yeah, you'd need to call "flush" or similar on it

7:30 mearnsh: clgv: of course, that works. thanks all!

7:30 clgv: or just close it, since it is not used anymore

7:30 justin_smith: (inc clgv)

7:30 lazybot: ⇒ 43

7:31 clgv: damn. now the 42 is gone. I guess I have to insult someone to get back to it ;)

7:36 TEttinger: (inc clgv)

7:36 lazybot: ⇒ 44

7:36 TEttinger: we'll get you to some other number soon enough

7:36 clgv: :P

7:42 gfredericks: 45 is a triangular number

7:42 justin_smith: see, that's something to aspire to

7:44 clgv: hmm is there an english word that combines the meaning of "computable" and "predictable"?

7:45 I'd have needed that for an answer ;)

7:45 TEttinger: ,(reductions #(+ % (* 6 %2)) 1 (range 10))

7:45 clojurebot: (1 1 7 19 37 ...)

7:45 TEttinger: &(reductions #(+ % (* 6 %2)) 1 (range 2 10))

7:45 lazybot: ⇒ (1 13 31 55 85 121 163 211 265)

7:45 TEttinger: ah, 55 is a hexagonal number

7:45 or something?

7:45 is it?

7:46 &(reductions #(+ % (* 6 (Math/pow 2 %2))) 1 (range 1 10))

7:46 lazybot: ⇒ (1 13.0 37.0 85.0 181.0 373.0 757.0 1525.0 3061.0 6133.0)

7:46 TEttinger: maybe not

7:46 that... hm

7:46 clgv: triangular refers to side length relation of a rectangular triangle ;)

7:46 TEttinger: &(reductions #(+ % (* 6 (Math/pow 2 %2))) 1 (range 0 10))

7:47 lazybot: ⇒ (1 7.0 19.0 43.0 91.0 187.0 379.0 763.0 1531.0 3067.0 6139.0)

7:47 TEttinger: referring here to the series of hexagonal tilings where you add concentric hexagons

7:47 1 hex, add a hex to all adjacent open cells, get 7 hexes

7:48 add a hex to all open, +12

7:48 the next set I think is +24

7:48 clgv: ah well or maybe not, http://en.wikipedia.org/wiki/Triangular_number - tricked by translation :P

7:52 gfredericks: clgv: "deterministic" might be related

7:52 TEttinger: &(map #(inc (* (dec %) (/ (* 6 %) 2))) (range 1 20))

7:52 lazybot: ⇒ (1 7 19 37 61 91 127 169 217 271 331 397 469 547 631 721 817 919 1027)

7:53 TEttinger: so next centered hexagonal number is 61

7:53 http://en.wikipedia.org/wiki/Centered_polygonal_number

7:54 clgv: gfredericks: I wanted to write a play of words ;)

7:55 TEttinger: (identity clgv)

7:55 lazybot: clgv has karma 44.

7:55 TimMc: &(take 10 (reductions + (range)))

7:55 lazybot: ⇒ (0 1 3 6 10 15 21 28 36 45)

7:55 TEttinger: one off of an interesting sequence! http://oeis.org/A144974

7:57 wow, some odd factoids Calculating Ramanujan's tau function on a centered octagonal number yields an odd number, whereas for any other number the function yields an even number.[2]

7:57 justin_smith: factoids?

7:57 Calculating Ramanujan's tau function on a centered octagonal number |yields| an odd number, whereas for any other number the function yields an even number.

7:58 ~Calculating Ramanujan's tau function on a centered octagonal number |yields| an odd number, whereas for any other number the function yields an even number.

7:58 clojurebot: 'Sea, mhuise.

7:58 justin_smith:

7:58 ~Calculating Ramanujan's tau functon on a centered octagonal number

7:58 clojurebot: I don't understand.

7:58 justin_smith: :P

8:11 clgv: Calculating Ramanujan's tau functon on a centered octagonal number?

8:11 damn I thought it reacts to that

8:11 clojurebot: Calculating Ramanujan's tau function on a centered octagonal number |yields| an odd number, whereas for any other number the function yields an even number.

8:11 clojurebot: A nod, you know, is as good as a wink to a blind horse.

8:12 clgv: Calculating Ramanujan's tau functon on a centered octagonal number?

8:15 TEttinger: awww

8:16 ~Calculating Ramanujan's tau functon on a centered octagonal number

8:16 clojurebot: Cool story bro.

8:16 TEttinger: :|

8:16 ~Calculating Ramanujan's tau functon on a centered octagonal number?

8:16 clojurebot: Titim gan éirí ort.

8:16 clgv: factoids |are| broken.

8:16 clojurebot: factoids |are| broken.

8:16 clojurebot: 'Sea, mhuise.

8:16 clgv: ~factoids

8:16 clojurebot: factoids are broken.

8:16 TEttinger: heh

8:16 clgv: :/

8:17 clojurebot: factoids |are not| broken.

8:17 clojurebot: Ok.

8:17 clgv: ~factoids

8:17 clojurebot: factoids are broken.

8:17 clgv: clojurebot: forget factoids |are| broken.

8:17 clojurebot: I forgot that factoids are broken.

8:23 wasamasa: is there a way for me to quote a comma?

8:23 '\, gives me a string ._.

8:23 justin_smith: wasamasa: commas are whitespace

8:23 ,'\,

8:23 clojurebot: \,

8:23 justin_smith: that's a character

8:24 ,',foo

8:24 clojurebot: foo

8:24 justin_smith: ,',,,,,,foo

8:24 clojurebot: foo

8:24 wasamasa: right, a character

8:24 so I can't have , as symbol?

8:24 clojurebot: Cool story bro.

8:24 justin_smith: ,(symbol ",")

8:24 clojurebot: ,

8:24 justin_smith: but don't do that

8:24 it's weird

8:24 ,(symbol " ")

8:24 clojurebot:

8:24 wasamasa: I'll tell

8:25 justin_smith: haha

8:28 clgv: ,(intern *ns* (symbol ",") 42)

8:28 clojurebot: #'sandbox/,

8:28 clgv: good luck using that symbol ;)

8:28 justin_smith: ,@(resolve (symbol ","))

8:28 clojurebot: 42

8:28 clgv: pssst! that was a puzzle ;)

8:30 justin_smith: ,(intern *ns* (symbol "  ") '☃)

8:30 clojurebot: #'sandbox/ 

8:32 clgv: ,(def ☃ 42)

8:32 clojurebot: #'sandbox/☃

8:32 clgv: ,(+ ☃ ☃)

8:32 clojurebot: 84

8:33 clgv: justin_smith: http://www.emojilisp.com/prog/MzgPNAScXec81CsB

8:33 justin_smith: hah, I had forgotten that one

8:34 ,@(resolve (symbol "  "))

8:34 clojurebot: #error {\n :cause nil\n :via\n [{:type java.lang.NullPointerException\n :message nil\n :at [clojure.core$deref_future invoke "core.clj" 2184]}]\n :trace\n [[clojure.core$deref_future invoke "core.clj" 2184]\n [clojure.core$deref invoke "core.clj" 2205]\n [sandbox$eval25 invoke "NO_SOURCE_FILE" 0]\n [clojure.lang.Compiler eval "Compiler.java" 6792]\n [clojure.lang.Compiler eval "Compiler.ja...

8:38 m1dnight_: https://gist.github.com/spacemanaki/1093917 This is the ant problem of Rich Hickey. Can anyone think of a reason why he doest not put the entire ant struct in the agent and just the location?

8:38 I cant see any reason why not to do it.

8:38 justin_smith: ,(ns-publics 'user)

8:38 clojurebot: {}

8:39 m1dnight_: Oh, perhaps to make drawing them easier!

9:00 clgv: justin_smith: the "session" expired - you have to intern it again ;)

9:01 m1dnight_: I think that one qualifies as quick hack - it violates several clojure best practices starting with all the awful global defs

9:12 bluebird: hi - i'm playing around with learning macros - can anyone help me with this short macro? https://www.refheap.com/102430

9:13 clgv: bluebird: you have to build lists then

9:13 bluebird: (map #(list 'inc %) coll)

9:14 bluebird: or usually a better idea: (map #(list `inc %) coll)

9:14 wasamasa: bluebird: you're placing the symbol coll in there, not the collection

9:14 clgv: ,(defmacro m [coll] `(or ~@(map #(list `inc %) coll)))

9:14 clojurebot: #'sandbox/m

9:15 clgv: ,(macroexpand-1 '(m [1 2 3]))

9:15 clojurebot: (clojure.core/or (clojure.core/inc 1) (clojure.core/inc 2) (clojure.core/inc 3))

9:15 bluebird: clgv: ahh ya perfect

9:15 clgv: thanks!

9:40 justin_smith: bluebird: the weird part is that you will always either get an NPE or the first number

9:40 bluebird: unless that was just an example of course

9:40 ,(or 0 1)

9:40 clojurebot: 0

9:41 bluebird: justin_smith: ya it was just an example

9:41 justin_smith: some people expect 0 to be falsey

9:45 pingw: Hello

9:46 I have a question about using clojure with mongodb asynchronously

9:47 j-pb: pingw: good for you ;), it' generally easier to just ask it

9:48 pingw: j-pb: im trying to think how to phrase this

9:48 j-pb: ah ok :)

9:48 pingw: I cant find anything when I google something like 'clojure monger async'

9:48 does this mean that monger is synchronous?

9:49 so if I make some kind of database query, the application will block until the database server responds?

9:50 justin_smith: mongo has multiple synchronization rules, the default for monger should be the same as for mongo

9:50 which is "proceed as if insertion succeeded"

9:51 pingw: justin_smith, what if you query the database

9:51 will the clojure application block until it responds?

9:51 justin_smith: in all my usage, yes

9:51 it's easy to put your read in a future of course

9:52 pingw: Oh, thats what I was looking for

9:52 justin_smith: (doc future)

9:52 pingw: so async is achieved using futures?

9:52 ok

9:52 clojurebot: "([& body]); Takes a body of expressions and yields a future object that will invoke the body in another thread, and will cache the result and return it on all subsequent calls to deref/@. If the computation has not yet finished, calls to deref/@ will block, unless the variant of deref with timeout is used. See also - realized?."

9:52 justin_smith: pingw: that's one kind of async

9:52 there is also core.async

9:52 and agents

10:55 bluebird: I don't think I'm understanding something about how macros work: https://www.refheap.com/102433 anyone know which piece of the puzzle i'm missing? just a toy example

10:59 clgv: bluebird: marcos are executed at compile time and they get unevaluated arguments - hence you can't get access to the numbers bound in the `let`

11:00 bluebird: that example of yours is getting weirder anyway. what are you trying to accomplish?

11:00 bluebird: clgv: nothing, just playing around. so you can't use macros inside of let bindings?

11:01 clgv: bluebird: you can. but you can't expect the macro to see the values bound to the symbol

11:02 bluebird: you could construct code using that symbol such that the computation using those values is performed at runtime

11:02 bluebird: clgv: what are you referring to with `symbol`?

11:02 clgv: bluebird: your example has the problem, that it seems to be a task that does not need a macro ;)

11:03 bluebird: "nums"

11:03 bluebird: clgv: ya, I'm just messing around trying to learn macros because normally I never use them.

11:03 clgv: bluebird: ok, you pass more than the symbol, the form `(rest nums)` - but the reason remains the same

11:04 bluebird: then try to build control flow macros

11:04 bluebird: thats a valid use case and you can pick simple control flows

11:05 bluebird: clgv: ya I guess the idea I'm playing around with is trying to see if i can do code generation. in this case a silly example of an or call followed by generated expressions

11:07 clgv: bluebird: best read about the evaluation semantics and the time at which macros are executed - this seems to be your difficulty in the example

11:11 bluebird: clgv: alright

11:25 noncom: don't these two exceptions look not too mutual?

11:25 ,(apply + [1 2 3] 40)

11:25 clojurebot: #error {\n :cause "Don't know how to create ISeq from: java.lang.Long"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: java.lang.Long"\n :at [clojure.lang.RT seqFrom "RT.java" 528]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 528]\n [clojure.lang.RT seq "RT.java" 509]\n [clojure.lang.RT cons "RT.java" 648]\n [clojure.core$cons__4100 in...

11:25 noncom: ,(apply + [1 2 3] [40])

11:25 clojurebot: #error {\n :cause "clojure.lang.PersistentVector cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.PersistentVector cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers add "Numbers.java" 128]}]\n :trace\n [[clojure.lang.Numbers add "Numbers.java" 128]\n [clojure.core$_PLUS_ invoke "core.clj" 955]\n [clojure.lang.AFn applyTo...

11:26 justin_smith: haha

11:26 I like the symmetry - you go from having a number where there should have been a seqable, to having a vector where there should have been a number

11:26 noncom: yeah :)

11:31 justin_smith: ,(apply map (juxt #(into %1 %2) #(into %2 %1)) (repeatedly 2 #(shuffle [nil () [] {} #{}])))

11:31 clojurebot: ([() []] [nil nil] [{} #{}] [#{} ()] [[] {}])

11:40 threadwaste: /n

11:44 clgv: justin_smith: generating swearjure expressions?

11:45 justin_smith: ,(map (comp symbol str) (repeatedly #(rand-nth ":;8|")) (repeatedly #(rand-nth "-7 ")) (repeatedly #(rand-nth "()[]}{/\\")))

11:45 clojurebot: (|-\ : { 8-\ |-( ;7] ...)

11:45 justin_smith: clgv: just fiddling around

11:46 oddcully: i like the sceptical laforge

11:47 justin_smith: (inc oddcully)

11:47 lazybot: ⇒ 10

11:47 justin_smith: perfect name for that

11:47 oddcully: could be used for engineering problems

11:47 justin_smith: ~mongodb |is| |-\

11:47 clojurebot: A nod, you know, is as good as a wink to a blind horse.

11:47 oddcully: not sure if this heisenbergcompensator can hold the throughput |-/

11:48 clgv: mongodb?

11:48 clojurebot: mongodb is |-\

11:48 clgv: hehe

11:50 zerokarmaleft: haha

12:06 clgv: $karma zerokarmaleft

12:06 lazybot: zerokarmaleft has karma 1.

12:06 clgv: lying again, eh? :P

12:47 binjured: so i'm trying out cljx and the lein plugin is working fine, but automated cljsbuild (via figwheel) is warning about `map->RecordType` methods being replaced and won't use the new file.

12:51 oddcully: binjured: i had the same problem with prismatic/schema - there is a flag to enable reloading with warnings in figwheel, but this isn't such a great solution

12:52 binjured: oddcully: did you ever resolve it more satisfactorily?

12:54 oddcully: binjured: i was in the great position to delay use of schema and i am waiting for the ticket (could already been done)

12:55 binjured: short answer: no. could be gone already

12:56 binjured: oddcully: i see. appears to still be an issue, unfortunately. i can't find an actual issue about it, just a reference in another issue, so i'm gonna create one now.

12:57 alexyakushev: Any midje users here? Is it possible to defer the test execution with it, the way clojure.test/deftest does?

12:57 jonathanj: i have a question but i don't actually know how to explain it, bear with me:

12:58 i have a tree-like structure (nested maps with :left and :right keys), i want to convert it into something i can easily render (to a console) so i'm traversing it using (loop)

12:59 the problem is if i travel down some path and hit a leaf node, i'm not sure how to backtrack and continue (such that my render doesn't end early)

12:59 justin_smith: jonathanj: loop on a tree will be a bit tricky, given that it does only tail recursion and that's awkward for trees (regular, unoptimized recursion is more natural)

12:59 jonathanj: yes

13:00 i was going to say that if i were doing normal recursion this would kind of solve itself

13:00 TEttinger: clojure.zip ?

13:00 justin_smith: perhaps you want a function that just calls itself

13:00 that's simple enough (up to a certain size of input, of course)

13:00 see also clojure.walk/postwalk

13:00 (doc clojure.walk/postwalk)

13:01 clojurebot: Huh?

13:01 justin_smith: ,(require 'clojure.walk)

13:01 clojurebot: nil

13:01 justin_smith: (doc clojure.walk/postwalk)

13:01 clojurebot: "([f form]); Performs a depth-first, post-order traversal of form. Calls f on each sub-form, uses f's return value in place of the original. Recognizes all Clojure data structures. Consumes seqs as with doall."

13:01 jonathanj: i read that but i honestly don't really understand how to use it

13:01 maybe there's an example on clojuredocs

13:02 justin_smith: I think you could probably do your transform elegantly with postwalk (just remember to return the input unmodified in all default cases)_

13:02 jonathanj: you give it a function, for every recursive input in your nested structure, it is replaced with the return value of that function

13:03 ,(clojure.walk/postwalk (fn [x] (if (string? x) (keyword x) x)) {"a" ["b" #{"c" 2 3 4}]})

13:03 jonathanj: okay, so one thing here, i'm keeping track of depth in my current function

13:03 clojurebot: {:a [:b #{4 :c 3 2}]}

13:03 jonathanj: the output is [(depth node-value) ...]

13:03 justin_smith: jonathanj: postwalk should make that unneeded

13:03 jonathanj: well, i need it for the purpose of rendering

13:03 justin_smith: ahh, got it

13:04 jonathanj: one option would be walk (as opposed to postwalk), passing in depths on the way in, returning variously indented strings on the way out

13:06 jonathanj: what is the fundamental difference between postwalk and walk?

13:06 justin_smith: (doc clojure.walk/walk)

13:06 clojurebot: "([inner outer form]); Traverses form, an arbitrary data structure. inner and outer are functions. Applies inner to each element of form, building up a data structure of the same type, then applies outer to the result. Recognizes all Clojure data structures. Consumes seqs as with doall."

13:06 jonathanj: i did read that, but i'm a bit lost

13:06 justin_smith: it takes two functions, one to call to transform while walking down, another to call on the way back up

13:06 jonathanj: the wikipedia page on tree walking algorithms may help

13:07 jonathanj: justin_smith: yes, it probably will help, let me go read that over while i process this

13:07 justin_smith: thanks for the help

13:08 justin_smith: jonathanj: note in particular the description of pre-order and post-order - walk synthesizes the two http://en.wikipedia.org/wiki/Tree_traversal

13:18 jonathanj: hrm, if my tree looks like: [{:value x :left nil :right {:value y ...}}] i'm not sure how to use (walk)

13:19 my inner function is called once with [:value x] then with [:left nil] etc.

13:19 sorry, my tree is not in a vec

13:26 justin_smith: jonathanj: it will get every branch as args, which is why I mentioned that in most cases you return the input unmodified

13:26 jonathanj: I'll repeat my previous example

13:26 ,(require 'clojure.walk)

13:26 clojurebot: nil

13:26 justin_smith: ,(clojure.walk/postwalk (fn [x] (if (string? x) (keyword x) x)) {"a" ["b" #{"c" 2 3 4}]})

13:26 clojurebot: {:a [:b #{4 :c 3 2}]}

13:28 justin_smith: jonathanj: I'd imagine you could put each data structure in the nested map into a tuple with its depth on the way down, and combine with an accumulator on the way up (both of these requiring an atom or some other mutable data)

13:28 but maybe there is a simpler way to do this

13:28 you could look at how clojure.pprint deals with it

13:35 voidnoid: I am following the leinengen tutorial, and when I try to run (require ‘[clj-http :as http]) I get the following error

13:35 FileNotFoundException Could not locate clj_http__init.class or clj_http.clj on classpath

13:35 I have clj-http listed in my project.clj under dependencies

13:36 justin_smith: voidnoid: have you restarted your repl since modifying the project.clj?

13:36 voidnoid: and when I ran lein repl it obviously downloaded all the related deps for clj-http from clojars (as well as central)

13:36 justin_smith: yep I have

13:36 justin_smith: voidnoid: does clj-http define a namespace called clj-http? I would be surprised if it did.

13:37 likely it's something like clj-http.core

13:37 or clj-http.client iirc

13:37 voidnoid: hmm, well I’m just following the lein tutorial right now

13:37 so I just ran the command as they list it

13:38 justin_smith: I have done everything up to this point https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#running-code

13:38 jonathanj: justin_smith: i don't quite understand how walk descends, maybe i'm being stupid

13:38 voidnoid: the repl seems to work fine, the hello world part works fine

13:38 jonathanj: justin_smith: this is what it looks like: https://pb.codehash.net/262aed6d71324ce89ee569815af7b552

13:38 voidnoid: oh wait… lol

13:38 haha, I wasn’t running it liek they have it :)

13:38 justin_smith: voidnoid: I just looked at the tutorial, they require 'clj-http.client

13:38 voidnoid: nm, ignore me

13:39 oddcully: voidnoid: also your ' there is some odd char (maybe just from pasting with some ubersmart client)

13:39 justin_smith: jonathanj: the easiest way to see how walk descends is to add print statements to the pre and post functions

13:39 jonathanj: if i do something like this (to try understand walk) it doesn't like it is descending: https://pb.codehash.net/bca189c015ec48e5b6e6a54b1866ea4f

13:39 voidnoid: oddcully: yeah I think that’s an OSX artifact

13:39 it’s a regular/proper character in terminal

13:40 jonathanj: actually i guess there's no descending to do

13:40 justin_smith: jonathanj: yeah, not much depth to that structure

13:40 jonathanj: but if i have a more complex tree there's no descending

13:41 ie i get output like ["inner" {... :right {...}}] and that :right value is never called by the inner function

13:42 justin_smith: jonathanj: odd - is the datatype coming in a normal map?

13:42 andyf_: jonathanj: It might be more straightforward to write your own recursive function, rather than using one of the walk functions.

13:42 jonathanj: andyf_: why do you say that?

13:43 andyf_: something like (defn print-tree [t depth] (when (:left t) (print-tree (:left t) (inc depth)) (print-tree (:right t) (inc depth))))

13:43 jonathanj: justin_smith: uh, i think the answer is yes but i don't quite understand

13:43 andyf_: except with printing, or whatever else you want to do, somewhere in there.

13:44 jonathanj: andyf_: i have basically that except using (loop) (and it fails for the obvious reason i mentioned up front)

13:44 andyf_: no loop in my example, just normal recursion on left and right subtrees.

13:44 justin_smith: jonathanj: when I run walk on your data, I see a lot more output than you just shared

13:44 jonathanj: i was hoping (walk) or something could help me

13:44 andyf_: I am not saying you have to use walk, or you should definitely avoid it. Just a suggestion.

13:45 jonathanj: justin_smith: can you paste it somewhere? (with the function call and input)

13:45 andyf_: sure, i'm mostly curious at this stage

13:46 i would like to try implement this with (walk) for my own education

13:46 andyf_: jonathanj: If you figure out a simple example of using one of the walk function that is clearer to you than the ones on ClojureDocs.org, I'd recommend adding yours there.

13:48 justin_smith: jonathanj: weird, now that I look closer, I got the same result you did, and there are definitely things missing (bug?)

13:59 jonathanj: justin_smith: the documentation for walk doesn't say anything about depth first, and indeed there's no depth firsting going on

14:00 hellofunk: dumb q. from non java guy. Can the JVM take full advantage of all of a machine's resources? or is the VM always going to be limited compared to a "native" app

14:00 jonathanj: justin_smith: perhaps the trick is to call (walk) within itself?

14:01 code-ape: hellofunk: it really depends on what you're doing, the JVM does optimization that can make up for the extra weight of the VM for some things, other times it can't.

14:02 hellofunk: code-ape: interesting, thanks

14:02 code-ape: hellofunk: anytime :)

14:25 Intensity: Hi. I'm wondering if anyone has used the buddy crypto library. When I try the example encrypt code, the resultant encrypted bytes does not get bigger when I increase the input plaintext size.

14:33 hiredman: I dunno anything about buddy, but concerning crypto that is a property ciphers can easily have

14:34 if a cipher operates on blocks of a certain size, and your input is smaller, your input will be padded to match the blocksize

14:34 like I said, I dunno anything about buddy

14:34 justin_smith: Intensity: a common thing is that you have a fixed block size, whether you use all of it or not - your data is encoded into N blocks, which will be a certain block size * N rounded up

14:34 Intensity: hiredman: Thanks for the feedback. I understand what you're saying about that case. But if I give 32 bytes as input I don't see how I could get 16 bytes as output.

14:35 justin_smith: Intensity: the encryption includes a compression stage?

14:35 hiredman: are you sure you are using cipher functions and not hashing functions? does it decipher?

14:36 Intensity: justin_smith: No, I don't think it does. When I do an encrypt followed by decrypt, I get a result truncated to 16 bytes. I don't get my original data back. I may not be using it correctly. Maybe it's only intended to operate on 16 bytes at a time total, but the documentation doesn't suggest this limitation.

14:36 hiredman: Yes, it does decipher; it's just that it deciphers to a subset.

14:44 jjttjj: if one were to develop a mordern charting library (like ggplot) what are some java libs it might build upon?

14:49 jonathanj: how do i do something like Python's `"x" * 4`?

14:49 "x" * 4 # => "xxxx"

14:49 mgaare: I'm getting this exception when trying to startup with lein run or lein repl, and I'm baffled. Caused by: java.lang.NoClassDefFoundError: com/stuartsierra/component/Lifecycle

14:52 I can only assume this is related to aot somehow

14:52 amalloy: no, probably not

14:52 binjured: ,(clojure.string/join (take 4 (repeat "x")))

14:52 clojurebot: "xxxx"

14:52 amalloy: or, well, maybe so

14:53 binjured: jonathanj: ^

14:53 amalloy: (repeat 4 "x")

14:53 binjured: oh right, forgot repeat took a count

14:53 justin_smith: In transit, if I want some data to get encoded as if it were a string, what would I return for the tag method? I am trying to interpolate from looking at the output of write, but I am baffled

14:55 maybe I am doing this wrong - my channel is objecting to certain object types being encoded, so I am trying to make encoders that will just output a string (which is good enough for the client) in order to avoid having to walk the nested structure twice

14:56 (to be more accurate, the objects are encoding fine, it's the decoder that's complaining)

14:59 voidnoid: what leinengen command do I invoke to “run” this https://gist.github.com/weavejester/585915

14:59 I’m guessing that lein run isn’t it?

15:09 justin_smith: I don't know if voidnoid changed nicks or something, but you can run all that code in a repl, or you can put it in a namespace so that lein run can find the namespace

15:10 the repl being lein repl of course

15:15 sdegutis: Quick poll: How many of you came from Ruby or Python?

15:15 gfredericks: phrasing it in a yes/no fashion might be more effective

15:16 if you're aiming at a percentage

15:16 sdegutis: Good point.

15:17 code-ape: sdegutis: I'm still a bit new to IRC, should we all just start answering or is there a better way to do this?

15:17 amalloy: gfredericks: about 15% of me game from ruby or python

15:17 code-ape: the usual thing would be most people don't answer, because if everyone hit reply-all the room would be swamped

15:18 sdegutis: code-ape: I don't know I'm new to IRC too relatively.

15:18 justin_smith: code-ape: we should all send him /msg with our percentages

15:18 sdegutis: No no no that's inefficient.

15:18 amalloy: only people who feel very strongly will answer out loud, which means sdegutis will get a very biased answer

15:18 * justin_smith is just kidding.

15:18 sdegutis: Just, one of you PM me with the number of how many of you have.

15:18 So, for example, if 37 of you came from Ruby or Python, one of you would PM me with "37".

15:19 amalloy: we can do this with recursion! i'll answer sdegutis's queestion by asking who here, besides sdegutis and me, came fmor python or ruby

15:19 i'll add some amount to the answer i get, and send that to sdegutis

15:19 sdegutis: amalloy: it's already wayyyy more biased by being answerable only by people who are ever here, meaning you, justin_smith, gfredericks, and one other guy I can't remember his name

15:19 code-ape: can we use to bot for this? Does is keep persistent data?

15:19 oddcully: (inc python)

15:19 lazybot: ⇒ 3

15:19 oddcully: darn

15:19 amalloy: you're suggesting we use lazybot as a census-taker??

15:19 lazybot: amalloy: Uh, no. Why would you even ask?

15:19 sdegutis: amalloy: that plan has a race condition

15:19 oddcully: opend it was around 0

15:20 (inc sdegutis-poll-python)

15:20 lazybot: ⇒ 1

15:20 gfredericks: yeah definitely namespace it

15:20 justin_smith: (dec python or ruby)

15:20 lazybot: ⇒ -1

15:20 oddcully: (dec python)

15:20 lazybot: ⇒ 2

15:20 sdegutis: (inc gfredericks) for that one

15:20 oddcully: that fixed me

15:20 amalloy: like if i switch to ruby while someone else is answering the question there'll be a race on my answer?

15:20 sdegutis: lazybot is broken

15:21 amalloy: no, meaning if two people say "who besides me and amalloy and sdegutis ..."

15:21 simultaneously.

15:22 code-ape: I feel like using a set may make things easier (?)

15:23 sdegutis: oh yeah totally

15:23 (def ruby-or-python (atom (set)))

15:23 ,(def ruby-or-python (atom (set)))

15:23 clojurebot: #error {\n :cause "Wrong number of args (0) passed to: core/set"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "clojure.lang.ArityException: Wrong number of args (0) passed to: core/set, compiling:(NO_SOURCE_FILE:0:0)"\n :at [clojure.lang.Compiler$InvokeExpr eval "Compiler.java" 3628]}\n {:type clojure.lang.ArityException\n :message "Wrong number of args (0) passed to:...

15:23 sdegutis: wat

15:24 justin_smith: sdegutis: hash-set

15:24 sdegutis: oooh

15:24 justin_smith: set takes a coll

15:24 sdegutis: silly arbitrary naming scheme

15:24 oddcully: doesn't that get GCed after a few minutes?

15:24 sdegutis: you'd think (set) with no args would just be (hash-set)

15:24 justin_smith: the idiomatic thing would have been #{} a set literal

15:24 ,(set nil)

15:24 clojurebot: #{}

15:24 sdegutis: oh right haha

15:25 justin_smith: ,(hash-set nil)

15:25 clojurebot: #{nil}

15:25 sdegutis: ,(do (def ruby (atom #{})) (def python (atom #{})))

15:25 clojurebot: #'sandbox/python

15:25 justin_smith: sdegutis: consistently:

15:25 ,(vec nil)

15:25 clojurebot: []

15:25 justin_smith: ,(vector nil)

15:25 clojurebot: [nil]

15:25 sdegutis: How do you add to a set?

15:25 Does conj or cons work?

15:25 justin_smith: sdegutis: conj

15:26 sdegutis: ,(swap! ruby conj :sdegutis)

15:26 clojurebot: #{:sdegutis}

15:26 sdegutis: ,@ruby

15:26 clojurebot: #{:sdegutis}

15:26 sdegutis: ok there just conj away

15:26 justin_smith: ,(swap! ruby conj 'not-justin_smith)

15:26 clojurebot: #{:sdegutis not-justin_smith}

15:26 sdegutis: justin_smith: wait what???

15:26 lazybot: sdegutis: Yes, 100% for sure.

15:26 justin_smith: sdegutis: just being a dumbass

15:26 sdegutis: but now the data is cluttered

15:26 how do we fix!

15:26 justin_smith: ,(swap! ruby disj 'not-justin_smith)

15:26 sdegutis: dissoc?

15:26 clojurebot: #{:sdegutis}

15:27 sdegutis: oh ok

15:27 * sdegutis is knew to clojure

15:27 code-ape: ,(swap! python conj :code-ape)

15:27 clojurebot: #{:code-ape}

15:27 gfredericks: I've started working on my active-record-envy-thing

15:27 justin_smith: fascinating

15:28 gfredericks: I kind of want to call it static-record

15:28 justin_smith: sedentary-record

15:30 hiredman: maps-or-something-i-dunno

15:32 gfredericks: can't yet tell if it's useful or not

15:33 hiredman: but is it functional?

15:33 gfredericks: hell maybe!

15:40 sdegutis: ,(defmacro from! [whence who] `(swap! ~whence ~who))

15:40 clojurebot: #'sandbox/from!

15:40 sdegutis: ,(from! ruby sdegutis)

15:40 clojurebot: #error {\n :cause "Unable to resolve symbol: ruby in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: ruby in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6543]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: ruby in this co...

15:40 sdegutis: hahahaha get out of town clojurebot

15:40 you amnesiac you

15:49 voidnoid: so I’ve been googling for like an hour now, and there still doesn’t seem to be an obvious answer to this yet that I can find… how do I add a jar to my classpath manually with leinengen?

15:49 all the SO posts basically say I should use clojars, but the postgresql jdbc 9.4 driver isn’t in clojars

15:50 sdegutis: voidnoid: Leiningen takes from both clojars and maven

15:50 voidnoid: just mention it in your Leiningen file's dependencies.

15:51 voidnoid: ah ok thanks

15:53 sdegutis: yep that does it, thanks

15:53 sdegutis: So glad to be of service.

15:53 That'll be 30,000 reddit karma, please.

15:54 shem: only when you tell us what you will do with that karma.

15:55 sdegutis: Alternatively I'd say inc me with lazybot, to help my $karma catch up to amalloy's. But I don't want to catch up to justin_smith. So instead you can just dec amalloy.

15:56 shem: trade it in for real money of course

15:59 shem: sdegutis: nono. the final outcome is what we are interested in. idle luxury or botnets hatching wicked AI

16:37 arohner_: is there a library that sets up generic file watching on a directory?

16:37 I want tools.namespace.dir style watching, but not tied to clj files

16:38 also, I want it to use the NIO file-watching stuff, so my clojure fn gets called when the file is saved

16:38 https://github.com/juxt/dirwatch looks interesting

16:48 binjured: is anyone aware of a way to use http-kit channel responses with compojure-api?

16:48 dagda1_: why is (seq? [2 [3 [4 false nil] nil] nil]) false

16:48 amalloy: dagda1_: try simplifying your question. what does (seq? []) say?

16:49 dagda1_: amalloy why is seq? false for a vector?

16:49 oddcully: arohner_: there is also org.apache.commons.io.monitor if you prefer to fiddle with java. it only needs a proxy basically

16:50 amalloy: &(doc seq?)

16:50 lazybot: ⇒ "([x]); Return true if x implements ISeq"

16:53 binjured: ,(instance? clojure.lang.ISeq [])

16:53 clojurebot: false

16:53 binjured: ,(instance? clojure.lang.ISeq ())

16:53 clojurebot: true

16:53 dagda1_: so I use coll?

16:53 mindbender1: arohner: https://github.com/derekchiang/Clojure-Watch

16:54 amalloy: depends what you want to know

16:55 binjured: dagda1_: ideally you just know the argument is always a collection if it's important enough to check. you could use empty? or nil? to make a decision based on it.

16:57 mindbender1: ,(nil? [])

16:57 clojurebot: false

17:00 binjured: nil? tells you if someone passed nil as an argument. if it's not nil, you can assume it's a collection (via hint, schema, core.typed, etc.)

18:45 N8Dawgr: Hi All, have an issue using try/catch inside a core.async go block

18:46 quite easy to reproduce in my environment

18:46 https://gist.github.com/71c3c8c343926062ab95.git

19:54 whomp: is mapcat the same as (reduce concat (map ...))

19:54 ?

19:56 hiredman: apply

19:56 reduce with concat is really bad

19:56 (infact I am sure the doc string for mapcat says it is the same as apply concat)

19:59 whomp: hiredman, why is reduce so bad? i've often seen solutions on 4clojure that are different in that they either use reduce or apply

20:07 hiredman: reduce is not bad, reduce with concat is bad

20:08 whomp: why? just wondering

20:11 amalloy: $google clojure reduce concat stackoverflow

20:11 lazybot: [recursion - Why does reduce give a StackOverflowError in Clojure ...] http://stackoverflow.com/questions/24958907/why-does-reduce-give-a-stackoverflowerror-in-clojure

20:16 whomp: amalloy hiredman, thx :)

21:20 how come i have to use (map #(Character/getNumericValue %) ...) rather than (map Character/getNumericValue ...)?

21:21 amalloy: whomp: what is the type of Character/getNumericValue, when stored in a variable?

21:22 whomp: (def a Character/getNumericValue) gives me, CompilerException java.lang.RuntimeException: Unable to find static field: getNumericValue in class java.lang.Character, compiling:(NO_SOURCE_PATH:1:1)

21:22 justin_smith: whomp: on the jvm methods are not first class, so they can't be arguments or values

21:22 amalloy: so, what does that tell you? does it shed any light on your original questino?

21:23 whomp: ohh ok, thanks guys got it :)

22:11 WickedShell: Does core.async allow multiple publishers to a single subscriber? I've been unable to find any discussion of this use

23:15 justin_smith: WickedShell: as far as i know you can subscribe one channel to multiple publishers with the sub function

Logging service provided by n01se.net