#clojure log - May 10 2012

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

0:02 brehaut: TimMc: w/hat the link to your page about equality partitions?

0:02 cshell: emezeske: nice work

0:04 brehaut: TimMc: dont worry. found it

0:08 emezeske: cshell: Thanks!

0:59 technomancy: so is lein-cljsbuild's repl-listen agnostic of which repl implementation is going to connect to it?

1:06 wei_: how do i insert at the head of a vec? conj adds to the end

1:08 technomancy: wei_: vectors don't work like that; you can't do it without constructing a whole new vector

1:09 ,(into [:newhead] [:a :b :c]) ; <- something like that

1:09 clojurebot: [:newhead :a :b :c]

1:09 wei_: ah thank you. so would that be better than (concat [:newhead] [:a :b :c])?

1:10 technomancy: concat returns a seq, not a vector

1:10 so it depends on what you want

1:10 wei_: into returns a vec and concat a list

1:11 brehaut: into retunrs whatever type of collection is the first argument

1:12 (if we are being pedantic)

1:12 technomancy: we are

1:12 well at least I am

1:12 you guys don't have to be; it's cool

1:12 wei_: i see

1:12 hiredman: the best kind dantic

1:12 wei_: haha thanks

1:13 technomancy: someone plz make M-x imenu work with protocols; kthxbai

1:19 mrakana: I'm having a horrible time finding libraries for Clojure. For instance, the duck-streams library. It was once in clojure-contrib, but now I can't seem to find it anywhere online. Is there any single place I can go to get Clojure libraries, such as Haskell's hackage?

1:19 xeqi: ~contrib

1:19 clojurebot: Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

1:20 mrakana: Thanks.

1:20 xeqi: that will help some, but there isn't a single place for everything

1:22 some are in http://search.maven.org/, some are in http://clojars.org

1:23 brainproxy: just finished putting together a decent README, with some instructions, examples and links to resources

1:23 https://github.com/michaelsbradleyjr/node-clojurescript

1:23 amalloy: mrakana: the functions from duck-streams, in particular, were either merged into clojure.core or clojure.java.io, or thrown away as rubbish ideas to begin with

1:24 eg, slurp is now in clojure.core, but lines was horrible because it meant you couldn't .close the implicitly-opened reader

1:32 robertstuttaford: brainproxy: this is great work, but why would i want to use node.js instead of the jvm to deploy server side clojure?

1:32 just curious about the potential advantages. not poking holes :)

1:34 brainproxy: robertstuttaford: it's more about using clojurescript to develop apps that will be hosted on NodeJS

1:34 e.g. taking adavantage of the node ecosystem of modules

1:34 since use you use both namespaces dependencies and nodejs's require inside clojurescript running on node

1:34 *you can use

1:38 robertstuttaford: please help me: https://gist.github.com/2651249

1:38 going in circles here

1:42 brainproxy, it's really cool. i'm looking at using cljs in the browser, but i want to modularise it: have a base app 'binary' load separately compiled code+data 'binaries' all written in cljs

1:43 i have to figure out how to get cljs to produce externs for all exported symbols so that these binaries can interoperate

1:44 have you had to do anything like this?

1:52 brainproxy: robertstuttaford: not yet

2:20 kovasb_: robertstuttaford: you are throwing away the result of mapping the function

2:21 robertstuttaford: oh wait nm was parsing it wrong..

2:27 flijten: So clojure has dotimes and while macro's. Should I avoid those if I want to work in the spirit of functional programming languages? Since you can map, filter, reduce, group-by on collections (and thus everything) it seems there is always another solution to the "loop macro's"

2:30 alexbaranosky: while is a variation on loop you could say

2:30 and dotimes is a side-effecty function, but sometimes that is exactly what you need

2:32 flijten: there are also for and doseq

2:33 I find it hard to comprehend if I should use them at all or not, since the spirit of the language is that it is without side-effects

2:33 or as little as possible

2:36 bartj: is there a function which returns an infinite list of natural numbers?

2:37 xeqi: (doc range)

2:37 clojurebot: "([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."

2:37 bartj: xeqi, thanks!

2:41 mmarczyk: flijten: for is a list comprehension -- returns a lazy seq of values of its second ("expression") argument for varying values of the locals specified in the first ("bindings") argument; nothing to do with side effects

2:46 flijten: for the others... a first-approximation rule of thumb would probably be to ask yourself if you really need a side effect to happen -- if yes, maybe they can help write the side-effecty code in a pleasant manner, if no (you're implementing an algorithm and thinking of breaking the functional idiom), it's probably worthwhile to think about avoiding them; no hard-and-fast rules though

2:50 are JavaScript constructors -- values of foo.constructor for any non-null, non-undefined foo -- guaranteed to have a non-null, non-undefined prototype? (a sanity check on sth I'm doing with CLJS)

2:54 robertstuttaford: xeqi: thank you very much!

3:05 PeregrinePDX: lein run

3:05 oops wrong window

3:06 robertstuttaford: +++ OUT OF CHEESE ERROR +++

3:08 flijten: mmarczyk: thx for the explanation

3:09 mmarczyk: np

3:21 arohner: top is saying that my jvm is taking 15.2G of virtual ram, but I have -Xmx1024m. Any ideas what could cause that?

3:22 hiredman: which column in top? rss?

3:24 michaelr525: hello

3:24 arohner: hiredman: VIRT

3:24 hiredman: meh

3:24 arohner: hiredman the kernel is OOM killing

3:25 hiredman: on virt?

3:25 could be native memory, memory mapped files, etc

3:25 arohner: right

3:26 hiredman: hook up a profiler?

3:27 arohner: yeah, I will. It's just annoying to set up remotely

3:27 hiredman: you can install visualvm remotely and forward it over x11 (which is easier then forwarding all the java stuff)

3:28 arohner: ooh, they finally packaged it: "sudo aptitude jvisualvm install"

3:29 hiredman: last time I ran in to something like this, I never tracked down the cause, just rewrote the code to not do it, but I suspected it was related to string interning

3:30 arohner: I'd be amazed if I was creating even 100M of strings

4:13 robertstuttaford: is there a way to see how many args a function expects from within the repl?

4:14 i have this func (defn- convert-media-paths [string uuid] (...)) but i'm getting an ArityException when i call it with two strings and i don't know why

4:21 katratxo: robertstuttaford: the uuid param should be a java.util.UUID ? (just guessing)

4:22 Raynes: &(meta #"+)

4:22 lazybot: java.lang.RuntimeException: EOF while reading regex

4:22 Raynes: &(meta #'+)

4:22 lazybot: ⇒ {:ns #<Namespace clojure.core>, :name +, :file "clojure/core.clj", :line 920, :arglists ([] [x] [x y] [x y & more]), :added "1.2", :inline-arities #<core$_GT_1_QMARK_ clojure.core$_GT_1_QMARK_@45d9b1>, :inline #<core$nary_inline$fn__3842 clojure.core$nary_inline... https://www.refheap.com/paste/2675

4:22 Raynes: See the :arglists key

4:22 robertstuttaford: super thanks!

4:23 Raynes: Mega welcome!

4:26 robertstuttaford: it's got something to do with the first param here

4:26 (convert-media-paths "<img src=\"foo.png\">" "uuid")

4:27 does'nt like how i'm escaping it, or something

4:30 matessim: Hey guys, does anyone have a good recommendation on where to learn clojure for a guy coming from Java with a few years of experience?, i've tried the official doc, but it was a bit dry for me.

4:31 robertstuttaford: matessim: http://clojurebook.com/. the end.

4:31 PeregrinePDX: I've been having good luck with Programming Clojure 2nd edition

4:31 robertstuttaford: i've just finished all the non Practicum chapters

4:31 very good book

4:32 matessim: Clojurebook.com != Programming Clojure 2nd edition right?

4:32 not the same books

4:32 PeregrinePDX: No they are not the same book.

4:32 robertstuttaford: correct

4:32 PeregrinePDX: I have heard good things about clojurebook.com as well.

4:32 robertstuttaford: another book i've seen recommended is joyofclojure.com

4:32 matessim: did any of you read both?

4:32 PeregrinePDX: But work has a subscription to prag prog. So it was free for me to get Programming Clojure.

4:32 robertstuttaford: clojurebook.com is newest

4:33 matessim: the Reviews seem pretty damn good on Clojurebook also

4:33 Fullmoon: What Redis library to use?

4:34 wkmanire: Howdy folks.

4:35 anyone awake yet?

4:35 PeregrinePDX: Hello

4:36 wkmanire: Well hell. I was gonna ask a question but I just answered it

4:36 failed to read the docs correctly.

4:37 clgv: wkmanire: It feels better to solve it yourself, doesnt it? :)

4:37 wkmanire: Sure does.

4:37 clgv: only sometimes one regrets if it took too much time for something really - let's say - stupid ;)

4:38 wkmanire: I am that sometimes.

4:38 clgv: been there, as well ;)

4:38 if nothing works, just restart that repl thing^^

4:41 matessim: Ordered Clojure Programming now :), thanks guys.

4:41 should have it in a month or so ^_^

4:42 clgv: ui thats long

4:42 robertstuttaford: kindle?

4:42 i got mine on kindle

4:42 cheaper, and i started reading right away

4:43 matessim: I don't have a kindle :/

4:43 + I live in Israel.

4:43 robertstuttaford: you get kindle apps for all operating systems

4:43 matessim: so that's why shipping will take a bit

4:43 i have a tablet

4:43 but

4:43 i can't read ebooks

4:43 it just kills me

4:43 i can't concentrate on it for some reason, i might get a e-ink reader some day, maybe it will be easier

4:44 robertstuttaford: how do you manage to code, then? #justsayin'

4:44 matessim: i bought the Art of war on e-book edition, tried reading it on my computer, my tablet, ended up just ordering a physical copy

4:44 PeregrinePDX: I had that problem for awhile with ebooks

4:44 matessim: i don't have a problem working with code that way etc, i just prefer having physical copies for books.

4:44 PeregrinePDX: Eventually I managed to push through it.

4:44 matessim: do you read books on your computer?

4:46 wkmanire: weird...

4:46 I'm reading Cemerick's new book on my kindle.

4:46 I love it.

4:46 But i still have to look at the code on the cloud reader.

4:46 clgv: ebooks are only good for searching - paper is better for reading ;)

4:47 wkmanire: (computer), the kindle isn't wide enough.

4:47 To me at least, the kindle reads like paper.

4:47 matessim: well, i don't have a kindle.

4:47 robertstuttaford: reading it on ipad in widescreen, able to read it all just fine

4:48 clgv: I love that the JoC book comes with the pdf version so that I can search easily^^

4:48 matessim: it might be just because i have A.D.D, but i can't read on a screen that has backlighting.

4:48 (read a book, concentrate on page after page after page)

4:48 wkmanire: matessim: Probably that.

4:48 robertstuttaford: ya the light can be a problem

4:48 matessim: i don't have a problem jumping through references and code and irc 12 hours a day, but for reading a book for a hour or two straight

4:48 its a pain

4:49 robertstuttaford: is it possible to do this sort of destructuring (fn [[_ match] … ) in a #(bla) function?

4:50 Borkdude: robertstuttaford: I don't think so, prob. need core.match for it

4:50 wkmanire: i think the difference with readers like the kindle is that they don't refresh constantly.

4:50 clgv: robertstuttaford: only if you include a let form

4:51 robertstuttaford: i've been doing a let form inside a function whenever i want desctructuring. can i just do it right there in the fn's arg vector?

4:51 wkmanire: robertstuttaford: Yes.

4:51 clgv: but then (fn [[_ match] ...] ..) is again shorter than #(let [[[_ match] ...] %] ...)

4:51 Borkdude: ,((fn [[a b]] [a b]) [1 2])

4:51 clojurebot: [1 2]

4:52 clgv: thats lame, let it do sth to prove it worked ;) ##((fn [[a b]] [b a]) [1 2])

4:52 lazybot: ⇒ [2 1]

4:52 Borkdude: hello neotyk

4:52 robertstuttaford: so how would i do it with this func? https://gist.github.com/2651979

4:52 neotyk: hello Borkdude :-)

4:52 bobry: does anyone have any experience with clojurescript one? i can't quite get my head around it -- the 'sample' application is just too simple :(

4:53 MS|Away: Programming Clojure explains the basics of Lisp-based languages right? I've never really got my head around lisp syntax.

4:53 robertstuttaford: MS|Away: clojurebook.com's one does a great job of this

4:53 Borkdude: robertstuttaford: you can't match in a destructure form, only take things apart

4:53 MS|Away: Yeah, clojurebook, thats the book i ordered.

4:53 Borkdude: robertstuttaford: you need core.match for it

4:54 robertstuttaford: bobry: kinda. there's a lot to integrate. domina, state transitions, where code executes, compiled vs repl-controllable

4:54 PeregrinePDX: I've never done any lisp programming.

4:54 robertstuttaford: me neither, before a couple days ago. been reading clojurebook.com for about a week

4:54 PeregrinePDX: I've found doing some of the 4clojure.com problems has helped me immensly.

4:55 clgv: robertstuttaford: you can destructure maps easily with pure clojure

4:55 robertstuttaford: tore through the koans (with help from me old mate google)

4:55 bobry: robertstuttaford: indeed, i wish they had 'projects using cljs one' page in the wiki

4:55 Borkdude: robertstuttaford: maybe you can do it with a nested map destructuring

4:56 robertstuttaford: i have to learn how, first :)

4:56 Borkdude: robertstuttaford: http://blog.jayfields.com/2010/07/clojure-destructuring.html <- search for "nested map"

4:56 clgv: robertstuttaford: ##((fn [{{d :data} :item}] data) {:item {:data 42}})

4:56 lazybot: java.lang.RuntimeException: Unable to resolve symbol: data in this context

4:56 clgv: args^^

4:56 robertstuttaford: :o

4:56 that's hot

4:56 clojurebot: It's greek to me.

4:56 clgv: robertstuttaford: ##((fn [{{d :data} :item}] d) {:item {:data 42}})

4:56 lazybot: ⇒ 42

4:57 robertstuttaford: half the crap i've been writing has been to do exactly that sort of thing

4:57 i'll post a full gist with sample input just now for you all to giggle at

4:57 clgv: robertstuttaford: but be careful not to introduce destructuring in hotspots ;)

4:58 wkmanire: robertstuttaford: Your code can't be worse than mine, I just started learning a couple of weeks ago.

4:58 clgv: What do you mean by that? Is there a big performance penalty for destructuring?

4:58 robertstuttaford: clgv: i'll be sure not to, once i understand what you mean

4:58 Fullmoon: It it a smell to use clojure agents like queues? For example for synchronization of a log file?

4:59 clgv: wkmanire: there is some penalty. if it's really a hotspot it makes a difference.

4:59 Borkdude: neotyk: I've been tinkering with your lib, but I don't understand a few things

5:00 neotyk: Borkdude: how can I help?

5:01 Borkdude: neotyk: for example, how do I create a "body-collect" function that counts the amount of parts coming in and printing a msg for each part

5:01 wkmanire: clgv: hmm, if destructuring is just another form of transforming your data, and that transformation must occur in order for your program to process the data then...

5:01 does that mean if you have a bottle neck in some destructuring segment that you need to refactor your data structures:

5:01 ?

5:01 Borkdude: neotyk: is the :body element of state the part that comes in, or the whole body?

5:02 clgv: wkmanire: not necessarily. the point is that just doing manual let's is faster in a lot of cases. I tried that some time ago

5:03 wkmanire: I didnt get to the point to understand why that is

5:03 neotyk: Borkdude: :part (fn [resp part] (let [counter (or (:body resp) (atom 0))] (swap! counter inc) (println part) [counter :continue]))

5:03 wkmanire: Oh... I figured destructuring just used let and that let is what handled the actual destructuring.

5:04 Just to warn you, these are all mostly alien concepts to me still.

5:04 robertstuttaford: clojurebook said exactly that, wkmanire

5:04 let destructuring forms are handled by let calls internally

5:04 neotyk: Borkdude: :body of response is what you return for first invocation of part callback

