#clojure logs

2015-06-20

03:27yedihey guys im having an issue using this: https://gist.github.com/swannodette/5888989#file-debounce-clj-L1
03:27yediinitially I was doing (debounce chan 600) to create my debounce channel, and despite getting an ERROR in the chrome console, i was getting the debouncing behavior i expected
03:28yedii realized I was creating a chan incorrectly and switched to (debounce (chan) 600) and the error is no longer there, but im no longer getting the debouncing behavior
03:28yedidoes anyone know what might be up
03:49yedinvm i was using it wrong
03:49yedii should be taking from the debounced channel and putting to the normal channel
04:01TEttinger,:6
04:01clojurebot:6
04:23j-pbambrosebs: Id on't think the clojure community needs a COC, because it's the nicest one I've ever met, but if you want to make it explicit thats cool too. It's really just that sexual language bit I find concerning, do we have to stop to talk about the "domina" library now? What about "fuck this" or "I made love to that code all night long"?
04:24ambrosebsj-pb: hey
04:25j-pbambrosebs: hey :)
04:25ambrosebsj-pb: as you can tell I'm new to this and thinking about it
04:25ambrosebs:)
04:25j-pbI know its bikeshedding, but do you remember that "CouchDB + Ruby: Perform Like a Pr0n Star." talk were everybody lost their shit about some abs and butts.
04:25ambrosebsthanks for your patience :)
04:26ambrosebsI don't remember, but I don't think that's cool
04:26j-pbit was a reference to the casting couch meme
04:27ambrosebsto answer your first question, I found that CoC while folling the Opal fiasco yesterday
04:27ambrosebsfollowing
04:28ambrosebsnothing in the Clojure community triggered it, other than our lack of diversity
04:28j-pbwent past me, I'll look for what happened
04:28ambrosebssome transphobia that was terribly handled by a maintainer
04:28j-pbah
04:29ambrosebsI looked at the CoC and it's basically what I want to foster for typed clojure
04:29ambrosebsnote typed clojure is not clojure
04:29ambrosebscore.typed shares its licence with rich hickey
04:29ambrosebsthat's where the similarities end
04:30j-pbI know, I'm concered about that not clojure itself
04:30ambrosebsright, I know there's grey areas, but as I said in the post, I would rather deal with that in public than have someone leave
04:31ambrosebsI don't pretend that the CoC is unambiguous
04:31j-pbI just think that people should be able to express themselves freely as long as they don't intend to harm somebody else
04:32ambrosebsyes, I agree. sometimes intentions don't always work, sometimes they do
04:32ambrosebsI'm a human
04:32ambrosebsI interpret every situation like a human
04:32ambrosebs*will
04:32j-pbyeah, like I said, a COC isn't nessecarily bad, but I think it can easily curb freedom of expression
04:32ambrosebsthis is not saying I will ban you if your start making love with your code
04:33ambrosebsbut if people are uncomfortable, then it's something that needs to be addressed
04:34j-pbyes, but it's easy to get offended by all sorts of things
04:34j-pbis one got offended by gays, we would tell them to fuck themselves
04:35j-pbif one get offended by sexual extroverts, we side with them
04:36j-pb(sexual extrovert as in, doesn't have a problem with talking about sex publicly or including sexual references in slides without showing anythig explicit (like a dildo))
04:38j-pband I don't think a "don't show don't tell" approach will help there
04:40ambrosebsj-pb: right. my main intention was mostly my point about opening a dialog if there's a social issue.
04:40ambrosebsif people are offended at the quality of core.typed, well that's not my problem
04:40j-pbyeah, no critique there :), just wanted to hint at the potential problems
04:41TEttingerI find codes of conduct offensive. shame on you for considering one, ambrosebs, you need to step down as maintainer of typed clojure so a more qualified... uh... wait how are we going to find someone who knows the code better. CARRY ON
04:41j-pbTEttinger: haha, thats actually the point of the maintainer of opal, (the fiasko that ambrosebs) mentioned
04:42TEttingeryeah I kinda think adding a CoC without a need for one is kinda assuming the worst of your contributors
04:43ambrosebsTEttinger: I am extremely proud of my contributors so that certainly wasn't the intention.
04:43j-pbambrosebs: tbh I just read on it and even though he handled it extremely badly, I think he's right. What you do outside the project, should have no impact on what you do inside the project.
04:43ambrosebsj-pb: I disagree that ignoring the issue is an option
04:44elvis4526I think I don't get what the ->> macro does
04:44j-pbIf he behaved badly on "project grounds" (channel, issues, code) then fuck him, but what he does on his private twitter account is his thing.
04:44j-pbelvis4526: do you get the -> macro :)?
04:44elvis4526Yes, I thought this was the same thing, only at the end
04:44TEttingerelvis4526: takes an argument that will be sent in as the last argument to each of the forms after it
04:44j-pbelvis4526: exactly
04:44elvis4526uh...
04:44TEttinger,(->> [1 2 3] (map inc) (map (partial * 2)))
04:44clojurebot(4 6 8)
04:45TEttingerbecomes (map inc [1 2 3]) first, which sends [2 3 4] to the next form
04:45TEttinger(map (partial * 2) [2 3 4])
04:46j-pbambrosebs: how is it ignoring the issue though? I can acnowledge that somebody is an ass that I don't want to meet in person, but I can still accept that he/she writes good code.
04:46TEttingerwhich becomes [4 6 8]
04:46j-pbambrosebs: the first thing I learned in OSS is, that there are assholes, but you don't have to like the people to work with them
04:47TEttingeralso, thick skin is internet 101
04:48ambrosebsI also don't have to work with them either.
04:48TEttingeryeah, I've on and off collaborated with a guy who doesn't believe in the moon landing and used to be rather antisemitic (it was a phase he got out of)
04:48elvis4526alright I get it - my problem was somewhere anyway.
04:49elvis4526thanks guys !
04:49j-pbambrosebs: yes, but why would you not? It won't change the person probably, and your project potentially got a lot worse
04:49TEttingerI think the main turning point for him was getting a "real job"
04:49j-pbelvis4526: always welcome :)
04:49ambrosebsj-pb: because I don't like working with assholes
04:50TEttingerhaving responsibilities tends to drive away immature people anyway
04:50j-pbambrosebs: if he/she doesn't act like that on the project though?
04:50ambrosebsright, that's a good question.
04:51j-pbif somebody is an arse on twitter then it's twitters job to ban them
04:52j-pbnot his/her's peers job to socially isolate, him/ger
04:52j-pbbecause thats actually pretty cruel
04:53TEttingerI kinda think the Opal fiasco attracted more negative attention than positive attention to the Opal project, both from the immediate response to a tweet on github, and the response to the actions that were demanded in the github issue....
04:53ambrosebsTEttinger: of course it was more negative
04:53TEttingerwell even adding a CoC didn't help
04:54ambrosebsI agree
04:54j-pbtbh though
04:54ambrosebsdamage was done
04:54j-pbam I the only one who thinks that there is a group of poeple who's job it is to be offended?
04:54TEttingerj-pb, not at all
04:55j-pbI mean what kind of person, goes to somebody elses hobby project and tells the people there what a bastard he is and that they should exclude him
04:55j-pbthat's pretty damn mean
04:55TEttingerit is astonishing how people go to such lengths to track down things that offend them
04:55j-pbthe author even made the argument I made above "is free to have his opinions, in the case he'll bring his views against anyone contributing based on any of their mental or physical attributes, then it would be reason to tell him not to do that."
04:56TEttinger(especially when you could walk out your front door in any place of the world that has real problems, like a Brazilian favela, and not have to look at all to find something horribly wrong)
04:56j-pband tbh CoralineAda comes across as the bigger jerk than meh in the discussion
04:57ambrosebsI don't think that's possible
04:57TEttingerI think they both acted like children
04:57TEttinger"oh no, I just offended a 9-year-old"
04:58ambrosebsj-pb: anyway, thanks for your concerns. I'm prepared to take each challenge as it comes.
04:58j-pbambrosebs: shure :), thanks for the discussion
04:59TEttingerI think an in general request not to advertise yourself as part of Project X when in private conversations is really all you need
04:59j-pbTEttinger: thats actually a pretty good solution
05:00TEttingeryou can say what you want if it's clear you don't represent Typed Clojure and that your barbaric views on, say, slavery, are entirely your own
05:00TEttinger(especially since those are likely to be sarcastic, which is hard to express in text)
05:01j-pbambrosebs: pretty easily possible "Pro tip: you won't read it because you don't care."
05:01ambrosebsI think it's a judgement call. I spend every day working on Typed Clojure. If something is not right in my community then that's a big deal.
05:01ambrosebsat best it was a false alarm.
05:01ambrosebsI'm prepared to take the false positives on the chin.
05:02ambrosebsj-pb: god I can't believe how much of an ass meh was making of himself
05:02TEttingerI think the most important thing is to separate Typed Clojure communication from private communication
05:02j-pbambrosebs: also true
05:02TEttingerif you're going to be a jerk, you don't ever do it in a Typed Clojure forum or the like
05:03ambrosebssometimes those are inseparable.
05:03TEttingerwell then it is a typed clojure forum
05:03TEttingerso the advice stands
05:03j-pbwell you can read on the views of her here https://modelviewculture.com/pieces/the-dehumanizing-myth-of-the-meritocracy
05:03j-pbI don't think here views are combinable with classical hacker ethic
05:04j-pbambrosebs: to be honest though, I wouldn't want to contribute to something where I might get excluded from because of something completely unrelated
05:04ambrosebsj-pb: right, that's a good point.
05:05ambrosebsj-pb: personally I'm not sanding down my ban hammer. more like my private email skills
05:05TEttinger"misogynoiristic expectancy on social media"
05:06TEttingerok is that a real word
05:06j-pbhaha
05:06j-pbits funny how developers are literally like children
05:06TEttingerwell we make up words for a living
05:07TEttingertransducers come close, though I believe it was a real word before
05:08j-pbmy old headmaster always head a saying when kids got into a fight. "You know, in ancient germany there was a rule, called Burgfrieden. If two nights had a quarrel they were free to fight it out, but no not on the premisses of the lord they were guest at. Because that would be impolite and disturb the peace. This school is my castle, so get it together."
05:08j-pbhttps://en.wikipedia.org/wiki/Burgfrieden
05:09j-pbI think open source projects should have a burgfrieden policy
05:09TEttingerI'm not sure social justice people would appreciate a call back to medieval germany, especially when that worked out so "well" before for modern germany!
05:09j-pbhow did it not?
05:10j-pbwe had 2500 independend kingdoms, living in peace with only minor quarrels between locals
05:10TEttingerwell not for the jewish inhabitants of what was to become liebsraum under hitler...
05:10j-pbhitler is not ancient germany
05:10j-pbbut very recent events
05:10TEttingerread what I said
05:10j-pb*relatively speakeing
05:11TEttingeranyway, nazi germany tried to justify a lot of things as old german custom, even when it made no sense
05:11j-pbaahhh, thats what you're getting at
05:11wagjoGodwin's law FTW
05:11TEttinger(the swastika is a sacred symbol in hinduism, what does it have to do with germany...)
05:11j-pblol yeah
05:12j-pbbecause it looks admittably cool
05:12TEttingerit's certainly easy to make em, anything with right angles tends to be iconic
05:12j-pbhttps://www.youtube.com/watch?v=hn1VxaMEjRU
05:13TEttinger(compare the actual cross historians believe Jesus and/or his contemporaries would have been crucified on, to the one that is iconic today. a single pole wouldn't support the weight of a man, it likely had a crossbar like the Eastern Orthodox churches' cross uses)
05:14TEttingerbut, two pieces of wood are easier to produce and to draw, so a simplfied symbol became the iconic one
05:16j-pbinteresting
05:17TEttingerit also likely had to do with retroactively making the old romans look primitive when the new roman catholic church took over
05:20j-pblol
05:23TEttingerreally! supporting a person on a crucifix takes a surprising and terrifying amount of interest in causing the most pain to an enemy as possible, and if you're trying to show that the old roman ways were bad, you don't show that they had a methodology for torturing people, that just makes them more terrifying. you make them virtual cavemen, unenlightened in every sense.
06:36j-pbambrosebs: The story goes like this. 2 male attendes of pycon talk in private and make jokes like "I'd fork that repo" or "something something big dongle". Female attendee finds this offensive sexual language, says it's explicitly forbiden by the COC, and posts a photo of them online. Twitter shitstorm ensures. The guys get fired. EVEN MORE shitstorm ensures. Girl gets fired.
06:41gonz_One guy got fired, Adria Ricards proudly proclaimed victory, the Internet got mad, Adria Richards got fired from her 'evangelist' job.
06:41j-pbyeah, quite popcorn worthy to be honest
06:41j-pbsad for everybody directly involved though
06:41gonz_The guy found new work
06:43gonz_As for Adria Richards, I have no idea if she found a new 'evangelist' position, but it's pretty much a non-job anyway. She was a glorified Twitter spammer.
06:54J_Arcanewtf. this isn't #hackernews. what the hell is this shit?
06:54J_Arcanetake the 'ebul girls' shit to reddit, please.
06:55ffwacomklogure
06:55ffwacom#hackernews is full of fuccbois
06:57j-pbJ_Arcane: sorry, the background is that core.typed added a COC because of the opal incident yesterday and we were talking about the wording of it
06:57j-pbJ_Arcane: we shifted discussion to another room by now
06:59J_ArcaneCool. Another reason to get round to checking out core.typed.
07:03gonz_J_Arcane: There was no 'ebul girls' talk
07:04gonz_You might want to put on some glasses, or work on your reading comprehension.
07:04gonz_As for offtopic chatter, fair enough
07:08elvis4526What does this exception even means? " Caused by: java.lang.IllegalArgumentException: "Unparsable namespace form:" nil "
07:08elvis4526all my ns declarations exist.
07:09scottjelvis4526: web paste the code
07:09mrcheekselvis4526:how do you declare your namespaces? indeed paste it
07:10elvis4526This css: https://gist.github.com/je-allard/38ff22146c52e07c3d4a
07:10elvis4526(wait there is more)
07:12elvis4526with garden configured like this: https://gist.github.com/je-allard/184812c2edfb7352bb70
07:12mrcheekselvis4526:I think that the full stacktrace would be interesting.
07:12elvis4526It only happens when I run lein garden auto - when loading the code myself in a repl it load just fine.
07:13elvis4526mrcheeks: https://gist.github.com/je-allard/28848ea3bd3d68f7152f
07:13elvis4526/tmp/form-init779624767614268047.clj:1:71 - so helpful :) :) :)
07:19mrcheekselvis4526: It seems to be related to whatever code auto-reloading it's doing. Also check your dependencies, I've never use that ns-tracker, but your errors seems related to the checks here : https://github.com/weavejester/ns-tracker/blob/master/src/ns_tracker/nsdeps.clj
07:20mrcheekss/errors/error/g
09:00vivekramaswamyHello All, a quick question (reduce + (conj [] (repeat 1(rand-int 100000)))) I am not able to understand how that reduce is working, any help will be appreciated
09:01justin_smith,(reduce + (conj [] (repeat 1 (rand-int 100000))))
09:01clojurebot(47228)
09:01justin_smith,(reduce + [:whatever])
09:01clojurebot:whatever
09:02justin_smithwhen there is only one item in the collection, and no initial value of the reduce, the reducing function never gets called
09:03justin_smith,(reduce (fn [] (assert false)) [:OK])
09:03clojurebot:OK
09:05vivekramaswamybut what I can't undestand is that reduce + requires 2 arguments, and also how id that final result derived, meaning once you get a random number and put it in a vector, what is the reduce actually doing I am unable to see any additions here
09:05justin_smithvivekramaswamy: the function + is never called
09:05justin_smithbecause you don't supply enough args (or a large enough collection) for the reducing function to be called
09:06justin_smithvivekramaswamy: specifically, when you do not give reduce an initial value for the reduction, it takes the first item out of the collection and uses that
09:06vivekramaswamyit is getting called justin, cause try executing (conj [] (repeat 1 (rand-int 100000))) the form you get is diffrent from (reduce + (conj [] (repeat 1 (rand-int 100000))))
09:06justin_smithno, it does not get called
09:07justin_smithif taking the first item out of the collection results in an empty colleciton, the reducing function is never called
09:07justin_smithit just returns the first item
09:07justin_smithlook at the source of reduce
09:07vivekramaswamyok
09:07justin_smith$source reduce
09:07lazybotreduce is http://is.gd/KClthS
09:08justin_smithvivekramaswamy: we can know + is not called, because it would throw an error, you can't call + on collections
09:08justin_smiththat was the point of my (fn [] (assert false)) example - that would blow up, it doesn't take enough args, and even if called successfully it would blow up
09:10vivekramaswamyok, but please help me with this https://gist.github.com/anonymous/483ab2cf6a1c80a74580 how come the forms are diffrent
09:11justin_smithvivekramaswamy: as I said before, it takes the first item out of the collection
09:11justin_smith,(reduce nil [:FOO])
09:11clojurebot:FOO
09:11justin_smithbecause you did not give reduce an initial value
09:11vivekramaswamyso in place of reduce I could have just used first
09:12justin_smithin this specific example, sure - but you would get an error if there were two items in the collection
09:12justin_smithnote above, it also works with nil, which isn't even a function
09:13vivekramaswamygot it, cause this example is from a book I am reading, and I could not understand as to why the author used reduce + in the example, if all she wanted was the first element
09:13justin_smithyes, that is a bit weird, maybe it's a lesson about what reduce does in the degenerate case
09:14vivekramaswamymaybe, as always thank you very much
10:42kaffeeboehnchenok, so I have ring-json and (:body request) is giving me the string without a problem, but (get-in req …) is not working and json/read-str fails because org.httpkit.BytesInputStream can not be casted to String :(
10:57justin_smithkaffeeboehnchen: the body is an inputstream, not a string in that case
10:57justin_smithyou can slurp an inputstream to get a string
11:01DEA7THI have a macro defined in terms of itself (recursively). Now I want to do a single step of preprocessing every time before calling it and my solution is to turn it into a function, and do the preprocessing in a macro which then calls that function. So in my case the only difference between a macro and a function is how it takes its input, what it does with it. Which brings the question, why do we need macros at all? Can’t I use instead ‘ and eval i
11:01DEA7THfunction? This is my first macro btw, so I might be missing obvious background information.
11:01justin_smithDEA7TH: macros only run when the source code is loaded, never at runtime
11:01kaffeeboehnchenjustin_smith: "slurp"? :D And I thought the ring middleware will do that for me?
11:02DEA7THjustin_smith: I know, but in my case it doesn’t matter.
11:02DEA7THin the sense that both work for me.
11:02justin_smithkaffeeboehnchen: could be the headers (content type?) wasn't right to get the automatic processing
11:02kaffeeboehnchenjustin_smith: That could be it, right, I will look into it.
11:03justin_smithDEA7TH: in that case, a macro is better because it does the work at compile time instead of runtime, and worse because macros are fragile and you can't readily use them as first class values
11:04DEA7THjustin_smith: Performance won’t become an issue, so only the downside about fragility applies, therefore I should use ‘ and eval? But I’ve read somewhere that I should always prefer macros to eval.
11:04justin_smithoh, if the alternative is eval, use a macro
11:04justin_smithI missed the eval part
11:05DEA7THbut what is wrong with eval?
11:07justin_smithit's slow, it's an easy source of security holes, it's one of the most powerful tools you can use, and it's always best to use the weakest sufficient tool
11:08ararogwhy this division isn't evaluated on repl? (/ 18288515683 1043177)
11:08justin_smithararog: it is, it returns a ratio
11:08DEA7THBut it can be used in such a way that none of these apply. Oh well, I understand now anyway.
11:08justin_smith,(type (/ 18288515683 1043177))
11:08clojurebotclojure.lang.Ratio
11:09ararogjustin_smith, got it, let me understand Ration a little better, thanks!
11:09justin_smith,(double (/ 18288515683 1043177))
11:09clojurebot17531.55570243592
11:09kaffeeboehnchenjustin_smith: Thank you very much, it was the missing content type -.-
11:11justin_smithDEA7TH: I don't know about the rest, but eval always has a performance penalty compared to an equivalent macro
11:12ararogjustin_smith, thanks again!
11:13DEA7THYeah, it makes sense now.
11:18GlenjaminHi all, has anyone had issues with timbre interleaving log output?
11:43ConfusionWhat would be a nice way to transform only elements of a vector matching a certain criterion? I can e.g. do (mapv #(if (even? %) (* % %) %) [1 2 3 4 5]) to square only the even members, but of course that is rather ugly
11:45ConfusionI can define a separate function for the predicate-transformer combination, but perhaps there's a nice construction that allows me to split the predicate function and the transformation function?
11:46classcastzach tellman's library "gloss" has this handy function "decode-stream" which I want to use in "aleph". Now I need a codec for a variable size byte-array which also results in a byte-array on the receiving side and not in a vector or list of bytes as it does when I use (repeated :byte)
11:47classcastcan someone help with that?
11:48classcastit must be a byte array for further processing with a third-party library. additional conversion from vector of bytes to an array is suboptimal...
11:52j-pb_classcast: does this somehow help? https://github.com/ztellman/byte-streams
11:52j-pb_are the two questions related btw :)?
11:53classcastj-pb_: how would that be? guess no
11:54classcastj-pb_: if you take that example: http://ideolalia.com/aleph/literate.html#aleph.examples.tcp but I just want to sent plain byte arrays
11:55j-pb_ah I see what you mean
11:55j-pb_there is something like that leck me check, long time since I wrote code with it
11:56classcast:)
11:57j-pb_classcast: finite-block might do what you want
11:57j-pb_https://github.com/ztellman/gloss/wiki/Introduction
11:57j-pb_I'm sorry
11:57j-pb_https://github.com/ztellman/gloss/wiki/Introduction#finite-block
11:57classcasthumm intersting
11:57classcastj-pb_: thanks. let's see where that gets me
12:03classcastj-pb_: simple repl tests look promising. thank you
12:05j-pb_classcast: I'm not sure if I got what you wanted correctly, :) do you want the input of the tcp stream as a bunch of bytebuffers? or do you want to send a bunch of bytebuffers with framing information?
12:05j-pb_because the above will create a header that encodes the length of each frame
12:06classcastj-pb_: I control both client and server and just want to get the arrays across. since they can be split on multiple tcp messages I wanted to use decode-stream to not reinvent the wheel ;)
12:07j-pb_ah yes, I though that you might want to do some parsing of raw bytes you don't controll, but it looks like finite-block is exactly what you're looking for :)
12:07j-pb_I though about your first problem a bit more, and haven't come up with a better solution
12:07j-pb_I think it would be nice if clojure had a "identity if predicate false, else transform" funciton
12:08classcastj-pb_: which first problem are you talking about?
12:08j-pb_oh I'm sorry, it was Confusion who asked that
12:09j-pb_both names are the same length and start with a c, my brain mangled you up :)
12:10classcastok ;)
12:12Confusionj-pb_, OK, so no such function exists. Nevertheless you've given me a good idea: move the transformation code to a separate function and make the predicate function return either id or that new function. That's already a bit nicer and if I make the 'if-true' function an argument, it's even reusable
12:17donbonifacioanyone using lein and cljc?
12:26classcastj-pb: hu thats weird. the array I get back from gloss still contains the length at the beginning
12:27j-pbhrm, that is weird
12:31j-pbclasscast: not sure if this works, but (finite-frame :int32 (finite-block :none migh
12:32classcastj-pb: I currently got (def protocol (gloss/finite-block :int32))
12:33j-pbcould you try
12:33j-pb(def protocol (gloss/finite-frame :int32 (gloss/finite-block :none)))
12:35classcastj-pb: seems to have problems with that :none
12:35j-pbah I feared that
12:35classcastj-pb: IllegalArgumentException: No implementation of method: :write-bytes of protocol: #'gloss.core.protocols/Writer found for class: clojure.lang.Keyword
12:37classcastj-pb: if you change :none to :int32 you get 2 lengths as expected ;)
12:37j-pbyeah
12:38classcastj-pb: I am not sure why the length does not get removed by decoding...
12:46classcastj-pb: I have the suspicion that I am accessing the HeapByteBuffer wrongly ;)
12:46classcastthere is probably a position marker somewhere behind that length
12:46j-pbcould be
12:50classcastj-pb: got it working :D
12:50j-pbnice :)
12:51j-pbdid you accidentaly "rewind" the bytebuffer?
12:51classcastj-pb: nope. I am extracting the actual array as: (let [hbb ^HeapByteBuffer (first %), ba (byte-array (.remaining hbb))] (.get hbb ba) ba)
12:52classcastI'd prefer a better decoding that results in the actual array
12:53j-pbso you manually cut of the header?
12:56j-pbif you do I'll open an issue on gloss, and ask what ztellman thinks of adding a remove-header flag
12:56j-pbthere should be a way to get the data out that you put in easily
12:57classcastj-pb: no, the state of the buffer is correct as you can see in the above code. the length is already consumed
12:57j-pbah ok, I don't know the bytebuffer api to may shame :) only used gloss
12:58classcastj-pb: the feature-wise question is: why do I have to deal with that buffer at all
12:58j-pbclasscast: instead of a byte-array?
12:59classcastyes
13:00j-pbyou also put a bytebuffer in right?
13:00j-pbso it's bytebuffer in bytebuffer out
13:00classcastnope. a byte array
13:00j-pbinteresting
13:00j-pbthe documentation states that you put bytebuffers in
13:01j-pbthat might be a convenience conversion, but as it uses bytebuffers internally I assume no reconversion is done for performance reasons
13:01classcastwell maybe it converts the array to a buffer internally
13:01j-pbyeah
13:02classcastI guess no one wanted that so far. since usual gloss users want their data frames to be decoded ;)
13:02j-pbyeah :D
13:02j-pbactually, could it be that aleph is already capable of sending raw bytebuffers?
13:03j-pbnot sure if it can do the framing for you
13:03j-pbI only used gloss, and skimmed over aleph :)
13:03classcastwell I end up with 244 bytebuffers of one message now ;)
13:04classcastgotta adjust that previous code
13:14whodidthisnot sure if this is a bit stoopid, but would it be possible to use core.match in tests in a way that the failed value could be read from test results kind of like with (is (= a b)) https://www.refheap.com/104291
13:28dnolenBronsa: ping
13:28Bronsadnolen: pong
13:29dnolenBronsa: so I'm realizing that there's a big step that needs to happen on the Clojure side of tools.reader before I can really proceed any further wrt. bootstrapping.
13:29Bronsado tell
13:29dnoleneven in ClojureScript today `(< x 1) doesn't do what you expect
13:29dnolen< will get resolved to whatever namespace you are in
13:29Bronsaright
13:29Bronsaso you need platform agnostic symbol resolutio
13:30dnolenyeah, it's never really come up before as a big deal because hardly anyone uses `(...) in CLJS since we don't have macros
13:30Bronsadnolen: clojure.tools.reader/resolve-symbol is a dynamic var
13:31Bronsarebinding that to something that understands cljs namespaces should be enough I think
13:32dnolenBronsa: that exists in 0.9.2?
13:32Bronsayeah
13:33BronsaI made it a dynamic var a while ago foreseeing this moment. Since 0.8.x at least IIRC
13:35Bronsadnolen: on a similar note, I don't think cljs supports ctor literals e.g. (deftype foo [a]) #user.foo[1]. To add support to them just treat them as tagged literals
13:36Bronsano nevermind, ctor literals don't make sense in cljs.
13:36dnolenyeah not under advanced compilation
13:36Bronsanot even under normal compilation
13:37Bronsa#user.foo[] produces an object at read-time
13:37Bronsabut at read-time you're using the jvm not the js vm
13:37dnolenhrm could probably work if deftype / defrecord is in .cljc?
13:38Bronsadnolen: could work but that'd be problematic. you'd have to create a jvm version of the record for each cljs record defined
13:39Bronsayou'd need to take into account collisions. what if some.ns.Record already exists in the jvm?
13:39dnolenwell assuming you did this on purpose via .cljc I don't actually see the issue
13:39Bronsaah
13:39dnolenbut in anycase, it doesn't seem that useful due to the advanced compilation bit
13:40dnolentrying out the resolve-symbol thing now
13:58dnolenBronsa: well that was easy https://github.com/clojure/clojurescript/commit/f240826034bb5f9ddd53e68a6c3be4e740070470, thanks
14:02Bronsadnolen: cool, I don't remember how resolve-existing-var works but resolve-symbol assumes the symbol itself is returned if it's not possible to resolve it
14:03Bronsadnolen: and if it's not qualified, it should qualify it according to the current ns to prevent capture
14:03Bronsa,`foo
14:04clojurebotsandbox/foo
14:05dnolenit works the same far as I can tell
14:23whodidthisnot sure how to describe but whats a fun way to do this in emacs https://www.refheap.com/104295, other than backspacing
14:24dnolenwhodidthis: there's a join line command
14:24whodidthissweet, thanks
14:25TimMcnice!
14:28dnolenwhodidthis: http://pragmaticemacs.com/emacs/join-line-to-previous-line/
14:30whodidthisperfect
14:32TimMcIt's just M-x join-line for me.
14:34whodidthisbound it for M-k since theres something not-too-clojurey in there as default
14:41dnolenTimMc: I think it depends on cursor placement?
14:42dnolenjoin-line works on current line, M-^ works on previous one
15:16DEA7THSo, this is how I handled my macros: (defmacro algebra-eval [expr] (algebra-eval-f expr)) ———- algebra-eval-f is a function which takes a list of expressions and returns an expression. This is the only macro I use. I basically put my everything in functions, and used a macro as a wrapper. Is this good practice?
15:16justin_smithit's generally what's recommended
15:16DEA7THI needed to do that because I call (map algebra-eval-f collection), and map didn’t work so well with a macro, even with #(macro %)
15:17DEA7THI mean #(my-macro %)
15:18DEA7THI see. Hm, oh well.
15:43TimMcdnolen: Appears to be same thing.
15:43dnolenTimMc: ah k
15:44TimMc(behaviorally)
17:15kaffeeboehnchendo I need a macro to accomplish that? I want a function "me-first" which takes two parameters, a string and the name of the function. If some conditions are true I want to call the function name of the parameter with the other parameter. E.g. (me-first "hi" this-maybe).
17:37celwellHi, in "loop" is it possible to "recur" by rerunning the original bindings?
17:37celwelle.g., (loop [code (util/rand-str-alpha-num-only-upper 5)]
17:37celwell (if (is-code-available? db-conn code)
17:37celwell (println "done" code)
17:37celwell (recur (util/rand-str-alpha-num-only-upper 5))))
17:38celwellSee how the recur is the same as the original binding?
17:38Bronsacelwell: (loop [] (let [code ..] .. (recur)))
17:39celwelli guess that is slightly cleaner
20:22billymeter_Hi
20:24billymeterWhat's the best/de facto standard book for learning Clojure?
20:24billymeterI'm somewhat familiar with Common Lisp
20:51scottjbillymeter: clojurebook.com
21:55billymeterscottj: thanks
22:33justin_smithbillymeter: if you have a good unsertanding of common lisp, joy of clojure can be good