#clojure logs

2012-05-05

00:00ibdknoxtechnomancy: running off of cljs master
00:00technomancyhm; you could maybe just add something to :source-paths
00:03ibdknoxI think I tried that and it did bad things
00:03ibdknoxI'll give it a go again though
00:03technomancywhat you really want is a checkout dependency, right?
00:03technomancyit's just that you can't do it for cljs since it's not a lein project?
00:03technomancymaybe dump a fake project.clj in there?
00:04ibdknoxnot a bad idea
00:04ibdknoxI had that at one point and then nuked it
00:05technomancyhugod has something to let you use mvn projects as checkout deps, but I'm not sure it would make sense to add support for other project types
00:06technomancysince it would pretty much just be clojure and cljs
00:06technomancyand maybe gradle?
00:10mdeboardgod wtb emacs-in-clojure :(
00:11mdeboardeverything is hard
00:11mdeboardw/ elisp
00:25mmarczyktechnomancy: failure-expected-here-dont-freak-out :-D
00:25mmarczyktechnomancy: thanks for that, stopped in the middle of freaking out :-)
00:26mmarczyktechnomancy: do you want a pull req for the bluuugh thing or do you want me to push to master
00:26mdeboardWant to pair this up with https://github.com/lynaghk/c2
00:26mdeboarder
00:26mdeboardWant to pair https://github.com/lynaghk/c2 up with Cascalog output
00:33mmarczykhm, on second thought I probably need to make sure that tests remain on the cp when working on lein, which might not happen with my current approach... will do that later.
01:23leo2007How to use `lein plugin install <something> ..' to install the latest snapshot version of something?
01:28_KY_Do I need many "doall"s for a series of nested "for"s, or just one "doall"?
01:35mdeboardleo2007: Are you coming from ruby/python world
01:36mdeboardleo2007: lein isn't like pip/gem, if you want to include a module in your project you need to specify it in your project.clj
01:46amalloy_KY_: if you have many nested fors, especially of the sort you feel you need to doall, you can probably simplify your approach radically
01:47_KY_Like how?
01:49spjtIs there any way to make lein use symbolic links?
01:50spjtseems kind of ridiculous to have every project hold a separate copy of the libs
01:51amalloy_KY_: for example, by generating flatter sequences, or using doseq instead of for, or reducing side effect
01:51_KY_1) doseq doesn't collect
01:52_KY_2) I already use concat inside the "for"s to flatten results
01:52amalloyuhoh
01:53_KY_But flattened could still be lazy, right?
01:53amalloyare you aware that for takes multiple binding pairs? ##(for [x [1 2 3], y '(a b c)] [x y]), for example
01:53lazybot⇒ ([1 a] [1 b] [1 c] [2 a] [2 b] [2 c] [3 a] [3 b] [3 c])
01:53amalloyyou can surely use that instead of having multiple nested fors with concats
01:55amalloyfor example, a worse way to write that would have been ##(apply concat (for [x [1 2 3]] (for [y '(a b c)] [x y])))
01:55lazybot⇒ ([1 a] [1 b] [1 c] [2 a] [2 b] [2 c] [3 a] [3 b] [3 c])
01:57_KY_Ah right...
01:59_KY_I want to squeeze a "let" between 2 for's
01:59amalloyyou should read the docs for for
02:00amalloy&(for [x [1 2 3] :let [y (inc x)], z [y x y]] [x y z])
02:00lazybot⇒ ([1 2 2] [1 2 1] [1 2 2] [2 3 3] [2 3 2] [2 3 3] [3 4 4] [3 4 3] [3 4 4])
02:01_KY_"For" is very hard to search on the net =[
02:01amalloy&(doc for)
02:01lazybot⇒ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightm... https://www.refheap.com/paste/2576
02:02amalloy$google clojuredocs
02:02lazybot[ClojureDocs - Community-Powered Clojure Documentation and ...] http://clojuredocs.org/
02:02_KY_The result doesn't have "for":
02:02_KY_http://clojuredocs.org/search?x=0&amp;y=0&amp;q=for
02:04_KY_Well, "for form" does it...
02:04amalloyhaha um...the actual search button is really bad, i think
02:04amalloybut if you type "for", the autosuggest is good
02:06_KY_Thanks a lot... it reduced a lot of indents =)
02:12leo2007mdeboard: no
02:12leo2007mdeboard: but i never used java
02:14_KY_I did (let [answer (first lazy-seq)] ..., does it ensure the first element is evaluated and stored as answer?
02:15amalloyindeed
02:16_KY_I mean "my-lazy-seq"
02:17_KY_Ok=)
02:22mlozanojust saw the clojuredocs.org reference ... would be nice to see it on: http://dochub.io/
02:22mlozanoperhaps I should get on that
02:23wei_how would I rewrite this java snippet in Clojure? new TrustManager[] { tm }
02:24mlozanocshell ... clever
02:24wei_more context: I'm translating this to clojure https://gist.github.com/2600263
02:26noidi_wei_, (into-array [tm])
02:26noidi_,(doc into-array)
02:26clojurebot"([aseq] [type aseq]); Returns an array with components set to the values in aseq. The array's component type is type if provided, or the type of the first value in aseq if present, or Object. All values in aseq must be compatible with the component type. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
03:09muhoois there any way to get just the top level of a tree?
03:09_KY_Maybe (first tree)?
03:09RaynesA ladder.
03:10RaynesThank's folks, I'm here all week.
03:10_KY_I'm trying to (catch java.util.concurrent.CancellationException every) but it doesn't work, any idea?
03:11_KY_s/every/e
03:12wei_noidi_: thanks, that worked
03:15wei_Could you help me figure out where this IllegalAccessError is coming from? The stacktrace isn't being very helpful: https://gist.github.com/2600542
03:16_KY_(Oh I found out it's something else throwing the exception...)
03:16muhooi think the magic answer is "breadth first", however, not sure how to do that in clojure yet
03:16mlozano1Oh has lots of arguments
03:21noidi_wei_, perhaps the class IOConnection has private or default (package private) visibility?
03:23noidi_or maybe the method setDefaultSSLSocketFactory is private/protected
03:25wei_oh, you're right! there was another (public) class to access it from
03:30_KY_,(doc ~)
03:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
03:32amalloymuhoo: i think the first thing you have to do is decide/define what you mean by (a) tree, and (b) "just the top level"
03:33amalloyeg, if the tree is a seq of seqs, such as (a (b c) (d (e f))), then the top level is the whole tree
03:35_KY_(I see... ~ is unquote)
03:38amalloyor if each node is a pair, [value children], then the top level is just (first tree), and the second level is (map first (second tree)), and so on
03:54muhooamalloy: ah, thanks
03:55amalloyi practically went to a special school just for complaining the problem is ill-defined
03:56amalloyso gimme a call if you need me to do that
05:18muhooRaynes: https://www.refheap.com/paste/2577 ahem www
05:19muhooamalloy: this is what i was on after: https://www.refheap.com/paste/2578
05:22muhoothat's for a vector-zip
05:31Raynesmuhoo: ...?
05:32Raynesmuhoo: The forced www is on purpose.
05:32Raynesmuhoo: https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords
05:33muhooi know, i patched refheap.el to use www
05:33RaynesOh.
05:33RaynesSee, I didn't actually look at the paste.
05:33RaynesBahaha.
05:33muhooif i cover my eyes, then you can't see me
05:34Raynesmuhoo: Want something to do?
05:34RaynesNot necessarily now, but perhaps when you're bored.
05:36Raynesmuhoo: https://github.com/Raynes/refheap/wiki/Documentation:-API Under the /paste docs, look at the 'language' param. It can take a file extension. Your mission should you chose to accept it is to remove all of the mode detection crap (that association list) in refheap.el and just pass along the extension to refheap as per the docs. Should be easy. For added difficulty, handle modes that don't have an extension specially using a much smaller association
05:37RaynesI'll add the www to refheap.el in the morning. Me go nitenite.
06:22_KY_I call empty? on a lazy seq it got an error, why?
06:23noidi_has anyone built counterclockwise from source recently?
06:23AimHereWhat error, _KY_?
06:24_KY_Don't know how to create ISeq from: java.lang.Boolean
06:24noidi_I'm trying to set up an environment for hacking on CCW, but these instructions seem to be quite a bit out of date https://code.google.com/p/counterclockwise/wiki/HowToBuild
06:24AimHereYou sure the thing you're calling empty? on is a sequence?
06:25_KY_Yes
06:25_KY_type is clojure.lang.LazySeq
06:25AimHereWhat's likely to have happened is either you're passing a boolean value instead of a sequence to empty, or you're attempting to use the result of (empty?...) as a sequence
06:26noidi_I do get CCW building with those instructions, but they use the compilation-deps branch of the CCW repository, whereas the latest releases of CCW seem to be tagged from the master branch
06:26LicenserOr the thing that handles what comes out of empty? is trying to handle a seq?
06:27BorkdudeI'm wondering, I use noir 1.2.0 as a dependency and also clojure 1.2.0. On OSX lein downloads clojure 1.2.1 and in my XP virtual machine clojure 1.3.0.
06:27AimHereI think I already said that, but maybe it needs saying twice ;)
06:40muhoowow. it's taken me 10 hours today to understand clojure.zip, and i think i've just about got it.
06:40muhoomust. sleep. now.
06:41Licenserhey people I've a off topic question: What browser do you use, FF is starting to piss me off, being slow as hell and crashing reagularily just because I've a few dozent tabs open :(
06:42bradwrightChrome
06:43Licenserbradwright is it worht it?
06:43fliebelSafari
06:46Licensernow I need a third person saying safari or chrome so I can get an vote that isn't balanced :P
06:46Licensergreat tahnk you
06:46Licenser:P
06:46piecykchrome! :P
06:47Licenserpiecyk thank you! you saved my day :)
06:48Licenserbradwright fliebel thanks for your oppinions
06:50bradwrightI find Chrome to be very stable with lots of tabs
06:50bradwrightLess RAM hungry than Firefox as well
07:03_KY_Does my REPL have trace built in?
07:03_KY_It's just clojure-1.3.0
07:23bobryis it allright to ask clojure-script related questions here?
07:25AimHereYes
07:29_KY_How can I create a lazy sequence from a function?
07:30_KY_Suppose the function returns 1,2,3,4,... on each successive call
07:47Borkdude_KV_ : http://clojuredocs.org/clojure_core/clojure.core/lazy-seq
07:51_KY_But I have a function that returns values, not a seq initially
07:53Borkdudeah, then you need a closure
07:53raek_KY_: is the seq infinite?
07:53Borkdude(let [counter (atom 0)] (fn [] (swap! counter inc) @counter))
07:53_KY_Let's say the function is "take"
07:53_KY_(take) ==> 1
07:54_KY_(take) ==> 2
07:54_KY_And so on...
07:54raekwell, there's 'repeatedly'
07:54Borkdude_KY_ try my function
07:54raek,(repeatedly #(rand-int 10))
07:54_KY_I see...
07:54clojurebot(8 3 2 2 7 ...)
07:55Borkdude_KY_K: http://cljbin.com/paste/4fa512c7e4b018b49dfc3fc6
07:55raekbut if you want it to end, you need to write a function that returns the lazy seq
07:56_KY_Can I write (repeatedly (my-func)) and get a lazy seq?
07:56AimHere"repeatedly", and "iterate" turn functions into sequence
07:56raek_KY_: (repeatedly my-func)
07:56raekreturns a lazy-seq that will call my-func to generate each element (on demand)
07:57Borkdude_KY_ I guess so, but why would you do it this way… (range) already represents a lazy list of integers
07:57_KY_Ahhh works now =)
07:57_KY_I have a special my-func... that must be used
07:57Borkdude_KY_ for side effects?
07:58_KY_Yes it changes its output every time it's called
07:58AimHereWhatever you're doing sounds a tad nonidiomatic ;)
08:00Borkdudegrrr. now Eclipse ccw doesn't even start a repl anymore, it's driving me crazy :(
08:11_KY_AimHere: I'm calling some java library that returns external stuff
08:13leo2007is there a fork of swank-clojure that fixes issues in fuzzy completion?
08:16raek_KY_: https://gist.github.com/2601906
08:17raekthis is an example on how to implement a finite lazy-seq backed by a stateful java object
08:19_KY_Thanks.. but "repeatedly" answered my needs already =)
08:19_KY_There is fuzzy completion?
08:19_KY_Sounds very sophisticated =)
08:22leo2007it is broken
08:22raekleo2007: is there an issue for it?
08:23BorkdudeI am supposed to do a "run as clojure application (preload file)" before I can do a "load file in REPL" in ccw 0.8?
08:24Borkdudecemerick: poke
08:25leo2007raek: a few
08:28cemerickBorkdude: hrm?
08:29Borkdudesee question before the poke
08:29Borkdudecemerick: see question before the poke… when I do "load file in REPL" there not a REPL coming up anymore
08:30Borkdudecemerick: Run As> Clojure (preload file) still works though
08:34Borkdudecemerick: I still haven't got leiningen support working, installed completely new eclipse, new workspace, etc… it works in my Windows XP VM though
08:34Borkdudecemerick: for now I'm giving up, don't know what is causing this wonkyness… :(
08:37cemerickBorkdude: loading a file to start a REPL works here
08:38cemerickI think you have something well-horked in your environment. Too many unrelated (and changing) issues…there can't be that many bugs in the world! ;-)
08:40cshellwow, this feels like deja vu - the same conversation 24 hours later - thought something was messed up with my irc client ;)
08:44Borkdudecshell: this totally means I've spend too much time on this now
09:00cshellBorkdude: You could switch to Intellij :)
09:01Borkdudecshell: I was using emacs before, the reason I'm using eclipse is because my students are more familiar with it
09:02Borkdudecshell: I like it though, except for this quirky behavior I'm getting
09:02cshellBorkdude: Understandable - were you ever able to get lein to run from the command line?
09:02Borkdudecshell: yes, works great
09:03Borkdudecshell: with lein2 I'm now also able to connect to an nrepl that was started from eclipse, nice feature
09:03cshellcshell: that is cool, I didn't know that
09:43Borkdudecan you destructure on a map of which you expect only one key-value pair, but don't know the keyname?
09:44Borkdudesomething like this: (let [[k v] {:b12 \X}] k), but then something that works
09:45gfredericks&(let [[k v] (seq {3 4})] [k v])
09:45lazybot⇒ [[3 4] nil]
09:45gfredericksoop
09:45gfredericks&(let [[[k v]] (seq {3 4})] [k v])
09:45lazybot⇒ [3 4]
09:45gfredericksthere it go
09:46gfredericksso if you wanted something slicker than that then I think the answer is no
09:46Borkdudegfredericks: yes, but one cannot use this in a function I assume, because you need to wrap the map in a seq first?
09:46gfredericksah ha
09:46gfredericksrighto
09:46gfredericksyeah no way to do that; you have to admit it's a weird use of maps
09:46gfredericksnot very mappy
09:46Borkdudegfredericks: I admit
09:48Borkdudegfredericks: reason why I ask is this function: https://github.com/Borkdude/tictactoe/blob/master/src/tictactoe/views/tictactoe.clj#L52
09:48Borkdudegfredericks: it always expects a map with only one key, actually I'm only interested in the key, not even the value
09:50gfredericksoh it's a form with a bunch of submit buttons?
09:50Borkdudegfredericks: right, and each submit button has a unique id
09:50Borkdudegfredericks: which I'm decoding in this function, to discover which one has been pressed
09:52gfredericksBorkdude: I guess the only alternative I could suggest is use a separate form (and route) for each button
09:53Borkdudegfredericks: I'll stick with this then
10:30natsuhi. i am a newbie trying to set up leiningen on my machine. i am using windows 7.
10:32natsutrying to run lein gives me this error: http://pastebin.com/7Zs2x84y. i tried with both cmd and cygwin.
10:33TimMc&(let [[[k v]] {3 4}] [k v])
10:33lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
10:33TimMcAha.
10:36_KY_Can I use NetBeans to open a project created by lein? how?
10:42jondot1hi all. what is a commonly used documentation guideline with clojure?
10:42jondot1such that I can also generate documentation from
10:44TimMcjondot1: Docstrings. Everywhere.
10:44TimMcYou can't go wrong with that.
10:45jondot1would that be the equivalent of, say, Ruby's tomdoc?
10:45TimMcNo idea.
10:45TimMcBeyond that, each doc-generation is going to have some guidelines of its own. Marginalia, for instance, mixes in all the top-level code comments.
10:45raeknatsu: which version of lein are you installing?
10:46raeknatsu: have you run `lein self-install`
10:46dnolenmmarczyk: ping?
10:48natsuraek: thanks for the response. this should answer the q's.
10:48natsuraek: lein self-install "$home\.lein\self-installs\leiningen-2.0.0-preview3-standalone.jar" already exists. Delete and retry.
10:55raeknatsu: can you verify that that file is actually a jar file? you should be able to open it as a zip file.
10:55natsuraek: yes it is. even extracted it.
10:55raekok, weird
10:57raeknatsu: have you tried installiing it through the shell script (rather than the windows batch file) in cygwin?
10:58natsuraek: yes. same issues. :(
10:59raekhave you tried the stable 1.7.1 version?
11:00raekalso, does your home directory path contain spaces or non-ascii characters?
11:01raeknatsu: one thing you could check is whether %HOMEPATH% points the place there the .lein directory is
11:02raekthis could be an issue with environment variables
11:02natsuyes it does.
11:03raekbut you got the exact same error with both lein.bat in cmd and lein in cygwin?
11:04natsuraek: yes
11:04natsulein command gives this error
11:04natsuF:\Compilers, libraries, and IDEs>lein Exception in thread "main" java.lang.NoClassDefFoundError: Files\Java\jre6\lib\ext\QTJava/zip;F:\Compilers, Caused by: java.lang.ClassNotFoundException: Files\Java\jre6\lib\ext\QTJava.zip;F:\Compilers,
11:05natsudoesnt seem to be handling whitespaces properly.
11:06raeknatsu: have you installed QT bindings for Java?
11:07natsuraek: yeah the zip is there on the path.
11:07raekI think the installer for the Java QT bindings did something wrong
11:08raeknatsu: is there a CLASSPATH env variable or someting that have these paths in it?
11:08natsuthere is a qtjava variable, set to: C:\Program Files\Java\jre6\lib\ext\QTJava.zip
11:09raekI think some env variable has ...;C:\Program Files\Java\jre6\lib\ext\QTJava/zip;... in it where it should have ...;"C:\Program Files\Java\jre6\lib\ext\QTJava/zip";...
11:09raeknatsu: try adding quotes around the value of that env variable
11:11natsuraek: tried. doesnt work.
11:17natsuraek: putting classpath variable in quotes made it work. (cfa suggested that.) thanks so much!
11:22raeknatsu: to summarize, this was not a Leiningen issue. the lein script uses whatever classpath your system has (which contained an error introduced by QT for Java in your case)
11:23natsuraek: no other classpaths have quotes around them. this one didnt either.
11:26raekhrm
11:30jondot1cemerick/friend take on warden is really interesting
12:19yoklovits sort of annoying that things need to be namespace qualified to use derive
12:25lynaghkAny emacs wizards have a suggestion on how to delete trailing whitespace in my buffer except in docstrings?
12:36yoklovlynaghk: does whitespace-cleanup end up applying to docstrings?
12:37lynaghkyoklov: yep.
12:37yoklovdamn.
12:38lynaghkI know next to nothing about elisp. Someone in #emacs suggested just looping and checking the font-face at each line to see if I'm inside a string.
12:38yoklovouch
12:38lynaghkSeems like a good enough plan for me.
12:39yoklovstill is a pain and seems a bit kludgey
12:40yoklovat least, you'll end up implementing part of whitespace-cleanup
12:40lynaghkyoklov: I'm pretty sure most of what's inside emacs is pain and kludge.
12:43yoklovhaha, yeah, there's always the possibility that that's the most idiomatic way to do it
12:43yoklovor something.
12:59samrathi, is anyone else here using vimclojure? \eb doesn't seem to be working for me.. don't know why
13:02samratI was watching cemerick's 'Starting Clojure' screencast and wondering if it would be possible to set up an environment similar to Eclipse's on Vim. Any alternatives to just copy..pasting each time to the REPL?
13:46ibdknoxI'm adding data-binding to crate :)
13:54yoklovdata binding?
13:55yoklovibdknox: like http://en.wikipedia.org/wiki/Data_binding or something else?
13:56ibdknoxyoklov: for example (defpartial t-html [v] [:p (bound v identity)])
13:56ibdknoxassuming v is an atom
13:56ibdknoxanytime the atom's value is changed
13:57ibdknoxthe text of that paragraph tag will too
13:57yoklovthats pretty awesome.
13:57ibdknoxnot through re-rendering but throw attribute manipulation
13:57ibdknoxI'm adding it for styles and normal attrs now
13:57ibdknoxso you'll be able to do
13:58ibdknox[:p {:class (bound v my-class-maker)} (bound v text-getter)]
13:58ibdknoxand everything will just be magic :)
13:58yoklovyeah, thats pretty awesome
13:58yoklovand relevant to what i'm doing :)
13:58ibdknoxme too
13:58ibdknoxlol
13:59yoklovsort of not that far from FRP i think either
13:59yoklovbut yeah that's really quite awesome.
14:00ibdknoxit's surprisingly easy to add
14:00yoklovyeah?
14:01ibdknoxyeah
14:01ibdknox40 lines?
14:01ibdknoxmaybe
14:01yoklovwow
14:01ibdknoxworking with actual dom objects instead of strings = huge win
14:02yoklovmakes sense
14:10lynaghk`ibdknox: people will explicitly pass in things implementing IWatchable and you'll handle updating attributes for them?
14:11ibdknoxI made my own protocol because I needed a value function
14:11ibdknoxbut yes
14:11ibdknoxmore or less :)
14:11lynaghk`What about when the values are transformed in the view
14:11ibdknoxwhat do you mean?
14:11lynaghk`e.g. {:background-color (color-scale v)}
14:12lynaghk`that's what I'm hung up on. For what I'd like to do, explicitly doing all transforms in advance is pulling apart the view logic too much.
14:12ibdknoxit would be written as {:background-color (bound v color-scale)
14:12ibdknox}
14:13ibdknoxyou pass the value generating function
14:13ibdknoxwhich gives you lots of freedom
14:13lynaghk`I was wondering if there'd be a way to make the bindings implict
14:13ibdknoxmaybe
14:13ibdknoxI don't mind them being explicit right now :)
14:13lynaghk`via some kind of macroexpansion that walks the hiccup vector and wraps forms that contain IWatchables
14:13ibdknoxI thought about it
14:14ibdknoxbut you'd need to know that at compile time, I didn't know that information was available
14:14lynaghk`yeah, that's the biggie.
14:14lynaghk`well, that and macro-black-magic.
14:14ibdknoxyeah
14:15lynaghk`So you are planning to maintain and extend Crate?
14:16ibdknoxyeah, I need it for Light Table
14:16lynaghk`I'd like to be able to rip the DOM manipulation stuff out of C2 and rely on another CLJS DOM library
14:16ibdknoxwell crate is only dom creation really
14:16ibdknoxand now this binding stuff
14:17ibdknoxdoesn't include things like append
14:17lynaghk`how do people use their newly created doms?
14:18ibdknoxI use jayq
14:18lynaghk`oh, so crate actually renders into the html string?
14:18lynaghk`or do you return live detached DOM nodes?
14:19ibdknoxlive detached dom nods
14:19ibdknoxnodes*
14:20lynaghk`is this binding stuff pushed anywhere public?
14:20ibdknoxone difference from what you want I think though is that I'm making the assumption of atoms all the way down
14:20ibdknoxright now
14:21ibdknoxbut that's just because I implemented it in the past 30 minutes
14:21ibdknoxand sure, let me push it
14:22ibdknoxlynaghk`: yoklov: https://github.com/ibdknox/crate/commit/0f1aae63afeda370af944082775f339af8e943ab
14:24lynaghk`ibdknox: you can use gensym if you need unique ids, btw.
14:24ibdknoxah
14:24ibdknoxthat's a good idea
14:24ibdknoxthe add-watch keying is kind of annoying
14:24ibdknoxnice when you need it
14:24lynaghk`I learned about it the first time I tried to have two C2 visualizations watching the same atom and one clobbered the other's watcher = )
14:25ibdknoxyeaaah
14:25lynaghk`Why bindable protocol? If you need value you can extend ideref and then get to use @
14:26ibdknoxI dunno, I guess I could, but for some reason I prefer that bits of functionality are grouped when it comes to these things. In this case it's implement one protocol, in that case it's implement two seemingly unrelated ones
14:26ibdknoxI don't have a strong argument either way
14:27lynaghk`Chris, Stuart Halloway sheds a tear for every new method you add to a protocol. You know that.
14:27ibdknoxlol
14:31ibdknoxthe thing that's hard to sort of deal with (and what I think you *did* solve) is a single atom with collections in it
14:32ibdknoxthe way this works right now the outer collection would need to be an atom as well
14:32ibdknoxand it's not doing diffing
14:33ibdknoxso there's definitely more work to be done to be more idiomatic - this feels backboney
14:34lynaghk`ibdknox: hmm, so if I'm reading this correctly you are creating a closure for each element and bindable attribute
14:34ibdknoxyes
14:34lynaghk`so after it has been rendered all of the pieces take care of themselves.
14:34ibdknoxyup
14:35lynaghk`that's in contrast to what I do in C2, which is walk the existing DOM nodes and update if the live dom nodes and their attributes don't match the hiccup representation
14:35ibdknoxyep
14:35ibdknoxI think how I did it is how it is traditionally implemented
14:35ibdknoxbuuut
14:35lynaghk`I suspect your version is more performant, but it may be less general w.r.t. mapping a collection to a collection of nodes
14:36ibdknoxyeah, like I was saying it suggests a more un-clojurish way of keeping your data
14:36ibdknoxI don't usually have collections of atoms
14:36ibdknoxI have an atom with collections in it
14:37lynaghk`Right, and it looks like there's no way to match existing nodes with logical nodes.
14:38ibdknoxyeah, there's no coordinating piece. Usually there isn't
14:39ibdknoxwe tried building the coordinating piece into backbone at RFZ
14:39ibdknoxworst mistake we made
14:39ibdknoxshould've handled it the way it was meant to be
14:39lynaghk`What do you mean coordinating?
14:39yoklovyeah, I had been wondering about the atom of collection vs collection of atoms thing
14:39lynaghk`syncing collections with collections of dom nodes?
14:40ibdknoxlynaghk`: more or less. Basically if you have inner parts of the collection that can change, not treating them as self-contained ends up a mess as things grow
14:40ibdknoxand it's very slow
14:40ibdknoxbut our data was structured that way
14:41ibdknoxwe worked on a collection of things and changed within it, not on individuals that changed
14:41ibdknoxunfortunately that worked very poorly for UI
14:42lynaghk`ibdknox: that sounds about right---trying to sync nested collections is probably going to be confusing/slow.
14:42ibdknoxso one way to handle this
14:42ibdknoxwould be to have sub-bindings
14:43ibdknoxI think you can effectively simulate the same thing if you use those
14:43ibdknoxbut I haven't thought through it long enough
14:44lynaghk`well if you need an excuse to come visit sunny sunny Portland and do some thinking over beers, let me know.
14:44ibdknox:)
14:44ibdknoxI'll probably take you up on it at some point
14:44lynaghk`ibdknox: actually, I'm going to be down at Stanford May 15--17 if you want to grab lunch or something.
14:45ibdknoxThat might work, what are you heading down there for?
14:45lynaghk`lil' holiday, pretty much. visiting a friend of mine at the business school there
14:46ibdknoxah nice
14:54lynaghk`ibdknox: well, I'll do some more thinking on this stuff; it sounds like we're working on similar problems. Since DOM <-> data binding is orthogonal to grab-bag-of-datavis-helpers, it'd be cool if we could factor out a shared solution.
15:11FrozenlockI'm using a piped input/outputstream. When I'm sending something too big (which really isn't that big), it hangs. Is there something more I need to do? Use buffered stream or something like that?
15:11xeqiFrozenlock: are you writing on a different thread?
15:11Rayneshttp://pledgie.com/campaigns/17303 Working on raising a little money to support refheap for the next year. Any contributions are much appreciated.
15:12FrozenlockBrb
15:13muhooRaynes: been thinking about this emacs mode business: it's better to have it choose lang by mode than file extension, since it's common to have buffers with no file
15:13muhooesepcially for a one-off-thing i'd paste
15:13Raynesmuhoo: That sounds fair. Thanks for thinking that through for me.
15:13muhoomaybe that assoc could move from the client to the server?
15:13lynaghk`Raynes: Keming Labs will cut you a cheque for that amount. Send me an email.
15:14Frozenlockxeqi: thank you so much, I've been trying to solve this for the last hour. A simple `future' call was all that was needed!
15:14muhooif the api supported being fed an emacs-mode instead of extension or language, that massive assoc could be removed from refheap.el
15:15Rayneslynaghk`: Could you PM me an address?
15:15dnolenmmarczyk: ping?
15:16lynaghk`Raynes: ugghh I have no idea how to use emacs IRC. it's kevin at keminglabs dot com
15:16Rayneslynaghk`: Your query worked!
15:16RaynesYou know more than you think apparently.
15:16Raynes:D
15:18Cyrikis there some way to implement a custom hashCode method on a record?
15:18mmarczykdnolen: pong!
15:19mmarczykdnolen: I'm seeing some fantastic perf w/ your new commits
15:19mmarczyk:-)
15:20natsuraek: the issue has popped up again.
15:21natsuraek: i believe it's a lein issue. https://github.com/technomancy/leiningen/issues/541
15:25Raynesmuhoo: The associations could be moved to the server, but Emacs modes are way to domain specific.
15:25Raynesmuhoo: Mostly, we just need to make sure that the modes are in sync with the current language offering.
15:25RaynesI know that I have at least added Elixir to the languages recently, but Emacs doesn't have a mode for that...
15:26natsuraek: hmm. this worked: https://github.com/technomancy/leiningen/blob/1.x/bin/lein.bat.
15:26RaynesBecause I can't get technomancy interested and he is the only person on the planet who knows how to write an emacs mode.
15:27muhoohehehe
15:27muhooi've never written one, but i've spelunked around in them
15:28muhooask on #emacs maybe
15:29muhooas for the assocs, how would you want that? the client sends an emacs-mode as a field in the paste POST, and the server looks up basically the same table that is currently in refheap.el?
15:29dnolenmarchdown: yes!
15:29dnolenoops
15:29dnolenmmarczyk: yes!
15:30mmarczyk:-)
15:30mmarczykthis is absolutely fabulous
15:30gf3Raynes: Y U HAET CLJBIN
15:30mmarczykthe perf win on success (i.e. the thing satisfies the protocol) is somewhat larger than before *and* rather than a perf hit on failure there's actually a gain here too
15:30mmarczykwjw.
15:31Raynesgf3: :p
15:31gf3WHYYY
15:31Raynesgf3: Competition, bro.
15:31Raynes:)
15:31dnolenmmarczyk: yes, no loss for PV now :)
15:31mmarczyk:-)
15:32lynaghk`Raynes: don't you need to swap out that mongo nonsense for Datomic?
15:32lynaghk`so one-off pasties can LIVE FOREVER.
15:32Rayneslynaghk`: I'm looking into other databases. Not sure datomic would be my best option though. More damned expenses.
15:33muhooRaynes: it's free for "development only" use, wink wink
15:33Raynesmuhoo: Right, but you still have to pay for amazon crap, right?
15:33muhooapparently there's a postgres back-end, which would prolly work nicely on heroku's free postgres db
15:33lynaghk`It's free for open source, yeah? But there's still the infrastructure overhead
15:33RaynesIt is free for open source, indeed.
15:34RaynesIf it works with postgres that would be an option.
15:34mmarczykdnolen: so now I'm thinking about extending this to non-core protocols and extend-type
15:34muhoothere are a few back-ends. one in-memory, a flat file IIRC, a postgres "development only" backend, then that amazon stuff for "production"
15:34RaynesI actually applied for refheap a while back but never went completely through with the sign up.
15:34muhooi really want to play with datomic, but atm i'm deep in couchdb land
15:34mmarczykdnolen: in general, it's not a problem to arrange things so that instances of Bar created after (extend-protocol IFoo Bar ...) get the correct bit mask
15:36mmarczykhm...
15:36RaynesYay! Pledgie closed.
15:37mmarczykRaynes: pledgie?
15:38Raynesmmarczyk: http://pledgie.com/campaigns/17303
15:38RaynesI was raising money for refheap hosting over the next year.
15:38Cyrikis there some way to implement a custom hashCode method on a record?
15:38eggsbyso core.match works well w/ cljs?
15:38brainproxydnolen: good news .. I've got node-clojurescript working for the most part
15:38muhoogf3: lol https://github.com/gf3/CLJBIN/commit/2bd5b5b2854d0f926da9b114334929668efbe129
15:38mmarczykRaynes: wow, cool!
15:39gf3muhoo: THE WORST
15:40gf3muhoo: Also I'm sure most of my code is not idiomatic, feel free to correct me
15:41muhoothe code is fine, the comment was funny. i've been bitten by that too
15:43Cr8Raynes:.. that didn't take long =D
15:44RaynesCr8: Well, lynaghk` just offered me the whole original goal… so… yeah, didn't take long. :p
15:44dnolenmmarczyk: yes tho I think adding the bit mask later is a minor optimization
15:44Cr8ah
15:44dnolenmmarczyk: for dynamic stuff like that going up the prototype chain isn't so bad.
15:44dnolenmmarczyk: I'm mostly interested in speed up core here.
15:44dnolenmmarczyk: been thinking more about EmptyList being it's own type and ASeq
15:45dnolenmmarczyk: to speed up cljs.core.seq
15:45mmarczykdnolen: well, it would also mean that non-inline impls of core protocols would get a speedup for new instances
15:46dnolenmmarczyk: yes I'm not saying that's not worth pursuing - just more interested in tackling the bigger benefits for everyone.
15:46mmarczykdnolen: sure
15:50dnolenmmarczyk: one optimization I'm curious about
15:50dnolenmmarczyk: which you mentioned - protocol bit test in protocol dispatch
15:50mmarczykdnolen: yes
15:51dnolenmmarczyk: if bit test passed, called protocol dispatch directly, instead of testing property existence
15:51mmarczykdnolen: exactly
15:51dnolenmmarczyk: I'm not sure how much of a boost that will reveal.
15:57mmarczykdnolen: I'm thinking about splitting -methods into "direct" part and "native/default" part and calling the "direct" part without any checks -- no nil check, no property existence check -- for types/records w/ their own (non-default) impls of the protocol
15:58mmarczykdnolen: that would require a completely different approach to calling -methods -- basically noone should do it anymore except in places like the proto impls themselves, where the types are known / have otherwise been checked for
16:00mmarczykdnolen: then satisfies? would be sort of insufficient in that it doesn't provide any insight into "how" a thing satisfies a protocol -- so there could be a separate check for that or a version of satisfies? returning one of a handful "marker objects" (for comparisons with identical?), say, to indicate "satisfies with own impl", "satisfies as a native JS type", "satisfies with default impl", "does not satisfy"
16:00mmarczykdnolen: ...and all of a sudden this seems somewhat complicated...
16:01dnolenmmarczyk: yeah I'm not sure about that.
16:01Guest2000hello all. a dumb question... why => (binding
16:01Guest2000 [*invocation-user-mandant* "test"]
16:01Guest2000 (map (fn [_] *invocation-user-mandant*) '(1 2 3)))
16:01Guest2000returns (nil nil nil) instead of (test test test)?
16:01mmarczykdnolen: could introduce enough overhead to defeat the purpose :-/
16:01Guest2000i mean - instead of ("test" "test" "test")
16:01mmarczykdnolen: alternatively -methods could take a flag meaning "assume direct call will work" and check that first
16:02mmarczykdnolen: should expect true iff the thing is a type/record with own impl
16:02dnolenmmarczyk: I've thought about this approach as well
16:02dnolenmmarczyk: one problem is checking native JS types
16:03mmarczykdnolen: we're not going to find bit masks on those
16:03mmarczykdnolen: so the flag would be false and dispatch would proceed as it currently does (well, hopefully with some other optimizations)
16:04dnolenmmarczyk: this stuff is worth exploring but probably in a branch off rt-cljs
16:04mmarczykdnolen: right
16:05dnolenmmarczyk: I'd like to get rt-cljs in a spot where we're pretty happy w/ it's perf compared to master and merge it in.
16:05dnolenmmarczyk: it's already pretty close I think.
16:05mmarczykdnolen: I think it is great as it is
16:06mmarczykdnolen: clear win all around
16:06dnolenmmarczyk: is the partition stuff just working?
16:06mmarczykdnolen: I think it should, core protocols only
16:06mmarczykdnolen: did some sanity checks at the REPL
16:06mmarczykdnolen: define a type with just 1 inline core proto impl
16:06mmarczykdnolen: then extend-protocol some-other-core-protocol-form-same-partition to that type
16:07mmarczykdnolen: happily, both protocols work
16:07dnolenmmarczyk: yes the bit test is a fast check, fall backs to the old thing otherwise.
16:07Guest2000hello all. i need some help in understanding a weird thing... why
16:07Guest2000(binding [*somevar* "test"]
16:07Guest2000 (map (fn [_] *somevar*) '(1 2 3)))
16:07Guest2000returns (nil nil nil) instead of ("test" "test" "test")
16:07Guest2000and
16:07Guest2000(binding [*somevar* "test"]
16:07Guest2000 (println *somevar*)
16:07mmarczykdnolen: right, and that does indeed work :-)
16:07Guest2000prints of course as expected "test"?
16:07Guest2000Can someone enlighten me? would be happy & thankfull for explanations and possible hints how to get the current binding of a var also INSIDE a map function
16:07dnolenmmarczyk: excellent well then I'm gonna merge it in! :)
16:08mmarczykdnolen: hah! great :-)
16:08mmarczykdnolen: before I dive into anything hairy, I'm going to play with next a bit
16:08mmarczykdnolen: ILazySeq as marker interface for things next should explicitly call seq on, basically
16:09mmarczykdnolen: (defn next [coll] (when coll (let [r (rest coll)] (if (satisfies? ILazySeq r) (seq r) r)))) or some such thing
16:11dnolenmmarczyk: pushed to master
16:11mmarczykdnolen: cool! :-)
16:14raekGuest2000: map is lazy. the sequence is not forced until your repl prints it, which happens outside the dynamic scope of 'binding'
16:14dnolenmmarczyk: yeah, it seems to strange to me that first is >2X slower than -first
16:15raekGuest2000: you have to force the whole sequence within thr 'binding' form, for example like this:
16:15raek(binding [*somevar* "test"]
16:15raek (doall (map (fn [_] *somevar*) '(1 2 3))))
16:16raekfeatures that are based one dynamic scope (such as 'binding' and 'with-open') are easiest to use near the top level
16:16ibdknoxdnolen: mmarczyk: it sounds like we're getting epic perf wins?
16:16mmarczykdnolen: hm, is it? :-(
16:17Guest2000raek - thank you a lot - forgot that part. without your help would have gazed for another 30mins at the screen lol - ty again!
16:17dnolenibdknox: groundwork being laid
16:17ibdknox:)
16:17mmarczyk:-)
16:18ibdknoxI dunno if you guys saw, I added data-binding to crate this morning
16:18dnolenmmarczyk: yeah, again I'm not sure if that can be avoided?
16:19dnolenmmarczyk: perhaps a simple fact of 2 fn calls not 1.
16:19mmarczykibdknox: hah! cool :-)
16:19mmarczykdnolen: hm, with simple opts and static-fns
16:20dnolenmmarczyk: advanced opts
16:30mmarczykdnolen: hm, yeah; I'm not seeing much difference on :simple, on :advanced -- a factor of 2x like you say
16:31mmarczykdnolen: of course :simple is like 4.5x slower than :advanced for first (9x on -first -- wow?)
16:34mmarczykdnolen: amazingly, satisfies? seems faster on :simple !?
17:31FrozenlockAny suggestion for a graph/network drawing library? (graphviz-like)
17:33meiji11I don't know, loom?
17:33meiji11I think loom uses graphviz to draw its graphs.
17:35FrozenlockInteresting. It requires to have graphviz on the path, but it's better than nothing. Thanks!
17:35meiji11you're welcome.
17:44johnfnthe "hot swapping" stuff with swank clojure seems nice and all in theory, but as soon as i make a single mistake the whole thing crashes, which kind of defeats the point. is there any way to make it more resilient?
17:45yoklovjohnfn: hotswapping?
17:45johnfni mean using ctrl+c ctrl+c to send in an updated version of a function
17:46yoklovah, no clue, just was curious what you were referring to
17:46johnfnoh hmm.
17:51Raynesarohner: Oh man. Is this the lazy seq of pages tentacles users have pleaded with the old Gods for for so long?
17:52arohnerRaynes: yes
17:52RaynesYou are a gentleman and a scholar.
17:53arohnerRaynes: glad to be of service
17:55arohnerRaynes: will you be making a release, or should I make my own?
17:56Raynesarohner: I'll cut a release. One question: your oauth.clj commit has the word 'incomplete' in it. Do you just mean "some endpoints aren't here" or "these don't work properly"?
17:56arohnerRaynes: some endpoints aren't there
17:56arohnerI use those in my tests
17:57RaynesOkay. Are you okay with a 2.0-beta1 release until one of us gets around to adding the rest? I think Github is going to put search and repo deletion back into the API shortly too.
17:57arohnersure
17:58RaynesGreat. One moment.
18:00Raynesarohner: 0.2.0-beta1 is now on clojars.
18:00arohnerRaynes: thanks
18:03technomancyRaynes: elixir-mode exists already bro
18:04Raynestechnomancy: Nope.
18:04Raynestechnomancy: It exists for Elixir's old syntax which has radically changed.
18:04technomancypicky, picky
18:04amalloythey should try a more regular syntax
18:05amalloymaybe with parens or something
18:05RaynesIt lives!
18:25mlozano1was trying to write a good insertion sort for a list, does this seem reasonable? https://gist.github.com/2605926
18:37yoklovmlozano1: insert is the same as cons, i think
18:37yoklov,[(list 3) (cons 3 ())]
18:37clojurebot[(3) (3)]
18:38yoklov,(= (conj () 3) (list 3))
18:38clojurebottrue
18:39yoklovmlozano1: i also think your lists will all end in 'nil'
18:40yoklov"(if (empty? lst) nil" should be "(if (empty? lst) ()" or "(if (empty? lst) lst"
18:40yoklovin scheme and common lisp lists end with nil (null in scheme), but that is not true in clojure
18:41yoklovalso i don't think that will sort anything.
18:41_KY_Can I use NetBeans to open a project created by lein?
18:42yoklovmlozano1: yeah, you don't ever actually sort the list. try instead of (first lst), something like (apply max lst)
18:44yoklovit often helps to write unit tests for your code, or to run some examples on it in the repl
18:47amalloyyoklov: clojure's lists end in nil in the same way that CL's and scheme's do
18:47amalloy&(cons 5 nil)
18:47lazybot⇒ (5)
18:47yoklovreally?
18:47yoklovhm
18:48yoklov,(= () nil)
18:48amalloyie, they don't have nil as an element
18:48clojurebotfalse
18:48amalloybut the last "element/next" pair is nil
18:48yoklov,(rest '(1))
18:48clojurebot()
18:48yoklov,(next '(1))
18:48clojurebotnil
18:48yoklovhuh.
18:49yoklovi never know the difference between next and rest. in my mind rest is somehow lazier, so when i'm being lazy i use rest. other than that i just try not to count on their differences.
18:51yoklovregardless, i guess what i meant to say is that scheme and CL don't distinguish between nil/null and the empty list, whereas clojure does
18:51yoklovthough his check there is okay
18:52amalloy(def next (comp seq rest))
18:52yoklovreally?
18:52yoklov_weird_
18:52amalloywhy is that weird?
18:53yoklovi would have thought that rest would work in terms of next, if anything
18:53yoklovdunno
18:54gfredericks&(next [3])
18:54lazybot⇒ nil
18:55gfredericksso next is the more eager one that actually probes the next element
18:55gfrederickswhile rest is the "lazier" one; thus rest could not be defined in terms of next
18:55amalloyi suppose it could do that. and the defns in clojure/core aren't actually written as (def next (comp seq rest)); that's just conceptually how they compare
18:55amalloygfredericks: (defn rest [coll] (lazy-seq (next coll)))
18:56yoklov^ thats how i thought it worked
18:56amalloybut i got halfway through typing out your argument myself before i realized i was wrong
18:56amalloyreally they're both implemented in java
18:57gfredericksI am a foil used to increase the instructiveness of the conversation
18:57yoklovyeah
18:57amalloyISeqs implement .next(), and .more() (which is just a weird name for rest)
18:57yoklovhm
19:03devnis there a reason why .more is used instead of .rest?
19:03devnor is that just a vestigial piece of clojure?
19:10BostXhi all
19:13muhooi'm really enjoying this zipper thing http://clojuredocs.org/clojure_core/clojure.zip/zipper
19:13BostXguys, in my project.clj I set :dependencies [[org.clojure/clojure "1.4.0"]] but 'lein deps' gives me is no ~/.m2/repository/org/clojure/clojure/1.4.0/clojure-1.4.0.jar
19:13BostXdo you know why?
19:14Chousukedevn: vestigial, yes
19:14muhootook me a good 10 hours of struggle to get my brain around it, but now i find them very natural and fun to work with
19:15muhooi have to ask, is it a code smell to have huge (let .... blocks that do most of the work, and only like 1 line of code outside the let?
19:16johnfnmuhoo: i used to do that a lot, and im starting to think that it is.
19:16johnfni dunno if i have a grasp on exactly what code smell means, but i feel like there's generally a more idiomatic way to do things
19:17johnfnmuhoo: maybe you should paste some code
19:19amalloyi think it's fine, though i usually wind up with a number of nested lets/whens instead
19:19amalloyand i can see how your code would look that way when you're working with zippers
19:21eggsbyIs anyone here familiar with congomongo? I'm having a weird issue: https://www.refheap.com/paste/2594 (or possibly I'm just confused)
19:22amalloyeggsby: i don't know what nuke-collection is, but i suspect it's lazy
19:23amalloyeg, perhaps (defn nuke [] (map destroy! (fetch...)))
19:23amalloyso when you evaluate it for side effects (as in a 'do), none of the elements are ever forced, and nothing happens
19:24eggsbyah
19:24eggsbyya that is what I'm doing.. mapping the destroy over the result of fetching the collection
19:25muhoothe biggest annoyance i have with zippers is it seems to proliferate NPE's
19:25amalloymongo has a delete-the-whole-damn-thing function somewhere, though i don't know if congomongo exposes it other than through direct js interop
19:26muhooif i screw up, it is not very nice about it.
19:26eggsbybut why would the implementation being lazy cause 'nuke-collection' to never get called amalloy?
19:27eggsbyamalloy: I'm actually just writing this to try to make tests, I don't think I'll ever really want to destroy my entire collection :)
19:28johnfnis there some sort of assoc-with-fn function
19:28amalloy&(doc update-in)
19:28lazybot⇒ "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
19:28johnfnaah, yeah that works
19:28amalloyeggsby: i think you should read some about how lazy sequences work. you create a lazy sequence representing your computations, but never realize any elements of it
19:29amalloy&(do (repeatedly #(println "OMGOMGOMG")) 1)
19:29lazybot⇒ 1
19:29eggsbyright, until something needs the value of it for some computation
19:29eggsbyI think I just misunderstand what do is for
19:30replacaeggsby: if you're trying to force the realization of a lazy seq, use doall not do
19:31eggsbyah, thank you replaca
19:31replacanp
19:32amalloy*cough* dorun
19:33amalloybut really, the answer is that nuke-collection! should be forcing the sequence internally, not requiring you to force it anytime you want to use it
19:34amalloyeg, (defn nuke! [] (doseq [{:keys [_id]} (fetch ...)] (destroy! _id)))
19:36eggsbyhmm
19:36eggsbythank you amalloy, I will try that
19:39yoklovso, I upgraded to leiningen 2.0 today, and I get "WARN ignoring checkouts directory clojurescript as it does not contain a project.clj file." when using a new version of clojurescript in a checkouts directory on the classpath, does this… still work?
19:39technomancyyoklov: ibdknox said he was going to write one
19:39technomancya project.clj file I mean
19:40muhoois there a way to add a string to an Exception after catching it, then re-throw it?
19:41gfredericksre-throw the same exception?
19:41yoklovtechnomancy: hm, so should I just go back to using lein1?
19:41technomancyit worked in lein1? that's surprising.
19:41technomancyit shouldn't work on projects that don't have project.clj
19:42yoklovtechnomancy: hm, yeah, it doesn't work in lein2
19:43yoklovbut just having clojurescript's compiler and core lib in the classpath was enough in lein1
19:43technomancyif you want it to work with lein2 you'd need to create a dummy project.clj file for clojurescript
19:43technomancythe fact that it works on lein1 is accidental
19:44yoklovyeah, I think I knew that it sort of accidentally worked
19:46yoklovthe fix described here: https://github.com/emezeske/lein-cljsbuild/issues/58 doesn't work in lein2, basically.
19:47yoklovhow "dummy" would the project.clj file have to be
19:48muhoogfredericks: yeah, but with my text added
19:49muhoojohnfn: amalloy: it *was* a code smell. i refactored it into half as many lines and fewer bugs :-)
19:49emezeskeyoklov: You don't really need to put the clojurescript checkout in the checkouts/ directory
19:49emezeskeyoklov: It could be anywhere from what I understand; as long as you somehow hack its source directories into your classpath
19:49yoklovemezeske: yeah, is the fact that i put it there a problem though?
19:49muhooi think i add a bunch of intermediate lets when i'm not confident that it's going to work. once it does, i nuke those and just pipeline the whole thing with (-> ) or ((())))
19:50emezeskeyoklov: Well, lein has special handling for things in checkouts/ from what I understand
19:50technomancyyoklov: oh right; you can add an entry to your own project's :source-paths
19:50emezeskeyoklov: If there's a dir in there, lein wants a projec.tclj
19:51yoklovtechnomancy: yeah, i've done that
19:51yoklovhm, trying it with some other folder name
19:51emezeskeReally, the example shouldn't use the checkouts/ dir, because it's not a checkout (at least in lein's terminology)
19:52emezeskeBut yeah, the ideal solution would be a project.clj for it, and then you could just drop it in checkouts/ and not have to muck with your :source-paths
19:53emezeskeI'm guessing the dummy project.clj could be pretty simple, just enough to tell lein where the source for the compiler is (I'm not certain, though, haven't messed with it)
19:55yoklovyeah, still doesn't work
19:55yoklovi'm still getting an old clojurescript
19:55emezeskeWhat does your :source-paths look like?
19:55yoklovwait, hold on, they were actually in :resource-paths
19:56devnChousuke: is there any reason why a patch couldn't be accepted to change .more to .rest?
19:57yoklovwhoops, yeah that made the difference.
19:57gfredericksthat reminds me of the lava patch
19:59eggsbythank you amalloy and replaca I was able to fix my bug and learn a bit about clojure in the process w/ yr help :)
20:02emezeskeyoklov: I updated the issue to reflect the lein2 differences, mind double checking what I wrote? https://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5531494
20:06yoklovemezeske: yup
20:06yoklovcommented with what worked for me.
20:08emezeskeyoklov: thanks
20:15ibdknoxlynaghk`: I think I might have something that solves your case but works the way I had mine setup
20:16ibdknoxyoklov: you might be interested too
20:16yoklovoh?
20:16ibdknoxyoklov: it looks like this: https://www.refheap.com/paste/2595
20:17lynaghk`ibdknox: oh yeah?
20:17ibdknoxit's a bit ugly right now
20:17ibdknoxbuuuut
20:17ibdknoxit lets you have a single atom
20:17ibdknoxand does all the right magic to handle propagating changes down
20:17ibdknoxno walking, all closures handling updates to themselves
20:18ibdknoxlynaghk`: what do you use for your default key fn?
20:18lynaghk`child index
20:18mebaran151I'm trying to play with ClojureScript on Windows; since fixing trampoline for windows, I can get cljsbuild repl-listen to ALMOST start, except it throws a null pointer exception, apparently trying to call re-matcher for something. Any ideas how to fix?
20:18ibdknoxah, yeah mine is dumb and doesn't consider ordering yet
20:19dnolenmebaran151: might want to ping emezeske
20:20lynaghk`ibdknox: what's the {:as aliases} doing? Taking the collection (:aliases n) and passing each element to the aliases partial?
20:21ibdknoxlynaghk`: yoklov: impl https://github.com/ibdknox/crate/commit/2f816a978ee37c71dc5c98c1268d6b07805926f4
20:21ibdknoxlynaghk`: yeah, telling it what to represent each one as
20:21ibdknoxlynaghk`: you could easily wrap a macro around that and make it transparently inline
20:22lynaghk`is defpartial just defn?
20:22ibdknoxwith a little more, but fundamentally yeah
20:24yoklovact rct and cct are are unrelated to the example?
20:24ibdknoxthey're just little functions to modify the atom
20:24yoklovyeah
20:24lynaghk`hmm. I'm really interested to see the performance comparison of dom-walking vs. tons-of-closures.
20:25ibdknoxI'm pretty sure the latter wins on memory, since you have to store the data in the dom, right?
20:26ibdknoxI have no idea how fast might current implementation is. I know there are some places where I could easily speed it up if it were too slow
20:27ibdknoxmy*
20:27yoklovi'd bet that it would depend on how you walked the dom
20:27lynaghk`I'm not sure how memory works when assiging a js object as a dom node property.
20:28ibdknoxthis is a common pattern
20:28lynaghk`yoklov: yeah, definitely. Right now C2 has this garbage collection party every time it updates a visualization. speedup is on the agenda as soon as I get some cljs benchmarking infrastructure setup.
20:28mebaran151dnolen: thanks, I throw a ticket up on github
20:28yoklovhm, i think goog.dom adds objects to dom nodes, but i'd have to look
20:29lynaghk`right now C2 just sets directly: (set! (.-c2data $node) datum)
20:30yoklovhrm…
20:30yoklovi'm sure lots of research has been done into dom node gc and the like.
20:31yoklovdo you think that's what it is? or cljs datastructure gc
20:33lynaghk`the GC stuff? I have no idea
20:34ibdknoxwhat is it cleaning up?
20:34lynaghk`I think it may be a lot of intermediate structures
20:35yoklovibdknox: haven't looked too closely at the implementation, but a concern i'd have with the closure approach is that they could prevent the nodes from getting GCed
20:35lynaghk`yeah, I wondered about that to. There's a lot of discussion of that kind of thing in the FRP papers
20:36ibdknoxyoklov: lynaghk`: well if you remove the nodes, but don't remove the data that would be true
20:36ibdknoxbut the point is to work with the data not the dom
20:36ibdknoxassuming you do that
20:36ibdknoxeverything will be GC'd as you'd expect
20:40ibdknoxah I guess I am closing over the elems for the attributes and styles
20:41mebaran151dnolen: I think it actually maybe a lein bug as it seems to bubble up from its shutdown code
20:43gf3Is Alex Osborne in here?
20:43gf3aka ato on Github
20:44amalloygf3: _ato, but he doesn't talk much
20:44gf3amalloy: Ahh thanks, not sure how I missed that
20:45gf3_ato: ping!
20:47zinn_I'm trying to deploy a war I made with "lein ring war" in Tomcat, and get : ClassNotFoundException: clojure.lang.IFn
20:47zinn_any ideas what I'm doing wrong?
20:48yoklovhrm, anybody using clojurescript head?
20:48yoklovi'm getting an undeclared var warning for not in two places
20:48dnolenyoklov: what lines?
20:48yoklov504 and 515
20:50dnolenyoklov: hmm for not? Even after 'lein cljsbuild clean'
20:52yoklovhm, that fixed it, it looks like it appeared after a few compilations in auto last time too. odd.
20:53yoklovcould have something to do with the fact that i was messing with clojurescript and leiningen versions
20:56zinn_found out I should use 'lein ring uberwar' and never 'lein ring war'. (for the record)
20:56zinn_sorry for being noise :)
21:06brainproxynot sure how to properly use cljs :require to pull in a dependency that's in the same directory as the .cljs file I'm compiling with closure/build
21:06brainproxyhttps://gist.github.com/2606633
21:06ibdknoxbrainproxy: cljs doesn't enforce directory structure
21:07ibdknoxbrainproxy: so it's whatever the ns at the top of your file is
21:08emezeskeibdknox: I have seen very weird problems when the dir structure does not match the ns structure, like compilation succeeding, but only every other time
21:08ibdknoxhm, never seen that
21:08brainproxyibdknox: okay, but I'm not sure how to apply that with respect to changing how I'm invoking :require w.r.t. foo, or renaming foo.cljs or the ns in foo.cljs
21:09emezeskebrainproxy: your paste looks correct to me...
21:09ibdknoxyeah I don't see anything obvious
21:09emezeskebrainproxy: how are you compiling things?
21:10brainproxyemezeske: with a nodejs-backed compile routine
21:10brainproxywhich I'm currently developing
21:10brainproxythe example works if I pull in foo.cljs with nodejs's require
21:10emezeskebrainproxy: are you ultimately invoking closure/build?
21:10brainproxyemezeske: yes
21:11emezeskebrainproxy: And when you call closure/build, you pass it the name of the directory containing both cljs files?
21:11brainproxyno, just the filename hello.cljs
21:11brainproxywhich may be my problem
21:12brainproxybut I thought maybe it would pick up foo.cljs automatically since it's spec'd as a :require dependency
21:12emezeskethat would work, but only if the parent directory is on the classpath
21:12brainproxyi see
21:12emezeskethe compiler will read files as java resources, which can come from anywhere on the classpath, and in that case, the ns layout *must* match the dir layout
21:12brainproxycan I massage the classpath from within clojurescript?
21:13brainproxyif not, it's fine, I can do it from nodejs
21:13brainproxynvm, the first question is dumb
21:13emezeskemaybe from the clojure code that calls closure/build
21:13brainproxy:)
21:13emezeskeprobably difficult to do, though, and painful
21:20brainproxyemezeske: was easy.. just pushed `process.cwd()` onto the class path
21:20brainproxynow it works :D
21:21brainproxythanks for the tips, really really appreciated
21:21brainproxyprocess.cwd is a node thing
21:25yoklovI think I remember there was some syntax for instantiating records from maps?
21:27yoklovmap->Record ?
21:27yoklovor actually I can just use the fancy reader syntax, can't I
21:27lynaghkyoklov: yes, when you defrecord a constructor is also made that takes a map
21:28lynaghkso if you (defrecord A [x y]) then you'll be able to (map->A {:x 1 :y 2})
21:28yoklovHrm. that should work in cljs too, right?
21:29yoklovyeah it does, needed to refresh
21:30mjaukaloI want to convert a list of bytes to a vector of bytes with vector-of. How do I splice the list into the vector-of? (vector-of :byte a-list-of-bytes-that-should-be-spliced).
21:32tomoj(into (vector-of :byte) a-list-of-bytes-that-should-be-spliced)
21:33mjaukalotomoj: Thanks!
21:33xeqi,(apply vector-of :byte (list 0 1 2 3 4 5))
21:34clojurebot[0 1 2 3 4 ...]
21:34tomojah, that was my first thought, but vector-of in this repl only takes one arg
21:34tomoj1.2.1
21:55Licenser*g*
22:08mlozano1odd
23:47Bretzkydoes anyone have any suggestions in regards to getting a proper dev environment up on win7?
23:47FrozenlockI'm trying to use the JSON libary cheshire. Here is what I get when trying to use it in a namespace: class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B
23:47Frozenlock [Thrown class java.lang.VerifyError]
23:47FrozenlockHelp? :P
23:48FrozenlockBretzky: I'm on Win7, any particular question?
23:48Bretzkynot really, just a general getting started
23:49Bretzkyw/ leiningen
23:49FrozenlockHmm I've written this (for my own poor memory) http://frozenlock.org/2012/03/06/clojure-on-windows-7/
23:49FrozenlockPerhaps it can help you
23:50FrozenlockI've never tried Lein2 however
23:50Bretzkyyeah
23:51BretzkyI dl'd 1.5.2 a while back, and now I'm tryingt o upgrade to no avail
23:51Bretzkyfigured starting over would help
23:51Bretzkybut nope, it still keeps downloading the 1.5.2 jar even w/ 1.7.1 specified
23:51Bretzkythe tutorial I'm trying to follow is using lein2 on osx
23:51Bretzkymakes me want to switch to osx for a dev environment
23:52FrozenlockEwwwww
23:52FrozenlockI'll go on Linux before that :p
23:52Bretzkylinux takes a lot of work to customize imo
23:53FrozenlockBretzky: 1.5.2 works fine for me btw. Is there a plugin you want to use which isn't compatible?
23:53Bretzkywell, I've been trying to use pprint
23:53Bretzkyand I can't seem to get that into my dependencies properly
23:53Bretzkylooks like it's included as a plugin in lein2
23:53Frozenlockweird, pprint wokrs fine for me.
23:54Bretzkyyou can just do (pprint resource) ?
23:54FrozenlockAre you using emacs/slime?
23:54Bretzkyno
23:54Bretzkyjust sublime text 2
23:54Bretzkyand cygwin for bash
23:54FrozenlockWell in the repl: (use 'clojure.pprint)
23:56FrozenlockNever used sublime text 2. Do you have access to the repl with it?
23:56Bretzkythrough a plugin, yeah
23:56BretzkyI just use lein repl though
23:58FrozenlockIn a command window?
23:58Bretzkyyeah
23:58FrozenlockWow... I envy your courage :)