5:04 wkmanire: robertstuttaford: I can only fathom that it must have to do with processing macros in the reader.

5:05 neotyk: Borkdude: first element of tuple you return

5:05 robertstuttaford: i could be completely wrong, but i remember reading that. although, i have read several hundred other pages of new concepts in a very short space of time :-)

5:05 neotyk: Borkdude: nah, my example won't work

5:05 clgv: robertstuttaford: thats right. you can expand it. and I guess the intermediary expressions are the reason for the overhead

5:06 wkmanire: robertstuttaford: I'm finding that the faster I go with the material the slwer I understand it. It really helps to sit down and run doc on the function in the sample and practice with them a fwe times.

5:07 robertstuttaford: definitely, wkmanire. i have several juicy programming tasks i need to accomplish which clojure is perfect for. i've jumped in with both feet on the first of those tasks

5:07 neotyk: Borkdude: https://github.com/neotyk/http.async.client/blob/master/test/http/async/client/test.clj#L234

5:08 Borkdude: would that solve it for you? or you prefer to have it in (:body response)?

5:08 robertstuttaford: read xml, html, css files from a zip file, munge teh xml into json, replace paths in html and css, return single json blob with everythign nicely packaged… on demand via json rest api

5:08 wkmanire: robertstuttaford: Wow, my english was horrible there. I'm surprised you understood me.

5:08 robertstuttaford: i've got all that done except the path replacements, now

5:09 learning one helluva lot

5:09 Borkdude: neotyk: ah I have something working now

5:10 robertstuttaford: what's helped is that i already had all this working done as a coffeescript node.js app so i have an output to compare to

5:12 wkmanire: robertstuttaford: yeah, this is great stuff. I'm learning more, more quickly with clojure than I have with any other language in years. I had a big hole to fill in my CS knowledge that I didn't even know about.

5:14 punkboy: hi i have a question pertaining to leiningen checkouts.. (if anyone tried using it before).. as mentioned i did create a checkouts dir under my project root.. created a symlink to the external project in checkouts.. have the dependency specified in project.clj.. but when i run lein deps, it still does not identify the dependecy

5:14 anyone used this before?

5:15 neotyk: Borkdude: here is example with delivering via :body https://gist.github.com/2652052

5:26 Borkdude: updated gist, previous was failing

5:29 Borkdude: neotyk: ok… I tried the following: https://gist.github.com/2652015

5:30 neotyk: somehow this is not working

5:31 neotyk: wait, with-out-str should be something different

5:38 neotyk: edited a bit, https://gist.github.com/2652015 - it's not clean code, just a quick script to see the parts of html in a file

5:40 neotyk: Borkdude: will look at it in a minute, will ping you

5:41 espeed: I'm trying to extract the method signature from a groovy function like so: (re-seq #"^def(.*)\{" groovy-func) ...however, it's returning the first line plus the extracted sig: [def warm_cache() { warm_cache() ]

5:51 Borkdude: neotyk: probably I could give the writer and counter to each next part and close it in the completed function?

5:52 neotyk: anyway, it's not really an issue, I'm just playing around with it

5:55 neotyk: maybe a nice example: put each part in a separate file so you can see the files being generated

5:56 neotyk: Borkdude: you could write it out in completed callback

5:57 Borkdude: neotyk: you mean by first collecting all the pieces and only write them when ready?

5:57 neotyk: Borkdude: exactly

5:57 Borkdude: and default part cb will collect everything for you

5:58 Borkdude: neotyk: as a demo effect it is nice to see that work is being doing asynchronously

5:58 neotyk: Borkdude: default :part callback is http.async.client.request/body-collect

5:59 Borkdude: you can invoke body-collect at the end of you cb, that will print something to user

6:00 Borkdude: neotyk: ok

6:00 neotyk: what do you use this lib for in practice/projects now?

6:02 neotyk: Borkdude: to access http apis

6:07 Borkdude: https://gist.github.com/2652261 counting parts and collecting body

6:08 Borkdude: neotyk: cool!

6:10 neotyk: Borkdude: I often end up using it to test when I build API myself, kind of like curl in repl

6:11 Borkdude: neotyk: I was wondering when do you need the async part of it

6:12 neotyk: Borkdude: to be honest, not very often

6:13 Borkdude: neotyk: so what you're doing now is like wrapping middleware in ring

6:13 neotyk: in the part function

6:13 neotyk: Borkdude: only once I had fire and forget scenario

6:14 Borkdude: neotyk: I have to go, ttyl

6:14 neotyk: Borkdude: yes, kind of

6:14 Borkdude: ttyl

6:25 * robertstuttaford wishes all clojure github repos would put the lein deps incantation and :use/:require incantations right at the top

6:26 * clgv checks his projects

6:26 robertstuttaford: i see clojars has the lein deps which is great

6:27 clgv: yep. meanwhile they also have all old versions listed :)

6:34 robertstuttaford: any enlive veterans about?

6:35 is it possible to copy nodes from one html tree into another separate html tree?

6:35 from reading the docs it looks like transformations happen within the context of a tree

6:52 if i can slurp an html file but enlive's load-resource has a nullptr exception on the same path, what does that mean?

6:52 the path is on my filesystem

7:06 shawn-p: Heyo

7:07 I'm new to Clojure... I was hoping to ask a couple newbie questions

7:11 clgv: ~anyone

7:11 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

7:12 clgv: just ask^^

7:19 michaelr525: <clgv> ~anyone [14:11]

7:19 <clojurebot> Just a heads up, you're more likely to get some help if you ask

7:19 the question you really want the answer to, instead of "does

7:19 anyone ..."

7:19 <clgv> just ask^^

7:19 clgv: michaelr525: äh was?

7:19 michaelr525: erm, what?

7:29 HCumberdale: Hi!

7:30 How can I control the slime frame which opens in emacs by M-x clojure-jack-in to appear at the bottom?

7:32 clgv: In midje can I specify a table of provided statements?

7:33 Madsy: Is there a function like "isref?" in Clojure core? It's handy enough that it should exist :)

7:34 (isa? (class foo) clojure.lang.Ref) isn't as nice

7:36 HCumberdale: Control what in Slime?

7:37 HCumberdale: Madsy: If I run M-x clojure-jack-in the main window is split and the REPL occurs at the right side

7:37 I want it to appear in the bottom

7:37 (at the bottom)

7:37 Madsy: Learn the Emacs window commands. Changing the layout takes 2 seconds

7:38 HCumberdale: Madsy: do you have a link for me

7:38 neotyk: HCumberdale: https://duckduckgo.com/?q=emacs+C-x+2

7:39 HCumberdale: thx!!

7:39 Madsy: HCumberdale: http://refcards.com/docs/gildeas/gnu-emacs/emacs-refcard-a4.pdf

7:39 See "multiple windows" in the top-right corner

7:41 This is what I do: 1.) C-x-o to change focus to your main window. 2.) C-x-1 to close all other windows. 3.) C-x-2 to get a horisontal split. 4.) C-x-o to change to the other window, and C-x-b to change the buffer to the Slime REPL.

7:41 If you want to, make it into a keyboard macro and save it.

7:42 HCumberdale: Madsy: how to add such a macro?

7:42 Madsy: See the refeference I gave you

7:45 Fossi: is there a function like the following in the library or another clever way to do the same: https://gist.github.com/2652566

7:45 basically it reduces over a map and transforms the values, returning them under the same key

7:49 clgv: Fossi: I dont think so. I wrote it like (reduce #(update-in %1 [%2] func) map (keys map))

7:51 espeed: I'm trying do a loop/recur to update and return a map (https://gist.github.com/2652573), but something's not right with the recur

7:53 clgv: espeed: you have no base case for the recursion so it will loop forever

7:54 try: (if (seq methods) (let ...) methods)

7:54 err, scripts is the result: (if (seq methods) (let ...) scripts)

7:56 espeed: clgv: thanks -- I'll try that

7:58 clgv: espeed: if you didnt know why you have to do that - read a short introduction on recursion ;)

7:59 espeed: clgv: thanks -- that worked after I moved the scripts return value to the "else" in the cond (https://gist.github.com/2652573)

8:46 michaelr525: אני אוהב שסק

8:47 matessim: מגניב אחי

8:55 michaelr525: כל השאר עושים את עצמם לא מבינים

8:55 clgv: oh look, unicode!

8:56 matessim: hebrew :P

8:56 חחח, ממש

8:56 Fossi: same, really :>

8:58 cool

8:58 matessim: this is why i like #Clojure, if i was at ##java, i'd already would have been banned for talking out of turn and typing unicode

8:58 damn hostile channel

8:58 Fossi: google translate says חחח means 'lol' :D

8:58 matessim: ח is kh

8:58 the sound

8:58 that's how israelis laugh

8:59 Fossi: yeah

8:59 matessim: typing חחחחחחח

8:59 is like

8:59 hahahaha

8:59 Fossi: i figured

8:59 for one it says 'kh'

8:59 but for three 'lol' :>

8:59 clgv: khkhkhkh :D

8:59 matessim: it must be odd as fuck to see a bunch of unclosed rectangles though

8:59 :P

9:04 ShawnMcCool: what's the widely accepted best introductory clojure book?

9:05 rhc: ShawnMcCool: cemericks new book from oreilly or "joy of clojure", based on my limited research

9:05 ShawnMcCool: thanks, i was looking at the joy of clojure so i think i'll go with that

9:06 hyPiRion: ShawnMcCool: What kind of experience with languages do you have from before?

9:06 clgv: these are the books I heard of: Programming Clojure, Practical Clojure, Clojure in Action, Clojure Programming, Joy of Clojure

9:06 ShawnMcCool: 14 years of professional programming, 20 years total experience.

9:06 hyPiRion: I meant languages. ;)

9:06 clgv: I would recommend Joy of Clojure as second read ;)

9:07 ShawnMcCool: turbo pascal, c, c++, c#, php, ruby, java, perl, etc

9:07 i have very little time to put into studying clojure or i probably wouldn't even read a book. i'd probably just troll around here and work on apps.

9:07 but, i'm interested in it and i can fit it in on the toilet

9:07 hyPiRion: Okay, then I can't speak for what I would recommend, as I came from a Lisp-background.

9:08 ShawnMcCool: i've never touched any lisp

9:08 hyPiRion: But I think Joy of Clojure is a good second book when you've read a good introductory book.

9:09 (And programmed a bit)

9:09 ShawnMcCool: I was trying to decide if i wanted to pursue clojure or haskell for fun. A buddy convinced me to go with Clojure for now.

9:09 oh really?

9:09 http://www.amazon.co.uk/The-Joy-Clojure-Thinking-Way/dp/1935182641/ref=sr_1_2?ie=UTF8&qid=1336655000&sr=8-2#reader_1935182641

9:09 it seems to begin rather introductory

9:10 i liked the idea of this book because it specifically is trying to sell me on the idea that it will give me the philosophy of developing with clojure which is usually the harder to gain aspect of working in a language

9:11 clgv: ShawnMcCool: It progresses fast and some topics are rather advanced

9:11 ShawnMcCool: i see, recommended first read for someone new to clojure and functional programming?

9:11 Maybe then Clojure Programming by Chas Emerick?

9:12 matessim: i ordered Clojure Programming today :)

9:13 hyPiRion: I haven't read any introductory book other than Programming Clojure, but I wouldn't say it was amazing. My best pick is the highest rated by the rest of this channel.

9:15 ShawnMcCool: well, i pulled the trigger. had a few references te emerick's new book in this channel. can always get another book at another time.

9:15 thanks for your feedback

9:15 clgv: ShawnMcCool: I started with Clojure Programming but if there is no new release it's pretty outdated

9:15 args "Programming Clojure" I meant

9:15 these titles are too similar ^^

9:16 matessim: we could refer to books by ISBN numbes, but i fear it would be more confusing

9:16 snamellit: I used "programming clojure" as first book. The pragprog one.

9:17 matessim: i bought the oreilly one

9:41 cshell: What's the Clojure equivalent of the Java code: "Hello" + " world" (ie the string concat/append)

9:41 dakrone: cshell: (str "Hello" " world")

9:41 ,(str "Hello" " world")

9:41 clojurebot: "Hello world"

9:42 cshell: dakrone: thank you very much

9:43 babilen: cshell: You might also want to look at core/format for string formatting

9:46 cshell: babilen: another good tip, thanks!

9:50 ache: cshell: printf combines print and format... so you don't need to do (print (format "some string with tokens like %s" token1))

9:50 cshell: ache: awesome, thanks!

9:51 babilen: cshell: We could probably even come up with more tips if we knew what you really want to do ;)

9:51 cshell: babilen: haha, thanks I'll save more tips for another day

9:51 Morning, Rich

9:59 ache: (hm. so there's println ... but no printfln.)

10:01 kzar: ache: I think you're supposed to use format

10:02 ,(format "Dumb example %d" 3)

10:02 clojurebot: "Dumb example 3"

10:03 ache: ,(printf "feels odd to have to insert a %s\n" "newline-char")

10:03 clojurebot: feels odd to have to insert a newline-char

10:03 ache: ... especially when println and print both exist. just an observation. not asking for any changes

10:03 gfredericks: there should be 8 different printf functions.

10:04 Fossi: at least

10:04 gfredericks: prf, prnf, printf, printlnf, prf-str, prnf-str, printf-str, and printlnf-str

10:05 beffbernard: I just noticed that some of my hiccup vectors are only formatted with one space in clojure-mode…

10:05 https://www.refheap.com/paste/2680

10:05 duck1123: gfredericks: what about the pprint variants?

10:05 beffbernard: is this a bug in clojure-mode or is that how it's supposed to be indented?

10:06 gfredericks: duck1123: you mean in clojure.pprint?

10:06 duck1123: shouldn't they make that list as well?

10:06 gfredericks: okay add to my list pprf, pprnf, pprintf, pprintlnf, pprf-str, pprnf-str, pprintf-str, and pprintlnf-str

10:10 Madsy: ,(letfn [(ref? [r] (isa? (class r) clojure.lang.Ref))] (let [x (ref 1) y 2] [(ref? x) (ref? y)]))

10:10 clojurebot: [true false]

10:12 mmarczyk: dnolen: ping

10:15 dnolen: I've been working on the prototype-attached protocol mask idea -- and running into issues w/ (as far as I can tell) stuff like (extend-type js/String IFn ...); I've actually got a branch which works and fares unexpectedly well on a bunch of timings in node (still need to move all tests over to pure V8...) on :simple, but seems to be a step back in :advanced -- definitely WIP

10:16 dnolen: but now that I see CLJS-246, I think that's more important, so I'll be looking into that tonight -- unless you've already got sth working?

10:17 dnolen: not going nearly as fast on this as I'd like to due to various time constraints.

10:22 fliebel: Are there any clojure-py people lurking in here, or is there a #clojure-py?

10:25 Wild_Cat: I don't think there's a #clojure-py (although clojure-py is remarkably interesting)

10:34 fliebel: Wild_Cat: It is. I'm still looking for a place to chat about it though...

10:34 * fliebel just submitted them a pull request

10:34 Wild_Cat: fliebel: I suppose Clojure still has a small enough community that all discussion can happen here.

10:35 uvtc: fliebel, maybe email Timothy. He might be interested in setting up a channel.

10:35 fliebel: Wild_Cat: Yea, if there is anyone to discuss with... ;)

10:35 uvtc: They have a mailing list...

10:35 kzar: With Clojurescript is it important to learn about Google Closure as well as Javascript and Clojure?

10:36 uvtc: fliebel: Yes, I know. But you mentioned how you were looking for a place to chat about it. I figured that some folks prefer irc over ML's.

10:37 fliebel: yea...

10:37 mmarczyk: I agree with Wild_Cat about #clojure being sufficiently small

10:38 TimMc: $mail echo-area The proxy bug actually has to do with proxy not even dispatching on arity, just name. Really kind of terrible.

10:38 lazybot: Message saved.

10:38 fliebel: kzar: I'd say so. You can ignore the underlying platform to some extent, but you'll bump into it at some point.

