#clojure log - May 05 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 ibdknox: technomancy: running off of cljs master

0:00 technomancy: hm; you could maybe just add something to :source-paths

0:03 ibdknox: I think I tried that and it did bad things

0:03 I'll give it a go again though

0:03 technomancy: what you really want is a checkout dependency, right?

0:03 it's just that you can't do it for cljs since it's not a lein project?

0:03 maybe dump a fake project.clj in there?

0:04 ibdknox: not a bad idea

0:04 I had that at one point and then nuked it

0:05 technomancy: hugod 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

0:06 since it would pretty much just be clojure and cljs

0:06 and maybe gradle?

0:10 mdeboard: god wtb emacs-in-clojure :(

0:11 everything is hard

0:11 w/ elisp

0:25 mmarczyk: technomancy: failure-expected-here-dont-freak-out :-D

0:25 technomancy: thanks for that, stopped in the middle of freaking out :-)

0:26 technomancy: do you want a pull req for the bluuugh thing or do you want me to push to master

0:26 mdeboard: Want to pair this up with https://github.com/lynaghk/c2

0:26 er

0:26 Want to pair https://github.com/lynaghk/c2 up with Cascalog output

0:33 mmarczyk: hm, 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.

1:23 leo2007: How to use `lein plugin install <something> ..' to install the latest snapshot version of something?

1:28 _KY_: Do I need many "doall"s for a series of nested "for"s, or just one "doall"?

1:35 mdeboard: leo2007: Are you coming from ruby/python world

1:36 leo2007: 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

1:46 amalloy: _KY_: if you have many nested fors, especially of the sort you feel you need to doall, you can probably simplify your approach radically

1:47 _KY_: Like how?

1:49 spjt: Is there any way to make lein use symbolic links?

1:50 seems kind of ridiculous to have every project hold a separate copy of the libs

1:51 amalloy: _KY_: for example, by generating flatter sequences, or using doseq instead of for, or reducing side effect

1:51 _KY_: 1) doseq doesn't collect

1:52 2) I already use concat inside the "for"s to flatten results

1:52 amalloy: uhoh

1:53 _KY_: But flattened could still be lazy, right?

1:53 amalloy: are you aware that for takes multiple binding pairs? ##(for [x [1 2 3], y '(a b c)] [x y]), for example

1:53 lazybot: ⇒ ([1 a] [1 b] [1 c] [2 a] [2 b] [2 c] [3 a] [3 b] [3 c])

1:53 amalloy: you can surely use that instead of having multiple nested fors with concats

1:55 for example, a worse way to write that would have been ##(apply concat (for [x [1 2 3]] (for [y '(a b c)] [x y])))

1:55 lazybot: ⇒ ([1 a] [1 b] [1 c] [2 a] [2 b] [2 c] [3 a] [3 b] [3 c])

1:57 _KY_: Ah right...

1:59 I want to squeeze a "let" between 2 for's

1:59 amalloy: you should read the docs for for

2:00 &(for [x [1 2 3] :let [y (inc x)], z [y x y]] [x y z])

2:00 lazybot: ⇒ ([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])

2:01 _KY_: "For" is very hard to search on the net =[

2:01 amalloy: &(doc for)

2:01 lazybot: ⇒ "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

2:02 amalloy: $google clojuredocs

2:02 lazybot: [ClojureDocs - Community-Powered Clojure Documentation and ...] http://clojuredocs.org/

2:02 _KY_: The result doesn't have "for":

2:02 http://clojuredocs.org/search?x=0&y=0&q=for

2:04 Well, "for form" does it...

2:04 amalloy: haha um...the actual search button is really bad, i think

2:04 but if you type "for", the autosuggest is good

2:06 _KY_: Thanks a lot... it reduced a lot of indents =)

2:12 leo2007: mdeboard: no

2:12 mdeboard: but i never used java

2:14 _KY_: I did (let [answer (first lazy-seq)] ..., does it ensure the first element is evaluated and stored as answer?

2:15 amalloy: indeed

2:16 _KY_: I mean "my-lazy-seq"

2:17 Ok=)

2:22 mlozano: just saw the clojuredocs.org reference ... would be nice to see it on: http://dochub.io/

2:22 perhaps I should get on that

2:23 wei_: how would I rewrite this java snippet in Clojure? new TrustManager[] { tm }

2:24 mlozano: cshell ... clever

2:24 wei_: more context: I'm translating this to clojure https://gist.github.com/2600263

2:26 noidi_: wei_, (into-array [tm])

2:26 ,(doc into-array)

2:26 clojurebot: "([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."

3:09 muhoo: is there any way to get just the top level of a tree?

3:09 _KY_: Maybe (first tree)?

3:09 Raynes: A ladder.

3:10 Thank's folks, I'm here all week.

3:10 _KY_: I'm trying to (catch java.util.concurrent.CancellationException every) but it doesn't work, any idea?

3:11 s/every/e

3:12 wei_: noidi_: thanks, that worked

3:15 Could you help me figure out where this IllegalAccessError is coming from? The stacktrace isn't being very helpful: https://gist.github.com/2600542

3:16 _KY_: (Oh I found out it's something else throwing the exception...)

3:16 muhoo: i think the magic answer is "breadth first", however, not sure how to do that in clojure yet

3:16 mlozano1: Oh has lots of arguments

3:21 noidi_: wei_, perhaps the class IOConnection has private or default (package private) visibility?

3:23 or maybe the method setDefaultSSLSocketFactory is private/protected

3:25 wei_: oh, you're right! there was another (public) class to access it from

3:30 _KY_: ,(doc ~)

3:30 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>

3:32 amalloy: muhoo: i think the first thing you have to do is decide/define what you mean by (a) tree, and (b) "just the top level"

3:33 eg, if the tree is a seq of seqs, such as (a (b c) (d (e f))), then the top level is the whole tree

3:35 _KY_: (I see... ~ is unquote)

3:38 amalloy: or 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

3:54 muhoo: amalloy: ah, thanks

3:55 amalloy: i practically went to a special school just for complaining the problem is ill-defined

3:56 so gimme a call if you need me to do that

5:18 muhoo: Raynes: https://www.refheap.com/paste/2577 ahem www

5:19 amalloy: this is what i was on after: https://www.refheap.com/paste/2578

5:22 that's for a vector-zip

5:31 Raynes: muhoo: ...?

5:32 muhoo: The forced www is on purpose.

5:32 muhoo: https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords

5:33 muhoo: i know, i patched refheap.el to use www

5:33 Raynes: Oh.

5:33 See, I didn't actually look at the paste.

5:33 Bahaha.

5:33 muhoo: if i cover my eyes, then you can't see me

5:34 Raynes: muhoo: Want something to do?

5:34 Not necessarily now, but perhaps when you're bored.

5:36 muhoo: 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

5:37 I'll add the www to refheap.el in the morning. Me go nitenite.

6:22 _KY_: I call empty? on a lazy seq it got an error, why?

6:23 noidi_: has anyone built counterclockwise from source recently?

6:23 AimHere: What error, _KY_?

6:24 _KY_: Don't know how to create ISeq from: java.lang.Boolean

6:24 noidi_: 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

6:24 AimHere: You sure the thing you're calling empty? on is a sequence?

6:25 _KY_: Yes

6:25 type is clojure.lang.LazySeq

6:25 AimHere: What'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

6:26 noidi_: 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

6:26 Licenser: Or the thing that handles what comes out of empty? is trying to handle a seq?

6:27 Borkdude: I'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.

6:27 AimHere: I think I already said that, but maybe it needs saying twice ;)

6:40 muhoo: wow. it's taken me 10 hours today to understand clojure.zip, and i think i've just about got it.

6:40 must. sleep. now.

6:41 Licenser: hey 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 :(

6:42 bradwright: Chrome

6:43 Licenser: bradwright is it worht it?

6:43 fliebel: Safari

6:46 Licenser: now I need a third person saying safari or chrome so I can get an vote that isn't balanced :P

6:46 great tahnk you

6:46 :P

6:46 piecyk: chrome! :P

6:47 Licenser: piecyk thank you! you saved my day :)

6:48 bradwright fliebel thanks for your oppinions

6:50 bradwright: I find Chrome to be very stable with lots of tabs

6:50 Less RAM hungry than Firefox as well

6:53 * Licenser nods

7:03 _KY_: Does my REPL have trace built in?

7:03 It's just clojure-1.3.0

7:23 bobry: is it allright to ask clojure-script related questions here?

7:25 AimHere: Yes

7:29 _KY_: How can I create a lazy sequence from a function?

7:30 Suppose the function returns 1,2,3,4,... on each successive call

7:47 Borkdude: _KV_ : http://clojuredocs.org/clojure_core/clojure.core/lazy-seq

7:51 _KY_: But I have a function that returns values, not a seq initially

7:53 Borkdude: ah, then you need a closure

7:53 raek: _KY_: is the seq infinite?

7:53 Borkdude: (let [counter (atom 0)] (fn [] (swap! counter inc) @counter))

7:53 _KY_: Let's say the function is "take"

7:53 (take) ==> 1

7:54 (take) ==> 2

7:54 And so on...

7:54 raek: well, there's 'repeatedly'

7:54 Borkdude: _KY_ try my function

7:54 raek: ,(repeatedly #(rand-int 10))

7:54 _KY_: I see...

7:54 clojurebot: (8 3 2 2 7 ...)

7:55 Borkdude: _KY_K: http://cljbin.com/paste/4fa512c7e4b018b49dfc3fc6

7:55 raek: but if you want it to end, you need to write a function that returns the lazy seq

7:56 _KY_: Can I write (repeatedly (my-func)) and get a lazy seq?

7:56 AimHere: "repeatedly", and "iterate" turn functions into sequence

7:56 raek: _KY_: (repeatedly my-func)

7:56 returns a lazy-seq that will call my-func to generate each element (on demand)

7:57 Borkdude: _KY_ I guess so, but why would you do it this way… (range) already represents a lazy list of integers

7:57 _KY_: Ahhh works now =)

7:57 I have a special my-func... that must be used

7:57 Borkdude: _KY_ for side effects?

7:58 _KY_: Yes it changes its output every time it's called

7:58 AimHere: Whatever you're doing sounds a tad nonidiomatic ;)

8:00 Borkdude: grrr. now Eclipse ccw doesn't even start a repl anymore, it's driving me crazy :(

8:11 _KY_: AimHere: I'm calling some java library that returns external stuff

8:13 leo2007: is there a fork of swank-clojure that fixes issues in fuzzy completion?

8:16 raek: _KY_: https://gist.github.com/2601906

8:17 this is an example on how to implement a finite lazy-seq backed by a stateful java object

8:19 _KY_: Thanks.. but "repeatedly" answered my needs already =)

8:19 There is fuzzy completion?

8:19 Sounds very sophisticated =)

8:22 leo2007: it is broken

8:22 raek: leo2007: is there an issue for it?

8:23 Borkdude: I am supposed to do a "run as clojure application (preload file)" before I can do a "load file in REPL" in ccw 0.8?

8:24 cemerick: poke

8:25 leo2007: raek: a few

8:28 cemerick: Borkdude: hrm?

8:29 Borkdude: see question before the poke

8:29 cemerick: see question before the poke… when I do "load file in REPL" there not a REPL coming up anymore

8:30 cemerick: Run As> Clojure (preload file) still works though

8:34 cemerick: I still haven't got leiningen support working, installed completely new eclipse, new workspace, etc… it works in my Windows XP VM though

8:34 cemerick: for now I'm giving up, don't know what is causing this wonkyness… :(

8:37 cemerick: Borkdude: loading a file to start a REPL works here

8:38 I 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! ;-)

8:40 cshell: wow, this feels like deja vu - the same conversation 24 hours later - thought something was messed up with my irc client ;)

8:44 Borkdude: cshell: this totally means I've spend too much time on this now

9:00 cshell: Borkdude: You could switch to Intellij :)

9:01 Borkdude: cshell: I was using emacs before, the reason I'm using eclipse is because my students are more familiar with it

9:02 cshell: I like it though, except for this quirky behavior I'm getting

9:02 cshell: Borkdude: Understandable - were you ever able to get lein to run from the command line?

9:02 Borkdude: cshell: yes, works great

9:03 cshell: with lein2 I'm now also able to connect to an nrepl that was started from eclipse, nice feature

9:03 cshell: cshell: that is cool, I didn't know that

9:43 Borkdude: can you destructure on a map of which you expect only one key-value pair, but don't know the keyname?

9:44 something like this: (let [[k v] {:b12 \X}] k), but then something that works

9:45 gfredericks: &(let [[k v] (seq {3 4})] [k v])

9:45 lazybot: ⇒ [[3 4] nil]

9:45 gfredericks: oop

9:45 &(let [[[k v]] (seq {3 4})] [k v])

9:45 lazybot: ⇒ [3 4]

9:45 gfredericks: there it go

9:46 so if you wanted something slicker than that then I think the answer is no

9:46 Borkdude: gfredericks: yes, but one cannot use this in a function I assume, because you need to wrap the map in a seq first?

9:46 gfredericks: ah ha

9:46 righto

9:46 yeah no way to do that; you have to admit it's a weird use of maps

9:46 not very mappy

9:46 Borkdude: gfredericks: I admit

9:48 gfredericks: reason why I ask is this function: https://github.com/Borkdude/tictactoe/blob/master/src/tictactoe/views/tictactoe.clj#L52

9:48 gfredericks: it always expects a map with only one key, actually I'm only interested in the key, not even the value

9:50 gfredericks: oh it's a form with a bunch of submit buttons?

9:50 Borkdude: gfredericks: right, and each submit button has a unique id

9:50 gfredericks: which I'm decoding in this function, to discover which one has been pressed

9:52 gfredericks: Borkdude: I guess the only alternative I could suggest is use a separate form (and route) for each button

9:53 Borkdude: gfredericks: I'll stick with this then

10:30 natsu: hi. i am a newbie trying to set up leiningen on my machine. i am using windows 7.

10:32 trying to run lein gives me this error: http://pastebin.com/7Zs2x84y. i tried with both cmd and cygwin.

10:33 TimMc: &(let [[[k v]] {3 4}] [k v])

10:33 lazybot: java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap

10:33 TimMc: Aha.

10:36 _KY_: Can I use NetBeans to open a project created by lein? how?

10:42 jondot1: hi all. what is a commonly used documentation guideline with clojure?

10:42 such that I can also generate documentation from

10:44 TimMc: jondot1: Docstrings. Everywhere.

10:44 You can't go wrong with that.

10:45 jondot1: would that be the equivalent of, say, Ruby's tomdoc?

10:45 TimMc: No idea.

10:45 Beyond 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:45 raek: natsu: which version of lein are you installing?

10:46 natsu: have you run `lein self-install`

10:46 dnolen: mmarczyk: ping?

10:48 natsu: raek: thanks for the response. this should answer the q's.

10:48 raek: lein self-install "$home\.lein\self-installs\leiningen-2.0.0-preview3-standalone.jar" already exists. Delete and retry.

10:55 raek: natsu: can you verify that that file is actually a jar file? you should be able to open it as a zip file.

10:55 natsu: raek: yes it is. even extracted it.

10:55 raek: ok, weird

10:57 natsu: have you tried installiing it through the shell script (rather than the windows batch file) in cygwin?

10:58 natsu: raek: yes. same issues. :(

10:59 raek: have you tried the stable 1.7.1 version?

11:00 also, does your home directory path contain spaces or non-ascii characters?

11:01 natsu: one thing you could check is whether %HOMEPATH% points the place there the .lein directory is

11:02 this could be an issue with environment variables

11:02 natsu: yes it does.

11:03 raek: but you got the exact same error with both lein.bat in cmd and lein in cygwin?

11:04 natsu: raek: yes

11:04 lein command gives this error

11:04 F:\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:05 doesnt seem to be handling whitespaces properly.

11:06 raek: natsu: have you installed QT bindings for Java?

11:07 natsu: raek: yeah the zip is there on the path.

11:07 raek: I think the installer for the Java QT bindings did something wrong

11:08 natsu: is there a CLASSPATH env variable or someting that have these paths in it?

11:08 natsu: there is a qtjava variable, set to: C:\Program Files\Java\jre6\lib\ext\QTJava.zip

11:09 raek: I 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:09 natsu: try adding quotes around the value of that env variable

11:11 natsu: raek: tried. doesnt work.

11:17 raek: putting classpath variable in quotes made it work. (cfa suggested that.) thanks so much!

11:22 raek: natsu: 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:23 natsu: raek: no other classpaths have quotes around them. this one didnt either.

11:26 raek: hrm

11:30 jondot1: cemerick/friend take on warden is really interesting

12:19 yoklov: its sort of annoying that things need to be namespace qualified to use derive

12:25 lynaghk: Any emacs wizards have a suggestion on how to delete trailing whitespace in my buffer except in docstrings?

12:36 yoklov: lynaghk: does whitespace-cleanup end up applying to docstrings?

12:37 lynaghk: yoklov: yep.

12:37 yoklov: damn.

12:38 lynaghk: I 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:38 yoklov: ouch

12:38 lynaghk: Seems like a good enough plan for me.

12:39 yoklov: still is a pain and seems a bit kludgey

12:40 at least, you'll end up implementing part of whitespace-cleanup

12:40 lynaghk: yoklov: I'm pretty sure most of what's inside emacs is pain and kludge.

12:43 yoklov: haha, yeah, there's always the possibility that that's the most idiomatic way to do it

12:43 or something.

12:59 samrat: hi, is anyone else here using vimclojure? \eb doesn't seem to be working for me.. don't know why

13:02 I 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:46 ibdknox: I'm adding data-binding to crate :)

13:54 yoklov: data binding?

13:55 ibdknox: like http://en.wikipedia.org/wiki/Data_binding or something else?

13:56 ibdknox: yoklov: for example (defpartial t-html [v] [:p (bound v identity)])

13:56 assuming v is an atom

13:56 anytime the atom's value is changed

13:57 the text of that paragraph tag will too

13:57 yoklov: thats pretty awesome.

13:57 ibdknox: not through re-rendering but throw attribute manipulation

13:57 I'm adding it for styles and normal attrs now

13:57 so you'll be able to do

13:58 [:p {:class (bound v my-class-maker)} (bound v text-getter)]

13:58 and everything will just be magic :)

13:58 yoklov: yeah, thats pretty awesome

13:58 and relevant to what i'm doing :)

13:58 ibdknox: me too

13:58 lol

13:59 yoklov: sort of not that far from FRP i think either

13:59 but yeah that's really quite awesome.

14:00 ibdknox: it's surprisingly easy to add

14:00 yoklov: yeah?

14:01 ibdknox: yeah

14:01 40 lines?

14:01 maybe

14:01 yoklov: wow

14:01 ibdknox: working with actual dom objects instead of strings = huge win

14:02 yoklov: makes sense

14:10 lynaghk`: ibdknox: people will explicitly pass in things implementing IWatchable and you'll handle updating attributes for them?

