2012-02-12
| 00:30 | jblomo | is there a lein plugin for running ant / build.xml tasks? |
| 00:45 | clj_newb | is there a way to tell clojure to not import _anything_ (not even core)? I want to build a DSL within clojure; and I don't want it getting conflicts w/ core functions all over the place |
| 00:48 | jblomo | clj_newb: I think you may be able to use (:refer-clojure :only ()) |
| 00:55 | clj_newb | jblomo: interesting fix; thanks |
| 00:55 | JohnnyL | have any of you gotten clojure to run processes in parallel on a multicore configuration? |
| 00:56 | clj_newb | clojure; by default, runs functions sent to agents, in separate threads, iirc |
| 02:10 | amalloy | amro, muhoo: "for isn't a recur target" glosses over some stuff that might be important |
| 02:11 | amalloy | for expands to a lazy-seq and some function calls: you can't usefully recur to it, but you can't recur around/through it either, because it "gets in the way of" the actual recur target it's inside of |
| 02:12 | amalloy | whether for is a recur target isn't really relevant for muhoo's code, because loop is a recur target and you always recur to the inner-most "closest" point |
| 03:35 | clj_newb | what is the best way to get a java Graphics2D to output svg/vector graphics? |
| 03:39 | tylergillies | i have a function that returns a vector and i want to pass the return value from that function to a different function that takes multiple arguments, but the second function is erroing telling me i only passed it one argument |
| 03:40 | emezeske | tylergillies: I think you might want 'apply' |
| 03:40 | emezeske | ,(apply + [1 2 3 4 5]) |
| 03:40 | clojurebot | 15 |
| 03:41 | emezeske | ,(+ [1 2 3 4 5]) |
| 03:41 | clojurebot | #<ClassCastException java.lang.ClassCastException> |
| 03:41 | tylergillies | emezeske: thnx |
| 03:42 | tylergillies | woot that worked |
| 03:42 | emezeske | :) |
| 03:43 | tylergillies | messing around with java.security http://cl.ly/2Y3W1o1H2w0A163u2H1w |
| 03:46 | emezeske | tylergillies: cool stuff |
| 03:46 | emezeske | tylergillies: If you're gonna do a lot of java interop, you might like the thrush macro -> |
| 03:47 | tylergillies | emezeske: where can i read up on that? |
| 03:47 | tylergillies | with all the java libraries available why wouldn't everyone do tons of java interop? |
| 03:48 | emezeske | tylergillies: the first answer on this thread is useful |
| 03:48 | emezeske | http://stackoverflow.com/questions/4579226/what-does-do-in-clojure |
| 03:48 | tylergillies | emezeske: thnx |
| 03:49 | emezeske | tylergillies: an example: http://pastebin.com/sCWJ9sV2 |
| 03:49 | emezeske | tylergillies: I didn't run that, so it might have bugs :P |
| 03:49 | tylergillies | oh |
| 03:49 | tylergillies | i know what that macro is |
| 03:49 | tylergillies | just forgot what it was called |
| 03:49 | emezeske | I routinely forget what it's called. |
| 03:53 | tylergillies | is there a way to import multiple classes without calling :import for each one? |
| 04:48 | fliebel | Is there any support for complex number in clojure/libraries? I only found something in old contrib that is both unfinished *and* outdated. |
| 04:51 | romanandreg | quick question: do you know if you can do partial parsing of json using clojure.json? |
| 04:51 | romanandreg | parsing json without having all the string to parse available? |
| 04:54 | fliebel | romanandreg: You mean like lazy xml, but for json? I don't think so, but it should be possible. |
| 04:55 | romanandreg | fliebel: yes, exactly that, parse as data is available |
| 04:55 | romanandreg | but don't halt if there is not enough input |
| 04:56 | fliebel | romanandreg: That would only work if you interpret JSON arrays as lazy sequences. |
| 04:59 | romanandreg | fliebel: thank you :-) |
| 05:02 | talios | 'lo miclorb_ |
| 05:22 | fliebel | Ok, so generic functions are in new contrib, but complex numbers aren't |
| 08:04 | fliebel | What kind of latencies should I expect with Avout? |
| 08:05 | fliebel | The default ticktime of 2000ms seems to indicate it's not really instantaneous. |
| 08:36 | ldh | I'm trying to play with irepl via "lein trampoline irepl", but am getting "java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected" (https://gist.github.com/1808500). any suggestions? |
| 08:49 | fliebel | ldh: Some kind of version mismatch? |
| 08:51 | ldh | fliebel: i've had trouble with jline in the past (OS X here), solved by making sure only one jline jar is on the classpath (in /Library/Java/Extensions) IIRC |
| 08:51 | ldh | fliebel: not sure if/how that applies here |
| 09:26 | chawks | Hi everybody. I am trying to use Noir to create a form with several checkboxes, however when I select more than one check box, I only receive the last selection... any ideas? |
| 11:34 | apwalk | chawks: I've not done this with Noir, or clojure, but ensure that the html groups the checkboxes by specifying the same name, and makes them an array, e.g. name="choices[]" |
| 11:56 | chawks | Hi apwalk, that worked, thanks :) |
| 12:22 | muhoo | hey, holy crap. refs are pointers! |
| 12:22 | muhoo | i can write c in clojure :_) |
| 12:24 | muhoo | neat. thread-safe, concurrency-aware pointers. |
| 12:35 | gf3 | c in clojure on the JVM |
| 12:35 | gf3 | AMAZING |
| 12:37 | the-kenny | So, who wants to drive a Delorean Monster Truck? https://machinegestalt.posterous.com/if-programming-languages-were-cars |
| 13:06 | muhoo | i kind of suspected taht, when reading about structural sharing, i thought, hmm, sounds like pointers in c, but without the segfaults. |
| 13:09 | muhoo | the-kenny: that's fantastic. lol purple bat van |
| 13:27 | jjcomer | Does anyone know how I specify attributes (other than id and class) in hiccup? |
| 13:29 | Scriptor | jjcomer: just specify them in the map in the 2nd argument? |
| 13:33 | jjcomer | Scriptor: that worked! |
| 13:33 | jjcomer | thanks |
| 13:33 | Scriptor | no prob! |
| 14:32 | fliebel | How can I dispatch on a number in multimethods? |
| 14:33 | alex_baranosky | (fn [n] (if (= n 5) :five :othernums)) |
| 14:33 | TimMc | fliebel: Dispatch in multimethods is all based on 'isa? -- read the docs on that function. |
| 14:33 | TimMc | It's not self-evident. |
| 14:34 | fliebel | TimMc: Right, so either all numbers need to have a common ancestor, or I need to derive them. |
| 14:34 | TimMc | fliebel: No, read the doc again. |
| 14:34 | TimMc | &(doc isa?) |
| 14:34 | lazybot | ⇒ "([child parent] [h child parent]); Returns true if (= child parent), or child is directly or indirectly derived from parent, either via a Java type inheritance relationship or a relationship established via derive. h must be a hierarchy obtained from make-hierarchy,... https://refheap.com/paste/718 |
| 14:34 | TimMc | very first clause |
| 14:35 | fliebel | "Returns true if (= child parent)"? |
| 14:35 | TimMc | yeah |
| 14:35 | TimMc | &(isa? 5 5) |
| 14:35 | lazybot | ⇒ true |
| 14:36 | TimMc | &(isa? (class 5) Number) |
| 14:36 | lazybot | ⇒ true |
| 14:36 | fliebel | &Numer |
| 14:36 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: Numer in this context |
| 14:36 | fliebel | &Number |
| 14:36 | lazybot | ⇒ java.lang.Number |
| 14:36 | fliebel | aha |
| 14:37 | TimMc | I didn't understand multimethods at all until I had that explained to me. :-) |
| 14:37 | fliebel | TimMc: I did understand that, I was just looking for what turned out to be called -- very logically in hindsight -- java.lang.Number. |
| 14:38 | fliebel | &(bases (class 1)) |
| 14:38 | lazybot | ⇒ (java.lang.Number java.lang.Comparable) |
| 14:38 | fliebel | Thanks though. |
| 14:44 | TimMc | Oh, hah! OK. |
| 14:44 | TimMc | fliebel: ##(ancestors (class 5)) |
| 14:44 | lazybot | ⇒ #{java.lang.Object java.io.Serializable java.lang.Comparable java.lang.Number} |
| 14:45 | TimMc | I thought you were trying to dispatch on a specific numeric value. |
| 14:49 | tmciver | TimMc: Really? But how does isa? help dispatch on a particular value? |
| 14:49 | tmciver | TimMc: I'm looking at the defproxy branch of the import stuff, by the way. |
| 14:49 | TimMc | &(isa? 5 5) |
| 14:49 | lazybot | ⇒ true |
| 14:50 | tmciver | TimMc: But the dispatch function doesn't have to involve types, right? The dispatch function could have been (= 5 5), true? |
| 14:51 | TimMc | Ah, well, there are two components to the dispatch. |
| 14:51 | tmciver | TimMc: I admit, that would be a limited way to implement multi-methods on particular values, I think. |
| 14:51 | Frozenlock | Nooo! Y u no working! I restarted my machine and now I can't get clojure-jack-in to work. :( |
| 14:52 | TimMc | tmciver: You could dispatch on #(mod 4 %) and have multimethods for 0, 1, 2, and 3. |
| 14:52 | TimMc | It's pretty flexible. |
| 14:52 | Frozenlock | Does "error in process filter: Symbol's function definition is void: define-slime-contrib" rings a bell for someone? |
| 14:53 | tmciver | Frozenlock: I occasionally get an error like that - usually after I kill slime/swank and try to clojure-jack-in again. I just restart emacs. |
| 14:54 | Frozenlock | Hmmm.. I'll try that then, thanks |
| 14:57 | rhall | is there any real difference between these two forms of def: (defn func-name [args] (body ...)) and (defn func-name ([args] (body ...))) ? |
| 14:57 | rhall | I see them both used but I've never seen anyone discuss this |
| 14:57 | rhall | ie, parens wrapping the args |
| 14:57 | Raynes | The latter is typically used when there are multiple arities. |
| 14:57 | TimMc | rhall: The second allows you to define multiple arities. |
| 14:57 | rhall | ah, of course |
| 14:58 | Raynes | (defn foo ([x] (foo x 0)) ([x y] (+ x y))) |
| 14:58 | TimMc | You only get one docstring for the whole thing, of course. |
| 14:58 | Raynes | TimMc: Go away. I'm busy teaching. |
| 14:58 | alex_baranosky | usually you wouldn't use the second, unless you had multiple arity definitions |
| 14:58 | TimMc | haha |
| 14:58 | Raynes | ;) |
| 14:58 | rhall | cool... thx |
| 14:58 | Raynes | alex_baranosky: I don't think he understood that yet, thanks. ;) |
| 14:59 | Raynes | In all seriousness, isn't it awesome that everybody fights to answer questions? |
| 14:59 | Raynes | Must be doing something right. |
| 14:59 | alex_baranosky | Raynes: I'm slow over here. too be programming |
| 14:59 | rhall | it's great the quick responses you get here |
| 15:00 | Raynes | TimMc: In other news, I'm biting the Enlive bullet. Working on moving RefHeap to it. Has been pretty painful so far, but I'm dealing. |
| 15:00 | Frozenlock | Grrr, I close Emacs for nothing, still not working :( |
| 15:01 | Raynes | Actually, it wasn't really enlive that was painful. For some reason my layout became different when it was expressed using the precise same HTML, only formatted well. Since hiccup doesn't format HTML, I never noticed. It was extremely frustrating figuring that one out. |
| 15:01 | Frozenlock | Is is possible my previously installed Slime (for CL) clashes with clojure's own slime? |
| 15:03 | TimMc | Raynes: Weird. |
| 15:04 | TimMc | Why are you moving to enlive, anyway? |
| 15:04 | Raynes | TimMc: Yeah, I went as far as to actually diff the HTML. :P |
| 15:04 | Raynes | Because it seems like a cleaner solution than the gobs and chunks of vectorcream that is RefHeap right now. |
| 15:05 | Raynes | I'm fine with hiccup, but messy is messy and RefHeap is getting messy. |
| 15:05 | TimMc | *nod* |
| 15:05 | TimMc | (Haven't seen the source, but I know the feeling.) |
| 15:06 | Raynes | The reason I gave you shit about tryclojure was just because it was pretty small. |
| 15:06 | Raynes | I probably would have agreed with you if it got bigger. |
| 15:07 | Raynes | I'm not sure if Enlive is the best solution here, but everybody seems to like it. I'm mostly worried about how much overhead this adds to people wanting to contribute to the sit.e |
| 15:07 | Raynes | site.* |
| 15:08 | Raynes | Enlive is pretty complicated, and I really like how easy 4Clojure is to contribute to. I'm not sure RefHeap will be able to serve a similar purpose under Enlive, but we'll see. |
| 15:08 | brehaut | Raynes: so you had some success? |
| 15:09 | Raynes | brehaut: Well, I've got one file converted after only 6 hours. |
| 15:10 | Raynes | But that was because of the formatting bu... |
| 15:10 | Raynes | Oh you weren't here. |
| 15:10 | Raynes | brehaut: Let me get you some logs. |
| 15:10 | brehaut | cheers |
| 15:10 | Raynes | brehaut: https://refheap.com/paste/719 |
| 15:14 | brehaut | Raynes: re:contribution, i tihnk enlive is less intimidating if you have someone elses working code to get started with |
| 15:14 | TimMc | absolutely |
| 15:15 | Raynes | brehaut: Fair enough. |
| 15:16 | Raynes | brehaut: Now, go finish this conversion to enlive. |
| 15:22 | scottj | Frozenlock: yes. swank-clojure doesn't work with recent versions of slime. |
| 15:23 | Frozenlock | That's really unfortunate... |
| 15:23 | romain_p_ | Hi, can someone help with the following korma error: http://pastie.org/3369281 |
| 15:24 | Raynes | Frozenlock: That is mostly the fault of the SLIME developers though, for never releasing anything. |
| 15:24 | scottj | Frozenlock: I use slime from 2009-10-15 and it works fine with clojure and CL |
| 15:24 | Frozenlock | Yeah, simply installing it for CL was quite an epic adventure |
| 15:25 | Frozenlock | "Oh you took it from ELPA? No you should take it from X place instead" |
| 15:28 | Frozenlock | What is the command to download and install swank with leiningen? |
| 15:30 | compj | maybe: lein plugin install swank-plugin 1.4.0 |
| 15:30 | compj | sorry |
| 15:30 | compj | swank-clojure |
| 15:30 | compj | not swank-plugin |
| 15:31 | puchacz | guys, for installing CL and all libraries you need (including slime) I suggest quicklisp |
| 15:31 | puchacz | it is much better than it used to be few years back |
| 15:31 | scottj | it didn't exist a few years back :) |
| 15:31 | puchacz | i.e. than before quicklisp arrived |
| 15:31 | scottj | oh that it :) |
| 15:31 | compj | does cvs slime work with clojure? |
| 15:32 | scottj | compj: no |
| 15:32 | osa1 | how can I implement clojure.lang.IFn in my records with arbitrary number of parameters? I've tried (invoke [a & rest] ...) but doesn't seem working(I'm getting AbstractMethodError) |
| 15:33 | puchacz | oh, I see I would have to take a week holiday at least if I wanted to evaluate clojure..... slime does not work, ouch |
| 15:33 | pmooser | Anyone using a current version of clojure-mode ? I'm getting errors because it is referencing a tramp-related function that isn't defined in slime. |
| 15:33 | scottj | puchacz: slime works, just not cvs version |
| 15:33 | puchacz | ah, ok |
| 15:33 | pmooser | Specifically, 'slime-tramp-local-filename' |
| 15:34 | TimMc | osa1: Well, you're going to have to implement all 22 overloads of invoke. |
| 15:34 | scottj | pmooser: ;;; clojure mode has no business messing up slime for CL |
| 15:34 | scottj | (remove-hook 'slime-connected-hook 'clojure-slime-remote-file-name-hook) |
| 15:34 | osa1 | TimMc: whoa! |
| 15:34 | TimMc | Are you sure you're up for that? :-) |
| 15:34 | osa1 | TimMc: not if you're sure it's the only way |
| 15:35 | TimMc | It's not. |
| 15:35 | osa1 | TimMc: maybe I can write a macro to do that for me |
| 15:35 | osa1 | TimMc: oh, what are other ways then? |
| 15:35 | TimMc | AFn is a helpful adapter, but you're not going to be able to use it in defrecord, deftype, or reify since it is a concrete (albeit abstract) class. |
| 15:36 | TimMc | Your best bet is proxy. |
| 15:36 | pmooser | scottj - you're awesome. Things like this seem to happen a lot. |
| 15:36 | TimMc | osa1: The larger question is... are you sure this is what you really want to do in the first place? |
| 15:36 | pmooser | It doesn't help of course that I can't use the 'standard' ways of setting this stuff up (jack-in), so I run into these issues often. |
| 15:36 | scottj | pmooser: just try not to update stuff if it's working :) |
| 15:37 | pmooser | scott, I was trying to upgrade to swank-1.4.0 so I could give CDT a try, and an update of clojure-mode seemed to be required. |
| 15:37 | osa1 | TimMc: actually I'm not. I just want to know if there's a way to do that. I'm in the learning phase. |
| 15:37 | scottj | pmooser: I recommend ritz |
| 15:37 | TimMc | osa1: You;d have to have a pretty compelling reason to do it. |
| 15:38 | Frozenlock | Ah damnit! I broke everything! |
| 15:38 | pmooser | scottj: I've been looking at it … it's never been clear to me exactly what state it is in. |
| 15:38 | Frozenlock | Time to delete all and start over. |
| 15:38 | pmooser | For me to use it I have to figure out how to launch the ritz swank thread from within my app (again, I can't use lein or cake or whatever), |
| 15:38 | pmooser | but I looked at the lein plugin for ritz earlier and it didn't look that hard. |
| 15:39 | TimMc | scottj: I took me sooooo long to learn not to upgrade things compulsively. |
| 15:40 | scottj | TimMc: I'm getting better at that. I love ubuntu LTS but will probably go to debian stable next time since 3 years is more upgrading than I like :) |
| 15:40 | TimMc | yep |
| 15:40 | pmooser | scottj: Do you find that ritz works better thank swank-clojure in general? |
| 15:41 | scottj | pmooser: I haven't done this but if your emacs configs including slime were in git then you could create a branch called trying-out-cdt and mostly get back if it didn't work |
| 15:41 | Raynes | scottj: Next LTS will be 5 years. |
| 15:41 | TimMc | Raynes: Now, if only they actually *supported* it... |
| 15:41 | scottj | Raynes: ahh, mark must want to keep me :) |
| 15:41 | pmooser | scottj: Sure, they are - I was just interested in not having to downgrade my clojure-mode.el to the previous version if possible, and you kindly helped me make the necessary config changes. |
| 15:42 | scottj | pmooser: ritz fixes several annoying things like it will show you line numbers of errors for things evaluated in the repl |
| 15:42 | Raynes | TimMc: Ubuntu is an ill-conceived weak-ass piece of shit anyway, so... |
| 15:42 | TimMc | heh, do you have that memorized by now? |
| 15:42 | Raynes | No, I actually had to google this time. |
| 15:42 | Raynes | Google "timmc browserid piece of shit" |
| 15:42 | Raynes | First hit. |
| 15:43 | TimMc | niiice |
| 15:43 | Raynes | $google timmc browserid piece of shit |
| 15:43 | scottj | pmooser: I like the debugger stepping UI in ritz. I haven't used it a lot though |
| 15:43 | Raynes | $kill |
| 15:43 | lazybot | KILL IT WITH FIRE! |
| 15:43 | Raynes | Hm. |
| 15:43 | TimMc | haha |
| 15:43 | Raynes | He refuses to google you. |
| 15:44 | pmooser | scottj: I'll see if I can integrate it with my setup at work. It's going to be interesting to see how it reacts to ritz's need to spawn and extra JVM process. |
| 15:45 | scottj | pmooser: btw ritz uses a different version of slime than swank-clojure :) |
| 15:45 | pmooser | My development setup is (unfortunately) not exactly typical, in that I run my own swank-server listening on a thread in an app that is mostly written in Java. |
| 15:45 | pmooser | scottj: Yeah, I'll have to carefully archive everything off before I start playing with ritz too much. |
| 15:45 | pmooser | All my configs are in git, but all of my ~/.emacs.d stuff is not. |
| 15:48 | pmooser | scottj: Thanks again for all the help. I really appreciate it. |
| 15:48 | pmooser | Hope to meet some of you folks at clojure/west! |
| 16:12 | Frozenlock | 1 required artifact is missing. |
| 16:12 | Frozenlock | for artifact: |
| 16:12 | Frozenlock | org.apache.maven:super-pom:jar:2.0 |
| 16:13 | Frozenlock | I was thinking that by starting everything over it would work... :( |
| 16:16 | muhoo | clojure.contrib. batteries not included anymore :-) |
| 16:19 | muhoo | also, google is fun: http://www.google.com/search?q=browser+piece+of+shit&btnG=Search |
| 16:28 | muhoo | ok, fail. pomegranate is installed, but this dies: |
| 16:28 | clojurebot | Roger. |
| 16:28 | muhoo | (add-dependencies "org.clojure/data.json" "0.1.2") |
| 16:28 | muhoo | IllegalArgumentException No value supplied for key: 0.1.2 clojure.lang.PersistentHashMap.createWithCheck (PersistentHashMap.java:89) |
| 16:29 | muhoo | also, this fails too: (add-dependencies 'org.clojure/data.json "0.1.2") |
| 16:29 | Bronsa | i think it should be (add-dependencies [['org.clojure/data.json "0.1.2"]]) |
| 16:30 | muhoo | ah, thanks |
| 16:30 | muhoo | also, i notice that noir doesn't use the official clojure data.json |
| 16:30 | muhoo | it uses clj-json. why? |
| 16:30 | nollidj | i'm looking at the clojure source. does anyone know what the &form and &env mean in (fn defn [&form &env name & fdecl] ...)? |
| 16:30 | Frozenlock | Yesss! It works! Now nobody move! Don't even breathe! |
| 16:31 | muhoo | Frozenlock: that's how i feel about most of the stuff i write :-/ |
| 16:32 | Frozenlock | Awww you broke it! |
| 16:32 | muhoo | hopefully, once i start writing production stuff in clojure, i won't feel like it's so fragile. |
| 16:32 | Frozenlock | :P |
| 16:32 | Bronsa | nollidj: defn is a macro |
| 16:32 | Bronsa | in a macro the first two args are &form and &env |
| 16:32 | nollidj | ah, ok. thanks |
| 16:32 | Bronsa | those are passed by the compiler i think |
| 16:33 | nollidj | i was wondering where they came from. defn is defined by a literal def instead of defmacro, so i guess that's why it's there |
| 16:33 | Bronsa | yeah |
| 16:33 | Bronsa | if you look a t defmacro source you can see |
| 16:33 | Bronsa | add-implicit-args (fn [fd] |
| 16:33 | Bronsa | (let [args (first fd)] |
| 16:33 | Bronsa | (cons (vec (cons '&form (cons '&env args))) (next fd)))) |
| 16:34 | nollidj | ah, i see |
| 16:36 | muhoo | be afraid. a moron (me) has discovered the threading macro. |
| 16:36 | muhoo | (-> 'clojure.data.json ns-publics keys) |
| 16:36 | muhoo | muaahahaha |
| 16:49 | muhoo | i need a cigarette now (-> "http://localhost/testserver/somebs?stuff=whatevs" slurp read-json pprint-json) |
| 16:50 | Raynes | Hahaha |
| 16:50 | Raynes | I've got an electronic one lying around here somewhere... |
| 16:51 | muhoo | it's like unix pipes, but in a real language (not bash) |
| 16:51 | brehaut | muhoo: modulo multiprocess stuff |
| 16:51 | Raynes | brehaut: Conch! |
| 16:52 | brehaut | Raynes: or threads and LinkedBlockingQueues ;) |
| 16:52 | muhoo | and tons of other stuff, including whatever java libs exist |
| 16:52 | muhoo | yep, well consider this one happy newb. |
| 16:52 | brehaut | im tempted to try to write a terrible facsimile of erlangs processors / mailboxes using PriorityBlockingQueue and core.match for fun |
| 17:04 | Raynes | TimMc: http://c.images.memegenerator.net/instances/500x/14493242.jpg |
| 17:05 | rahcola | am I right to say, that there is no equivalent for letrec in clojure? |
| 17:06 | bbloom | letfn ? |
| 17:08 | rahcola | what if you have a function and a other value, mutually dependand? |
| 17:08 | rahcola | like you have a function f that you map over a sequence s |
| 17:09 | rahcola | but f accesses s |
| 17:11 | rads | in that case couldn't you just put s before f and all would be good? I think I'm missing something here |
| 17:11 | raek | rahcola: lazy-seqs can be mutually recursive |
| 17:12 | bbloom | rahcola: pretend you have letrec, paste the form you're trying to achieve |
| 17:12 | lpetit | (let [s (some-seq), f (fn […] … s …), v (map f s)] …) |
| 17:12 | raek | (declare foo-seq bar-seq) (defn foo-seq [] (lazy-seq (cons 0 (bar-seq)))) (defn bar-seq [] (lazy-seq (cons 1 (foo-seq)))) |
| 17:13 | muhoo | how would i do this with destructuring, to get two keys out of this |
| 17:13 | muhoo | &(let [f [{:a 1, :b 2, :c 9}, {:a 3, :b 4, :c 10}]] (for [i f] [(:a i) (:b i)])) |
| 17:13 | lazybot | ⇒ ([1 2] [3 4]) |
| 17:13 | muhoo | the [(:a i) (:b i)] seems unidiomatic to me |
| 17:14 | raek | (map (juxt :a :b) f) |
| 17:15 | rahcola | rads: should have been more clear, s would be created by mapping f over it :) |
| 17:15 | raek | muhoo: with destructuring: (for [{:keys [a b]} f] [a b]) |
| 17:15 | muhoo | raek: that's mildly insane, but i lov eit. |
| 17:15 | rahcola | something like: (letrec [s (cons 0 (map f (range 1 10))) f (fn [i] (+ i (nth s (dec i))))] (do-something s)) |
| 17:15 | muhoo | thanks |
| 17:16 | TimMc | muhoo: data.json is probably slower than clj-json |
| 17:19 | muhoo | oh, thanks. |
| 17:20 | muhoo | wow, now i need a towel: (map (juxt :display_name :display_photo) (:responses bar)) |
| 17:21 | Raynes | Calm down. |
| 17:21 | muhoo | hehe |
| 17:22 | muhoo | you have to understand. the languages i've been using for work have been PHP and Java. |
| 17:22 | muhoo | coming to this from that, it's , well, i don't kno quite how to describe it exactly. |
| 17:22 | Raynes | amalloy too comes from that world. |
| 17:23 | Raynes | He is nuts for juxt, obviously, but he doesn't very often need a towel. |
| 17:23 | amalloy | a lot of clojure users do |
| 17:24 | TimMc | Perspiration, clearly. >_> |
| 17:24 | muhoo | it's hard work, this coding. |
| 17:28 | TimMc | muhoo: ##(map #(select-keys % #{:a :c}) [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6}]) |
| 17:28 | TimMc | $ping |
| 17:28 | lazybot | ⇒ ({:c 3, :a 1} {:c 6, :a 4}) |
| 17:28 | lazybot | TimMc: Ping completed in 0 seconds. |
| 17:28 | amalloy | TimMc: the $ping command doesn't do anything, last i checked |
| 17:28 | TimMc | muhoo: ^ if you still want the key-value relationships |
| 17:28 | muhoo | ooh, neat, thanks |
| 17:28 | TimMc | amalloy: I just wanted a response and thought $ping might do something. |
| 17:28 | amalloy | ah. $kill was written for exactly that purpose |
| 17:28 | amalloy | though personally i just do &1 |
| 17:29 | Raynes | $kill |
| 17:29 | lazybot | KILL IT WITH FIRE! |
| 17:29 | Raynes | Actually, kill wasn't written for that purpose at all. |
| 17:30 | Raynes | I use it because it's the only command I can reliably remember that does nothing but print a message. |
| 17:30 | Raynes | I added it for testing the bot in the early stages. |
| 17:32 | amalloy | sphinxure? really? |
| 17:33 | Raynes | ._. |
| 17:33 | Raynes | $google sphinxure clojure |
| 17:33 | Raynes | Yeah, google hasn't been working all day. |
| 17:34 | muhoo | TimMc: why would i use a set instead of (map #(select-keys % [:a :c]) f) ? |
| 17:34 | Raynes | $google sphinxure clojure |
| 17:34 | Raynes | amalloy: So, I haven't touched that code in a year and it is broken. |
| 17:34 | TimMc | (map #(select-keys % [:a :c]) [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6}]) |
| 17:34 | TimMc | &(map #(select-keys % [:a :c]) [{:a 1 :b 2 :c 3} {:a 4 :b 5 :c 6}]) |
| 17:34 | lazybot | ⇒ ({:c 3, :a 1} {:c 6, :a 4}) |
| 17:35 | Raynes | ~google foo bar |
| 17:35 | clojurebot | First, out of 1900000 results is: |
| 17:35 | clojurebot | foobar2000 |
| 17:35 | clojurebot | http://www.foobar2000.org/ |
| 17:35 | Raynes | So obviously the API still works... |
| 17:35 | TimMc | muhoo: *shrug* It just seems like the appropriate semantics. |
| 17:36 | muhoo | cool, thanks |
| 17:36 | Raynes | https://refheap.com/paste/721 |
| 17:36 | Raynes | I'll give anybody, including amalloy, 1 dollar to fix that bug in the next two hours. |
| 17:38 | Raynes | Hint: handle-search in lazybot/plugins/google.clj is giving nil to URLDecoder/decode. Go find out why. |
| 17:40 | aphyr | How can I test a private function? |
| 17:41 | alex_baranosky | reference it as #'function |
| 17:41 | alex_baranosky | I think... |
| 17:41 | Raynes | aphyr: You can access the var. |
| 17:41 | Raynes | #'some.namespace/someprivatevar. |
| 17:42 | alex_baranosky | or use the newest version of midje and call (expose-testables my.namespace.foo) , while marking that priate function with ^:testable |
| 17:42 | alex_baranosky | that's not deployed to clojars yet however |
| 17:42 | aphyr | Raynes: Ah, excellent. |
| 17:43 | aphyr | I was mucking around with ns-resolve... that's exactly what I needed. |
| 17:43 | Raynes | alex_baranosky: You forgot </shamelessplug> |
| 17:43 | Raynes | :P |
| 17:44 | Raynes | alex_baranosky: I have a new library with like three tests. Go rewrite them with Midje. |
| 17:44 | Raynes | https://github.com/Raynes/bultitude |
| 17:44 | alex_baranosky | Raynes lol |
| 17:45 | alex_baranosky | Let me put that on my todo list right after....... nothing |
| 17:45 | Raynes | :p |
| 17:45 | Raynes | You seem to get off on fixing my tests and stuff, so I figured... |
| 17:45 | muhoo | Raynes: is this in the string library somewhere? https://refheap.com/paste/720 |
| 17:45 | alex_baranosky | bultitude is hard to say |
| 17:46 | Raynes | See my note in the README about the name. |
| 17:46 | amalloy | clojure.string/join is the second half |
| 17:46 | Raynes | muhoo: Nope. It can also be better expressed as (clojure.string/join " " (.split #"\s+" s)) |
| 17:46 | Raynes | amalloy: It's an ancient snippet from lazybot's title plugin. |
| 17:46 | Raynes | :P |
| 17:47 | Raynes | Remember when I hated you and join? |
| 17:47 | amalloy | haha. the number of interpose/str fixes i've applied to that code already... |
| 17:47 | Raynes | Yeah. We used to give each other so much shit over that. |
| 17:48 | aphyr | Huh. What's the correct style? join or apply str interpose? |
| 17:48 | Raynes | join, for the most part. |
| 17:48 | amalloy | join in every instance ever |
| 17:48 | aphyr | Got it. |
| 17:49 | Raynes | I still tend to use (apply str (interpose " ")) in isolated cases where there is no real reason to bring in clojure.string. Basically, when I'm too lazy to add the require. |
| 17:49 | Raynes | More than one of those = use join or die. |
| 17:54 | TimMc | Raynes: Did you switch JSON libs recently with lazybot? |
| 18:00 | muhoo | hm, https://refheap.com/paste/724 |
| 18:00 | muhoo | waz that mean? |
| 18:01 | TimMc | muhoo: That means you have an older clj-json, I think. |
| 18:01 | muhoo | older than what, specifically? |
| 18:01 | muhoo | it's 0.5.0, from clojars |
| 18:01 | TimMc | than the most recent |
| 18:01 | muhoo | http://clojars.org/clj-json |
| 18:02 | muhoo | most recent says 0.5.0, via that site |
| 18:02 | TimMc | Oh, maybe the commit that makes it compatible with 1.3 hasn't been released yet. |
| 18:02 | TimMc | Anyway, I just switched to using cheshire because of that. |
| 18:03 | muhoo | odd. 0.4.3 is what noir requires, and it works fine with 1.3 |
| 18:04 | muhoo | heh, but 0.4.3 works fine . so i had a TOO recent version, apparently. |
| 18:04 | TimMc | Weird! |
| 18:04 | muhoo | well, no, maybe it's not reimporting it |
| 18:05 | TimMc | A regression, perhaps? |
| 18:06 | muhoo | i suppose if i'm ogin to be using noir, and it already has 0.4.3 , then there's no sense in my importing some other json library really |
| 18:08 | Raynes | TimMc: Not recently, no. |
| 18:08 | TimMc | (My internet was being terrible, so I couldn't check for myself.) |
| 18:08 | Raynes | I switched it a while back, but the google plugin was working afterwards. |
| 18:08 | Raynes | It only stopped working today. |
| 18:09 | aphyr | Any recommendation for what file logger I should use? I'm not familiar with java logging. |
| 18:09 | devn | is there anything a bit more xpathy for parsed html in clojure? |
| 18:12 | TimMc | Raynes: Overlimit? |
| 18:12 | Raynes | An API limit? I don't know of one. |
| 18:13 | Raynes | And that'd be a pretty cool trick unless someone has spammed him with google commands. |
| 18:13 | TimMc | >_> |
| 18:13 | TimMc | <_< |
| 18:15 | alex_baranosky | devn, this isn't XPATHy really but you might check it out anyway: https://github.com/antoniogarrote/apricot-soup |
| 18:15 | muhoo | is there a way to get a seq of all the namespaces that are loaded? i'm looking at clojure.tools.namespace and it doesn't seem to have that |
| 18:16 | amalloy | ,(loaded-libs) |
| 18:16 | clojurebot | #{clojure.java.io clojure.repl} |
| 18:16 | muhoo | amalloy: thanks! |
| 18:16 | TimMc | &(loaded-libs) ; comparing... |
| 18:16 | lazybot | ⇒ #{cd-client.core cheshire.core cheshire.factory cheshire.generate cheshire.parse clj-config.core clj-http.client clj-http.cookies clj-http.core clj-http.util clj-time.core clj-time.format clojail.core clojail.jvm clojail.testers clojure.contrib.zip-filter clojure.con... https://refheap.com/paste/725 |
| 18:17 | muhoo | two bots, no waiting. |
| 18:17 | muhoo | if the line gets more than 3 people deep, they open another bot. |
| 18:21 | Raynes | amalloy: I've got another lazybot bug for you. If you dec someone's karma to 0 and then try to inc it, lazybot thinks you're asking it to leave karma the same. |
| 18:21 | Raynes | $karma foo |
| 18:21 | lazybot | foo has karma 0. |
| 18:21 | Raynes | (inc foo) |
| 18:21 | lazybot | ⇒ 1 |
| 18:21 | Raynes | (dec foo) |
| 18:21 | lazybot | ⇒ 0 |
| 18:21 | Raynes | (inc foo) |
| 18:21 | lazybot | ⇒ 1 |
| 18:21 | Raynes | wut |
| 18:22 | amalloy | cool story |
| 18:22 | Raynes | I swea… T… |
| 18:22 | tmciver | Ha! |
| 18:22 | amalloy | you sweat? go get a towel |
| 18:22 | Raynes | amalloy: https://refheap.com/paste/726 |
| 18:23 | tmciver | not again! |
| 18:23 | muhoo | that's really odd, noir supposedly requires clj-json, but if i do loaded-libs, it doesn't show it. |
| 18:23 | Raynes | muhoo: Proptip: use noir 1.3.0 alphas. |
| 18:23 | amalloy | Raynes: that looks like the "only three operations at a time" restriction |
| 18:23 | Raynes | muhoo: They use cheshire. |
| 18:23 | muhoo | wait, what? |
| 18:23 | Raynes | amalloy: But then the error is wrong. |
| 18:23 | muhoo | no, i'm looking at the project.clj, and it says clj-json |
| 18:23 | amalloy | or no, because it was different people anyway |
| 18:24 | muhoo | plus the source code has specific references to it |
| 18:24 | Raynes | (dec foo) |
| 18:24 | lazybot | Do I smell abuse? Wait a while before modifying that person's karma again. |
| 18:24 | amalloy | lazybot: no, but you smell abused. does he not let you go outside? |
| 18:25 | Raynes | (inc redhat) |
| 18:25 | lazybot | You want me to leave karma the same? Fine, I will. |
| 18:25 | Raynes | amalloy: This was done on a whole different network. Why is it broken here too? |
| 18:25 | Raynes | The sky is falling, bro. |
| 18:25 | muhoo | Raynes: i've got noir 1.2.2 |
| 18:26 | Raynes | muhoo: UPGRADE TIME |
| 18:26 | muhoo | *sigh* |
| 18:26 | Raynes | http://clojars.org/noir alpha9! |
| 18:26 | Raynes | muhoo: Do you use flash sessions? |
| 18:26 | muhoo | Raynes: this is from git |
| 18:26 | Raynes | If so, they're broken now. |
| 18:26 | Raynes | Well, your usage of them is broken. |
| 18:26 | muhoo | commit f62e7e5e2045a53cf6980dc1ad0491b94b7ec92f |
| 18:26 | TimMc | Raynes: How can that "leave karma the same" error message even exist? |
| 18:26 | Raynes | We rewrote how they work in 1.3.0. |
| 18:26 | Raynes | TimMc: That's a good question bro. |
| 18:27 | muhoo | flash sessions? i don't use flash. adobe can bite me. :-) |
| 18:27 | Raynes | Not that kind of flash. |
| 18:27 | amalloy | part of the soon-to-be-unveiled lazybot-noop plugin, TimMc |
| 18:27 | Raynes | But if you don't know what I'm talking about, you can probably upgrade to 1.3.0 cleanly. |
| 18:28 | Raynes | amalloy: Have you deployed 4clojure-pasting-to-refheap yet? |
| 18:28 | muhoo | ok, i'll try. really, i figured if i git clone something off of github, i'm getting the most recent version. |
| 18:28 | Raynes | muhoo: Not if you aren't using the 1.3 branch. |
| 18:28 | muhoo | fair enough, and easy enough to fix too. |
| 18:29 | Raynes | I encourage usage of alpha software. |
| 18:29 | TimMc | Raynes: So people can find your bugs? |
| 18:29 | muhoo | i generally stay away from alpha software |
| 18:29 | alex_baranosky | TimMc, exactly! |
| 18:29 | muhoo | whatever was stable 2 years ago, is just fine now. |
| 18:29 | Raynes | I use macosecks |
| 18:29 | TimMc | Raynes: The question is, do *you* use alpha software? |
| 18:30 | alex_baranosky | it really dependes on the software in question |
| 18:30 | muhoo | i generally use production stable. that's how i roll. |
| 18:30 | Raynes | TimMc: I'm currently using Leiningen master, Emacs 24, macvim from homebrew, Textual for IRC from the unstable git branch... |
| 18:30 | alex_baranosky | I don't think non-alpha Midje releases are way less stable than non-alphas |
| 18:30 | muhoo | i got enough bugs of my own, i don't need anyone else's. |
| 18:31 | alex_baranosky | it depends how much you want to use new features that aren't available yet |
| 18:31 | Raynes | And the chrome beta release channel |
| 18:31 | Raynes | I would use canary but I'm too lazy. |
| 18:31 | muhoo | a friend called me "technologically Amish". |
| 18:32 | Raynes | I don't have friends who aren't infants. |
| 18:32 | Raynes | Alpha humans. |
| 18:32 | muhoo | generally that's why i'm discovering clojure now. when it first came out, i figured, "nah, i'll wait for the bugs to shake out first" |
| 18:32 | Raynes | Whatever you do, don't use ClojureScript. |
| 18:32 | Raynes | Your head will explode. |
| 18:33 | duck1123 | How do I get the namespace from a var? |
| 18:33 | Raynes | Wait, you're just now getting into Clojure and you're already using RefHeap as your primary pastebin? |
| 18:33 | muhoo | i know. i love the idea of clojurescript, but i can tell i've got a few years before i get to play with it. |
| 18:33 | Raynes | You and I are going to be very good friends. |
| 18:33 | amalloy | &(meta #'inc) |
| 18:33 | lazybot | ⇒ {:ns #<Namespace clojure.core>, :name inc, :file "clojure/core.clj", :line 857, :arglists ([x]), :added "1.2", :inline #<core$inc__inliner clojure.core$inc__inliner@198f833>, :doc "Returns a number one greater than num. Does not auto-promote\n longs, will throw on overflow. See also: inc'"} |
| 18:34 | Raynes | &(-> #'inc meta :ns str) |
| 18:34 | lazybot | ⇒ "clojure.core" |
| 18:34 | muhoo | Raynes: refheap is the first pastebin i found that had an emacs client. |
| 18:34 | duck1123 | in the meta... I was thinking there was a fn that would give it, thanks |
| 18:34 | Raynes | duck1123: ^ minus str if you just want the ns object. |
| 18:34 | muhoo | maybe others do, but i didn't know abou tthem. |
| 18:34 | Raynes | muhoo: Every single pastebin ever has an emacs client. :| |
| 18:34 | amalloy | Raynes: ns-name, not str |
| 18:34 | Raynes | But by all means, keep using refheap. |
| 18:34 | Raynes | amalloy: Piss off. |
| 18:35 | Raynes | &(doc ns-name) |
| 18:35 | lazybot | ⇒ "([ns]); Returns the name of the namespace, a symbol." |
| 18:35 | amalloy | write me an emacs client for pissing off and i'll consider it |
| 18:35 | amalloy | (yes, i agree it's absurd there's a separate function - namespaces should just be Named |
| 18:35 | amalloy | ) |
| 18:35 | duck1123 | agree |
| 18:36 | Raynes | amalloy: (defun piss-off () (message "Piss off, amalloy")) |
| 18:36 | Raynes | DOne. |
| 18:36 | amalloy | there was some discussion of it on the mailing list a while ago, duck1123, but as usual nothing came of it |
| 18:36 | muhoo | it's gettin' real in #clojurre |
| 18:36 | Raynes | amalloy: Want some keybindings too? |
| 18:37 | muhoo | ok back to my confusion here. this is what's loaded. no clj-json https://refheap.com/paste/727 |
| 18:37 | Raynes | muhoo: How did you get that list? |
| 18:38 | muhoo | (seq (loaded-libs)) |
| 18:38 | Raynes | Is this on the 1.3 branch of noir? |
| 18:38 | muhoo | [noir "1.2.2"] |
| 18:38 | muhoo | sorry, actually 1.2.1 |
| 18:38 | Raynes | Noir wont load that namespace until you require noir.response |
| 18:39 | muhoo | aha, ok, that makes sense |
| 18:39 | muhoo | Warning: *coercions* not declared dynamic and thus is not dynamically rebindable, but its name suggests otherwise. Please either indicate ^:dynamic *coercions* or change the name. |
| 18:39 | muhoo | because there's the error message clj-json spews out |
| 18:39 | Raynes | That's not an error. |
| 18:39 | Raynes | 1.3 uses cheshire which doesn't have that warning. |
| 18:40 | amalloy | well, it's a warning about an error that will occur later |
| 18:40 | muhoo | i see. ok. now it makes sense why you'd recommend 1.3 |
| 18:40 | Raynes | You know, I think I'm an asshole for turning people away from clj-json, since a co-worker (I think) maintain sit. |
| 18:40 | Raynes | amalloy: An error that never actually does occur. |
| 18:40 | Raynes | Pretty sure it is never ever rebound. |
| 18:40 | cindy1986 | Okay, restart after dist-upgrade |
| 18:40 | amalloy | Raynes: it can occur. *coercions* is intended to be rebound |
| 18:41 | Raynes | I don't think so. |
| 18:41 | Raynes | At least, unless the client rebinds it. |
| 18:41 | cindy1986 | mhh grub2 |
| 18:41 | amalloy | since i maintain it with lancepantz, i am confident in telling you you're wrong |
| 18:41 | amalloy | yes, the client is intended to rebind it |
| 18:41 | Raynes | Well, you didn't bother telling me why. |
| 18:41 | Raynes | "Yes it does. U R rong." wasn't particularly helpful in my understanding. |
| 18:42 | amalloy | *coercions* is pretty gross though |
| 18:42 | Raynes | In this case, why do you guys bother maintaining clj-json when cheshire is maintained just fine by someone else and is just as fast? |
| 18:42 | amalloy | i dunno |
| 18:42 | amalloy | that's lance and justin's decision |
| 18:42 | Raynes | Tell Lance to talk to me about it. |
| 18:42 | Raynes | Justin told me to talk to Lance about it. |
| 18:43 | amalloy | actually it might be because of *coercions* |
| 18:43 | Raynes | But I can never get Lance to actually sit at his keyboard long enough to have a meaningful discussion. |
| 18:43 | amalloy | we use it to make clj-json encode sets as json arrays |
| 18:43 | Raynes | Maybe you can convince him to. |
| 18:43 | Raynes | :p |
| 18:43 | muhoo | gentlemen, i really didn't want to start a dispute over something as mundane as json libraries. |
| 18:44 | Raynes | We aren't disputing. Just wondering what would need to be done to stop maintaining a library. |
| 18:44 | Raynes | If we can use cheshire without major modifications, we might as well. |
| 18:44 | Raynes | I can probably add whatever is necessary if anything is necessary. |
| 18:45 | Raynes | Or dakrone would if we asked, I'm sure. He basically does whatever I tell him to. |
| 18:45 | Raynes | dakrone: sudo make me a sandwich |
| 18:47 | amalloy | let's fork off into three disputes: json, whether we were disputing, and whether there are gentlemen present |
| 18:48 | Scriptor | quick question, on windows 7 where does the emacs starter kit go? |
| 18:48 | Raynes | On your Linux partition. |
| 18:48 | Raynes | ~rimshot |
| 18:48 | clojurebot | Badum, *tish* |
| 18:48 | muhoo | http://www.youtube.com/watch?v=kQFKtI6gn9Y |
| 18:49 | TimMc | Scriptor: ~/ |
| 18:50 | mrBliss | Scriptor: WIN+R %APPDATA% RET |
| 18:51 | TimMc | oh, right |
| 18:53 | Scriptor | hmm, that's the place I used |
| 20:40 | codeforkjeff | just upgraded to latest clojure-mode from technomancy. now when i do clojure-jack-in, i get errors in emacs and can't edit the file: "Symbol's function definition is void: slime-tramp-local-filename" anyone else seen this? |
| 20:40 | codeforkjeff | i'm editing a local file, not using tramp at all |
| 21:31 | aphyr | Is there a sane way to log to a file? |
| 21:31 | TimMc | aphyr: where log4j is insane? :-P |
| 21:31 | aphyr | I'm like 3 hours and hundreds of pages into java logging and clojure.tools.logging and getting ready to write my own damn logger |
| 21:32 | aphyr | I just want to say (set-log-file "foo.log"), and have my log messages go there. |
| 21:32 | aphyr | Instead there's this fucking configurator bullshit and XML and property files and nested domain contexts |
| 21:32 | TimMc | Write your own logger. You can always sub in something horrible later. :-) |
| 21:32 | beffbernard | aphyr: Which framework are you using? |
| 21:33 | aphyr | I'll use whatever gets the job done |
| 21:33 | TimMc | I bet there's a Clojure lib for this, actually... |
| 21:33 | aphyr | Right now just clojure.tools.logging |
| 21:33 | beffbernard | tools.logging? |
| 21:33 | aphyr | I guess it split off from contrib.logging...? |
| 21:34 | TimMc | It moved. |
| 21:34 | aphyr | I mucked around with clj-logging-config but it doesn't seem to actually set the filename anywhere. I can't figure out how to make a RollingFileAppender happy, either. |
| 21:34 | beffbernard | just add log4j, or any slf4j package in your project.cljj |
| 21:34 | beffbernard | then make sure the config files are in your classpath |
| 21:34 | TimMc | "just add log4j", he says |
| 21:34 | aphyr | I don't want to use a config file though |
| 21:34 | beffbernard | :) |
| 21:35 | TimMc | I don't think anything to do with log4j is ever simple. |
| 21:35 | aphyr | I need to be able to set the log file from a fn call |
| 21:35 | TimMc | It is very inflexible at runtime. |
| 21:35 | aphyr | I could do the fucking file IO and synchronization myself in like 20 lines... |
| 21:35 | aphyr | I don't know why this should be so hard, haha |
| 21:35 | TimMc | aphyr: send messages to an agent |
| 21:35 | beffbernard | performance, rolling logs, etc |
| 21:36 | aphyr | Yeah, performance would be nice |
| 21:36 | aphyr | I understand that log4j is super fast, which sounds great... |
| 21:37 | aphyr | It's not clear to me how clojure.tools.logging chooses *which* logger to use |
| 21:37 | aphyr | log4j seems to have this whole heirarchy of named loggers |
| 21:41 | beffbernard | Yeah, I"m curious myself. I'm just looking into the code ATM |
| 21:51 | beffbernard | aphyr: Well in clojure.tools.logging.impl there is a find-factory method… it uses Class/forName to see if each logger is in the classpath |
| 21:51 | arohner1 | aphyr: https://gist.github.com/37b57284a130eb296ef3 |
| 21:52 | aphyr | arohner1: !!!! |
| 21:53 | aphyr | Yes, that's it exactly. |
| 21:53 | TimMc | That's disgusting. |
| 21:53 | TimMc | I mean, it would still look worse in Java... |
| 21:53 | aphyr | I was about a quarter of the way through writing that myself. |
| 21:54 | aphyr | Thanks |
| 21:54 | arohner1 | np |
| 22:04 | technomancy | codeforkjeff: I was a bit trigger-happy applying incoming pull requests |
| 22:04 | technomancy | best to stick with the packaged releases rather than following git if you want to avoid breakage |
| 22:23 | Frozenlock | I'm still struggling with the java --> clojure conversion. How would this be written in clojure? |
| 22:23 | Frozenlock | localDevice.getConfiguration().setProperty(PropertyIdentifier.objectName, new CharacterString("BACnet4J slave device test")) |
| 22:24 | Frozenlock | Usually I would do : (.somejavafunction argument). But for this long expression, I'm confused. |
| 22:25 | brehaut | at a guess it is (.setProperty (.getConfiguration localDevice) PropertyIdentifier/objectName (CharacterString. "BACnet4J slave device test")) |
| 22:26 | brehaut | or perhaps you might prefer (-> localDevice .getConfiguration (.setProperty PropertyIdentifier/objectName (CharacterString. "BACnet4J slave device test"))) |
| 22:26 | Frozenlock | I'll try it, thanks! |
| 22:27 | amalloy | i much prefer the -> notation there. but Frozenlock, you probably should figure this out yourself by translating each sub-piece and asking questions about the parts you don't understand or can't fit together |
| 22:28 | Frozenlock | amalloy: I agree. Unfortunatly every java-clojure interop explanation I've seen assume a working knowledge of java. :( |
| 22:29 | Frozenlock | It feels like learning 2 languages at once. |
| 22:30 | Raynes | You only need to know a certain limited amount about how Java works and only as much as you need to know to do something at any given point in time. |
| 22:30 | jaimef | that's what you get with a java dsl :P |
| 22:31 | Frozenlock | jaimef: I flushed racket because they didn't have docstring :P |
| 22:37 | jaimef | Frozenlock: yeah.. fighting the size atm trying to use compozure without eating all the ram :-/ |
| 22:39 | Frozenlock | I noticed the same thing earlier today! "Hey, where's all my ram?.. OMG!" |
| 22:40 | Frozenlock | Okay, biggest eater was chrome... but still :P |
| 22:43 | jaimef | on small vm's in the cloud every byte counts |
| 22:44 | jaimef | e.g. run lein with only 256megs of ram :P |
| 22:49 | technomancy | jaimef: definitely use lein trampoline if you're short on ram |
| 22:49 | jaimef | hey technomancy yeah once I get more clojure clue I will check it out |
| 22:50 | amalloy | trampoline is good, but at least as important is setting a maximum heap size for the jvm |
| 22:50 | jaimef | technomancy: do you use slime for other lisps? |
| 22:51 | amalloy | trampoline gets you from two 500MB instances down to one; -Xmx40m gets you down to maybe 100MB |
| 22:51 | technomancy | jaimef: no; CL's attitude towards slime development drives me nuts |
| 22:51 | daedius | hey all, got a code question, i'm a noob clojure dev trying to create a macro that will take in a symbol and (def set the symbol to a number |
| 22:51 | Raynes | Once we get the classloader stuff solid in Leiningen... |
| 22:52 | Frozenlock | technomancy: wasn't slime FOR common lisp? |
| 22:52 | technomancy | Frozenlock: sure, and the JVM was for Java |
| 22:52 | jaimef | given sbcl's default lack of readline like support slime is the only usable option imho |
| 22:52 | brehaut | Frozenlock: how do you feel about CVS? |
| 22:52 | technomancy | doesn't mean we can't find better uses for them both =) |
| 22:52 | daedius | http://pastebin.com/zaU7jU4z |
| 22:53 | daedius | can someone give me a hint for how to do this? |
| 22:53 | daedius | oops.. http://pastebin.com/r17UbfC2 |
| 22:53 | daedius | corrected |
| 22:53 | Frozenlock | brehaut: never used it, why? |
| 22:53 | brehaut | you are in for a treat |
| 22:54 | amalloy | your macro should return a list representing code to run |
| 22:54 | brehaut | im pretty sure the CL slime is still in CVS? |
| 22:54 | Frozenlock | I think it is. I just snatched the lastest version available on the website and was done with it. |
| 22:55 | Frozenlock | Who's developing Slime anyways? I've yet to meet one of "them" :P |
| 22:55 | emezeske | daedius: You want to read up on "quoting". I suggest the Joy of Clojure, it has some good content regarding macros and quoting. |
| 22:55 | brehaut | If you had had experience with CVS that would tell you everything that is wrong |
| 22:56 | daedius | yah, trying to figure it out, I get the gist of it, but I don't know what symbols to use to say "I want the actual value of what this parameter is" |
| 22:57 | daedius | in the codes case, getting the value of the symbol thats passed in as a parameter |
| 22:57 | Apage43 | (defmacro foo [s] `(def ~s 10)) |
| 22:59 | daedius | ahhh, I came close, I made a mistake of (defmacro foo [s] `((def ~s 10))) |
| 22:59 | daedius | thanks Apage43 |
| 23:00 | amalloy | it's instructive to consider the other approach of (defmacro foo [s] (list 'def s 10)) |
| 23:02 | emezeske | technomancy: Did you say there was a doc on migrating plugins from lein 1.6 -> 1.7? |
| 23:02 | TimMc | emezeske: PLUGINS.md on master |
| 23:02 | technomancy | emezeske: https://groups.google.com/group/leiningen/browse_thread/thread/cce838e9460d51c2 |
| 23:03 | emezeske | technomancy, TimMc: thanks |
| 23:03 | TimMc | emezeske: Oops, disregard what I said. |
| 23:03 | technomancy | well doc/PLUGINS.md is about 2.0, which does the :plugins thing but also has several other changes |
| 23:03 | technomancy | (1.7 has :plugins too) |
| 23:03 | TimMc | I assumed you had written 1.7 -> 2.0, because that's what was on my mind. |
| 23:05 | emezeske | technomancy: So my plugin has two main namespaces: leiningen.cljsbuild and cljsbuild.core. Do I need to move everything underneath leiningen? |
| 23:05 | technomancy | emezeske: the tl;dr is anything that runs inside the project classpath needs to be in its own dependency |
| 23:05 | technomancy | :plugins exist only in the Leiningen process |
| 23:05 | emezeske | technomancy: My plugin doesn't have anything that needs to be in the project classpath |
| 23:06 | technomancy | ok, then you're in luck |
| 23:06 | technomancy | you should be able to just update your documentation |
| 23:06 | emezeske | Well, it's complaining about not finding the non-leiningen namespace |
| 23:07 | technomancy | the leiningen.* convention is only needed for tasks |
| 23:07 | emezeske | Okay, so it *should* work. I'll keep diggin then. |
| 23:08 | hugod | technomancy: are installed plugins in 0.7.0 still equivalent to using :dev-dependencies? |
| 23:08 | hugod | oops, 1.7 |
| 23:08 | technomancy | hugod: no, they aren't placed on the project's classpath |
| 23:08 | technomancy | apart from that they're the same |
| 23:08 | hugod | ok, thanks |
| 23:08 | emezeske | technomancy: Uh weird question: if my plugin uses eval-in-project, does that project need to have my plugin as a plugin dependency? |
| 23:09 | technomancy | emezeske: oh, you are doing that funky construct-a-dummy-project thing, right? |
| 23:09 | emezeske | Yeah |
| 23:09 | emezeske | Well, it merges in the :dependencies and :dev-dependencies from the parent project |
| 23:09 | emezeske | Maybe I just need to merge in :project as well |
| 23:10 | technomancy | you mean merge in :plugins as well? |
| 23:10 | technomancy | I'd advise against that |
| 23:10 | emezeske | Yeah |
| 23:10 | emezeske | Oh |
| 23:10 | technomancy | :plugins is specifically intended to be kept off the project classpath |
| 23:10 | emezeske | No I mean, add a :plugins to the dummy project |
| 23:10 | technomancy | so if you want to assoc lein-cljsbuild specifically in, you could do that |
| 23:10 | technomancy | or you could spin cljsbuild-core off into its own jar |
| 23:10 | technomancy | if it never needs to run in the context of lein |
| 23:11 | emezeske | Right |
| 23:11 | emezeske | I think I am really going to like lein 2.0 ^_^ |
| 23:11 | technomancy | I hope you do! =) |
| 23:14 | emezeske | Okay, I think spinning off a non-lein jar is the cleanest thing to do |
| 23:14 | emezeske | That solves some other problems as well |
| 23:16 | technomancy | I think that the lein2 isolation of :plugins makes sense, and it only seems confusing because :dev-dependencies lets people get away with a lot of crap that didn't particularly make sense to begin with |
| 23:19 | emezeske | I agree. The 1.6 way of doing plugins has a very blurred line between "extends leiningen" and "is a library that your project uses." |