10:38 mmarczyk: TimMc: oh, interesting. have you filed an issue for this? (I've seen that discussion when skimming the logs)

10:39 kzar: fliebel: Balls, I'll add another book to the backlog heh

10:39 TimMc: mmarczyk: Haven't done a bug search with the new info.

10:39 fliebel: kzar: A Closure or JS book?

10:40 HCumberdale: how to control the frame size in emacs?

10:40 kzar: fliebel: Closure, was going to get that o'reilly one. Already read Javascript the good parts and pretty much got my head around Javascript

10:41 fliebel: kzar: Id's say you need to know as much about them as you need to knoe wbout the JVM for Clojure.

10:41 kzar: fliebel: Fair enough, makes sense. My lack of knowledge of Java always slowed me down with Clojure I think

10:42 fliebel: kzar: I think some people are using cljs without closure-the-lib.

10:43 nickmbailey: gotta go

10:43 err wrong room

10:43 RickInGA: I know that ibdknox has written a cljs wrapper around jquerry. I think it is called jayq

10:45 kzar: is the closure lib any good?

10:48 fliebel: kzar: It's like java for javascript... I havn't touched it to much.

10:49 dnolen: kzar: there's some really good stuff in there, especially the base libraries.

10:49 kzar: I wouldn't touch the UI stuff myself. But I'm sure plenty of people find it useful.

10:51 ynniv: how are people deploying compojure apps? inside a tomcat wrapper?

10:53 fliebel: Does clojurescript have a seque?

10:53 mmarczyk: fliebel: what would it do?

10:53 fliebel: ... just because I can see how broken it is, or how they fixed it.

10:54 mmarczyk: consume a lazy seq into a buffer on a th... wait... webworker?

10:55 mmarczyk: fliebel: right; no webworker stuff figured out yet, so -- not yet

10:55 fliebel: ok

10:55 well, that makes it easy to have controlled mutation, I guess.

11:24 RickInGA: is there a way to get a fully qualified name from a symbol? for example, if I (def x) is there a way later to find out that x is user/x ?

11:24 ah, wow, I gave up too soon #'x

11:25 mdeboard: You stole my opportunity to be helpful

11:25 RickInGA: :)

11:26 robertstuttaford: is there something special i need to pass to enlive's html-resource function? i keep getting a NullPointerException (enlive_html.clj:53) regardless of whether i pass it a path as a string, or a File instance

11:27 slurp on either works and i can see the content just fine

11:27 ache: how would one find out about #'x on their own?

11:27 mdeboard: ache: books

11:27 ache: ah book lernin

11:27 mdeboard: robertstuttaford: I know for sure you get an NPE if you try to pass it a path to a file that doesn't exist

11:28 robertstuttaford: So just wild guess I'd say you need to re-evaluate how you're forming your file reference

11:28 robertstuttaford: i'm passing it an absolute path which echos when i cat it in zsh

11:28 and as i said, slurp happily shows it too

11:29 weird

11:29 mdeboard: robertstuttaford: Is the directory it's in on the classpath?

11:30 robertstuttaford: it's an absolute path

11:30 starting from /

11:30 pandeiro: ot: anyone have any favorite bad startup videos?

11:32 robertstuttaford: whoa ok even (html/html-resource "http://www.google.com") has the error

11:32 enlive 1.0.0 right?

11:34 bhenry: so i'm using lein2 and suddenly lein2 repl keeps timing out. it was working earlier today. i removed a plugin from my project.clj but i don't see how that would break it.

11:36 S11001001: bhenry: add it back

11:37 bhenry: S11001001: new info. lein2 repl works fine with same project on another machine.

11:39 S11001001: also just for kicks i added it back on the offending machine and it still times out

11:39 yoklov: heh, there's a typo in cljs.reader

11:40 https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L157 "charater"

11:40 Is that the sort of thing I should make an issue on JIRA for?

11:41 ache: pandeiro: people at my company wanted to make a video series featuring a Cat Man... but no one had the guts to play the role. is that the kind of thing you're asking about? we have a dozen episode scripts in our wiki

11:43 cark: hello all

11:44 I've been giving a try at clojurescript and having some problems

11:45 when compiling (specially advanced compilation) I notice that my exported function and top namespace are not actually exported, so that i can't call them from the outside

11:46 i'm using the head version

11:47 ynniv: wow, lein ring uberwar + resource-path is awesome

11:47 cark: so the question is this : anybody experiencing this problem, and is there a solution ?

11:47 yoklov: cark: That's weird, you're doing ^:export?

11:48 cark: yes i have a single function defined like so : (defn init ^:export ....

11:48 yoklov: oh

11:48 you want (defn ^:export init ...)

11:49 cark: darn let me try that ...

11:49 yoklov: you're applying the metadata to the var, init

11:50 cark: indeed it works ....

11:50 i've been banging on this one for a while, thanks a lot !

11:51 robertstuttaford: ynniv: please do elaborate for this newbie?

11:51 pandeiro: ache: yeah i was thinking something like jot.ly ... i need to give a talk on the tech bubble/startup culture for people at a local software company

11:51 ynniv: I've been running in swank with ring-response/file-response

11:52 yoklov: cark: heh, no problem :)

11:52 hope you like cljs!

11:52 ynniv: I just switched to a top level :resource-path in my project.clj

11:52 and a ring-response/resource-response

11:52 cark: i've been using clojure for a long time, having high hopes for clojurescript

11:52 robertstuttaford: yoklov: have you ever had to generate an externs for a cljs compiled js file before?

11:53 resource-path is what ring uses to serve static assets, right?

11:53 cark: i think there's an ongoing effort for implementing persistent data structures in cljs, what's the status on that ?

11:53 ynniv: then use "lein ring uberwar" and it packages my ring routes for tomcat

11:53 yoklov: robertstuttaford: No, sorry. I usually don't export anything and just load my code at the bottom of the page to be honest

11:53 cark: they're all there, pretty much

11:53 ynniv: drop that war in tomcat's webapps and it's good to go

11:53 yes, resource-path is for static files

11:54 cark: yoklov: awesome, that's what made me wait for such a long time

11:54 RickInGA: cark: I beleive they have done persistant vector and persistant map.

11:54 robertstuttaford: yoklov: ok cool. i want to make a base cljs app that loads up cljs modules on demand

11:54 yoklov: maps, vectors, sets, sorted sets seqs,

11:54 ynniv: and if you're using noir, you get a ring handler via (def ring-handler (server/gen-handler))

11:55 yoklov: robertstuttaford: yeah, I don't really know how to do that. I've considered it before, as I have several CLJS programs which might make for a somewhat nice demo site or something like that, but the closure compiler is… a strange beast

11:55 ynniv: i'm not sure about noir over straight compojure tho

11:55 cark: that's nice, any idea on the performances of the cljs persitent datastructures ? as related to java clojure ?

11:56 yoklov: seqs are slowish

11:56 cark: or maybe related to javascript

11:56 robertstuttaford: yoklov: gclosure compiler just needs an externs definition for the exported symbols and it'll work fine

11:56 i use gclosure the painful way and have this working already

11:56 yoklov: cark: iirc, vectors and hashs are about 1/10th the speed of js native arrays and objects respectively

11:57 cark: yoklov: ok well i guess i'll have a look at that now that i can compile =) thanks again !

11:58 actually 1/10th is not too bad imo

11:58 yoklov: cark: basically, I just use the cljs data types, and if performance becomes an issue I switch to arrays. Typically performance will only be an issue in one or two bottlenecks, and even then we're talking "don't use a persistent data structure in a fucntion that gets called hundreds of times a second"

11:58 robertstuttaford: cark, yeah. js execution is blistering these days, although i wonder how well mobile will cope

11:59 wkmanire: Howdy folks.

11:59 bobry: how can I convert js Object to clojurescript map?

11:59 yoklov: bobry: js->clj

11:59 cark: yep, i'm so worried about performances to be honest, we're not doing hpc here after all =)

12:00 tho game developement might be a future use case... but that's not for me

12:01 bobry: yoklov: is it available out of the box?

12:01 yoklov: cark: cool, though in my experience if you are somewhat disciplined you can get cljs to be the same speed as js

12:01 bobry: yup, in cljs.core

12:01 cark: ok well going back to experimentation, bye =)

12:01 yoklov: cark: i've been working on the game development side in cljs, it performs fine http://thomcc.github.com/Argh/

12:02 that's old though, I should update it at some point...

12:02 cark: yoklov: mhh i'm going to check that =)

12:02 yoklov: at least so it doesn't refer to the past as "next weekend"

12:03 cark: wow i'm impressed

12:03 yoklov: heh, thanks

12:03 cark: is this webgl ?

12:03 yoklov: nope

12:03 cark: !

12:03 yoklov: it would look better if I did webgl

12:04 and I've been thinking of learning it...

12:04 RickInGA: that's awesome yoklov!

12:04 cark: don't tell me you're mapping these textures from clojurescript

12:04 yoklov: RickInGA, thanks!

12:04 cark: yeah, its a mess though, https://github.com/thomcc/Argh/blob/master/src/argh/render.cljs

12:05 I've refactored those into outer functions several times, but the destructuring of the game state ends up being a huge perf. bottleneck

12:05 cark: 60 fps, i can't beleive it =)

12:06 muhoo: heh, bultitude

12:07 dnolen: cark: yoklov is right, CLJS data structures are within an order of magnitude of arrays and objects.

12:07 muhoo: i dunno how paul bultitude meets the wikipedia notability guidelines

12:07 dnolen: cark: there's probably more tuning that we could do.

12:07 cark: that said, that why there's explicit support for using arrays and objects directly.

12:07 cark: dnolen: one order of magnitude is fine by me

12:08 dnolen: filling a table will still be instantaneous =)

12:09 dnolen: cark: one problem is that JS engines just don't aggressively inline yet the way that the JVM does.

12:09 mmarczyk: ping

12:09 cark: dnolen: do you see much differences between different javascript engines ?

12:09 mmarczyk: dnolen: pong

12:11 yoklov: cark: In my experience chrome is much faster than gecko, but the speed difference goes away mostly during advanced compilation

12:11 err, v8

12:11 dnolen: yoklov: especially now with 1211