14:11 ibdknox: I made my own protocol because I needed a value function

14:11 but yes

14:11 more or less :)

14:11 lynaghk`: What about when the values are transformed in the view

14:11 ibdknox: what do you mean?

14:11 lynaghk`: e.g. {:background-color (color-scale v)}

14:12 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:12 ibdknox: it would be written as {:background-color (bound v color-scale)

14:12 }

14:13 you pass the value generating function

14:13 which gives you lots of freedom

14:13 lynaghk`: I was wondering if there'd be a way to make the bindings implict

14:13 ibdknox: maybe

14:13 I don't mind them being explicit right now :)

14:13 lynaghk`: via some kind of macroexpansion that walks the hiccup vector and wraps forms that contain IWatchables

14:13 ibdknox: I thought about it

14:14 but you'd need to know that at compile time, I didn't know that information was available

14:14 lynaghk`: yeah, that's the biggie.

14:14 well, that and macro-black-magic.

14:14 ibdknox: yeah

14:15 lynaghk`: So you are planning to maintain and extend Crate?

14:16 ibdknox: yeah, I need it for Light Table

14:16 lynaghk`: I'd like to be able to rip the DOM manipulation stuff out of C2 and rely on another CLJS DOM library

14:16 ibdknox: well crate is only dom creation really

14:16 and now this binding stuff

14:17 doesn't include things like append

14:17 lynaghk`: how do people use their newly created doms?

