#clojure logs

2012-05-04

00:05muhooturning things into clojure maps is such a joy
00:06muhooi just did a bunch of data import from excel csv's, and with clojure-csv and a little bit of code it went really well.
00:07muhoohttps://refheap.com/paste/2540
00:08brehautcouchdb replication is magical
00:08mdeboardmuhoo: That's cheating imo :P You didn't paste your parse-csv function, where all the cooking is
00:09muhoomdeboard: it's in clojure-csv
00:10mdeboardI turned on paredit for the first time in months since this screencast is using it, took about 3 minutes before I remembered why I don't like it.
00:10muhoomdeboard: https://github.com/davidsantiago/clojure-csv
00:10m0smithhi
00:10mdeboardhi
00:10LuminousMonkeymdeboard: You don't? I love paredit.
00:10m0smithI am trying to move to 1.4
00:10LuminousMonkeyHello
00:10m0smithI am getting an error "Too many arguments to def"
00:10mdeboardLuminousMonkey: Well, what do I need to do to change ["foo"] to ("foo") ? I can't delete those brackets :(
00:11muhoom0smith: def or defn? :-)
00:11m0smith(def ^:dynamic *hibernate-session-factory* "" (atom nil))
00:11m0smithdef
00:11LuminousMonkeymdeboard: I do a alt-( before the first [
00:11m0smithmuhoo: Did something change with the dynamics again?
00:11LuminousMonkeymdeboard: Then Esc-up on the first "
00:11muhoo&(doc def)
00:11amalloymdeboard: you want M-r
00:11lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
00:12muhoo##(doc def)
00:12lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
00:12mdeboardOh, thanks amalloy
00:12LuminousMonkeyamalloy: I was about to say there might be a better way. :)
00:12amalloythat's probably what M-up does, but who wants to leave the home row ever?
00:12mdeboardI freak when my backspace stpos working.
00:12muhoom0smith: it doesn't like the docstring?
00:12amalloymdeboard: automatic sliding doors don't let you push them open, but you don't need to so it's fine
00:13LuminousMonkeyI hate it, when I leave the homerow, that was my reason with sticking to vim, but, er, to lazy to find out another way.
00:13m0smithdef is bad?
00:13muhoom0smith: in a bot, yes
00:13LuminousMonkeyBad def, naughty def.
00:13muhooiirc the bot runs clojail ?
00:14muhoomos def
00:15mdeboardamalloy: Oh, they let me. http://www.youtube.com/watch?v=6nb0BogGIv0&feature=results_video&playnext=1&list=PL199543E4A9F91CBC
00:16amalloythat's not even the door, man. you couldn't find one where someone goes through a door?
00:16mdeboardyeah but they all have annoying music
00:20mattreplis there a reason that set! shouldn't work on an Integer field marked as volatile-mutable in a deftype? it's clojure 1.3 and I'm using ^{:volatile-mutable true} theField in the [fields] portion of the deftype form
00:23hiredman mattrepl how are you calling set! ? and on what version of clojure?
00:23mattreplhiredman: (set! theField newVal) within a method implementation in the deftype
00:23amalloymattrepl: as long as you're doing it from within the context of the deftype body it should work
00:27amalloyyou can see an example at https://github.com/flatland/ordered/blob/develop/src/ordered/set.clj, where (change! field f & args) expands to (set! field (f field ~@args))
00:28mattreplaha, it's set! within a locking macro that fails
00:29amalloymmmmm, that should work too
00:29amalloyunless you try to do it from two different threads
00:30m0smithmuhoo: yep, no more docstrings in defs (weird)
00:30mattreplcompilation won't work if set! is in a locking macro, but works fine when just outside
00:30amalloym0smith: are you sure you aren't accidentally downgrading to 1.2?
00:31mattreplperhaps it's missing metadata for the symbol
00:34m0smithmuhoo: you are right
00:34m0smith muhoo: :dependencies [[org.clojure/clojure "1.4.0"]
00:35mdeboardIs enlive an outlier in terms of its package naming? i.e. ``:dependencies [[enlive "1.0.0"]]`` in project.clj but then in the source I import it via ``:require [net.cgrand.enlive-html]``
00:35m0smithbut 1.2.1 is in the lib directory
00:40mattreplneed to read docs, but problem may be that modification of volatile field uses a lock on the instance being modified
00:41mattrepland why you would use :unsynchronized-mutable...
00:45muhoomdeboard: iirc, package names can, and often do, have nothing whatsoever to do with namespace names
00:45mdeboardRight, just confusing
00:47muhoo:dependencies [com.lets.drive.everyone.nuts/packagename "1.0.0"] ...... (:require hahahaa.suckers.its.all.different)
00:48mdeboardtechnomancy: By re-running clojure-jack-in is it starting an additional JVM? http://dl.dropbox.com/u/21321471/Screenshot%20from%202012-05-04%2000%3A36%3A44.png
00:50muhoowow, i think i finally got my brain around this whole nosql thing. what a struggle it's been.
00:51muhooit seems the secret is to do all the calculation at WRITE time. no calculation at all at read time, becuase the query language is so limited.
00:52technomancymdeboard: yeah
00:52mdeboardmuhoo: That is definitely the case for Solr.
00:53muhooadvantage: i can do the calculations in clojure :-)
00:55LuminousMonkeyIs there a way to take a sequence of maps like this: https://gist.github.com/2592077 and make it a nested map {table-name {column-name {column-detail} column-name2 {column-detail}} table-name2 {column-name {...}}} etc.
00:56LuminousMonkeyI'm thinking about using group-by in two passes, but is there a cleaner way?
00:56muhooLuminousMonkey: a question for amalloy, i expect :-)
00:58amalloyi dunno, you could do it that way, or maybe reduce with update-in
00:59LuminousMonkeyHmm, I'll keep playing. :)
00:59LuminousMonkeyThanks.
00:59amalloy(reduce (fn [m {:keys [table_name column_name] :as details] (assoc-in m table_name column_name (-> details (dissoc :table_name :column_name)))) {} rows)?
01:02mdeboardI totally forgot I wrote a url shortener using korma + noir like
01:02mdeboardholy stuffing, 6 months ago
01:04muhoodoes it seem like a message from a distant galaxy when you read it now?
01:04mdeboardYes, I have no idea what's happening
01:04mdeboardSomething about parentheses
01:05muhooi've experienced this same surreal phenomenon recently too
01:05mdeboardonly reason I even remembered is because I'm going through this screencast
01:05mdeboardand it's building out a url shortener. Seeing the form jogged my memory
01:09muhooi'm surprised there isn't some general function or library in clojure to turn a series of flat rows into a map
01:10muhoointo a tree, really. maybe it's in zippers or somewhere
01:10mdeboardWhat do you mean by flat rows
01:10muhooLuminousMonkey's gist
01:12mdeboardSeems like an odd way to handle the data
01:13LuminousMonkeyMaking it into nested maps?
01:14mdeboardYeah, not sure what the use case is though. I'm really tired however, so that doesn't mean anything.
01:15tomojcan you give the gist again?
01:16mdeboardhttps://gist.github.com/2592077
01:16LuminousMonkeymdeboard: You are probably right, I'm so used to handling arrays.
01:16clojurebotExcuse me?
01:17tomojI don't see what kind of nested maps you would make out of that
01:20mdeboardI could see e.g. https://gist.github.com/853b5066813fe1c2d329
01:21LuminousMonkeyI must be thinking the wrong way, I'm going to have to stop and think about it.
01:23creesewhat's the best way to search a string "cat" to see if it contains the letter \a and return true if it does?
01:24LuminousMonkeyamalloy: Thanks, I got: (reduce (fn [m {:keys [table_name column_name] :as details}] (assoc-in m [table_name column_name] (-> details (dissoc :table_name :column_name)))) {} (get-current-schema))
01:25LuminousMonkeyWhich seems to work, how on earth you came up with that so quick, I don't know. :)
01:25amalloy$javadoc String contains
01:25lazybothttp://docs.oracle.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)
01:26mdeboardoh god yes lein2 repl has `exit`
01:26LuminousMonkeymdeboard: exit?
01:26amalloymdeboard: accept unix into your heart and type Ctrl-D
01:26LuminousMonkeymdeboard: I always used ctrl-D :)
01:27mdeboardamalloy: That has left behind a running jvm that I need to then kill
01:27Raynesmdeboard: It has always had exit.
01:27Raynes(System/exit 0)
01:27mdeboardthat's not `exit` :)
01:28RaynesIt's precisely the same.
01:28mdeboardMaybe under the hood, but I shouldn't be expected to google how to exit a repl
01:28mdeboardno user should
01:29RaynesEvery user on this planet knows control d.
01:29mdeboardSure, I just don't want to Ctrl-D and also have to kill -9 whatever
01:30Raynesuh
01:30RaynesCtrl-d kills the process, dude.
01:30amalloyRaynes: there have been versions of lein where that's broken
01:30LuminousMonkeymdeboard: Maybe a bug? I just tested, and it works correctly.
01:30Raynesamalloy: There are versions of Leiningen where profiles didn't exist. Not sure that is relevant either.
01:30mdeboardYeah it works now with lein2
01:31mdeboardwhich is great, hence my excitement :)
01:31Raynes:)
01:32tomojmdeboard: yeah
01:34LuminousMonkeyI get terribly impressed with little things in Clojure, like {:keys } destructing, I did not know that.
01:39tomojdo default field aliases in defentity not work in korma?
01:45ibdknoxtomoj: to my knowledge I didn't implement default field aliases :)
01:45Raynes"But I was drunk at the time, so hey, who knows?"
01:46tomojI was using fields instead of entity-fields
01:46tomojbut entity-fields doesn't seem to work either
01:47tomoj(for aliases)
01:47tomojwell, doesn't do anything without aliases either
01:49ibdknoxtomoj: yeah neither of those implement a magical field replacing strategy
01:49ibdknoxRaynes: :p
01:49ibdknoxtomoj: what I usually do is something like (def myfiels [[:a :a2] [:b b2]])
01:49ibdknoxand just use myfields all over the place
01:50tomojcan you just (def entity (fields entity myfields))?
01:50Raynes"The whole "documentation everywhere" reminds me of Eclipse. Does he really think this is a new idea? "
01:50RaynesMan, ibdknox, do people not even watch or read about light table before spewing random garbage about it?
01:50ibdknoxRaynes: my personal favorite are the I could totally write an emacs plugin that does all of that
01:50ibdknoxI think they might be missing the point
01:51ibdknoxtomoj: entity-fields is what you want
01:51LuminousMonkeyall?!
01:51ibdknoxtomoj: though that means every query will use them by default unless you specify fields manually
01:52_tcaibdknox: have you seen blocky?
01:53tomojthat's exactly what I want
01:53tomojbut it doesn't seem to work
01:53tomoj(well, not quite exactly, but close enough)
01:53ibdknox_tca: I haven't, link?
01:54tomojrunning (select items (where {:id 3573})) I get all fields when I did (entity-fields :id)
01:54ibdknoxtomoj: might be a bug. I basically never use that
01:54_tcahttp://blocky.io/blog/
01:54tomojentity-fields or korma?
01:54ibdknoxentity-fields :p
01:54_tcaibdknox: it's pretty relevant to stuff you've been doing
01:55tomojI'll do the myfields thing
01:55ibdknox_tca: oh neat :)
01:58LuminousMonkeyI think Bret Victor would be happy with all the stuff that's been happening from his concepts.
02:01ibdknox_tca: thanks for that pointer
02:01ibdknoxlooks like he's doing some cool work
02:02ibdknoxLuminousMonkey: yeah, it's funny. They're all old ideas. We just needed people championing them again
02:02ibdknoxI stopped thinking about dev tools for a good bit
02:04LuminousMonkeyibdknox: Everything in Comp Sci seems to be based off old ideas. :)
02:04ibdknoxall of it was invented in the 70's by Xerox-PARC ;)
02:05muhooibdknox: no, 1969: http://en.wikipedia.org/wiki/The_Mother_of_All_Demos
02:05LuminousMonkey1968? :P
02:06muhoo1968, sorry. i saw the video of it. it was breathtaking. http://www.dougengelbart.org/firsts/dougs-1968-demo.html
02:06ibdknoxhuh
02:06ibdknoxI thought that was in 74
02:06muhooit felt a LOT like watching ibdknox's demo of lighttable :-)
02:06ibdknoxsomething important went down in 74
02:06LuminousMonkeymuhoo: Thanks for that link, I'll watch that later.
02:15michaelr525hey
02:16michaelr525why my uberjar doesn't work? I specified :main in project.clj
02:16michaelr525java -jar uberjar.jar says it can't find the main class
02:17LuminousMonkeyAnd you have (defn -main ...) in the ns you specified with :main in project.clj?
02:18michaelr525yup..
02:19michaelr525I found someone saying that one has to include a third component in the namespace
02:19michaelr525mine only has two components
02:20LuminousMonkeyI think you might also need (:gen-class) in the namespace declaration that you're using as main?
02:20RaynesYes.
02:22michaelr525Yes?
02:22clojurebotyes is is
02:22muhoointerestingly, in noir projects (maybe for ring projects too?), no such gen-class seems necessary for main
02:23michaelr525yes for :gen-class?
02:23RaynesAre you running it with `lein run`
02:23Raynesmuhoo: ^
02:23muhooah, yes.
02:23RaynesYeah, lein handles it itself.
02:23muhooi guess lein-uberwar injects that for me
02:23muhoolein ring uberwar, sorry
02:27michaelr525can I still run it from the repl or `lein run` after adding :gen-class?
02:27michaelr525ok :gen-class solved the uberjar problem
02:27michaelr525hey nathan
02:39aperiodi1michaelr525: yes, you can still launch it in all the normal ways
02:40aperiodici have run into issues where what's in classes/ matters, but i do a lot of kinda hairy java interop (hadoop) so you might not run into that
02:41aperiodicjudicious use of lein clean; lein compile will handle those sorts of things, though
02:54michaelr525aperiodic: cool
02:54michaelr525thanks
02:55michaelr525how do you guys feel about debugging clojure?
02:56michaelr525I mean, when I work in Visual Studio with C# I just press F5 and if the program fails, the debugger breaks in at the failure point and I have everything there
02:57michaelr525when something fails in clojure I just have the stacktrace and have to start debugging with pprints and such
03:33mojitohi im making my way through clojure koans from: https://github.com/functional-koans/clojure-koans
03:33mojitoim stuck at - "Higher-order functions take function arguments" (= 25 (___ (fn [n] (* n n))))
03:34mojitomy guess was that i could use some kind of "apply" the fn to an arg
03:34mojitois that the intent of this koan?
03:37michaelr525i think ->
03:38michaelr525mojito: ^
03:39mojitomichealr525: ok -> is interesting. but the intent seems to be HOF.
03:39mojitoi googled around and found #(% 5)
03:39michaelr525# is also a macro
03:40mojitomy question is: what should i take away from this koan? that functions can take functions as arguments? or something else?
03:41michaelr525i don't know, i never solved any koans :)
03:42mojito:)
03:42mojitonm. thanks anyway.
03:42emezeskemojito: I think that is what you are supposed to take away.
03:42emezeskeE.g. functions are just values like everything else, and you can pass 'em as args, etc, etc
03:43mojitoemezeske: cool
03:54kralnamaste
04:44y3didoes anyone know which company backed lighttable 10k?
04:49Raynesy3di: Yep.
04:50RaynesCan't say I remember at the moment htough.
04:50Raynesthough*
05:00y3diRaynes: ah, well if you remember, do post it here
05:00y3dialso it looks like lighttables funding is guaranteed
05:00y3di(basically)
05:00y3ditis good to see
05:02ejacksonyeah, its great stuff
05:14ejacksonhow does one override lein2's repository locations ?
05:14ejacksonI have a local nexus and maven is happily using it, but lein thumbs it nose at me
05:36qerubHello. What's the proper way to use clojure.contrib.str-utils (re-gsub) with Clojure 1.3?
05:37ejacksonstr-utils is deprecated
05:37ejacksoncheck out clojure.string
05:37qerubAh, right. Thanks!
05:38qerubclojure.string/replace will do the trick indeed.
05:38ejacksonhttp://clojuredocs.org/clojure_core/1.3.0/clojure.string
06:34cshellwaking up early: the world's way of giving you an opportunity to get ahead of your competition
06:37beffbernardcshell: or you just can't fall back asleep
06:37beffbernard;)
06:57cshellbeffbernard: haha, that too ;-)
07:10ssedano1Hi, how can I make an array of java.lang.String ? I need because of a java method that expects a vararg
07:12ssedano1&(into-array ["blah"])
07:12lazybot⇒ #<String[] [Ljava.lang.String;@c056dc>
07:12ssedano1coola
07:12ssedano1cool*
07:14lucianO'Reily 50% off sale to support DRM-free books
07:14lucians/books/ebooks/
07:34cshelllucian: that is the best book on clojure that I've found
07:36luciancshell: i read the preview and had the same impression
07:36luciani'm a bit too poor for the full price version, but this i've certainly bought
07:37lucianand hopefully it'll help O'Reily's statistics about how well their DRM-free sale went
07:39x_orI'm using emacs/slime to do some clojure programming. I am trying to use the repl, and getting this error: "Unable to resolve symbol: shorten in this context"
07:39x_orI have defn'd shorten, but my repl does not seem to be able to access it.
07:39cshelllucian: it's great, it has a chapter for all the questions I've ever had about clojure - Chapter 12: how java design patterns map to clojure and then a later chapter that has a flowchart of which type of data structure to use
07:40cshellx_or: what namespace are you in?
07:40x_orfoobar.core
07:40x_orDo I need to prefix the call with that?
07:40cshelland you defined it in there?
07:40x_orNo, and I'm new to clojure, so bear with me. The code is like this
07:40luciancshell: the former isn't entirely relevant to a pythonista, but i've thumbed through and looks very nice
07:41x_or(ns foobar.core (:use ...) (:require ... ))
07:41x_or(defn shorten [] ... )
07:41x_orSo, shorten is outside of the NS, right?
07:41cshellright, but the default namespace in the REPL is user
07:41cshelltype *ns* at the repl and it will tell you which one you're in
07:41x_orOK. It shows user> at the prompt.
07:42cshelllucian: good point - it has some good python references in there too
07:42x_or#<Namespace user>
07:42cshellx_or: type (require '[foodbar.core :as f])
07:42cshellthen you do f/shorten
07:42csheller, foobar even
07:43cemerickThat flowchart originated here, BTW: http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
07:43x_orSays unmatched delimiter, do I need to use :require?
07:44Chousukeyou're missing a paren somewher
07:44Chousukee
07:44cshellx_or: :require is needed for the REPL - you're missing either a bracket or a paren
07:44x_orOK, will verify.
07:45cshellcemerick: thanks Chas, you've written a great book - the namespace chapter really clarified things for me - especially regarding use vs refer and require - i'm waiting to read even more, and when i'm done i'll give it a five star review on amazon
07:46cemerickcshell: thanks, I'm glad you're enjoying it :-)
07:47cshellcemerick: 600 pages - incredible - how long does it take to write a book like that? (and maintain such high quality, of course)
07:47x_orcemerick: I really enjoyed your screencast via Oreilly the other day. Not sure if you felt this way, but seeing you troubleshoot when things went awry was actually very helpful to me.
07:47cemerickcshell: Well, I had help, too :-)
07:48cemerickBut, the writing essentially took a full 12 months.
07:48cemerickPlus 4 months on each end of that for all sorts of *stuff* around the project.
07:49cshellcemerick: wow, amazing - that contrasts so much with other authors I know who just throw together a basic example and write 200 pages about it in two weeks
07:49cemerickhah, which authors can do that?! :-)
07:51cshellHaha, I forget his name, but he was a part time trainer for a software company and told me he'd just read the specs, and just make an example based off of it - he said he was contracted for about one a month or so - but like most of the tech books out there now, it lacked in depth - you guys seem to have covered everything
07:52cshellevery question i've had so far, whether about syntax, idioms, or moving from java, has all been answered
08:02BorkdudeI have this git project: https://github.com/Borkdude/tictactoe. I cloned it, created a general project out of it in Eclipse and now want to turn on Clojure+Leiningen support
08:02BorkdudeWhen I try to turn on Clojure support I get this: http://twitpic.com/9h51np
08:03Borkdudewhy?
08:03clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
08:04Borkdudecemerick: poke
08:05cshellBorkdude: there's probably a message in a log file somewhere that will help you
08:05cemerickBorkdude: can you paste the project.clj?
08:06Borkdudecemerick: it's on github, https://github.com/Borkdude/tictactoe
08:06cemerickand yeah, there's probably a helpful exception in the error log
08:06cemericksorry, didn't scroll up :-)
08:06cemerickwell, that's simple enough
08:07Borkdudecshell: cemerick do you mean in the "Problems" view?
08:07cemerickBorkdude: nope; Window > Show View > Error Log
08:08Borkdudecemerick: wanted to try out the approach from your video
08:08Borkdudecemerick: but maybe I missed something?
08:08cshellBorkdude: Can you run the project from the command line with lein?
08:08cemerickBorkdude: I just created a project and added Leiningen support without an issue using that project.clj. Definitely need that stack trace.
08:09Borkdudecemerick: ow, here it is: Nature ccw.nature is missing prerequisite nature: org.eclipse.jdt.core.javanature.
08:10cemerickyuck
08:10Borkdudecshell: I think so, but I want to try it from Eclipse only (it's for my students, so that they won't have to install the script)
08:10cemerickBorkdude: what sort of Eclipse build do you have? Does it have Java support in it?
08:10cshellBorkdude: something seems wrong with your eclipse install - I don't think that error is clojure/lein related
08:10cemerickalso, what version of ccw?
08:10Borkdudecemerick: yes, it's Indigo, the J2EE version, I do lots of Java and Clojure things with it
08:11Borkdudecemerick: 0.7.0.STABLE001
08:12cemerickhrm, same as me, mostly
08:12Borkdudecemerick: I did forget anything? I created a "general project" instead of a Java or Clojure project, but I saw that from your video I think
08:12Borkdude"did I" I mean..
08:12cshellBorkdude: It's not a clojure 1.2.0 vs 1.3.0 is it?
08:14Borkdudecshell: hem, it says clojure 1.2.0 in the project.clj but ccw doesn't look at this right
08:14cemerickah-ha
08:14cemerickBorkdude: you have to add Leiningen support first, *then* Clojure.
08:14Borkdudecemerick: ah… sorry then
08:14Borkdude:(
08:14cemerickAdding the lein support coerces it into a JDT project, which explains the error message.
08:15cshellinteresting quirk
08:15cemericklpetit is working on a proper leiningen/clojure import wizard AFAIK
08:15Borkdudecemerick: so from configure I should see "add leiningen support"?
08:15cemerickcshell: that's an artifact of bootstrapping the thing from a bare project, vs. a Java or Clojure project from the start.
08:16Borkdudecemerick: I don't see this option…
08:16cemerickBorkdude: right-click project node > Configure > Convert to Leiningen Project
08:17cshellcemerick: ah cool
08:17Borkdudecemerick: http://twitpic.com/9h58nj ...
08:17cemerickBorkdude: have you not installed the Leiningen eclipse plugin?
08:18cemerickhttp://ccw.cgrand.net/updatesite-lein-betas is the update site FYI
08:18Borkdudecemerick: I thought I had, but I must have removed it…. going to try it again
08:21cshellDoes anyone know the state of ClojureScript? Is it mature enough to use on a production app?
08:21Borkdudecemerick: ok did that… and now add clojure support to it?
08:21Borkdudecemerick: after adding leiningen support I mean
08:23cemerickBorkdude: Yup
08:24Borkdudecemerick: I keep getting the same msg
08:24cemerickdoes the project now have a "Leiningen dependencies" classpath container within it?
08:24Borkdudecemerick: Problem requiring namespace/getting var ccw.clojure-project-nature/factory from bundle ccw.core
08:24Borkdudecemerick: no...
08:25cshellrestart eclipse?
08:25cemerickThere's something wonky.
08:25cemerickI would suggest: cloning the project clean
08:25cemerickand, if you didn't restart eclipse after installing the leiningen plugin, doing so
08:26cemerick(I've never been able to install an eclipse plugin, enable it, and use it properly without restarting) :-(
08:26Borkdudecemerick: ah.. the plugin installation doesn't demand it? then I didn't do it, will do now
08:27Borkdudecemerick: let me just try the workflow from the beginning, having restarted eclipse
08:29Borkdudecemerick: deleted project. did a git clone, made a project in eclipse. "convert to leiningen project" -> Unhandled event loop exception
08:30cemerickbizarre
08:30Borkdudecemerick: https://gist.github.com/2594486
08:30cemerickwhoa, clojure.core/refer is unbound?!
08:30cemericksomething is definitely wonky in your environment / install
08:31cemerickI suggest reporting this (e.g. to http://groups.google.com/group/clojuredev-users/) with the stack trace and a link to the project, etc.
08:31x_orcshell: I've tried all the things you suggest, but still cannot get this (https://gist.github.com/2594485) to work. cemerick: I am using the example you used a few days in your webcast.
08:31x_orWhen I run (require '[foobar.core :as f]) I get "Unmatched delimiter: ]"
08:32cemerickx_or: You have an extra ] instead of a ) after the compojure.core :use
08:34x_orcemerick: OK, that makes sense. Now when I run the require I get "Could not locate compojure/core__init.class or compojure/core.clj on classpath:"
08:35Borkdudecemerick: I had this error before, this is why I de-installed the leiningen plugin before I think… can try a fresh Eclipse
08:35x_orShouldn't lein manage dependencies for me? Or, do I need to run something within emacs to handle installing compojure?
08:35cemerickx_or: yes, you should absolutely be using Leiningen.
08:35cemerickSorry, misread that Q :-)
08:36cemerickx_or: how are you starting a REPL within emacs?
08:36x_orclojure-jack-in
08:36x_orlein is in my path.
08:37cemerickI'd start a REPL on the console `lein repl` and see how things go. If things work fine there, then you need to find an emacs wizard to help you with that department. :-)
08:37x_orcemerick: Sounds good. Thanks, appreciate getting feedback from the guru. :)
08:38x_orSame error: FileNotFoundException Could not locate compojure/core__init.class or compojure/core.clj on classpath: clojure.lang.RT.load (RT.java:430)
08:39cemerickx_or: can you paste your project.clj?
08:39x_orDo I need to do something special to install compojure?
08:41x_orOoh that is the problem...
08:43felideonooh nice, Clojure Programming ebook for $17.99
08:43felideon(today)
08:47Borkdudecemerick: fyi, a fresh Eclipse with a fresh leiningen plugin, I get this https://gist.github.com/2594570
08:47Borkdudecemerick: will e-mail it to the list now
08:47cemerickman, that's a low-level failure :-|
08:51robertstuttafordhas anyone got any pointers to quickstarts with clojure and mongodb? as a learning project i want to replicate a rest json api we have together using ring and compojure that uses our mongo db
09:01Borkdudecemerick: sent the e-mail, I'm off now
09:11mdeboardSo is this just how pattern matching in Clojure works? dnolen just tweeted this a bit ago https://gist.github.com/2594296
09:13babilenmdeboard: For further details see https://github.com/clojure/core.match
09:13mdeboardSo, yes then?
09:14Licenserpattern matching is cool
09:14mdeboardlokos like it, p funny. I think his gist is in response to http://news.ycombinator.com/item?id=3927652
09:14cemerickyes, that's one approach to pattern matching
09:14cemericksurely the most popular, as these things go
09:14robertstuttaford*tries to understand it*
09:15mdeboardrobertstuttaford: It helps to think of it in terms of "if/else if" blocks
09:15mdeboardIt helps me*
09:16robertstuttafordso the first [] {} is and if () {}, and the rest of the [] {} are else if () {}?
09:16robertstuttafordan*
09:16robertstuttafordoh i get it
09:16robertstuttafordthat's awesome!
09:16Licenserit is
09:17Licenserthen again I'm an erlang person :) have to
09:17robertstuttafordi'm about 5 days into FP as a whole
09:17robertstuttafordmind blown regularly
09:17Licenseryea get a good head to cover all the brain that will gow out of the craters
09:18robertstuttafordi'm busy doing the clojure koans. really enjoying it
09:19Licensercan imagine :) it's one of the greatest langauges to learn
09:25robertstuttafordthis one's confused me
09:25robertstuttaford(= 25 (___ (fn [n] (* n n))))
09:25mdeboardIs pattern matching considered cyclomatic complexity?
09:25robertstuttaford"Higher-order functions take function arguments"
09:32_KY_Is there a function to find the position of a sub-list within a list?
09:34mdeboard_KY_: Is this a list of lists? e.g. '((1 2) (3 4) (5 6)) etc?
09:34_KY_No just a flat list...
09:35_KY_So I want to find say [4 5 6] in [2 3 4 5 6 7]
09:36mdeboardRight, there are several "longest common subsequence" algorithms, e.g. http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm not sure if there's a stdlib implementation
09:36robertstuttafordclojure.set/intersection?
09:36clojurebotclojure is the bestest programming language available.
09:37mdeboardrobertstuttaford: He wants position though
09:37robertstuttafordah
09:41_KY_Just a simple function will do... the lists are tiny =)
09:42dxlr8rtrying to set up leiningen… but it stands on "Downloading index from central - http://repo1.maven.org/maven2&quot; forever when I try to search for something
09:42dxlr8rI have a fast internet, been at it for over half an hour
09:42_KY_Yeah I have that problem before
09:43mdeboardrobertstuttaford: I dunno about higher order functions but #(% 5) solves your question earlier
09:43_KY_The site seems overloaded or broken
09:43dxlr8rdu -s .m2 , it doesn't get bigger either
09:43mdeboard# is just a macro for an anonymous fn though
09:43_KY_I ended up not searching and asking for others to fill in the incantations
09:43dxlr8r_KY_ why does that always happen when us noobs are going to test out stuff? :P
09:44robertstuttafordmdeboard: yes, thank you, got there
09:44_KY_=)
09:45robertstuttafordi was able to install lein2 earlier today
09:45dxlr8rwell, trying to delete .m2 and se what's happening
09:45robertstuttafordusing the instructions on the lein github page
09:45dxlr8ryeah, me 2
09:46dxlr8rthere should be mirrors
09:47mdeboard(= 25 (->> 5 ((fn [n] (* n n))))) is a better way imo, but doesn't fit the problem
09:48dxlr8rthe few times I have been dealing with maven it has seemed to fuck up everything...
09:48robertstuttafordi have yet to learn about (->) and (->>)
09:52mdeboardthey're pretty neat
09:59robertstuttafordhow many 'core' functions are there to learn?
09:59clojurebotanonymous functions are functions with no names
09:59robertstuttafordtens? hundreds?
09:59robertstuttafordclojurebot???
09:59lazybotrobertstuttaford: Oh, absolutely.
09:59clojurebotclojurebot is amazing
09:59mdeboardlol
10:01mdeboardrobertstuttaford: http://www.clojureatlas.com/org.clojure:clojure:1.4.0?guest=t
10:01uvtcrobertstuttaford, http://clojure.org/cheatsheet
10:01robertstuttafordi guess the only function i need to know is (doc)
10:01robertstuttafordawesome
10:03mdeboardI'm not sure how I feel about the atlas
10:04x_orI'm getting a "Too many arguments to def" error when I attempt to require my module. Is there a reference on how to breakdown the stack trace and understand whether this is an issue in my code or the clojure library?
10:04achengrobertstuttaford: sometimes find-doc before doc, and sometimes just #clojure :-P
10:04robertstuttafordah, find-doc - thanks for that!
10:05mdeboardx_or: If there is a good/simple/straightforward way to understand stack trace for Clojure (any JVM language, I expect) I don't know what it is.
10:05mdeboardNot that me not knowing is indicative of a larger issue
10:06x_ormdeboard: :)
10:07mdeboardx_or: I've never used this, and just found it via google, but http://richhickey.github.com/clojure/clojure.stacktrace-api.html
10:07lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure/clojure.stacktrace-api.html and try to stop linking to rich's repo.
10:07mdeboardoops, your'e right lazybot, sory
10:07mdeboarddidn't check the uRL
10:07fliebelx_or: Usually when I get that error, I have been doing Python, and defined a function using def instead of defn
10:07mdeboardha
10:07felideonlol nice lazybot
10:08fliebelCan't rich just fix the internet and update his clojure repo?
10:08achengrobertstuttaford: thanks for the tip yesterday that paredit exists in eclipse (and not just in emacs) i didn't know that
10:09ssedano1How can I create an array of a certain enum to pass it to a java method vararg?
10:09x_orfliebel: Yep, that was it.
10:09mdeboardawesome
10:10fliebelssedano1: An array of an enum?
10:10robertstuttafordmy pleasure. CCW is great
10:11robertstuttafordparedit is fantastic
10:11ssedano1(into-array [(Enum/VALUE)]) ?
10:13ssedano1yeah that it is
10:15ssedano1&(into-array [java.lang.Integer/MAX_VALUE])
10:15lazybot⇒ #<Integer[] [Ljava.lang.Integer;@6a67dc>
10:18mdeboardcemerick: If I pay for Atlas is there a setting to stop the bouncey nodes
10:18cemerickbouncey nodes?
10:19mdeboardthe animation
10:19ssedano1fliebel: I need to call a java method that expectes a vararg of an enum type
10:19ssedano1fliebel: that's why I needed to create a java array of one enum value
10:19fliebelah
10:19ssedano1but I figured it out, thank you
10:19mdeboardLike, not totally stop it but it's hard to find what I want quickly as I need to wait for the animation to stop
10:20cemerickmdeboard: oh, I see. Yes, that's probably the #1 gripe.
10:21cemerickworking on it :-)
10:21cemerickit's a particle simulation underneath, which hopefully partially explains the challenge.
10:21mdeboardcool, good enough for me
10:21fliebelcemerick: What is the advantage of paying anyhow? Does the try function expire eventually?
10:21cemerickfliebel: it'll stop nagging you
10:21mdeboardi like paying people for neat stuff they make as long as it's not ridiculously expensive
10:21mdeboardand $5 isn't bad
10:22fliebelhadn't noticed the nagging...
10:22mdeboardfliebel: Clean up your room
10:22cemerickfliebel: heh, maybe I have it set too high; I think it starts after 25 clicks or something.
10:22mdeboardand call your mother more often
10:22fliebelmdeboard: ?
10:22mdeboardnagging
10:22uvtcnot naggy enough. Must increase nagging factor.
10:24fliebelI wonder if Atlas + Light table is something interesting.
10:28mdeboardrm seo/tests/runner.py
10:28mdeboardfeh
10:28robertstuttafordheh
10:30TEttingerI assume many people in here know about http://www.kickstarter.com/projects/ibdknox/light-table?ref=home_popular ?
10:31TEttingerI'm kinda wondering if I want to back it
10:31espeedhow do you enable SLIME REPL history for the up arrow?
10:32fliebelTEttinger: You want. At least, deep inside...
10:32TEttingeras long as ibdknox isn't this guy http://penny-arcade.com/comic/2012/05/04
10:35uvtcWhat does it mean for a data structure to "participate" in an abstraction? (primary Clojure abstractions such as Collection, Sequence, Associative, etc.)
10:36uvtc(Reading the wonderful "Clojure Programming" book, btw. Thank you authors (cemerick, not sure of others' nicks).)
10:36uvtcIs an abstraction defined by the functions that are expected to work right on object types which implement said abstraction?
10:37mdeboardTEttinger: I kicked in a couple dollars toward it, based strictly on the strength of ibdknox's contributions to Clojure in general. I wasn't as amped about the idea in general as others, tbh. But he's one of those dudes I feel like can make something cool given resources.
10:37mdeboarduvtc: It seems like you're asking about the general concept of an abstraction
10:39uvtcmdeboard, Well, I know what an abstraction is in terms of OOP languages. You've got an abstraction which says, "if your object supports these methods, than it implements the abstraction". If it quacks like a duck ...
10:39uvtcs/than/then
10:40uvtcBut in Clojure, the data structures are just data ...
10:41mdeboardWell, they're not JUST data, they're also instructions. instructions which abstract away implementation details from the user while preserving semantics
10:42mdeboarde.g. &(doc partial)
10:42uvtcmdeboard, I don't see how, say, a vector is "also instructions". It's just an indexable sequence of things, afaict.
10:42mdeboard&(doc partial)
10:42lazybot⇒ "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
10:42faust45hi guys
10:42robertstuttaforddata that contain instructions that cause the runtime to do things. those instructions belong to these abstractions
10:42faust45is it right way to handle non block io with agents send-off
10:42faust45?
10:43Chousukeuvtc: the abstractions define a bunch of operations that the data structures support
10:43mdeboarduvtc: I think in the book (I don't have it in front of me) participation in an abstraction just means that that particular data type is used to create the abstraction. e.g. seqs used to create like (take), (drop) etc
10:43uvtcChousuke, but how does a data structure "support" anything? Isn't it up to the function to decide if it supports the data structure?
10:43Chousukeuvtc: no
10:44Chousukeuvtc: the data structure determines what operations are sensible.
10:44Chousukeyou can't add in the middle of a vector for example
10:45Chousukeand linked lists are not associative, so it makes no sense for them to implement lookup by key
10:45mdeboardThere are certain operations that can be efficiently executed on one data type but not another, etc.
10:45bolicIs anyone using clojureql? I would like to process a large resultset sequentially, using paging (mysql first/max). Is there a way to do it without using take/drop? Here's an attempt that doesn't work so far http://pastie.org/3859229 (see comment below the code: no paging params in the generated sql)
10:45uvtcChousuke, Oh, implement behind the scenes. Hm.
10:46mdeboarduvtc: "implementation behind the scenes" is the a characteristic of an abstraction
10:47mdeboardwhoops, "is a core characteristic"
10:47Chousukeuvtc: but in essence each abstraction is just a bunch of operations with no data attached to them
10:47Chousukewhich is different from usual class-style abstraction which couples data and operations
10:47Chousukeand which is generally frowned upon in clojure-land :P
10:48mdeboardoh hm, never really made that connection
10:48mdeboardditto
10:49uvtcChousuke, mdeboard I think my brain has been stuck in OO-mode for a while. Thanks for the help.
10:50Chousukein a Clojure application you could just as well provide an abstraction as a bunch of functions, with no language-level "interface" behind it
10:50mdeboarduvtc: Yeah was just thinking that I haven't trained my brain to flex the FP muscles while relaxing the OO muscles
10:51mdeboardLike how I can wink my right eye without moving my left, but not vice versa :P
10:51uvtcThe book mentions the Collection abstraction, and then lists: conj, seq, count, empty, and =. If some data objects behaves correctly when those fn's are called on it, then it implements the Collection abstraction. Correct?
10:51gfredericksmdeboard: ;)
10:51uvtcs/data objects/data object/
10:52Borkdudefunctions are objects, sometimes with data attached (closures)
10:52Chousukeuvtc: yeah. and in the JVM implementation the objects actually implement the corresponding interface(s).
10:53TimMcgfredericks: ¦)
10:53BorkdudeI need caffeine now...
10:53Chousukebut eq java String works with seq even though it doesn't implement the clojure interface; it's special-cased in the implementation
10:53Chousukeso you could say it participates in the abstraction because all the user sees of it the "seq" function
10:54Chousuke+is
10:54gfredericksTimMc: ooooooh
10:54gfredericksTimMc: I bet that took practice
10:54Chousukealso eg
10:54Chousuke:P
10:54uvtcChousuke, Thank you.
10:54gfrederickshuh; do string seqs hold a ref to the string?
10:55joegallomdeboard: a semi-related thought. java has a "stream" abstraction. but there's no class for stream itself. there's InputStream and OutputStream, and they represent aspects of the stream abstraction, but the language itself doesn't have (doesn't need?) a mechanism for elaborating on that thing by itself. (this seems related to me, but if it just confuses things more, then please ignore me.)
10:55Chousukegfredericks: as far as I know yes
10:55mdeboardjoegallo: No I see what you mean
10:55S11001001unfortunately forall x,y in javaarrays, (= (seq x) (seq y)) does not imply (= x y)
10:55Chousukeyeah seqs over mutable things are a bit iffy :/
10:56TimMcgfredericks: Does your keyboard still have the ¦ symbol for the | key? Mine doesn't. When did that happen?
10:56mdeboard|)
10:56Chousukeactually, mutable things are a bit iffy :p
10:56gfredericksTimMc: nope
10:56gfredericks|)
10:56gfredericksI guess that's a geordi face?
10:56mdeboard|-) looks mor eli--
10:56mdeboarddammit
10:57Chousukehmm, I can get ¦ with shift-altgr-<
10:57ChousukeI wonder if that character is useful somewhere
10:57gfredericksdemonstrating double-winking skills
10:58TimMcgfredericks: I practice that every night, for hours at a time.
10:58TimMcSometimes it causes me to hallucinate.
10:58gfrederickscrap
10:58mdeboardlol
10:58mdeboard@ that description of blinking/sleeping
10:59TimMcThere: https://en.wikipedia.org/wiki/Vertical_bar#Solid_vertical_bar_vs_broken_bar
11:00ejacksongeordi face !
11:00acheng;) !)
11:00gfredericksI would go drinking at a place called "Solid Vertical Bar Vs Broken Bar"
11:04FullmoonCould someone critique a little bit of code I wrote to read all the output of a shell command? I am not quite sure I do the right thing wrt reading from the stream
11:05Fullmoonhttps://gist.github.com/2595281
11:05gfredericksimmutability in parenting: "changing" a diaper does not actually alter the original diaper, but rather returns a new diaper.
11:06tmcivergfredericks: yeah, but the *baby* alters the original diaper . . .
11:07achenggarbage collection on the old diaper happens too slow imho
11:08michaelr525err
11:10gfrederickstmciver: I infer from your punctuation that babies can have thread-local bindings
11:13nDuffgfredericks: ...there certainly do exist people for whom who is and is not their baby depends on context.
11:14mdeboardI am so disturbed.
11:14mdeboarddynamic babies
11:14gfredericks(with-baby jake (generate-birthday-gift))
11:17tomojFullmoon: you shouldn't need to read char by char
11:18Fullmoontomoj: Yeah, I could read it into buffers, but then the if-eof check is more the thing which I think is most problematic
11:18tomoj(defn exec [command & args] (slurp (.getInputStream (run-process (into [command] args)))))
11:20tomojalso I imagine this is a pedagogical example, but https://github.com/Raynes/conch
11:21Fullmoontomoj: Nice, thank you
11:22Borkdudewhen I do a "lein test" on this one https://github.com/Borkdude/tictactoe it also tries to test the namespace "testdata", can I tell lein that this namespace doesn't contain tests?
11:23Borkdudenot such a big deal btw
11:31TimMcFascinating. If I understand this correctly, the JVM considers a method's return type to be part of its signature, but Java does not.
11:32nonubyTimMc, that essential or how would object a = x.method1() work
11:32rhcTimMc: what are the implications of that?
11:32mefestoTimMc: How so? I thought Java did
11:33nonubyif there exists a method1() that returns Car
11:33TimMcSo to account for narrowing return types in Java-method "overrides", the compiler inserts a synthetic bridge method with the wider return type.
11:33nonubyand method1() that returns Truck
11:33nonubyboth derives types of Object
11:33rhcah crazy
11:33rhcsimilar weirdness in C++ with narrowing retrn types in derived classes
11:34TimMcmefesto: Java only pays attention to the params.
11:34chouserTimMc: if that's right, that's the clearest explanation of bridge methods I've ever heard. Thanks!
11:34TimMcchouser: Well, there are other kinds of bridge methods, too. The problem is, they apparently aren't documented in the JVM spec. They just exist...
11:35TimMc^ second-hand information
11:35Borkdudewhat is a bridge method?
11:35mefestoTimMc: But if you implement an interface you must have an acceptable return type for the methods you implement, no?
11:36TimMcmefesto: Yes, but the return type can be narrower.
11:36rhcmefesto: check this out http://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
11:37TimMcYep, that's the source I used.
11:41rhcthat's interesting when you think about performance: every call to a generics base class will actually incur two function calls, right?
11:45mefestointeresting
11:45TimMcSure, but function calls are pretty fast, and I would imagine that HotSpot can inline such tiny methods.
11:46yoklovi mean, lambda is the ultimate goto, after all :p
11:46yoklovthough i don't know if the jvm has gotos
11:47dnolenyoklov: exceptions
11:48fdaoudHi all. I'm looking at Mustache and I don't "get" what lambdas are or why you would need to use them in your templates. Any enlightment would be appreciated.
11:49yoklovdnolen: ah, that sorta makes sense. exceptions are sort of more general than gotos though, right?
11:49yoklovor more specific maybe, hm
11:49dnolenyoklov: yes more specific.
11:50yoklovfdaoud: what sort of languages do you have experience with?
11:50yoklova lambda is just a first class function, equivalent to javascript's `function` keyword
11:50fdaoudyoklov: Java, Clojure, Groovy, Ruby..
11:51yoklovit's the fn keyword in clojure, and something like blocks/procs/lambdas in ruby
11:51fdaoudyoklov: ok, I'm with you there. I just don't understand how they are used in Mustache templates, what problems they solve.
11:52fdaoudyoklov: I mean, wouldn't you just do all the "hard work" in Clojure to prepare a data structure for the view, and just ship it off to a simple Mustache template?
11:52bhenry1someone refresh my memory. what would make me want to put ^:export in a clojurescript defn?
11:53yoklovfdaoud: i don't really have experience with moustache, i experience explaining lambdas to people, haha.
11:53fdaoudyoklov: fair enough :-)
11:54yoklovThough, looking at it it looks like they serve the purpose of allowing you to write more customizable templates
11:55vojdfdaoud: if i understand it correctly its not too far from a macro. the lambda is called and expands into the template
11:55vojdso you could cleanly print {{ nof_users }}
11:55vojdand then have a lambda which would format the html around that block
11:56yoklovthe documentation has {:greet #(str "Hello, " %)} and then {{#greet}}Felix{{/greet}}, which inserts the output of (#(str "Hello, " %) "Felix") into whatever you are templating
11:56vojdcheck here: http://mustache.github.com/mustache.5.html and scroll down to Lambda
12:00fdaoudyoklov, vojd: I've read the docs and the examples. I just don't understand why you need that. Why not just {:greet (greet "Felix")} and (defn greet [x] (str "Hello, " x))
12:00fdaoudthen the template just has {{greet}}
12:00vojdfdaoud: my quick answer is. moustache wasnt written with clojure in mind ;)
12:01vojdthink of all the other languages out there which would benefit greatly from a neat template language
12:01yoklovfdaoud: what if you want to greet many people the same way?
12:01yoklovyou could just use greet, and then later should you want to change the way you greet them you only need to change the definition of greet
12:02fdaoudyoklov: {:greet (map greet many-people)}
12:02vojdanother plus for moustache is that a person familiar with it can work together with devs from clojure, python, java and still have a tool which works in all areas
12:02yoklovfdaoud: wouldn't work if those greetings weren't all in the same place
12:02_tcafdaoud: it's all preference
12:03yoklovfdaoud: using it as a function is more flexible
12:04yoklovfdaoud: but yeah, it comes down to personal preference.
12:04yoklovthough i think using functions would prove to be less of a pain to maintain in the future.
12:05fdaoudyoklov: ok, I think I get it. thanks.
12:08yoklovfdaoud: great!
12:09fdaoudyoklov: I guess I find it strange to pass a function to the template and have the template call that function with data. I don't see how that data could be in the template but not on the server. Also strange to go back to the server to generate the output.
12:09fdaoudseems backwards to me.
12:11vojdbut you do have the data in the template already
12:11vojdno round trips to the server
12:11brainproxyI'm getting an error when trying to call the add-dependencies func from clojurescript's closure.clj
12:11brainproxyhttps://gist.github.com/2595668
12:12fdaoudvojd: best thing for me to understand is an example where the solution with a mustache lambda is better than a solution without.
12:12yoklovfdaoud: i'd think of the server-side part as making a library of functions for use inside your templates
12:12brainproxynote I'm a noob and feeling my along, so I may be making a basic mistake, but haven't been able to figure it out w/ google's help
12:13fdaoudyoklov: ok, but why call those functions from the templates instead of calling them from the code that prepares the data for the template?
12:13yoklovfdaoud: hm, i'd think that it would make your templates clearer
12:15LicenserA prime example why imutabilty is great: https://gist.github.com/2595753
12:15vojdfdaoud: imagine you're writing front end stuff for a system where you have no control over the backend
12:15yoklovfdaoud: honestly though, I don't really know enough about moustache to say
12:16Licenser6 code examples and the only one that works is the one that looks totally wrong
12:16yoklovbrainproxy: Have you considered using lein-cljsbuild?
12:16fdaoudyoklov: ok, I do appreciate your responses!
12:17yoklovfdaoud: haha, thanks, wish I could help more!
12:17brainproxyyoklov: I'm doing something custom which doesn't fit in with lein, at least not yet
12:17TimMcWhere did I see some horrible hack that allows you to write fancy condition systems in Java?
12:17fdaoudvojd: I think I understand what you mean, but I'm used to the server being the data king, and the client being the powerless slave.. :)
12:18fdaoudvojd: so the client template would just have {{stuff}} or {{#things}}<li>{{something}}</li>{{/things}} and let the server create the data structure
12:18vojdfdaoud: indeed . i'm with you on that point :)
12:19brainproxyyoklov: mainly I'm just trying to understand the error; I can run other functions in the closure namespace, e.g. closure/-compile
12:19brainproxyand those work fine
12:19vojdfdaoud: and in all honesty, the things made with moustasche can of course also be done with javascript. just a matter of taste in the end
12:20fdaoudvojd: so I can't see myself calling {{#lambda}}Jack{{/lambda}} from a template because what is Jack? Why does the template know about Jack?
12:21yoklovbrainproxy: you're somehow calling something which ends up as (make-reader nil)
12:21muhoois there a clojure idiom for destructuring a map into another map, i.e. mostly renaming and shifting keys around?
12:21yoklovsince nil doesn't implement clojure.java.io/IOFactory, this is an error
12:21tomojidiom for destructuring?
12:22yoklovfor anything more you'd have to ask someone who understands the internals of the cljs compiler better than i
12:22yoklovsuch as dnolen, for example, if he's around
12:22brainproxyyoklov: okay, well thanks for the feedback, appreciated :)
12:23muhooi.e. to turn {:foo {:bar "baz" } :quux "blah"} into {:somekey "baz" :anotherkey "blah"} ?
12:23brainproxyyoklov: cool, will do
12:23vojdfdaoud: but say you have different user groups. all strawberry-members shall have a nice little strawberry-avatar and a bold name while the banana-team shall have something else
12:24dnolenyoklov: brainproxy: closure.clj is one of the files I don't know that well.
12:24tomoj,(doc clojure.set/rename-keys)
12:24clojurebotGabh mo leithscéal?
12:24dnolenbrainproxy: I'm curious as to why you need to mess around with that directly.
12:24tomojthat helps a bit
12:29dnolenlynaghk`: nice C2 on HN.
12:33lynaghk`dnolen: uh oh
12:33lynaghk`why do I always get publicity before I have time to cleanup READMEs
12:34yoklovhaha
12:34ibdknoxheh, that's like when I first "released" noir
12:34ibdknoxwhat a disaster that was
12:35lynaghk`ibdknox: someone just stumbled on the github and posted to HN?
12:35ibdknoxyep, at 2am
12:35lynaghk`hah
12:35ibdknoxI had just gotten the site up but hadn't had time to make sure it was ok
12:35ibdknoxand I was going to bed
12:35ibdknox3 hours later I finally passed out
12:36ibdknoxwoke up a couple hours later to find out that I hadn't daemonized my lein process correctly
12:36ibdknoxand linux killed the process :p
12:36progoouch :)
12:36ibdknoxI think it was down for like 40 minutes
12:37ibdknoxlynaghk`: so look at the bright side, at least it's during the day!
12:37lynaghk`all of my sites are totally static. I was really stoked about the latest Keming Labs homepage redesign since it ended up being under 100k (including images) and has no JavaScript whatsoever---basically the antithesis of everything we make
12:37lynaghk`ibdknox: yeah, true true. The next half hour is as good as any to cleanup the README...
12:39ibdknoxpython's naming conventions seem to be incredibly inconsistent. I miss my everything is lowercase with dashes.
12:41ivanthe real trouble starts when someone with a PEP8 program wants to use a camelCase library
12:42ivanPython standard library actually implements both camel case and underscore in some places
12:42ibdknoxI've noticed :(
12:42hhutchlynaghk`: i was just looking at cljs-chosen .. looks really neat... i'm just still not sure i like adding jQuery as a dependency in my CLJS stack
12:43dnolenso should we do another CLJS release?
12:43lynaghk`hhutch: since the Harvest folks designed Chosen to support jQuery and prototype, I think you could probably replace the DOM calls to use google's closure
12:43ibdknoxdnolen: yes please :)
12:43lynaghk`hhutch: also, they wrote it in CoffeeScript, so you can use my/bolenfest's fork of that compiler to emit Closure-compatible JS
12:44lynaghk`hhutch: so, what I'm saying is: "pull requests welcome" = )
12:44lynaghk`dnolen: hells yes.
12:45dnolenk email sent to clojure-dev
12:46hhutchlynaghk`: i guess i was just commenting because this is an internal debate i'm having about my projects and especially CLJS libraries that will add another dependency (like jquery) in the stack. It seems like jayq has pretty much ended this debate though
12:47brainproxydnolen: I'm working on bridging nodejs/npm directly into the clojurescript compiler using thre require extensions mechanism proided node
12:47lynaghk`hhutch: yeah, it depends on your use case. Most of the work we do is on internal networks, so size / dependency bloat hasn't been a big issue for us. Conceptually, though, I would like to be able to avoid jQuery in cljs projects.
12:47brainproxy*the require...
12:47brainproxyerr.. *provided by node
12:48brainproxydnolen: that way, you should be able to do require('clojure-script') and have the same effect as require('coffee-script') with respect to .cljs files
12:49dnolenbrainproxy: neat. Were you planning on putting together a patch for this?
12:49brainproxydnolen: it will be an npm module
12:49brainproxyactually, I've already pub'd it, but it doesn't really work yet
12:50dnolenbrainproxy: yes, what I mean is that doesn't this require currently require changing the compiler and maintaining your own fork of CLJS?
12:59brainproxydnolen: sorry, internet connection woes .. big storm in the area
13:00brainproxydnolen: https://github.com/michaelsbradleyjr/node-clojurescript
13:00brainproxyshouldn't require a fork, as I'm using node-java package to bridge directly into the java api
13:00OwenOuhi i am just curious if anyone has played with java 7's new GC with clojure? http://www.oracle.com/technetwork/java/javase/tech/g1-intro-jsp-135488.html
13:00dnolenbrainproxy: gotcha. looks cool.
13:01brainproxydnolen: closure/-compile works fine
13:01brainproxyit spits back a javascript string
13:01brainproxybut if I try closure/add-dependencies, which is what I need next, I'm getting the error in that gist
13:01prpatelemacs-clojure n00b here. have quick question: i have everything running, project in lein, swank plugged in, etc.
13:01brainproxynot sure if it's an issue with the clojure build I'm using, with clojurescript or what exactly
13:02wkmanireHowdy folks.
13:02dnolenLicenser: that's more an issue of the lack of proper let scoping in JS
13:02dnolenLicenser: did that fix yesterday help you much?
13:03brainproxydnolen: btw, once I have it working, I'll rewrite a newer version of the package in clojurescript, but to start with, it's written in coffeescript
13:03wkmanireprpatel: Question?
13:03Licenserdnolen I haven't yet run into the same issue :) but I guess it will when I do
13:04dnolenbrainproxy: hmm, yeah not sure what's going on there - I've never tried calling add-dependencies directly.
13:04prpateltrying to run this in the REPL in emacs: (def server (jetty/run-jetty #'app {:port 8080 :join? false}))
13:04prpateli'm working through cemerick's screencast
13:04prpatelin emacs rather than CCW
13:04prpateldang it
13:04prpatelnevermind
13:04prpatelseems to work now, of course the minute I go ask for help
13:05brainproxydnolen: very similar error messages are being reported with a recent vesion of lein
13:05brainproxydnolen: but, this is all a crash course for me, as previously I've not programmed in java or clojure
13:05prpateli was wondering if the REPL in emacs was tied to the running instance... i guess it is
13:05brainproxyhowever, I learn quickly :D
13:05wkmanireprpatel: You're using swank right?
13:05prpatelyessir I am
13:06dnolenbrainproxy: it's nice to see that more people are interesting in getting CLJS to work well with Node.js
13:06dnoleninterested
13:06wkmanireThen yeah. It's a client-server setup.
13:06prpatelsuper excited about digging into clojure script... finally found a good use (for me) for clojure :)
13:06muhootechnomancy: would you happen to know how many dynos, and of what type, i have to throw at heroku to prevent the app from spinning down?
13:07brainproxydnolen: heck yeah, the promise of immutability, protocols, etc. are just too good not to jump on cljs
13:07brainproxydnolen: a friend and I started playing w/ cljs this past weekend at a hackathon, we're both big node nerds
13:07technomancymuhoo: only 1-dyno apps spin down I believe
13:07brainproxyby the time we went home, we both were convinced that to not adopt cljs would be a mistake
13:07brainproxy:)
13:07dnolenbrainproxy: awesome!
13:07muhootechnomancy: so 2 dynos is no spindown?
13:08wkmaniretechnomancy, muhoo: What does "spin down" mean?
13:08technomancymuhoo: that's my understanding
13:08muhoothat's great deal actually, thanks
13:08dnolenbrainproxy: bunch of perf work left to do, but it's cool to hear you're excited about it even it's current state :)
13:08muhoowkmanire: heroku free apps shut down the jvm if it's idle for an hour
13:08ibdknoxI can confirm that two prevents the spindown
13:09muhooibdknox: thanks
13:09lynaghk`muhoo: that explains a lot...any way to prevent that?
13:09wkmanireand this shut down process is called spindown?
13:09brainproxydnolen: the main thing holding me back was the fact that it's not a good palyer wrt npm and node's module system in general
13:09muhoolynaghk`: yeah, pay $35/mo :-)
13:09technomancywkmanire: I think the preferred term is "idling"
13:09brainproxywhen I discovered node-java earlier this week, I figured what the heck, let's do this
13:09ibdknoxlynaghk`: or set up something to ping it every 30mins ;)
13:09dnolenbrainproxy: yeah. Again we're listening - anything to make that simpler is something we're very interested in.
13:10wkmanireOh ok.
13:10muhoothe cron-job-to-ping-the-app approach would work for my own stuff, but this is for someone with a budget, they can afford $35/mo
13:10dnolenibdknox: so I take you're not ready to talk about that big donor from yesterday?
13:10brainproxydnolen: what I'm aiming for is to provide the same functionality as the coffee-script module for node, and also make it possible to do things akin to what the ender project does w/ npm
13:10ibdknoxThey won't be well known here I think haha
13:10ibdknoxdnolen: It's Red Gate software
13:11brainproxydnolen: instead of cake, projects should probably use lein for for build routines and whatnot, but I haven't started messing w/ lein yet
13:11ibdknoxTimMc: big player in .NET tools
13:11dnolenibdknox: wow, that's very interesting
13:12ibdknoxdnolen: very interesting lol
13:12ibdknoxit's a bit of a poke at the bear
13:12wkmanireI've used some red gate stuff. I can't remember what it was.
13:12TimMcAh, they are fed up with VS, or what?
13:12wkmanireI think it was a code analysis plugin for VS.
13:12ibdknoxTimMc: I think it's "go where the puck will be"
13:13ibdknox10k for a largish organization is a rounding error
13:13ibdknoxso probably hedging their bets
13:13ibdknoxthey were genuinely excited about it
13:13ibdknoxa guy flew down yesterday and I talked with him
13:13ibdknox(he came for other reasons as well)
13:14TimMcNifty.
13:14muhoomost large companies have an internal vc team
13:14dnolenbrainproxy: looking forward to seeing where this goes.
13:14muhoolooking for potential acquisitions, they get toe in with angel money
13:14ibdknoxmuhoo: yeah
13:14muhoothat's really good news tho
13:14dnolenibdknox: still nice, you haven't got much further to go now.
13:14ibdknoxI have another one that I think you guys will be excited about :)
13:15brainproxydnolen: well I'm stuck atm, :), even if you're not too familiar w/ closure.clj, any tips on how I can hunt down the error in that gist?
13:16jodarowow a $10k'er
13:16jodaronice
13:16dnolenibdknox: more secrets!
13:16ibdknoxdnolen: Hopefully I'll convince them today :)
13:17solussd_how do I get aquamacs to use .emacs.d
13:17solussd_?
13:19dnolenbrainproxy: huh when I run that at the repl it just works.
13:19prpatelsolussd_: you may need to stuff it under /Applications/Aquaemacs/
13:19brainproxydnolen: what version of clojure?
13:19technomancyaquamacs? =(
13:20dnolenbrainproxy: 1.3.0 - that's what ClojureScript uses at the moment
13:20ibdknoxmuhoo: I love that movie
13:20brainproxydnolen: doh, okay, I'm on 1.4.0
13:20prpatelsolussd_ don't use aquaemacs if possible, just grab emacs 24 and get technomancy or batsov's .emacsd stff
13:20brainproxydnolen: I'll try using 1.3.0
13:20solussd_prpatel: It's actually using ~/.emacs.d for me, trying to figure out "how" it is for a coworker
13:21dnolenbrainproxy: trying now with 1.4
13:21dnolenbrainproxy: works
13:21technomancysuuuuure; it's "for a friend" =)
13:22brainproxysolussd_: using "emacs for os x" emacs24 build and bbatsov's prelude are working a lot better for me than aquamacs
13:22prpatelsolussd_ : don't know much about aquaemacs anymore
13:22brainproxydnolen: okay, well i'll try the older version anyway, just to see if it makes any diff for me
13:23jodarowow
13:23jodaroMCA is dead
13:23jodarohttp://www.tmz.com/2012/05/04/beastie-boys-adam-yauch-dead/
13:28muhoowat? sad.
13:28zakwilsonI want to get the path to my running jar. A Java answer suggests ClassLoader.getSystemClassLoader().getResource(".").getPath(), but when I try that, getResource returns nil.
13:28fdaoudibdknox: just curious, what does 'ibdknox' mean?
13:29ibdknoxfdaoud: it's from high school back when I used to play Halo and such. Knox is just what I always named characters, IBD = International Baccalaureate Dork. All my friends were in IB together.
13:30ibdknoxfdaoud: my cofounder is ibdthor lol
13:30fdaoudibdknox: heh, cool :)
13:30ivanlynaghk`: you might be losing some users with that non-obvious --extract flag that you have to find in the video
13:30ivanshort attention spans and all...
13:31hiredmanzakwilson: yeah, I can't image that would ever work
13:32fdaoudbrb
13:32zakwilsonhiredman: I know little of these things and just tried something I saw on StackOverflow.
13:32hiredman. is a unix file system thing, seems unlikely that .getResource would ever look kindly upon it
13:32hiredmanzakwilson: I suggest doing whatever in a way that avoids needing the path
13:33zakwilsonhiredman: I want it to look for and/or create files relative to the jar without knowing how the user will launch it (and therefore not being able to predict the working directory at launch)
13:34lynaghk`ivan: it's in the vrepl/README.markdown. Where do you think I should add an additional note?
13:35ivanwell, no thinking is required if that flag isn't needed and the browser page shows "This visual REPL will automatically load the most-recently modified file in samples/"
13:35ivannot sure if you want the shortest-attention-span users, though ;)
13:36brainproxydnolen: didnt' work, but was just looking at the pom.xml.template for cljs .. do I need to have the google closure library on my class path in addition to the google closure compiler?
13:36ivanI just grabbed the jar and didn't even know there was a README
13:36dnolenbrainproxy: probably.
13:37lynaghk`ivan: I hate it when I run things and they barf on my filesystem, which is why there's a flag. Putting the command line args in the default startup page is a good idea though. I'll cut a new JAR in the next few minutes.
13:37lynaghk`ivan: thanks for the feedback.
13:37ivanoh, I was running in a VM anyway and didn't care about barfing
13:37ivangood point
13:38wkmanirelynaghk`: That was nearly quotable.
13:38lynaghk`wkmanire: ?
13:39wkmanirelynaghk`: I hate it when I run things and they barf on my filesystem too.
13:39wkmanireHappened to me yesterday.
13:39lynaghk`wkmanire: oh, definitely. so rude!
13:39wkmanireNothing like hand-picking 30 files out of 200 to delete.
13:39ivanls -lrt makes it a little easier
13:40gfredericksemacs is always barfing on things
13:40ivannot enough backup files, write more backup files
13:40wkmaniregfredericks: #WHAT DO YOU MEAN# emacs~ would~ never~ do~ #THAT#
13:40gfredericks.#never
13:41joegallozakwilson: getResource on something that actually exists. like clojure/core.clj :)
13:41ivanlet's put 1000 Clojurists in one room and rewrite Emacs in a week
13:41joegallothen you can hork the resulting url apart pretty easily.
13:41technomancyivan: no rudybot in here, sorry =)
13:41technomancyrudybot might be more realistic to rewrite in a week though
13:42wkmanireClemacs? Clomacs... Emojure....
13:42ivanI'll go with Emojure
13:42zakwilsonjoegallo: thanks. That actually gives me something.
13:42TimMclol @ emojure
13:43gfredericksthere was a ban of *jure names I think, but I also think rewriting emacs would be an understandable exception
13:43TimMc"Clyde" would be a pretty decent name for a Clojure IDE.
13:43gfredericksTimMc: that's brilliant
13:44Chousukeneeds a tool called Bonnie to go with it
13:44joegalloI would call it Hubris, but that's just my $.02.
13:44ivanwould a PersistentVector be a good choice for an editor buffer?
13:44wkmanireDamn my nerdly existence.
13:46gfredericksivan: that sounds bad to me
13:46gfredericksdon't those have to be pretty flexible?
13:46gfrederickssplicing and joining everywhere?
13:46zakwilsonIt's my understanding that editor buffers are surprisingly hard to do well, and usually end up using specialized tree structures.
13:46ivangfredericks: yes
13:46gfredericksI saw an interesting discussion of them on the Good Math Bad Math blog
13:46ivan(multiple cursors make things even worse)
13:47Borkdudewhy build clemacs, better build clojure on elisp and not throw away emacs?
13:48wkmanireBorkdude: I think it was more of a running joke than anything else.
13:48ivanBorkdude: it would be better to keep the elisp and throw away Emacs' buffer/window code (though I don't think many will agree with me)
13:48technomancyBorkdude: because emacs doesn't have immutable data structures
13:48ibdknoxzakwilson: that is correct, some really fancy data structures
13:48technomancyBorkdude: http://technomancy.us/159.html
13:49ivanBorkdude: mousewheel, word wrap, cursor outside viewport, everything is wrong
13:49ivanthe scrollbar changes size as you scroll. it's amazing.
13:49zakwilsonibdknox: yay! I got one right!
13:49technomancywho keeps the scrollbar turned on?
13:50Borkdudetechnomancy: javascript and python do not either right?
13:51technomancyBorkdude: JS and Python have immutable strings
13:51technomancyand let you implement data structures; with elisp you're stuck with what's implemented in C
13:52felideonoh wow, redgate
13:52Borkdudetechnomancy: aha
13:52felideonthey make some nice tools for .NET ppl
13:53FullmoonI am looking for a Quicktest-style test frameowrk, any recommendations?
13:53ivanPython even has immutable tuples on which you can build an ArrayMap
13:54wkmaniretechnomancy: Interesting article.
13:58wkmaniretechnomancy: Just out of curiosity, if I answer "no" to your spam filter question will it still post my comment?
13:58Borkdudeibdknox: what is the interest of companies investing larger sums of money, they get more say in the final product? or altruism?
13:58technomancywkmanire: nope, it will be discarded
13:59wkmaniretechnomancy: Ah ok.
14:02wkmanireIt's pretty damned hard to whistle Thunder Struck isn't it.
14:02mebaran151I would like to implement a protocol that would handle generic maps and specific defrecords, with differing semantics. Can I configure extend-type to prefer my implementation inside my defrecord than the generic version for maps?
14:02wkmanireMy neighbor probably thinks I'm trying to immitate a bird since I have headphones on.
14:06wkmanireNo Cemerick today eh?
14:07Borkdudewkmanire: he was here earlier today
14:08amalloywkmanire: http://www.youtube.com/watch?v=EkmbjUsFZt0 is a string-only cover of thunderstruck, if you're into that sort of thing
14:08gfredericksthis must be one of those things from "the eighties" or something similar
14:11mebaran151also, is there an easy way to convert record to a map so I can use transients on them?
14:13mdeboardtechnomancy: re: Your elisp-in-clojure post, thanks. That actually answered some questions I was pondering.
14:13gfredericksmebaran151: (into {} rec) should work
14:14technomancymdeboard: cool
14:14mebaran151ah yeah that makes sense
14:14mebaran151gfredericks: thanks
14:16wkmaniregfredericks: It is. It was/is really popular at hockey games.
14:16wkmanireamalloy: Neat
14:16wkmanireBorkdude: I just got through is breakdown of the game of life algorithm. That's one of my favorite problems. I'm having to re-read the code over and over again to really take in the way you do this sort of thing with clojure.
14:17FullmoonLet's say I have a sequence of maps, and I want to return a map with them grouped key -> count of them, is there something special for that, opposed to reducing, and then map [a, (count b)] ?
14:17Borkdudewkmanire: in the clojure book?
14:17wkmanireThe next bit is the wilson's maze. I'm looking forward to it.
14:17wkmanireBorkdude: Yep.
14:17Borkdudewkmanire: still waiting for it.. amazon.de is slow this time
14:18wkmanireBorkdude: I bought it for my kindle. Aside from the code getting wrapped annoyingly it is well formatted.
14:18wkmanireSometimes I have to use the amazon cloud reader to see the code correctly.
14:18BorkdudeFullmoon: (for [s seqs] [(count s) s]) ?
14:19wkmanireI wish I could change the orientation of the reader to horizontal for the code segments.
14:19lynaghk`ivan: new C2 VREPL pushed.
14:19FullmoonBorkdude: Sure, but I thought that grouping-by-and-returning-the-keys-and-count is so common that it has it's own function
14:19Borkdudewkmanire: this is why I don't read textbooks on my kindle yet
14:20BorkdudeFullmoon: I never needed that yet, what do you use it for?
14:20wkmanireBorkdude: I thought about buying the larger one, but I ended up not spending the money... now I sort of regret it.
14:21wkmanireAfter another few iterations of the kindle I'll probably make the switch to a larger display.
14:24zaneswkmanire: You ... can do that? Or do you mean for just the code segments?
14:25wkmanirezanes: I'm sorry, I don't understand your question.
14:25wkmanirezanes: I can do what?
14:25zaneswkmanire: You said that you wished you could change the orientation to horizontal.
14:25wkmanirezanes: Yes. Is that possible?
14:25muhoohmm, pprint seems not to be honoring *print-level*
14:26technomancypprint also ignores *flush-on-newlines* =(
14:26zaneswkmanire: Totally! http://www.amazon.com/gp/help/customer/display.html?nodeId=200375800
14:26muhooum, is there a way to get it to behave?
14:26technomancyreplaca might know
14:26zaneswkmanire: Under 'Screen Rotation'.
14:27wkmanirecemerick: Hello. I was just talking about your section on Conway's game of life. I was really pleased to see that, it happens to be one of my favorite problems. I don't fully understand the clojure implementation you wrote yet though.
14:27wkmanirecemerick: After a few more re-reads and some experimentation I will. I'm looking forward to getting into the wilson's maze algorithm next. Great content!
14:27cemerickwkmanire: That part is nearly all Christophe. :-)
14:27faust45is it right way using agents send-off to handle non-block io ?
14:27wkmanireahh, well I hope he read that.
14:28cemerickHe's not in irc much these days.
14:28muhoohehe. blog.n01se.net/?p=85 is reported as an attack page by ffx
14:28muhoo:-o
14:29wkmanirezanes: I'm using the newer version. the touch. It doesn't have a keyboard.
14:29TimMcmuhoo: The diagnostic message is pretty confusing.
14:30TimMcmuhoo: Apparently 0 page(s) resulted in 22 scripting exploit(s) and 1 trojan(s) being downloaded...
14:30wkmanirezanes: Looks like the touch doesn't rotate.
14:30zaneswkmanire: Oh wow. I have the non-touch latest gen kindle (also no keyboard). I didn't realize the touch didn't have screen orientation controls. That's awful.
14:30zaneswkmanire: Yeah, just read. Terrible.
14:30zanes:(
14:31TimMcAnd even the Kindle *with* rotate has very confusing navigation semantics.
14:31wkmanirezanes: Yep. Not too pleased about that.
14:31TimMcIt's not the most pleasant UI.
14:31patchworkHey, what happened to lein interactive?
14:32technomancypatchwork: in lein2 that role will hopefully be handled by jark
14:32technomancy(but that doesn't work yet)
14:32wkmanirecemerick: Anyway, the part about representing the board as a simple collection of live cells is completely obvious to me now.
14:32TimMcchouser: You know that blog.n01se.net is marked as an attack page in Firefox?
14:32wkmanirecemerick: But I probably would never have thought about it with the book pointing it out.
14:32patchworkSo I just want to have a lein terminal running that I can execute lein tasks in… anything else out there for that?
14:33cemerickwkmanire: then you have reached enlightenment. Or something. :-)
14:33wkmanirelol
14:33cemerickThe maze generation is the real killer IMO.
14:33muhooapparently there's this workaround, but me no like; (binding [*print-level* 2] (pprint ...
14:33muhooheh, even that doesn't work
14:34tibaldshillings#python
14:34wkmanirecemerick: That is going to be fun for sure.
14:35technomancycemerick: it's funny how different people react to this drawbridge article
14:35_KY_How can I force the first element of a lazy sequence to be evaluated?
14:35technomancycemerick: the ruby people are all "holy crap; that's sweet" and the clojure people are all "man, it's about time!"
14:36muhooi thought drawbridge had been around for a while now
14:36muhoogreat tutorial btw
14:36technomancythanks =)
14:36mdeboarddrawbridge?
14:36mdeboardtutorial?
14:36clojurebotleiningen tutorial is at http://github.com/technomancy/leiningen/blob/master/TUTORIAL.md
14:36mdeboardIRC?
14:36clojurebotirc is only for opionfests
14:36mdeboardwhere am I
14:37muhooopion?
14:37technomancymuhoo: it's been maybe a month, but I just mean that you haven't been able to get a REPL in a live web dyno on Heroku until recently
14:37technomancy"where's my swank?" has been near the top of the list of complaints since we started offering Clojure
14:38technomancymdeboard: https://devcenter.heroku.com/articles/debugging-clojure
14:38technomancyI should post that to the Clojure list
14:38mdeboardorite, neat
14:38muhoothat'd be a good place for it
14:39amalloy_KY_: just call seq on it
14:40mdeboard(defn if-you-like-it-then-you-should-have-put-a-seq-on-it [coll] (seq (first coll)))
14:41foxdonutdrawbridge?
14:41technomancyfoxdonut: see the devcenter link above
14:41dnolenCLJS users, any thoughts about this ticket? http://dev.clojure.org/jira/browse/CLJS-180
14:42foxdonuttechnomancy: thanks, couldn't tell from the link that it was drawbridge.
14:45cemericktechnomancy: is this happening publicly?
14:46chouserTimMc: *sigh* I did not. Thanks.
14:48technomancycemerick: sorta: https://mobile.twitter.com/rwdaigle/status/198241118629007361
14:49cemerickoh, sure
14:49cemerickhe's "ruby people" then?
14:50cemericktechnomancy: I'm going to amend your comment for twitter purposes :-P
14:50Raynesdnolen: Didn't I report that issue a long time ago?
14:51technomancysure thing =)
14:51wkmanireTime to go do boring crap. *grumble*
14:51wkmanireLater fellas.
14:56muhooi am trying to use zippers with defrecord to represent a recursive tree of categories, and i'm lost
14:57muhooi started with this: http://tech.puredanger.com/2010/10/22/zippers-with-records-in-clojure/
14:58muhooi ended up with this https://refheap.com/paste/2550
14:59dnolenRaynes: I never saw that ticket
15:00Raynesdnolen: It might have been slightly different, and I think my case was fixed so the ticket was probably closed. We talked about it, but it was ages ago.
15:00amalloyi think Raynes is referring to his ticket about top-level namespaces being shadowed by functions, not function arguments
15:00RaynesRight.
15:02rednovaeis there a clojure interpter, like clj, that uses something like readline so when i hit UP i get the previous command?
15:02dnolenamalloy: Raynes: oh right. This one is a bit trickier (or simpler)
15:02TimMcrednovae: You mean a REPL?
15:02rednovaeTimMc <- 3 minutes of clojure experience, so... maybe?
15:02amalloyinstall leiningen
15:02yoklovrednovae: try lein repl
15:03happy4crazyrednovae: you could use rlwrap
15:03rednovaeok
15:03TimMcrednovae: Is "clj" a shell script that launches Clojure? Don't do that.
15:03RaynesGuys.
15:03ibdknoxdnolen: I don't think you can gensym the param names
15:03RaynesJust say "install leiningen".
15:03dnolenibdknox: why not?
15:03RaynesIt is no more difficult or interesting than that.
15:03RaynesDon't berate or confuse the poor guy.
15:04amalloybut +1 for using rlwrap on similar problems, for when you don't have an option as cool as lein
15:04rednovaeinstall leiningen
15:04RaynesIndeed.
15:04rednovaeoh man i am in deep now
15:04Rayneshttps://github.com/technomancy/leiningen
15:04TimMcRaynes: You would have me not be pedantic? o\__/o
15:04ibdknoxdnolen: hm, I take that back. I was thinking there might be weird ambiguities with things like "name"
15:05dnolenibdknox: it is kinda gross I admit that.
15:05ibdknoxdnolen: where it's also shadowing functions in the NS or whatnot, but I guess that isn't ambiguous
15:05dnolenibdknox: but I'm not sure how else we could prevent clashes.
15:06ibdknoxdnolen: sucks for looking at the generated code
15:06amalloyyou could gensym the namespaces instead
15:06ibdknoxdnolen: I'm trying to think of that makes some of the things I'm doing harder, since the names will get munged
15:06ibdknoxit*
15:06ibdknoxgrr
15:06ibdknoxif*
15:07RaynesWe've all had those days.
15:07cemerickibdknox: man, interviews and everything? Don't forget about us peons now that you've made it big. ;-P
15:07ibdknoxlol
15:07ibdknoxthere should be another one in the next .net magazine :)
15:08rednovaeok i'm going to leiningen it up
15:08dnolenibdknox: k I'm convinced we should do the hard thing. I guess advanced compilation makes this less of an issue when dealing with external libs that aren't compiled w/ GClosure.
15:08Raynescemerick: Yeah, dude, I wish he would have asked me for server space so I could sue him later for not considering me a founder… or… or whatever the hell happened in that facebook movie.
15:08ibdknoxhaha
15:08ibdknoxspeaking of servers.. I should've used smaller images
15:08muhooRaynes: you'd need to wear a suit to do that
15:08ibdknoxI server over half a terabyte off of S3
15:09ibdknoxserved
15:09ibdknoxturns out that has moderate cost lol
15:10muhooall i can say is, i hope noir has a bus factor > 1
15:10dnolenibdknox: so we'll warn on clashes, leave param names alone. Fixing CLJS-180 will depend on fixing the analysis order issue first.
15:11ibdknoxdnolen: analysis order?
15:11yoklovdnolen: couldn't you gensym the param names only if there's a clash?
15:11dnolenibdknox: it's pretty random at the moment.
15:11ibdknoxmm
15:11muhoobecause the startup bus is coming :-)
15:11dnolenibdknox: analysis doesn't follow requires / uses
15:11ibdknoxdnolen: ah, yes.
15:12dnolenibdknox: once we do that then we can accurately warn about param name clashes with namespaces
15:12jonasendnolen: this doesn't happen with let, right? (let [foo 1] (x/bar)) should work?
15:12ibdknoxmuhoo: lol, yeah ideally someone will take an interest in helping with a couple of my libs
15:12dnolenjonasen: dunno, you should test.
15:13ibdknoxlets get gensymed
15:13ibdknoxin cljs
15:13ibdknoxnot in CLJ
15:13ibdknoxwhich is wicked confusing
15:13yoklovyeah, never seen lets not get gensymmed
15:14ibdknoxit's a "cleaner" solution to the (let [foo 1 foo (inc foo)] ..) mess I guess
15:14TimMcIs there any support in CLJS or some CLJS lib for streaming a seq of data from the server to the client?
15:15TimMcThat would be killer.
15:15ibdknoxlike over websockets?
15:16Borkdudeibdknox: btw, my question was just out of curiosity, not out of criticism
15:16ibdknoxBorkdude: totally missed your question
15:16ibdknoxah
15:16ibdknoxfound it
15:16Borkdudeibdknox: question was, what gain is in it for companies investing largely in your product?
15:16RaynesBorkdude: I saw you using cljbin recently. Damned traitor, you.
15:17ibdknoxBorkdude: honestly, it's a gamble. Let's say I manage to pull this off and it ends up big. You would want your company's name attached to it
15:17BorkdudeRaynes: I am a hedonist. I use whatever comes my way ;).
15:17TimMcibdknox: And they get an IDE.
15:17ibdknoxFor others it's about introducing a new platform where they can try to come out as the "leaders" on it
15:17ibdknoxand as TimMc just said, many of them actually just want the thing
15:18Raynesibdknox: When you've got a second, I'd like to talk over something I'm doing with you and see what you think.
15:18mdeboard15:07 <ibdknox> For others it's about introducing a new platform where they can try to come out as the "leaders" on it <---- this will make it easier for them to attract top candidates as well
15:18ibdknoxIt's one of those pascal's wager moments
15:18Borkdudeibdknox: do you think Jetbrains would be interested to invest in it?
15:18ibdknoxno idea
15:19ibdknoxI worked with those guys a bit at MSFT
15:19felideonthey make some nice tools for .NET ppl
15:19felideonerr
15:19felideonsry copy paste
15:20Borkdudefelideon: actually Jetbrains have made smth nice for .NET too, although I never used it (Resharper)
15:20felideonUp Arrow + Enter rather
15:20ibdknoxI still haven't heard from any of the major players yet :)
15:20ibdknoxThat'll be when things get interesting
15:20muhoook i almost got it working https://refheap.com/paste/2555 the only problem is that trying to access empty leafs casues an NPE
15:21mattrepla set! on a :volatile-mutable or :unsychronized-mutable field in a deftype method should work when inside a (locking this &body) form, right? I am seeing it work fine outside of a locking form, but ObjExpr throws an exception about the LocalBinding not being mutable.
15:21felideonBorkdude: right. actually i almost confused them.
15:21felideonglad i'm not in 'that world' anymore :)
15:22ibdknoxBorkdude: felideon: as I recall resharper is the most commonly used VS plugin
15:22BorkdudeI had to use Python, and after trying several IDEs I sort of liked Pycharm (Jetbrains) the best
15:22felideonyeah it probably is.
15:23technomancyhttp://news.ycombinator.com/item?id=3929789
15:24mdeboardI've been watching a coworker who's new to Python development using WingIDE and it just looks awkward as shit.
15:24Borkdudeibdknox: I'm curious about what kinds of refactoring options Light Table will support for clojure, I didn't see anything related to that in the video
15:24ibdknoxtechnomancy: never post the direct link
15:24ibdknoxtechnomancy: that's how you get ringed
15:24technomancyibdknox: oh dang
15:24jonasendnolen: I think we should gensym {:name (munge name)} here: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/compiler.clj#L925
15:24ibdknoxBorkdude: no idea yet :)
15:24felideonlispers need no refactoring tool non-sense!
15:24technomancyibdknox: you've been doing this longer than I have apparently =)
15:25mdeboardOh, huh
15:25mdeboardThat sucks.
15:25Borkdudefelideon: an example of 5 mins ago: I decided to use require instead of use, with an alias, so I had to manually prefix the alias… could this be automated?
15:25dnolenjonasen: I think we should avoid gensym'ing for now - unless somebody gives us a source map patch.
15:26dnolenjonasen: CLJS-180 ticket updates pointing to new ticket - fixing require / use analysis order would make warning on clashes pretty easy.
15:26felideonBorkdude: sounds like a sed one-liner
15:26Borkdudefelideon: sed doesn't have any namespace intelligence
15:27technomancyBorkdude: slamhound automates that
15:27BorkdudeRaynes: I'm going to try refheap now
15:27mdeboardlol I love your project names
15:28RaynesBorkdude: It will eventually have cljbin's evaluation feature (only betters).
15:28S11001001technomancy: it's a whole-source transformer now?
15:28RaynesBorkdude: But I will not break your face for using cljbin in the meantime if you like that sort of thing.
15:28BorkdudeRaynes: ah, that's what I like about cljbin, so good
15:28mdeboardholy Ffffffff
15:28mdeboard@ slamhound
15:28felideontechnomancy: that's kinda cool
15:28technomancyS11001001: oh, no I just misread what he said
15:28technomancyS11001001: some day though
15:28jonasendnolen: Is a warning good enough?
15:28technomancyif it's implemented as a logic program, you could run it forwards or backwards
15:29BorkdudeI will check out slamhound now… and see if it worth a "sweet!" or "about time…"
15:29technomancyBorkdude: more like, "this will be nice once it's finished..." =)
15:29dnolenjonasen: probably not - gensym the specific clashing parameter.
15:29technomancyhopefully
15:30Borkdudetechnomancy: as I read the README, it can fix ns declarations, but can it fix code that needs alias prefixing?
15:30Borkdudetechnomancy: once it's finished.. ;)
15:31technomancyBorkdude: well that would be more like once it's completely rewritten and transformed into a logic program; I misread your original question
15:32Borkdude"extract macro" would be a nice refactoring
15:32gfredericksdoes it remove unneeded requires?
15:32technomancygfredericks: unneeded :require/:as
15:33technomancyit won't work if you need a require and use a fully-qualified reference
15:33felideonBorkdude: i dont get what's so hard about s|foo|x/foo| or whatever
15:34felideonhow many symbols do you need to replace
15:34Borkdudefelideon: not so many, but let me show you… wait a minute
15:36michaelbartonWhat's the correct way to insert a map function into a (-> ...) pipeline?
15:37jonaskoelkerwhat's the syntax for variable arity function definitions?
15:37chousermichaelbarton: there's no right way. You could use ->> instead, but if you find yourself fighting either one, it's probably better just to use let
15:38Borkdudefelideon: https://github.com/Borkdude/tictactoe/commit/d5fa8427d9891f6765807ef456b666aa7111f05a test/tictactoe/test/models/model.clj
15:38jonaskoelkermichaelbarton: I'm not sure I understand your question, but (-> somelist (partial (map my-function)) ...) ?
15:39chouserjonaskoelker: you can have multiple fn bodies, each with a different arity (defn f ([a] (prn a)) ([a b] (prn a b)))
15:39chouserjonaskoelker: that partial will receive somelist as it's first arg, so probably not what you want.
15:39brehautjonaskoelker: (partial somelist (map … probably wont do what you want
15:39Borkdudefelideon: I had to type the prefix nine times
15:40Borkdudefelideon: and it is error prone
15:40felideonyour poor fingers!
15:40chouserjonaskoelker: for varargs, your arg vector can look like [a b & args] in which case args will be nil or a lazy seq
15:40michaelbartonI have (-> (first *command-line-args*) reader line-seq)) and I'd like to do some mapping and filtering on this.?
15:40chousermichaelbarton: ->> should work for that
15:40felideonBorkdude: that link didnt work
15:40michaelbartonOk
15:41michaelbartonWhat is the difference between the two?
15:41Borkdudefelideon: it was a link, then a space and then a file name
15:41mattreplyup, there's a bug where try forms don't know about the deftype fields and thus ObjExpr#isMutable returns true and compilation fails
15:41Borkdudefelideon: so not a link with a space in it
15:41felideonBorkdude: ah k
15:41chouser->> puts each expr as the *last* arg of the next expr, instead of the *first*
15:41michaelbartonI see
15:41michaelbartonThank you
15:42michaelbartonI will try that.
15:42jonaskoelkerbrehaut: that would be a good point :)
15:42chouserso something like (-> (first *cla*) (reader ,,,) (line-seq ,,,) (map #(do-foo %) ,,,))
15:42felideonBorkdude: yeah so, if you had to do this accross thousands of lines of code, a simple script would have done fine
15:42jonaskoelkerchouser: the first one is exactly what I want. Thank you :)
15:42chouser...to use the notation Fogus put in the book
15:42chouserjonaskoelker: yw
15:43Borkdudefelideon: how does the script now what symbols need prefixing?
15:43Borkdudeknow
15:43felideonyou give it the list.
15:43Borkdudefelideon: I'm too lazy to make the list. ok ok...
15:43felideonyeah i mean comon, you're a programmer. God forbid you have to type.
15:43felideon^_^
15:43jonaskoelker:D
15:43Borkdude=)
15:44jonaskoelkerit didn't say "typist" on the job offer
15:44brehautwheres tavis rudd when someone delivers a line like that
15:44amalloychouser: you accidentally used -> instead of ->>
15:45amalloymaking the commas not line up with reality
15:45michaelbartonThat
15:45michaelbartonThat
15:45michaelbartonThat's great.
15:45michaelbartonJust what I was looking for.
15:46michaelbartonThank you.
15:47nollidjanyone here start a new incanter project (with incanter 1.2.2) lately? i've just created a project.clj and tried to "lein deps" it with leiningen 1.7.1, and lein is complaining that it can't find clojure-contrib 1.2.0-master-SNAPSHOT. sounds to me like incanter really needs updating, but repo.incanter.org says 1.2.2 is the latest stable release.
15:49tomojnollidj: 1.3.0 appears to be released
15:49nollidjah, i'll try updating. thanks.
15:50ralfonsodid lein interactive disappear in lein2? I'm looking for a way to speed up test runs.
15:52nollidjtomoj: did you look at clojars directly to find that out, or are you looking at an incanter project page i haven't found?
15:52pandeirois there any way that cljs.reader/read-string would be able to work with html-escaped data?
15:53tomojclojars
15:53amalloypandeiro: ...un-html-escape it first?
16:00chouseramalloy: gah. thanks.
16:21pandeirohow can i deal with the :body element of a ring-request when i am serializing/deserializing between clj and cljs?
16:24gtrakbody's a bytearray, right? I bet you could convert it to a string?
16:25pandeirogtrak: it's one of these: #<Input org.mortbay.jetty.HttpParser$Input@5b506da4>
16:25mefestobody is an InputStream which can be put in a string easily like gtrak says
16:26gtrakhttp://jetty.codehaus.org/jetty/jetty-6/apidocs/org/mortbay/jetty/HttpParser.Input.html
16:26gtrakextends InputStream
16:27mefesto,(doc slurp)
16:27clojurebot"([f & opts]); Opens a reader on f and reads all its contents, returning a string. See clojure.java.io/reader for a complete list of supported arguments."
16:29mefestopandeiro: try (slurp (:body request))
16:30pandeiromefesto: great thanks.. is there an assoc-like fn that will convert :body to (slurp ...) in place?
16:31gtrakyou can make a middleware that adds a :body-str attribute?
16:32mefestopandeiro: i like gtrak's approach better
16:32gtrakor does it in place, not sure if that's considered clean
16:32mefestopandeiro: but update-in might do it
16:33pandeiroupdate-in is it, perfect
16:33beffbernardIf I'm to upgrade to lein2, is there anything special I need to do in my project.clj so emacs/swank-clojure/clojure-jack-in jive together?
16:34pandeirogtrak: i am doing this in middleware, conj'ing each request to an atom that i can inspect from the browser to make debugging a little nicer
16:39nDuffI'm playing around with field reflection, and have an object which clojure, at the REPL, simply prints as "int". (type that-thing) returns java.lang.Class... what _is_ it?
16:40patchworkHmmm, jark server install fails because it cannot verify github's certificate?
16:40patchworkwhat is that about?
16:41amalloynDuff: int.class
16:42amalloythe Class object representing the JVM primitive type "int"
16:43nDuffamalloy: ...what's the canonical way to refer to that class in Clojure?
16:43amalloy&Integer/TYPE
16:43lazybot⇒ int
16:44nDuffgraci
16:47gfredericks&(prn Integer/TYPE)
16:47lazybot⇒ int nil
16:47technomancybeffbernard: you just need to declare lein-swank as a user-level plugin in ~/.lein/profiles.clj
16:47technomancyI think it's covered in the swank readme
16:52beffbernardtechnomancy: swank readme or lein wiki?
16:52beffbernardlike this? {:user {:plugins [[lein-swank "1.4.4"]]} ; ~/.lein/profiles.clj
16:53technomancyyeah
16:55beffbernardIf I want to use the name lein2 instead of lein.. Do I (setq clojure-swank-command "lein2 jack-in %s") ?
16:55technomancythat should do the trick
16:56mebaran151if I concat two map statements (say they both map over results from a REST API that they have to GET), will the second map statement evaluate its arguments immediately or only when I exhaust the list from the first call to map
16:56ieureIs there a convenient way to decompile things in Clojure?
16:56ieuree.g.
16:56ieureI want to load up a class which I didn't write and dump its bytecode in the repl
16:59beffbernardtechnomancy: perfect
17:02aaelonywhat's the best way to provide a file chooser via clojurescript? I'm googling around without much success...
17:04gfredericksaaelony: like the regular built-in browser upload form?
17:04aaelonygfredericks: exactly, yes.
17:05dnolenbrainproxy: I'm assuming your Michael Bradley? Mind not spamming the #clojurescript Twitter stream with turbonode? :)
17:05gfredericksaaelony: isn't that just [:input {:type "file"}]? or something close to that?
17:06aaelonygfredericks: thanks! I'll try that. Just learning... :)
17:06gfredericksoh no prob
17:08dnolenmmarczyk: ping
17:08mmarczykdnolen: pong
17:09aaelonygfredericks: that's amazing. Works like a charm. :)
17:09dnolenmmarczyk: how much are you planning on digging into CLJS-235?
17:09gfredericksis there a standard clojure/java mechanims for running some code X seconds later without hogging a thread the whole time?
17:10aaelonydelay ??
17:10lazybotaaelony: What are you, crazy? Of course not!
17:10aaelonyfunny
17:10mmarczykdnolen: well, so far I've got a patch with replacement first / rest that seems to be a clear win in the ISeq case
17:10gfredericksaaelony: if you mean the clojure function, that's not what I'm talking about
17:10aaelonyok
17:10mmarczykdnolen: could post that on the ticket with some cleanup and a proper commit message, actually
17:10Chousukegfredericks: there's probably a java api for that
17:11mmarczykdnolen: and apart from that -- a preliminary bit-and-based version of satisfies? which doesn't seem to be a win on node, so needs work
17:12dnolenmmarczyk: go ahead and do that if you have a second - I'm thinking about starting branch called rt-cljs where we can do this work.
17:12gfredericksChousuke: ooh, java.util.Timer
17:12mmarczykdnolen: ok
17:13dnolenmmarczyk: thx!
17:13mmarczykdnolen: as for your actual question, which time frame did you have in mind? I'll probably need to go a little slower over the weekend, but that seems to be the most promising direction of cljs work, so I'd like to dig quit a lot eventually
17:14mmarczyk^dig into it
17:14brainproxydnolen: yes ... wasn't aware it was spamming it
17:14brainproxy???
17:14lazybotbrainproxy: How could that be wrong?
17:14dnolenmmarczyk: yes that's why I'm suggesting a branch for this work instead of ticket.
17:14mmarczykdnolen: ah, right
17:14mmarczykok, making the patch now, be back in a sec
17:15brainproxydnolen: is their a bot or something keying on mentions of clojurescript?
17:16dnolenbrainproxy: http://twitter.com/#!/search/realtime/clojurescript
17:16hiredmangfredericks: :(
17:16brainproxydnolen: okay, i've turned off the github hook that posts to my dev stream
17:16dnolenbrainproxy: thanks much
17:16hiredmangfredericks: you mean you need to use a scheduledthreadpoolexecutor
17:16brainproxydnolen: sure thing, didn't realize it would cause a problem
17:16hiredmanhttp://stackoverflow.com/questions/409932/java-timer-vs-executorservice
17:16Chousukethe kingdom of nouns :P
17:16gfrederickshiredman: aw crap
17:17cemerickgfredericks: if you're ever going outside of java.util.concurrent for…concurrency stuff…your spidey sense should tingle. :-)
17:17brainproxydnolen: btw, I realized I was being a dummy .. the bootstrap and compile scripts in clojure-clojurescript/script/ were all I needed to use as part of my npm postinstall routines, rather than keeping my own copy of clojure sources and whatnot checked-in
17:17hiredmanhttps://github.com/hiredman/clojurebot/blob/master/src/hiredman/schedule.clj
17:17hiredmandecentish, but not great
17:18dnolenbrainproxy: so things are working for you now?
17:18brainproxydnolen: sort of ... add-dependencies is working, but optimize is complaining about a null pointer
17:18brainproxyand I don't want stuff to go to disk, just want the whole string in memory ... I'll figure it out
17:18brainproxyanyway, getting much closer :)
17:19hiredmanideally you'd want a scheduled thread pool on top of clojure's existing threadpools
17:21mmarczykdnolen: just posted the patch -- NB. I've skipped the second nil check (after calling seq in the non-ISeq case)
17:21gfredericksburgle...
17:22dnolenmmarczyk: the mask patch isn't based on master tho right?
17:22mmarczykdnolen: ah, no
17:22dnolenmmarczyk: I still see the hasOwnProperty test.
17:22mmarczykdnolen: yeah, that's the WIP patch -- out of date
17:23mmarczykdnolen: the first / rest patch seems like a win for ISeqs even with the current satisfies -- > 20 ms -> ~15 ms for first / rest on lists
17:24dnolenmmarczyk: yeah makes sense.
17:26solussdcan I use #_ yet? ::D
17:26solussderr
17:26solussd#=
17:27dnolenmmarczyk: I've created a rt-cljs branch in my fork, if you track we can stay in sync.
17:27mmarczykdnolen: yeah, I've noticed -- will track
17:30dnolenmmarczyk: so I take the satisfies? work is flux so you can't make a patch?
17:30dnolenis in flux
17:31mmarczykdnolen: hm, yeah, atm -- but I can probably polish it a bit so you can take it for a test ride tonight
17:31dnolenmmarczyk: please do, I'll apply that to rt-cljs.
17:32gfredericksyou guys are so dang productive
17:32mmarczykdnolen: ok, will do that in an hour or two I guess -- got to go away for a moment now
17:32cbp`hello, is there like a for where the sequences are traversed in parallel
17:33dnolenmmarczyk: great, thx!
17:33gfrederickscbp`: like ##(map vector (range) [:foo :bar :baz] "hahaha foo") ?
17:33lazybot⇒ ([0 :foo \h] [1 :bar \a] [2 :baz \h])
17:34dnolenyoklov: haha, your latest project sounds fun.
17:35cbp`yes
17:35gfrederickshiredman: thanks for the example, that helped
17:35yoklovdnolen: haha, thanks, it's been quite fun so far
17:35cbp`but i want to bind it to a symbol
17:36gfrederickscbp`: you can use that within for
17:36gfredericks&(for [[a b c] (map vector (range) [:foo :bar :baz] "hahaha foo")] {:a a :b b :see c})
17:36lazybot⇒ ({:a 0, :b :foo, :see \h} {:a 1, :b :bar, :see \a} {:a 2, :b :baz, :see \h})
17:37cbp`oh ok
17:37cbp`thanks
17:42mebaran151is flatten lazy?
17:42gfredericks$source flatten
17:42lazybotflatten is http://is.gd/WWBDNQ
17:43hiredman~flatten
17:43clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
17:43mebaran151I'm actually looking for mapcat
17:44gfredericksmebaran151: flatten looks lazy
17:45amalloyin the sense that if you use it, it's because you were too lazy to find the right function?
17:45amalloy(but yes, it is lazy)
17:46mebaran151hiredma pointed me to mapcat, which was exactly what I needed
17:46amalloyclojurebot: high five!
17:46clojurebotIt's greek to me.
17:57mmarczykdnolen: just realized that I could post a patch for satisfies? using the general approach of the original WIP patch (no partitions yet) but with your improvements to satisfies? in place -- so that's attached to the ticket now -- next up, partitions-based patch
17:57dnolenmmarczyk: great thanks.
17:57mmarczykok, bbl
18:00nDuffWhat am I doing wrong when trying to use (into {} (partition 2 [:a :b :c :d]))?
18:02gfredericks&(into {} (partition 2 [:a :b
18:02gfredericks :c :d]))
18:02lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
18:02gfredericks(into {} (partition 2 [:a :b :c :d]))
18:02gfrederickspaste fail
18:02gfredericks&(into {} (partition 2 [:a :b :c :d]))
18:02lazybotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
18:02gfredericks&(partition 2 [:a :b :c :d])
18:02lazybot⇒ ((:a :b) (:c :d))
18:03gfredericks&(into {} [[:a :b] [:c :d]])
18:03lazybot⇒ {:a :b, :c :d}
18:03gfredericks&(into {} ['(:a :b) '(:c :d)])
18:03lazybotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
18:03gfredericks&(into {} (map vec (partition 2 [:a :b :c :d])))
18:03lazybot⇒ {:a :b, :c :d}
18:03gfrederickshm
18:04gfredericksI can't think of why it would act that way
18:04gfredericksbut apparently it likes vectors
18:04amalloygfredericks: conj on maps has a stupid contract
18:05gfrederickswelp. there you go.
18:05gfredericksit is stupid because a slightly lower-level thing is stupid.
18:06amalloyand of course it's an implicit contract, which you can only figure out by reading the source
18:06gfredericksit is hard to write good software.
18:07yoklovthat's not a bug?
18:07gfredericks&(conj {} '(3 4))
18:07lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry
18:08gfredericksyoklov: do you know of any docs saying ^that should work?
18:09yoklovno, but it seems like it should i guess
18:09yoklovregardless you can still do
18:09yoklov,(apply hashmap [:a :b :c :d])
18:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: hashmap in this context, compiling:(NO_SOURCE_PATH:0)>
18:09yoklov:(
18:09gfredericksoh I forget about that one
18:10yoklov,(apply hash-map '(:a :b :c :d))
18:10clojurebot{:a :b, :c :d}
18:10yoklovnDuff: you can go about it that way
18:11nDuffAhh; graci
18:58cbp`ughhh traversing vectors so different from other languages
18:58cbp`i'm so confused
18:59cbp`can't recur from inside doseq/for right
19:00wkmanirecbp`: One of the things I'm learning is that a lot of the time where you would want to traverse a vector in an imperative language, in clojure you really just want to map it or reduce it.
19:00wkmanireBasically perform some kind of transformation on the data
19:00wkmanireThe other day I was using nth for example where I ended up being able to use destructuring.
19:01technomancyjustified uses of loop/recur are very rare
19:01cbp`say if i'm traversing a vector of vectors and for every "special" value i find i need to do something to the rest of the matrix can i do that with maps/filters/etc
19:02antares_cbp`: you certainly can filter out "special" entries and do something with them. Do you need to modify the coll?
19:02dnolenmmarczyk: ping
19:02kovasb__cbp`: the function way to do it is to first find all the special values (maybe including their position)
19:03kovasb__cbp`: and then do the needed transformation
19:03kovasb__cbp`: with another function
19:03kovasb__cbp`: if you are more specific in the transformation you want to do, maybe theres another approach
19:03cbp`basically im
19:04cbp`have you played the board game connect four
19:04kovasb__nope :)
19:04cbp`imagine you can turn it 90 degrees so that the pieces fall to the side
19:04jodaropretty sneaky sis!
19:04cbp`well you drop pieces on stacks
19:05cbp`so basically im representing that with a vector of vectors and rotating and then making the pieces "fall" to the ground
19:06wkmanirecbp`: I read a really interesting article today in Cemerick's book about representing Conway's game of life different.
19:06wkmanireIt is one of thos vector intensive type problems in most languages.
19:06wkmanireInstead, Cemerick represents the game board as a collection of tuples of live cells.
19:06wkmanireInstead of using a vector of vectors.
19:07wkmanireThe final solution ended up being very elegant. I wonder if you could take the same approach.
19:07cbp`well maybe
19:07cbp`its just that i need to wrap my head around this really fast because its for a timed contest
19:07wkmaniremyBoard == ([1 1] [2 2]) ;; I have pieces at 1,1 and 2,2.
19:07cbp`and i understand the problem in terms of matrices very easily and can do it very easily in python
19:07kovasb__cbp`: ive done stuff like that, it just write a function to identify the positions of the places of interest
19:08kovasb__cbp`: and then feed that into another function that takes the current state, those positions, and gives the new state
19:08emezeskecbp`: In your vector of vectors, are the inner fectors columns or rows?
19:10cbp`its something very literally like this:
19:10cbp`[[. . .]
19:10cbp` [. x .]
19:10cbp` [x x x]
19:10cbp` [x x x]]
19:10cbp`so i rotate and it should give this:
19:10cbp`[[. . .]
19:10cbp` [x x .]
19:10cbp` [x x .]
19:10cbp` [x x x]
19:11cbp`uhm assume its square and top row doesnt exist ^^
19:11emezeskecbp`: understood
19:11emezeskecbp`: Given the nature of the game, where gravity affects columns, I might suggest making the inner vectors columns
19:12emezeskecbp`: Then you could do something like (map apply-gravity matrix)
19:12cbp`yeah i guess thanks
19:13amalloyemezeske: i don't think that matters much, because when you rotate the board it "switches"
19:13amalloyso if you used row-major format, you could apply-gravity then transpose, and in column-major you could transpose then apply-gravity
19:13emezeskeYeah that's true
19:14emezeskeMakes more sense to me to rotate and then apply gravity, though, although it really doesn't matter
19:14jayunit100hi guys -> this method has a weird siganture : http://pastebin.com/raw.php?i=4AW2j1Ad.
19:14amalloyyeah, and when you're not actively rotating it's probably better to go column-major
19:15emezeskecbp`: Another hint: something like this might be useful for apply-gravity (concat (repeat 3 "x") (repeat 1 "."))
19:15amalloyactually, perhaps it's best to have a board like [[a b c] [d e f] [g h i]], where a is the bottom-left and c is the top-left?
19:15amalloyie, column-major but bottom-first? it seems like that helps somehow
19:16emezeskeamalloy: I could see that making the gravity reduce easier maybe?
19:16amalloyright
19:16amalloyi'm not sure how, but it feels like it will
19:16emezeskeI'd probably just go quick & easy and just count the chips, and do the concat repeat thing I pasted above
19:16emezeskeNot very elegant though
19:17amalloy(defn apply-gravity [column] (apply concat ((juxt filter remove) piece? column)))
19:18emezeskeNice!
19:18emezeskeI love juxt...
19:18cbp`don't need elegant =p need something i can think up and implement in 10 minutes
19:22jayunit100rephrase question :) -> how can you have a defn with 2 [] []s after it ? I've never seen such syntax before.
19:23emezeskejayunit100: The first [] specifies the arguments, the second [] is the body of the function
19:23cbp`returns empty vector?
19:23emezeskejayunit100: In other words, the function returns a vector
19:23jayunit100Oh i guess the ( is only needed if we want to eval.
19:23emezeskejayunit100: (defn [] [1 2 3]) would be like (defn [] (vector 1 2 3))
19:24jayunit100aha yup/ not thinking very clojurely. my bad been in java ee world all day 2day
19:24emezeske:)
19:29dnolenmuahahaha
19:30dnolenCLJS satisfies? call is faster than JS instanceof on V8
19:30amalloynice
19:34wkmanireAlas, my time has not yet come.
19:34emezeskednolen: That's just ridiculous
19:34amalloydnolen: was satisfies? using instanceof before? i didn't think js had multiple inheritance, and you were just looking up some method with a funky name in the prototype
19:35dnolenamalloy: satisifes? was looking up the prototype chain before.
19:36dnolenemezeske: amalloy: >2X faster :D
19:36dreishp3i.P3i cannot be cast to p3i.P3i [Thrown class java.lang.ClassCastException]. Oooooookay ...
19:36dnolenthan instanceof
19:36dnolen>10X faster than old satisfies?
19:36ibdknoxdnolen: Good work!
19:37dnolenibdknox: yes this is big.
19:37amalloydoes satisfies? actually end up getting used at all? shouldn't most of those tests wind up being polymorphic dispatch?
19:37wkmanirednolen: I totally misread your first statement.
19:38dnolenamalloy: polymorphic dispatch is relatively slow
19:38dnolenamalloy: we want to test membership to avoid hitting protocols when possible.
19:38wkmanireI thought "CLSJ satisfies?" was a proposition. Didn't realize you were refering to a function.
19:38ibdknoxlol
19:38dnolenwkmanire: satisifes? is actually a macro ;0
19:39dnolenoops
19:40wkmanireI like having punctuation be valid in symbol names, but sometimes I get hung up on it when I'm reading.
19:40amalloyoh i see. so you can actually expand to the bit-test at compile time
19:40wkmanireMy internal syntax parser wants to reverify it several times.
19:40dnolenamalloy: yep
19:40dreishI think I might have found it, in case anyone saw my confounding error message above. After recompiling p3i.clj (which has a defrecord P3i), I needed to redo (import 'p3i.P3i) at the repl.
19:40dnolenamalloy: satisfies? is not a function call - never was.
19:40amalloydnolen: is it really a macro, or a function with a compiler-macro around it? i can imagine wanting to do like (filter (partial satisfies? Counted) ...)
19:41dnolenamalloy: satisfies? won't be a function anytime soon.
19:42scottjlein question: do :jvm-opts of dependencies apply or just the main project.clj?
19:42hiredmandnolen: maybe a canidate for something like definline ?
19:42amalloyis there a reason for that? it seems like a level of dynamism that there's no reason to reject
19:43dnolenhiredman: well CLJS doesn't have definline
19:43amalloyit has compiler macros though, right?
19:43hiredmanyou can't just lift the definline macro from core.clj?
19:43dnolenamalloy: yes
19:44dnolenhiredman: there's no need with compiler macros really.
19:44dnolenamalloy: now that I think about - now that protocol mask exists, yes satisfies can be function :)
19:44hiredmandnolen: if you want something to be like a macro and like a function?
19:45dnolenhiredman: define the function, define the compiler macro w/ the same name.
19:45hiredmanah
19:55muhoothis is where not having a cs degree is a huge limitation for me, but, how would i walk a tree and get a list of the parents for each leaf node? functionally (i know how to do it imperatively, easily)
19:56mmarczykdnolen: pong
19:56wkmaniremuhoo: Still working on your new category structure?
19:56muhooya, that one
19:57dnolenmmarczyk: so bit mask protocol test is fast - very, very fast :)
19:57wkmanireDo you want just the parents? Or you do you want the leaf and it's parents?
19:57mmarczykdnolen: hah! great :-)
19:57mmarczykdnolen: do you mean my WIP patch or did you write another impl?
19:57muhoowhat i ultimately want is a structure like [leaf [parent grandparent greatgrandparent]]
19:58wkmanireSo you want the whole branch from root to leaf.
19:58muhoofor each of the leaves, yes
19:58muhoopostwalk is great, but i haven't figured out how to SAVE the values, without resorting to atoms and such
19:58gfredericksmuhoo: I think it'd be pretty simple to define recursively
19:59wkmaniremuhoo: Whatever you end up doing to solve this, I'd like to see the solution if you don't mind.
19:59dnolenmmarczyk: there a couple problems
19:59muhoosure thing, it'd be a nice generic library thing
19:59dnolenmmarczyk: bool type inference needed fixing
19:59wkmanireMy puny FP brain sais create a seq out of the branch and then flatten it to an array.
19:59gfredericks(fn parents-map [tree] (if (leaf? tree) {tree []} ...))
19:59wkmanirerather, a vector.
19:59wkmaniresays*
19:59dnolenmmarczyk: needed a bit-and that won't trigger truth test
19:59dnolenmmarczyk: and needed an or around bit test and prototype chain lookup
20:00dnolen"there were a couple of problems" I mean.
20:00mmarczykdnolen: right
20:00muhoogfredericks: where's the leaf? function?
20:00clojurebotfunctions are maps
20:00mmarczykdnolen: oh, so you got around the truth_ in satisfies? then?
20:00mmarczykdnolen: fantastic :-)
20:00dnolenmmarczyk: no truth_ in satisfies? anymore
20:00mmarczykdnolen: :-D
20:00gfredericksmuhoo: depends on exactly how your tree is represented
20:01gfredericksmuhoo: when you say you want the parents, is a parent a whole subtree or just the root node of the subtree?
20:01dnolenmmarczyk: all the changes are in my CLJS fork, rt-cljs branch
20:01muhoo[node [subnode [subsubnode1 subsubnode2] subnode2]
20:01muhoogfredericks: i'm looking for the path
20:01muhooso, for subsubnode1 above, i'd want [subsubnode1 [subnode node]]
20:01mmarczykdnolen: looking at it now
20:02gfredericksmuhoo: okay so
20:03muhooof [subnode1 [node subnode]] . i know how to use reverse :-)
20:03dnolenmmarczyk: k, so I'm seeing a 2X perf boost on first on lists.
20:03muhooor
20:03mmarczykdnolen: hm, so how are you measuring this?
20:03dnolenmmarczyk: w/ node
20:03mmarczykdnolen: https://gist.github.com/2598523 <- my simplistic benchmark "suite"
20:04mmarczykdnolen: running cljsc on that w/ :opt :adv, then node timings.js
20:04gfredericksmuhoo: hold on gonna make a paste
20:04mmarczykdnolen: ...and then totally misreading the output, lol
20:04mmarczykdnolen: yeah, I'm seeing a huge perf boost too :-d
20:04mmarczyk:-D, that is
20:05gfrederickswtf refheap.com gives a cert error?
20:05ibdknoxRaynes: ^
20:05gfredericksRaynes u can haz hax0r
20:05dnolenmmarczyk: :)
20:05Raynesgfredericks: I'm currently working on moving to Heroku.
20:05mmarczykdnolen: though actually the win seems to be there on master
20:05Raynesgfredericks: Could you tell me exactly what it is telling you?
20:06mmarczykdnolen: with your satisfies? fix
20:06RaynesMy dns is cached, so I'm kinda screwed.
20:06gfredericksRaynes: pm
20:08muhoorefheap works, i shrugged and added exception to the ssl error
20:08Raynesmuhoo: Yeah, but it shouldn't happen. Working it out.
20:08gfredericksmuhoo: https://gist.github.com/2598613
20:08mmarczykdnolen: oh, you haven't applied the first/rest patch on the branch then?
20:09dnolenmmarczyk: not yet no, you really want to do what I said in the ticket, and not what you did in your patch.
20:09muhooRaynes: oh, smells like phish too. hmm, glad you're tracking that
20:09mmarczykdnolen: with the extra nil check you mean?
20:09dnolenmmarczyk: yes
20:10muhoogetpersonas? uh huh.
20:10Raynesmuhoo: It's just a DNS problem.
20:10dnolenmmarczyk: otherwise you slow down the nil path.
20:10mmarczykdnolen: I suppose, though I couldn't measure much of a difference
20:10dnolenmmarczyk: calling a protocol fn should basically be last resort.
20:10dnolenmmarczyk: if you have nil return nil, don't waste time calling a protocol fn.
20:10muhoooh np
20:10dnolenmmarczyk: nil is slow, because you can't even handle that null via a JS prototype
20:11Raynesmuhoo: Does refheap.com redirect to www.refheap.com?
20:11mmarczykdnolen: ok, about satisfies? -- are you seeing a speedup on rt-cljs vs. current master?
20:12muhooRaynes: curl -i refheap.com => Location: https://refheap.com/
20:12dnolenspeedup for what? satisfies?
20:12mmarczykyeah
20:12muhooah, curl -i https://refheap.com => SSL: certificate subject name '*.heroku.com' does not match target host name 'refheap.com'
20:12muhoothat's it
20:12dnolenmarchdown: satisfies? on master for 1e6 takes >100ms, for 1e6 on rt-cljs ~10ms
20:13gfredericksmuhoo: come on man tell me how much you love my codez
20:13muhooi'm stunned by your codez, gfredericks
20:13gfredericksphew
20:14muhooi'm testing it now, hope to see if it works, but i'm inclinded to take some time to try to digest it
20:14muhoogfredericks: wow, and it does, perfectly.
20:15mmarczykdnolen: wow, I'm seeing a speedup alright at huge iteration counts, but nowhere near 10x
20:15muhoohow the hell??? it's going to take me a while to understand that :-)
20:15gfredericksw00p
20:15RaynesI think I know what's going on. I've pointed refheap.com to heroku and the ssl cert doesn't like that at all. The canonical host now will be www.refheap.com (which should be working fine, btw, as long as your DNS is up-to-date), but I think I'm going to have to add a redirect on my own server.
20:15RaynesCan somebody confirm www.refheap.com gives no SSL whining?
20:16muhooRaynes: still whining, according to curl
20:16gfredericksmuhoo: think of it from the perspective of any internal node; if you know the paths up to all your children, you know the paths up to yourself are just those paths plus yourself (i.e. the conj)
20:16muhoogfredericks: it's great code, in particular because it uses stuff i'm well familiar with. and yet, i really need to study it
20:17gfredericksrecursion and trees are well familiar with each other
20:17amalloygfredericks: doesn't that only work if all the tree elements are unique?
20:17muhoohehee, and here comes amalloy preparing rev 2.0 of it :-)
20:17muhoowhich will be 1 line and have 3 symbols
20:18mmarczykdnolen: 1e7 iterations of (satisfies? ISeq coll), where coll is a list created outside of the timed block: ~265 ms -> ~250 ms
20:18gfredericksamalloy: yeah, I forgot he didn't specify a map
20:18gfredericksmuhoo: so if they're not unique then you can't use a map, but I think the other version would be about as simple
20:19mmarczykdnolen: could you paste the code you use for timings somewhere? I'm trying to figure out what's wrong with my timings
20:19dnolenmmarczyk: avoid advanced optimizations for now, use simple + static-fns true
20:19mmarczykdnolen: ok, trying that now
20:19Raynesmuhoo: www.refheap.com, not refheap.com
20:20mmarczykdnolen: ...and all of a sudden the satisfies? test takes 5x as long on master, advanced compilation must have been doing something
20:20dnolenmmarczyk: yep
20:20dnolenmmarczyk: it's important to look at the generated code
20:21dnolenmmarczyk: advanced opts often just eliminates the work.
20:21RaynesI just switched DNS providers (google's dns is up to date), and refheap.com is the only host giving SSL warnings. www.refheap.com should work fine, and refheap.com should redirect to www.refheap.com after you accept the evil SSL. So, I should be right in that just adding a redirect on my own server should work, so I'm going to do that.
20:21dnolenmmarczyk: esp. if it's simple
20:21dnolenmmarczyk: I mean simple work
20:21gfredericksmuhoo: I think just change {tree []} to [[tree []]] and use concat instead of merge and screw the (into {})
20:21RaynesAlso, sorry for clogging up the channel with this stuff, it's just you guys are the only people I know who use the site. :p
20:22gfredericksRaynes: wrong channel, please move the conversation to #refheap-dns
20:22Raynesgfredericks: :p
20:22muhooRaynes: www.refheap.com is working, no whining
20:22mmarczykdnolen: ok, what I'm seeing now is literally unbelievable
20:22mmarczykdnolen: :-D
20:22Raynesmuhoo: Great, then I can fix this!
20:22RaynesBear with me boys and girls.
20:22dnolenmmarczyk: ;)
20:23mmarczykdnolen: right, so I guess I'll be putting the finishing touches on the partitioned proto masks now :-)
20:23dnolenmmarczyk: excellent
20:23mmarczykdnolen: do you want a patch on the ticket for that or a commit in my fork?
20:23muhoogfredericks: amalloy: they are unique, so no problem there
20:23dnolenmmarczyk: just work on your fork
20:23dnolenmmarczyk: and I'll pull your changes.
20:24mmarczykdnolen: cool
20:24muhooi'm working on figuring out if i can mod it to give me parents for the intermediate nodes too, not just the leaves. just to see if i really understand it
20:25pandeiroanyone noticed weird double retrieval of resources with noir/cljs-template?
20:27mmarczykdnolen: just pushed first/rest with the second nil check
20:31muhoogfredericks: well i knew enough to replace (apply (concat (map .. with mapcat :-)
20:31gfrederickswuhoo mapcat
20:32RaynesOkay guys, refheap.com is still going to fail until DNS propagates and then it should point back to my server and my nginx rewrite takes effect. The canonical domain is www.refheap.com now anyways, so you can just use that. Sorry for any inconveniences.
20:33RaynesThe reason this happened was because I didn't realize you had to use subdomains with SSL on Heroku, and they frown on naked domains. I pulled the trigger a little too quickly. ;)
20:34muhooi see where i got stuck. i was trying to figure out how to do it with recur. advanced tco mojo was not necessary and was just confusing me
20:34muhoo(not (= recur recursion))
20:34gfredericksyeah tco gets thwarted whenever you want to recur more than once
20:49zakwilson_http://news.ycombinator.com/item?id=3927891 <-- node.js clone for the JVM. Is this a cargo cult?
20:53jtoyhow do I get all the urls from a string? I am trying something like : (re-find #"^http://\S+&quot; "http://asdasd.com asdasd http://google.com&quot;)
20:54gfredericksjtoy: and you're only getting the first one? because of the ^?
20:54amalloyre-seq
20:54gfredericksoh right
20:54gfredericksthat too
20:54jtoyoh cool
20:54gfredericksamalloy always fixes my answers
20:54Raynes&(re-seq #"^http://\S+&quot; "http://asdasd.com asdasd http://google.com
20:54lazybotjava.lang.RuntimeException: EOF while reading string
20:54Raynes&(re-seq #"^http://\S+&quot; "http://asdasd.com asdasd http://google.com&quot;)
20:54lazybot⇒ ("http://asdasd.com&quot;)
20:54amalloyit's okay, i wouldn't have noticed the ^ issue
20:54RaynesMe either.
20:54amalloyevidently
20:55jtoy&(re-seq #"http://\S+&quot; "http://asdasd.com asdasd http://google.com&quot;)
20:55lazybot⇒ ("http://asdasd.com&quot; "http://google.com&quot;)
20:55zakwilsonURLs are used for protocols that aren't HTTP. It's fine if you don't care about that, but be aware.
20:56gfrederickstincan://
20:58mmarczykdnolen: almost done on the partition-based patch -- seeing a speedup of 2x :-)
20:59mmarczykdnolen: (first/rest on a list)
20:59dnolenmmarczyk: yep that's basically what I'm seeing.
21:00mmarczykdnolen: right, and now the same thing should be possible for all core protocols :-)
21:05jayunit100Exception messages and handling could be improved in clj.. hope soon :] .. would be cool if we could contribute exception messages without being official "contributors" somehow.
21:06mmarczykdnolen: apparently it breaks the (= () (rest nil)) test, though -- looking into it
21:09gfredericksswank-clojure assumes I am a male
21:12mmarczykdnolen: hm, it's the first/rest patch that is breaking the test -- not sure what's going on
21:12mmarczykdnolen: ohhhh wait
21:12dnolenmmarczyk: yes we'll have to be careful to preserve the various invariants.
21:13mmarczykdnolen: just realized that (rest nil) is probably meant to be ()
21:13dnolenmmarczyk: yep
21:13mmarczykdnolen: fixing that now
21:13dnolenmmarczyk: RT.java more
21:13mmarczykyeah
21:18mmarczykdnolen: ok, just pushed rt-cljs to my fork w/ partitioned protocol masks and first/rest
21:25dnolenmmarczyk: merged, please merge from my fork.
21:25dnolenmmarczyk: first on List getting reasonable
21:26mmarczykdnolen: :-)
21:26dnolenmmarczyk: first on PV crazy slow :)
21:27mmarczykdnolen: yeah :-(
21:27mmarczykdnolen: that does take a hit
21:28dnolenmmarczyk: probably just needs looking into.
21:28mmarczykdnolen: yes
21:30mmarczykdnolen: first on vector is 6x slower than first on list in Clojure, though
21:30mmarczykdnolen: which is not a problem in practice :-)
21:30dnolenmmarczyk: yeah
21:31mmarczykdnolen: so clearly this is a huge win -- I really had to see it to believe it
21:31mmarczykdnolen: fantastic idea!
21:31mmarczykthe speedup on satisfies is ridiculous
21:31dnolenmmarczyk: yes :) there's quite a bit of work left to do.
21:31mmarczykdnolen: ok, so what are the next steps?
21:31dnolenmmarczyk: V8 is awesome but I think we'll find that it leaves much to be desired compared to the JVM
21:32dnolenmmarczyk: inlining is not nearly so aggressive on V8 as the JVM.
21:33dnolenmmarczyk: next steps I think are going through RT.java and seeing which fundamental fns could benefit from RT.java style.
21:34mmarczykdnolen: there's a bunch of functions which just call through to the proto method
21:34mmarczykdnolen: seq on non-nil, conj
21:34dnolenmmarczyk: we should apply your patches to remove the extend-type default
21:35mmarczykdnolen: they should apply cleanly, I think
21:36dnolenmmarczyk: where possible we should try to avoid calling protocol dispatch on nil I think.
21:36mmarczykdnolen: inline the impls on nil by hand, basically?
21:37brweber2Does anyone know if a clojurescript book is in the works? Is it stable enough to publish something?
21:37dnolenmmarczyk: now that I think bout that we should do that last
21:37mmarczykdnolen: I *think* there might be some spots in core where -methods are used directly in a way which would then not be nil-safe, but I'm not sure; will go and check
21:39TimMcjayunit100: Are you familiar with (pst) in the REPL?
21:39TimMcjayunit100: Or do you mean the error messages themselves?
21:39dnolenmmarczyk: next & seq probably should involve some thinking how to optimize they are critical.
21:39mmarczykdnolen: what do you think about next? any way to avoid that seq call? (can't just check for ISeq, since LazySeq implements that too)
21:39dnolenmmarczyk: another one is handling of EmptyList
21:39mmarczykdnolen: right
21:40dnolenmmarczyk: EmptyList in Clojure on JVM is not ASeq
21:40mmarczykdnolen: no, but it implements ISeq
21:41dnolenmmarczyk: but I wonder if we shouldn't have ASeq as a marker protocol
21:41mmarczykdnolen: with what semantics?
21:41pandeiroibdknox: is there a known bug with noir.server/add-middleware (1.3b3)? my logging fn shows everything getting requested twice when i add it with add-middleware, but not when i create the handler manually
21:42dnolenmmarczyk: ASeq is ISeq sans EmptyList?
21:42dnolenmmarczyk: no need to rush this stuff :) I'm about to call it quits soon.
21:42mmarczykdnolen: LazySeqs might or might not be empty though, so it couldn't carry a non-empty guarantee
21:42mmarczykdnolen: sure
21:43mmarczykdnolen: I wonder if next could somehow handle lazy seqs specially -- only calling seq on them -- without taking too much of a hit from the extra tests
21:44mmarczykdnolen: ILazySeq marker?
21:44dnolenmmarczyk: why not just (instance? LazySeq x)
21:44mmarczykdnolen: hm, yeah, there will be no other impl
21:45amalloydnolen: that loses the generality/extensibility of the languages. now nobody else can implement their own "flavor" of lazy seqs, right? you've hardcoded special behavior to the existing impl
21:45amalloyeg, chunked seqs
21:45mmarczykdnolen: so then next would check for that and return (rest coll) on false, (seq (rest coll)) on true
21:45mmarczykoh. fair point.
21:46mmarczykincidentally what's the status of that chunked vector patch?
21:46spjtSo.. how do I make "lein repl" load the current version of clojure?
21:46dnolenamalloy: perhaps ...
21:46brehautspjt: specify it in your project.clj and hope none of your dependancies override it
21:46dnolenmmarczyk: chunked vector would be nice
21:46spjtbrehaut: I'm starting lein in a directory with no project
21:46mmarczykdnolen: yeah, and there is a patch on the ticket actually
21:47brehautthen you get whatever lein wants to give you
21:47mmarczykdnolen: *probably* not usable as-is because of the changes to PV around transients
21:47spjtbrehaut: is there some configuration file for lein? I've been looking at google for a while about this
21:47brehautspjt: there might be fore lein2, but i dont think there was for lein 1 (not that im an expert)
21:47brehauti just create a dummy project when i really care
21:48mmarczykdnolen: well actually that patch is only the beginning of the story, since then things actually need to check for chunkiness, we need chunked-cons & Co.
21:48mmarczykdnolen: which means it's kinda fortunate that satisfies? just got faster, cause it's gonna be needed :-)
21:48spjthmm. I actually looked and "lein" is some shell script and the clojure jar filename is in there.. twice. Bad.
21:49spjtCLOJURE_JAR="$HOME/.m2/repository/org/clojure/clojure/1.2.1/clojure-1.2.1.jar"
21:49spjt CLOJURE_JAR_URL=http://build.clojure.org/releases/org/clojure/clojure/1.2.1/clojure-1.2.1.jar
21:49mmarczykdnolen: ok, I'll try to merge the existing patch and build sth on top of that, or if it's unmergeable for some reason, start over
21:49pandeirospjt: i believe that's just the version lein1 uses internally or something
21:50dnolenmmarczyk: sounds good
21:50spjtpandeiro: It's the version it uses for lein repl. I'm not at the point where I want to create a project
21:51pandeirospjt: i think you always want to create a project to use lein
21:51pandeirolein new foo && cd foo && lein repl
21:51spjtpandeiro: I only use "lein repl", I'm not advanced enough to make any sort of project
21:51mmarczykdnolen: back to the RT.java stuff: I think nth could perhaps use a split into -nth-based part and a linear helper?
21:52pandeirospjt: blind leading the blind here but i think you should try what i suggested
21:52spjtHmm.
21:52pandeiro...that is, if you want to use clojure 1.3 or 1.4
21:53spjtemacs inferior-lisp is also running 1.2.1, i think it runs lein repl
21:55dnolenmmarczyk: lets leave the chunked stuff alone for now. and focus on RT.java
21:56mmarczykdnolen: I notice that cljs.core/find should now be faster, by magic
21:56mmarczykdnolen: apart from that, there is a whole bunch of functions which delegate straight to the proto method
21:57mmarczykdnolen: current impl of nth, say
21:57dnolenmmarczyk: one thing we should be very careful about - slowing things down.
21:57xeqispjt: the clojure jar has to be on the classpath to run lein. in lein 1.x it uses 1.2.1 for this. This is what you get when lein is run outside a project
21:57mmarczykdnolen: so in the cases where the proto method is called and nothing else happens
21:57xeqiif you have a project then lein will spawn another jvm with the specified version
21:58mmarczykdnolen: there's nothing to be gained from an extra check, right?
21:58dnolenmmarczyk: like the PV case, it also seems like first on prim arrays may have gotten slower.
21:58dnolenmmarczyk: I think we're going to have measure carefully against master
21:59mmarczykdnolen: anything which is not an ISeq will be slower, as will anything which is an ISeq, but not a cljs type / record, and thus has no proto masks attached
21:59mmarczykdnolen: extend-type could of course attach proto masks to prototypes
22:00dnolenmmarczyk: yes but we're missing a opportunity to simplify the code path.
22:00dnolenmmarczyk: under advanced optimization we have all the information
22:00dnolenmmarczyk: no need to do the prototype chain lookup at all
22:01dnolenif mask fails, it fails
22:01mmarczykdnolen: well it still has to be attached somewhere; for strings that would presumably be to the string prototype?
22:01dnolenmmarczyk: JS natives are not directly extended.
22:02dnolenmmarczyk: separate test entirely.
22:02mmarczykdnolen: oh ok, that's right
22:02dnolenmmarczyk: in anycase I'm done :) some fun stuff to play with and test for the next few days.
22:02mmarczykdnolen: :-)
22:04mmarczykdnolen: ok, I'll call it a night too for now -- looking forward to more CLJS fun soon though :-)
22:04spjtWeird, if I change the version of clojure in the lein shell script it crashes.
22:05mmarczyk(or I might actually get the node repl done, cause the lack of it is beginning to drive me crazy :-P)
22:11pandeirospjt: if you use arch the version in community is already 1.4.0... you can get a repl with `clj`, no lein necessary (since you're not really wanting to create a project)
22:12spjtpandeiro: Emacs uses lein to make the inferior-lisp repl, I had it working with "clj"
22:13pandeirospjt: hmm, emacs using clojure-mode does that by default? ... but emacs is another can of worms i think if all you want is a repl
22:14spjtI managed to get it to use 1.4.0 by creating a project, creating a new file, opening a repl in that window, but it seems pretty.. inelegant.
22:15pandeirospjt: what OS do you use?
22:15spjtthen again, maybe I should have asked if what I want to do already exists
22:15spjtpandeiro: OSX, I can try it in Linux
22:16pandeirono any nix is fine, just create an alias for quickly setting up a dummy project and entering the repl
22:16spjtI wanted to write a clojure "program" that just has little snippets to show an example for each function in core
22:16pandeirothat you would then use at the repl?
22:16spjtmaybe such a thing already exists
22:17spjtpandeiro: I'd use it in emacs since it's so easy to evaluate expressions
22:17spjtyou just move to the end and hit C-x C-e and it shows the output
22:17pandeirospjt: have you checked out swank-clojure?
22:18xeqispjt: have you seen the clojure koans? not quite what you're describing, but kind of that direction
22:18pandeiroi think nREPL also has the ability to fetch stuff from clojuredocs, which often include examples
22:18spjtpandeiro: hehe, yeah. I think I got it working once, but it puts the output in the minibuffer which I didn't like
22:19pandeirospjt: swank-clojure gives you the function clojure-jack-in, which opens a SLIME REPL, not a minibuffer at all... it's a repl on steroids
22:19spjtpandeiro: It outputs on the minibuffer.
22:20pandeiro*slime-repl ...* is a minibuffer? don't think so...
22:20spjtpandeiro: You can type into the buffer, but eval output appears in the minibuffer.
22:21spjtI know I had it working once, but I can't remember how to start it, I just ran clojure-jack-in and it gave me a page of errors
22:22pandeiroit is not exactly plug and play but i'm 7-8 months in to clojure/emacs and i'd say swank-clojure is well worth the effort... the github page for it has pretty simple instructions
22:22pandeiroC-x C-e will eval the form under point in the slime repl i believe
22:23pandeiroone of the main gotchas with swank-clojure is having another version of slime installed, get past that hurdle and you should be fine i think
22:24spjthehe. I think Clojure is the first language I've seen where it's harder to run a program than it is to write it
22:27pandeirospjt: no joke, the environment can be a challenge
22:27pandeirowait til you try clojurescript :)
22:29emezeskespjt: Have you tried Leiningen? For me it removes all challenges to running a program
22:30spjtemezeske: I think lein is actually where my challenges started
22:30emezeskespjt: Huh.
22:30pandeirospjt: what's the actual obstacle at this point?
22:31spjtpandeiro: I dunno, I suppose I can get around it, I have inferior-lisp running 1.4.0
22:31spjtI got swank to work once, but I don't remember how I did it.
22:33pandeirospjt: do you have an ~/emacs.d already? mine is here https://github.com/pandeiro/dotemacs, you could just swipe it and it should work
22:33spjtpandeiro: yeah, I can set it aside temporarily
22:34spjtactually I'm wondering if I ever reinstalled all the necessary el files
22:35pandeirospjt: that got me once as well, i accidentally removed slime and clojure-jack-in stopped working :)
22:37spjti have them all installed afaik
22:38technomancyall you need is clojure-mode, leiningen, and lein-swank
22:38spjthm?..
22:39spjtIt's starting the server, it just can't connect to it
22:44spjterror in process filter: Symbol's value as variable is void: slime-clj
22:44spjtgotten it down to only one error at least
22:45technomancyspjt: yeah, get rid of slime-clj
22:45technomancyit's deprecated
22:45spjttechnomancy: in favor of what?
22:46technomancyslime-clj became ritz, which is an alternative to swank-clojure
22:46technomancyit just used to have a terrible name
22:47spjttechnomancy: hmm, I saw that ritz thing, I had no idea what it was.
22:48spjtAs long as I don't have to give up emacs. That was the worst thing about clojure at first, but now I'm using it instead of Windows at work
22:49technomancyclojurebot: swank?
22:49clojurebotswank is trust the readme and the readme only. all others will lead you astray.
22:50technomancy^ real truth
22:51spjtI don't know why I'm even bothering with this, inferior-lisp works fine now as long as I load a file in the project directory
22:53spjtI don't think this has anything to do with emacs though, it's lein that's messed up
22:53technomancyit has happened before
22:54spjtAt the command line, "lein swank" runs fine. "lein jack-in" runs fine
22:55spjtAs long as they're not running at the same time.
22:56spjtwhen I do that, I get:
22:56spjtException in thread "main" java.lang.RuntimeException: java.net.BindException: Address already in use
23:08spjtI got it working, such a silly issue.
23:08spjtwhatever it was, rm -rf ~/.emacs.d/swank fixed it
23:09technomancyyou can't open two servers on the same port
23:09spjttechnomancy: I was trying to open a server and a client.
23:10spjtThe worst part is that now that I've finally got everything working, I completely forgot what I wanted to write.
23:12technomancyjack-in opens a server and a client at the same time
23:12technomancyit's meant to replace lein-swank rather than working with it
23:13spjttechnomancy: yeah, I was just trying to run it manually on the command line to figure out why it wasn't running.
23:14spjttechnomancy: For whatever reason, whatever it ended up compiling into .emacs.d/swank was making it no longer work, because it started working once I deleted it.
23:17_KY_What is the way to avoid name clashes when I "use" 2 modules in the test module?
23:17tmciver_KY_: don't use; require
23:18tmciver_KY_: (:require lib.name :as alias)
23:18_KY_I see...
23:18tmcivererr, (:require [lib.name :as alias])
23:21tmciverclojure aphorism: only use use with only
23:22technomancyonly use :use with versions of clojure prior to 1.4 doesn't quite have the same ring to it
23:22xeqihmm, do other people alias clojure.test vs use/refer+require
23:23technomancyxeqi: I like to think of clojure.test as being the equivalent of clojure.core for the test/ directory =)
23:23tmciveryes, I use clojure.test :/
23:23technomancythere are only 3-5 vars you'll ever use from it, so I think :refer :all is pretty well-justified
23:27ivanI noticed that in Clojure it's more common to accept both Thing and a vector of Thing, than it is in Python
23:27ivanis there a design rationale somewhere for this forgiveness?
23:29xeqiivan: do you have an example?
23:29ivan(require 'x) (require '[x y])
23:30ivansomething else I can't remember right now
23:30ivaner, maybe it was not require but something similar
23:31ivanI'll come back when I have better examples
23:37amalloyivan: (require 'x) is very different from (require '[x y])
23:37ivanyep
23:38ivanhttps://github.com/mmcgrana/ring/blob/master/SPEC <- ring has a String or a seq of Strings
23:38amalloyi guess my point is it's not accepting "x or a vector of x", it's accepting "a symbol or a totally different datatype, which happens to be a vector"
23:39technomancyivan: the seq of strings is to allow for response bodies to be lazy
23:39ivantechnomancy: I meant the headers, sorry
23:40technomancythat's just a quirk of the HTTP spec; you can have a header provided multiple times with different values
23:41ivanyeah, I know that part. I'm just wondering if it's good design to accept both Thing and seq of Thing, instead of only seq of Thing
23:41ivana little bike-sheddy, perhaps
23:41ivanbut you can get spectacular explosions when you treat a string as a list of Thing and get bytes or whatever
23:42ivaneven worse in Python, where you get 1-byte strings
23:42technomancyI'd say it's not a good principle in general; each of these cases have specific motivations behind them
23:43mlozanoevening!
23:43ivansupporting a non-seq would seem to expand every API user's code slightly
23:52Raynes&(repeat 500 "I'm a little teapot")
23:52lazybot⇒ ("I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapot" "I'm a little teapo... https://www.refheap.com/paste/2574
23:52RaynesExcellent.
23:53technomancyRaynes: I was going to mention that apex domains are strongly advised against if you ever might face a DDOS: https://devcenter.heroku.com/articles/avoiding-naked-domains-dns-arecords
23:53xeqi&(repeat "I'm a little teapot?")
23:53technomancyso the whole adding www is probably the right move
23:54lazybotExecution Timed Out!
23:54Raynestechnomancy: I didn't have a choice in the matter, but I read the rationale and it made sense so I was okay with it.
23:54RaynesBesides, it's 4 more characters. We have URL shorteners for a reason.
23:55Raynestechnomancy: Also, fwiw, refheap is now running entirely on heroku. All I've got left on my server is a nginx rewrite of refheap.com to www.refheap.com
23:56technomancyslick!
23:57RaynesThanks again for all the help with the transition.
23:57mmarczyktechnomancy: hm, apparently lein2, when running out of a checkout, has test stuff on its regular classpath -- `lein2` (no args) says there's a bluuugh task available, for example
23:57RaynesHaha
23:57technomancymmarczyk: heh; yeah I noticed that =)
23:58Raynestechnomancy: Also, re www: if it's good enough for Google, it's good enough for Raynes.
23:58mmarczyktechnomancy: oh, ok :-)
23:58mmarczyktechnomancy: if it's not on purpose, I could look into fixing that
23:58technomancyit's been low on my priority list, but a fix would be great =)
23:58technomancysince it doesn't affect the releases
23:59technomancymmarczyk: also I tagged a bunch of the easier issues with the "newbie" tag if you're looking for stuff to do =)
23:59ibdknoxtechnomancy: is there a replacement for :extra-classpath-dirs?
23:59mmarczykcool, sometime when I'm not feeling sleep-deprived then :-)
23:59technomancyibdknox: depends; what were you using it for?