#clojure logs

2012-05-10

00:02brehautTimMc: w/hat the link to your page about equality partitions?
00:02cshellemezeske: nice work
00:04brehautTimMc: dont worry. found it
00:08emezeskecshell: Thanks!
00:59technomancyso is lein-cljsbuild's repl-listen agnostic of which repl implementation is going to connect to it?
01:06wei_how do i insert at the head of a vec? conj adds to the end
01:08technomancywei_: vectors don't work like that; you can't do it without constructing a whole new vector
01:09technomancy,(into [:newhead] [:a :b :c]) ; <- something like that
01:09clojurebot[:newhead :a :b :c]
01:09wei_ah thank you. so would that be better than (concat [:newhead] [:a :b :c])?
01:10technomancyconcat returns a seq, not a vector
01:10technomancyso it depends on what you want
01:10wei_into returns a vec and concat a list
01:11brehautinto retunrs whatever type of collection is the first argument
01:12brehaut(if we are being pedantic)
01:12technomancywe are
01:12technomancywell at least I am
01:12technomancyyou guys don't have to be; it's cool
01:12wei_i see
01:12hiredmanthe best kind dantic
01:12wei_haha thanks
01:13technomancysomeone plz make M-x imenu work with protocols; kthxbai
01:19mrakanaI'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?
01:19xeqi~contrib
01:19clojurebotMonolithic 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
01:20mrakanaThanks.
01:20xeqithat will help some, but there isn't a single place for everything
01:22xeqisome are in http://search.maven.org/, some are in http://clojars.org
01:23brainproxyjust finished putting together a decent README, with some instructions, examples and links to resources
01:23brainproxyhttps://github.com/michaelsbradleyjr/node-clojurescript
01:23amalloymrakana: 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
01:24amalloyeg, slurp is now in clojure.core, but lines was horrible because it meant you couldn't .close the implicitly-opened reader
01:32robertstuttafordbrainproxy: this is great work, but why would i want to use node.js instead of the jvm to deploy server side clojure?
01:32robertstuttafordjust curious about the potential advantages. not poking holes :)
01:34brainproxyrobertstuttaford: it's more about using clojurescript to develop apps that will be hosted on NodeJS
01:34brainproxye.g. taking adavantage of the node ecosystem of modules
01:34brainproxysince use you use both namespaces dependencies and nodejs's require inside clojurescript running on node
01:34brainproxy*you can use
01:38robertstuttafordplease help me: https://gist.github.com/2651249
01:38robertstuttafordgoing in circles here
01:42robertstuttafordbrainproxy, 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
01:43robertstuttafordi have to figure out how to get cljs to produce externs for all exported symbols so that these binaries can interoperate
01:44robertstuttafordhave you had to do anything like this?
01:52brainproxyrobertstuttaford: not yet
02:20kovasb_robertstuttaford: you are throwing away the result of mapping the function
02:21kovasb_robertstuttaford: oh wait nm was parsing it wrong..
02:27flijtenSo 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"
02:30alexbaranoskywhile is a variation on loop you could say
02:30alexbaranoskyand dotimes is a side-effecty function, but sometimes that is exactly what you need
02:32flijtenthere are also for and doseq
02:33flijtenI 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
02:33flijtenor as little as possible
02:36bartjis there a function which returns an infinite list of natural numbers?
02:37xeqi(doc range)
02:37clojurebot"([] [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."
02:37bartjxeqi, thanks!
02:41mmarczykflijten: 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
02:46mmarczykflijten: 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
02:50mmarczykare 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)
02:54robertstuttafordxeqi: thank you very much!
03:05PeregrinePDXlein run
03:05PeregrinePDXoops wrong window
03:06robertstuttaford+++ OUT OF CHEESE ERROR +++
03:08flijtenmmarczyk: thx for the explanation
03:09mmarczyknp
03:21arohnertop is saying that my jvm is taking 15.2G of virtual ram, but I have -Xmx1024m. Any ideas what could cause that?
03:22hiredmanwhich column in top? rss?
03:24michaelr525hello
03:24arohnerhiredman: VIRT
03:24hiredmanmeh
03:24arohnerhiredman the kernel is OOM killing
03:25hiredmanon virt?
03:25hiredmancould be native memory, memory mapped files, etc
03:25arohnerright
03:26hiredmanhook up a profiler?
03:27arohneryeah, I will. It's just annoying to set up remotely
03:27hiredmanyou can install visualvm remotely and forward it over x11 (which is easier then forwarding all the java stuff)
03:28arohnerooh, they finally packaged it: "sudo aptitude jvisualvm install"
03:29hiredmanlast 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
03:30arohnerI'd be amazed if I was creating even 100M of strings
04:13robertstuttafordis there a way to see how many args a function expects from within the repl?
04:14robertstuttafordi 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
04:21katratxorobertstuttaford: the uuid param should be a java.util.UUID ? (just guessing)
04:22Raynes&(meta #"+)
04:22lazybotjava.lang.RuntimeException: EOF while reading regex
04:22Raynes&(meta #'+)
04:22lazybot⇒ {: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
04:22RaynesSee the :arglists key
04:22robertstuttafordsuper thanks!
04:23RaynesMega welcome!
04:26robertstuttafordit's got something to do with the first param here
04:26robertstuttaford(convert-media-paths "<img src=\"foo.png\">" "uuid")
04:27robertstuttaforddoes'nt like how i'm escaping it, or something
04:30matessimHey 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.
04:31robertstuttafordmatessim: http://clojurebook.com/. the end.
04:31PeregrinePDXI've been having good luck with Programming Clojure 2nd edition
04:31robertstuttafordi've just finished all the non Practicum chapters
04:31robertstuttafordvery good book
04:32matessimClojurebook.com != Programming Clojure 2nd edition right?
04:32matessimnot the same books
04:32PeregrinePDXNo they are not the same book.
04:32robertstuttafordcorrect
04:32PeregrinePDXI have heard good things about clojurebook.com as well.
04:32robertstuttafordanother book i've seen recommended is joyofclojure.com
04:32matessimdid any of you read both?
04:32PeregrinePDXBut work has a subscription to prag prog. So it was free for me to get Programming Clojure.
04:32robertstuttafordclojurebook.com is newest
04:33matessimthe Reviews seem pretty damn good on Clojurebook also
04:33FullmoonWhat Redis library to use?
04:34wkmanireHowdy folks.
04:35wkmanireanyone awake yet?
04:35PeregrinePDXHello
04:36wkmanireWell hell. I was gonna ask a question but I just answered it
04:36wkmanirefailed to read the docs correctly.
04:37clgvwkmanire: It feels better to solve it yourself, doesnt it? :)
04:37wkmanireSure does.
04:37clgvonly sometimes one regrets if it took too much time for something really - let's say - stupid ;)
04:38wkmanireI am that sometimes.
04:38clgvbeen there, as well ;)
04:38clgvif nothing works, just restart that repl thing^^
04:41matessimOrdered Clojure Programming now :), thanks guys.
04:41matessimshould have it in a month or so ^_^
04:42clgvui thats long
04:42robertstuttafordkindle?
04:42robertstuttafordi got mine on kindle
04:42robertstuttafordcheaper, and i started reading right away
04:43matessimI don't have a kindle :/
04:43matessim+ I live in Israel.
04:43robertstuttafordyou get kindle apps for all operating systems
04:43matessimso that's why shipping will take a bit
04:43matessimi have a tablet
04:43matessimbut
04:43matessimi can't read ebooks
04:43matessimit just kills me
04:43matessimi can't concentrate on it for some reason, i might get a e-ink reader some day, maybe it will be easier
04:44robertstuttafordhow do you manage to code, then? #justsayin'
04:44matessimi bought the Art of war on e-book edition, tried reading it on my computer, my tablet, ended up just ordering a physical copy
04:44PeregrinePDXI had that problem for awhile with ebooks
04:44matessimi don't have a problem working with code that way etc, i just prefer having physical copies for books.
04:44PeregrinePDXEventually I managed to push through it.
04:44matessimdo you read books on your computer?
04:46wkmanireweird...
04:46wkmanireI'm reading Cemerick's new book on my kindle.
04:46wkmanireI love it.
04:46wkmanireBut i still have to look at the code on the cloud reader.
04:46clgvebooks are only good for searching - paper is better for reading ;)
04:47wkmanire(computer), the kindle isn't wide enough.
04:47wkmanireTo me at least, the kindle reads like paper.
04:47matessimwell, i don't have a kindle.
04:47robertstuttafordreading it on ipad in widescreen, able to read it all just fine
04:48clgvI love that the JoC book comes with the pdf version so that I can search easily^^
04:48matessimit might be just because i have A.D.D, but i can't read on a screen that has backlighting.
04:48matessim(read a book, concentrate on page after page after page)
04:48wkmanirematessim: Probably that.
04:48robertstuttafordya the light can be a problem
04:48matessimi 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
04:48matessimits a pain
04:49robertstuttafordis it possible to do this sort of destructuring (fn [[_ match] … ) in a #(bla) function?
04:50Borkduderobertstuttaford: I don't think so, prob. need core.match for it
04:50wkmanirei think the difference with readers like the kindle is that they don't refresh constantly.
04:50clgv robertstuttaford: only if you include a let form
04:51robertstuttafordi'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?
04:51wkmanirerobertstuttaford: Yes.
04:51clgvbut then (fn [[_ match] ...] ..) is again shorter than #(let [[[_ match] ...] %] ...)
04:51Borkdude,((fn [[a b]] [a b]) [1 2])
04:51clojurebot[1 2]
04:52clgvthats lame, let it do sth to prove it worked ;) ##((fn [[a b]] [b a]) [1 2])
04:52lazybot⇒ [2 1]
04:52Borkdudehello neotyk
04:52robertstuttafordso how would i do it with this func? https://gist.github.com/2651979
04:52neotykhello Borkdude :-)
04:52bobrydoes anyone have any experience with clojurescript one? i can't quite get my head around it -- the 'sample' application is just too simple :(
04:53MS|AwayProgramming Clojure explains the basics of Lisp-based languages right? I've never really got my head around lisp syntax.
04:53robertstuttafordMS|Away: clojurebook.com's one does a great job of this
04:53Borkduderobertstuttaford: you can't match in a destructure form, only take things apart
04:53MS|AwayYeah, clojurebook, thats the book i ordered.
04:53Borkduderobertstuttaford: you need core.match for it
04:54robertstuttafordbobry: kinda. there's a lot to integrate. domina, state transitions, where code executes, compiled vs repl-controllable
04:54PeregrinePDXI've never done any lisp programming.
04:54robertstuttafordme neither, before a couple days ago. been reading clojurebook.com for about a week
04:54PeregrinePDXI've found doing some of the 4clojure.com problems has helped me immensly.
04:55clgvrobertstuttaford: you can destructure maps easily with pure clojure
04:55robertstuttafordtore through the koans (with help from me old mate google)
04:55bobryrobertstuttaford: indeed, i wish they had 'projects using cljs one' page in the wiki
04:55Borkduderobertstuttaford: maybe you can do it with a nested map destructuring
04:56robertstuttafordi have to learn how, first :)
04:56Borkduderobertstuttaford: http://blog.jayfields.com/2010/07/clojure-destructuring.html <- search for "nested map"
04:56clgvrobertstuttaford: ##((fn [{{d :data} :item}] data) {:item {:data 42}})
04:56lazybotjava.lang.RuntimeException: Unable to resolve symbol: data in this context
04:56clgvargs^^
04:56robertstuttaford:o
04:56robertstuttafordthat's hot
04:56clojurebotIt's greek to me.
04:56clgvrobertstuttaford: ##((fn [{{d :data} :item}] d) {:item {:data 42}})
04:56lazybot⇒ 42
04:57robertstuttafordhalf the crap i've been writing has been to do exactly that sort of thing
04:57robertstuttafordi'll post a full gist with sample input just now for you all to giggle at
04:57clgvrobertstuttaford: but be careful not to introduce destructuring in hotspots ;)
04:58wkmanirerobertstuttaford: Your code can't be worse than mine, I just started learning a couple of weeks ago.
04:58wkmanireclgv: What do you mean by that? Is there a big performance penalty for destructuring?
04:58robertstuttafordclgv: i'll be sure not to, once i understand what you mean
04:58FullmoonIt it a smell to use clojure agents like queues? For example for synchronization of a log file?
04:59clgvwkmanire: there is some penalty. if it's really a hotspot it makes a difference.
04:59Borkdudeneotyk: I've been tinkering with your lib, but I don't understand a few things
05:00neotykBorkdude: how can I help?
05:01Borkdudeneotyk: 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
05:01wkmanireclgv: 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...
05:01wkmaniredoes that mean if you have a bottle neck in some destructuring segment that you need to refactor your data structures:
05:01wkmanire ?
05:01Borkdudeneotyk: is the :body element of state the part that comes in, or the whole body?
05:02clgvwkmanire: not necessarily. the point is that just doing manual let's is faster in a lot of cases. I tried that some time ago
05:03clgvwkmanire: I didnt get to the point to understand why that is
05:03neotykBorkdude: :part (fn [resp part] (let [counter (or (:body resp) (atom 0))] (swap! counter inc) (println part) [counter :continue]))
05:03wkmanireOh... I figured destructuring just used let and that let is what handled the actual destructuring.
05:04wkmanireJust to warn you, these are all mostly alien concepts to me still.
05:04robertstuttafordclojurebook said exactly that, wkmanire
05:04robertstuttafordlet destructuring forms are handled by let calls internally
05:04neotykBorkdude: :body of response is what you return for first invocation of part callback
05:04wkmanirerobertstuttaford: I can only fathom that it must have to do with processing macros in the reader.
05:05neotykBorkdude: first element of tuple you return
05:05robertstuttafordi 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 :-)
05:05neotykBorkdude: nah, my example won't work
05:05clgvrobertstuttaford: thats right. you can expand it. and I guess the intermediary expressions are the reason for the overhead
05:06wkmanirerobertstuttaford: 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.
05:07robertstuttaforddefinitely, 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
05:07neotykBorkdude: https://github.com/neotyk/http.async.client/blob/master/test/http/async/client/test.clj#L234
05:08neotykBorkdude: would that solve it for you? or you prefer to have it in (:body response)?
05:08robertstuttafordread 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
05:08wkmanirerobertstuttaford: Wow, my english was horrible there. I'm surprised you understood me.
05:08robertstuttafordi've got all that done except the path replacements, now
05:09robertstuttafordlearning one helluva lot
05:09Borkdudeneotyk: ah I have something working now
05:10robertstuttafordwhat'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
05:12wkmanirerobertstuttaford: 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.
05:14punkboyhi 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
05:14punkboyanyone used this before?
05:15neotykBorkdude: here is example with delivering via :body https://gist.github.com/2652052
05:26neotykBorkdude: updated gist, previous was failing
05:29Borkdudeneotyk: ok… I tried the following: https://gist.github.com/2652015
05:30Borkdudeneotyk: somehow this is not working
05:31Borkdudeneotyk: wait, with-out-str should be something different
05:38Borkdudeneotyk: 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
05:40neotykBorkdude: will look at it in a minute, will ping you
05:41espeedI'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() ]
05:51Borkdudeneotyk: probably I could give the writer and counter to each next part and close it in the completed function?
05:52Borkdudeneotyk: anyway, it's not really an issue, I'm just playing around with it
05:55Borkdudeneotyk: maybe a nice example: put each part in a separate file so you can see the files being generated
05:56neotykBorkdude: you could write it out in completed callback
05:57Borkdudeneotyk: you mean by first collecting all the pieces and only write them when ready?
05:57neotykBorkdude: exactly
05:57neotykBorkdude: and default part cb will collect everything for you
05:58Borkdudeneotyk: as a demo effect it is nice to see that work is being doing asynchronously
05:58neotykBorkdude: default :part callback is http.async.client.request/body-collect
05:59neotykBorkdude: you can invoke body-collect at the end of you cb, that will print something to user
06:00Borkdudeneotyk: ok
06:00Borkdudeneotyk: what do you use this lib for in practice/projects now?
06:02neotykBorkdude: to access http apis
06:07neotykBorkdude: https://gist.github.com/2652261 counting parts and collecting body
06:08Borkdudeneotyk: cool!
06:10neotykBorkdude: I often end up using it to test when I build API myself, kind of like curl in repl
06:11Borkdudeneotyk: I was wondering when do you need the async part of it
06:12neotykBorkdude: to be honest, not very often
06:13Borkdudeneotyk: so what you're doing now is like wrapping middleware in ring
06:13Borkdudeneotyk: in the part function
06:13neotykBorkdude: only once I had fire and forget scenario
06:14Borkdudeneotyk: I have to go, ttyl
06:14neotykBorkdude: yes, kind of
06:14neotykBorkdude: ttyl
06:26robertstuttafordi see clojars has the lein deps which is great
06:27clgvyep. meanwhile they also have all old versions listed :)
06:34robertstuttafordany enlive veterans about?
06:35robertstuttafordis it possible to copy nodes from one html tree into another separate html tree?
06:35robertstuttafordfrom reading the docs it looks like transformations happen within the context of a tree
06:52robertstuttafordif i can slurp an html file but enlive's load-resource has a nullptr exception on the same path, what does that mean?
06:52robertstuttafordthe path is on my filesystem
07:06shawn-pHeyo
07:07shawn-pI'm new to Clojure... I was hoping to ask a couple newbie questions
07:11clgv~anyone
07:11clojurebotJust 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 ..."
07:12clgvjust ask^^
07:19michaelr525<clgv> ~anyone [14:11]
07:19michaelr525<clojurebot> Just a heads up, you're more likely to get some help if you ask
07:19michaelr525 the question you really want the answer to, instead of "does
07:19michaelr525 anyone ..."
07:19michaelr525<clgv> just ask^^
07:19clgvmichaelr525: äh was?
07:19clgvmichaelr525: erm, what?
07:29HCumberdaleHi!
07:30HCumberdaleHow can I control the slime frame which opens in emacs by M-x clojure-jack-in to appear at the bottom?
07:32clgvIn midje can I specify a table of provided statements?
07:33MadsyIs there a function like "isref?" in Clojure core? It's handy enough that it should exist :)
07:34Madsy(isa? (class foo) clojure.lang.Ref) isn't as nice
07:36MadsyHCumberdale: Control what in Slime?
07:37HCumberdaleMadsy: If I run M-x clojure-jack-in the main window is split and the REPL occurs at the right side
07:37HCumberdaleI want it to appear in the bottom
07:37HCumberdale(at the bottom)
07:37MadsyLearn the Emacs window commands. Changing the layout takes 2 seconds
07:38HCumberdaleMadsy: do you have a link for me
07:38neotykHCumberdale: https://duckduckgo.com/?q=emacs+C-x+2
07:39HCumberdalethx!!
07:39MadsyHCumberdale: http://refcards.com/docs/gildeas/gnu-emacs/emacs-refcard-a4.pdf
07:39MadsySee "multiple windows" in the top-right corner
07:41MadsyThis 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.
07:41MadsyIf you want to, make it into a keyboard macro and save it.
07:42HCumberdaleMadsy: how to add such a macro?
07:42MadsySee the refeference I gave you
07:45Fossiis there a function like the following in the library or another clever way to do the same: https://gist.github.com/2652566
07:45Fossibasically it reduces over a map and transforms the values, returning them under the same key
07:49clgvFossi: I dont think so. I wrote it like (reduce #(update-in %1 [%2] func) map (keys map))
07:51espeedI'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
07:53clgvespeed: you have no base case for the recursion so it will loop forever
07:54clgvtry: (if (seq methods) (let ...) methods)
07:54clgverr, scripts is the result: (if (seq methods) (let ...) scripts)
07:56espeedclgv: thanks -- I'll try that
07:58clgvespeed: if you didnt know why you have to do that - read a short introduction on recursion ;)
07:59espeedclgv: thanks -- that worked after I moved the scripts return value to the "else" in the cond (https://gist.github.com/2652573)
08:46michaelr525אני אוהב שסק
08:47matessimמגניב אחי
08:55michaelr525כל השאר עושים את עצמם לא מבינים
08:55clgvoh look, unicode!
08:56matessimhebrew :P
08:56matessimחחח, ממש
08:56Fossisame, really :>
08:58Fossicool
08:58matessimthis 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
08:58matessimdamn hostile channel
08:58Fossigoogle translate says חחח means 'lol' :D
08:58matessimח is kh
08:58matessimthe sound
08:58matessimthat's how israelis laugh
08:59Fossiyeah
08:59matessimtyping חחחחחחח
08:59matessimis like
08:59matessimhahahaha
08:59Fossii figured
08:59Fossifor one it says 'kh'
08:59Fossibut for three 'lol' :>
08:59clgvkhkhkhkh :D
08:59matessimit must be odd as fuck to see a bunch of unclosed rectangles though
08:59matessim:P
09:04ShawnMcCoolwhat's the widely accepted best introductory clojure book?
09:05rhcShawnMcCool: cemericks new book from oreilly or "joy of clojure", based on my limited research
09:05ShawnMcCoolthanks, i was looking at the joy of clojure so i think i'll go with that
09:06hyPiRionShawnMcCool: What kind of experience with languages do you have from before?
09:06clgvthese are the books I heard of: Programming Clojure, Practical Clojure, Clojure in Action, Clojure Programming, Joy of Clojure
09:06ShawnMcCool14 years of professional programming, 20 years total experience.
09:06hyPiRionI meant languages. ;)
09:06clgvI would recommend Joy of Clojure as second read ;)
09:07ShawnMcCoolturbo pascal, c, c++, c#, php, ruby, java, perl, etc
09:07ShawnMcCooli 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.
09:07ShawnMcCoolbut, i'm interested in it and i can fit it in on the toilet
09:07hyPiRionOkay, then I can't speak for what I would recommend, as I came from a Lisp-background.
09:08ShawnMcCooli've never touched any lisp
09:08hyPiRionBut I think Joy of Clojure is a good second book when you've read a good introductory book.
09:09hyPiRion(And programmed a bit)
09:09ShawnMcCoolI was trying to decide if i wanted to pursue clojure or haskell for fun. A buddy convinced me to go with Clojure for now.
09:09ShawnMcCooloh really?
09:09ShawnMcCoolhttp://www.amazon.co.uk/The-Joy-Clojure-Thinking-Way/dp/1935182641/ref=sr_1_2?ie=UTF8&amp;qid=1336655000&amp;sr=8-2#reader_1935182641
09:09ShawnMcCoolit seems to begin rather introductory
09:10ShawnMcCooli 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
09:11clgvShawnMcCool: It progresses fast and some topics are rather advanced
09:11ShawnMcCooli see, recommended first read for someone new to clojure and functional programming?
09:11ShawnMcCoolMaybe then Clojure Programming by Chas Emerick?
09:12matessimi ordered Clojure Programming today :)
09:13hyPiRionI 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.
09:15ShawnMcCoolwell, i pulled the trigger. had a few references te emerick's new book in this channel. can always get another book at another time.
09:15ShawnMcCoolthanks for your feedback
09:15clgvShawnMcCool: I started with Clojure Programming but if there is no new release it's pretty outdated
09:15clgvargs "Programming Clojure" I meant
09:15clgvthese titles are too similar ^^
09:16matessimwe could refer to books by ISBN numbes, but i fear it would be more confusing
09:16snamellitI used "programming clojure" as first book. The pragprog one.
09:17matessimi bought the oreilly one
09:41cshellWhat's the Clojure equivalent of the Java code: "Hello" + " world" (ie the string concat/append)
09:41dakronecshell: (str "Hello" " world")
09:41dakrone,(str "Hello" " world")
09:41clojurebot"Hello world"
09:42cshelldakrone: thank you very much
09:43babilencshell: You might also want to look at core/format for string formatting
09:46cshellbabilen: another good tip, thanks!
09:50achecshell: printf combines print and format... so you don't need to do (print (format "some string with tokens like %s" token1))
09:50cshellache: awesome, thanks!
09:51babilencshell: We could probably even come up with more tips if we knew what you really want to do ;)
09:51cshellbabilen: haha, thanks I'll save more tips for another day
09:51cshellMorning, Rich
09:59ache(hm. so there's println ... but no printfln.)
10:01kzarache: I think you're supposed to use format
10:02kzar,(format "Dumb example %d" 3)
10:02clojurebot"Dumb example 3"
10:03ache,(printf "feels odd to have to insert a %s\n" "newline-char")
10:03clojurebotfeels odd to have to insert a newline-char
10:03ache... especially when println and print both exist. just an observation. not asking for any changes
10:03gfredericksthere should be 8 different printf functions.
10:04Fossiat least
10:04gfredericksprf, prnf, printf, printlnf, prf-str, prnf-str, printf-str, and printlnf-str
10:05beffbernardI just noticed that some of my hiccup vectors are only formatted with one space in clojure-mode…
10:05beffbernardhttps://www.refheap.com/paste/2680
10:05duck1123gfredericks: what about the pprint variants?
10:05beffbernardis this a bug in clojure-mode or is that how it's supposed to be indented?
10:06gfredericksduck1123: you mean in clojure.pprint?
10:06duck1123shouldn't they make that list as well?
10:06gfredericksokay add to my list pprf, pprnf, pprintf, pprintlnf, pprf-str, pprnf-str, pprintf-str, and pprintlnf-str
10:10Madsy,(letfn [(ref? [r] (isa? (class r) clojure.lang.Ref))] (let [x (ref 1) y 2] [(ref? x) (ref? y)]))
10:10clojurebot[true false]
10:12mmarczykdnolen: ping
10:15mmarczykdnolen: 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:16mmarczykdnolen: 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:17mmarczykdnolen: not going nearly as fast on this as I'd like to due to various time constraints.
10:22fliebelAre there any clojure-py people lurking in here, or is there a #clojure-py?
10:25Wild_CatI don't think there's a #clojure-py (although clojure-py is remarkably interesting)
10:34fliebelWild_Cat: It is. I'm still looking for a place to chat about it though...
10:34Wild_Catfliebel: I suppose Clojure still has a small enough community that all discussion can happen here.
10:35uvtcfliebel, maybe email Timothy. He might be interested in setting up a channel.
10:35fliebelWild_Cat: Yea, if there is anyone to discuss with... ;)
10:35fliebeluvtc: They have a mailing list...
10:35kzarWith Clojurescript is it important to learn about Google Closure as well as Javascript and Clojure?
10:36uvtcfliebel: 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:37fliebelyea...
10:37mmarczykI agree with Wild_Cat about #clojure being sufficiently small
10:38TimMc$mail echo-area The proxy bug actually has to do with proxy not even dispatching on arity, just name. Really kind of terrible.
10:38lazybotMessage saved.
10:38fliebelkzar: I'd say so. You can ignore the underlying platform to some extent, but you'll bump into it at some point.
10:38mmarczykTimMc: oh, interesting. have you filed an issue for this? (I've seen that discussion when skimming the logs)
10:39kzarfliebel: Balls, I'll add another book to the backlog heh
10:39TimMcmmarczyk: Haven't done a bug search with the new info.
10:39fliebelkzar: A Closure or JS book?
10:40HCumberdalehow to control the frame size in emacs?
10:40kzarfliebel: Closure, was going to get that o'reilly one. Already read Javascript the good parts and pretty much got my head around Javascript
10:41fliebelkzar: Id's say you need to know as much about them as you need to knoe wbout the JVM for Clojure.
10:41kzarfliebel: Fair enough, makes sense. My lack of knowledge of Java always slowed me down with Clojure I think
10:42fliebelkzar: I think some people are using cljs without closure-the-lib.
10:43nickmbaileygotta go
10:43nickmbaileyerr wrong room
10:43RickInGAI know that ibdknox has written a cljs wrapper around jquerry. I think it is called jayq
10:45kzaris the closure lib any good?
10:48fliebelkzar: It's like java for javascript... I havn't touched it to much.
10:49dnolenkzar: there's some really good stuff in there, especially the base libraries.
10:49dnolenkzar: I wouldn't touch the UI stuff myself. But I'm sure plenty of people find it useful.
10:51ynnivhow are people deploying compojure apps? inside a tomcat wrapper?
10:53fliebelDoes clojurescript have a seque?
10:53mmarczykfliebel: what would it do?
10:53fliebel... just because I can see how broken it is, or how they fixed it.
10:54fliebelmmarczyk: consume a lazy seq into a buffer on a th... wait... webworker?
10:55mmarczykfliebel: right; no webworker stuff figured out yet, so -- not yet
10:55fliebelok
10:55fliebelwell, that makes it easy to have controlled mutation, I guess.
11:24RickInGAis 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:24RickInGAah, wow, I gave up too soon #'x
11:25mdeboardYou stole my opportunity to be helpful
11:25RickInGA:)
11:26robertstuttafordis 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:27robertstuttafordslurp on either works and i can see the content just fine
11:27achehow would one find out about #'x on their own?
11:27mdeboardache: books
11:27acheah book lernin
11:27mdeboardrobertstuttaford: I know for sure you get an NPE if you try to pass it a path to a file that doesn't exist
11:28mdeboardrobertstuttaford: So just wild guess I'd say you need to re-evaluate how you're forming your file reference
11:28robertstuttafordi'm passing it an absolute path which echos when i cat it in zsh
11:28robertstuttafordand as i said, slurp happily shows it too
11:29robertstuttafordweird
11:29mdeboardrobertstuttaford: Is the directory it's in on the classpath?
11:30robertstuttafordit's an absolute path
11:30robertstuttafordstarting from /
11:30pandeiroot: anyone have any favorite bad startup videos?
11:32robertstuttafordwhoa ok even (html/html-resource "http://www.google.com&quot;) has the error
11:32robertstuttafordenlive 1.0.0 right?
11:34bhenryso 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:36S11001001bhenry: add it back
11:37bhenryS11001001: new info. lein2 repl works fine with same project on another machine.
11:39bhenryS11001001: also just for kicks i added it back on the offending machine and it still times out
11:39yoklovheh, there's a typo in cljs.reader
11:40yoklovhttps://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L157 "charater"
11:40yoklovIs that the sort of thing I should make an issue on JIRA for?
11:41achepandeiro: 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:43carkhello all
11:44carkI've been giving a try at clojurescript and having some problems
11:45carkwhen 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:46carki'm using the head version
11:47ynnivwow, lein ring uberwar + resource-path is awesome
11:47carkso the question is this : anybody experiencing this problem, and is there a solution ?
11:47yoklovcark: That's weird, you're doing ^:export?
11:48carkyes i have a single function defined like so : (defn init ^:export ....
11:48yoklovoh
11:48yoklovyou want (defn ^:export init ...)
11:49carkdarn let me try that ...
11:49yoklovyou're applying the metadata to the var, init
11:50carkindeed it works ....
11:50carki've been banging on this one for a while, thanks a lot !
11:51robertstuttafordynniv: please do elaborate for this newbie?
11:51pandeiroache: 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:51ynnivI've been running in swank with ring-response/file-response
11:52yoklovcark: heh, no problem :)
11:52yoklovhope you like cljs!
11:52ynnivI just switched to a top level :resource-path in my project.clj
11:52ynnivand a ring-response/resource-response
11:52carki've been using clojure for a long time, having high hopes for clojurescript
11:52robertstuttafordyoklov: have you ever had to generate an externs for a cljs compiled js file before?
11:53robertstuttafordresource-path is what ring uses to serve static assets, right?
11:53carki think there's an ongoing effort for implementing persistent data structures in cljs, what's the status on that ?
11:53ynnivthen use "lein ring uberwar" and it packages my ring routes for tomcat
11:53yoklovrobertstuttaford: No, sorry. I usually don't export anything and just load my code at the bottom of the page to be honest
11:53yoklovcark: they're all there, pretty much
11:53ynnivdrop that war in tomcat's webapps and it's good to go
11:53ynnivyes, resource-path is for static files
11:54carkyoklov: awesome, that's what made me wait for such a long time
11:54RickInGAcark: I beleive they have done persistant vector and persistant map.
11:54robertstuttafordyoklov: ok cool. i want to make a base cljs app that loads up cljs modules on demand
11:54yoklovmaps, vectors, sets, sorted sets seqs,
11:54ynnivand if you're using noir, you get a ring handler via (def ring-handler (server/gen-handler))
11:55yoklovrobertstuttaford: 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:55ynnivi'm not sure about noir over straight compojure tho
11:55carkthat's nice, any idea on the performances of the cljs persitent datastructures ? as related to java clojure ?
11:56yoklovseqs are slowish
11:56carkor maybe related to javascript
11:56robertstuttafordyoklov: gclosure compiler just needs an externs definition for the exported symbols and it'll work fine
11:56robertstuttafordi use gclosure the painful way and have this working already
11:56yoklovcark: iirc, vectors and hashs are about 1/10th the speed of js native arrays and objects respectively
11:57carkyoklov: ok well i guess i'll have a look at that now that i can compile =) thanks again !
11:58carkactually 1/10th is not too bad imo
11:58yoklovcark: 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:58robertstuttafordcark, yeah. js execution is blistering these days, although i wonder how well mobile will cope
11:59wkmanireHowdy folks.
11:59bobryhow can I convert js Object to clojurescript map?
11:59yoklovbobry: js->clj
11:59carkyep, i'm so worried about performances to be honest, we're not doing hpc here after all =)
12:00carktho game developement might be a future use case... but that's not for me
12:01bobryyoklov: is it available out of the box?
12:01yoklovcark: cool, though in my experience if you are somewhat disciplined you can get cljs to be the same speed as js
12:01yoklovbobry: yup, in cljs.core
12:01carkok well going back to experimentation, bye =)
12:01yoklovcark: i've been working on the game development side in cljs, it performs fine http://thomcc.github.com/Argh/
12:02yoklovthat's old though, I should update it at some point...
12:02carkyoklov: mhh i'm going to check that =)
12:02yoklovat least so it doesn't refer to the past as "next weekend"
12:03carkwow i'm impressed
12:03yoklovheh, thanks
12:03carkis this webgl ?
12:03yoklovnope
12:03cark!
12:03yoklovit would look better if I did webgl
12:04yoklovand I've been thinking of learning it...
12:04RickInGAthat's awesome yoklov!
12:04carkdon't tell me you're mapping these textures from clojurescript
12:04yoklovRickInGA, thanks!
12:04yoklovcark: yeah, its a mess though, https://github.com/thomcc/Argh/blob/master/src/argh/render.cljs
12:05yoklovI've refactored those into outer functions several times, but the destructuring of the game state ends up being a huge perf. bottleneck
12:05cark60 fps, i can't beleive it =)
12:06muhooheh, bultitude
12:07dnolencark: yoklov is right, CLJS data structures are within an order of magnitude of arrays and objects.
12:07muhooi dunno how paul bultitude meets the wikipedia notability guidelines
12:07dnolencark: there's probably more tuning that we could do.
12:07dnolencark: that said, that why there's explicit support for using arrays and objects directly.
12:07carkdnolen: one order of magnitude is fine by me
12:08carkdnolen: filling a table will still be instantaneous =)
12:09dnolencark: one problem is that JS engines just don't aggressively inline yet the way that the JVM does.
12:09dnolenmmarczyk: ping
12:09carkdnolen: do you see much differences between different javascript engines ?
12:09mmarczykdnolen: pong
12:11yoklovcark: In my experience chrome is much faster than gecko, but the speed difference goes away mostly during advanced compilation
12:11yokloverr, v8
12:11dnolenyoklov: especially now with 1211
12:11jweissanyone else see a problem where leiningen (i'm using 1.7.1) hangs if there is a compile error when running lein jar?
12:11dnolenyoklov: we analyze ns dependencies first, under advanced compilation we almost never emit foo.call(null, ...)
12:12yoklovdnolen: Oh, that's great
12:12dnolenmmarczyk: http://dev.clojure.org/jira/browse/CLJS-247
12:12technomancymuhoo: it's named after the bear, FWIW
12:12jweiss(i'm using a java project by the way with that lein error)
12:13yoklovdnolen: 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:15dnolenyoklov: fixed thx
12:15yoklovno problem
12:15dnolencark: yes
12:16dnolencark: V8 is the king, JSC w/in 2X, SpiderMonkey is reasonably fast now but lags behind.
12:16technomancyjweiss: probably a thread pool got started and is keeping it open
12:16technomancyI wonder how old gjs's version of spidermonkey is
12:16jweisstechnomancy: that's what the thread dump looks like, yeah
12:16dnolencark: 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:17mmarczykdnolen: 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:17technomancyjweiss: not much we can do about that until clojure implements a way to undo shutdown-agents
12:17technomancyhttp://p.hagelb.org/scumbag-shutdown-agents.jpg
12:17jweisslol
12:18dnolenmmarczyk: I don't see how we can make that assumption at.
12:18dnolenall
12:18mmarczykdnolen: right now we can't
12:18mmarczykdnolen: but with some rewrites to core.cljs
12:18jweisstechnomancy: lein compile, jar seems to let it exit gracefully
12:18dnolenmmarczyk: seems more complicated than bit testing and dispatching which we know if fast.
12:18dnolenis fast
12:20mmarczykdnolen: hm, probably right
12:21mmarczykdnolen: but yeah, doing the bit test first if the protocol is on the fast path makes sense
12:21dnolenmmarczyk: it would eliminate one extra function call - that's a big win for protocols.
12:21technomancyjweiss: oh, curious
12:21mmarczykdnolen: right
12:21technomancythere shouldn't be a difference
12:21technomancyjweiss: can you repro on 2.x?
12:22jweisstechnomancy: i haven't tried, will give that a shot in a bit
12:23dnolenyoklov: reducers stuff should be pretty interesting for CLJS perf
12:23yoklovdnolen: what's the deal with cljs-172? (implement chucked persistentvectors)
12:23technomancywhile I haven't ruled out another bugfix release on the 1.x branch, I'd rather not unless a serious issue is found
12:23dnolenyoklov: what do you mean?
12:23yoklovdnolen: There's a patch for it, is there any reason it hasnt been applied?
12:24mmarczykincidentally, 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:24technomancyjweiss: curious, is there anything blocking you from upgrading, or just haven't had the time?
12:24yoklovdnolen: I hadn't had time to look into the reducers really, but I thought it had to do with parallelism
12:24dnolenyoklov: and zero-allocation overhead.
12:25mmarczykyoklov: 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:25yoklovdnolen: Ah, okay, that seems to make more sense
12:25dnolenyoklov: oh I missed that, no specific reason. But what mmarczyk applies.
12:25dnolenmmarczyk said applies.
12:25dnolenyoklov: we need to update all the seq fns to take advantage of chunked seqs.
12:25mmarczykyoklov: 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:26mmarczykdnolen: so, I'd love to take 247
12:26dnolenmmarczyk: cool!
12:26mmarczykdnolen: ok, I'll post a patch tonight
12:27dnolenmmarczyk: with the patch mind mentioned code size difference?
12:27dnolenmentioning
12:27mmarczykdnolen: sure
12:27dnolenmmarczyk: thx
12:28mmarczykdnolen: size of $CLOJURESCRIPT_HOME/out after a test run, say?
12:28dnolenmmarczyk: core-advanced-test.js yes
12:29dnolenyoklov: I wonder if map destructuring should support property access for hosts that provide fast access w/o type hints like JS.
12:29mmarczykdnolen: 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:30mmarczykdnolen: if code turns out to grow a lot, I'll add the :inline-... switch
12:30mmarczykdnolen: {:properties [foo bar baz]} !!!
12:30dnolenyoklov: http://dev.clojure.org/jira/browse/CLJS-248
12:31yoklovdnolen: that would be an enormous benefit
12:31espeedwhere did clojure.contrib.string get moved to?
12:31dnolenyoklov: mmarczyk: worth bringing up on the dev list - since it's a change to Clojure's destructuring syntax.
12:31mmarczykwow, that is a *fantastic* idea
12:32mmarczykdnolen: sure -- but definitely a +1 from me
12:32dnolenmmarczyk: re: inline-protocol-fns, sounds good.
12:33mmarczykdnolen: are you planning on writing a patch for 248? otherwise I'd love to to do that once I'm done with 247
12:33yoklovYeah, 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:33dnolenmmarczyk: go ahead, it probably won't be applied till we get feedback from the list is all.
12:33mmarczykand possibly reducers, though I'm hoping that's half an hour away.
12:33technomancyespeed: clojure.string, but watch out for reversed argument order
12:33mmarczykdnolen: cool
12:34acheespeed: is that different from clojure.string ?
12:35espeedtechnomancy: thanks
12:35espeedache: it's now the same -- just found the docs saying that (http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go)
12:35acheah. i don't type as fast as technomancy :-P
12:36technomancyit's the dvorak
12:37TimMcand the methamphetamines
12:38uvtctechnomancy: aoeu!
12:39muhooyou don't need methamphetamines if you livein seattle
12:39muhoothere's coffee :-)
12:40muhooapparently, 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:40felipedmuhoo: wat
12:41technomancyuvtc: um... htns?
12:41technomancyin Indonesia Red Bull has nicotene in it
12:41felipedwhat about nicotine
12:41muhoohmm, a wrapper added with add-middleware runs 3 times per request?
12:41technomancyfeliped: I'll have to check next time I'm there
12:41felipedtechnomancy: :D
12:43uvtctechnomancy: Evidently that's the secret handshake. ;)
12:43pandeiromuhoo: noir?
12:44ibdknoxpandeiro: about the removing of the other custom middleware
12:44pandeiroyeah, i gleaned from that convo you're kind of in flux about all that
12:45ibdknoxpandeiro: I added it because otherwise it would be another breaking change compared to the original behavior
12:45ibdknoxpandeiro: that being said, if someone wanted it back they'd only need to do wrap-route :resources
12:46pandeiroibdknox: are you not thinking about rewriting parts of noir.server? i got that impression
12:46ibdknoxpandeiro: in your specific case, couldn't you just check if the response is null and only log otherwise
12:47ibdknoxpandeiro: it probably makes sense
12:47pandeiroibdknox: there are a couple workarounds, don't worry about my case... i brought it up b/c it seems broken in general
12:47ibdknoxyeah
12:47ibdknoxunfortunately it's somewhat a limitation of compojure
12:47pandeiroand i figured my solution was flimsy at best, which you just confirmed...
12:48pandeiroi see
12:48pandeiromaybe the temporary solution is deprecating add-middleware so people aren't surprised by that? i dunno
12:49ibdknoxI dunno, definitely something that needs more thought
12:49alexyakushevtechnomancy: is there a convenient way to exclude :dev profile from the profiles (e.g. for building the release version)?
12:50pandeiroibdknox: i also submitted a pr for the defpartial docstrings, did you see that already?
12:51ibdknoxI saw it was up, haven't had a chance to look at it yet
12:51pandeiroi think that one's a little more straightforward, if you still think it's useful
12:51nDuffI 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:51nDuffCurrent attempt: (into {} (for [[cur-set value] {s1 :a, s2 :b} item cur-set] [item value]))
12:51mmarczykdnolen: 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:52nDuff(err, make that :a true and the :b false to match with the problem description)
12:55mmarczykdnolen: core-advanced-test.js size increases by ~4k (357 to 361)
12:55felideonibdknox: so should we bug you about pull requests now or after light table is funded? :P
12:58mmarczykdnolen: just attached a patch to CLJS-247
12:58ibdknoxfelideon: merged
12:58technomancyalexyakushev: yeah, it's actually a bug that it's not being excluded when you generate the pom/jar right now
12:58technomancyalexyakushev: it's fixed in master; I hope to have a new preview release tomorrow
12:59felideonibdknox: nice!
12:59felideonthank you, kind sir.
13:00technomancyalexyakushev: btw, I meant to mention this earlier, but you might find this useful: https://github.com/mirah/pindah
13:00technomancyI tried to leave a comment on your blog but the comment form wasn't in english, so I got confused. =)
13:02TimMctechnomancy: That's to keep out pesky foreigners like you.
13:04alexyakushevtechnomancy: as I can see in the "jar" subtask the classpath is recreated from scratch (i.e. from :without-profiles), am I right?
13:04technomancyalexyakushev: that's correct in git master; it wasn't true in preview3
13:05alexyakushevtechnomancy: What I want to do is to have a nrepl dependency in :dev profile but exclude it in :release
13:05uvtcIs ::foo just shorthand for :the-current-namespace/foo?
13:06technomancyalexyakushev: if you need to do it with preview3, you could create an empty profile and do `lein with-profile empty jar`
13:06ibdknoxpandeiro: for the defpartial can't you just take the (rest params)? based on tools.macro params should contain everything after the name
13:06ibdknoxpandeiro: so the fn params would be (first params) and the body would be (html (rest params))
13:06MordusHi, I want to learn about web services programming in Clojure, can anyone recommend any resources for this?
13:07ibdknoxMordus: http://webnoir.org
13:07Mordusibdknox: thanks
13:07technomancyMordus: this is a good overview: http://brehaut.net/blog/2011/ring_introduction
13:07alexyakushevtechnomancy: 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:07technomancyexcept it's too old to mention noir, oops
13:07alexyakushevtechnomancy: but if it is fixed in master, I'm ok with it
13:08technomancyalexyakushev: oh, shoot; I thought that would have worked. =\
13:08pandeiroibdknox: 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:08MordusWhat 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:09technomancyclojurebot: via soap?
13:09clojurebot"They enable us to send XML messages through SOAP. Through SOAP!!!" (http://www.youtube.com/watch
13:09technomancy=(
13:09felideonibdknox: did you design the websites for your libs?
13:09ibdknoxfliebel: yeah
13:09ibdknoxerr
13:09ibdknoxfelideon: yeah
13:10kzarIt's crap in a million ways but check it out, first version of my drum machine http://kzar.co.uk/static/davesteppa/
13:10alexyakushevtechnomancy: oh, sorry, it actually worked. My bad, got mixed among all this maps being printed to the terminal:)
13:11uvtcRe. ::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:11ibdknoxkzar: neat :)
13:11technomancyalexyakushev: whew; that means I'm not going crazy
13:11kzarYou can edit the tracks on the fly, it lets you do different time signitures so you can make some interesting stuff
13:12ibdknoxkzar: yeah I was surprised by the on the fly editing - well done.
13:12alexyakushevtechnomancy: sorry again:) and thanks for the link to pindah, I can definitely find something interesting there
13:12kzaribdknox: cheers :)
13:13technomancyalexyakushev: 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:14mmarczykkzar: wow, that's cool!! :-)
13:15yoklovkzar: extremely neat
13:17TimMcYay, polyrhythms!
13:20kzar:) cheers guys
13:26cacodaemonuser=> (use 'main)
13:26cacodaemonIllegalArgumentException Don't know how to create ISeq from: clojure.lang.Symbol clojure.lang.RT.seqFrom (RT.java:494)
13:26cacodaemonwhat am i doing wrong? :)
13:27kzarcacodaemon: Something in main namespace is treating a symbol like a sequence? Perhaps you're quoting the name for a sequence by mistake?
13:27MadsyNone of the jogl packages in the Clojars and central can be downloaded. What's up with that?
13:27duck1123cacodaemon: is this clojurescript?
13:27MadsyI tried 2.0-SNAPSHOT and 2.0-rc3
13:27cacodaemonno, just clojure
13:29cacodaemonah, figured
13:29cacodaemonyes, error was in "main" namespace
13:30duck1123just as a note, it's generally best to try to avoid single segment namespaces
13:31duck1123there's an issue, I think with AOT or something.
13:32cacodaemonyes, i know. Just cannot force myself to make decent namespaces and +1 dir level:)
13:33Bronsalooks like richard stallman had a heart attack
13:34cacodaemontrouble with ISeq/symbol was in name clash - deftype from clojure.core and deftype from clojure.contrib.generic
13:34dnolenmmarczyk: what about advanced?
13:34kzarBronsa: literally?
13:34Bronsayeah
13:35Bronsahttp://www.i2cat.net/ca/multimedia/201205/richard-stallman-conference
13:35kzarshit
13:35felideonBronsa: how do you know it was a heart attack
13:36Bronsawell, it's all over twitter.
13:36pandeiro,(rest '[1 ([2] [3] [4])])
13:36clojurebot(([2] [3] [4]))
13:36pandeiro,(nth '[1 ([2] [3] [4])] 1)
13:36clojurebot([2] [3] [4])
13:36duck1123yeah, that doesn't give much to go on there
13:37pandeiro,(second '[1 ([2] [3] [4])])
13:37clojurebot([2] [3] [4])
13:38dnolenmmarczyk: that patch is nice though that's not the call site optimization I had in mind.
13:39dnolenmmarczyk: patch for 247 is really the patch for 246, if you move that, I'll happily apply.
13:43wkmanirepandeiro: Are you a musician?
13:43pandeiropandeiro: amateur, bad one, yes i guess
13:44wkmanirepandeiro: talking to yourself?
13:44wkmanirehe he
13:44pandeiroalways :)
13:44pandeirosorry yeah i am trying to debug a macro for the first time
13:44wkmanirepandeiro: Which city are you in? I'm in Cuiabá.
13:45wkmanirepandeiro: I still haven't learned the macro forms.
13:45pandeirois it just me or is it 10x harder than debugging a fn?
13:45pandeiroi am in sp
13:45wkmanirepandeiro: Oh ok. Too bad. It'd be fun to get a beer and talk about clojure stuff.
13:46pandeirowkmanire: definitely! one day i'd like to start a group here
13:46wkmanireI've spoken with some developers here, most use Java or Python.
13:47pandeirodont forget php
13:47wkmanireI haven't met anyone on the streets that uses clojure yet.
13:47TimMcpandeiro: macroexpand-1, and lots of printlns...
13:47wkmanirepandeiro: I was talking about programming langauges.
13:47wkmanirelanguages*
13:47scriptorscala is getting increasingly popular around here
13:47pandeiroTimMc: macroexpand-1 assumes you have something that doesn't throw an exception
13:47technomancyscriptor: where's "here"?
13:47pandeirowkmanire: i like your sense of humor... dry...
13:47TimMcThat's where the printlns come in. :-P
13:47wkmanirepandeiro: :D
13:47scriptortechnomancy: nyc, though it's probably spread beyond that too
13:48scriptorboth tumblr and meetup use it, for example
13:49TimMcJava++
13:49TimMc^ my impression of the language from the little I've seen
13:52wkmanirepandeiro: 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:53wkmanirepandeiro: R$6000 worth of caipirinhas.
13:53wkmanireI can't believe one person could drink that much alcohol on one tourist visa stamp.
13:55pandeirowkmanire: i'm hoping they don
13:55pandeiro...dont know i'm hiding here in sp
13:56pandeiroit's very easy to say yes when they offer you a second caipirinha
13:57dpritchettWhat's the idiomatic way to collect input via read-line until the user enters a special exit sequence (e.g. "")
13:57wkmanirepandeiro: What about when they offer you a 33rd caipirinha?
13:59wkmanirepandeiro: He he he, he was here for a heart treatment. ha ha hah too much. lunch time.
14:08pandeiroibdknox: you were right, i was greatly overcomplicating how body was bound in defpartial; updated pull req
14:09nDuffHrm.
14:12rhcnDuff: i had that problem too recently
14:12technomancynDuff: that's a bug in clj-stacktrace
14:12technomancyhaven't been able to reproduce it consistently
14:12mmarczykdnolen_: reattached that patch to 246
14:12mmarczykdnolen_: sorry for the confusion
14:12rhcnDuff: sometimes poking around clojure.stacktrace reveals it
14:14fliebelA while back, some Clojure guy tweeted a video of a sketching machine with switches, flickering lines, a pen and a screen. Any ideas?
14:14fliebelVery old thing. It showed some guy drawing a square, and the square correcting itself.
14:14matessimI'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:15mmarczykdnolen_: I'll do the real 247 too, btw
14:17mmarczykmatessim: 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:18mmarczykdnolen_: (reattached after adjusting ticket no. in the commit message, that is)
14:18matessimhmm
14:19matessimi seem to be missing the difference commutes have, since both alter and commute would rerun if the start value changed on commit time
14:19matessimright?
14:19clojurebotflatten |is| rarely the right answer. What if your "base type" is a list
14:20matessimboth would rerun on the latest ref*
14:21rhcmatessim: i dont think commute would ever need to rerun
14:21rhcmatessim: it can just run once the transaction is completed
14:21rhcerr, when the transaction is completed
14:22matessimbut transactions can run asynchronously, right? This is why this "problem" exists?
14:23matessimi 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:24rhci'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:24rhci'm pretty new to clojure so i could be wrong about this too :)
14:25rhcyou dont care about the time because the operation is commutative
14:25rhclike say you had a transaction that moved money
14:25rhcand there was also some global state like "how much money has ever been moved"
14:26rhcso you (dosync (let [m (remove-from-a)] (add-to-b m) (commute all-money-moved + m)))
14:26matessimbut the documentation says that if another transaction was commited,the transaction local value is discarded
14:27matessimand the mutation operation is applied again
14:27rhcif two of those are running at the same time, you really dont care what the order of adding all-money-moved is
14:27matessimisn't this equal to rerunning the transaction?
14:27rhcwhere do you see that?
14:27rhci'm looking here http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/commute
14:28matessimhttp://en.wikibooks.org/wiki/Learning_Clojure/Concurrent_Programming
14:28matessim 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:28matessimoperation is applied again, this time to the new current Ref value, and the resulting value is committed.
14:28matessimi might be confusing the transaction scope with the commute scope.
14:28matessimi think i am.
14:29rhcah yeah, its just re-running commute only
14:29rhcnot the rest of the transaction
14:29matessimand the other versions
14:29matessimrerun the transaction?
14:29rhcyeah, i think so
14:29rhclike ref-set
14:29rhcwill have to re-run the transaction
14:30rhcbecause the state of the world has changed and the logic of your transaction might want to do soemthing different now
14:30matessimso commutes are better if i'm doing any sort of I/O for example, right?.
14:30rhcthings like bumping a counter, appending a log, building an unordered set/list are all good applications of commute
14:30matessimwhen i'm not going to get double input for each transactions
14:30matessimtransaction*
14:30rhci'm not sure what you mean
14:31matessimwhen before the commute in the transaction, i have something that requires a very large resource overhead for example.
14:31matessimlets say reading from a disk.
14:31matessimi wouldn't want to reread the disk every time another transaction is writing to it.
14:33matessimman clojure is awesome.
14:34TimMcmatessim: You'd generally avoid I/O inside a transaction, though.
14:34matessimI've seen the doc says something about it being retired.
14:34matessimtransactions retired
14:35TimMcretried?
14:35matessimnot as in depractated i assumed, but i couldn't figure out what it means
14:35TimMcOh, "retired", really?
14:35matessim"I/O and other activities with side-effects should be avoided in transactions, since transactions will be retried"
14:35gfrederickstypo for "retried"?
14:35matessimwat
14:35matessimlol
14:35gfredericksbraino for "retried"?
14:35TimMchaha
14:35matessimno, typo for i can't read.
14:36matessimbut why should it be avoided if i'm using commutes anyway
14:36TimMcReminds me of http://i.imgur.com/vKy5j.jpg
14:37matessimLOL
14:37rhchah
14:37rhcmatessim: well, the commute function can still be called twice, so you don't want to put anything in there that has side effects
14:38rhcsame with everything else inside a transaction
14:38matessimif i use alter and commute in the same transaction i basically risk losing the advantage of commute right?
14:38TimMcIf you use them on the same ref, yes.
14:39TimMcOn different refs, no -- as long as other transactions are not hammering on the ref you alter in the first one.
14:39TimMcmatessim: By the way, read about ##(doc ensure) -- it's good to know about.
14:39lazybot⇒ "([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:40matessimoh wait braindamage incoming...
14:40matessimmultiple refs modification in the same transaction
14:40matessimhow is that not messy as hell?
14:40rhcwhats the whole point of transactions :)
14:40matessimbut if i have many refs being changed
14:40matessimand many transactions going on
14:41matessimi could be hammering the rerun button
14:41matessimrunning transactions many time
14:41rhcyep
14:41rhcconcurrency has its limit when you want consistency
14:41TimMcAs 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:41matessimCAP Theorem :P
14:42TimMcNah, there's no P here.
14:42matessimNo TimMc, i'm a complete newbie
14:42matessimwell, to Clojure
14:42matessimTimMc, isn't speed relative? if i have large transactions etc, possibly taking multiple miliseconds
14:43matessimand a few transactions
14:43matessimand alter on like 3 refs
14:43matessimi'd be setting myself up for a disaster wouldn't i?
14:43nDuffAre 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:44TimMcmatessim: I would *guess* that in the worst case, your transactions would serialize.
14:44matessimby that you mean they'll get queued?
14:44matessimafter a few tries? automagically?
14:45nDuff...shows up on (:impls ProtocolName) just fine...
14:45TimMcmatessim: I'd have to guess. I don't really know the answer.
14:45matessimwhat did you mean by serialize?
14:46matessimi must have misunderstood.
14:46TimMcRun one-at-a-time.
14:46TimMcWhich isn't the same as queuing, since that implies a specific strategy for serialization.
14:50matessimbut basically what you're saying is, that Clojure would automatically manage to finish all my transactions
14:51matessimthat it would fallback to a strategy that is less parallel
14:51craigbrohola
14:51amalloynDuff: no, you can extend. you must have the syntax wrong
14:51dpritchettAnyone 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:54craigbroerr, never mind, logged in to ask question that was solved by updating my copy of tools.logging
14:54amalloydpritchett: 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:54dpritchettyeah, maybe i can gzip it too
14:55dpritchettseriously though, i only barely managed to make it work in clojure
14:55amalloyalso, 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:55dpritchettmy super-simple-not-idiomatic python code was 25 lines, my idiomatic one was half that
14:55dpritchettyeah i love list comps
14:55dpritchetti just didnt know how to implement "take input until the user enters a blank line" any other way
14:56amalloy(defn letter-grade [avg] (first (for [[score label] cutoffs :when (<= score avg)] label)))
14:56amalloy(for example)
14:57dnolen_mmarczyk: thanks
14:57amalloy(defn collect-test-scores [] (map read-string (take-while seq (repeatedly #(do (println ...) (read-line))))))
14:58jtoywhere is lein stored ? when I do "which lein" i get nothing returned but I'm able to use it
14:59technomancyjtoy: it's stored wherever you want to put it
14:59jtoyshouldn't which find it?
14:59jtoyi don't remember, hence looking
14:59amalloyjtoy: if which doesn't find it, but it runs anyway, your operating system is to blame
15:00amalloymost people put it in ~/bin
15:00jtoyits in my ~/bin is it ok to do a system wide install?
15:00technomancysure
15:01amalloyi guess my collect-test-scores isn't incrementing and printing the score number, though, dpritchett
15:01robertstuttafordin my json api, i have /resources/uuid and /resources/uuid/version
15:01hiredmanfor really should except :where as a synonym for :when
15:01robertstuttafordi'm guessing i can multimethod this?
15:01RaynesExtra extra, read all about it. Latest is that Richard Stallman had a heart attack during a conference a little while ago.
15:01robertstuttafordoh dear
15:02dpritchettamalloy fwiw my original python implementation was hard coded to take range(1,5) inputs
15:02dpritchettso i guess thats a few lines lost
15:02dpritchettand the python was only a single function since I was able to assign new variables willy-nilly mid-function
15:02dpritchettlike halfway down the page it said average_score = float(sum(scores)) / len(scores)
15:04jtoycool, thx
15:04jsabeaudryIs noir 1.3 ready for prime time?
15:04RaynesYes.
15:04RaynesGo get you some.
15:04jsabeaudryYay!
15:05jsabeaudryRaynes, beta6 is the way to go?
15:05amalloydpritchett: you don't really need any of these extra functions in clojure either, but clojure does encourage you to use smaller functions
15:06RaynesIf you don't use small functions, children cry.
15:06RaynesBut if you're okay with children crying, you can certainly not use small functions.
15:06LicenserI think it depends on how loud they cry and how far they are away
15:08RaynesLicenser: If you write something as long as doseq, the child tells his teacher that you beat him.
15:08RaynesWork backwards from there.
15:08Licenseroi
15:09kennethhey, do you have to use clojure to serve clojurescript stuff?
15:09MadsySigh.. anyone have an idea how I can install jogl from upstream (NOT maven or central) and make leiningen find it?
15:09dpritchetti 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:09kovasbkenneth: no, you can just compile the clojurescript to js and serve that as static files
15:09dpritchetterr scroll down to the second file to see the difference
15:10dpritchettplus i guess i punted on handling a variable number of inputs in python. gotta figure that one out...
15:10Rayneskenneth: Clojurescript compiles directly to Javascript, with which you can do and use as you please.
15:10Licenserkenneth no but it's simpler
15:10RaynesIt doesn't have to be used in conjunction with JVM Clojure, but they make an excellent pair.
15:11RaynesPart of the excitement with Clojurescript is to be able to use Clojure on the server and client side.
15:11kennethnot in my case Licenser :)
15:11Licenserkenneth replace erlang with *
15:11RaynesWell, don't hype too much Licenser.
15:11Raynes;)
15:11kennethyeah i definitely want to go more full stack with it, but for now i'm stuck dealing with a massive legacy codebase
15:12LicenserRaynes I did erlang before ti was cool :P
15:12RaynesLegacy smegacy. Delete it all and write it in three lines of Clojure.
15:12kennethdeploying on hundreds of jvm-less servers :p
15:12RaynesThen quit your job and live on a mountain.
15:14amalloydpritchett: you seem to be comparing a python implementation of X with a clojure implementation of X, Y, Z, and some more letters
15:15RaynesI'm particularly interested in your implementation of U and P.
15:15dpritchettfair enough amalloy, i updated the python in the gist to match the same functionality.
15:16dpritchettI would like to learn Clojure to the point where my clojure implementation looks better than the python one
15:17Raynesibdknox: six thousand dollars away from light table euphoria.
15:17Raynesibdknox: Better get your announcement prepared. Make hacker news explode, implode, black hole, and every other strange thing.
15:17amalloyfor 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:19robertstuttafordi've been programming clojure for two days solid and i'm still not dead
15:19Licenserwhich remidns me I need to kick in somehting for ligthtable
15:20Licenseribdknox how aout erlang support? *ducks*
15:20RaynesI'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:20LicenserRaynes hint: don't write ruby
15:20RaynesLicenser: Erlang is pretty dynamic. I'd be interested in seeing if it would be possible.
15:20RaynesLicenser: https://github.com/Raynes/refh
15:21AimHereI put on a clown costume and greasepaint when I touch javascript
15:21MadsyAnyone? 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:21LicenserRaynes you could have written that in pure shell
15:21craigbroanyone using clj-loging-config to log to multiple appenders?
15:21ache 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:21craigbroI can't seem to get that working. Always appends to the first one
15:21RaynesLicenser: 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:21RaynesLicenser: One thing about Ruby is that it is cross platform while BASH is not.
15:21LicenserRaynes yes it means i could use refh on my server :P
15:22robertstuttafordon clojurescript, are there any issues with it that would prevent widespread use?
15:22robertstuttafordknown browser issues, for example
15:22RaynesLicenser: Well, you can actually just use curl. So, it's probably a one liner script unless you want to do fancy things.
15:25technomancyMadsy: you could try lein-localrepo, but I'm not sure it would work for dependencies with native components
15:25Licenseranyone using tramp (emacs ssh thingy)?
15:25yoklovrobertstuttaford: 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:26yoklovAnd some stuff probably is slower in older browsers.
15:27rvgateI'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:28rvgateto simplify: ((comp + - -) 8 3)
15:28xeqi&(+ (- (- 8 3)))
15:28lazybot⇒ -5
15:28Raynesxeqi: Dude. I was almost done typing that.
15:29Bronsame too.
15:29RaynesYou took that from me. I hope you're happy with yourself.
15:29xeqivery
15:29Raynesrvgate: 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:30Raynes&(- 8 3)
15:30lazybot⇒ 5
15:30Raynes&(- 5)
15:30lazybot⇒ -5
15:30Raynes(+ -5)
15:30Raynes&(+ -5)
15:30lazybot⇒ -5
15:30Bronsahttp://www.publico.es/ciencias/432664/richard-stallman-rajoy-nos-quiere-matar-a-todos
15:30RaynesThat's what happens step by step.
15:30Bronsaso it wasnt a heart attack after all
15:30TimMc&(#(+ (- (- % %2))) 8 3)
15:30lazybot⇒ -5
15:30TimMcrvgate: ^ it's more like that
15:30RaynesI don't speaka the spanisha.
15:30Bronsame neither
15:30rvgatelol
15:30rvgatethis help is to much
15:31rvgatexD
15:31TimMc"The president of the Free Software Foundation has begun to feel ill, apparently due to a power surge"
15:31Bronsabut since i speak italian i can understand what's going on
15:31TimMc...
15:31rvgatethx for the help!
15:31Bronsalol
15:32RaynesTimMc: Yeah, I didn't quite get that either.
15:32AimHereA power surge?
15:32RaynesTimMc: I didn't realize he was *that* plugged in.
15:32Bronsahypotension
15:32TimMcThis article must be wrong, RMS connects to the internet through a UPS.
15:33AimHereSlightly out of date, BTW, RMS is apparently well, though in hospital
15:33michaelr`lsd overdose?
15:36dnolen_mmarczyk:
15:36dnolen_mmarczyk: ping
15:36michaelr525running "lein run" in a webnoir website sometimes takes ages for the server to start, anyone knows why?
15:37michaelr525i guess it's compiling or loading jars or something, right?
15:38mmarczykdnolen_: pong
15:38dnolen_mmarczyk: actually sorry one second
15:38mmarczyksure
15:45dnolen_mmarczyk: k so I see a slowdown with 274 applied
15:46dnolen_mmarczyk: you shouldn't be accessing the property if the bit mask succeeds
15:46dnolen_mmarczyk: just call.
15:49craigbromichaelr525: It's loading all the views probably, and all the models
15:49craigbromichaelr525: and all the things they depend on etc..
15:52mmarczykdnolen_: hm
15:53mmarczykdnolen_: as far as I can tell, if the bit test succeeds, there is no property lookup
15:53dnolen_mmarczyk: I'm double-checking
15:54mmarczykdnolen_: `(or (unsafe-bit-and (. ~(first sig) ~msym) ~bit) (. ~(first sig) ~(symbol (core/str "-" slot)))) -- the whole test for the fast path protocol case
15:55Raynesmichaelr525: Takes a long time in comparison to what? Other Clojure applications?
15:55RaynesThe JVM takes a long time to start up even without noir.
15:56RaynesBut 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:56mmarczykdnolen_: what's the test that slows down? and compilation settings?
15:56dnolen_mmarczyk: advanced slows down
15:56dnolen_on V8
15:57mmarczyk:-(
15:58Raynes$seen brehaut
15:58lazybotbrehaut was last seen quitting 14 hours and 15 minutes ago.
15:58mmarczykdnolen_: any particular benchmark?
15:58dnolen_mmarczyk: yeah, sorry actually the emitted code looks good - but I'm not seeing a speed improvement.
15:58dnolen_mmarczyk: I had a bunch of tests lying around for rest fn, calling seq on cons, calling nth on vector - everything got slower.
15:58mmarczykdnolen_: back to the drawing board then.
15:58gfredericks4clojure doesn't have a "next problem" button?
15:59Raynesgfredericks: Part of the fun is incrementing the number.
15:59fliebelWhy is clojure-py written from scratch, rather than based on cljs? (which is close to cinc afaik)
15:59Raynesfliebel: Does clojure-py compile to python code?
15:59mmarczykdnolen_: I benchmarked a bunch of first / rest / seq / next-involving expressions and they seemed to get faster; oh well.
15:59fliebelRaynes: erm, no, byte code.
15:59Raynesfliebel: That's probably why.
16:00dnolen_mmarczyk: do you have gist? I'll copy them and try them out as well.
16:00RaynesUnless cljs's compiler can be made to emit bytecode, which is entirely possible.
16:00RaynesI don't know how that stuff works.
16:00mmarczykdnolen_: just a sec
16:00dnolen_Raynes: it could.
16:01RaynesIn that case, I haven't a clue.
16:02mmarczykdnolen_: https://gist.github.com/2598523
16:02fliebeloptimization? Python being a primary Google language, in wonder why there is no closure/guava for Python.
16:03dnolen_mmarczyk: thx
16:07dnolen_mmarczyk: on my machine, I see faster timing prior to the patch.
16:07dnolen_mmarczyk: I updated V8 to HEAD last weekend.
16:07RaynesHoly crap. I just realized I have a really good use of debugging!
16:08mmarczykdnolen_: well, you're more up-to-date than I am :-)
16:08RaynesFor the first time in my entire career, I want a breakpoint. My life is forever changed.
16:10mmarczykdnolen_: 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:11mmarczykdnolen_: 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:11dnolen_mmarczyk: on which test? 233ms on which test?
16:11mmarczykdnolen_: -first
16:11dnolen_mmarczyk: what kind of machine do you have?
16:12dnolen_mmarczyk: on my machine -first on list is 39ms, w/ patch 70ms
16:12mmarczykwow
16:13mmarczyki5 -- the kind before sandy bridge
16:13dnolen_mmarczyk: yes a more rigorous performance setup would be great - especially one that documented OS + arch
16:13dnolen_mmarczyk: dual 2.66 i7 here
16:14mmarczykUbuntu 10.10
16:14dnolen_mmarczyk: particularly we're getting into that territory where we're trying to shave off from every last little corner :)
16:14dnolen_particularly since
16:14mmarczykyeah :-)
16:14mmarczykthat's actually not a bad spot to be in :-)
16:15Raynesmmarczyk: So, can cljs beat the Enterprise in a foot race at this point?
16:15mmarczykwhat do you mean
16:15mmarczykthe Enterprise *is* programmed in cljs
16:15RaynesNaw, it's old. COBOL legacy.
16:16dnolen_mmarczyk: I'm more optimistic about call site protocol inlining - but we'll see what he code size hit is.
16:16mmarczykRaynes: oh, you didn't mean http://en.wikipedia.org/wiki/Starship_Enterprise ?
16:16RaynesI did.
16:17mmarczykwhoosh then :-P
16:17Raynesmmarczyk: Did my cobol comment not make sense?
16:18mmarczykoh sure, after a moment ;-)
16:18RaynesYou 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:18mmarczykI'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:18mmarczykdnolen_: yeah
16:19dpritchettthe majority of my team programs in cobol
16:19dpritchettwell, xgen and cogen
16:20dpritchettwhich are apparently dialects that compile to cobol
16:20mmarczykhow eerie
16:22Raynesgfredericks: Is the site still up?
16:22rvgateAm 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:22RaynesNot really.
16:23rvgateso im not really the only one? :P
16:23gfredericksRaynes: must be I'm using it
16:23RaynesYou're probably not the only one, but it makes sense to me. *shrug*
16:23gfredericksoh whoops
16:23gfredericksby "failed" I meant the unit tests
16:23gfredericksnot the web app
16:24mdeboardrvgate: 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:24Raynesgfredericks: I thought you did, but 4Clojure spends more time in purgatory than it does on Earth, so I wasn't sure.
16:25craigbroI find the clojure.org website docs, and the src code are the best bets
16:25RaynesI'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:26Raynesclojure.org is so wildly inappropriate for a new Clojure programmer to learn from that it is amazing.
16:26dpritchettrvgate i usually try clojuredocs.org if a heredoc doesnt make any sense to me. sample code helps a ton
16:26craigbroagreed
16:26gfredericksRaynes: my coworker is using it right now to learn clojure and likes it
16:26craigbroi's a reference
16:27AimHereTo be fair, I don't see anything on the frontpage of clojure.org that claims to be a tutorial
16:27craigbroI learn languages from references
16:27craigbrotutorials usually just annoy me
16:27craigbrobut I've done alot of lisp and functional programming, so I didn't have to pick up all that
16:28craigbroit was mostly about learning to data structures, abstract data types, and the libraries
16:29craigbroon that note...
16:29craigbrothanx yall
16:30aperiodici essentially learned clojure from clojure.org, but i recognize that i'm weird
16:30Null-AI like the succinct explanations
16:30nelson-hi guys, I'm having issues with leiningen on osx
16:31RaynesTell us of your troubles.
16:32nelson-When I try to install swank
16:32michaelr525Raynes: well, it's really a small site with a few views but it takes minutes to load
16:32Raynesmichaelr525: Minutes sounds wrong.
16:32RaynesIf you mean actual minutes.
16:33michaelr525yeah
16:33RaynesDo you have the code anywhere?
16:33michaelr525nope
16:34michaelr525could be dropbox somehow affecting it?
16:34RaynesWell, 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:34nelson-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:34RaynesI'd start taking stuff out until it stops taking forever.
16:34michaelr525yeah, good idea :)
16:34RaynesWhat tutorial is that?
16:34RaynesBecause the vast majority of them are outdated and incorrect.
16:35nelson-Raynes: http://rockhoppertech.com/blog/learning-clojure-setting-up-the-emacs-on-osx/#osx
16:35S11001001the emacs?
16:36nelson-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:36Null-Anelson-: INFO] Unable to find resource 'lein-swank:lein-swank:jar:1.4.4' in repository central (http://repo1.maven.org/maven2)
16:36Null-AIncluding lein-swank-1.4.4.jar
16:36Null-ACreated lein-swank-1.4.4.jar
16:36Null-Ai think it succeeded
16:37nelson-and when I use lein search i get no output
16:37RaynesAre you stopping it before you get output?
16:37nelson-I installed leiningen through homebrew
16:37RaynesBecause it takes a long time to download stuff.
16:37nelson-no
16:37PeregrinePDXHeya brehaut
16:37Raynesbrehaut! My buddy! My pal!
16:37nelson-Raynes: I get that error immediately
16:38Raynesnelson-: Can you paste the entire output to https://www.refheap.com for me?
16:38PeregrinePDXWell lein-swank isn't on the maven repository. So it should continue on to check on clojars
16:38RaynesAssuming that isn't all it says.
16:38brehauthi PeregrinePDX , raynes
16:38RaynesThat's why I want to see what else it says.
16:39RaynesYes.
16:40RaynesEr, wrong channel.
16:41nelson-Raynes: https://www.refheap.com/paste/2683
16:41nelson-for instance when I use search, I get no output. Is it because search only uses the maven repository?
16:42RaynesI meant the output where it says it can't find lein-swank.
16:43nelson-Raynes: :ashamed: that seems to be working, I just thought that because of the first info message it wasn't working
16:43RaynesAh, good.
16:44RaynesNot sure about lein search. technomancy can probably help with that when he comes around.
16:45nelson-Raynes: Ok :). Thank you for your precious help.
16:46gfredericksawww. Raynes' help is so precious.
16:46RaynesI can't help it I'm adorable.
16:47PeregrinePDXLein 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:47PeregrinePDXSo I think it doesn't find the lein plugins for some reason.
16:48nelson-Raynes: One more question. Is there any book you recommend for learning clojure, for someone with previous programming experience in python/java?
16:49RaynesClojure Programming is the latest and greatest.
16:49nelson-Raynes: Once again, thanks :)
16:50Null-Anelson-: joy of clojure
16:51RaynesThe Joy of Clojure is best reserved as the next step after Clojure Programming and similar books.
16:52gfredericksaffectionately not referred to as "Jojure"
16:52Null-AYah I just read the TOC for clojure programming, that's probably the best newbie book
16:52Null-Aalso the coverage of web programming is very pleasing to the masses
16:54PeregrinePDXJust as a counterpoint. I've been having good luck with Programming Clojure second edition by Stuart Halloway
16:54Null-Aall 3 beeks are awesome
16:54Null-Abooks*
16:55RaynesSecond edition is mostly by Aaron Bedra, right?
16:56RaynesnDuff: You can google the why. Some people just want to code things first.
16:56PeregrinePDXHmm he is also credited.
16:56PeregrinePDXI dunno who it is mostly by.
16:56RaynesPeregrinePDX: Well, the base material is Stuart Halloway, but the updating and adding done for the second edition is, IIRC, Aaron Bedra.
16:56PeregrinePDXFair enough. I should have credited both authors.
16:58PeregrinePDXI admit not having to pay for the book I have is a lot of why I have the one I do.
16:58PeregrinePDXWork kindly provided the book to me.
16:59brehautthats a good reason :)
17:01nDuffnelson-: ...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:02eggsbyJoC rules
17:02eggsbyprobably JoC if you have a functional background, something like Clojure in Action if you don't
17:02eggsbyor ya Programming Clojure
17:03nDuffProgramming Clojure > Clojure In Action (IMHO, of course)
17:03eggsbyI haven't read the former
17:03eggsbywhy does wikipedia say RMS is dead
17:03eggsbyoh it doesn't anymore
17:03brehautbecause wikipedia is full of loons ?
17:03AimHereBecause wikipedia regularly say X is dead
17:03pipeline_he had a heart attack today
17:03nelson-Thanks guys, I will look into your suggestions
17:04eggsbyhi pipeline_
17:04AimHereHe took a funny turn, went to hospital, nothing serious.
17:04technomancyPeregrinePDX: the tokenizer for the search task is not quite right; we have someone working on an opet issue for that
17:04technomancyopen
17:05gfrederickshttp://en.wikipedia.org/w/index.php?title=Richard_Stallman&amp;diff=491869423&amp;oldid=491859935
17:06gfredericksthat's a pretty solid death edit. I wonder if somebody has a script for that.
17:06gfrederickstalk about an eerie diff
17:07AimHereHeh, I've used "John Galt" as a nickname when trolling Wikis too
17:07nelson-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:08AimHereGlad to see someone's carrying on the tradition
17:09technomancynelson-: it could be a tokenization problem; does `lein search swank` show output?
17:09nelson-let me try it out
17:09nelson-technomancy: No :S
17:09PeregrinePDXIt doesn't for me either
17:10technomancygfredericks: someone's been practicing
17:10technomancynelson-: what does `ls ~/.lein/indices` give you?
17:11nelson-technomancy: http___clojars.org_repo_ http___repo1.maven.org_maven2
17:11technomancynelson-: how big is each directory?
17:12nelson-technomancy: 238B and 408B respectively
17:13technomancybytes?
17:13clojurebotoctets, please. calling them bytes is racist.
17:13technomancyoops; sorry
17:13technomancynelson-: that's way too small; must have been a problem downloading them. delete them and try again
17:14nelson-technomancy: sorry, 3.1 M clojars and 251M the maven
17:14technomancyhm; not sure what's going on then
17:15nelson-technomancy: It's a fresh install from homebrew
17:18PeregrinePDXnelson does lein search noir work by chance?
17:19nelson-PeregrinePDX: yes, it does
17:20technomancynelson-: oh, ok in that case it must just me a tokenization issue
17:20technomancyit's breaking down the words in the query in a slightly different way from the way they were indexed
17:21technomancyhttps://github.com/technomancy/leiningen/issues/243 <- details
17:21nelson-technomancy: Ah ok. That explains it. Thanks
17:28winkywoosteri 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:28tmciverwinkywooster: (apply hash-map your-vec)
17:29winkywoostertmciver: that was fast… thanks!
17:30winkywoosterdoes it break because partition is returning a lazy seq?
17:32Null-Awinkywooster: #_ (into {} (map vec (partition 2 [:blah 4 :blue 4])))
17:32Null-Ainto {} expects vector of kvs
17:32Null-Adunno why that is exactly
17:32winkywoosterso specifically a vector, and not a general seq
17:32Null-Aright
17:33winkywoosterthanks, Null-A. still trying to get my head wrapped around the nuances.
17:33mefesto,(into {} (list [:key1 1] [:key2 2]))
17:33clojurebot{:key1 1, :key2 2}
17:33Null-Awinkywooster: generally clojure's nuances are few and far between and have good reasons
17:34brehautpendantry time: conj on maps requires a MapEntry
17:34Null-Awhy can't conj accept 2-list?
17:34Null-Abrehaut: is a 2-vector a MapEntry?
17:35brehaut,((comp (juxt identity supers) class)(first {:a 1}))
17:35clojurebot[clojure.lang.MapEntry #{java.lang.Runnable clojure.lang.IFn clojure.lang.IPersistentStack java.util.Map$Entry clojure.lang.AFn ...}]
17:35brehautMapEntry is its own class, bit it is a persistent vector
17:35Null-A,((comp (juxt identity supers) class)[1 2])
17:35clojurebot[clojure.lang.PersistentVector #{java.lang.Runnable clojure.lang.IFn clojure.lang.IEditableCollection clojure.lang.IPersistentStack clojure.lang.AFn ...}]
17:36Null-Aso conj accepts MapEntry or 2-vector
17:36Null-A,(conj {} [:a 1])
17:36clojurebot{:a 1}
17:36Cr8,(bean (first {:a 2}))
17:36clojurebot{:value 2, :key :a, :empty false, :class clojure.lang.MapEntry}
17:37brehautim pretty sure theres a cast from 2-vector to map entry
17:37Null-Aperhaps it's for performance reasons that 2-list is not supported
17:39brehautNull-A: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L23-45
17:39brehautturns out it does have a special case for 2-vectors yet
17:40brehauts/t$/s/
17:44Null-AI 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:44Null-Aparticularly when you read the doc string for read-string, it sounds safe
17:44brehaut,(doc *read-eval*)
17:44clojurebot"; 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:45Null-A*nods*
17:45brehautso yes its a gotcha
17:45brehautbut its not unavoidable
17:45Null-AI would've set the default to false
17:46brehautyou could reasonably argue both ways
17:46brehautthe reader is afterall a language feature first, and a serialisation mechanism second
18:13hiredman~ping clojurebot
18:13clojurebotclojurebot is amazing
18:13hiredman~good enough
18:13clojurebotNo entiendo
18:28rednovaei 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:28rednovaewrong channel entirely i apologize
18:29rednovaei 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:30rednovaeagain, sorry, i'm leaving this channel
18:32Cr8is there an automake channel?
18:33brehautits full of weeping and nashing of teeth
18:33Cr8that's pretty much my experience with automake, it's just a lot more lonely
18:34technomancyit'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:34brehauthaha
18:37kennethhey, 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:37dnolen_kenneth: do you have at least one source file under the cljs directory with the extension .cljs?
18:38kennethyes. [swizz ~/Dropbox/dev/caffeine/server/cljs•cljs]$ cat src/cljs/main.cljs
18:38kenneth(ns example.hello)
18:38kenneth(js/alert "Hello from ClojureScript!")
18:39dnolen_kenneth: :source-path should probably be "src" not "cljs"
18:40dnolen_kenneth: it's also wise to follow Java class path conventions.
18:40dnolen_kenneth: given the ns declaration you should have - src/example/hello.cljs
18:40kennethdnolen_: i'm not from the java world, is there a good doc somewhere on what exactly those are?
18:41kennethand i see
18:41kennethlet me try fixing that
18:43kennethoh
18:43kennethsweet works now
18:44dnolen_kenneth: great
19:13kennethlol my 3 lines of cljs compile into a 20k lines js file
19:14devnIs there a way to tell that println will use std out before calling it?
19:15craigbrocheck *out*?
19:15devnprintln is an example, but i was wondering if it's at all possible to check what a fn will do before using it
19:15devncraigbro: that's after the fact
19:15craigbro(with-out-str (println ...))
19:15devnim curious about checking up front
19:15devncraigbro: right i know
19:15craigbrothat will return a string
19:15devnyes.
19:15devnis it possible to see the future?
19:16craigbrowell, if you look at *out* you can tell if it's using stdout or not
19:16craigbroif that's what you meant
19:16hyPiRion,(doc println)
19:16clojurebot"([& more]); Same as print followed by (newline)"
19:16craigbrohehe
19:16hyPiRion,(doc print)
19:16clojurebot"([& 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:17devnit'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:17craigbroI don't understand your question at all
19:17devnlol
19:17devnid like to be able to tell /prior to calling a function/ if it will send anything to standard out
19:17devnyou're telling me how to check after the fact
19:17devnbut that's the opposite of what im asking
19:17craigbronope, no way oter than decompiling
19:18craigbroand stepping through all the bits
19:18craigbroand even then, nope
19:18craigbrothere are ways around that
19:18hyPiRionWell, not really. Is it merely a technical question, or has it practical application?
19:19devnim running a bunch of stuff in a sandbox and capturing return values
19:19devni realized that if I run (println "foo") in the sandbox ill capture nil as its output value
19:19devnid like to avoid checking *out* every single time i run a function because there are many of them
19:20hyPiRionmany functions or many *out*-streams?
19:20devn100s of thousands
19:20hyPiRion(functions I assume?)
19:21devnexpressions would be more accurate
19:21devnbut yeah, lots and lots and lots
19:22craigbrodevn: use a macro and evaluate in the sandbox properly
19:22devnit'd be cool to say "okay this statement contains a call to #'println, so im going to capture *out*"
19:22craigbroif you are running in a snadbox, you control evaluation
19:22devnheh, nevermind, im going to think about it for a bit :)
19:22craigbroyou should just always be binding *out* and *err* to new string buffers
19:22craigbroand then you can examine the string buffers
19:23devnit's a check i dont want to do every time ideally
19:23hyPiRiondevn: the expressions are generated at runtime, right?
19:23devnthat's the point of this question
19:23craigbroit's more expensive to see if you should do it
19:23craigbrothan to bind *out* and *err* to a stringbuffer
19:23craigbroreally
19:23amalloydevn: you've already spent more time asking how to do it than you would spend binding *out* a couple hundred thousand times
19:23craigbroyou are asking to solve a version of the halting problem 8)
19:24amalloyplus as craig says it's basically impossible anyway
19:24devnlol
19:24devnno, i dont think it is, so ill try my idea
19:24hyPiRionIf the expressions aren't generated runtime (which I doubt), you could hash them into a bloom filter and check for collisions.
19:25craigbrojust checking for println calls won't do it
19:25devnhyPiRion: they aren't generated
19:25devncraigbro: i understand that
19:25craigbroin effect, no code analysis can
19:25devntotally true
19:25craigbrounless you are controlling the composition
19:25devnbut im not going for perfection
19:26craigbroif you control the composition of the forms... than sure.
19:27hyPiRioncraigbro: I would assume you can find out if a function has the possibility to send stuff to *out*?
19:27devnit was a question worth asking
19:27devnhyPiRion: only to a point though :\
19:28devn,(eval (read-string (apply str (reverse ")\"dlrow olleh\" nltnirp("))))
19:28clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
19:28craigbrohyPiRion: not absolutely, but up to the point of catching all but obfuscated code, perhaps
19:29devnlet me step back a bit -- i started this query way vague
19:29devnim talking about functions only available in clojure.core
19:29craigbrohyPiRion: but it would be expensive. It's a form of automatic static analysis
19:29devnso those could be tagged, but you still have obfuscated versions that could float around out there
19:29devncraigbro: yeah, that's the thing
19:29dnolenkenneth: if you want to reduce the CLJS footprint you need to use :optimizations :advanced.
19:30hyPiRioncraigbro: yes, but if they're not generated at runtime, you could allow that penalty during startup.
19:30craigbrohyPiRion: the penalty is potentially infinite
19:30devnhyPiRion: 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:30craigbrohyPiRion: in short, better of running it and catching output
19:31craigbrobut wether it outputs or not for any given execution does not tell you if it will for other executions
19:31craigbroalthought for a small subset, you could just do it by hand
19:31craigbroclojure.core for example
19:31devncraigbro: yeah, but obfuscated code strikes again
19:31devnmight as well capture *out* and just be done with it
19:32craigbroin which case, fuck the attempt to do analysis and just capture
19:32craigbromy day job is malware analysis 8)
19:32craigbroit'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:32devncreepy smiley face for a malware analyst
19:33devn=o)
19:33craigbronot sure how that renders in your client, it's my ancient usenet smilee
19:33devncraigbro: 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:34devnbut we're there. checking *out* repeatedly it is.
19:34craigbrodevn: I don't have to prove it, I just have to convince you it's calssified as a version of the halting problem
19:35craigbrobut that's not fun in IRC!
19:36devncraigbro: 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:38kennethis there a cljs core lib somewhere?
19:38hyPiRioncraigbro: 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:39hyPiRion(I'm not disagreeing, I just want to get my understanding confirmed ;))
19:39craigbrohyPiRion: yes
19:39kennether, documentation* for the cljs core lib
19:40craigbrohyPiRion: because you don't know what code it might generate until it generates it 8)
19:40dnolenkenneth: not specifically for cljs.core, but most of http://clojuredocs.org/ applies.
19:41hyPiRioncraigbro: Ahh, I see. (I think)
19:42devnif some code is taking its time generating code to generate code that prints to out /me chucks it in a pile of garbage
19:42devnso that's why im not overly concerned with some level of analysis up front
19:43devnif someone is getting cute with their input, tough. it is no garbage.
19:43devnnow*
19:43craigbrodevn: yah, if you are just running against cl.core and don't care if someone escape
19:43devneither way, amalloy made a good point. /me goes back to hacking
19:43devnthanks craigbro and hyPiRion
19:44hyPiRionGood luck on the hacking :)
19:57JulioBarrosAnybody using mongodb as a session store with noir? I'm a little confused on current libraries.
19:59kennethhow do i convert a cljs map to a js object?
20:00aperiodiccraigbro: the halting problem is only intractable in the general case ;)
20:00gfredericks(halts? '(+ 1 2)) => true
20:00kennethalso is there a library in cljs for creating html on the fly? (interop w/ query seems unwieldy)
20:00gfrederickskenneth: crate
20:01kennethawesome
20:04gozala1I'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:04gozala1anyone can help ?
20:05hiredmanit's in core.clj
20:05gozala1hiredman: thanks I'll take a look there then
20:06gozala1tried to see what was it repl but got Unable to resolve symbol
20:18kennethhey my compilation to js is failing with this exception java.lang.UnsupportedOperationException: nth not supported on this type: Keyword
20:18kennethnot sure what this is about?
20:20aperiodicsounds like a keyword is being passed to something that's expecting a vector (or sequence)
20:21hyPiRionkenneth: that means you use nth on a keywork - either like (nth keyword pos) or through destructuring.
20:22kennethit seems to happen in the cljs compiler tho, not in my code. the stack trace doesn't show any of my files
20:23brehautkenneth: guessing but perhaps you missed a ^ from a keyword hint from eg a defn form?
20:24brehauteg #(fn :private [a] (inc a))
20:25brehautthats a completely useless definition of course, and i screwed up the lazybot thing
20:25brehautbut it would cause the error you are seeing
20:27kennethi don't think i'm doing anything like that, no? https://gist.github.com/6e554107a715d1c09c9d
20:27kenneththis is my two files and my project.clj
20:27brehautkenneth: its your ns
20:27kennethoh?
20:28kennethhow so
20:28brehautyou have :use […] where you want (:use […]) i tihnk
20:28aperiodicyeah, that's it
20:28kennethoh i see
20:28kenneththanks
20:28kennethrookie mistak e;p
20:28kennethmistake :p *
20:28aperiodicit's definitely not the most enlightening error message
20:31brehautkenneth: if i had realised you had posted a gist earlier, i wouldnt have startd by guessing
20:31brehautsorry about that
20:34kennethbrehaut: no worries, help much appreciated :)
20:46@rhickeyTassilo Horn contributed a mapcat reducer
20:48hiredmanare you looking for contributed reducers?
20:48@rhickeysure, why not?
20:49hiredmanI have a partition-by, can I just drop it jira?
20:49@rhickeyhiredman: sure - thanks
20:49@rhickeyglad to see some people getting it
20:50cshellRich, 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:50TimMccshell: What part are you having trouble with?
20:52cshellTimMc: Not sure, I am just not understanding the article - I think that i'm lacking background
20:52cshellrhickey: Did you disconnect before my last message?
20:52@rhickey_probably
20:52cshellRich, 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:53cshellah
20:53@rhickey_cshell: did you read the library source?
20:53cshellrhickey: Not yet, I take it that's where I should look?
20:54cshellI'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@rhickey_cshell: hrm, well if new to Clojure the source might be a bit dense, and has macros
20:55@rhickey_I'll probably do another post to explain the mechanism in more detaill
20:55cshellrhickey: that would be great and I know really helpful to me
20:56cshellrhickey: and I'm sure others as we've discussed it in here a bit
20:58TimMccshell: 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:59cshellcshell: I'm familiar with those functions and their behavior, but not with the chained seqs and cons cells part
20:59cshellI understand cons
20:59cshellfrom the lisp books I've been reading, but it seems that Clojure is an evolved, more elegant version of lisp
21:00gfredericks(map #(* 2 (inc %)) coll) vs (map #(* 2) (map inc coll))
21:02cmcbridemaybe 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@rhickey_and thus enables it to be parallelized
21:03@rhickey_composing seq fns doesn't get you there
21:04@rhickey_you have to revisit the essence of 'mapping' and 'filtering'
21:04gfredericksis it meant to be used for its own sake, or just when you need the performance?
21:05dreishAnything 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:06dreish"Just" performance is probably understating the issue.
21:06cshellrhickey: 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@rhickey_thus, if the collection can reduce in parallel, so to can these run in parallel
21:08@rhickey_so too
21:09mefestoreducers will replace the need for pmap and friends, right?
21:09TimMcHmm, 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:09hiredmanI really wanted a reducer partition-all with stepping, but I haven't figured that out
21:09TimMcOne of my projects involves multiple maps and filters over 10k-size colls.
21:11cshellrhickey: Cool, I'll reread with this in mind - thanks
21:11hiredmangfredericks: not being lazy also gets you out of issues with resource scope
21:12brehautis it wrong to be most excited about reducers being curried ?
21:12@rhickey_brehaut: yes :)
21:12brehautuh oh
21:13brehautim totally most excited by the potential parallelism then.
21:13@rhickey_ok
21:17cmcbrideis it enforced that fold must take a monoid? or is that up to the programmer?
21:17amalloyrhickey_: 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@rhickey_e.g. infinite seqs can't fold
21:22amalloyah, 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:23brehautthat would be unfold wouldnt it?
21:23@rhickey_iterate can still reduce
21:23dnolen`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:24dnolen`sorry defrecords really I think.
21:24@rhickey_dnolen`: not sure I understand the issues, maybe we can discuss next week?
21:24dnolen`rhickey_: sure thing.
21:25@rhickey_foldable range would be welcome
21:26Null-Ado I need java 7 to develop reducers, thus windows or linux?
21:26Null-Athat's when forkjoin was added afaik
21:26@rhickey_nope, you can use jsr166y.jar
21:27kennethhow would i map js chaining to cljs?
21:27@rhickey_with jdk 6
21:27Null-Ak thx
21:27antares_Null-A: fork/join has a standalone implementation and I believe clojure build system will download it for JDK 6
21:27brehautNull-A: im pretty sure Oracle have released JDK 7 for mac os x
21:27kennethsince clojure -> assumes return val of previous statement as the last arg, whereas interop defines it as (.method OBJ …) (i.e. 2nd arg)
21:28hiredmanNull-A: java 7 is out for osx
21:29Null-Ahiredman: brehaut just sent me the link
21:29hiredmanand there are builds of openjdk8 available
21:29antares_kenneth: -> pass the result as the first argument. ->> as the last. So typical chaining (a.getB().getC()) uses ->: (-> a .getB .getC)
21:29kennethoh really, that's sweet
21:29antares_kenneth: a.getB().getC(d) becomes (-> a .getB (.getC d))
21:30kennethis there a reason .getB is not surrounded by parens? antares_
21:31antares_kenneth: they can be omitted if there's only one arg
21:31kennethokay, looks cleaner to me to have them, for a multi-line chain
21:37dgrnbrg,(doc ^:doc [])
21:37clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to clojure.lang.Symbol>
21:38zakwilsonclojure.org's reader docs don't seem to mention the new tagged literals.
21:41kennethcljs is super hard to debug
21:41RaynesSuper duper even.
21:41kenneththese js exception are not very descriptive
21:42dnolen`kenneth: yep waiting on someone to submit a source map patch.
21:42mlozanoyeah, I had kinda wondered about that ... was considering trying that out in my project
21:42dnolen`kenneth: if you know already know Clojure it's not quite as challenging.
21:43kennethi've used clojure on two scripts or so, so far
21:43kennethhttps://gist.github.com/6e554107a715d1c09c9d
21:43dnolen`kenneth: nice
21:43kenneththis 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:44cmcbridedo you have advanced optimizations on?
21:44dnolen`kenneth: you shouldn't be using strobj
21:45dnolen`kenneth: strobj is not a method, but a private property.
21:49amalloyrhickey: 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:50goodieboyis there an equivalent function to realized? in clojure 1.2?
21:50amalloygoodieboy: no
21:50goodieboyrats
21:50amalloy(but seriously, upgrade from 1.2)
21:50goodieboyyeah, we're working hard on that
21:51Null-Aamalloy: did you put the jsr166y.jar in lib?
21:51amalloynope, i sure didn't. i must have missed the discussion of where to get that thing
21:51Null-Ahttp://gee.cs.oswego.edu/dl/jsr166/dist/jsr166y.jar
21:52Null-Ai just ran into the same problem as you, and that fixed it
21:52amalloyNull-A: and put it where?
21:52Null-Ain lib
21:53Null-Awell.. i'm using leiningen
21:53@rhickeyamalloy: if using maven or lein just copy the dep from Clojure's pom.xml
21:53hiredmanbut leave out the provided scoping
21:53@rhickeyright
21:55Null-A [org.codehaus.jsr166-mirror/jsr166y "1.7.0"]
21:55amalloyoh, i was just trying to hack on clojure itself to add a reducer, so i guess mvn compile should be good enough
22:02amalloybut 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:05dnolen`wow, making CLJS persistent data structures available to JS users is pretty easy
22:06gozaladnolen`: got a minute ? I got question on reducers ?
22:06dnolen`gozala: I have yet to dive into reducers
22:06gozalaahh ok then :)
22:07gozalaI was trying to understand if you could consume them lazily
22:07gozalavia pull or if they always push
22:10spjthttp://pastebin.com/CdXBE1vy Is there a particularly clever way to reduce this into two-dimensional?
22:11spjte.g one vector containing all the vectors that have the numbers
22:15hiredman,(remove #(some vector? %) (tree-seq #(and (vector? %) (some vector? %)) vec [[1 2 3] [[5 6 7 8]]]))
22:15clojurebot([1 2 3] [5 6 7 8])
22:19spjtawesome, some day I hope to understand what that does. :)
22:22kennethdnolen`: where am i using strobj?
22:23kennethyou mean by console.logging my map?
22:24kennethcmcbride: i do
22:29kennethoh nvm
22:33cmcbridekenneth: I could be wrong, but I dont think you need to wrap each-tick in #() when you pass it to setInterval
22:34cmcbrideeach-tick by itself is a function value
22:34kennethright, wasn't sure if you could pass clojure function as js closures
22:35cmcbrideI think you can
22:35kennethdo 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:36kennethalso, weirdly a Uncaught TypeError: Object #<Object> has no method 'main'
22:36cmcbrideyea
22:36cmcbrideyou need an extern file
22:36cmcbridein project.clj
22:37cmcbrideunder the :compiler key in :cljsbuild
22:37cmcbrideyou set your externs files
22:37cmcbrideyou can just use d3 itself as the extern file
22:37kenneththe 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:37kennethusing requirejs
22:38kennethoh wait i got it
22:38kennethexterns
22:39cmcbrideyea basically you just need a file telling the google closure compiler which function sigs to ignore when it minifies
22:40dnolen`https://github.com/swannodette/psjs
22:40kennethjust a list of var myname;
22:41dnolen`beginnings of a persistent data structure library for JavaScript consumers
22:41cmcbridekenneth: https://github.com/shripadk/d3-externs/blob/master/externs.js
22:42cmcbridednolen`: thats slick :)
22:43dnolen`gzipped ps.js is 19k :D
22:44cmcbridenice
22:44dnolen`getting the reducer framework in there will be pretty sweet :)
22:46kennethcmcbride: woo externs fixed the d3 issue
22:46kennethcmcbride: still having uncaught type errors Object #<Object> has no method 'main', and now also for 'domain'
22:47kennethbut that's probably my fault
22:48cmcbridekenneth: does this work on simple compile?
22:48cmcbrideI always do that as a sanity check first
22:49amalloyhiredman: 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:49lynaghk`kenneth, you might be interested in C2, a Clojure/ClojureScript library inspired by D3: https://github.com/lynaghk/c2
22:51lynaghk`also, I'd love to hear about what you're doing with d3 in CLJS
22:53kennethi'm not doing it in cljs for any reason other than curiosity, i'd probably have an easier time doing it in js
22:53kennethbut wanted to see if cljs is a possibility for serious real-life projects
22:53lynaghk`you do serious real life work with d3?
22:54kennethnot yet, hoping to
22:54kennethtrying :p
22:54dnolen`kenneth: people already using CLJS for serious real-life projects :) ... but certainly the debugging story needs to improve for wider adoption.
22:54kennethi don't know very much about either right now, but i want to see what i can do with it
22:55kennethand doing it while making something that's actually useful (analytic charting for chartboost.com)
22:55lynaghk`dnolen`: I'll have to mention that whenever clients ask: "Yes, we use Clojure and ClojureScript like many other serious, real life people"
22:56cmcbridekenneth: on a side note, if you just need basic charts highcharts.js is pretty nice
22:57cmcbridednolen`: whats the next steps to get source map support?
22:58cmcbrideI saw some compiler patches on JIRA already
22:58kennethooh
23:00kennethhttps://gist.github.com/6e554107a715d1c09c9d -> line 16, why is that being compiled to
23:00kennethd3.scale.domain([0, 100]).range([0, continuous.h]);
23:00kennethas opposed to d3.linear.scale.domain([0, 100]).range([0, continuous.h]);
23:01kennethoh nvm i caught it
23:01kennethdamn, debugging this stuff is haaaaaard
23:01kennethworse than debugging real clojure
23:04kennethok, how would i convert a hash to a js object?
23:04Null-Aamalloy: do you understand filter code? (if (pred k v) … )
23:04Null-Aamalloy: how it is calling pred with 2 args, when it's 1 arity
23:06cmcbridekenneth: I use that clj->js function that you have
23:06cmcbrideIm not sure if thats the most idiomatic way
23:07dnolen`kenneth: there is no standard way.
23:07dnolen`cmcbride: actual source map support
23:07dnolen`cmcbride: line tracking patches already applied.
23:07kennethcmcbride: i removed it because it was causing problems
23:07kennethcrashing on strobj
23:08kennethnow i'm trying to do it with assoc
23:08cmcbrideput a dash in front of strobj
23:08cmcbridelike .-strobj
23:08dnolen`anybody have a cool name for a CLJS persistent datastructure bridge for JS?
23:08amalloyNull-A: oh yeah, i forgot about the k/v impl at all
23:08dnolen`cmcbride: using .-strobj is asking for trouble.
23:09Null-Aamalloy: are there two implementations? i only see a kv impl
23:09kennethwhat does strobj even do?
23:09amalloyNull-A: rfn takes a k/v impl and transforms it into a multi-arity impl that takes either k/v or just x
23:10amalloyhow 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:10cmcbridednolen: what do you use instead?
23:11Null-Aamalloy: ah thanks
23:11dnolen`cmcbride: reduce into js-obj
23:12dnolen`code relying on any fields of CLJS data structures is doomed
23:14brehaut$findfn 1 2
23:14lazybot[clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']
23:14brehautPeregrinePDX: ^
23:15brehaut$findfn odd? [1 2 3] [1 3]
23:15lazybot[clojure.core/filterv clojure.core/filter]
23:16kennethdnolen`: do you have sample code handy?
23:17dnolen`kenneth: of what?
23:17kennethreducing into js-obj
23:18dnolen`kenneth: oh you mean (reduce (fn [o [k v]] (aset o k v)) (js-obj) some-map)
23:18echo-area(let [[[_ [keyword]]] next-lines] <-- In which case will this snippet cause StackOverflowError?
23:18echo-areaCould you imagine?
23:18lynaghk`kenneth: you will want to recurse too; https://github.com/lynaghk/c2/blob/master/src/cljs/c2/util.cljs
23:19lynaghk`dnolen`: will strobj be getting phased out of cljs?
23:19echo-areaTimMc: Message received, but I'll currently busy doing other stuffs, will discuss later. Sorry
23:19echo-area*I'm
23:19dnolen`lynaghk`: you can never use any internal properties of CLJS data structures.
23:19dnolen`lynaghk`: it's no different from Clojure
23:20dnolen`lynaghk`: it might can renamed or removed at anytime.
23:20lynaghk`dnolen`: yeah, sounds reasonable. Is there any reason why clj->js isn't in cljs core?
23:20dnolen`lynaghk`: there's no sensible conversion
23:21dnolen`lynaghk`: conversion will be app specific.
23:21acagle /flush
23:21lynaghk`dnolen`: not completely, for things like sets, but maps and collections should be turned into objects and arrays, no?
23:22dnolen`lynaghk`: what about complex keys? what options, etc.
23:22dnolen`lynaghk`: not saying that we're not willing to look at some patches ...
23:22kenneth(doc js-obj)
23:22clojurebotPardon?
23:23kennethlol, of course that didn't work
23:23dnolen`lynaghk`: but we went down this path a couple of times - always yucky.
23:23kennethcljs needs a std lib documentation site
23:23kennethi have no idea how to look up doc for this stuff, like assoc / js-obj / etc
23:23gfrederickshimera?
23:24lynaghk`dnolen`: Maybe just something that does the things it can, and throws an exception with a note: "please defmethod ... to convert this type"
23:24dnolen`lynaghk`: I couldn't think of anything good - again I'm up for looking at patches.
23:25dnolen`lynaghk`: though my hunch is that people can write their app specific conversion in a few lines - any real solution will be complex.
23:25lynaghk`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:25lynaghk`er, talking to myself there.
23:25dnolen`lynaghk`: I don't disagree at all - it is a source of confusion.
23:26dnolen`lynaghk`: js -> cljs, easy, poor -> rich format
23:26dnolen`the other direction is lossy
23:26Null-Aamalloy: do you know other things that need porting?
23:26cmcbridewell could there at least by map->jsmap, etc..
23:27cmcbridethen people could roll their own stuff with those primitive functions
23:27ivancmcbride: same problem with non-string keys
23:27cmcbrideoh right
23:32kennethugh, every time i solve one error i have another :p
23:33kennethnow i'm on No protocol method ISeqable.-seq defined for type number: 71
23:34amalloyNull-A: almost every interesting lazy-seq function can be ported
23:35amalloyeg, i submitted a patch for iterate, and i'm nearing completion on range atm
23:37dnolen`kenneth: you're calling seq on a number
23:49amalloyfor 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:49Null-A*nods*
23:50amalloyi 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:52Null-AYah I figured seeing yours would help
23:54kenneth`(- 5 2 1)
23:56gfredericks2
23:56tmcivergfredericks: clojurebot, is that you?
23:57gfrederickspardon?
23:57tmciverha!