14:18 ibdknox: I use jayq

14:18 lynaghk`: oh, so crate actually renders into the html string?

14:18 or do you return live detached DOM nodes?

14:19 ibdknox: live detached dom nods

14:19 nodes*

14:20 lynaghk`: is this binding stuff pushed anywhere public?

14:20 ibdknox: one difference from what you want I think though is that I'm making the assumption of atoms all the way down

14:20 right now

14:21 but that's just because I implemented it in the past 30 minutes

14:21 and sure, let me push it

14:22 lynaghk`: yoklov: https://github.com/ibdknox/crate/commit/0f1aae63afeda370af944082775f339af8e943ab

14:24 lynaghk`: ibdknox: you can use gensym if you need unique ids, btw.

14:24 ibdknox: ah

14:24 that's a good idea

14:24 the add-watch keying is kind of annoying

14:24 nice when you need it

14:24 lynaghk`: 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:25 ibdknox: yeaaah

14:25 lynaghk`: Why bindable protocol? If you need value you can extend ideref and then get to use @

14:26 ibdknox: I 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:26 I don't have a strong argument either way

14:27 lynaghk`: Chris, Stuart Halloway sheds a tear for every new method you add to a protocol. You know that.

14:27 ibdknox: lol

14:31 the 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:32 the way this works right now the outer collection would need to be an atom as well

14:32 and it's not doing diffing

14:33 so there's definitely more work to be done to be more idiomatic - this feels backboney

14:34 lynaghk`: ibdknox: hmm, so if I'm reading this correctly you are creating a closure for each element and bindable attribute