12:11 jweiss: anyone else see a problem where leiningen (i'm using 1.7.1) hangs if there is a compile error when running lein jar?

12:11 dnolen: yoklov: we analyze ns dependencies first, under advanced compilation we almost never emit foo.call(null, ...)

12:12 yoklov: dnolen: Oh, that's great

12:12 dnolen: mmarczyk: http://dev.clojure.org/jira/browse/CLJS-247

12:12 technomancy: muhoo: it's named after the bear, FWIW

12:12 jweiss: (i'm using a java project by the way with that lein error)

12:13 yoklov: dnolen: didn't know if this deserved a ticket in JIRA, but there's a typo in cljs.reader line 157. "charater" should be "character"

12:15 dnolen: yoklov: fixed thx

12:15 yoklov: no problem

12:15 dnolen: cark: yes

12:16 cark: V8 is the king, JSC w/in 2X, SpiderMonkey is reasonably fast now but lags behind.

12:16 technomancy: jweiss: probably a thread pool got started and is keeping it open

12:16 I wonder how old gjs's version of spidermonkey is

12:16 jweiss: technomancy: that's what the thread dump looks like, yeah

12:16 dnolen: cark: I recently ran spectral-norm from Alioth on V8, it's run w/in 1 second of the JVM version single core - which is crazy.

12:17 mmarczyk: dnolen: right, so I wonder if we can just assume that if -foo is called than a satisfies? test has already been performed (unless not necessary because it's guaranteed to be true due to some special circumstances)

12:17 technomancy: jweiss: not much we can do about that until clojure implements a way to undo shutdown-agents

12:17 http://p.hagelb.org/scumbag-shutdown-agents.jpg

12:17 jweiss: lol

12:18 dnolen: mmarczyk: I don't see how we can make that assumption at.

12:18 all

12:18 mmarczyk: dnolen: right now we can't

12:18 dnolen: but with some rewrites to core.cljs

12:18 jweiss: technomancy: lein compile, jar seems to let it exit gracefully

12:18 dnolen: mmarczyk: seems more complicated than bit testing and dispatching which we know if fast.

12:18 is fast

12:20 mmarczyk: dnolen: hm, probably right

12:21 dnolen: but yeah, doing the bit test first if the protocol is on the fast path makes sense

12:21 dnolen: mmarczyk: it would eliminate one extra function call - that's a big win for protocols.

12:21 technomancy: jweiss: oh, curious

12:21 mmarczyk: dnolen: right

12:21 technomancy: there shouldn't be a difference

12:21 jweiss: can you repro on 2.x?

12:22 jweiss: technomancy: i haven't tried, will give that a shot in a bit

12:23 dnolen: yoklov: reducers stuff should be pretty interesting for CLJS perf

12:23 yoklov: dnolen: what's the deal with cljs-172? (implement chucked persistentvectors)

12:23 technomancy: while I haven't ruled out another bugfix release on the 1.x branch, I'd rather not unless a serious issue is found

12:23 dnolen: yoklov: what do you mean?

12:23 yoklov: dnolen: There's a patch for it, is there any reason it hasnt been applied?

12:24 mmarczyk: incidentally, I've got a sketchy port of reducers -- should be ready to replace core.reduce in cljs soon -- I need to catch a stray bug or two though

12:24 technomancy: jweiss: curious, is there anything blocking you from upgrading, or just haven't had the time?

12:24 yoklov: dnolen: I hadn't had time to look into the reducers really, but I thought it had to do with parallelism

12:24 dnolen: yoklov: and zero-allocation overhead.

12:25 mmarczyk: yoklov: I'm not positive on this, but it's likely to need an update due to some reorg in PV (to do with transient vectors), plus there needs to be some infrastructure put in place around it -- chunked-cons etc.

12:25 yoklov: dnolen: Ah, okay, that seems to make more sense

12:25 dnolen: yoklov: oh I missed that, no specific reason. But what mmarczyk applies.

12:25 mmarczyk said applies.

12:25 yoklov: we need to update all the seq fns to take advantage of chunked seqs.

12:25 mmarczyk: yoklov: I'm actually sort of planning to work on this, but dnolen doesn't seem to run out of cool protocol-related ideas which I think are a bigger win

12:26 dnolen: so, I'd love to take 247

12:26 dnolen: mmarczyk: cool!

12:26 mmarczyk: dnolen: ok, I'll post a patch tonight

12:27 dnolen: mmarczyk: with the patch mind mentioned code size difference?

12:27 mentioning

12:27 mmarczyk: dnolen: sure

12:27 dnolen: mmarczyk: thx

12:28 mmarczyk: dnolen: size of $CLOJURESCRIPT_HOME/out after a test run, say?

12:28 dnolen: mmarczyk: core-advanced-test.js yes

12:29 yoklov: I wonder if map destructuring should support property access for hosts that provide fast access w/o type hints like JS.

12:29 mmarczyk: dnolen: ok, so -foo will now check for non-nil first arg, then attempt a bit test, then fall back to what's it doing currently

12:30 dnolen: if code turns out to grow a lot, I'll add the :inline-... switch

12:30 dnolen: {:properties [foo bar baz]} !!!

12:30 dnolen: yoklov: http://dev.clojure.org/jira/browse/CLJS-248

12:31 yoklov: dnolen: that would be an enormous benefit

12:31 espeed: where did clojure.contrib.string get moved to?

12:31 dnolen: yoklov: mmarczyk: worth bringing up on the dev list - since it's a change to Clojure's destructuring syntax.

12:31 mmarczyk: wow, that is a *fantastic* idea

12:32 dnolen: sure -- but definitely a +1 from me

12:32 dnolen: mmarczyk: re: inline-protocol-fns, sounds good.

12:33 mmarczyk: dnolen: are you planning on writing a patch for 248? otherwise I'd love to to do that once I'm done with 247

12:33 yoklov: Yeah, I had wished something that existed when I was writing argh, but couldn't come up with a good syntax and the thought of reimplementing `let` or whatever sounded like too much of a pain

12:33 dnolen: mmarczyk: go ahead, it probably won't be applied till we get feedback from the list is all.

12:33 mmarczyk: and possibly reducers, though I'm hoping that's half an hour away.

12:33 technomancy: espeed: clojure.string, but watch out for reversed argument order

12:33 mmarczyk: dnolen: cool

12:34 ache: espeed: is that different from clojure.string ?

12:35 espeed: technomancy: thanks

12:35 ache: it's now the same -- just found the docs saying that (http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go)

12:35 ache: ah. i don't type as fast as technomancy :-P

12:36 technomancy: it's the dvorak

12:37 TimMc: and the methamphetamines

12:38 uvtc: technomancy: aoeu!

12:39 muhoo: you don't need methamphetamines if you livein seattle

12:39 there's coffee :-)

12:40 apparently, starbucks has 5 times as much caffiene as a red bull. i don't know what the gourmet stuff technomancy has in it, but i'm afraid to ask

12:40 feliped: muhoo: wat

12:41 technomancy: uvtc: um... htns?

12:41 in Indonesia Red Bull has nicotene in it

12:41 feliped: what about nicotine

12:41 muhoo: hmm, a wrapper added with add-middleware runs 3 times per request?

12:41 technomancy: feliped: I'll have to check next time I'm there

12:41 feliped: technomancy: :D

12:42 * nDuff isn't through his morning 6-shots-of-espresso yet.

12:43 uvtc: technomancy: Evidently that's the secret handshake. ;)

12:43 pandeiro: muhoo: noir?

12:44 ibdknox: pandeiro: about the removing of the other custom middleware

12:44 pandeiro: yeah, i gleaned from that convo you're kind of in flux about all that

12:45 ibdknox: pandeiro: I added it because otherwise it would be another breaking change compared to the original behavior

12:45 pandeiro: that being said, if someone wanted it back they'd only need to do wrap-route :resources

12:46 pandeiro: ibdknox: are you not thinking about rewriting parts of noir.server? i got that impression

12:46 ibdknox: pandeiro: in your specific case, couldn't you just check if the response is null and only log otherwise

12:47 pandeiro: it probably makes sense

12:47 pandeiro: ibdknox: there are a couple workarounds, don't worry about my case... i brought it up b/c it seems broken in general

12:47 ibdknox: yeah

12:47 unfortunately it's somewhat a limitation of compojure

12:47 pandeiro: and i figured my solution was flimsy at best, which you just confirmed...

12:48 i see

12:48 maybe the temporary solution is deprecating add-middleware so people aren't surprised by that? i dunno

12:49 ibdknox: I dunno, definitely something that needs more thought

12:49 alexyakushev: technomancy: is there a convenient way to exclude :dev profile from the profiles (e.g. for building the release version)?

12:50 pandeiro: ibdknox: i also submitted a pr for the defpartial docstrings, did you see that already?

12:51 ibdknox: I saw it was up, haven't had a chance to look at it yet

12:51 pandeiro: i think that one's a little more straightforward, if you still think it's useful

12:51 nDuff: I have two sets, guaranteed to be completely disjoint, and want to move to a map of {item is-in-first-set} pairs (doing a union of the sets, but recording which one served as origin). The ways I'm thinking of to do this are mostly clunky; is there something idiomatic?

12:51 Current attempt: (into {} (for [[cur-set value] {s1 :a, s2 :b} item cur-set] [item value]))

12:51 mmarczyk: dnolen: unless I'm doing something very wrong, the perf gain on :simple from the most naive way of testing the bit is quite significant :-)

12:52 nDuff: (err, make that :a true and the :b false to match with the problem description)

12:55 mmarczyk: dnolen: core-advanced-test.js size increases by ~4k (357 to 361)

12:55 felideon: ibdknox: so should we bug you about pull requests now or after light table is funded? :P

12:58 mmarczyk: dnolen: just attached a patch to CLJS-247

12:58 ibdknox: felideon: merged

12:58 technomancy: alexyakushev: yeah, it's actually a bug that it's not being excluded when you generate the pom/jar right now

12:58 alexyakushev: it's fixed in master; I hope to have a new preview release tomorrow

12:59 felideon: ibdknox: nice!

12:59 thank you, kind sir.

13:00 technomancy: alexyakushev: btw, I meant to mention this earlier, but you might find this useful: https://github.com/mirah/pindah

13:00 I tried to leave a comment on your blog but the comment form wasn't in english, so I got confused. =)

13:02 TimMc: technomancy: That's to keep out pesky foreigners like you.

13:04 alexyakushev: technomancy: as I can see in the "jar" subtask the classpath is recreated from scratch (i.e. from :without-profiles), am I right?

13:04 technomancy: alexyakushev: that's correct in git master; it wasn't true in preview3

13:05 alexyakushev: technomancy: What I want to do is to have a nrepl dependency in :dev profile but exclude it in :release

13:05 uvtc: Is ::foo just shorthand for :the-current-namespace/foo?

13:06 technomancy: alexyakushev: if you need to do it with preview3, you could create an empty profile and do `lein with-profile empty jar`

13:06 ibdknox: pandeiro: for the defpartial can't you just take the (rest params)? based on tools.macro params should contain everything after the name

13:06 pandeiro: so the fn params would be (first params) and the body would be (html (rest params))

13:06 Mordus: Hi, I want to learn about web services programming in Clojure, can anyone recommend any resources for this?

13:07 ibdknox: Mordus: http://webnoir.org

13:07 Mordus: ibdknox: thanks

13:07 technomancy: Mordus: this is a good overview: http://brehaut.net/blog/2011/ring_introduction

13:07 alexyakushev: technomancy: that's basically what I do, my :release profile is empty but when I do `lein with-profile release foo` I have both :dev and :release profiles attached

13:07 technomancy: except it's too old to mention noir, oops

13:07 alexyakushev: technomancy: but if it is fixed in master, I'm ok with it

13:08 technomancy: alexyakushev: oh, shoot; I thought that would have worked. =\

13:08 pandeiro: ibdknox: i will test again but i believe the tools.macro fn is only returning a seq of the first vector (i tried your suggestion first)

13:08 Mordus: What about SOAP? I've tried out clj-soap, but there's not much documentation and I've found it very hard to do more than trivial stuff with it.

13:09 technomancy: clojurebot: via soap?

13:09 clojurebot: "They enable us to send XML messages through SOAP. Through SOAP!!!" (http://www.youtube.com/watch

13:09 technomancy: =(

13:09 felideon: ibdknox: did you design the websites for your libs?

13:09 ibdknox: fliebel: yeah

13:09 err

13:09 felideon: yeah

13:10 kzar: It's crap in a million ways but check it out, first version of my drum machine http://kzar.co.uk/static/davesteppa/

13:10 alexyakushev: technomancy: oh, sorry, it actually worked. My bad, got mixed among all this maps being printed to the terminal:)

13:11 uvtc: Re. ::foo keywords, n/m. `identity?` tells me they are the same, and also found http://kotka.de/blog/2010/05/Did_you_know_III.html .

13:11 ibdknox: kzar: neat :)

13:11 technomancy: alexyakushev: whew; that means I'm not going crazy

13:11 kzar: You can edit the tracks on the fly, it lets you do different time signitures so you can make some interesting stuff

13:12 ibdknox: kzar: yeah I was surprised by the on the fly editing - well done.

13:12 alexyakushev: technomancy: sorry again:) and thanks for the link to pindah, I can definitely find something interesting there

13:12 kzar: ibdknox: cheers :)

13:13 technomancy: alexyakushev: I got burned out with Pindah because there wasn't a repl available for Mirah, but some of the boring build stuff is implemented nicely there

13:14 mmarczyk: kzar: wow, that's cool!! :-)

13:15 yoklov: kzar: extremely neat

13:17 TimMc: Yay, polyrhythms!

13:20 kzar: :) cheers guys

13:26 cacodaemon: user=> (use 'main)

13:26 IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:494)

13:26 what am i doing wrong? :)

13:27 kzar: cacodaemon: Something in main namespace is treating a symbol like a sequence? Perhaps you're quoting the name for a sequence by mistake?

13:27 Madsy: None of the jogl packages in the Clojars and central can be downloaded. What's up with that?

13:27 duck1123: cacodaemon: is this clojurescript?

13:27 Madsy: I tried 2.0-SNAPSHOT and 2.0-rc3

13:27 cacodaemon: no, just clojure

13:29 ah, figured

13:29 yes, error was in "main" namespace

13:30 duck1123: just as a note, it's generally best to try to avoid single segment namespaces

13:31 there's an issue, I think with AOT or something.

13:32 cacodaemon: yes, i know. Just cannot force myself to make decent namespaces and +1 dir level:)

13:33 Bronsa: looks like richard stallman had a heart attack

13:34 cacodaemon: trouble with ISeq/symbol was in name clash - deftype from clojure.core and deftype from clojure.contrib.generic

13:34 dnolen: mmarczyk: what about advanced?

13:34 kzar: Bronsa: literally?

13:34 Bronsa: yeah

13:35 http://www.i2cat.net/ca/multimedia/201205/richard-stallman-conference

13:35 kzar: shit

13:35 felideon: Bronsa: how do you know it was a heart attack

13:36 Bronsa: well, it's all over twitter.

13:36 pandeiro: ,(rest '[1 ([2] [3] [4])])

13:36 clojurebot: (([2] [3] [4]))

13:36 pandeiro: ,(nth '[1 ([2] [3] [4])] 1)

13:36 clojurebot: ([2] [3] [4])

13:36 duck1123: yeah, that doesn't give much to go on there

13:37 pandeiro: ,(second '[1 ([2] [3] [4])])

13:37 clojurebot: ([2] [3] [4])

13:38 dnolen: mmarczyk: that patch is nice though that's not the call site optimization I had in mind.

13:39 mmarczyk: patch for 247 is really the patch for 246, if you move that, I'll happily apply.

13:43 wkmanire: pandeiro: Are you a musician?

13:43 pandeiro: pandeiro: amateur, bad one, yes i guess

13:44 wkmanire: pandeiro: talking to yourself?

13:44 he he

13:44 pandeiro: always :)

13:44 sorry yeah i am trying to debug a macro for the first time

13:44 wkmanire: pandeiro: Which city are you in? I'm in Cuiabá.

13:45 pandeiro: I still haven't learned the macro forms.

13:45 pandeiro: is it just me or is it 10x harder than debugging a fn?

13:45 i am in sp

13:45 wkmanire: pandeiro: Oh ok. Too bad. It'd be fun to get a beer and talk about clojure stuff.

13:46 pandeiro: wkmanire: definitely! one day i'd like to start a group here

13:46 wkmanire: I've spoken with some developers here, most use Java or Python.

13:47 pandeiro: dont forget php

13:47 wkmanire: I haven't met anyone on the streets that uses clojure yet.

13:47 TimMc: pandeiro: macroexpand-1, and lots of printlns...

13:47 wkmanire: pandeiro: I was talking about programming langauges.

13:47 languages*

13:47 scriptor: scala is getting increasingly popular around here

13:47 pandeiro: TimMc: macroexpand-1 assumes you have something that doesn't throw an exception

13:47 technomancy: scriptor: where's "here"?

13:47 pandeiro: wkmanire: i like your sense of humor... dry...

13:47 TimMc: That's where the printlns come in. :-P

13:47 wkmanire: pandeiro: :D

13:47 scriptor: technomancy: nyc, though it's probably spread beyond that too

13:48 both tumblr and meetup use it, for example

13:49 TimMc: Java++

13:49 ^ my impression of the language from the little I've seen

13:52 wkmanire: pandeiro: Did you see on the news? They arrested an American in rio for racking up 15,000 R$ of hotel services and then trying to leave the country.

13:53 pandeiro: R$6000 worth of caipirinhas.

13:53 I can't believe one person could drink that much alcohol on one tourist visa stamp.

13:55 pandeiro: wkmanire: i'm hoping they don

13:55 ...dont know i'm hiding here in sp

13:56 it's very easy to say yes when they offer you a second caipirinha

13:57 dpritchett: What's the idiomatic way to collect input via read-line until the user enters a special exit sequence (e.g. "")

13:57 wkmanire: pandeiro: What about when they offer you a 33rd caipirinha?

13:59 pandeiro: He he he, he was here for a heart treatment. ha ha hah too much. lunch time.

14:08 pandeiro: ibdknox: you were right, i was greatly overcomplicating how body was bound in defpartial; updated pull req

14:09 nDuff: Hrm.

14:09 * nDuff is frequently having swank jump directly to "Evaluation aborted", without providing a stack trace.

14:12 rhc: nDuff: i had that problem too recently

14:12 technomancy: nDuff: that's a bug in clj-stacktrace

14:12 haven't been able to reproduce it consistently

14:12 mmarczyk: dnolen_: reattached that patch to 246

14:12 dnolen_: sorry for the confusion

14:12 rhc: nDuff: sometimes poking around clojure.stacktrace reveals it

14:14 fliebel: A while back, some Clojure guy tweeted a video of a sketching machine with switches, flickering lines, a pen and a screen. Any ideas?

14:14 Very old thing. It showed some guy drawing a square, and the square correcting itself.

14:14 matessim: I'm a bit confused about commutes, basically the best time to use a commute is when i don't care about the order of transactions, but the amount of the transactions?

14:15 mmarczyk: dnolen_: I'll do the real 247 too, btw

14:17 matessim: commute won't increase that and might decrease it; on the other hand, if commute *guarantees* an extra evaluation of your function, so with low contention (low enough that alter wouldn't retry much) it might do more computation than alter

14:18 dnolen_: (reattached after adjusting ticket no. in the commit message, that is)

14:18 matessim: hmm

14:19 i seem to be missing the difference commutes have, since both alter and commute would rerun if the start value changed on commit time

14:19 right?

14:19 clojurebot: flatten |is| rarely the right answer. What if your "base type" is a list

14:20 matessim: both would rerun on the latest ref*

14:21 rhc: matessim: i dont think commute would ever need to rerun

14:21 matessim: it can just run once the transaction is completed

14:21 err, when the transaction is completed

14:22 matessim: but transactions can run asynchronously, right? This is why this "problem" exists?

14:23 i must have understood you wrong, because it sounds to me that your saying like the transactions are queued and run one after another(which is not what you mean probably).

14:24 rhc: i'm saying transactions "execute" all of their operations (ref-set, alter) at the same "time", but commute lets you say "i don't care what time this happens, as long as it happens once for this transaction"

14:24 i'm pretty new to clojure so i could be wrong about this too :)

14:25 you dont care about the time because the operation is commutative

14:25 like say you had a transaction that moved money

14:25 and there was also some global state like "how much money has ever been moved"

14:26 so you (dosync (let [m (remove-from-a)] (add-to-b m) (commute all-money-moved + m)))

14:26 matessim: but the documentation says that if another transaction was commited,the transaction local value is discarded

14:27 and the mutation operation is applied again

14:27 rhc: if two of those are running at the same time, you really dont care what the order of adding all-money-moved is

14:27 matessim: isn't this equal to rerunning the transaction?

14:27 rhc: where do you see that?

14:27 i'm looking here http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/commute

14:28 matessim: http://en.wikibooks.org/wiki/Learning_Clojure/Concurrent_Programming

14:28 a commute operation applies a mutating operation to a Ref, changing its value for the remainder of the transaction like normal, but the commit will not fail on account of commits to this Ref by other transactions: if no other transaction has committed to the Ref, this transaction's local Ref value is committed; otherwise, the transaction-local value is discarded and instead the mutating

14:28 operation is applied again, this time to the new current Ref value, and the resulting value is committed.

14:28 i might be confusing the transaction scope with the commute scope.

14:28 i think i am.

14:29 rhc: ah yeah, its just re-running commute only

14:29 not the rest of the transaction

14:29 matessim: and the other versions

14:29 rerun the transaction?

14:29 rhc: yeah, i think so

14:29 like ref-set

14:29 will have to re-run the transaction

14:30 because the state of the world has changed and the logic of your transaction might want to do soemthing different now

14:30 matessim: so commutes are better if i'm doing any sort of I/O for example, right?.

14:30 rhc: things like bumping a counter, appending a log, building an unordered set/list are all good applications of commute

14:30 matessim: when i'm not going to get double input for each transactions

14:30 transaction*

14:30 rhc: i'm not sure what you mean

14:31 matessim: when before the commute in the transaction, i have something that requires a very large resource overhead for example.

14:31 lets say reading from a disk.

14:31 i wouldn't want to reread the disk every time another transaction is writing to it.

14:33 man clojure is awesome.

14:34 TimMc: matessim: You'd generally avoid I/O inside a transaction, though.

14:34 matessim: I've seen the doc says something about it being retired.

14:34 transactions retired

14:35 TimMc: retried?

14:35 matessim: not as in depractated i assumed, but i couldn't figure out what it means

14:35 TimMc: Oh, "retired", really?

14:35 matessim: "I/O and other activities with side-effects should be avoided in transactions, since transactions will be retried"

14:35 gfredericks: typo for "retried"?

14:35 matessim: wat

14:35 lol

14:35 gfredericks: braino for "retried"?

14:35 TimMc: haha

14:35 matessim: no, typo for i can't read.

14:36 but why should it be avoided if i'm using commutes anyway

14:36 TimMc: Reminds me of http://i.imgur.com/vKy5j.jpg

14:37 matessim: LOL

14:37 rhc: hah

14:37 matessim: well, the commute function can still be called twice, so you don't want to put anything in there that has side effects

14:38 same with everything else inside a transaction

14:38 matessim: if i use alter and commute in the same transaction i basically risk losing the advantage of commute right?

14:38 TimMc: If you use them on the same ref, yes.

14:39 On different refs, no -- as long as other transactions are not hammering on the ref you alter in the first one.

14:39 matessim: By the way, read about ##(doc ensure) -- it's good to know about.

14:39 lazybot: ⇒ "([ref]); Must be called in a transaction. Protects the ref from modification by other transactions. Returns the in-transaction-value of ref. Allows for more concurrency than (ref-set ref @ref)"

14:40 matessim: oh wait braindamage incoming...

14:40 multiple refs modification in the same transaction

14:40 how is that not messy as hell?

14:40 rhc: whats the whole point of transactions :)

