#clojure logs

2013-05-24

00:38ustunozgurhow would one update a map atom? (def x (atom {}) (swap! x (conj x {:foo "bar"})) doesn't seem to work.
00:44ustunozgurok, got it, (swap! x assoc :foo "bar") works.
00:48frozenlockWell, I think I figured out what was wrong. *** For all Rasperry Pi user, or AllInWinner ARM chips ***, you shouldn't be using the normal open-jdk 7, but jdk8 for ARM: https://blogs.oracle.com/hinkmond/entry/quickie_guide_getting_hard_float
00:49frozenlockInsidious bugs were popping everywhere. -_-
00:55d2r_If given a vector of N elements e, I would like to call (doto inst-exp (meth e1) (meth elem e2) … (meth eN)).
00:55d2r_I am not sure how to express this. Is it possible?
01:02brehaut(reduce #(doto % (meth %2)) inst-exp v) ?
01:02brehautthats a kind of boneheaded literal translation
01:03d2r_hmm. Not sure what you mean.
01:03brehaut(let [o inst-exp] (doseq [e v] (.meth o e)) o) would be my preference
01:04d2r_Ah, that's good. Thanks a lot!
01:25amalloybrehaut: i haven't been following the conversatoin, but doto...meth...inst-exp sounds like a cautionary tale about the dangers of meth leading to instant expiry
01:25brehautlols
02:07ianeslickImplemented halfway decent nREPL inspector middleware at: https://github.com/vitalreactor/nrepl-inspect
02:55certaintymoin
02:55clojurebotIt's greek to me.
02:57r0bgleesonmoin
02:57r0bgleeson,moin
02:57clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: moin in this context, compiling:(NO_SOURCE_PATH:0:0)>
03:07certainty,(constantly "moin")
03:07clojurebot#<core$constantly$fn__4051 clojure.core$constantly$fn__4051@aa204d>
03:07certaintyoh it really exists
03:35certaintyis there really no (flip) in core?
03:36mthvedtcertainty: do you want reverse
03:37certaintymthvedt: reverse reverses a sequence, correct?
03:37mthvedtyes
03:37certaintynope I want (defn flip [f] (fn [x y] (f y x))
03:38nonubywhen using lein repl i thought there was a option in project.clj to open in a specific namespace like project.dev
03:38nonubybut cant find it now :(
03:52ianeslickproject.clj: {:repl-options {:init (in-ns 'my.namespace)}}
03:53ianeslickOr more succinctly: {:repl-options {:init-ns foo.bar}}
03:53llasramnonuby: If you didn't know already, you can run `lein sample` to see a sample project.clj showing almost every option
03:59nonubythanks guys!
04:08amalloycertainty: there's really no flip. it's not as useful as it is in haskell, because of multi-arity functions
04:09gozalaIs there equivalent of :rename in :require forms ?
04:09certaintyamalloy: ok thanks for the information. It's still odd though, it goes so well with partial.
04:10gozalaI mean equivalent of (ns lib (:use [foo.bar :rename { qux beep }]))
04:10amalloymeh. if you're flipping and partialing at once, you're surely bending over backwards to try for a point-free function, whereas just using a lambda would be easier to read
04:12certaintyamalloy: I'll consider it. I like point-free style though
04:21luxbockI'm having some trouble with creating a basic uberjar with lein
04:21luxbockhttps://www.refheap.com/paste/14947
04:21luxbockis what I tried, what am I doing wrong?
04:22luxbockI tried to follow the instructions here: http://www.beaconhill.com/blog/?p=283
04:23llasramluxbock: From your output: "Created [...] tester-0.1.0-SNAPSHOT-standalon
04:23llasrame.jar"
04:23ucbluxbock: try -jar ...-standalone.jar
04:24ucbluxbock: lein uberjar will create both jars, the one that contains clojure (the -standalone) and the one that doesn't. You're trying to run with the latter.
04:24luxbockahhhh, I'm dumb
04:24ucbs/with//
04:24luxbockI didn't even notice there were two of them
04:24luxbockyeah that works
04:44dnolengozala: refer
04:44dnolenalandipert: ping
04:44gozaladnolen: my understanding is that :refer is equivalent of :only
04:44gozalais there a way to use :refer as rename ?
04:45gozalaor do you mean separate :refer that isn't part of :require ?
04:46sveduboisI have a question about Google Closure Libraray using ClojureScript.
04:46sveduboisTaking this example of a Filtered Menu:
04:46sveduboishttp://closure-library.googlecode.com/svn/trunk/closure/goog/demos/filteredmenu.html
04:46sveduboisHow I can automatically open/close the content-portion of this FilteredMenu when the mouse enters/leaves the control (search input)?
04:47dnolengozala: oh right, no I don't think there is a :rename for :refer?
04:48dnolen:rename in :use seems pretty feature-creepy
04:52gozaladnolen: to be honest I wish require had regular destructuring
04:52sveduboisAnd my ClojureScript code:
04:52sveduboishttps://www.refheap.com/paste/14951
04:52sveduboisAny idea about how to enable drop-down effect?
04:52dnolengozala: that doesn't make any sense to me.
04:53edoloughlinIs there a way to redefine Compojure routes (defroutes) without restarting everything? I'm using CCW.
04:53gozaladnolen: why not you just lear one pattern and use it where you need it
04:53gozalalearn*
04:54gozaladnolen: anyway just ignore my comments & thanks for response
04:54dnolengozala: destructuring is only about binding names in a lexical scope, namespaces are a top level thing so I'm not sure the concept really applies.
04:58zoldaredoloughlin: you can wrap handler with (var ...)
06:00mindbend`where did clojure.contrib.sql goto?
06:01talioswas it ever ported over to the new maven builds? if not - the great contrib grave in the sky
06:01taliosor, the new separate repo builds I should say
06:02mindbend`url?
06:02clojurebotsomething
06:02taliosI think you want https://github.com/clojure/java.jdbc
06:02taliosthats where it moved by the looks of it
06:02vijaykiranhttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
06:02taliosvijaykiran - hazah! I knew that was documented somewhere
06:03taliosmmm, loving this new Alice in Chains album. so good.
06:04mindbend`talios: is that a lib? ;)
06:05ucbtalios: new as in 2013?
06:05taliosmindbend` - if I could bring the elegence and power of Alice in Chains to my projects by merely adding a dependency declaration that would be awesome
06:06taliosucb - yep, "The Devil Put Dinosaurs Here" - came out, today? or yesterday I think maybe
06:06ucbtalios: |o/
06:38CookedGryphondoes anyone know if there's a way to get how much stuff is queued up in a channel in lamina?
08:26sveduboisTaking this example of Google Closure Filtered Menu: http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/filteredmenu.html
08:26sveduboisI have reimplemented in ClojureScript: https://www.refheap.com/paste/14951
08:26sveduboisBut do you know how I can automatically open/close the content-portion of this FilteredMenu when the mouse enters/leaves the control (search input)?
08:33ddellacostasvedubois: what don't you know how to do, close the thing, or attach a listener to it, or something else? I would use domina for this, and just attach a listener to the relevant dom element.
08:34sveduboisddellacosta: I don't know how to close the content (goog-menu-content)
08:37ddellacostanot sure if this is exactly the effect you want, but just ran this in the console and it worked
08:37ddellacostagoog.style.setStyle(goog.dom.getElementByClass("goog-menu-content"), "display", "none");
08:38ddellacostasvedubois: and you can use show again to show it
08:38sveduboisddellacosta: Yes it works
08:38ddellacostasvedubois: blatantly ripped off from this: http://stackoverflow.com/questions/1954874/how-to-hide-show-dom-element-in-google-closure
08:38ddellacostasvedubois: is that what you are looking for? I would then just attach a listener to mousein/mouseout that showed it/hid it
08:39ddellacostasvedubois: I like domina for that myself.
08:41mpenetCookedGryphon: just use count
08:50mefestoGood morning all.
08:52mefestoi'm attempting to use enlive for a new web project. is there a way to configure the templates to be re-eval'd on each page load for development?
08:55wliaoHi,all. I have three threads repeatedly print nums, for example 1111 2222 3333. How can i use clojure concurrent primitives to schedule them to print 123123?
08:56clgvwliao: you can use an agent for coordination but you wont get a guaranteed order of the numbers, but a first-come-first-serve semantic
08:58wliaoclgv: Hi, clgv. In `Clojure Programming`, agents are classified as uncoordinated and asynchronous. Am I wrong?
08:58clgvwliao: agents work sequential through the task in the order they were send to them
08:59clgv*sequentially through the tasks
08:59mefestowliao: each thread is printing the numbers to stdout?
08:59wliaomefesto: Yes.
09:00mefestowliao: and you want to somehow combine that output?
09:00clgvwilao: for example I use an agent for printing a progress report which summarizes the activity of multiple threads
09:00clgvwilao: tools.logging can be configured to use an agent for logging as well
09:00wliaoclgv: I got it, the uncoordination should be betwen agents.
09:02wliaomefesto: The threads output to the same terminal, so they're combined.
09:03mefestowliao: so you want to serialize printing so that one char from thread a, then one char from thread b, etc... ?
09:04mefestomeaning, thread a prints one char but then must wait until thread b + c have printed their chars before it can print it's next?
09:05wliaomefesto: Yes, exactly. Maybe it's easier to achieve in Java.
09:05mefestowliao: if im understanding correctly, i'd use a blocking queue per thread
09:05mefestothen have a printer thread which pops one char off each queue in turn
09:06mefestowliao: clojure embraces the use of java.util.concurrent
09:09wliaomefesto: I'll give it try. Thanks for the tip.
09:16clgvwliao: if every thread prints one line at a time do you just want to avoid an uncoordinated mess of characters on the console?
09:17clgvwilao: if so, use an agent
09:18mefestomy rough attempt: https://www.refheap.com/paste/14957
09:22mefestonot sure what the use case is but at least in this example it doesn't seem to be a very good use of threads :)
09:22clgvmefesto: if you do it like that you can just use an agent ;)
09:23mefestoclgv: how so?
09:23mefestoclgv: each thread does a send-off to the agent with the char?
09:23clgvmefesto: since an agent is in principle (simplified) a thread with a queue
09:24mefestoclgv: but will that guarantee the order of the printing?
09:24mefestocouldn't a thread `send-off multiple times before another thread `send-off's?
09:24clgvmefesto: yeah (send-off print-agent (fn [_, msg] (println msg)) "my message")
09:25clgvmefesto: it has the same guarantees as you LBQ implementation
09:25clgvfirst-sent first-served
09:25mefestoclgv: yeah but the reason 1 queue per thread is necessary in that example is to the printer can guarantee that it's taking chars off each queue in the right order
09:26clgvmefesto: multiple adds of one thread can happen with the LBQ as well
09:26mefestoclgv: yes but these are blocking queues so those threads must wait their turn
09:26clgvmefesto: ah you have one queue per thread. I missed that
09:26clgvmefesto: somehow I doubt that this is the desired output...
09:27mefestoclgv: i don't get what wliao wanted to accomplish. more info needed i thnk
09:27mefestothink*
09:27mefestofun exercise tho
09:28clgvmefesto: I vote for multi thread printing without generating a mess ;)
09:28mefestoclgv: for some reason he wanted to combine their output in a specific order
09:28clgvmefesto: btw you could use `future` instead of manually creating a thread
09:29mefestotrue
09:30CookedGryphonmpenet: oh, thanks, I feel silly for asking now :P
09:31mefestoanyone know if there is a way to configure enlive so that the templates are re-eval'd each time. would be nice for dev mode
09:32mefestoi keep having to recompile my views.clj even tho it hasn't been edited and only the templates have been changed
10:34dhlmefesto: this has been an open issue for a while now. Might wanna take a look at this https://github.com/cgrand/enlive/issues/6
10:35dhlI switched to stencil partly because of that
10:35seangroveddellacosta: That's probably not a good idea - the closure lib has higher level functions, like "setVisible", etc. Otherwise you risk falling out of sync, or leaking memory
10:35ddellacostaseangrove: ah, thanks for the tips--I'm still getting to know how to best use google closure (or how not to use it)
10:36ddellacostaseangrove: which libs are you talking about, or are these wrapper functions baked into CLJS?
10:37ddellacostaI've been using domina, and just augmented that with "raw" Google closure code when the functionality doesn't exist
10:37seangroveWe make pretty heavy use of it, had the docs open in a separate window for a month at least http://closure-library.googlecode.com/svn/docs/class_goog_ui_Control.html
10:38ddellacostaseangrove: ah, sorry, I see you said "google closure" itself
10:38seangroveYeah, I liked domina a lot, but it wasn't being maintained when we started using it, and I eventually realized it wasn't super useful above ~4 small wrapper functions on top of the built-in closure methods
10:38ddellacostagotcha
10:38ddellacostaah, good to hear
10:38ddellacostayeah, I mean, I'm trying to stay away from using jQuery (jayq), and use stuff I know is already built-in
10:38ddellacostabut I don't know closure very well yet
10:38sinistersnarehey, can anyone recommend a book? i was look at Programming Clojure, but it seems to only cover version 1.3
10:39sinistersnarearent we on 1.5?
10:39ddellacostasinistersnare: there is a second edition of Joy of Clojure coming out soon, check that out
10:39llasramsinistersnare: The changes since 1.3 are relatively incremental
10:39seangrovetook a month to merge a change to the readme on how to prevent a total show-stopping NPE https://github.com/levand/domina/pull/39
10:39ddellacostabut, as llasram suggests, you'll still get a lot out of Programming Clojure
10:40ddellacostaseangrove: hmm
10:40ddellacostadoh
10:40sinistersnareso do you think i should wait for Joy of Clojure 2nd Ed. or would Programming clojure be more worth it?
10:40ddellacostasinistersnare: I own both for what it's worth, and I find them both useful
10:40llasramsinistersnare: JoC is better after you understand Clojure some anyway. No need to wait!
10:40ddellacostaagreed wholeheartedly
10:41sinistersnarewell, i only have enough for one, so i should go for Programming Clojure?
10:41ddellacostasinistersnare: if you are just getting started, I agree that is a good one to go for. A bit more straightforward. JoC is…kind of "concentrated" so to speak.
10:41ddellacostain other words, what llasram said.
10:42sinistersnareddellacosta: ok thanks, ill go for Programming clojure then :D
10:42sinistersnarellasram: ^
10:42ddellacostaseangrove: have you checked out dommy?
10:45mefestoanyone know if it's possible to configure enlive to reload the template for each render for development purposes?
10:59dhlmefesto: did you check out the issue I referenced? There are a couple of solutions there.
11:08seangroveddellacosta: dommy looks amazing
11:08seangroveThis weekend I'm working on a cljs + angular frontend for Kandan, and sadly dommy may not fit perfectly
11:08ddellacostaWe have been using domina and before that jayq, but I like dommy
11:08seangroveActually, it might...
11:08ddellacostahaha
11:09ddellacostawow, so how is angular + cljs working for you?
11:09ddellacostaI haven't tried cljs with any frameworks at all
11:09ddellacostareally curious about tthat
11:09seangroveAt least the templating portion
11:09seangroveWell, not sure, that's why I want to do it as a weekend hack
11:09ddellacostaah, gotcha
11:09ddellacostaI'll be really interested to hear how it goes
11:09seangroveBut lynaghk has written a mobile app using cljs + angular, said it's quite good
11:09ddellacostaah, nice
11:10seangroveWe'll see if his level of performance is attainable by mere mortals, though
11:10ddellacostalately I feel like when I write cljs, I'm doing the kind of really simplistic stuff I was doing 5-7 years ago in JS
11:11ddellacostajust glossy interactivity. I want to build something out with a bit more intelligence, but I haven't figured out a good approach yet
11:11ddellacostait's like started over in some ways.
11:11ddellacostastarted -> starting
11:11seangroveWell, it's all there :)
11:11ddellacostaanyways, interested in hearing more about that.
11:12seangroveWhat kind of stuff are you working on with it, a single-page app?
11:12ddellacostasort of, that's part of the problem. I've inherited something which is kinda like a few single-page apps
11:13ddellacostabut, still not quite. I want to move us to something that is much more like an integrated system with much more intelligence on the front-end.
11:14ddellacostaI mean, it's only been a month since I started though. Also, we have a bunch of Coffeescript that I'm slowly migrating to CLJS
11:14ddellacostaso it'll take some time.
11:17mefestodhl: sorry for the delay, just now seeing your messages. reading that issue now
11:18mefestodhl: well i guess that answers my question. thanks :)
11:34seangroveI haven't seen this error when compiling a cljs project before, and googling isn't helping, in case someone recognizes it: https://www.refheap.com/paste/14962
11:34jweissinteresting. https://www.refheap.com/paste/14961 apparently when you destructure a list in a let, the list itself is saved in an invisible local binding. So my assertion macro that prints out local values will explode with OOM if I do (let [[x y] (iterate inc 1)] ...) even though it appears that nothing is holding onto the head.
11:35jweisstook me a while to figure that one out.
11:35jweissgfredericks: that's what was causing my OOM yesterday.
11:40dhlmefesto: did you have a chance to check out laser by Raynes?
11:46seangroveWell, clang seems to be totally broken
11:49TimMcjweiss: I'd like to see a repro case.
11:49jaleydoes anyone know much about slf4j/commons-logging and exceptions getting eaten? I have a dependency on a library that pulls commons-logging onto my classpath, and i think this is causing exceptions to be hidden
11:49TimMcWhat's causing the seq to be realized?
11:49seangroveWell, broken on the latest clojurescript, seems alright with clojure 1.4.0 and cljsbuild 0.3.0
11:56bbloomseangrove: clang? the llvm compiler? what does that have to do with cljs? i'm confused.
11:57hyPiRionbbloom: clang some js thingy too
11:57seangrovebbloom: It's a poorly named cljs library wrapping angular
11:57seangrovehttps://github.com/pangloss/clang
11:57bbloomah ok
11:57bbloomwhat's broken with the latest cljs?
11:58seangrovehttps://github.com/pangloss/clang/issues/10
11:58seangroveI'm not sure how to track down that error
11:58bbloomdoes it occur with no optimizations or only with simple or advanced ?
11:59seangroveNo optimizations
11:59seangroveYou've inspired me to open up the closure.clj file and see what's going on here
12:02jweissTimMc: https://www.refheap.com/paste/14964
12:03jweissTimMc: it's actually destructuring let that expands into a binding for the whole list
12:03_fm_Hi
12:05_fm_I am writing a small compojure application and I was wondering if there was a way for creating DB tables at startup if needed. My idea is that at startup the app would check if the tables exist and if they don't it will create them before serving the first request. Is there an easy way to do this?
12:06justin_smith_fm_: define a migration that only runs if it has not been applied, and run it on startup?
12:07justin_smiththere is a function clojure.java.jdbc/table?
12:07justin_smiththat checks if a table exists
12:07nickmbaileyanyone know of any immediate things to look for when tests run normally but fail when run with cloverage https://github.com/lshift/cloverage
12:09_fm_justin_smith, I see. Need to find where to call that code.
12:09justin_smithin your main / init function?
12:11justin_smithcompojure uses ring right? under the :ring entry in project.clj you can specify :init
12:11justin_smiththe function named under :init will run on boot
12:11_fm_justin_smith, nice! Didn't know that
12:12_fm_justin_smith, thanx!
12:12justin_smithnp
12:21mpenetnickmbailey: I had an issue in the past where it would ignore :test :resource-path from the project.clj file and cause breakage because of that
12:21gfredericksjweiss: oh it was because of a macro that looks at all locals?
12:22gfredericks(macroexpand would show you the local pointing to the head, btw)
12:22jweissgfredericks: i'm still trying to prove that's exactly what happened, my particular macro filters out the locals to only print out ones that are used in the assert expression. so it shouldn't fail, and my simple attempts to get it to fail... have failed.
12:23mpenetnickmbailey: in my case it made a cassandra.yaml file missing from the classpath and cause the embedded server to fail starting up causing the tests to fail.
12:23gfredericks,(macroexpand-1 '(let [[a b] (range)] b))
12:23clojurebot(let* [vec__32 (range) a (clojure.core/nth vec__32 0 nil) b ...] b)
12:23mpenetnickmbailey: well not fail, not run
12:23nickmbaileympenet: mine seems more deviously subtle. tests run, but a few random asserts fail
12:24mpenetnickmbailey: yeah, too much magic for me, I gave up on it. I didn't really have the time to dig deeper
12:24ianeslickHi folks, I pushed a new nrepl-inspect middleware offering onto Github last night if anyone want to take it for a test spin and make suggestions? It provides browsable views of values located in vars or from evaluated expressions and is extensible to support custom rendering of typed objects.
12:25ianeslickhttps://github.com/vitalreactor/nrepl-inspect.git
12:26ianeslickBasically I wanted something close to what I got used to with slime/swank that was easier to work with (and because slime/swank is become quickly deprecated)
12:29mpenetianeslick: that sounds useful
12:34nickmbaileympenet: in my case it seems like whatever cloverage is doing is causing code to run multiple times and i'm using some stateful java stuff
12:34nickmbaileyfwiw
12:35justin_smithnickmbailey: you could use a test fixture to clear out state between runs
12:35nickmbaileyi don't have state external to the test functions
12:36nickmbaileythe tests have a java ByteBuffer which seems like its getting read from twice which breaks since it has an internal cursor or something
12:36justin_smithbut a fixture would insure that the pre code and post code only gets run once (around each test, or around all tests, depending on definition) thus preventing such an issue
12:36nickmbaileyor something completely different is happening, i'm not sure haha
12:37justin_smithcould it have to do with the order in which tests are run?
12:38justin_smithbut regardless, any stateful consequences of tests should be set up / torn down by fixtures
12:42nickmbaileyyeah it isn't order of tests, i'll see if i can move the java stuff into a fixture
12:46NeedMoreDesuHow someone can use my package, pushed to clojars with "lein push"
12:48justin_smithNeedMoreDesu: by adding it as a dependency in project.clj then requiring it in their code
12:49justin_smith(assuming they are using lein)
12:49NeedMoreDesujustin_smith: my friend says, that he see "Could not find artifact"
12:50NeedMoreDesuYet I deleted it from .m2 and it was downloaded
12:50justin_smithdoes he have the exact version required that you pushed? look for a typo in the version maybe
12:51NeedMoreDesuHe uses exactly my project from dropbox
12:52NeedMoreDesuMaybe I am pushing it wrong? I can see it on clojars, yet it is not promoted.
12:52justin_smithpromoted?
12:53nickmbaileyjustin_smith: actually that wasn't the problem at all, i had some non test code that was evaluating stateful java code inside a hash map literal. the cloverage code apparently loads the hash map literal first, changing the order the code was evaluated in
12:53nickmbaileyfwiw
12:54justin_smithwell, my point about stateful things probably needing to be in fixtures still stands, right?
12:54TimMcgfredericks: I still don't see how jweiss' code could produce an OOM.
12:56NeedMoreDesujustin_smith: I don't know what promotion do on clojars.
12:57justin_smithNeedMoreDesu: are you (or your friend) using a lein plugin that affects which repos are visible by any chance?
12:59NeedMoreDesuHe uses mine lein.bat file. Not sure why should it do that.
13:00justin_smithlike for example maybe the other person does not have lein-clojars in project.clj
13:00justin_smith*profiles.clj, not project.clj sorry
13:00justin_smithask him to try using your profiles.clj file as well
13:01justin_smithfor example I have {:user {:plugins ... [lein-clojars "0.9.1"]}}
13:02NeedMoreDesuYep, I throwed it to him, yet it's still there.
13:03llasramNeedMoreDesu: Can you post your project.clj on refheap or github gist?
13:05NeedMoreDesuhttp://www.everfall.com/paste/id.php?w5y79lrwbu49
13:08llasramI'm able to `lein deps` successfully -- no resolution failures. So definitely something unusual on your friend's side
13:10NeedMoreDesuThanks. I guess I'll just throw him .m2 folder this time.
13:11llasramUnless... Does his version of `lein` work otherwise?
13:12llasramI think I've seen people get an artifact error from the lein master HEAD `bin/lein` script trying to download a version of the leiningen JAR itself which doesn't exist in an upstream repo
13:12llasramIf that's the problem, he needs to grab the most recent stable version of the script
13:12NeedMoreDesuHe was able to "lein run" many times
13:13llasramOh well. That was my last idea :-)
13:30justin_smithdo you know for sure he has lein-clojars in his profiles.clj?
13:31llasramjustin_smith: OOC why would that matter? lein-clojars is for deploying to clojars
13:31justin_smithoh, it doesn't affect getting things from clojars?
13:31llasramNope
13:32justin_smiththat was all I could think if they were using the same lein, the same project.clj, then the profile is the only difference I could think of, other than network weirdness
13:33llasramI agree it's a good thought -- just lein-clojars would be a red herring
13:34technomancylein-clojars is just a wrapper around scp
13:34technomancyand maybe ssh-keygen
13:35justin_smiththis is either a really weird bug or a pebkac
13:38@rhickeyhow does one set xmx for lein repl?
13:39@rhickey:jvm-opts ["-Xmx1g" "-server"]in project.clj seems to have no effect
13:39pjstadigi think you can set the JAVA_OPTS env var
13:39pjstadigor i was gonna way you can set it in the project.clj, but i guess you've tried that
13:41danielglauserpjstadig: didn't those settings move under profiles in project.clj?
13:41@rhickeyI tried :profiles {:dev {:jvm-opts ["-Xmx1g" "-server"]}} as well
13:41pjstadigsample project.clj still has them at the top level https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L293
13:41@rhickeyand JAVA_OPTS seems to do nothing
13:41mefestoi wonder if `lein trampoline repl` makes any diff?
13:42pjstadigrhickey: turns out it should be JVM_OPTS https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L337
13:42llasram:jvm-opts do work
13:43llasramYou do end up with two processes though w/o trampoline. The leiningen parent JVM won't have the options, but the actual REPL child does
13:44patchwork_JAVA_OPTIONS
13:45patchwork_JAVA_OPTIONS=-Denvironment=development or whatever
13:46technomancy:jvm-opts in the top-level of project.clj works for me; how are you testing it?
13:46@rhickey(-> (Runtime/getRuntime) .freeMemory)
13:46@rhickeyin repl
13:47@rhickeygood old java -server -Xmx1G -Xms1G -cp `lein classpath` clojure.main continues to work
13:48technomancydoes ps awx show the :jvm-opts arguments when lein repl is running?
13:48@rhickeyI've been using Leiningen 2.1.3 on Java 1.6.0_45 Java HotSpot(TM) 64-Bit Server VM if that matters
13:50technomancy.freeMemory only reports 284495376 for me even though Leiningen is definitely setting -Xmx1g
13:50jrostiI've javascript event, and I'm trying to access a member :target in clojurescript. (event "target") and (:target event) throw a type error.
13:50jrostihow to access the event properly?
13:51mefestojrosti: (.-target event)
13:51mefestojrosti: or (aget event "target")
13:51pjstadigrhickey: are you putting -Xms1g in the :jvm-opts, too?
13:52@rhickeytechnomancy: can't tell, line starts with /usr/bin/java -classpath and is truncated
13:53hiredmanit is a case thing, the jvm silently ignores G
13:53mefesto`ps awwx` should show the entire command line
13:53harobDoes anyone know if reducers.foldcat does not work with Maps? `(r/foldcat (r/map key (zipmap (range 50) (range 50))))` throws a StackOverflowError, even though it works fine replacing `r/foldcat` with `into []`.
13:53seangroveIs there a way to examine/print-out the constructor function(s) for a record type?
13:54pjstadigi don't think (-> (Runtime/getRuntime) .freeMemory) is going to be 1g in a fresh repl unless you have -Xms1g right?
13:55teromwhat does .maxMemory tell you?
13:55@rhickeypjstadig: yes, better with that, but not same as normally
13:55@rhickeywhich is 1/2 heap
13:55@rhickeyI get 64mb
13:55seangroveI'm getting an error that there's NoSuchMethod, but I'm not sure what it's expecting - the source in closure.clj seems to be right, but thinking maybe it's picking up on an older version of the clojurescript compiler
13:57@rhickeyIn any case, just reporting diff, seems like mem is there
13:58@rhickeythanks all
14:01@rhickeyasync coming along, should be ready for kicking around soon
14:01bbloomrhickey: tomjack and i were kicking around with it a tiny bit early
14:02bbloomrhickey: i tried to do the little google search example rob pike showed: https://www.refheap.com/paste/14917
14:02bbloomrhickey: alt wasn't working when i tried it though
14:02seangroverhickey: Very much looking forward to trying it out
14:03bbloomrhickey: also, i'm not quite sure how the blocking operations are gonna translate to CLJS without a lot of extra async forms
14:03@rhickeyThe block is now called async/go, and I don't know why you would wrap things so tightly as that
14:04@rhickeyalt warks also
14:04@rhickeyworks
14:04@rhickeybbloom: where does alt belong in that?
14:05bbloomrhickey: was trying to use it for the timeout idiom on line 29
14:05@rhickeyah, alt in async should come out today
14:05bbloomrhickey: ah, ok
14:07bbloomrhickey: i wasn't quite sure how to use alt in a way that "feels good". i did the destructuring let with a case on the label, but it feels kinda redundant. either way, i used a transient and conj! to directly port the golang code. i stopped short of searching for a better idiom when i realized alt didn't work in async
14:07@rhickeyok, I see you are trying to get multiple requests in flight
14:07@rhickeythere will be something like par for that
14:08bbloomrhickey: par?
14:11@rhickey(async/par x y z) === (async/go x) (async/go y) (async/go z) => chan that will close when all complete
14:12bbloomgotcha.
14:12ucbI seem to recall that there's an arrow macro that shortcircuits the evaluation if any of the steps returned nil, was it -?> or something?
14:12bbloomucb: some->
14:13ucbbbloom: thanks! I assume this is clojure 1.5?
14:13bbloomucb: yes
14:13ucbthanks
14:13sinistersnareif i write a program in clojure 1.3, will it work in 1.5?
14:13sinistersnarethis may seem genearl
14:13sinistersnaregenearl
14:13sinistersnarewhatever
14:13sinistersnarebut
14:14sinistersnarethe book Programming Clojure is in 1.3, and i wanted to know if it would work on a clojure 1.5 install
14:14@rhickeybbloom: where's the go source for that? I can't make out the intent anymore
14:14llasramsinistersnare: Unless you do something pretty odd, the yes
14:14bbloomrhickey: https://github.com/lintide/GoConcurrencyPatterns/blob/master/googleSearch05.go
14:14bbloomrhickey: i'm trying to wrap my head around the CLJS story too. if you look at that fake-search fn, you'll see that it uses a block <! to sleep. Presumably you'd need to wrap that fn in an async macro, but the async/go idea creates a channel, which complicates the call site
14:15bbloomrhickey: see also time.Sleep in the go source on line 24
14:16sinistersnaredo you think that Programming Clojure would be ok with a 1.5 install?
14:16llasramsinistersnare: Yes. It pretty much just won't cover the small number of new features since 1.3
14:17sinistersnareok thanks :D
14:17sinistersnarejust got home, gonna hit buy on amazon
14:19sinistersnarejust to be sure, you guys recommend Programming Clojure over Clojure Programming? http://puu.sh/30gCv.png
14:19mefestosinistersnare: The Joy of Clojure is good too :)
14:19technomancysinistersnare: I like the oreilly one a lot
14:19technomancyhaven't read the 2nd ed. of the prags though
14:19sinistersnaremefesto: i was told JoC is a tad more advanced, and i could just wait for the second edition later
14:19Okasumefesto: Or maybe Clojure of the Joy?
14:20danielglausersinistersnare: Both are good books
14:20mefestoOkasu: I'm waiting for that one. it sounds awesome :)
14:20llasramsinistersnare: Oh, I thought we were talking about the O'Reilly book. I do recommend that one, but haven't read the more recent edition of the pragprog book
14:21sinistersnarellasram: so i should get the ORielly one?
14:22sinistersnarei think im going to get the ORIELLY one
14:22sinistersnarethanks guys
14:22alex_baranoskyis there a way to remove people from a clojars group?
14:23gfrederickswhy on earth would (first -' -]) do anything interesting? https://github.com/clojure/math.numeric-tower/blob/master/src/main/clojure/clojure/math/numeric_tower.clj#L58
14:24hyPiRiongfredericks: because 1.2 and 1.3 had arbitrary precision for -, +, * and /
14:24llasramgfredericks: Pre-1.3, [-' -] would parse as the symbol `-` then `'-`
14:24jtoyim writing a method that will run inserts into a db, do i need to wrap it with anythign special since it is considered mutable?
14:24gfredericksllasram: oh holy crap
14:24hyPiRionIn addition, 1.3 and 1.2 parses -' - as - '-
14:25bbloomrhickey: so i my cljs async question is this: Can I create an async function that returns a value? Or must it return a channel in order to be non blocking? the sleep in the fake search function is representative
14:25gfredericksthat's crazy amazing
14:25hyPiRionit's essentially a trick to do arbitrary math
14:25gfredericksthat is the hackiest thing I've ever seen in this entire file
14:26llasramI used δ as a variable the other day. That made me feel pretty good about myself
14:26bmentgeslol
14:26hyPiRionllasram: https://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71
14:27hyPiRionit's so lovely.
14:27llasramNice!
14:30@rhickeybbloom: https://www.refheap.com/paste/14966
14:31@rhickeythis using threads, async will have same shape
14:31hyPiRionIf you like unicode, you should try out BODOL btw.
14:33llasramHmm, interesting
14:33tomjackrhickëy: so is a nil message always a programmer error or is it a feature that you can pretend to be closed?
14:34@rhickeybbloom: their fake search and yours return functions
14:34bbloomrhickey: yeah, i know, i'm referring to the function that is returned, sorry for not being clearer
14:35llasramhyPiRion: I'm not sure I'm necessarily a big fan of it for its own sake... I've been doing a lot of translation back-and-forth between code and mathematical notation lately, and being able to use Greek letters in code has kept things a bit more in sync
14:35bbloomrhickey: web1, web2, etc all return a vector, but have a blocking read in them -- how will that work on CLJS?
14:35@rhickeythe function that is returned doesn't itself return immediately
14:36hyPiRionllasram: hahah. No, by no means. If that were the case, I'd be using a japanese Common Lisp variant probably.
14:36bbloomrhickey: yeah, that works as expected on the JVM, but it's not obvious to me that the same code will work on CLJS where the blocking read needs to be rewritten into SSA
14:36sinistersnarerhickey: a little off topic, but i listened to your talk on Clojure for Java programmers, it was cool, thanks :D
14:36@rhickeysinistersnare: you're welcome
14:38seangrovebbloom: seems like you could simulate blocking semantics using set/clearInterval as the basis
14:39tomjackthe problem is that fake-search is a function
14:39@rhickeybbloom: has nothing to do with SSA (that is just an implementation detail of inversion of control), you just want Sleep for javascript
14:39tomjackthe async macro system can't tell that there is a blocking read inside
14:40@rhickeySleep must have special handling in Go scheduler
14:41@rhickeyasync is not Go
14:42@rhickeyfunctions are not async
14:42@rhickeythere are async/go blocks, and they return channels
14:43@rhickeythe value of the last expression in the block will be placed in the channel, then the channel will be closed
14:44@rhickeyso if you make the body of a fn a go block, the fn returns a channel
14:44bbloomrhickey: yeah, i understand how that works. my concern is about portability between CLJ and CLJS. as it is because <! and >! won't be available outside of core.async/whatever macros on CLJS, right?
14:45@rhickeyright
14:45@rhickeyjust like future doesn't work
14:45@rhickeynor anything else blocking
14:45@rhickeybut we can protect against use outside of async/go
14:46@rhickeyportable code will use go instead of future
14:47bbloomrhickey: how do you plan to protect against blocking ops outside of async/go ?
14:48tomjackno need to protect against them if they just aren't there..
14:48bbloomtomjack: yes, but if you're developing on JVM and want to be writing portable code
14:50tomjackoh, I see
14:50@rhickeybbloom: on cljs? they can always throw, as go macro rewrites them
14:50tomjackbe careful? :)
14:50technomancygreat post on dynamicity vs performance: http://blog.headius.com/2013/05/on-languages-vms-optimization-and-way.html
14:51tomjackI was thinking I'd like some way to cause blocking ops to throw in clj
14:51tomjackfound so far I block accidentally somewhat often
14:51@rhickeybbloom: What you are asking for (async functions that return values) is impossible on JS engine
14:51bbloomrhickey: no, on clj, not cljs, see what tomjack is saying ^^
14:51@rhickeyyou'd need real blocking
14:52tomjackbbloom: but that wouldn't help really
14:52@rhickeybbloom: I don't care about that? How do you keep people from writing future calls?
14:52tomjackyou'd still have to run the thing to see if anything throws
14:52tomjackand you might as well just run it in cljs and see if it throws there
14:53@rhickeybigger issue is how to protect against use of blocking <! and >! on async thread pool - when on fj pool we can detect
14:54bbloomrhickey: i think this might just be too difficult to discuss via irc :-/
14:54@rhickeybut the option still exists to name them differently, still early days, not even set on <1 and >!
14:54@rhickeybbloom: I do understand - you want to write portable code with protection on the clj side from writing something that won't port
14:54bbloomrhickey: so far <! and >! has felt relatively natural to me. i think that i'd like a channel -> channel copy operator though
14:54bbloomrhickey: I've written (>! x (<! y)) a few times
14:55@rhickeybbloom: we are sticking to the primitives for now
14:56@rhickeybbloom: so, given async fns having returns being impossible on JS, you just have to invert control at the edges, thus take! and put!
14:57bbloomrhickey: yeah, i experimented with take! and put! too. i'm just worried that going from clj to cljs will mean injecting a bunch of extra async/go forms and a bunch of extra (>! x (<! y)) patterns that only serve to mask the underlying desired blocking waterfall data flow
14:58tomjackdo 'spliced' channels (write0 -> read1 and write1 -> read0, I'm calling them 'tunnels') confuse the semantics?
14:58@rhickeybbloom: I don't know what the expectations are - one platform has blocking and one doesn't
14:59@rhickeyso at the edges it must be different, or you can do the JS style everywhere
14:59@rhickeycause callbacks work on JVM as well
14:59@rhickeybut it fundamentally sucks a ton of callbacks out of the core of the logic, adds first-class channels, separation of concerns etc
15:00bbloomrhickey: oh yeah, don't get me wrong: this is a HUGE improvement over the base level callback soup & channels are a great addition all around
15:01bbloomrhickey: thanks for the hard work on this, i really appreciate it
15:03mthvedtare there comprehensive docs for minikanren/core.logic besides 'the reasoned schemer'
15:04tomjackmthvedt: I was watching a google hangout where one person announced that they had made nice documentation for alphakanren
15:04tomjackthe joke was then that this is 'not the minikanren way'
15:05bbloomrhickey: i guess my expectation is that i can defasync or something like that which automatically wires up the same inversion of control special treatment that <! and >! get -- admittedly, this is a very half baked idea
15:05@rhickeyif you can wait for the answer it is blocking
15:06@rhickeythere will have to be an edge somewhere
15:09mthvedttomjack: hmm, if those docs exist i can't find them on google
15:12mefestodommy vs crate? commit activity looks to be higher for dommy.
15:13bbloomrhickey: in theory, the same inversion of control that happens with async/go for <! can happen with sleep or fetchUrl or whatever. I'm thinking that some kind of defasync macro could register a function for participation with that inversion of control. That would mean that an extra <! isn't necessary at the call site, so it would look like a blocking call without having to think about the extra implicit channel
15:14bbloomrhickey: unfortunately, i need to run right now. thanks for listening
15:16seangrovemefesto: dommy is probably where most activity is headed
15:17seangroveI'm unclear about how to resolve this error: java.lang.NoSuchMethodError: cljs.closure.JavaScriptFile.<init>(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
15:17seangroveIs the issue that the types passed to the constructor aren't matching as expected?
15:18hiredmanor the count doesn't match
15:18hiredman(parameter count)
15:19mefestoseangrove: thanks
15:21supersymtechnomancy: thanks, that's a good read indeed
15:23seangrovehiredman: And if I (clojure.reflect/reflect JavaScriptFile), I should see the available arities/types for constructors, right?
15:23technomancysupersym: yeah, though oddly he never mentions the fact that he's only talking about dispatch
15:24technomancydispatch is a pretty small part of what makes programs run fast
15:24hiredmanseangrove: have you cleaned out generated classes recently?
15:24technomancywell
15:24technomancyit's a big part of what makes ruby programs run slowly I guess =)
15:24seangrovehiredman: yeah
15:24hiredmanand how is JavaScriptFile defined?
15:25seangrovehiredman: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L263
15:26seangroveI'm trying to track down why the error above only happens with clang is added as a project dependency
15:27tomjackpresumably someone's got bad AOT
15:27tomjack?
15:27seangroveWell, in the meantime, I'm interested in learning how to read https://www.refheap.com/paste/14967
15:28seangroveThis is (pprint (reflect JavaScriptFile))
15:28seangroveCan I tell what the constructor looks like from anything in there?
15:29tomjackyou installed clang yourself right
15:29hiredmanthe costructors are the members with the same name as the class
15:30seangrovetomjack: Yeah, git clone, lein install, added as a dependency to a minimum project, lein cljsbuild once in said project, get the error above
15:30seangroveSo inside closure.clj tearing it apart to see if I can get into it a bit more
15:30tomjack`jar tf ~/.m2/repository/clang/clang/*/*.jar`
15:30tomjackmy guess is it has not much to do with closure.clj
15:30seangrovehiredman: That's awesome, thank you
15:31tomjackI want a `cat foo | refheap`
15:31hiredmanyou either need to explicitly pull in a clojurescript version, or use the same version of cljsbuild as clang
15:32gfrederickshas anybody written any code that would, when encountered, fire up an nrepl debug server? (i.e., one that adds the locals to code to be eval'd)
15:32seangrovehiredman: Yeah, I've gone into clang, updated it to use cljsbuild 0.3.2, lein clean, lein install, try this again, same error
15:32tomjackare there .class files in the clang jar?
15:32seangroveIt does seem like some strange version mismatch though, but I'm trying to figure out where it's coming from
15:32tomjackdunno why there would be..
15:32supersymi see
15:32seangrovetomjack: no, no class files
15:33hiredmanseangrove: I wouldn't change the version of cljbuild in clang, I would change it in your project
15:33tomjackhuh, the only time I've ever seen an error like that, it was due to AOT
15:33seangrovehiredman: Was hoping to submit a pr to bring clang up to date with cljsbuild
15:33hiredmanwell maybe it get working first?
15:33hiredman:)
15:34seangroveHeh, yes, that's what I thought I was doing
15:34tomjacktry a `lein cljsbuild clean` for good measure if you haven't already :)
15:34tomjackmaybe it's keeping around an old compiled cljs or something?
15:35seangroveYeah, doesn't seem to be the case...
15:36seangroveMaybe I should give up on clang, but I was more interested in learning more about the cljs compiler by solving this
15:36hiredmanI would definitely try it with the version of cljsbuild that the authors of clang use, so get the same version of clojurescript they used
15:36seangrovehiredman: Yeah, it works in that case
15:36hiredmanright, so it might be a regression in clojurescript
15:37hiredmana feature that no one but the clang guy uses
15:37tomjackclang looks like it's just cljs really, right?
15:38seangroveYeah, I believe so, I don't see it exercising anything that should bother the compiler
15:38hiredmanit might even be fixed in master
15:38hiredmantomjack: yeah, but javascriptfile has to do with exposing external deps to the google closure compiler
15:39hiredmanwhich clang does with angular
15:39tomjackaha
15:39tomjackwhere? hmm
15:39hiredmandeps.js? somehow
15:41seangrovedeps.js is empty though
15:41hiredmanI'm not saying there is any code in deps.js
15:42hiredmanjust the fact that clang is trigger some less frequently used code path
15:42tomjackI see there's a vendor dir with angular and a resources/public/js/angular.js but no externs
15:43tomjackno :libs or :foreign-libs either
15:43seangroveYeah, looks like he just includes it separately in the index.html
15:47seangroveOk, it's working. I cloned clang, changed the cljsbuild and clojure version to the latest, lein cljsbuild clean, lein clean, lein cljsbuild once, lein installed it. In the project making use of it, I did `lein cljsbuild clean`, lein clean, lein cljsbuild once dev, and it worked
15:48seangroveI'm guessing from the reflect that the defrecord of JavaScriptFile in memory was a older one expecting 6 arguments, not 7 (for the source-map support), and the reason it was loaded was because of pebkac
15:49seangroveI didn't clean thoroughly enough or something
15:50gfredericksdoes anybody else have trouble jumping to source when using nrepl.el against a remote server versus -jack-in?
15:53ToBeReplacedhow does clojure clean up its docstrings?
15:54gfredericksclean up?
15:54ToBeReplacedthe equivalent of: http://docs.python.org/2/library/inspect.html#inspect.cleandoc
15:55ToBeReplacedit must do something to remove line breaks and indents
16:13gfredericksoh hm
16:13gfrederickslooks like it doesn't
16:13gfredericks,(doc (meta #'conj))
16:13clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol>
16:13gfredericks,(:doc (meta #'conj))
16:13clojurebot"conj[oin]. Returns a new collection with the xs\n 'added'. (conj nil item) returns (item). The 'addition' may\n happen at different 'places' depending on the concrete type."
16:14gfredericksclojure.repl/doc doesn't make any attempt to either
16:14gfredericksI take it back
16:14gfredericksmaybe it does
16:16gfrederickslooks like doc blindly assumes all but the first line of your docstring is indented two spaces, and adds two spaces to the first line to match
16:16gfrederickspresumably works most of the time
16:22IntensityHi. I'm wondering if Chouser/clojure-jna (Dynamically load and use native C libs from Clojure using JNA) is still maintained and working. It was modified four years ago. Is there an alternative nowadays?
16:28NeedMoreDesuIntensity: don't know that lib, but I used JNA lib from nakkaya. You can see the example here: https://github.com/NeedMoreDesu/clj-hisoutensoku and article here http://nakkaya.com/2009/11/16/java-native-access-from-clojure/
16:30llasramIntensity: My vote is write the tiny bit of Java you need to provide the wiring for JNA
16:30IntensityNeedMoreDesu: Cool. Thanks for providing that.
16:30llasramThat's what I've been doing. You don't really right any "code" -- just JVM<->C bridge description
16:31llasrams,right,write,
16:31hiredmanthe one time I needed to call native code I wrote a little jni stub for it
16:32tomjackif-let-reduced.. hmm https://www.refheap.com/paste/cb28e458f2c85afc5571f6570
16:32hiredmanyou can do a lot with a single C call and the Unsafe
16:32tomjackI wish I could think of a way to only write it once
16:33hiredmanhttps://github.com/hiredman/beaglebone-jni-utils/blob/master/a/B.java
16:34hiredmanhttps://github.com/hiredman/beaglebone-jni-utils/blob/master/B.c
16:34llasramtomjack: Only write what once?
16:36tomjack(let [ret' (f ret v)] (if (reduced? ret') @ret' (recur ret' ...))) etc
16:37llasramIsn't that what your `if-let-reduced` does? Looks pretty compact
16:38tomjackyeah, I just wish I didn't need if-let-reduced
16:38Intensityhiredman: Cool well I understand part of how it works at the high level - thanks for letting me know. I'm assuming that the provided build.sh will demonstrate this and that I could modify that to invoke an arbitrary C function through Java (within Clojure).
16:39hiredmanyeah, what I have there ends with a class a.B with a (non static) method that calls the C code
16:40tomjackit seems awfully similar to https://www.refheap.com/paste/795482490fa828aac731634bf
16:40hiredmanso (.mem (a.B) ...)
16:40hiredmaner
16:40hiredmanso (.mem (a.B.) ...)
16:41hiredmanhttps://github.com/hiredman/blackbox/blob/master/src/blackbox/gpio.clj is where it gets used
16:41Intensityhiredman: Cool, thanks again then is there anything special that needs to be done for the C function to return binary data (unsigned char *)? I suppose this would be the JNA side of the question.
16:41tomjackhmm, except it's (pure reducef) <*> ret <*> (pure v)
16:42mindbender1,(true? (= :pedestal :clojurized-mvc))
16:42clojurebotfalse
16:43hiredmanIntensity: this is JNI, not JNA, if you intend for that to be a string on the java side you'll have to do some kind of conversion, and I don't know anything about that. just enough to get the jni I needed working
16:43tomjackhah, I thought you must have typed your own 'false' and was like 'whoa clojurebot! how do you know that?' for a fraction of a second
16:45tomjackbbloom: did you notice foo// made it? :)
16:55tomjackis it possible to observe the current value of a ref and be notified of all future values? add watch, then deref, and if the watch triggers before deref returns, ignore it?
16:57tomjackor, hmm, take the old from the watch as the current value and ignore the deref
17:05@rhickeybbloom: here's a go block version, compatible with cljs except for the edge (last line) https://www.refheap.com/paste/14974
17:05@rhickeynote no Go-lang imperative cruft
17:06@rhickeyso blocking and parking JVM versions of the baseline stuff works today
17:06@rhickeypull it and play folks
17:07@rhickeymore docs soon
17:15seangroveI'm seeing "Uncaught ReferenceError: self__ is not defined", and "Cannot read property 'browser' of undefined" while using the nrepl.el, clojurescript repl, and cemerick's piggieback
17:16seangroveI see this ticket mentioning the same thing, but it's from awhile ago, and probably not relevant http://dev.clojure.org/jira/browse/CLJS-434
17:23tomjackbbloom: 'signal' chans https://www.refheap.com/paste/9c85c3855edc574d2f4fdb9ff
17:30tomjackI suppose maybe you could also just create a special Handler that waits until commit to call the signal-f for the value
17:45jtoywhat should I use to get unix timestamp?
17:46llasram##(quot (System/currentTimeMillis) 1000)
17:46lazybot⇒ 1369431548
17:46justin_smith(.getTime (java.util.Date.))
17:46justin_smithoh yeah, and divide by 1000
17:46justin_smith##(.getTime (java.util.Date.))
17:46lazybot⇒ 1369431588227
17:47jtoycool,thx
18:30bbloomtomjack: yes, i saw the 'foo// fix :-) about time! heh
18:32zRecursi`It is good to here haskell is based on Lisp and Prolog on "Planet Clojure", but i really donot know what unification is ?
18:34bbloomzRecursi`: http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-to-the-death/
18:34bbloomzRecursi`: see also the other posts in that series
18:35zRecursi`bbloom: thanks
18:37bbloomtomjack: you see rhickey's refheap above directed at me?
18:38bbloomthe (take 3 (repeatedly …)) is clever.
18:38bbloomdoesn't really handle the timeout case correctly, but some rearranging with a take-while would cover it
18:38bbloomand i guess that async/par he mentioned before would clean up the c chan and those 3 go statements that pull from each of the 3 "search backends"
18:52djwonkit seems to me that 'testing' a macro with macroexpand would be a good idea in automated tests. but I'm not seeing examples of that in the Clojure source. is there a better way? reason to not do it?
18:54technomancydjwonk: good macros are usually trivial wrappers around existing functionality, so it's often not worth the effort
18:54technomancyunless you're doing something really nuts like implementing pattern matching
18:54djwonktechnomancy: I don't buy that argument. while writing the macro, one probably checks with macroexpand at least once
18:55djwonkor, at least, one does hopefully check it -- so if you are checking by hand, it isn't hard to drop into the code
18:55technomancydunno... can't remember the last time I wrote a macro
18:56TimMcWTF, is there *seriously* not a standards-compliant, reasonably full-featured URI manipulation library out there in Java-land?
18:57justin_smithTimMc: does this not qualify? http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/URI.html
18:59TimMcjustin_smith: The lack of different encode methods makes me suspicious.
19:00technomancygrepping through all the clojure I've worked with this year I see a few trivial macros that wrap try/catch, a few macros that are clearly bad ideas ... and defproject.
19:00technomancyand defproject will probably become a trivial macro in lein3
19:00TimMcjustin_smith: Fragments, querystring components, matrix parameters, path segments, and userinfo all have different allowed sets of unescaped characters.
19:00justin_smithTimMc: that is in a different class http://commons.apache.org/proper/commons-codec/
19:00djwonktechnomancy: that's great that you write so few :) I like what you are saying about making them easy to reason about
19:01technomancydjwonk: it really depends. obviously something like core.match needs lots of tests.
19:01technomancybut justifiable cases for introducing new syntax are few and far between
19:01TimMcjustin_smith: It also doesn't have any manipulation methods, such as the ever-required "add a querystring parameter".
19:02djwonkTimMc: that's crazytown
19:04tomjackbbloom: thanks I missed that version
19:04TimMcI just discovered I was relying on some *very scary* URL-manipulation code, but I don't know where to find something better.
19:05tomjack"async is not Go"
19:05tomjack..did that mean "#'async is now #'go"
19:06tomjackI guess "core.async is not Go"
19:06bbloomtomjack: yeah think so
19:06tomjackcase works too, nice
19:08justin_smithTimMc: I guess with commons you would need to use getQuery, do the manipulations, then setQuery; and regarding your point about different allowed characters, it has separate methods to account for each part, and looking closer it has escaping and unescaping in there (set*, setEscaped*, setRaw*)
19:09djwonkTimMc: you are saying that http://docs.oracle.com/javase/7/docs/api/java/net/URI.html / URLDecoder / URLEncoder are not cutting it for you?
19:09justin_smithbut if it isn't sufficient, I don't know what else is better out there
19:11djwonkthis makes it look like a mess as well: http://stackoverflow.com/questions/2632175/java-decoding-uri-query-string
19:12alex_baranoskydoes anyone know if there's a library for EDN for use form R?
19:17djwonkalex_baranosky: I looked but found nothing. I tried here: http://www.inside-r.org/search/apachesolr_search/deserialize
19:17alex_baranoskydjwonk: thanks
19:17djwonkalso searched for "clojure" "EDN" too
19:18djwonkalex_baranosky: nothing under http://www.inside-r.org/packages/e either. this is your chance to write it! :)
19:18alex_baranoskydjwonk: YAY me! :P
19:19callenalex_baranosky: question about korma for you
19:19alex_baranoskycallen: yep
19:22NeedMoreDesuTrouble using lein, again(with other pc). http://www.everfall.com/paste/id.php?vr84wpirkf0r
19:23NeedMoreDesu"lein upgrade", jdk reinstall. Is there something else to try?
19:30llasramNeedMoreDesu: My understanding is that Windows support is slightly scattered, just because none of the core Leiningen devs use Windows. My initial reaction to that error is that somebody is not happy with the current level backslash escaping, but that's just a hunch
19:35hyPiRionNeedMoreDesu: what version are you running?
19:37hyPiRionclojurebot: core.async is not Go
19:37clojurebotc'est bon!
19:37bbloomhyPiRion: lol the meme begins
19:38bbloomi'm pretty sure rich was trying to say core.async/async is noW core.async/go
19:38bbloombut both ways work, heh
19:38hyPiRionhah
19:51djwonktechnomancy: now that I *am* trying some macroexpansion tests, gensyms are making it non-obvious how to proceed
19:53tomjackbbloom: I suspect he was talking about the lack of "Go-lang imperative cruft"
19:53tomjackmaybe
19:54Raynescallen: So, we should probably figure out how we're going to meet up at the concert.
19:54Raynescallen: Should I text you or something?
19:54RaynesI can carry a big CALLEN sign, but I'd prefer not to.
19:58hyPiRionRaynes: You can carry a big RAYNES sign instead
19:58hyPiRionI totally solved that issue for you now, no need to thank me.
20:04technomancyjust follow your heart; I'm sure that will lead you to each other
21:10pppaulboth of you should wear exactly the same outfit
21:11pppaulthen you can ask everyone what the person you are looking for looks like without any need for props or hand waving
21:23TimMcdjwonk: http://www.lunatech-research.com/archives/2009/02/03/what-every-web-developer-must-know-about-url-encoding made me sad, because it showed how all these libs are terrible/incomplete, and then doesn't really have any replacements to offer.
21:23TimMcystael: How would you like to write a URL library for Hack Week? :-D
21:27djwonkTimMc: my take away is that a wrapper on top would be very useful
21:29llasramTimMc: I'm going to add URLs to inet.data someday. But you know, scratching your own itches etc
21:30TimMcdjwonk: I'm envisioning something that just wraps the Java standard lib + some Apache stuff.
21:31djwonkcool. have you looked at, say, Nutch to see if it does it right?
21:32djwonkTimMc ^
21:32TimMcHmm, no. Will do.
21:33djwonkTimMc: if it does not, that would be a shame
21:33djwonksince it is a crawler
21:38callenRaynes: well, that could work
21:38callenRaynes: I was pondering when I should head down as well.