14:34 ibdknox: yes

14:34 lynaghk`: so after it has been rendered all of the pieces take care of themselves.

14:34 ibdknox: yup

14:35 lynaghk`: 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:35 ibdknox: yep

14:35 I think how I did it is how it is traditionally implemented

14:35 buuut

14:35 lynaghk`: 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:36 ibdknox: yeah, like I was saying it suggests a more un-clojurish way of keeping your data

14:36 I don't usually have collections of atoms

14:36 I have an atom with collections in it

14:37 lynaghk`: Right, and it looks like there's no way to match existing nodes with logical nodes.

14:38 ibdknox: yeah, there's no coordinating piece. Usually there isn't

14:39 we tried building the coordinating piece into backbone at RFZ

14:39 worst mistake we made

14:39 should've handled it the way it was meant to be

14:39 lynaghk`: What do you mean coordinating?

14:39 yoklov: yeah, I had been wondering about the atom of collection vs collection of atoms thing

14:39 lynaghk`: syncing collections with collections of dom nodes?

14:40 ibdknox: lynaghk`: 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:40 and it's very slow

14:40 but our data was structured that way

14:41 we worked on a collection of things and changed within it, not on individuals that changed

14:41 unfortunately that worked very poorly for UI

14:42 lynaghk`: ibdknox: that sounds about right---trying to sync nested collections is probably going to be confusing/slow.

14:42 ibdknox: so one way to handle this

14:42 would be to have sub-bindings

14:43 I think you can effectively simulate the same thing if you use those

14:43 but I haven't thought through it long enough

14:44 lynaghk`: well if you need an excuse to come visit sunny sunny Portland and do some thinking over beers, let me know.

14:44 ibdknox: :)

14:44 I'll probably take you up on it at some point

14:44 lynaghk`: ibdknox: actually, I'm going to be down at Stanford May 15--17 if you want to grab lunch or something.

14:45 ibdknox: That might work, what are you heading down there for?

14:45 lynaghk`: lil' holiday, pretty much. visiting a friend of mine at the business school there

14:46 ibdknox: ah nice

14:54 lynaghk`: 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:11 Frozenlock: I'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:11 xeqi: Frozenlock: are you writing on a different thread?

15:11 Raynes: http://pledgie.com/campaigns/17303 Working on raising a little money to support refheap for the next year. Any contributions are much appreciated.

15:12 * Frozenlock facepalms

15:12 Frozenlock: Brb

15:13 muhoo: Raynes: 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:13 esepcially for a one-off-thing i'd paste

15:13 Raynes: muhoo: That sounds fair. Thanks for thinking that through for me.

15:13 muhoo: maybe that assoc could move from the client to the server?

15:13 lynaghk`: Raynes: Keming Labs will cut you a cheque for that amount. Send me an email.

15:14 Frozenlock: xeqi: 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:14 muhoo: if the api supported being fed an emacs-mode instead of extension or language, that massive assoc could be removed from refheap.el

15:15 Raynes: lynaghk`: Could you PM me an address?

15:15 dnolen: mmarczyk: ping?

15:16 lynaghk`: Raynes: ugghh I have no idea how to use emacs IRC. it's kevin at keminglabs dot com

15:16 Raynes: lynaghk`: Your query worked!

15:16 You know more than you think apparently.

15:16 :D

15:18 Cyrik: is there some way to implement a custom hashCode method on a record?

15:18 mmarczyk: dnolen: pong!

15:19 dnolen: I'm seeing some fantastic perf w/ your new commits

15:19 :-)

15:20 natsu: raek: the issue has popped up again.

15:21 raek: i believe it's a lein issue. https://github.com/technomancy/leiningen/issues/541

15:25 Raynes: muhoo: The associations could be moved to the server, but Emacs modes are way to domain specific.

15:25 muhoo: Mostly, we just need to make sure that the modes are in sync with the current language offering.

15:25 I know that I have at least added Elixir to the languages recently, but Emacs doesn't have a mode for that...

15:26 natsu: raek: hmm. this worked: https://github.com/technomancy/leiningen/blob/1.x/bin/lein.bat.

15:26 Raynes: Because I can't get technomancy interested and he is the only person on the planet who knows how to write an emacs mode.

15:27 muhoo: hehehe

15:27 i've never written one, but i've spelunked around in them

15:28 ask on #emacs maybe

15:29 as 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:29 dnolen: marchdown: yes!

15:29 oops

15:29 mmarczyk: yes!

15:30 mmarczyk: :-)

15:30 this is absolutely fabulous

15:30 gf3: Raynes: Y U HAET CLJBIN

15:30 mmarczyk: the 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:30 wjw.

15:31 Raynes: gf3: :p

15:31 gf3: WHYYY

15:31 Raynes: gf3: Competition, bro.

15:31 :)