14:40 matessim: but if i have many refs being changed

14:40 and many transactions going on

14:41 i could be hammering the rerun button

14:41 running transactions many time

14:41 rhc: yep

14:41 concurrency has its limit when you want consistency

14:41 TimMc: As I understand it, this isn't a problem in practice. People don't use STM as much as you might think, and transactions execute quickly.

14:41 matessim: CAP Theorem :P

14:42 TimMc: Nah, there's no P here.

14:42 matessim: No TimMc, i'm a complete newbie

14:42 well, to Clojure

14:42 TimMc, isn't speed relative? if i have large transactions etc, possibly taking multiple miliseconds

14:43 and a few transactions

14:43 and alter on like 3 refs

14:43 i'd be setting myself up for a disaster wouldn't i?

14:43 nDuff: Are protocol implementations required to be inline for records? I have one created using extend-type, but trying to use it results in an IllegalArgumentException ("No implementation of method: ...")

14:44 TimMc: matessim: I would *guess* that in the worst case, your transactions would serialize.

14:44 matessim: by that you mean they'll get queued?

14:44 after a few tries? automagically?

14:45 nDuff: ...shows up on (:impls ProtocolName) just fine...

14:45 TimMc: matessim: I'd have to guess. I don't really know the answer.

14:45 matessim: what did you mean by serialize?

14:46 i must have misunderstood.

14:46 TimMc: Run one-at-a-time.

14:46 Which isn't the same as queuing, since that implies a specific strategy for serialization.

14:50 matessim: but basically what you're saying is, that Clojure would automatically manage to finish all my transactions

14:51 that it would fallback to a strategy that is less parallel

14:51 craigbro: hola

14:51 amalloy: nDuff: no, you can extend. you must have the syntax wrong

14:51 dpritchett: Anyone in the mood for some lighthearted code golfing? I wrote this same program in 14 lines of Python and now my clojure script is 40: https://gist.github.com/2655066

14:54 craigbro: err, never mind, logged in to ask question that was solved by updating my copy of tools.logging

14:54 amalloy: dpritchett: i can shrink the line count a lot by taking out the newlines that are in crazy places. or you could reduce it all the way down to 1 by taking them all out - take that, python!

14:54 dpritchett: yeah, maybe i can gzip it too

14:55 seriously though, i only barely managed to make it work in clojure

14:55 amalloy: also, don't you python guys love list comprehensions? ours are really good, and you'll probably be more comfortable with `for` than with a bunch of filters and maps

14:55 dpritchett: my super-simple-not-idiomatic python code was 25 lines, my idiomatic one was half that

14:55 yeah i love list comps

14:55 i just didnt know how to implement "take input until the user enters a blank line" any other way

14:56 amalloy: (defn letter-grade [avg] (first (for [[score label] cutoffs :when (<= score avg)] label)))

14:56 (for example)

14:57 dnolen_: mmarczyk: thanks

14:57 amalloy: (defn collect-test-scores [] (map read-string (take-while seq (repeatedly #(do (println ...) (read-line))))))

14:58 jtoy: where is lein stored ? when I do "which lein" i get nothing returned but I'm able to use it

14:59 technomancy: jtoy: it's stored wherever you want to put it

14:59 jtoy: shouldn't which find it?

14:59 i don't remember, hence looking

14:59 amalloy: jtoy: if which doesn't find it, but it runs anyway, your operating system is to blame

15:00 most people put it in ~/bin

15:00 jtoy: its in my ~/bin is it ok to do a system wide install?

15:00 technomancy: sure

15:01 amalloy: i guess my collect-test-scores isn't incrementing and printing the score number, though, dpritchett

15:01 robertstuttaford: in my json api, i have /resources/uuid and /resources/uuid/version

15:01 hiredman: for really should except :where as a synonym for :when

15:01 robertstuttaford: i'm guessing i can multimethod this?

15:01 Raynes: Extra extra, read all about it. Latest is that Richard Stallman had a heart attack during a conference a little while ago.

15:01 robertstuttaford: oh dear

15:02 dpritchett: amalloy fwiw my original python implementation was hard coded to take range(1,5) inputs

15:02 so i guess thats a few lines lost

15:02 and the python was only a single function since I was able to assign new variables willy-nilly mid-function

15:02 like halfway down the page it said average_score = float(sum(scores)) / len(scores)

15:04 jtoy: cool, thx

15:04 jsabeaudry: Is noir 1.3 ready for prime time?

15:04 Raynes: Yes.

15:04 Go get you some.

15:04 jsabeaudry: Yay!

15:05 Raynes, beta6 is the way to go?

15:05 amalloy: dpritchett: you don't really need any of these extra functions in clojure either, but clojure does encourage you to use smaller functions

15:06 Raynes: If you don't use small functions, children cry.

15:06 But if you're okay with children crying, you can certainly not use small functions.

15:06 Licenser: I think it depends on how loud they cry and how far they are away

15:08 Raynes: Licenser: If you write something as long as doseq, the child tells his teacher that you beat him.

15:08 Work backwards from there.

15:08 Licenser: oi

15:09 kenneth: hey, do you have to use clojure to serve clojurescript stuff?

15:09 Madsy: Sigh.. anyone have an idea how I can install jogl from upstream (NOT maven or central) and make leiningen find it?

15:09 dpritchett: i like using small functions too. fwiw my python implementation was a single function partially beacuse i was demoing it to someone who doesnt knwo what functions are: https://gist.github.com/2655066

15:09 kovasb: kenneth: no, you can just compile the clojurescript to js and serve that as static files

15:09 dpritchett: err scroll down to the second file to see the difference

15:10 plus i guess i punted on handling a variable number of inputs in python. gotta figure that one out...

15:10 Raynes: kenneth: Clojurescript compiles directly to Javascript, with which you can do and use as you please.

15:10 Licenser: kenneth no but it's simpler

15:10 Raynes: It doesn't have to be used in conjunction with JVM Clojure, but they make an excellent pair.

15:11 Part of the excitement with Clojurescript is to be able to use Clojure on the server and client side.

15:11 * Licenser is using clojurescript with erlang and I don't find ti a very pleasurable erperience

15:11 kenneth: not in my case Licenser :)

15:11 Licenser: kenneth replace erlang with *

15:11 Raynes: Well, don't hype too much Licenser.

15:11 ;)

15:11 kenneth: yeah i definitely want to go more full stack with it, but for now i'm stuck dealing with a massive legacy codebase

15:12 Licenser: Raynes I did erlang before ti was cool :P

15:12 Raynes: Legacy smegacy. Delete it all and write it in three lines of Clojure.

15:12 kenneth: deploying on hundreds of jvm-less servers :p

15:12 Raynes: Then quit your job and live on a mountain.

15:14 amalloy: dpritchett: you seem to be comparing a python implementation of X with a clojure implementation of X, Y, Z, and some more letters

15:15 Raynes: I'm particularly interested in your implementation of U and P.

15:15 dpritchett: fair enough amalloy, i updated the python in the gist to match the same functionality.

15:16 I would like to learn Clojure to the point where my clojure implementation looks better than the python one

15:17 Raynes: ibdknox: six thousand dollars away from light table euphoria.

15:17 ibdknox: Better get your announcement prepared. Make hacker news explode, implode, black hole, and every other strange thing.

15:17 amalloy: for one i'd put all of your side-effectful code in one function, and then pass the data to a pure function for computation

15:19 robertstuttaford: i've been programming clojure for two days solid and i'm still not dead

15:19 Licenser: which remidns me I need to kick in somehting for ligthtable

15:20 ibdknox how aout erlang support? *ducks*

15:20 Raynes: I've noticed that lately I don't even consider that it is possible to write code without isolating side effects and writing the rest as pure computations. I put hair gel on and wear sunglasses when I write Ruby because I feel so rebellious.

15:20 Licenser: Raynes hint: don't write ruby

15:20 Raynes: Licenser: Erlang is pretty dynamic. I'd be interested in seeing if it would be possible.

15:20 Licenser: https://github.com/Raynes/refh

15:21 AimHere: I put on a clown costume and greasepaint when I touch javascript

15:21 Madsy: Anyone? Is it possible to make leiningen find a third-party java library that I have put in a custom path, i.e *not* installed from maven. I assume I have to add to leiningen's classpath.

15:21 Licenser: Raynes you could have written that in pure shell

15:21 craigbro: anyone using clj-loging-config to log to multiple appenders?

15:21 ache: what's your general name for the lisp instance to which a new def is added when you define something? do you call it "the instance" or "the lisp instance" or something else?

15:21 craigbro: I can't seem to get that working. Always appends to the first one

15:21 Raynes: Licenser: And shell is better than Ruby? I'd just write it in clojure-py if clojure-py wasn't crazy slow to start up.

15:21 * robertstuttaford writes PHP (legacy yuck), Ruby and GClosure-style javascript right now

15:21 * robertstuttaford hopes to replace all of that with CLJ and CLJS

15:21 Raynes: Licenser: One thing about Ruby is that it is cross platform while BASH is not.

15:21 Licenser: Raynes yes it means i could use refh on my server :P

15:22 robertstuttaford: on clojurescript, are there any issues with it that would prevent widespread use?

15:22 known browser issues, for example

15:22 Raynes: Licenser: Well, you can actually just use curl. So, it's probably a one liner script unless you want to do fancy things.

15:25 technomancy: Madsy: you could try lein-localrepo, but I'm not sure it would work for dependencies with native components

15:25 Licenser: anyone using tramp (emacs ssh thingy)?

15:25 yoklov: robertstuttaford: None I've run into. Only thing I can think of that people are usually uncomfortable with is gclosure, and you said you already use it.

15:26 And some stuff probably is slower in older browsers.

15:27 rvgate: I'm trying to understand the comp function, can someone explain me step-by-step why this: (let [x 8 y 3] ((comp + - -) x y)) returns -5?

15:28 to simplify: ((comp + - -) 8 3)

15:28 xeqi: &(+ (- (- 8 3)))

15:28 lazybot: ⇒ -5

15:28 Raynes: xeqi: Dude. I was almost done typing that.

15:29 Bronsa: me too.

15:29 Raynes: You took that from me. I hope you're happy with yourself.

15:29 xeqi: very

15:29 Raynes: rvgate: comp composes functions. The result of the first function is passed to the next and then the result of that to the next and so on down the chain.

15:30 &(- 8 3)

15:30 lazybot: ⇒ 5

15:30 Raynes: &(- 5)

15:30 lazybot: ⇒ -5

15:30 Raynes: (+ -5)

15:30 &(+ -5)

15:30 lazybot: ⇒ -5

15:30 Bronsa: http://www.publico.es/ciencias/432664/richard-stallman-rajoy-nos-quiere-matar-a-todos

15:30 Raynes: That's what happens step by step.

15:30 Bronsa: so it wasnt a heart attack after all

15:30 TimMc: &(#(+ (- (- % %2))) 8 3)

15:30 lazybot: ⇒ -5

15:30 TimMc: rvgate: ^ it's more like that

15:30 Raynes: I don't speaka the spanisha.

15:30 Bronsa: me neither

15:30 rvgate: lol

15:30 this help is to much

15:31 xD

15:31 TimMc: "The president of the Free Software Foundation has begun to feel ill, apparently due to a power surge"

15:31 Bronsa: but since i speak italian i can understand what's going on

15:31 TimMc: ...

15:31 rvgate: thx for the help!

15:31 Bronsa: lol

15:32 Raynes: TimMc: Yeah, I didn't quite get that either.

15:32 AimHere: A power surge?

15:32 Raynes: TimMc: I didn't realize he was *that* plugged in.

15:32 Bronsa: hypotension

15:32 TimMc: This article must be wrong, RMS connects to the internet through a UPS.

15:33 AimHere: Slightly out of date, BTW, RMS is apparently well, though in hospital

15:33 michaelr`: lsd overdose?

15:36 dnolen_: mmarczyk:

15:36 mmarczyk: ping

15:36 michaelr525: running "lein run" in a webnoir website sometimes takes ages for the server to start, anyone knows why?

15:37 i guess it's compiling or loading jars or something, right?

15:38 mmarczyk: dnolen_: pong

15:38 dnolen_: mmarczyk: actually sorry one second

15:38 mmarczyk: sure

15:45 dnolen_: mmarczyk: k so I see a slowdown with 274 applied

15:46 mmarczyk: you shouldn't be accessing the property if the bit mask succeeds

15:46 mmarczyk: just call.

15:49 craigbro: michaelr525: It's loading all the views probably, and all the models

15:49 michaelr525: and all the things they depend on etc..

15:52 mmarczyk: dnolen_: hm

15:53 dnolen_: as far as I can tell, if the bit test succeeds, there is no property lookup

15:53 dnolen_: mmarczyk: I'm double-checking

15:54 mmarczyk: dnolen_: `(or (unsafe-bit-and (. ~(first sig) ~msym) ~bit) (. ~(first sig) ~(symbol (core/str "-" slot)))) -- the whole test for the fast path protocol case

15:55 Raynes: michaelr525: Takes a long time in comparison to what? Other Clojure applications?

15:55 The JVM takes a long time to start up even without noir.

15:56 But you can also factor in the loading of your views and everything they load in turn, as well as the loading of jetty and starting the server.

15:56 mmarczyk: dnolen_: what's the test that slows down? and compilation settings?

15:56 dnolen_: mmarczyk: advanced slows down

15:56 on V8

15:57 mmarczyk: :-(

15:58 Raynes: $seen brehaut

15:58 lazybot: brehaut was last seen quitting 14 hours and 15 minutes ago.

15:58 mmarczyk: dnolen_: any particular benchmark?

15:58 dnolen_: mmarczyk: yeah, sorry actually the emitted code looks good - but I'm not seeing a speed improvement.

15:58 mmarczyk: I had a bunch of tests lying around for rest fn, calling seq on cons, calling nth on vector - everything got slower.

15:58 mmarczyk: dnolen_: back to the drawing board then.

15:58 gfredericks: 4clojure doesn't have a "next problem" button?

15:59 Raynes: gfredericks: Part of the fun is incrementing the number.

15:59 fliebel: Why is clojure-py written from scratch, rather than based on cljs? (which is close to cinc afaik)

15:59 Raynes: fliebel: Does clojure-py compile to python code?

15:59 mmarczyk: dnolen_: I benchmarked a bunch of first / rest / seq / next-involving expressions and they seemed to get faster; oh well.

15:59 fliebel: Raynes: erm, no, byte code.

15:59 Raynes: fliebel: That's probably why.

16:00 dnolen_: mmarczyk: do you have gist? I'll copy them and try them out as well.

16:00 Raynes: Unless cljs's compiler can be made to emit bytecode, which is entirely possible.

16:00 I don't know how that stuff works.

16:00 mmarczyk: dnolen_: just a sec

16:00 dnolen_: Raynes: it could.

16:01 Raynes: In that case, I haven't a clue.

16:02 mmarczyk: dnolen_: https://gist.github.com/2598523

16:02 fliebel: optimization? Python being a primary Google language, in wonder why there is no closure/guava for Python.

16:03 dnolen_: mmarczyk: thx

16:07 mmarczyk: on my machine, I see faster timing prior to the patch.

16:07 mmarczyk: I updated V8 to HEAD last weekend.

16:07 Raynes: Holy crap. I just realized I have a really good use of debugging!

16:08 mmarczyk: dnolen_: well, you're more up-to-date than I am :-)

16:08 Raynes: For the first time in my entire career, I want a breakpoint. My life is forever changed.

16:10 mmarczyk: dnolen_: just goes to show that a rigorous timing methodology would be useful... I've just run this test suite on node and there's no competition -- 233 ms w/ patch vs. 337 on master

16:11 dnolen_: I'll spend some time making sure I've got the latest V8 / JSC / SM and maybe finally come up with a somewhat publishable testing setup

16:11 dnolen_: mmarczyk: on which test? 233ms on which test?

16:11 mmarczyk: dnolen_: -first

16:11 dnolen_: mmarczyk: what kind of machine do you have?

16:12 mmarczyk: on my machine -first on list is 39ms, w/ patch 70ms

16:12 mmarczyk: wow

16:13 i5 -- the kind before sandy bridge

16:13 dnolen_: mmarczyk: yes a more rigorous performance setup would be great - especially one that documented OS + arch

16:13 mmarczyk: dual 2.66 i7 here

16:14 mmarczyk: Ubuntu 10.10

16:14 dnolen_: mmarczyk: particularly we're getting into that territory where we're trying to shave off from every last little corner :)

16:14 particularly since

16:14 mmarczyk: yeah :-)

16:14 that's actually not a bad spot to be in :-)

16:15 Raynes: mmarczyk: So, can cljs beat the Enterprise in a foot race at this point?

16:15 mmarczyk: what do you mean

16:15 the Enterprise *is* programmed in cljs

16:15 Raynes: Naw, it's old. COBOL legacy.

16:16 dnolen_: mmarczyk: I'm more optimistic about call site protocol inlining - but we'll see what he code size hit is.

16:16 mmarczyk: Raynes: oh, you didn't mean http://en.wikipedia.org/wiki/Starship_Enterprise ?

16:16 Raynes: I did.

16:17 mmarczyk: whoosh then :-P

16:17 Raynes: mmarczyk: Did my cobol comment not make sense?

16:18 mmarczyk: oh sure, after a moment ;-)

16:18 Raynes: You said the Enterprise was programmed in cljs, and I countered by saying that because the Enterprise is an old ship, it is most likely programmed in COBOL. Just for anyone who didn't get it.

16:18 mmarczyk: I've led a sheltered childhood, only hearing about COBOL from travellers from far away, who have somehow managed to get over the horror :-P

16:18 dnolen_: yeah

16:19 dpritchett: the majority of my team programs in cobol

16:19 well, xgen and cogen

16:20 which are apparently dialects that compile to cobol

16:20 mmarczyk: how eerie

16:21 * gfredericks got to 4clojure problem 21 before anything failed

16:22 Raynes: gfredericks: Is the site still up?

16:22 rvgate: Am i the only one that thinks documentation like: "Applies fn f to the argument list formed by prepending args to argseq." is to cryptic?????

16:22 Raynes: Not really.

16:23 rvgate: so im not really the only one? :P

16:23 gfredericks: Raynes: must be I'm using it

16:23 Raynes: You're probably not the only one, but it makes sense to me. *shrug*

16:23 gfredericks: oh whoops

16:23 by "failed" I meant the unit tests

16:23 not the web app

16:24 mdeboard: rvgate: No, you're not the only one at all. It's not the best documentation ever. It's worth picking up a book on Clojure vice relying on online documentation.

16:24 Raynes: gfredericks: I thought you did, but 4Clojure spends more time in purgatory than it does on Earth, so I wasn't sure.

16:25 craigbro: I find the clojure.org website docs, and the src code are the best bets

16:25 Raynes: I'd like to get it running on Heroku as some point which should do wonders to keep it up, but unfortunately I can't run the site on my computer for some reason.

16:26 clojure.org is so wildly inappropriate for a new Clojure programmer to learn from that it is amazing.

16:26 dpritchett: rvgate i usually try clojuredocs.org if a heredoc doesnt make any sense to me. sample code helps a ton

16:26 craigbro: agreed

16:26 gfredericks: Raynes: my coworker is using it right now to learn clojure and likes it

16:26 craigbro: i's a reference

16:27 AimHere: To be fair, I don't see anything on the frontpage of clojure.org that claims to be a tutorial

16:27 craigbro: I learn languages from references

16:27 tutorials usually just annoy me

16:27 but I've done alot of lisp and functional programming, so I didn't have to pick up all that

16:28 it was mostly about learning to data structures, abstract data types, and the libraries

16:29 on that note...

16:29 thanx yall

16:30 aperiodic: i essentially learned clojure from clojure.org, but i recognize that i'm weird

16:30 Null-A: I like the succinct explanations

16:30 nelson-: hi guys, I'm having issues with leiningen on osx

16:31 Raynes: Tell us of your troubles.

16:32 nelson-: When I try to install swank

16:32 michaelr525: Raynes: well, it's really a small site with a few views but it takes minutes to load

16:32 Raynes: michaelr525: Minutes sounds wrong.

16:32 If you mean actual minutes.

16:33 michaelr525: yeah

16:33 Raynes: Do you have the code anywhere?

16:33 michaelr525: nope

16:34 could be dropbox somehow affecting it?

16:34 Raynes: Well, my best guess is that one of your views or something they load in turn is doing some really big computation when they get loaded.

16:34 nelson-: let me start again, I'm following one of the many tutorials online to get started with Clojure, my issue is when I try to swank to work with emacs

16:34 Raynes: I'd start taking stuff out until it stops taking forever.

16:34 michaelr525: yeah, good idea :)

