2013-05-24
| 00:38 | ustunozgur | how would one update a map atom? (def x (atom {}) (swap! x (conj x {:foo "bar"})) doesn't seem to work. |
| 00:44 | ustunozgur | ok, got it, (swap! x assoc :foo "bar") works. |
| 00:48 | frozenlock | Well, 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:49 | frozenlock | Insidious bugs were popping everywhere. -_- |
| 00:55 | d2r_ | If given a vector of N elements e, I would like to call (doto inst-exp (meth e1) (meth elem e2) … (meth eN)). |
| 00:55 | d2r_ | I am not sure how to express this. Is it possible? |
| 01:02 | brehaut | (reduce #(doto % (meth %2)) inst-exp v) ? |
| 01:02 | brehaut | thats a kind of boneheaded literal translation |
| 01:03 | d2r_ | hmm. Not sure what you mean. |
| 01:03 | brehaut | (let [o inst-exp] (doseq [e v] (.meth o e)) o) would be my preference |
| 01:04 | d2r_ | Ah, that's good. Thanks a lot! |
| 01:25 | amalloy | brehaut: 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:25 | brehaut | lols |
| 02:07 | ianeslick | Implemented halfway decent nREPL inspector middleware at: https://github.com/vitalreactor/nrepl-inspect |
| 02:55 | certainty | moin |
| 02:55 | clojurebot | It's greek to me. |
| 02:57 | r0bgleeson | moin |
| 02:57 | r0bgleeson | ,moin |
| 02:57 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: moin in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 03:07 | certainty | ,(constantly "moin") |
| 03:07 | clojurebot | #<core$constantly$fn__4051 clojure.core$constantly$fn__4051@aa204d> |
| 03:07 | certainty | oh it really exists |
| 03:35 | certainty | is there really no (flip) in core? |
| 03:36 | mthvedt | certainty: do you want reverse |
| 03:37 | certainty | mthvedt: reverse reverses a sequence, correct? |
| 03:37 | mthvedt | yes |
| 03:37 | certainty | nope I want (defn flip [f] (fn [x y] (f y x)) |
| 03:38 | nonuby | when using lein repl i thought there was a option in project.clj to open in a specific namespace like project.dev |
| 03:38 | nonuby | but cant find it now :( |
| 03:52 | ianeslick | project.clj: {:repl-options {:init (in-ns 'my.namespace)}} |
| 03:53 | ianeslick | Or more succinctly: {:repl-options {:init-ns foo.bar}} |
| 03:53 | llasram | nonuby: If you didn't know already, you can run `lein sample` to see a sample project.clj showing almost every option |
| 03:59 | nonuby | thanks guys! |
| 04:08 | amalloy | certainty: there's really no flip. it's not as useful as it is in haskell, because of multi-arity functions |
| 04:09 | gozala | Is there equivalent of :rename in :require forms ? |
| 04:09 | certainty | amalloy: ok thanks for the information. It's still odd though, it goes so well with partial. |
| 04:10 | gozala | I mean equivalent of (ns lib (:use [foo.bar :rename { qux beep }])) |
| 04:10 | amalloy | meh. 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:12 | certainty | amalloy: I'll consider it. I like point-free style though |
| 04:21 | luxbock | I'm having some trouble with creating a basic uberjar with lein |
| 04:21 | luxbock | https://www.refheap.com/paste/14947 |
| 04:21 | luxbock | is what I tried, what am I doing wrong? |
| 04:22 | luxbock | I tried to follow the instructions here: http://www.beaconhill.com/blog/?p=283 |
| 04:23 | llasram | luxbock: From your output: "Created [...] tester-0.1.0-SNAPSHOT-standalon |
| 04:23 | llasram | e.jar" |
| 04:23 | ucb | luxbock: try -jar ...-standalone.jar |
| 04:24 | ucb | luxbock: 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:24 | luxbock | ahhhh, I'm dumb |
| 04:24 | ucb | s/with// |
| 04:24 | luxbock | I didn't even notice there were two of them |
| 04:24 | luxbock | yeah that works |
| 04:44 | dnolen | gozala: refer |
| 04:44 | dnolen | alandipert: ping |
| 04:44 | gozala | dnolen: my understanding is that :refer is equivalent of :only |
| 04:44 | gozala | is there a way to use :refer as rename ? |
| 04:45 | gozala | or do you mean separate :refer that isn't part of :require ? |
| 04:46 | svedubois | I have a question about Google Closure Libraray using ClojureScript. |
| 04:46 | svedubois | Taking this example of a Filtered Menu: |
| 04:46 | svedubois | http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/filteredmenu.html |
| 04:46 | svedubois | How I can automatically open/close the content-portion of this FilteredMenu when the mouse enters/leaves the control (search input)? |
| 04:47 | dnolen | gozala: oh right, no I don't think there is a :rename for :refer? |
| 04:48 | dnolen | :rename in :use seems pretty feature-creepy |
| 04:52 | gozala | dnolen: to be honest I wish require had regular destructuring |
| 04:52 | svedubois | And my ClojureScript code: |
| 04:52 | svedubois | https://www.refheap.com/paste/14951 |
| 04:52 | svedubois | Any idea about how to enable drop-down effect? |
| 04:52 | dnolen | gozala: that doesn't make any sense to me. |
| 04:53 | edoloughlin | Is there a way to redefine Compojure routes (defroutes) without restarting everything? I'm using CCW. |
| 04:53 | gozala | dnolen: why not you just lear one pattern and use it where you need it |
| 04:53 | gozala | learn* |
| 04:54 | gozala | dnolen: anyway just ignore my comments & thanks for response |
| 04:54 | dnolen | gozala: 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:58 | zoldar | edoloughlin: you can wrap handler with (var ...) |
| 06:00 | mindbend` | where did clojure.contrib.sql goto? |
| 06:01 | talios | was it ever ported over to the new maven builds? if not - the great contrib grave in the sky |
| 06:01 | talios | or, the new separate repo builds I should say |
| 06:02 | mindbend` | url? |
| 06:02 | clojurebot | something |
| 06:02 | talios | I think you want https://github.com/clojure/java.jdbc |
| 06:02 | talios | thats where it moved by the looks of it |
| 06:02 | vijaykiran | http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go |
| 06:02 | talios | vijaykiran - hazah! I knew that was documented somewhere |
| 06:03 | talios | mmm, loving this new Alice in Chains album. so good. |
| 06:04 | mindbend` | talios: is that a lib? ;) |
| 06:05 | ucb | talios: new as in 2013? |
| 06:05 | talios | mindbend` - 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:06 | talios | ucb - yep, "The Devil Put Dinosaurs Here" - came out, today? or yesterday I think maybe |
| 06:06 | ucb | talios: |o/ |
| 06:38 | CookedGryphon | does anyone know if there's a way to get how much stuff is queued up in a channel in lamina? |
| 08:26 | svedubois | Taking this example of Google Closure Filtered Menu: http://closure-library.googlecode.com/svn/trunk/closure/goog/demos/filteredmenu.html |
| 08:26 | svedubois | I have reimplemented in ClojureScript: https://www.refheap.com/paste/14951 |
| 08:26 | svedubois | But 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:33 | ddellacosta | svedubois: 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:34 | svedubois | ddellacosta: I don't know how to close the content (goog-menu-content) |
| 08:37 | ddellacosta | not sure if this is exactly the effect you want, but just ran this in the console and it worked |
| 08:37 | ddellacosta | goog.style.setStyle(goog.dom.getElementByClass("goog-menu-content"), "display", "none"); |
| 08:38 | ddellacosta | svedubois: and you can use show again to show it |
| 08:38 | svedubois | ddellacosta: Yes it works |
| 08:38 | ddellacosta | svedubois: blatantly ripped off from this: http://stackoverflow.com/questions/1954874/how-to-hide-show-dom-element-in-google-closure |
| 08:38 | ddellacosta | svedubois: is that what you are looking for? I would then just attach a listener to mousein/mouseout that showed it/hid it |
| 08:39 | ddellacosta | svedubois: I like domina for that myself. |
| 08:41 | mpenet | CookedGryphon: just use count |
| 08:50 | mefesto | Good morning all. |
| 08:52 | mefesto | i'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:55 | wliao | Hi,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:56 | clgv | wliao: 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:58 | wliao | clgv: Hi, clgv. In `Clojure Programming`, agents are classified as uncoordinated and asynchronous. Am I wrong? |
| 08:58 | clgv | wliao: agents work sequential through the task in the order they were send to them |
| 08:59 | clgv | *sequentially through the tasks |
| 08:59 | mefesto | wliao: each thread is printing the numbers to stdout? |
| 08:59 | wliao | mefesto: Yes. |
| 09:00 | mefesto | wliao: and you want to somehow combine that output? |
| 09:00 | clgv | wilao: for example I use an agent for printing a progress report which summarizes the activity of multiple threads |
| 09:00 | clgv | wilao: tools.logging can be configured to use an agent for logging as well |
| 09:00 | wliao | clgv: I got it, the uncoordination should be betwen agents. |
| 09:02 | wliao | mefesto: The threads output to the same terminal, so they're combined. |
| 09:03 | mefesto | wliao: so you want to serialize printing so that one char from thread a, then one char from thread b, etc... ? |
| 09:04 | mefesto | meaning, 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:05 | wliao | mefesto: Yes, exactly. Maybe it's easier to achieve in Java. |
| 09:05 | mefesto | wliao: if im understanding correctly, i'd use a blocking queue per thread |
| 09:05 | mefesto | then have a printer thread which pops one char off each queue in turn |
| 09:06 | mefesto | wliao: clojure embraces the use of java.util.concurrent |
| 09:09 | wliao | mefesto: I'll give it try. Thanks for the tip. |
| 09:16 | clgv | wliao: if every thread prints one line at a time do you just want to avoid an uncoordinated mess of characters on the console? |
| 09:17 | clgv | wilao: if so, use an agent |
| 09:18 | mefesto | my rough attempt: https://www.refheap.com/paste/14957 |
| 09:22 | mefesto | not 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:22 | clgv | mefesto: if you do it like that you can just use an agent ;) |
| 09:23 | mefesto | clgv: how so? |
| 09:23 | mefesto | clgv: each thread does a send-off to the agent with the char? |
| 09:23 | clgv | mefesto: since an agent is in principle (simplified) a thread with a queue |
| 09:24 | mefesto | clgv: but will that guarantee the order of the printing? |
| 09:24 | mefesto | couldn't a thread `send-off multiple times before another thread `send-off's? |
| 09:24 | clgv | mefesto: yeah (send-off print-agent (fn [_, msg] (println msg)) "my message") |
| 09:25 | clgv | mefesto: it has the same guarantees as you LBQ implementation |
| 09:25 | clgv | first-sent first-served |
| 09:25 | mefesto | clgv: 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:26 | clgv | mefesto: multiple adds of one thread can happen with the LBQ as well |
| 09:26 | mefesto | clgv: yes but these are blocking queues so those threads must wait their turn |
| 09:26 | clgv | mefesto: ah you have one queue per thread. I missed that |
| 09:26 | clgv | mefesto: somehow I doubt that this is the desired output... |
| 09:27 | mefesto | clgv: i don't get what wliao wanted to accomplish. more info needed i thnk |
| 09:27 | mefesto | think* |
| 09:27 | mefesto | fun exercise tho |
| 09:28 | clgv | mefesto: I vote for multi thread printing without generating a mess ;) |
| 09:28 | mefesto | clgv: for some reason he wanted to combine their output in a specific order |
| 09:28 | clgv | mefesto: btw you could use `future` instead of manually creating a thread |
| 09:29 | mefesto | true |
| 09:30 | CookedGryphon | mpenet: oh, thanks, I feel silly for asking now :P |
| 09:31 | mefesto | anyone 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:32 | mefesto | i keep having to recompile my views.clj even tho it hasn't been edited and only the templates have been changed |
| 10:34 | dhl | mefesto: 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:35 | dhl | I switched to stencil partly because of that |
| 10:35 | seangrove | ddellacosta: 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:35 | ddellacosta | seangrove: ah, thanks for the tips--I'm still getting to know how to best use google closure (or how not to use it) |
| 10:36 | ddellacosta | seangrove: which libs are you talking about, or are these wrapper functions baked into CLJS? |
| 10:37 | ddellacosta | I've been using domina, and just augmented that with "raw" Google closure code when the functionality doesn't exist |
| 10:37 | seangrove | We 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:38 | ddellacosta | seangrove: ah, sorry, I see you said "google closure" itself |
| 10:38 | seangrove | Yeah, 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:38 | ddellacosta | gotcha |
| 10:38 | ddellacosta | ah, good to hear |
| 10:38 | ddellacosta | yeah, I mean, I'm trying to stay away from using jQuery (jayq), and use stuff I know is already built-in |
| 10:38 | ddellacosta | but I don't know closure very well yet |
| 10:38 | sinistersnare | hey, can anyone recommend a book? i was look at Programming Clojure, but it seems to only cover version 1.3 |
| 10:39 | sinistersnare | arent we on 1.5? |
| 10:39 | ddellacosta | sinistersnare: there is a second edition of Joy of Clojure coming out soon, check that out |
| 10:39 | llasram | sinistersnare: The changes since 1.3 are relatively incremental |
| 10:39 | seangrove | took 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:39 | ddellacosta | but, as llasram suggests, you'll still get a lot out of Programming Clojure |
| 10:40 | ddellacosta | seangrove: hmm |
| 10:40 | ddellacosta | doh |
| 10:40 | sinistersnare | so do you think i should wait for Joy of Clojure 2nd Ed. or would Programming clojure be more worth it? |
| 10:40 | ddellacosta | sinistersnare: I own both for what it's worth, and I find them both useful |
| 10:40 | llasram | sinistersnare: JoC is better after you understand Clojure some anyway. No need to wait! |
| 10:40 | ddellacosta | agreed wholeheartedly |
| 10:41 | sinistersnare | well, i only have enough for one, so i should go for Programming Clojure? |
| 10:41 | ddellacosta | sinistersnare: 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:41 | ddellacosta | in other words, what llasram said. |
| 10:42 | sinistersnare | ddellacosta: ok thanks, ill go for Programming clojure then :D |
| 10:42 | sinistersnare | llasram: ^ |
| 10:42 | ddellacosta | seangrove: have you checked out dommy? |
| 10:45 | mefesto | anyone know if it's possible to configure enlive to reload the template for each render for development purposes? |
| 10:59 | dhl | mefesto: did you check out the issue I referenced? There are a couple of solutions there. |
| 11:08 | seangrove | ddellacosta: dommy looks amazing |
| 11:08 | seangrove | This weekend I'm working on a cljs + angular frontend for Kandan, and sadly dommy may not fit perfectly |
| 11:08 | ddellacosta | We have been using domina and before that jayq, but I like dommy |
| 11:08 | seangrove | Actually, it might... |
| 11:08 | ddellacosta | haha |
| 11:09 | ddellacosta | wow, so how is angular + cljs working for you? |
| 11:09 | ddellacosta | I haven't tried cljs with any frameworks at all |
| 11:09 | ddellacosta | really curious about tthat |
| 11:09 | seangrove | At least the templating portion |
| 11:09 | seangrove | Well, not sure, that's why I want to do it as a weekend hack |
| 11:09 | ddellacosta | ah, gotcha |
| 11:09 | ddellacosta | I'll be really interested to hear how it goes |
| 11:09 | seangrove | But lynaghk has written a mobile app using cljs + angular, said it's quite good |
| 11:09 | ddellacosta | ah, nice |
| 11:10 | seangrove | We'll see if his level of performance is attainable by mere mortals, though |
| 11:10 | ddellacosta | lately 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:11 | ddellacosta | just glossy interactivity. I want to build something out with a bit more intelligence, but I haven't figured out a good approach yet |
| 11:11 | ddellacosta | it's like started over in some ways. |
| 11:11 | ddellacosta | started -> starting |
| 11:11 | seangrove | Well, it's all there :) |
| 11:11 | ddellacosta | anyways, interested in hearing more about that. |
| 11:12 | seangrove | What kind of stuff are you working on with it, a single-page app? |
| 11:12 | ddellacosta | sort of, that's part of the problem. I've inherited something which is kinda like a few single-page apps |
| 11:13 | ddellacosta | but, 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:14 | ddellacosta | I 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:14 | ddellacosta | so it'll take some time. |
| 11:17 | mefesto | dhl: sorry for the delay, just now seeing your messages. reading that issue now |
| 11:18 | mefesto | dhl: well i guess that answers my question. thanks :) |
| 11:34 | seangrove | I 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:34 | jweiss | interesting. 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:35 | jweiss | took me a while to figure that one out. |
| 11:35 | jweiss | gfredericks: that's what was causing my OOM yesterday. |
| 11:40 | dhl | mefesto: did you have a chance to check out laser by Raynes? |
| 11:46 | seangrove | Well, clang seems to be totally broken |
| 11:49 | TimMc | jweiss: I'd like to see a repro case. |
| 11:49 | jaley | does 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:49 | TimMc | What's causing the seq to be realized? |
| 11:49 | seangrove | Well, broken on the latest clojurescript, seems alright with clojure 1.4.0 and cljsbuild 0.3.0 |
| 11:56 | bbloom | seangrove: clang? the llvm compiler? what does that have to do with cljs? i'm confused. |
| 11:57 | hyPiRion | bbloom: clang some js thingy too |
| 11:57 | seangrove | bbloom: It's a poorly named cljs library wrapping angular |
| 11:57 | seangrove | https://github.com/pangloss/clang |
| 11:57 | bbloom | ah ok |
| 11:57 | bbloom | what's broken with the latest cljs? |
| 11:58 | seangrove | https://github.com/pangloss/clang/issues/10 |
| 11:58 | seangrove | I'm not sure how to track down that error |
| 11:58 | bbloom | does it occur with no optimizations or only with simple or advanced ? |
| 11:59 | seangrove | No optimizations |
| 11:59 | seangrove | You've inspired me to open up the closure.clj file and see what's going on here |
| 12:02 | jweiss | TimMc: https://www.refheap.com/paste/14964 |
| 12:03 | jweiss | TimMc: 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:06 | justin_smith | _fm_: define a migration that only runs if it has not been applied, and run it on startup? |
| 12:07 | justin_smith | there is a function clojure.java.jdbc/table? |
| 12:07 | justin_smith | that checks if a table exists |
| 12:07 | nickmbailey | anyone 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:09 | justin_smith | in your main / init function? |
| 12:11 | justin_smith | compojure uses ring right? under the :ring entry in project.clj you can specify :init |
| 12:11 | justin_smith | the 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:12 | justin_smith | np |
| 12:21 | mpenet | nickmbailey: 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:21 | gfredericks | jweiss: oh it was because of a macro that looks at all locals? |
| 12:22 | gfredericks | (macroexpand would show you the local pointing to the head, btw) |
| 12:22 | jweiss | gfredericks: 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:23 | mpenet | nickmbailey: 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:23 | gfredericks | ,(macroexpand-1 '(let [[a b] (range)] b)) |
| 12:23 | clojurebot | (let* [vec__32 (range) a (clojure.core/nth vec__32 0 nil) b ...] b) |
| 12:23 | mpenet | nickmbailey: well not fail, not run |
| 12:23 | nickmbailey | mpenet: mine seems more deviously subtle. tests run, but a few random asserts fail |
| 12:24 | mpenet | nickmbailey: yeah, too much magic for me, I gave up on it. I didn't really have the time to dig deeper |
| 12:24 | ianeslick | Hi 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:25 | ianeslick | https://github.com/vitalreactor/nrepl-inspect.git |
| 12:26 | ianeslick | Basically 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:29 | mpenet | ianeslick: that sounds useful |
| 12:34 | nickmbailey | mpenet: 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:34 | nickmbailey | fwiw |
| 12:35 | justin_smith | nickmbailey: you could use a test fixture to clear out state between runs |
| 12:35 | nickmbailey | i don't have state external to the test functions |
| 12:36 | nickmbailey | the tests have a java ByteBuffer which seems like its getting read from twice which breaks since it has an internal cursor or something |
| 12:36 | justin_smith | but 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:36 | nickmbailey | or something completely different is happening, i'm not sure haha |
| 12:37 | justin_smith | could it have to do with the order in which tests are run? |
| 12:38 | justin_smith | but regardless, any stateful consequences of tests should be set up / torn down by fixtures |
| 12:42 | nickmbailey | yeah it isn't order of tests, i'll see if i can move the java stuff into a fixture |
| 12:46 | NeedMoreDesu | How someone can use my package, pushed to clojars with "lein push" |
| 12:48 | justin_smith | NeedMoreDesu: by adding it as a dependency in project.clj then requiring it in their code |
| 12:49 | justin_smith | (assuming they are using lein) |
| 12:49 | NeedMoreDesu | justin_smith: my friend says, that he see "Could not find artifact" |
| 12:50 | NeedMoreDesu | Yet I deleted it from .m2 and it was downloaded |
| 12:50 | justin_smith | does he have the exact version required that you pushed? look for a typo in the version maybe |
| 12:51 | NeedMoreDesu | He uses exactly my project from dropbox |
| 12:52 | NeedMoreDesu | Maybe I am pushing it wrong? I can see it on clojars, yet it is not promoted. |
| 12:52 | justin_smith | promoted? |
| 12:53 | nickmbailey | justin_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:53 | nickmbailey | fwiw |
| 12:54 | justin_smith | well, my point about stateful things probably needing to be in fixtures still stands, right? |
| 12:54 | TimMc | gfredericks: I still don't see how jweiss' code could produce an OOM. |
| 12:56 | NeedMoreDesu | justin_smith: I don't know what promotion do on clojars. |
| 12:57 | justin_smith | NeedMoreDesu: are you (or your friend) using a lein plugin that affects which repos are visible by any chance? |
| 12:59 | NeedMoreDesu | He uses mine lein.bat file. Not sure why should it do that. |
| 13:00 | justin_smith | like for example maybe the other person does not have lein-clojars in project.clj |
| 13:00 | justin_smith | *profiles.clj, not project.clj sorry |
| 13:00 | justin_smith | ask him to try using your profiles.clj file as well |
| 13:01 | justin_smith | for example I have {:user {:plugins ... [lein-clojars "0.9.1"]}} |
| 13:02 | NeedMoreDesu | Yep, I throwed it to him, yet it's still there. |
| 13:03 | llasram | NeedMoreDesu: Can you post your project.clj on refheap or github gist? |
| 13:05 | NeedMoreDesu | http://www.everfall.com/paste/id.php?w5y79lrwbu49 |
| 13:08 | llasram | I'm able to `lein deps` successfully -- no resolution failures. So definitely something unusual on your friend's side |
| 13:10 | NeedMoreDesu | Thanks. I guess I'll just throw him .m2 folder this time. |
| 13:11 | llasram | Unless... Does his version of `lein` work otherwise? |
| 13:12 | llasram | I 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:12 | llasram | If that's the problem, he needs to grab the most recent stable version of the script |
| 13:12 | NeedMoreDesu | He was able to "lein run" many times |
| 13:13 | llasram | Oh well. That was my last idea :-) |
| 13:30 | justin_smith | do you know for sure he has lein-clojars in his profiles.clj? |
| 13:31 | llasram | justin_smith: OOC why would that matter? lein-clojars is for deploying to clojars |
| 13:31 | justin_smith | oh, it doesn't affect getting things from clojars? |
| 13:31 | llasram | Nope |
| 13:32 | justin_smith | that 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:33 | llasram | I agree it's a good thought -- just lein-clojars would be a red herring |
| 13:34 | technomancy | lein-clojars is just a wrapper around scp |
| 13:34 | technomancy | and maybe ssh-keygen |
| 13:35 | justin_smith | this is either a really weird bug or a pebkac |
| 13:38 | @rhickey | how does one set xmx for lein repl? |
| 13:39 | @rhickey | :jvm-opts ["-Xmx1g" "-server"]in project.clj seems to have no effect |
| 13:39 | pjstadig | i think you can set the JAVA_OPTS env var |
| 13:39 | pjstadig | or i was gonna way you can set it in the project.clj, but i guess you've tried that |
| 13:41 | danielglauser | pjstadig: didn't those settings move under profiles in project.clj? |
| 13:41 | @rhickey | I tried :profiles {:dev {:jvm-opts ["-Xmx1g" "-server"]}} as well |
| 13:41 | pjstadig | sample project.clj still has them at the top level https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L293 |
| 13:41 | @rhickey | and JAVA_OPTS seems to do nothing |
| 13:41 | mefesto | i wonder if `lein trampoline repl` makes any diff? |
| 13:42 | pjstadig | rhickey: turns out it should be JVM_OPTS https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L337 |
| 13:42 | llasram | :jvm-opts do work |
| 13:43 | llasram | You 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:44 | patchwork | _JAVA_OPTIONS |
| 13:45 | patchwork | _JAVA_OPTIONS=-Denvironment=development or whatever |
| 13:46 | technomancy | :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 | @rhickey | in repl |
| 13:47 | @rhickey | good old java -server -Xmx1G -Xms1G -cp `lein classpath` clojure.main continues to work |
| 13:48 | technomancy | does ps awx show the :jvm-opts arguments when lein repl is running? |
| 13:48 | @rhickey | I've been using Leiningen 2.1.3 on Java 1.6.0_45 Java HotSpot(TM) 64-Bit Server VM if that matters |
| 13:50 | technomancy | .freeMemory only reports 284495376 for me even though Leiningen is definitely setting -Xmx1g |
| 13:50 | jrosti | I've javascript event, and I'm trying to access a member :target in clojurescript. (event "target") and (:target event) throw a type error. |
| 13:50 | jrosti | how to access the event properly? |
| 13:51 | mefesto | jrosti: (.-target event) |
| 13:51 | mefesto | jrosti: or (aget event "target") |
| 13:51 | pjstadig | rhickey: are you putting -Xms1g in the :jvm-opts, too? |
| 13:52 | @rhickey | technomancy: can't tell, line starts with /usr/bin/java -classpath and is truncated |
| 13:53 | hiredman | it is a case thing, the jvm silently ignores G |
| 13:53 | mefesto | `ps awwx` should show the entire command line |
| 13:53 | harob | Does 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:53 | seangrove | Is there a way to examine/print-out the constructor function(s) for a record type? |
| 13:54 | pjstadig | i don't think (-> (Runtime/getRuntime) .freeMemory) is going to be 1g in a fresh repl unless you have -Xms1g right? |
| 13:55 | terom | what does .maxMemory tell you? |
| 13:55 | @rhickey | pjstadig: yes, better with that, but not same as normally |
| 13:55 | @rhickey | which is 1/2 heap |
| 13:55 | @rhickey | I get 64mb |
| 13:55 | seangrove | I'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 | @rhickey | In any case, just reporting diff, seems like mem is there |
| 13:58 | @rhickey | thanks all |
| 14:01 | @rhickey | async coming along, should be ready for kicking around soon |
| 14:01 | bbloom | rhickey: tomjack and i were kicking around with it a tiny bit early |
| 14:02 | bbloom | rhickey: i tried to do the little google search example rob pike showed: https://www.refheap.com/paste/14917 |
| 14:02 | bbloom | rhickey: alt wasn't working when i tried it though |
| 14:02 | seangrove | rhickey: Very much looking forward to trying it out |
| 14:03 | bbloom | rhickey: also, i'm not quite sure how the blocking operations are gonna translate to CLJS without a lot of extra async forms |
| 14:03 | @rhickey | The block is now called async/go, and I don't know why you would wrap things so tightly as that |
| 14:04 | @rhickey | alt warks also |
| 14:04 | @rhickey | works |
| 14:04 | @rhickey | bbloom: where does alt belong in that? |
| 14:05 | bbloom | rhickey: was trying to use it for the timeout idiom on line 29 |
| 14:05 | @rhickey | ah, alt in async should come out today |
| 14:05 | bbloom | rhickey: ah, ok |
| 14:07 | bbloom | rhickey: 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 | @rhickey | ok, I see you are trying to get multiple requests in flight |
| 14:07 | @rhickey | there will be something like par for that |
| 14:08 | bbloom | rhickey: 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:12 | bbloom | gotcha. |
| 14:12 | ucb | I 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:12 | bbloom | ucb: some-> |
| 14:13 | ucb | bbloom: thanks! I assume this is clojure 1.5? |
| 14:13 | bbloom | ucb: yes |
| 14:13 | ucb | thanks |
| 14:13 | sinistersnare | if i write a program in clojure 1.3, will it work in 1.5? |
| 14:13 | sinistersnare | this may seem genearl |
| 14:13 | sinistersnare | genearl |
| 14:13 | sinistersnare | whatever |
| 14:13 | sinistersnare | but |
| 14:14 | sinistersnare | the book Programming Clojure is in 1.3, and i wanted to know if it would work on a clojure 1.5 install |
| 14:14 | @rhickey | bbloom: where's the go source for that? I can't make out the intent anymore |
| 14:14 | llasram | sinistersnare: Unless you do something pretty odd, the yes |
| 14:14 | bbloom | rhickey: https://github.com/lintide/GoConcurrencyPatterns/blob/master/googleSearch05.go |
| 14:14 | bbloom | rhickey: 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:15 | bbloom | rhickey: see also time.Sleep in the go source on line 24 |
| 14:16 | sinistersnare | do you think that Programming Clojure would be ok with a 1.5 install? |
| 14:16 | llasram | sinistersnare: Yes. It pretty much just won't cover the small number of new features since 1.3 |
| 14:17 | sinistersnare | ok thanks :D |
| 14:17 | sinistersnare | just got home, gonna hit buy on amazon |
| 14:19 | sinistersnare | just to be sure, you guys recommend Programming Clojure over Clojure Programming? http://puu.sh/30gCv.png |
| 14:19 | mefesto | sinistersnare: The Joy of Clojure is good too :) |
| 14:19 | technomancy | sinistersnare: I like the oreilly one a lot |
| 14:19 | technomancy | haven't read the 2nd ed. of the prags though |
| 14:19 | sinistersnare | mefesto: i was told JoC is a tad more advanced, and i could just wait for the second edition later |
| 14:19 | Okasu | mefesto: Or maybe Clojure of the Joy? |
| 14:20 | danielglauser | sinistersnare: Both are good books |
| 14:20 | mefesto | Okasu: I'm waiting for that one. it sounds awesome :) |
| 14:20 | llasram | sinistersnare: 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:21 | sinistersnare | llasram: so i should get the ORielly one? |
| 14:22 | sinistersnare | i think im going to get the ORIELLY one |
| 14:22 | sinistersnare | thanks guys |
| 14:22 | alex_baranosky | is there a way to remove people from a clojars group? |
| 14:23 | gfredericks | why 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:24 | hyPiRion | gfredericks: because 1.2 and 1.3 had arbitrary precision for -, +, * and / |
| 14:24 | llasram | gfredericks: Pre-1.3, [-' -] would parse as the symbol `-` then `'-` |
| 14:24 | jtoy | im 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:24 | gfredericks | llasram: oh holy crap |
| 14:24 | hyPiRion | In addition, 1.3 and 1.2 parses -' - as - '- |
| 14:25 | bbloom | rhickey: 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:25 | gfredericks | that's crazy amazing |
| 14:25 | hyPiRion | it's essentially a trick to do arbitrary math |
| 14:25 | gfredericks | that is the hackiest thing I've ever seen in this entire file |
| 14:26 | llasram | I used δ as a variable the other day. That made me feel pretty good about myself |
| 14:26 | bmentges | lol |
| 14:26 | hyPiRion | llasram: https://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71 |
| 14:27 | hyPiRion | it's so lovely. |
| 14:27 | llasram | Nice! |
| 14:30 | @rhickey | bbloom: https://www.refheap.com/paste/14966 |
| 14:31 | @rhickey | this using threads, async will have same shape |
| 14:31 | hyPiRion | If you like unicode, you should try out BODOL btw. |
| 14:33 | llasram | Hmm, interesting |
| 14:33 | tomjack | rhickëy: so is a nil message always a programmer error or is it a feature that you can pretend to be closed? |
| 14:34 | @rhickey | bbloom: their fake search and yours return functions |
| 14:34 | bbloom | rhickey: yeah, i know, i'm referring to the function that is returned, sorry for not being clearer |
| 14:35 | llasram | hyPiRion: 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:35 | bbloom | rhickey: web1, web2, etc all return a vector, but have a blocking read in them -- how will that work on CLJS? |
| 14:35 | @rhickey | the function that is returned doesn't itself return immediately |
| 14:36 | hyPiRion | llasram: hahah. No, by no means. If that were the case, I'd be using a japanese Common Lisp variant probably. |
| 14:36 | bbloom | rhickey: 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:36 | sinistersnare | rhickey: a little off topic, but i listened to your talk on Clojure for Java programmers, it was cool, thanks :D |
| 14:36 | @rhickey | sinistersnare: you're welcome |
| 14:38 | seangrove | bbloom: seems like you could simulate blocking semantics using set/clearInterval as the basis |
| 14:39 | tomjack | the problem is that fake-search is a function |
| 14:39 | @rhickey | bbloom: has nothing to do with SSA (that is just an implementation detail of inversion of control), you just want Sleep for javascript |
| 14:39 | tomjack | the async macro system can't tell that there is a blocking read inside |
| 14:40 | @rhickey | Sleep must have special handling in Go scheduler |
| 14:41 | @rhickey | async is not Go |
| 14:42 | @rhickey | functions are not async |
| 14:42 | @rhickey | there are async/go blocks, and they return channels |
| 14:43 | @rhickey | the value of the last expression in the block will be placed in the channel, then the channel will be closed |
| 14:44 | @rhickey | so if you make the body of a fn a go block, the fn returns a channel |
| 14:44 | bbloom | rhickey: 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 | @rhickey | right |
| 14:45 | @rhickey | just like future doesn't work |
| 14:45 | @rhickey | nor anything else blocking |
| 14:45 | @rhickey | but we can protect against use outside of async/go |
| 14:46 | @rhickey | portable code will use go instead of future |
| 14:47 | bbloom | rhickey: how do you plan to protect against blocking ops outside of async/go ? |
| 14:48 | tomjack | no need to protect against them if they just aren't there.. |
| 14:48 | bbloom | tomjack: yes, but if you're developing on JVM and want to be writing portable code |
| 14:50 | tomjack | oh, I see |
| 14:50 | @rhickey | bbloom: on cljs? they can always throw, as go macro rewrites them |
| 14:50 | tomjack | be careful? :) |
| 14:50 | technomancy | great post on dynamicity vs performance: http://blog.headius.com/2013/05/on-languages-vms-optimization-and-way.html |
| 14:51 | tomjack | I was thinking I'd like some way to cause blocking ops to throw in clj |
| 14:51 | tomjack | found so far I block accidentally somewhat often |
| 14:51 | @rhickey | bbloom: What you are asking for (async functions that return values) is impossible on JS engine |
| 14:51 | bbloom | rhickey: no, on clj, not cljs, see what tomjack is saying ^^ |
| 14:51 | @rhickey | you'd need real blocking |
| 14:52 | tomjack | bbloom: but that wouldn't help really |
| 14:52 | @rhickey | bbloom: I don't care about that? How do you keep people from writing future calls? |
| 14:52 | tomjack | you'd still have to run the thing to see if anything throws |
| 14:52 | tomjack | and you might as well just run it in cljs and see if it throws there |
| 14:53 | @rhickey | bigger issue is how to protect against use of blocking <! and >! on async thread pool - when on fj pool we can detect |
| 14:54 | bbloom | rhickey: i think this might just be too difficult to discuss via irc :-/ |
| 14:54 | @rhickey | but the option still exists to name them differently, still early days, not even set on <1 and >! |
| 14:54 | @rhickey | bbloom: I do understand - you want to write portable code with protection on the clj side from writing something that won't port |
| 14:54 | bbloom | rhickey: so far <! and >! has felt relatively natural to me. i think that i'd like a channel -> channel copy operator though |
| 14:54 | bbloom | rhickey: I've written (>! x (<! y)) a few times |
| 14:55 | @rhickey | bbloom: we are sticking to the primitives for now |
| 14:56 | @rhickey | bbloom: so, given async fns having returns being impossible on JS, you just have to invert control at the edges, thus take! and put! |
| 14:57 | bbloom | rhickey: 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:58 | tomjack | do 'spliced' channels (write0 -> read1 and write1 -> read0, I'm calling them 'tunnels') confuse the semantics? |
| 14:58 | @rhickey | bbloom: I don't know what the expectations are - one platform has blocking and one doesn't |
| 14:59 | @rhickey | so at the edges it must be different, or you can do the JS style everywhere |
| 14:59 | @rhickey | cause callbacks work on JVM as well |
| 14:59 | @rhickey | but it fundamentally sucks a ton of callbacks out of the core of the logic, adds first-class channels, separation of concerns etc |
| 15:00 | bbloom | rhickey: 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:01 | bbloom | rhickey: thanks for the hard work on this, i really appreciate it |
| 15:03 | mthvedt | are there comprehensive docs for minikanren/core.logic besides 'the reasoned schemer' |
| 15:04 | tomjack | mthvedt: I was watching a google hangout where one person announced that they had made nice documentation for alphakanren |
| 15:04 | tomjack | the joke was then that this is 'not the minikanren way' |
| 15:05 | bbloom | rhickey: 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 | @rhickey | if you can wait for the answer it is blocking |
| 15:06 | @rhickey | there will have to be an edge somewhere |
| 15:09 | mthvedt | tomjack: hmm, if those docs exist i can't find them on google |
| 15:12 | mefesto | dommy vs crate? commit activity looks to be higher for dommy. |
| 15:13 | bbloom | rhickey: 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:14 | bbloom | rhickey: unfortunately, i need to run right now. thanks for listening |
| 15:16 | seangrove | mefesto: dommy is probably where most activity is headed |
| 15:17 | seangrove | I'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:17 | seangrove | Is the issue that the types passed to the constructor aren't matching as expected? |
| 15:18 | hiredman | or the count doesn't match |
| 15:18 | hiredman | (parameter count) |
| 15:19 | mefesto | seangrove: thanks |
| 15:21 | supersym | technomancy: thanks, that's a good read indeed |
| 15:23 | seangrove | hiredman: And if I (clojure.reflect/reflect JavaScriptFile), I should see the available arities/types for constructors, right? |
| 15:23 | technomancy | supersym: yeah, though oddly he never mentions the fact that he's only talking about dispatch |
| 15:24 | technomancy | dispatch is a pretty small part of what makes programs run fast |
| 15:24 | hiredman | seangrove: have you cleaned out generated classes recently? |
| 15:24 | technomancy | well |
| 15:24 | technomancy | it's a big part of what makes ruby programs run slowly I guess =) |
| 15:24 | seangrove | hiredman: yeah |
| 15:24 | hiredman | and how is JavaScriptFile defined? |
| 15:25 | seangrove | hiredman: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj#L263 |
| 15:26 | seangrove | I'm trying to track down why the error above only happens with clang is added as a project dependency |
| 15:27 | tomjack | presumably someone's got bad AOT |
| 15:27 | tomjack | ? |
| 15:27 | seangrove | Well, in the meantime, I'm interested in learning how to read https://www.refheap.com/paste/14967 |
| 15:28 | seangrove | This is (pprint (reflect JavaScriptFile)) |
| 15:28 | seangrove | Can I tell what the constructor looks like from anything in there? |
| 15:29 | tomjack | you installed clang yourself right |
| 15:29 | hiredman | the costructors are the members with the same name as the class |
| 15:30 | seangrove | tomjack: Yeah, git clone, lein install, added as a dependency to a minimum project, lein cljsbuild once in said project, get the error above |
| 15:30 | seangrove | So inside closure.clj tearing it apart to see if I can get into it a bit more |
| 15:30 | tomjack | `jar tf ~/.m2/repository/clang/clang/*/*.jar` |
| 15:30 | tomjack | my guess is it has not much to do with closure.clj |
| 15:30 | seangrove | hiredman: That's awesome, thank you |
| 15:31 | tomjack | I want a `cat foo | refheap` |
| 15:31 | hiredman | you either need to explicitly pull in a clojurescript version, or use the same version of cljsbuild as clang |
| 15:32 | gfredericks | has 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:32 | seangrove | hiredman: Yeah, I've gone into clang, updated it to use cljsbuild 0.3.2, lein clean, lein install, try this again, same error |
| 15:32 | tomjack | are there .class files in the clang jar? |
| 15:32 | seangrove | It does seem like some strange version mismatch though, but I'm trying to figure out where it's coming from |
| 15:32 | tomjack | dunno why there would be.. |
| 15:32 | supersym | i see |
| 15:32 | seangrove | tomjack: no, no class files |
| 15:33 | hiredman | seangrove: I wouldn't change the version of cljbuild in clang, I would change it in your project |
| 15:33 | tomjack | huh, the only time I've ever seen an error like that, it was due to AOT |
| 15:33 | seangrove | hiredman: Was hoping to submit a pr to bring clang up to date with cljsbuild |
| 15:33 | hiredman | well maybe it get working first? |
| 15:33 | hiredman | :) |
| 15:34 | seangrove | Heh, yes, that's what I thought I was doing |
| 15:34 | tomjack | try a `lein cljsbuild clean` for good measure if you haven't already :) |
| 15:34 | tomjack | maybe it's keeping around an old compiled cljs or something? |
| 15:35 | seangrove | Yeah, doesn't seem to be the case... |
| 15:36 | seangrove | Maybe I should give up on clang, but I was more interested in learning more about the cljs compiler by solving this |
| 15:36 | hiredman | I 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:36 | seangrove | hiredman: Yeah, it works in that case |
| 15:36 | hiredman | right, so it might be a regression in clojurescript |
| 15:37 | hiredman | a feature that no one but the clang guy uses |
| 15:37 | tomjack | clang looks like it's just cljs really, right? |
| 15:38 | seangrove | Yeah, I believe so, I don't see it exercising anything that should bother the compiler |
| 15:38 | hiredman | it might even be fixed in master |
| 15:38 | hiredman | tomjack: yeah, but javascriptfile has to do with exposing external deps to the google closure compiler |
| 15:39 | hiredman | which clang does with angular |
| 15:39 | tomjack | aha |
| 15:39 | tomjack | where? hmm |
| 15:39 | hiredman | deps.js? somehow |
| 15:41 | seangrove | deps.js is empty though |
| 15:41 | hiredman | I'm not saying there is any code in deps.js |
| 15:42 | hiredman | just the fact that clang is trigger some less frequently used code path |
| 15:42 | tomjack | I see there's a vendor dir with angular and a resources/public/js/angular.js but no externs |
| 15:43 | tomjack | no :libs or :foreign-libs either |
| 15:43 | seangrove | Yeah, looks like he just includes it separately in the index.html |
| 15:47 | seangrove | Ok, 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:48 | seangrove | I'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:49 | seangrove | I didn't clean thoroughly enough or something |
| 15:50 | gfredericks | does anybody else have trouble jumping to source when using nrepl.el against a remote server versus -jack-in? |
| 15:53 | ToBeReplaced | how does clojure clean up its docstrings? |
| 15:54 | gfredericks | clean up? |
| 15:54 | ToBeReplaced | the equivalent of: http://docs.python.org/2/library/inspect.html#inspect.cleandoc |
| 15:55 | ToBeReplaced | it must do something to remove line breaks and indents |
| 16:13 | gfredericks | oh hm |
| 16:13 | gfredericks | looks like it doesn't |
| 16:13 | gfredericks | ,(doc (meta #'conj)) |
| 16:13 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol> |
| 16:13 | gfredericks | ,(:doc (meta #'conj)) |
| 16:13 | clojurebot | "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:14 | gfredericks | clojure.repl/doc doesn't make any attempt to either |
| 16:14 | gfredericks | I take it back |
| 16:14 | gfredericks | maybe it does |
| 16:16 | gfredericks | looks 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:16 | gfredericks | presumably works most of the time |
| 16:22 | Intensity | Hi. 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:28 | NeedMoreDesu | Intensity: 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:30 | llasram | Intensity: My vote is write the tiny bit of Java you need to provide the wiring for JNA |
| 16:30 | Intensity | NeedMoreDesu: Cool. Thanks for providing that. |
| 16:30 | llasram | That's what I've been doing. You don't really right any "code" -- just JVM<->C bridge description |
| 16:31 | llasram | s,right,write, |
| 16:31 | hiredman | the one time I needed to call native code I wrote a little jni stub for it |
| 16:32 | tomjack | if-let-reduced.. hmm https://www.refheap.com/paste/cb28e458f2c85afc5571f6570 |
| 16:32 | hiredman | you can do a lot with a single C call and the Unsafe |
| 16:32 | tomjack | I wish I could think of a way to only write it once |
| 16:33 | hiredman | https://github.com/hiredman/beaglebone-jni-utils/blob/master/a/B.java |
| 16:34 | hiredman | https://github.com/hiredman/beaglebone-jni-utils/blob/master/B.c |
| 16:34 | llasram | tomjack: Only write what once? |
| 16:36 | tomjack | (let [ret' (f ret v)] (if (reduced? ret') @ret' (recur ret' ...))) etc |
| 16:37 | llasram | Isn't that what your `if-let-reduced` does? Looks pretty compact |
| 16:38 | tomjack | yeah, I just wish I didn't need if-let-reduced |
| 16:38 | Intensity | hiredman: 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:39 | hiredman | yeah, what I have there ends with a class a.B with a (non static) method that calls the C code |
| 16:40 | tomjack | it seems awfully similar to https://www.refheap.com/paste/795482490fa828aac731634bf |
| 16:40 | hiredman | so (.mem (a.B) ...) |
| 16:40 | hiredman | er |
| 16:40 | hiredman | so (.mem (a.B.) ...) |
| 16:41 | hiredman | https://github.com/hiredman/blackbox/blob/master/src/blackbox/gpio.clj is where it gets used |
| 16:41 | Intensity | hiredman: 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:41 | tomjack | hmm, except it's (pure reducef) <*> ret <*> (pure v) |
| 16:42 | mindbender1 | ,(true? (= :pedestal :clojurized-mvc)) |
| 16:42 | clojurebot | false |
| 16:43 | hiredman | Intensity: 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:43 | tomjack | hah, 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:45 | tomjack | bbloom: did you notice foo// made it? :) |
| 16:55 | tomjack | is 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:57 | tomjack | or, hmm, take the old from the watch as the current value and ignore the deref |
| 17:05 | @rhickey | bbloom: here's a go block version, compatible with cljs except for the edge (last line) https://www.refheap.com/paste/14974 |
| 17:05 | @rhickey | note no Go-lang imperative cruft |
| 17:06 | @rhickey | so blocking and parking JVM versions of the baseline stuff works today |
| 17:06 | @rhickey | pull it and play folks |
| 17:07 | @rhickey | more docs soon |
| 17:15 | seangrove | I'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:16 | seangrove | I 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:23 | tomjack | bbloom: 'signal' chans https://www.refheap.com/paste/9c85c3855edc574d2f4fdb9ff |
| 17:30 | tomjack | I suppose maybe you could also just create a special Handler that waits until commit to call the signal-f for the value |
| 17:45 | jtoy | what should I use to get unix timestamp? |
| 17:46 | llasram | ##(quot (System/currentTimeMillis) 1000) |
| 17:46 | lazybot | ⇒ 1369431548 |
| 17:46 | justin_smith | (.getTime (java.util.Date.)) |
| 17:46 | justin_smith | oh yeah, and divide by 1000 |
| 17:46 | justin_smith | ##(.getTime (java.util.Date.)) |
| 17:46 | lazybot | ⇒ 1369431588227 |
| 17:47 | jtoy | cool,thx |
| 18:30 | bbloom | tomjack: yes, i saw the 'foo// fix :-) about time! heh |
| 18:32 | zRecursi` | It is good to here haskell is based on Lisp and Prolog on "Planet Clojure", but i really donot know what unification is ? |
| 18:34 | bbloom | zRecursi`: http://blog.fogus.me/2010/12/14/unification-versus-pattern-matching-to-the-death/ |
| 18:34 | bbloom | zRecursi`: see also the other posts in that series |
| 18:35 | zRecursi` | bbloom: thanks |
| 18:37 | bbloom | tomjack: you see rhickey's refheap above directed at me? |
| 18:38 | bbloom | the (take 3 (repeatedly …)) is clever. |
| 18:38 | bbloom | doesn't really handle the timeout case correctly, but some rearranging with a take-while would cover it |
| 18:38 | bbloom | and 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:52 | djwonk | it 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:54 | technomancy | djwonk: good macros are usually trivial wrappers around existing functionality, so it's often not worth the effort |
| 18:54 | technomancy | unless you're doing something really nuts like implementing pattern matching |
| 18:54 | djwonk | technomancy: I don't buy that argument. while writing the macro, one probably checks with macroexpand at least once |
| 18:55 | djwonk | or, at least, one does hopefully check it -- so if you are checking by hand, it isn't hard to drop into the code |
| 18:55 | technomancy | dunno... can't remember the last time I wrote a macro |
| 18:56 | TimMc | WTF, is there *seriously* not a standards-compliant, reasonably full-featured URI manipulation library out there in Java-land? |
| 18:57 | justin_smith | TimMc: does this not qualify? http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/URI.html |
| 18:59 | TimMc | justin_smith: The lack of different encode methods makes me suspicious. |
| 19:00 | technomancy | grepping 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:00 | technomancy | and defproject will probably become a trivial macro in lein3 |
| 19:00 | TimMc | justin_smith: Fragments, querystring components, matrix parameters, path segments, and userinfo all have different allowed sets of unescaped characters. |
| 19:00 | justin_smith | TimMc: that is in a different class http://commons.apache.org/proper/commons-codec/ |
| 19:00 | djwonk | technomancy: that's great that you write so few :) I like what you are saying about making them easy to reason about |
| 19:01 | technomancy | djwonk: it really depends. obviously something like core.match needs lots of tests. |
| 19:01 | technomancy | but justifiable cases for introducing new syntax are few and far between |
| 19:01 | TimMc | justin_smith: It also doesn't have any manipulation methods, such as the ever-required "add a querystring parameter". |
| 19:02 | djwonk | TimMc: that's crazytown |
| 19:04 | tomjack | bbloom: thanks I missed that version |
| 19:04 | TimMc | I just discovered I was relying on some *very scary* URL-manipulation code, but I don't know where to find something better. |
| 19:05 | tomjack | "async is not Go" |
| 19:05 | tomjack | ..did that mean "#'async is now #'go" |
| 19:06 | tomjack | I guess "core.async is not Go" |
| 19:06 | bbloom | tomjack: yeah think so |
| 19:06 | tomjack | case works too, nice |
| 19:08 | justin_smith | TimMc: 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:09 | djwonk | TimMc: 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:09 | justin_smith | but if it isn't sufficient, I don't know what else is better out there |
| 19:11 | djwonk | this makes it look like a mess as well: http://stackoverflow.com/questions/2632175/java-decoding-uri-query-string |
| 19:12 | alex_baranosky | does anyone know if there's a library for EDN for use form R? |
| 19:17 | djwonk | alex_baranosky: I looked but found nothing. I tried here: http://www.inside-r.org/search/apachesolr_search/deserialize |
| 19:17 | alex_baranosky | djwonk: thanks |
| 19:17 | djwonk | also searched for "clojure" "EDN" too |
| 19:18 | djwonk | alex_baranosky: nothing under http://www.inside-r.org/packages/e either. this is your chance to write it! :) |
| 19:18 | alex_baranosky | djwonk: YAY me! :P |
| 19:19 | callen | alex_baranosky: question about korma for you |
| 19:19 | alex_baranosky | callen: yep |
| 19:22 | NeedMoreDesu | Trouble using lein, again(with other pc). http://www.everfall.com/paste/id.php?vr84wpirkf0r |
| 19:23 | NeedMoreDesu | "lein upgrade", jdk reinstall. Is there something else to try? |
| 19:30 | llasram | NeedMoreDesu: 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:35 | hyPiRion | NeedMoreDesu: what version are you running? |
| 19:37 | hyPiRion | clojurebot: core.async is not Go |
| 19:37 | clojurebot | c'est bon! |
| 19:37 | bbloom | hyPiRion: lol the meme begins |
| 19:38 | bbloom | i'm pretty sure rich was trying to say core.async/async is noW core.async/go |
| 19:38 | bbloom | but both ways work, heh |
| 19:38 | hyPiRion | hah |
| 19:51 | djwonk | technomancy: now that I *am* trying some macroexpansion tests, gensyms are making it non-obvious how to proceed |
| 19:53 | tomjack | bbloom: I suspect he was talking about the lack of "Go-lang imperative cruft" |
| 19:53 | tomjack | maybe |
| 19:54 | Raynes | callen: So, we should probably figure out how we're going to meet up at the concert. |
| 19:54 | Raynes | callen: Should I text you or something? |
| 19:54 | Raynes | I can carry a big CALLEN sign, but I'd prefer not to. |
| 19:58 | hyPiRion | Raynes: You can carry a big RAYNES sign instead |
| 19:58 | hyPiRion | I totally solved that issue for you now, no need to thank me. |
| 20:04 | technomancy | just follow your heart; I'm sure that will lead you to each other |
| 21:10 | pppaul | both of you should wear exactly the same outfit |
| 21:11 | pppaul | then you can ask everyone what the person you are looking for looks like without any need for props or hand waving |
| 21:23 | TimMc | djwonk: 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:23 | TimMc | ystael: How would you like to write a URL library for Hack Week? :-D |
| 21:27 | djwonk | TimMc: my take away is that a wrapper on top would be very useful |
| 21:29 | llasram | TimMc: I'm going to add URLs to inet.data someday. But you know, scratching your own itches etc |
| 21:30 | TimMc | djwonk: I'm envisioning something that just wraps the Java standard lib + some Apache stuff. |
| 21:31 | djwonk | cool. have you looked at, say, Nutch to see if it does it right? |
| 21:32 | djwonk | TimMc ^ |
| 21:32 | TimMc | Hmm, no. Will do. |
| 21:33 | djwonk | TimMc: if it does not, that would be a shame |
| 21:33 | djwonk | since it is a crawler |
| 21:38 | callen | Raynes: well, that could work |
| 21:38 | callen | Raynes: I was pondering when I should head down as well. |