15:31 dnolen: mmarczyk: yes, no loss for PV now :)

15:31 mmarczyk: :-)

15:32 * gf3 picks Raynes up over his head and throws him into a different channel

15:32 lynaghk`: Raynes: don't you need to swap out that mongo nonsense for Datomic?

15:32 so one-off pasties can LIVE FOREVER.

15:32 Raynes: lynaghk`: I'm looking into other databases. Not sure datomic would be my best option though. More damned expenses.

15:33 muhoo: Raynes: it's free for "development only" use, wink wink

15:33 Raynes: muhoo: Right, but you still have to pay for amazon crap, right?

15:33 muhoo: apparently there's a postgres back-end, which would prolly work nicely on heroku's free postgres db

15:33 lynaghk`: It's free for open source, yeah? But there's still the infrastructure overhead

15:33 Raynes: It is free for open source, indeed.

15:34 If it works with postgres that would be an option.

15:34 mmarczyk: dnolen: so now I'm thinking about extending this to non-core protocols and extend-type

15:34 muhoo: there are a few back-ends. one in-memory, a flat file IIRC, a postgres "development only" backend, then that amazon stuff for "production"

15:34 Raynes: I actually applied for refheap a while back but never went completely through with the sign up.

15:34 muhoo: i really want to play with datomic, but atm i'm deep in couchdb land

15:34 mmarczyk: dnolen: 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:36 hm...

15:36 Raynes: Yay! Pledgie closed.

15:37 mmarczyk: Raynes: pledgie?

15:38 Raynes: mmarczyk: http://pledgie.com/campaigns/17303

15:38 I was raising money for refheap hosting over the next year.

15:38 Cyrik: is there some way to implement a custom hashCode method on a record?

15:38 eggsby: so core.match works well w/ cljs?

15:38 brainproxy: dnolen: good news .. I've got node-clojurescript working for the most part

15:38 muhoo: gf3: lol https://github.com/gf3/CLJBIN/commit/2bd5b5b2854d0f926da9b114334929668efbe129

15:38 mmarczyk: Raynes: wow, cool!

15:39 gf3: muhoo: THE WORST

15:40 muhoo: Also I'm sure most of my code is not idiomatic, feel free to correct me

15:41 muhoo: the code is fine, the comment was funny. i've been bitten by that too

15:43 Cr8: Raynes:.. that didn't take long =D

15:44 Raynes: Cr8: Well, lynaghk` just offered me the whole original goal… so… yeah, didn't take long. :p

15:44 dnolen: mmarczyk: yes tho I think adding the bit mask later is a minor optimization

15:44 Cr8: ah

15:44 dnolen: mmarczyk: for dynamic stuff like that going up the prototype chain isn't so bad.

15:44 mmarczyk: I'm mostly interested in speed up core here.

15:44 mmarczyk: been thinking more about EmptyList being it's own type and ASeq

15:45 mmarczyk: to speed up cljs.core.seq

15:45 mmarczyk: dnolen: well, it would also mean that non-inline impls of core protocols would get a speedup for new instances

15:46 dnolen: mmarczyk: yes I'm not saying that's not worth pursuing - just more interested in tackling the bigger benefits for everyone.

15:46 mmarczyk: dnolen: sure

15:50 dnolen: mmarczyk: one optimization I'm curious about

15:50 mmarczyk: which you mentioned - protocol bit test in protocol dispatch

15:50 mmarczyk: dnolen: yes

15:51 dnolen: mmarczyk: if bit test passed, called protocol dispatch directly, instead of testing property existence

15:51 mmarczyk: dnolen: exactly

15:51 dnolen: mmarczyk: I'm not sure how much of a boost that will reveal.

15:57 mmarczyk: dnolen: 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:58 dnolen: 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:00 dnolen: 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:00 dnolen: ...and all of a sudden this seems somewhat complicated...

16:01 dnolen: mmarczyk: yeah I'm not sure about that.