16:34 Raynes: What tutorial is that?

16:34 Because the vast majority of them are outdated and incorrect.

16:35 nelson-: Raynes: http://rockhoppertech.com/blog/learning-clojure-setting-up-the-emacs-on-osx/#osx

16:35 S11001001: the emacs?

16:36 nelson-: when I try to install lein-swank through leiningen I get the following erro: [INFO] Unable to find resource 'lein-swank:lein-swank:jar:1.4.4' in repository central (http://repo1.maven.org/maven2)

16:36 Null-A: nelson-: INFO] Unable to find resource 'lein-swank:lein-swank:jar:1.4.4' in repository central (http://repo1.maven.org/maven2)

16:36 Including lein-swank-1.4.4.jar

16:36 Created lein-swank-1.4.4.jar

16:36 i think it succeeded

16:37 nelson-: and when I use lein search i get no output

16:37 Raynes: Are you stopping it before you get output?

16:37 nelson-: I installed leiningen through homebrew

16:37 Raynes: Because it takes a long time to download stuff.

16:37 nelson-: no

16:37 PeregrinePDX: Heya brehaut

16:37 Raynes: brehaut! My buddy! My pal!

16:37 nelson-: Raynes: I get that error immediately

16:38 Raynes: nelson-: Can you paste the entire output to https://www.refheap.com for me?

16:38 PeregrinePDX: Well lein-swank isn't on the maven repository. So it should continue on to check on clojars

16:38 Raynes: Assuming that isn't all it says.

16:38 brehaut: hi PeregrinePDX , raynes

16:38 Raynes: That's why I want to see what else it says.

16:39 Yes.

16:40 Er, wrong channel.

16:41 nelson-: Raynes: https://www.refheap.com/paste/2683

16:41 for instance when I use search, I get no output. Is it because search only uses the maven repository?

16:42 Raynes: I meant the output where it says it can't find lein-swank.

16:43 nelson-: Raynes: :ashamed: that seems to be working, I just thought that because of the first info message it wasn't working

16:43 Raynes: Ah, good.

16:44 Not sure about lein search. technomancy can probably help with that when he comes around.

16:45 nelson-: Raynes: Ok :). Thank you for your precious help.

16:46 gfredericks: awww. Raynes' help is so precious.

16:46 Raynes: I can't help it I'm adorable.

16:47 PeregrinePDX: Lein search doesn't seem to find any of the lein-* packages for me but it does find things that are on clojars for example noir.

16:47 So I think it doesn't find the lein plugins for some reason.

16:48 nelson-: Raynes: One more question. Is there any book you recommend for learning clojure, for someone with previous programming experience in python/java?

16:49 Raynes: Clojure Programming is the latest and greatest.

16:49 nelson-: Raynes: Once again, thanks :)

16:50 Null-A: nelson-: joy of clojure

16:51 Raynes: The Joy of Clojure is best reserved as the next step after Clojure Programming and similar books.

16:52 gfredericks: affectionately not referred to as "Jojure"

16:52 Null-A: Yah I just read the TOC for clojure programming, that's probably the best newbie book

16:52 also the coverage of web programming is very pleasing to the masses

16:54 * gfredericks realizes "joy of clojure" could be abbreviated "ooojure"

16:54 PeregrinePDX: Just as a counterpoint. I've been having good luck with Programming Clojure second edition by Stuart Halloway

16:54 Null-A: all 3 beeks are awesome

16:54 books*

16:55 * nDuff disagrees -- finds understanding the "why" (Joy of Clojure) necessary to have enthusiasm for buckling down to learn the "how" (Clojure Programming)... but maybe that's just me.

16:55 Raynes: Second edition is mostly by Aaron Bedra, right?

16:56 nDuff: You can google the why. Some people just want to code things first.

16:56 PeregrinePDX: Hmm he is also credited.

16:56 I dunno who it is mostly by.

16:56 Raynes: PeregrinePDX: Well, the base material is Stuart Halloway, but the updating and adding done for the second edition is, IIRC, Aaron Bedra.

16:56 PeregrinePDX: Fair enough. I should have credited both authors.

16:58 I admit not having to pay for the book I have is a lot of why I have the one I do.

16:58 Work kindly provided the book to me.

16:59 brehaut: thats a good reason :)

17:01 nDuff: nelson-: ...even if you _do_ start with Joy of Clojure, you'll want to work Clojure Programming in at some point -- goes into lots of useful practical points that JoC doesn't cover; I think it's a question of whether you're more of a top-down or bottom-up learner.

17:02 eggsby: JoC rules

17:02 probably JoC if you have a functional background, something like Clojure in Action if you don't

17:02 * nDuff wholeheartedly agrees

17:02 eggsby: or ya Programming Clojure

17:03 nDuff: Programming Clojure > Clojure In Action (IMHO, of course)

17:03 eggsby: I haven't read the former

17:03 why does wikipedia say RMS is dead

17:03 oh it doesn't anymore

17:03 brehaut: because wikipedia is full of loons ?

17:03 AimHere: Because wikipedia regularly say X is dead

17:03 pipeline_: he had a heart attack today

17:03 nelson-: Thanks guys, I will look into your suggestions

17:04 eggsby: hi pipeline_

17:04 AimHere: He took a funny turn, went to hospital, nothing serious.

17:04 technomancy: PeregrinePDX: the tokenizer for the search task is not quite right; we have someone working on an opet issue for that

17:04 open

17:05 gfredericks: http://en.wikipedia.org/w/index.php?title=Richard_Stallman&diff=491869423&oldid=491859935

17:06 that's a pretty solid death edit. I wonder if somebody has a script for that.

17:06 talk about an eerie diff

17:07 AimHere: Heh, I've used "John Galt" as a nickname when trolling Wikis too

17:07 nelson-: Hi technomancy. Can you tell me whats wrong with my setup, because when I use lein search I get no output, for instance lein search lein-swank returns nothing.

17:08 AimHere: Glad to see someone's carrying on the tradition

17:09 technomancy: nelson-: it could be a tokenization problem; does `lein search swank` show output?

17:09 nelson-: let me try it out

17:09 technomancy: No :S

17:09 PeregrinePDX: It doesn't for me either

17:10 technomancy: gfredericks: someone's been practicing

17:10 nelson-: what does `ls ~/.lein/indices` give you?

17:11 nelson-: technomancy: http___clojars.org_repo_ http___repo1.maven.org_maven2

17:11 technomancy: nelson-: how big is each directory?

17:12 nelson-: technomancy: 238B and 408B respectively

17:13 technomancy: bytes?

17:13 clojurebot: octets, please. calling them bytes is racist.

17:13 technomancy: oops; sorry

17:13 nelson-: that's way too small; must have been a problem downloading them. delete them and try again

17:14 nelson-: technomancy: sorry, 3.1 M clojars and 251M the maven

17:14 technomancy: hm; not sure what's going on then

17:15 nelson-: technomancy: It's a fresh install from homebrew

17:18 PeregrinePDX: nelson does lein search noir work by chance?

17:19 nelson-: PeregrinePDX: yes, it does

17:20 technomancy: nelson-: oh, ok in that case it must just me a tokenization issue

17:20 it's breaking down the words in the query in a slightly different way from the way they were indexed

17:21 https://github.com/technomancy/leiningen/issues/243 <- details

17:21 nelson-: technomancy: Ah ok. That explains it. Thanks

17:28 winkywooster: i have a vector of keyword value pairs (e.g., [:blah 1 :blech 5]) and i'm trying to create a map from that. using (into {} (partition 2 v)) doesn't work though… what should i be doing?

17:28 tmciver: winkywooster: (apply hash-map your-vec)

17:29 winkywooster: tmciver: that was fast… thanks!

17:30 does it break because partition is returning a lazy seq?

17:32 Null-A: winkywooster: #_ (into {} (map vec (partition 2 [:blah 4 :blue 4])))

17:32 into {} expects vector of kvs

17:32 dunno why that is exactly

17:32 winkywooster: so specifically a vector, and not a general seq

17:32 Null-A: right

17:33 winkywooster: thanks, Null-A. still trying to get my head wrapped around the nuances.

17:33 mefesto: ,(into {} (list [:key1 1] [:key2 2]))

17:33 clojurebot: {:key1 1, :key2 2}

17:33 Null-A: winkywooster: generally clojure's nuances are few and far between and have good reasons

17:34 brehaut: pendantry time: conj on maps requires a MapEntry

17:34 Null-A: why can't conj accept 2-list?

17:34 brehaut: is a 2-vector a MapEntry?

17:35 brehaut: ,((comp (juxt identity supers) class)(first {:a 1}))

17:35 clojurebot: [clojure.lang.MapEntry #{java.lang.Runnable clojure.lang.IFn clojure.lang.IPersistentStack java.util.Map$Entry clojure.lang.AFn ...}]

17:35 brehaut: MapEntry is its own class, bit it is a persistent vector

17:35 Null-A: ,((comp (juxt identity supers) class)[1 2])

17:35 clojurebot: [clojure.lang.PersistentVector #{java.lang.Runnable clojure.lang.IFn clojure.lang.IEditableCollection clojure.lang.IPersistentStack clojure.lang.AFn ...}]

17:36 Null-A: so conj accepts MapEntry or 2-vector

17:36 ,(conj {} [:a 1])

17:36 clojurebot: {:a 1}

17:36 Cr8: ,(bean (first {:a 2}))

17:36 clojurebot: {:value 2, :key :a, :empty false, :class clojure.lang.MapEntry}

17:37 brehaut: im pretty sure theres a cast from 2-vector to map entry

17:37 Null-A: perhaps it's for performance reasons that 2-list is not supported

17:39 brehaut: Null-A: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L23-45

17:39 turns out it does have a special case for 2-vectors yet

17:40 s/t$/s/

17:44 Null-A: I was surprised to hear about (read-string "#=(eval (def x 3))") i'm betting this will result in a lot of vulnerabilities in clojure code

17:44 particularly when you read the doc string for read-string, it sounds safe

17:44 brehaut: ,(doc *read-eval*)

17:44 clojurebot: "; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true"

17:45 Null-A: *nods*

17:45 brehaut: so yes its a gotcha

17:45 but its not unavoidable

17:45 Null-A: I would've set the default to false

17:46 brehaut: you could reasonably argue both ways

17:46 the reader is afterall a language feature first, and a serialisation mechanism second

18:13 hiredman: ~ping clojurebot

18:13 clojurebot: clojurebot is amazing

18:13 hiredman: ~good enough

18:13 clojurebot: No entiendo

18:28 rednovae: i need automake help. I'm trying to compile a package and automake tells me "required file './ltmain.sh' not found". ltmain.sh is in /usr/share/libtool/config/ltmain.sh, shouldn't automake --add-missing add this missing file?

18:28 wrong channel entirely i apologize

18:29 i need automake help. I'm trying to compile a package and automake tells me "required file './ltmain.sh' not found". ltmain.sh is in /usr/share/libtool/config/ltmain.sh, shouldn't automake --add-missing add this missing file?

18:30 again, sorry, i'm leaving this channel

18:32 Cr8: is there an automake channel?

18:33 brehaut: its full of weeping and nashing of teeth

18:33 Cr8: that's pretty much my experience with automake, it's just a lot more lonely

18:34 technomancy: it's just a bot that responds "Have you tried turning it off and turning it back on again?" to every line ending in a question mark.

18:34 brehaut: haha

18:37 kenneth: hey, can somebody look at my project.clj? attempting to use clojurescript and it's not compiling as i expect (doesn't create a js file anywhere) https://gist.github.com/9e089f8b8b189bd2e801

18:37 dnolen_: kenneth: do you have at least one source file under the cljs directory with the extension .cljs?

18:38 kenneth: yes. [swizz ~/Dropbox/dev/caffeine/server/cljs•cljs]$ cat src/cljs/main.cljs

18:38 (ns example.hello)

18:38 (js/alert "Hello from ClojureScript!")

18:39 dnolen_: kenneth: :source-path should probably be "src" not "cljs"

18:40 kenneth: it's also wise to follow Java class path conventions.

18:40 kenneth: given the ns declaration you should have - src/example/hello.cljs

18:40 kenneth: dnolen_: i'm not from the java world, is there a good doc somewhere on what exactly those are?

18:41 and i see

18:41 let me try fixing that

18:43 oh

18:43 sweet works now

18:44 dnolen_: kenneth: great

19:13 kenneth: lol my 3 lines of cljs compile into a 20k lines js file

19:14 devn: Is there a way to tell that println will use std out before calling it?

19:15 craigbro: check *out*?

19:15 devn: println is an example, but i was wondering if it's at all possible to check what a fn will do before using it

19:15 craigbro: that's after the fact

19:15 craigbro: (with-out-str (println ...))

19:15 devn: im curious about checking up front

19:15 craigbro: right i know

19:15 craigbro: that will return a string

19:15 devn: yes.

19:15 is it possible to see the future?

19:16 craigbro: well, if you look at *out* you can tell if it's using stdout or not

19:16 if that's what you meant

19:16 hyPiRion: ,(doc println)

19:16 clojurebot: "([& more]); Same as print followed by (newline)"

19:16 craigbro: hehe

19:16 hyPiRion: ,(doc print)

19:16 clojurebot: "([& more]); Prints the object(s) to the output stream that is the current value of *out*. print and println produce output for human consumption."

19:17 devn: it's not. i'm wondering if there's a way to determine if I need to even check *out* prior to calling *any* function

19:17 craigbro: I don't understand your question at all

19:17 devn: lol

19:17 id like to be able to tell /prior to calling a function/ if it will send anything to standard out

19:17 you're telling me how to check after the fact

19:17 but that's the opposite of what im asking

19:17 craigbro: nope, no way oter than decompiling

19:18 and stepping through all the bits

19:18 and even then, nope

19:18 there are ways around that

19:18 hyPiRion: Well, not really. Is it merely a technical question, or has it practical application?

19:19 devn: im running a bunch of stuff in a sandbox and capturing return values

19:19 i realized that if I run (println "foo") in the sandbox ill capture nil as its output value

19:19 id like to avoid checking *out* every single time i run a function because there are many of them

19:20 hyPiRion: many functions or many *out*-streams?

19:20 devn: 100s of thousands

19:20 hyPiRion: (functions I assume?)

19:21 devn: expressions would be more accurate

19:21 but yeah, lots and lots and lots

19:22 craigbro: devn: use a macro and evaluate in the sandbox properly

19:22 devn: it'd be cool to say "okay this statement contains a call to #'println, so im going to capture *out*"

19:22 craigbro: if you are running in a snadbox, you control evaluation

19:22 devn: heh, nevermind, im going to think about it for a bit :)

19:22 craigbro: you should just always be binding *out* and *err* to new string buffers

19:22 and then you can examine the string buffers

19:23 devn: it's a check i dont want to do every time ideally

19:23 hyPiRion: devn: the expressions are generated at runtime, right?

19:23 devn: that's the point of this question

19:23 craigbro: it's more expensive to see if you should do it

19:23 than to bind *out* and *err* to a stringbuffer

19:23 really

19:23 amalloy: devn: you've already spent more time asking how to do it than you would spend binding *out* a couple hundred thousand times

19:23 craigbro: you are asking to solve a version of the halting problem 8)

19:24 amalloy: plus as craig says it's basically impossible anyway

19:24 devn: lol

19:24 no, i dont think it is, so ill try my idea

19:24 hyPiRion: If the expressions aren't generated runtime (which I doubt), you could hash them into a bloom filter and check for collisions.

19:25 craigbro: just checking for println calls won't do it

19:25 devn: hyPiRion: they aren't generated

19:25 craigbro: i understand that

19:25 craigbro: in effect, no code analysis can

19:25 devn: totally true

19:25 craigbro: unless you are controlling the composition

19:25 devn: but im not going for perfection

19:26 craigbro: if you control the composition of the forms... than sure.

19:27 * devn shrugs

19:27 hyPiRion: craigbro: I would assume you can find out if a function has the possibility to send stuff to *out*?

19:27 devn: it was a question worth asking

19:27 hyPiRion: only to a point though :\

19:28 ,(eval (read-string (apply str (reverse ")\"dlrow olleh\" nltnirp("))))

19:28 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

19:28 craigbro: hyPiRion: not absolutely, but up to the point of catching all but obfuscated code, perhaps

19:29 devn: let me step back a bit -- i started this query way vague

19:29 im talking about functions only available in clojure.core

19:29 craigbro: hyPiRion: but it would be expensive. It's a form of automatic static analysis

19:29 devn: so those could be tagged, but you still have obfuscated versions that could float around out there

19:29 craigbro: yeah, that's the thing

19:29 dnolen: kenneth: if you want to reduce the CLJS footprint you need to use :optimizations :advanced.

19:30 hyPiRion: craigbro: yes, but if they're not generated at runtime, you could allow that penalty during startup.

19:30 craigbro: hyPiRion: the penalty is potentially infinite

19:30 devn: hyPiRion: good point. i suppose i could. since im saving the expresison and its output i should probably just make a couple of passes over my data

19:30 craigbro: hyPiRion: in short, better of running it and catching output

19:31 but wether it outputs or not for any given execution does not tell you if it will for other executions

19:31 althought for a small subset, you could just do it by hand

19:31 clojure.core for example

19:31 devn: craigbro: yeah, but obfuscated code strikes again

19:31 might as well capture *out* and just be done with it

19:32 craigbro: in which case, fuck the attempt to do analysis and just capture

19:32 my day job is malware analysis 8)

19:32 it's much cheaper to just run the shit and collect all it does, as opposed to tryin to divine what it does from the bytes

19:32 devn: creepy smiley face for a malware analyst

19:33 =o)

19:33 craigbro: not sure how that renders in your client, it's my ancient usenet smilee

19:33 devn: craigbro: im just messing with you. i appreciate your opinion, but it's in my nature to say "okay, so you say it won't work... prove it."

19:34 but we're there. checking *out* repeatedly it is.

19:34 craigbro: devn: I don't have to prove it, I just have to convince you it's calssified as a version of the halting problem

19:35 but that's not fun in IRC!

19:36 devn: craigbro: im not sure it is in the specific case im talking about, since i will just halt a thread whenever i see fit (if it's running too long)

19:38 kenneth: is there a cljs core lib somewhere?

19:38 hyPiRion: craigbro: I understand that checking whether it will spit out stuff to *out* is exactly as the halting problem, but you're saying that checking whether it's possible to print to *out* is in the same category?

19:39 (I'm not disagreeing, I just want to get my understanding confirmed ;))

19:39 * devn builds a neural net to dream of forms that print to *out*

19:39 craigbro: hyPiRion: yes

19:39 kenneth: er, documentation* for the cljs core lib

19:40 craigbro: hyPiRion: because you don't know what code it might generate until it generates it 8)

19:40 dnolen: kenneth: not specifically for cljs.core, but most of http://clojuredocs.org/ applies.

19:41 hyPiRion: craigbro: Ahh, I see. (I think)

19:42 devn: if some code is taking its time generating code to generate code that prints to out /me chucks it in a pile of garbage

19:42 so that's why im not overly concerned with some level of analysis up front

19:43 if someone is getting cute with their input, tough. it is no garbage.

19:43 now*

19:43 craigbro: devn: yah, if you are just running against cl.core and don't care if someone escape

19:43 devn: either way, amalloy made a good point. /me goes back to hacking

19:43 thanks craigbro and hyPiRion

19:44 hyPiRion: Good luck on the hacking :)

19:57 JulioBarros: Anybody using mongodb as a session store with noir? I'm a little confused on current libraries.

19:59 kenneth: how do i convert a cljs map to a js object?

20:00 aperiodic: craigbro: the halting problem is only intractable in the general case ;)

20:00 gfredericks: (halts? '(+ 1 2)) => true

20:00 kenneth: also is there a library in cljs for creating html on the fly? (interop w/ query seems unwieldy)

20:00 gfredericks: kenneth: crate

20:01 kenneth: awesome

20:04 gozala1: I'm trying to understand reducers but I just can't get what this `reduced` is or where is it coming from https://github.com/clojure/clojure/blob/master/src/clj/clojure/core/reducers.clj#L214

20:04 anyone can help ?

20:05 hiredman: it's in core.clj

20:05 gozala1: hiredman: thanks I'll take a look there then

20:06 tried to see what was it repl but got Unable to resolve symbol

20:18 kenneth: hey my compilation to js is failing with this exception java.lang.UnsupportedOperationException: nth not supported on this type: Keyword

20:18 not sure what this is about?

20:20 aperiodic: sounds like a keyword is being passed to something that's expecting a vector (or sequence)

20:21 hyPiRion: kenneth: that means you use nth on a keywork - either like (nth keyword pos) or through destructuring.

20:22 kenneth: it seems to happen in the cljs compiler tho, not in my code. the stack trace doesn't show any of my files

20:23 brehaut: kenneth: guessing but perhaps you missed a ^ from a keyword hint from eg a defn form?

20:24 eg #(fn :private [a] (inc a))

20:25 thats a completely useless definition of course, and i screwed up the lazybot thing

20:25 but it would cause the error you are seeing

20:27 kenneth: i don't think i'm doing anything like that, no? https://gist.github.com/6e554107a715d1c09c9d

20:27 this is my two files and my project.clj

20:27 brehaut: kenneth: its your ns

20:27 kenneth: oh?

20:28 how so

20:28 brehaut: you have :use […] where you want (:use […]) i tihnk

20:28 aperiodic: yeah, that's it

20:28 kenneth: oh i see

20:28 thanks

20:28 rookie mistak e;p

20:28 mistake :p *

20:28 aperiodic: it's definitely not the most enlightening error message

20:31 brehaut: kenneth: if i had realised you had posted a gist earlier, i wouldnt have startd by guessing

20:31 sorry about that

20:34 kenneth: brehaut: no worries, help much appreciated :)

20:46 rhickey: Tassilo Horn contributed a mapcat reducer

20:48 hiredman: are you looking for contributed reducers?

20:48 rhickey: sure, why not?

20:49 hiredman: I have a partition-by, can I just drop it jira?

20:49 rhickey: hiredman: sure - thanks

20:49 glad to see some people getting it

20:50 cshell: Rich, I've read it a couple times and am still a little fuzzy - do any of the books on your amazon list discuss this topic? Any other references that might help?

20:50 TimMc: cshell: What part are you having trouble with?

20:52 cshell: TimMc: Not sure, I am just not understanding the article - I think that i'm lacking background

20:52 rhickey: Did you disconnect before my last message?

20:52 rhickey_: probably

20:52 cshell: Rich, I've read it a couple times and am still a little fuzzy - do any of the books on your amazon list discuss this topic? Any other references that might help?

20:53 rhickey_: switched machines

20:53 cshell: ah

20:53 rhickey_: cshell: did you read the library source?

20:53 cshell: rhickey: Not yet, I take it that's where I should look?

20:54 I'm pretty new to Clojure, trying to get my head around everything - but am loving the language and am learning all I can

20:54 rhickey_: Well, the prose is several times longer than the source :)

20:54 cshell: hrm, well if new to Clojure the source might be a bit dense, and has macros

20:55 I'll probably do another post to explain the mechanism in more detaill

20:55 * gfredericks just googled "switched machines" thinking it was a book or concept

20:55 cshell: rhickey: that would be great and I know really helpful to me

20:56 rhickey: and I'm sure others as we've discussed it in here a bit

20:58 TimMc: cshell: Are you familiar with how the existing map, reduce, filter, etc. work in Clojure? That is, chained seqs with cons cells being allocated and discarded.

20:59 cshell: cshell: I'm familiar with those functions and their behavior, but not with the chained seqs and cons cells part

20:59 I understand cons

20:59 from the lisp books I've been reading, but it seems that Clojure is an evolved, more elegant version of lisp

21:00 gfredericks: (map #(* 2 (inc %)) coll) vs (map #(* 2) (map inc coll))

21:02 cmcbride: maybe I'm over-simplifying but reducers just seem like a nice abstraction over function composition

21:03 rhickey_: cmcbride: its more than that, since it disentangles map from collections

21:03 and thus enables it to be parallelized

21:03 composing seq fns doesn't get you there

21:04 you have to revisit the essence of 'mapping' and 'filtering'

21:04 gfredericks: is it meant to be used for its own sake, or just when you need the performance?

21:05 * gfredericks can't figure out if seqs are bad or not

21:05 dreish: Anything that's inherently tied to sequential operation on one core is going to get less and less acceptable in the coming years, if core counts continue to increase.

21:06 "Just" performance is probably understating the issue.

21:06 cshell: rhickey: My basic understanding of mapping and filtering are that they iterate through collections sequentially and apply their functions - so this eliminates the sequential/serial and allows concurrent/parallel?

21:07 rhickey_: cshell: this redefines map to be a function that modifies a reducing function, ditto filter etc

21:07 thus, if the collection can reduce in parallel, so to can these run in parallel

21:08 so too

21:09 mefesto: reducers will replace the need for pmap and friends, right?

21:09 TimMc: Hmm, this could be quite useful for my DB-munging code.

21:09 rhickey_: pmap still has a unique role, in that it is partially lazy

21:09 hiredman: I really wanted a reducer partition-all with stepping, but I haven't figured that out

21:09 TimMc: One of my projects involves multiple maps and filters over 10k-size colls.

21:11 cshell: rhickey: Cool, I'll reread with this in mind - thanks

21:11 hiredman: gfredericks: not being lazy also gets you out of issues with resource scope

21:12 brehaut: is it wrong to be most excited about reducers being curried ?

21:12 rhickey_: brehaut: yes :)