16:01 Guest2000: hello all. a dumb question... why => (binding

16:01 [*invocation-user-mandant* "test"]

16:01 (map (fn [_] *invocation-user-mandant*) '(1 2 3)))

16:01 returns (nil nil nil) instead of (test test test)?

16:01 mmarczyk: dnolen: could introduce enough overhead to defeat the purpose :-/

16:01 Guest2000: i mean - instead of ("test" "test" "test")

16:01 mmarczyk: dnolen: alternatively -methods could take a flag meaning "assume direct call will work" and check that first

16:02 dnolen: should expect true iff the thing is a type/record with own impl

16:02 dnolen: mmarczyk: I've thought about this approach as well

16:02 mmarczyk: one problem is checking native JS types

16:03 mmarczyk: dnolen: we're not going to find bit masks on those

16:03 dnolen: so the flag would be false and dispatch would proceed as it currently does (well, hopefully with some other optimizations)

16:04 dnolen: mmarczyk: this stuff is worth exploring but probably in a branch off rt-cljs

16:04 mmarczyk: dnolen: right

16:05 dnolen: mmarczyk: 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:05 mmarczyk: it's already pretty close I think.

16:05 mmarczyk: dnolen: I think it is great as it is

16:06 dnolen: clear win all around

16:06 dnolen: mmarczyk: is the partition stuff just working?

16:06 mmarczyk: dnolen: I think it should, core protocols only

16:06 dnolen: did some sanity checks at the REPL

16:06 dnolen: define a type with just 1 inline core proto impl

16:06 dnolen: then extend-protocol some-other-core-protocol-form-same-partition to that type

16:07 dnolen: happily, both protocols work

16:07 dnolen: mmarczyk: yes the bit test is a fast check, fall backs to the old thing otherwise.

16:07 Guest2000: hello all. i need some help in understanding a weird thing... why

16:07 (binding [*somevar* "test"]

16:07 (map (fn [_] *somevar*) '(1 2 3)))

16:07 returns (nil nil nil) instead of ("test" "test" "test")

16:07 and

16:07 (binding [*somevar* "test"]

16:07 (println *somevar*)

16:07 mmarczyk: dnolen: right, and that does indeed work :-)

16:07 Guest2000: prints of course as expected "test"?

16:07 Can 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:07 dnolen: mmarczyk: excellent well then I'm gonna merge it in! :)

16:08 mmarczyk: dnolen: hah! great :-)

16:08 dnolen: before I dive into anything hairy, I'm going to play with next a bit

16:08 dnolen: ILazySeq as marker interface for things next should explicitly call seq on, basically

16:09 dnolen: (defn next [coll] (when coll (let [r (rest coll)] (if (satisfies? ILazySeq r) (seq r) r)))) or some such thing

16:11 dnolen: mmarczyk: pushed to master

16:11 mmarczyk: dnolen: cool! :-)

16:14 raek: Guest2000: map is lazy. the sequence is not forced until your repl prints it, which happens outside the dynamic scope of 'binding'

16:14 dnolen: mmarczyk: yeah, it seems to strange to me that first is >2X slower than -first

16:15 raek: Guest2000: you have to force the whole sequence within thr 'binding' form, for example like this:

16:15 (binding [*somevar* "test"]

16:15 (doall (map (fn [_] *somevar*) '(1 2 3))))

16:16 features that are based one dynamic scope (such as 'binding' and 'with-open') are easiest to use near the top level

16:16 ibdknox: dnolen: mmarczyk: it sounds like we're getting epic perf wins?

16:16 mmarczyk: dnolen: hm, is it? :-(

16:17 Guest2000: raek - thank you a lot - forgot that part. without your help would have gazed for another 30mins at the screen lol - ty again!

16:17 dnolen: ibdknox: groundwork being laid

16:17 ibdknox: :)

16:17 mmarczyk: :-)

16:18 ibdknox: I dunno if you guys saw, I added data-binding to crate this morning

16:18 dnolen: mmarczyk: yeah, again I'm not sure if that can be avoided?

16:19 mmarczyk: perhaps a simple fact of 2 fn calls not 1.

16:19 mmarczyk: ibdknox: hah! cool :-)

16:19 dnolen: hm, with simple opts and static-fns

16:20 dnolen: mmarczyk: advanced opts

16:30 mmarczyk: dnolen: hm, yeah; I'm not seeing much difference on :simple, on :advanced -- a factor of 2x like you say

16:31 dnolen: of course :simple is like 4.5x slower than :advanced for first (9x on -first -- wow?)

16:34 dnolen: amazingly, satisfies? seems faster on :simple !?

17:31 Frozenlock: Any suggestion for a graph/network drawing library? (graphviz-like)

17:33 meiji11: I don't know, loom?

17:33 I think loom uses graphviz to draw its graphs.

17:35 Frozenlock: Interesting. It requires to have graphviz on the path, but it's better than nothing. Thanks!

17:35 meiji11: you're welcome.

17:44 johnfn: the "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:45 yoklov: johnfn: hotswapping?

17:45 johnfn: i mean using ctrl+c ctrl+c to send in an updated version of a function

17:46 yoklov: ah, no clue, just was curious what you were referring to

17:46 johnfn: oh hmm.

17:51 Raynes: arohner: Oh man. Is this the lazy seq of pages tentacles users have pleaded with the old Gods for for so long?

17:52 arohner: Raynes: yes

17:52 Raynes: You are a gentleman and a scholar.

17:53 arohner: Raynes: glad to be of service

17:55 Raynes: will you be making a release, or should I make my own?

17:56 Raynes: arohner: 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:56 arohner: Raynes: some endpoints aren't there

17:56 I use those in my tests

17:57 Raynes: Okay. 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:57 arohner: sure

17:58 Raynes: Great. One moment.

18:00 arohner: 0.2.0-beta1 is now on clojars.

18:00 arohner: Raynes: thanks

18:03 technomancy: Raynes: elixir-mode exists already bro

18:04 Raynes: technomancy: Nope.

18:04 technomancy: It exists for Elixir's old syntax which has radically changed.

18:04 technomancy: picky, picky

18:04 amalloy: they should try a more regular syntax

18:05 maybe with parens or something

18:05 Raynes: It lives!

18:25 mlozano1: was trying to write a good insertion sort for a list, does this seem reasonable? https://gist.github.com/2605926

18:37 yoklov: mlozano1: insert is the same as cons, i think

18:37 ,[(list 3) (cons 3 ())]

18:37 clojurebot: [(3) (3)]

18:38 yoklov: ,(= (conj () 3) (list 3))

18:38 clojurebot: true

18:39 yoklov: mlozano1: i also think your lists will all end in 'nil'

18:40 "(if (empty? lst) nil" should be "(if (empty? lst) ()" or "(if (empty? lst) lst"

18:40 in scheme and common lisp lists end with nil (null in scheme), but that is not true in clojure

18:41 also i don't think that will sort anything.

18:41 _KY_: Can I use NetBeans to open a project created by lein?

18:42 yoklov: mlozano1: yeah, you don't ever actually sort the list. try instead of (first lst), something like (apply max lst)

18:44 it often helps to write unit tests for your code, or to run some examples on it in the repl

18:47 amalloy: yoklov: clojure's lists end in nil in the same way that CL's and scheme's do

18:47 &(cons 5 nil)

18:47 lazybot: ⇒ (5)

18:47 yoklov: really?

18:47 hm

18:48 ,(= () nil)

18:48 amalloy: ie, they don't have nil as an element

18:48 clojurebot: false

18:48 amalloy: but the last "element/next" pair is nil

18:48 yoklov: ,(rest '(1))

18:48 clojurebot: ()

18:48 yoklov: ,(next '(1))

18:48 clojurebot: nil

18:48 yoklov: huh.

18:49 i 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:51 regardless, 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:51 though his check there is okay

18:52 amalloy: (def next (comp seq rest))

18:52 yoklov: really?

18:52 _weird_

18:52 amalloy: why is that weird?

18:53 yoklov: i would have thought that rest would work in terms of next, if anything

18:53 dunno

18:54 gfredericks: &(next [3])

18:54 lazybot: ⇒ nil

18:55 gfredericks: so next is the more eager one that actually probes the next element

18:55 while rest is the "lazier" one; thus rest could not be defined in terms of next

18:55 amalloy: i 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:55 gfredericks: (defn rest [coll] (lazy-seq (next coll)))

18:55 * gfredericks quits

18:56 yoklov: ^ thats how i thought it worked

18:56 amalloy: but i got halfway through typing out your argument myself before i realized i was wrong

18:56 really they're both implemented in java

18:57 gfredericks: I am a foil used to increase the instructiveness of the conversation

18:57 yoklov: yeah

18:57 amalloy: ISeqs implement .next(), and .more() (which is just a weird name for rest)

18:57 yoklov: hm

19:03 devn: is there a reason why .more is used instead of .rest?

19:03 or is that just a vestigial piece of clojure?

19:10 BostX: hi all

19:13 muhoo: i'm really enjoying this zipper thing http://clojuredocs.org/clojure_core/clojure.zip/zipper

19:13 BostX: guys, 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:13 do you know why?

19:14 Chousuke: devn: vestigial, yes

19:14 muhoo: took 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:15 i 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:16 johnfn: muhoo: i used to do that a lot, and im starting to think that it is.

19:16 i 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:17 muhoo: maybe you should paste some code

19:19 amalloy: i think it's fine, though i usually wind up with a number of nested lets/whens instead

19:19 and i can see how your code would look that way when you're working with zippers

19:21 eggsby: Is anyone here familiar with congomongo? I'm having a weird issue: https://www.refheap.com/paste/2594 (or possibly I'm just confused)

19:22 amalloy: eggsby: i don't know what nuke-collection is, but i suspect it's lazy

19:23 eg, perhaps (defn nuke [] (map destroy! (fetch...)))

19:23 so when you evaluate it for side effects (as in a 'do), none of the elements are ever forced, and nothing happens

19:24 eggsby: ah

19:24 ya that is what I'm doing.. mapping the destroy over the result of fetching the collection

19:25 muhoo: the biggest annoyance i have with zippers is it seems to proliferate NPE's

19:25 amalloy: mongo 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:26 muhoo: if i screw up, it is not very nice about it.

19:26 eggsby: but why would the implementation being lazy cause 'nuke-collection' to never get called amalloy?

19:27 amalloy: 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:28 johnfn: is there some sort of assoc-with-fn function

19:28 amalloy: &(doc update-in)

19:28 lazybot: ⇒ "([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:28 johnfn: aah, yeah that works

19:28 amalloy: eggsby: 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:29 &(do (repeatedly #(println "OMGOMGOMG")) 1)

19:29 lazybot: ⇒ 1

19:29 eggsby: right, until something needs the value of it for some computation

19:29 I think I just misunderstand what do is for

19:30 replaca: eggsby: if you're trying to force the realization of a lazy seq, use doall not do

19:31 eggsby: ah, thank you replaca

19:31 replaca: np

19:32 amalloy: *cough* dorun

19:33 but 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:34 eg, (defn nuke! [] (doseq [{:keys [_id]} (fetch ...)] (destroy! _id)))

19:36 eggsby: hmm

19:36 thank you amalloy, I will try that

19:39 yoklov: so, 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:39 technomancy: yoklov: ibdknox said he was going to write one

19:39 a project.clj file I mean

19:40 muhoo: is there a way to add a string to an Exception after catching it, then re-throw it?

19:41 gfredericks: re-throw the same exception?

19:41 yoklov: technomancy: hm, so should I just go back to using lein1?

19:41 technomancy: it worked in lein1? that's surprising.

19:41 it shouldn't work on projects that don't have project.clj

19:42 yoklov: technomancy: hm, yeah, it doesn't work in lein2

19:43 but just having clojurescript's compiler and core lib in the classpath was enough in lein1

19:43 technomancy: if you want it to work with lein2 you'd need to create a dummy project.clj file for clojurescript

19:43 the fact that it works on lein1 is accidental

19:44 yoklov: yeah, I think I knew that it sort of accidentally worked

19:46 the fix described here: https://github.com/emezeske/lein-cljsbuild/issues/58 doesn't work in lein2, basically.

19:47 how "dummy" would the project.clj file have to be

19:48 muhoo: gfredericks: yeah, but with my text added

19:49 johnfn: amalloy: it *was* a code smell. i refactored it into half as many lines and fewer bugs :-)

19:49 emezeske: yoklov: You don't really need to put the clojurescript checkout in the checkouts/ directory

19:49 yoklov: It could be anywhere from what I understand; as long as you somehow hack its source directories into your classpath

19:49 yoklov: emezeske: yeah, is the fact that i put it there a problem though?

19:49 muhoo: i 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:50 emezeske: yoklov: Well, lein has special handling for things in checkouts/ from what I understand

19:50 technomancy: yoklov: oh right; you can add an entry to your own project's :source-paths

19:50 emezeske: yoklov: If there's a dir in there, lein wants a projec.tclj

19:51 yoklov: technomancy: yeah, i've done that

19:51 hm, trying it with some other folder name

19:51 emezeske: Really, the example shouldn't use the checkouts/ dir, because it's not a checkout (at least in lein's terminology)

19:52 But 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:53 I'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:55 yoklov: yeah, still doesn't work

19:55 i'm still getting an old clojurescript

19:55 emezeske: What does your :source-paths look like?

19:55 yoklov: wait, hold on, they were actually in :resource-paths

19:56 devn: Chousuke: is there any reason why a patch couldn't be accepted to change .more to .rest?

19:57 yoklov: whoops, yeah that made the difference.

19:57 gfredericks: that reminds me of the lava patch

19:59 eggsby: thank you amalloy and replaca I was able to fix my bug and learn a bit about clojure in the process w/ yr help :)

20:02 emezeske: yoklov: 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:06 yoklov: emezeske: yup

20:06 commented with what worked for me.

20:08 emezeske: yoklov: thanks

20:15 ibdknox: lynaghk`: I think I might have something that solves your case but works the way I had mine setup

20:16 yoklov: you might be interested too

20:16 yoklov: oh?

20:16 ibdknox: yoklov: it looks like this: https://www.refheap.com/paste/2595

20:17 lynaghk`: ibdknox: oh yeah?

20:17 ibdknox: it's a bit ugly right now

20:17 buuuut

20:17 it lets you have a single atom

20:17 and does all the right magic to handle propagating changes down

20:17 no walking, all closures handling updates to themselves

20:18 lynaghk`: what do you use for your default key fn?

20:18 lynaghk`: child index

20:18 mebaran151: I'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:18 ibdknox: ah, yeah mine is dumb and doesn't consider ordering yet

20:19 dnolen: mebaran151: might want to ping emezeske

20:20 lynaghk`: ibdknox: what's the {:as aliases} doing? Taking the collection (:aliases n) and passing each element to the aliases partial?

20:21 ibdknox: lynaghk`: yoklov: impl https://github.com/ibdknox/crate/commit/2f816a978ee37c71dc5c98c1268d6b07805926f4

20:21 lynaghk`: yeah, telling it what to represent each one as

20:21 lynaghk`: you could easily wrap a macro around that and make it transparently inline

20:22 lynaghk`: is defpartial just defn?

20:22 ibdknox: with a little more, but fundamentally yeah

20:24 yoklov: act rct and cct are are unrelated to the example?

20:24 ibdknox: they're just little functions to modify the atom

20:24 yoklov: yeah

20:24 lynaghk`: hmm. I'm really interested to see the performance comparison of dom-walking vs. tons-of-closures.

20:25 ibdknox: I'm pretty sure the latter wins on memory, since you have to store the data in the dom, right?

20:26 I 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:27 my*

20:27 yoklov: i'd bet that it would depend on how you walked the dom

20:27 lynaghk`: I'm not sure how memory works when assiging a js object as a dom node property.

20:28 ibdknox: this is a common pattern

20:28 lynaghk`: 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:28 mebaran151: dnolen: thanks, I throw a ticket up on github

20:28 yoklov: hm, i think goog.dom adds objects to dom nodes, but i'd have to look

20:29 lynaghk`: right now C2 just sets directly: (set! (.-c2data $node) datum)

20:30 yoklov: hrm…

20:30 i'm sure lots of research has been done into dom node gc and the like.

20:31 do you think that's what it is? or cljs datastructure gc

20:33 lynaghk`: the GC stuff? I have no idea

20:34 ibdknox: what is it cleaning up?

20:34 lynaghk`: I think it may be a lot of intermediate structures

20:35 yoklov: ibdknox: 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:35 lynaghk`: yeah, I wondered about that to. There's a lot of discussion of that kind of thing in the FRP papers

20:36 ibdknox: yoklov: lynaghk`: well if you remove the nodes, but don't remove the data that would be true

20:36 but the point is to work with the data not the dom

20:36 assuming you do that

20:36 everything will be GC'd as you'd expect

20:40 ah I guess I am closing over the elems for the attributes and styles

20:41 mebaran151: dnolen: I think it actually maybe a lein bug as it seems to bubble up from its shutdown code

20:43 gf3: Is Alex Osborne in here?

20:43 aka ato on Github

20:44 amalloy: gf3: _ato, but he doesn't talk much

20:44 gf3: amalloy: Ahh thanks, not sure how I missed that

20:45 _ato: ping!

20:47 zinn_: I'm trying to deploy a war I made with "lein ring war" in Tomcat, and get : ClassNotFoundException: clojure.lang.IFn

20:47 any ideas what I'm doing wrong?

20:48 yoklov: hrm, anybody using clojurescript head?

20:48 i'm getting an undeclared var warning for not in two places

20:48 dnolen: yoklov: what lines?

20:48 yoklov: 504 and 515

20:50 dnolen: yoklov: hmm for not? Even after 'lein cljsbuild clean'

20:52 yoklov: hm, that fixed it, it looks like it appeared after a few compilations in auto last time too. odd.

20:53 could have something to do with the fact that i was messing with clojurescript and leiningen versions

20:56 zinn_: found out I should use 'lein ring uberwar' and never 'lein ring war'. (for the record)

20:56 sorry for being noise :)

21:06 brainproxy: not 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:06 https://gist.github.com/2606633

21:06 ibdknox: brainproxy: cljs doesn't enforce directory structure

21:07 brainproxy: so it's whatever the ns at the top of your file is

21:08 emezeske: ibdknox: 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:08 ibdknox: hm, never seen that

21:08 brainproxy: ibdknox: 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:09 emezeske: brainproxy: your paste looks correct to me...

21:09 ibdknox: yeah I don't see anything obvious

21:09 emezeske: brainproxy: how are you compiling things?

21:10 brainproxy: emezeske: with a nodejs-backed compile routine

21:10 which I'm currently developing

21:10 the example works if I pull in foo.cljs with nodejs's require

21:10 emezeske: brainproxy: are you ultimately invoking closure/build?

21:10 brainproxy: emezeske: yes

21:11 emezeske: brainproxy: And when you call closure/build, you pass it the name of the directory containing both cljs files?

21:11 brainproxy: no, just the filename hello.cljs

21:11 which may be my problem

21:12 but I thought maybe it would pick up foo.cljs automatically since it's spec'd as a :require dependency

21:12 emezeske: that would work, but only if the parent directory is on the classpath

21:12 brainproxy: i see

21:12 emezeske: the 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:12 brainproxy: can I massage the classpath from within clojurescript?

21:13 if not, it's fine, I can do it from nodejs

21:13 nvm, the first question is dumb

21:13 emezeske: maybe from the clojure code that calls closure/build

21:13 brainproxy: :)

21:13 emezeske: probably difficult to do, though, and painful

21:20 brainproxy: emezeske: was easy.. just pushed `process.cwd()` onto the class path

21:20 now it works :D

21:21 thanks for the tips, really really appreciated

21:21 process.cwd is a node thing

21:25 yoklov: I think I remember there was some syntax for instantiating records from maps?

21:27 map->Record ?

21:27 or actually I can just use the fancy reader syntax, can't I

21:27 lynaghk: yoklov: yes, when you defrecord a constructor is also made that takes a map

21:28 so if you (defrecord A [x y]) then you'll be able to (map->A {:x 1 :y 2})

21:28 yoklov: Hrm. that should work in cljs too, right?

21:29 yeah it does, needed to refresh

21:30 mjaukalo: I 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:32 tomoj: (into (vector-of :byte) a-list-of-bytes-that-should-be-spliced)

21:33 mjaukalo: tomoj: Thanks!

21:33 xeqi: ,(apply vector-of :byte (list 0 1 2 3 4 5))

21:34 clojurebot: [0 1 2 3 4 ...]

21:34 tomoj: ah, that was my first thought, but vector-of in this repl only takes one arg

21:34 1.2.1

21:55 Licenser: *g*

22:08 mlozano1: odd

23:47 Bretzky: does anyone have any suggestions in regards to getting a proper dev environment up on win7?

23:47 Frozenlock: I'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:47 [Thrown class java.lang.VerifyError]

23:47 Help? :P

23:48 Bretzky: I'm on Win7, any particular question?

23:48 Bretzky: not really, just a general getting started

23:49 w/ leiningen

23:49 Frozenlock: Hmm I've written this (for my own poor memory) http://frozenlock.org/2012/03/06/clojure-on-windows-7/

23:49 Perhaps it can help you

23:50 I've never tried Lein2 however

23:50 Bretzky: yeah

23:51 I dl'd 1.5.2 a while back, and now I'm tryingt o upgrade to no avail

23:51 figured starting over would help

23:51 but nope, it still keeps downloading the 1.5.2 jar even w/ 1.7.1 specified

23:51 the tutorial I'm trying to follow is using lein2 on osx

23:51 makes me want to switch to osx for a dev environment

23:52 Frozenlock: Ewwwww

23:52 I'll go on Linux before that :p

23:52 Bretzky: linux takes a lot of work to customize imo

23:53 Frozenlock: Bretzky: 1.5.2 works fine for me btw. Is there a plugin you want to use which isn't compatible?

23:53 Bretzky: well, I've been trying to use pprint

23:53 and I can't seem to get that into my dependencies properly

23:53 looks like it's included as a plugin in lein2

23:53 Frozenlock: weird, pprint wokrs fine for me.

23:54 Bretzky: you can just do (pprint resource) ?

23:54 Frozenlock: Are you using emacs/slime?

23:54 Bretzky: no

23:54 just sublime text 2

23:54 and cygwin for bash

23:54 Frozenlock: Well in the repl: (use 'clojure.pprint)

23:56 Never used sublime text 2. Do you have access to the repl with it?

23:56 Bretzky: through a plugin, yeah

23:56 I just use lein repl though

23:58 Frozenlock: In a command window?

23:58 Bretzky: yeah

23:58 Frozenlock: Wow... I envy your courage :)

Logging service provided by n01se.net