21:12 brehaut: uh oh

21:13 im totally most excited by the potential parallelism then.

21:13 rhickey_: ok

21:17 cmcbride: is it enforced that fold must take a monoid? or is that up to the programmer?

21:17 amalloy: rhickey_: i think i get the reducers concept, and i'm interested in adding some reducers. is it basically just "port lazy-seq functions", or is there something else? eg, i don't see `iterate` yet, and it seems like that would be a good instance of reducible

21:18 rhickey_: amalloy: yes, port is the first step (where it makes sense)

21:20 e.g. infinite seqs can't fold

21:22 amalloy: ah, sure. so iterate would be no good, because you can't ever fold the entire infinite sequence. but if there were some (iterate-until seed f done?), that could be an instance of collfold

21:23 brehaut: that would be unfold wouldnt it?

21:23 rhickey_: iterate can still reduce

21:23 dnolen`: rhickey_: quick CLJS question while you're here. What do you think about supporting property access in ClojureScript in map destructuring? yoklov's been doing some game stuff and one of the biggest bottlenecks is destructuring maps in his game loop.

21:24 sorry defrecords really I think.

21:24 rhickey_: dnolen`: not sure I understand the issues, maybe we can discuss next week?

21:24 dnolen`: rhickey_: sure thing.

21:25 rhickey_: foldable range would be welcome

21:26 Null-A: do I need java 7 to develop reducers, thus windows or linux?

21:26 that's when forkjoin was added afaik

21:26 rhickey_: nope, you can use jsr166y.jar

21:27 kenneth: how would i map js chaining to cljs?

21:27 rhickey_: with jdk 6

21:27 Null-A: k thx

21:27 antares_: Null-A: fork/join has a standalone implementation and I believe clojure build system will download it for JDK 6

21:27 brehaut: Null-A: im pretty sure Oracle have released JDK 7 for mac os x

21:27 kenneth: since clojure -> assumes return val of previous statement as the last arg, whereas interop defines it as (.method OBJ …) (i.e. 2nd arg)

21:28 hiredman: Null-A: java 7 is out for osx

21:29 Null-A: hiredman: brehaut just sent me the link

21:29 hiredman: and there are builds of openjdk8 available

21:29 antares_: kenneth: -> pass the result as the first argument. ->> as the last. So typical chaining (a.getB().getC()) uses ->: (-> a .getB .getC)

21:29 kenneth: oh really, that's sweet

21:29 antares_: kenneth: a.getB().getC(d) becomes (-> a .getB (.getC d))

21:30 kenneth: is there a reason .getB is not surrounded by parens? antares_

21:31 antares_: kenneth: they can be omitted if there's only one arg

21:31 kenneth: okay, looks cleaner to me to have them, for a multi-line chain

21:37 dgrnbrg: ,(doc ^:doc [])

21:37 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol>

21:38 zakwilson: clojure.org's reader docs don't seem to mention the new tagged literals.

21:41 kenneth: cljs is super hard to debug

21:41 Raynes: Super duper even.

21:41 kenneth: these js exception are not very descriptive

21:42 dnolen`: kenneth: yep waiting on someone to submit a source map patch.

21:42 mlozano: yeah, I had kinda wondered about that ... was considering trying that out in my project

21:42 dnolen`: kenneth: if you know already know Clojure it's not quite as challenging.

21:43 kenneth: i've used clojure on two scripts or so, so far

21:43 https://gist.github.com/6e554107a715d1c09c9d

21:43 dnolen`: kenneth: nice

21:43 kenneth: this is my code, i'm getting Uncaught TypeError: Property 'W' of object {"tick" 1, "value" 70} is not a function and Uncaught ReferenceError: continuous is not defined

21:44 cmcbride: do you have advanced optimizations on?

21:44 dnolen`: kenneth: you shouldn't be using strobj

21:45 kenneth: strobj is not a method, but a private property.

21:49 amalloy: rhickey: i'm on clojure master, and ant jar fails with https://gist.github.com/56a1dab1923934a2ea1b because it can't find the fork/join framework. is there something else i should be doing to get the deps, and get a repl up?

21:50 goodieboy: is there an equivalent function to realized? in clojure 1.2?

21:50 amalloy: goodieboy: no

21:50 goodieboy: rats

21:50 amalloy: (but seriously, upgrade from 1.2)

21:50 goodieboy: yeah, we're working hard on that

21:51 Null-A: amalloy: did you put the jsr166y.jar in lib?

21:51 amalloy: nope, i sure didn't. i must have missed the discussion of where to get that thing

21:51 Null-A: http://gee.cs.oswego.edu/dl/jsr166/dist/jsr166y.jar

21:52 i just ran into the same problem as you, and that fixed it

21:52 amalloy: Null-A: and put it where?

21:52 Null-A: in lib

21:53 well.. i'm using leiningen

21:53 rhickey: amalloy: if using maven or lein just copy the dep from Clojure's pom.xml

21:53 hiredman: but leave out the provided scoping

21:53 rhickey: right

21:55 Null-A: [org.codehaus.jsr166-mirror/jsr166y "1.7.0"]

21:55 amalloy: oh, i was just trying to hack on clojure itself to add a reducer, so i guess mvn compile should be good enough

22:02 but given how slow the compile process is, i guess i'll be better off depending on a snapshot of master and adding my reducer externally

22:05 dnolen`: wow, making CLJS persistent data structures available to JS users is pretty easy

22:06 gozala: dnolen`: got a minute ? I got question on reducers ?

22:06 dnolen`: gozala: I have yet to dive into reducers

22:06 gozala: ahh ok then :)

22:07 I was trying to understand if you could consume them lazily

22:07 via pull or if they always push

22:10 spjt: http://pastebin.com/CdXBE1vy Is there a particularly clever way to reduce this into two-dimensional?

22:11 e.g one vector containing all the vectors that have the numbers

22:15 hiredman: ,(remove #(some vector? %) (tree-seq #(and (vector? %) (some vector? %)) vec [[1 2 3] [[5 6 7 8]]]))

22:15 clojurebot: ([1 2 3] [5 6 7 8])

22:19 spjt: awesome, some day I hope to understand what that does. :)

22:22 kenneth: dnolen`: where am i using strobj?

22:23 you mean by console.logging my map?

22:24 cmcbride: i do

22:29 oh nvm

22:33 cmcbride: kenneth: I could be wrong, but I dont think you need to wrap each-tick in #() when you pass it to setInterval

22:34 each-tick by itself is a function value

22:34 kenneth: right, wasn't sure if you could pass clojure function as js closures

22:35 cmcbride: I think you can

22:35 kenneth: do i have to declare external js stuff somehow? i'm trying to use d3 from clojurescript and i'm getting a reference error d3 not defined on (.-scale js/d3)

22:36 also, weirdly a Uncaught TypeError: Object #<Object> has no method 'main'

22:36 cmcbride: yea

22:36 you need an extern file

22:36 in project.clj

22:37 under the :compiler key in :cljsbuild

22:37 you set your externs files

22:37 you can just use d3 itself as the extern file

22:37 kenneth: the libraries are already loaded in the dom from the other non-cljs code, so i don't want to re-add them via cljs

22:37 using requirejs

22:38 oh wait i got it

22:38 externs

22:39 cmcbride: yea basically you just need a file telling the google closure compiler which function sigs to ignore when it minifies

22:40 dnolen`: https://github.com/swannodette/psjs

22:40 kenneth: just a list of var myname;

22:41 dnolen`: beginnings of a persistent data structure library for JavaScript consumers

22:41 cmcbride: kenneth: https://github.com/shripadk/d3-externs/blob/master/externs.js

22:42 dnolen`: thats slick :)

22:43 dnolen`: gzipped ps.js is 19k :D

22:44 cmcbride: nice

22:44 dnolen`: getting the reducer framework in there will be pretty sweet :)

22:46 kenneth: cmcbride: woo externs fixed the d3 issue

22:46 cmcbride: still having uncaught type errors Object #<Object> has no method 'main', and now also for 'domain'

22:47 but that's probably my fault

22:48 cmcbride: kenneth: does this work on simple compile?

22:48 I always do that as a sanity check first

22:49 amalloy: hiredman: you mentioned you had a partition-by reducer. mind looking at http://dev.clojure.org/jira/browse/CLJ-992, my iterate reducer, just to make sure i haven't done anything crazy?

22:49 lynaghk`: kenneth, you might be interested in C2, a Clojure/ClojureScript library inspired by D3: https://github.com/lynaghk/c2

22:51 also, I'd love to hear about what you're doing with d3 in CLJS

22:53 kenneth: i'm not doing it in cljs for any reason other than curiosity, i'd probably have an easier time doing it in js

22:53 but wanted to see if cljs is a possibility for serious real-life projects

22:53 lynaghk`: you do serious real life work with d3?

22:54 kenneth: not yet, hoping to

22:54 trying :p

22:54 dnolen`: kenneth: people already using CLJS for serious real-life projects :) ... but certainly the debugging story needs to improve for wider adoption.

22:54 kenneth: i don't know very much about either right now, but i want to see what i can do with it

22:55 and doing it while making something that's actually useful (analytic charting for chartboost.com)

22:55 lynaghk`: dnolen`: I'll have to mention that whenever clients ask: "Yes, we use Clojure and ClojureScript like many other serious, real life people"

22:56 cmcbride: kenneth: on a side note, if you just need basic charts highcharts.js is pretty nice

22:57 dnolen`: whats the next steps to get source map support?

22:58 I saw some compiler patches on JIRA already

22:58 kenneth: ooh

23:00 https://gist.github.com/6e554107a715d1c09c9d -> line 16, why is that being compiled to

23:00 d3.scale.domain([0, 100]).range([0, continuous.h]);

23:00 as opposed to d3.linear.scale.domain([0, 100]).range([0, continuous.h]);

23:01 oh nvm i caught it

23:01 damn, debugging this stuff is haaaaaard

23:01 worse than debugging real clojure

23:04 ok, how would i convert a hash to a js object?

23:04 Null-A: amalloy: do you understand filter code? (if (pred k v) … )

23:04 amalloy: how it is calling pred with 2 args, when it's 1 arity

23:06 cmcbride: kenneth: I use that clj->js function that you have

23:06 Im not sure if thats the most idiomatic way

23:07 dnolen`: kenneth: there is no standard way.

23:07 cmcbride: actual source map support

23:07 cmcbride: line tracking patches already applied.

23:07 kenneth: cmcbride: i removed it because it was causing problems

23:07 crashing on strobj

23:08 now i'm trying to do it with assoc

23:08 cmcbride: put a dash in front of strobj

23:08 like .-strobj

23:08 dnolen`: anybody have a cool name for a CLJS persistent datastructure bridge for JS?

23:08 amalloy: Null-A: oh yeah, i forgot about the k/v impl at all

23:08 dnolen`: cmcbride: using .-strobj is asking for trouble.

23:09 Null-A: amalloy: are there two implementations? i only see a kv impl

23:09 kenneth: what does strobj even do?

23:09 amalloy: Null-A: rfn takes a k/v impl and transforms it into a multi-arity impl that takes either k/v or just x

23:10 how it does that is sorta a mystery to me, and looks like it just does it by removing the reference to v in the lower-arity version

23:10 cmcbride: dnolen: what do you use instead?

23:11 Null-A: amalloy: ah thanks

23:11 dnolen`: cmcbride: reduce into js-obj

23:12 code relying on any fields of CLJS data structures is doomed

23:14 brehaut: $findfn 1 2

23:14 lazybot: [clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']

23:14 brehaut: PeregrinePDX: ^

23:15 $findfn odd? [1 2 3] [1 3]

23:15 lazybot: [clojure.core/filterv clojure.core/filter]

23:16 kenneth: dnolen`: do you have sample code handy?

23:17 dnolen`: kenneth: of what?

23:17 kenneth: reducing into js-obj

23:18 dnolen`: kenneth: oh you mean (reduce (fn [o [k v]] (aset o k v)) (js-obj) some-map)

23:18 echo-area: (let [[[_ [keyword]]] next-lines] <-- In which case will this snippet cause StackOverflowError?

23:18 Could you imagine?

23:18 lynaghk`: kenneth: you will want to recurse too; https://github.com/lynaghk/c2/blob/master/src/cljs/c2/util.cljs

23:19 dnolen`: will strobj be getting phased out of cljs?

23:19 echo-area: TimMc: Message received, but I'll currently busy doing other stuffs, will discuss later. Sorry

23:19 *I'm

23:19 dnolen`: lynaghk`: you can never use any internal properties of CLJS data structures.

23:19 lynaghk`: it's no different from Clojure

23:20 lynaghk`: it might can renamed or removed at anytime.

23:20 lynaghk`: dnolen`: yeah, sounds reasonable. Is there any reason why clj->js isn't in cljs core?

23:20 dnolen`: lynaghk`: there's no sensible conversion

23:21 lynaghk`: conversion will be app specific.

23:21 acagle: /flush

23:21 lynaghk`: dnolen`: not completely, for things like sets, but maps and collections should be turned into objects and arrays, no?

23:22 dnolen`: lynaghk`: what about complex keys? what options, etc.

23:22 lynaghk`: not saying that we're not willing to look at some patches ...

23:22 kenneth: (doc js-obj)

23:22 clojurebot: Pardon?

23:23 kenneth: lol, of course that didn't work

23:23 dnolen`: lynaghk`: but we went down this path a couple of times - always yucky.

23:23 kenneth: cljs needs a std lib documentation site

23:23 i have no idea how to look up doc for this stuff, like assoc / js-obj / etc

23:23 gfredericks: himera?

23:24 lynaghk`: dnolen`: Maybe just something that does the things it can, and throws an exception with a note: "please defmethod ... to convert this type"

23:24 dnolen`: lynaghk`: I couldn't think of anything good - again I'm up for looking at patches.

23:25 lynaghk`: though my hunch is that people can write their app specific conversion in a few lines - any real solution will be complex.

23:25 lynaghk`: lynaghk`: I'll mull on it. I just know it's a confusing point for some folks, since I've heard the question a several times.

23:25 er, talking to myself there.

23:25 dnolen`: lynaghk`: I don't disagree at all - it is a source of confusion.

23:26 lynaghk`: js -> cljs, easy, poor -> rich format

23:26 the other direction is lossy

23:26 Null-A: amalloy: do you know other things that need porting?

23:26 cmcbride: well could there at least by map->jsmap, etc..

23:27 then people could roll their own stuff with those primitive functions

23:27 ivan: cmcbride: same problem with non-string keys

23:27 cmcbride: oh right

23:32 kenneth: ugh, every time i solve one error i have another :p

23:33 now i'm on No protocol method ISeqable.-seq defined for type number: 71

23:34 amalloy: Null-A: almost every interesting lazy-seq function can be ported

23:35 eg, i submitted a patch for iterate, and i'm nearing completion on range atm

23:37 dnolen`: kenneth: you're calling seq on a number

23:49 amalloy: for example, Null-A, `tree-seq` would be an interesting one to write, i bet. or for something easier to start with, you could do `repeat`

23:49 Null-A: *nods*

23:50 amalloy: i had some trouble getting started on iterate/range, because all the examples currently in core.reducers take an input sequence and transform it, rather than creating a brand new sequence. so you might want to look at my patches to see how it's done, or scrounge around in core.protocols to see how concrete collection types like Iterable do it

23:52 Null-A: Yah I figured seeing yours would help

23:54 kenneth: `(- 5 2 1)

23:56 gfredericks: 2

23:56 tmciver: gfredericks: clojurebot, is that you?

23:57 gfredericks: pardon?

23:57 tmciver: ha!

Logging service provided by n01se.net