#clojure logs

2012-08-17

01:35semperosfor any folks still around dealing with the cljs -> nodejs multi-namespace issue, I've put a temporary workaround on the JIRA ticket for it
01:35semperoshttp://dev.clojure.org/jira/browse/CLJS-355
01:43tomojhmm
01:43tomoji certainly got multiple namespaces working before
01:44tomojmonths ago maybe
01:53tomojsemperos: what cljs version?
01:53semperosHEAD of master
01:53tomojhuh..
01:53tomojrefh seems to work fine here
01:54semperoswith nodejs as the target?
01:54tomojyeah
01:54tomojI don't have quite HEAD yet
01:54semperoshmm
01:54semperosI didn't open the issue, just encountered it today, I've only targeted the browser with cljs in the past
01:56semperosI also tried all of the 0.0-14xx releases and had the same error occur when introducing multiple namespaces and targeting nodejs
01:58tomojhttps://gist.github.com/de65338f9d7eaa30c2e0
01:58tomojRaynes: https://gist.github.com/de65338f9d7eaa30c2e0
01:59semperostomoj: able to share the project code?
01:59semperosor at least what/how many namespaces that code base has?
02:02semperosnm...
02:03tomojhmm
02:05wmealing__hmm
02:07semperostomoj: on that refh code base, if I do `lein cljsbuild once` and then run the file, it doesn't work for me as shown in your gist
02:07semperoskinda curious
02:07tomojhow does it know which cljs version to use?
02:07Raynestomoj: ?
02:07tomojit looks like cljsc is using my HEAD install
02:08Raynestomoj: If that's the case and it is already fixed, somebody really need to push a new cljs release.
02:09Raynesneeds*
02:09RaynesThat was the craziest bug I've ever seen.
02:10tomojI see cljsbuild depends on 0.0-1450
02:10RaynesIs it using that in your gist?
02:10tomojI assume so
02:10RaynesBecause I can't get it to work with that.
02:10semperosme neither
02:11tomoj..platform?
02:11RaynesOS X
02:11semperosMac OSX Lion
02:11RaynesSame.
02:11tomojcalled it
02:11semperos:)
02:11tomojmaybe that's just a coincidence
02:11tomojubuntu here
02:11tomojwhat occurred to me was "case-insensitive hfs" but I don't see how that could cause it
02:12RaynesI can test on my ubuntu vps, tomoj.
02:12RaynesGimme a sec.
02:12tomojosx java sorts differently? :)
02:12semperosI've seen sorting differences in Ruby implementations across OS's...
02:13tomojif it sorts by hash somewhere I could see that
02:13tomoj..maybe?
02:13tomojit just happens to come out correct in ubuntu? that seems crazy though
02:15tomojjust tried again using cljsc with my clone on r1450, still works
02:15magopiani think i found a very clever solution to problem 82 on 4clojure <3
02:16Raynestomoj: I can reproduce on ubuntu
02:16Raynessemperos: ^
02:16nbeloglazovmagopian: and what is it? :)
02:16semperosRaynes: the error, or it working?
02:16RaynesThe error.
02:16RaynesSame thing happens.
02:16semperossweet
02:16semperosso tomoj has the magic box
02:17RaynesApparently so.
02:17RaynesWhere all things work.
02:18semperoswell, time for me to hit the sack; with that simple workaround on that ticket, those not using tomoj's magic box can get nodejs targets compiling again
02:20magopiannbeloglazov: did you solve the problem 82 already?
02:20nbeloglazovmagopian: yes
02:20magopiannbeloglazov: my username is "magopian"
02:21magopiannbeloglazov: reasoning was: if all words have to be chained, it's not possible if there's more than two words that can only connect to one word (the first and the last one)
02:21magopianif there's more than 2 words with only one connection => it can't be a single chain => false
02:22magopiani'm pretty sure that's a bit naive, as i'm pretty sure there could be a set of words, each having more than one "connection", but still no one chain could be made
02:23magopianhowever, that doesn't seem to be the case with the tests available
02:24magopiannbeloglazov: must rush, afk, will be back in a few minutes
02:26nbeloglazovmagopian: no need to hurry, 4clojure slow as hell now (at least for me)
02:27wmealing__i know its not clojure related.. but can someone tell me why "Koka" plans to do with these "inferred effects", ie what does it do for the langauge
02:39magopiannbeloglazov: back;)
02:41nbeloglazovmagopian: by the way I think I found a way to crash 4clojure for sometime
02:45magopiannbeloglazov: oh?
02:45magopiannbeloglazov: you mean some way to trump the "execution timeout" trigger ?
02:46nbeloglazovmagopian: no, just make it very slow and sometimes it shows "Broken gateway". It has problems with user search
02:46nbeloglazovmagopian: yes, your solution is a bit of a hack :)
02:49magopiannbeloglazov: i think so, yes
02:51magopiannbeloglazov: but eh, it's the simplest solution given the tests, right? O:)
02:51magopiani had a first solution, based on brute force (compute all possible combinations of the words, and then checking if it's a chain)
02:52magopianwhich was correct, but timed out on the very first test
02:52nbeloglazovmagopian: mine passed (it also check all permutations)
02:52magopian(took me two days to come up with it, was a bit frustrated when it failed :(
02:52magopiannbeloglazov: well, does it still run now? (your solution) ?
02:53magopianbecause mine had nothing fancy, i think, so i was a bit surprised it would timeout
02:53magopian(i still have it around if you're interested, but it's not very elegant)
02:55nbeloglazovmagopian: yes, it passes. My nick is nikelandjelo on 4clojure
02:56nbeloglazovmagopian: you also can check redraiment's solution it's really hack that has nothing common with the task
02:56magopiani'll check those two straight away
02:57magopianah, i'm following you already ;) (i follow each and every one who solved every problem, so i can compare my solutions to them)
02:57tomojRaynes: hmm
02:57tomojI guess I'm not using the cljs version I think I am?
02:58magopiannbeloglazov: (drop-nth [n s] (concat (take n s) (drop (inc n) s))) <==== i did that differently with split-at
03:03magopiannbeloglazov: very clever solution ;) my brute force one was very very close, same logic (but less idiomatic and clear, i'm still big big noob ;)
03:03nbeloglazovmagopian: hm, yes, drop-nth removes nth element and returns 1 seq, and split-at returns 2 seqs
03:03magopiannbeloglazov: i guess my permutations algorithm was too naive to run fast enough
03:03nbeloglazovmagopian: can you show your algorithm?
03:03magopiansure, let me paste it
03:04tomojwonder why symbols can't start with numbers
03:04magopianmmm let me trim it down
03:06magopiannbeloglazov: https://friendpaste.com/1Yti8jqQuUpdY8t8mKOg9
03:06magopianit takes a word, and inserts it in every possible position in a sequence
03:07nbeloglazovtomoj: because compiler won't be able to understand when you type (println 4) if you mean 4 as number or as symbol
03:07tomojhmm
03:08tomoj"if it's a valid literal number, it's a number, otherwise it's a symbol" is just too weird?
03:10tomojheh "Unable to resolve symbol: 4 in this context"
03:10nbeloglazovI think so. It can cause confusion. May be there are some bigger problems with this
03:10magopianhaha, just checked redraiment's solution :)
03:12magopiannbeloglazov: i love your "close?" function, it's just simple, clear, concise, readable, perfect !
03:13nbeloglazovmagopian: thanks :)
03:15magopianto learn the syntax of a new language, it can be rather quick... but to learn to write it idiomatically... it can take years
03:15magopianwow, this sentence is hardly english, sorry ^^
03:25rod_hi - i'm using compojure for a JSON RESTish api - and would like to handle exceptions returning them as JSON. i was about to write a macro to wrap all my routes, but can anyone reccomend the beter way of doing this? could i use a ring response handler? thanks
03:29nz-rod_: the exact same thing is on my to-do list, I would probably make a regular function as a ring response handler that does the job
03:29rod_ok thanks for the advice nz- i'll try it.
03:31nbeloglazovrod_: look at this article: http://mmcgrana.github.com/2010/08/clojure-rest-api.html Author creates error handler
03:31nz-see wrap-exception-logging and wrap-failsafe in http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html
03:33rod_cheers!
03:45augustlneed to turn {:headers {:foo 1 :bar 2}} into {:headers {:bar 2}}, this is a good use case for clojure.zip right?
03:47nz-select-keys?
03:48nz-,(select-keys {:foo 1 :bar 2} [:bar])
03:48clojurebot{:bar 2}
04:00hyPiRionso like
04:01hyPiRion,(update-in {:headers {:foo 1 :bar 2}} [:headers] dissoc :bar)
04:01clojurebot{:headers {:foo 1}}
04:02hyPiRion,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:foo])
04:02clojurebot{:headers {:foo 1}}
04:03nz-,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:bar])
04:03clojurebot{:headers {:bar 2}}
04:03nz-,(update-in {:headers {:foo 1 :bar 2}} [:headers] select-keys [:foobar])
04:03clojurebot{:headers {}}
04:05nz-what is idiomatic way to remove "empty" keys from a map: e.g {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d2 {} :d3 nil}} -> {:a 1 :d {:d1 1}}
04:06augustlhyPiRion: ah, cool
04:06rod_nz- would (into {} (remove empty? the-data)) work?
04:07rod_oh, you might have to (comp empty? second)
04:07nz-,(into {} (remove empty? {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d2 {} :d3 nil}}))
04:07clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Duplicate key: :d2>
04:07nz-,(into {} (remove empty? {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d4 {} :d3 nil}}))
04:07clojurebot{:a 1, :b {}, :c [], :d {:d1 1, :d2 {}, :d4 {}, :d3 nil}}
04:08rod_,(into {} (remove (comp empty? second) {:a 1 :b {} :c [] :d {:d1 1 :d2 {} :d4 {} :d3 nil}}))
04:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
04:08rod_ouch
04:08rod_maybe put ur own "empty" comparison in then
04:08rod_that'll deal with numbers and stuff
04:09nz-does it work recursively? several levels deep?
04:09azkeszis it possible to redefine a function and inside it call the old function?
04:10azkeszfunction having the same name
04:13tomoj(defn wrap-println [f] (fn [& args] (println (apply f args))))
04:13tomoj(def foo (-> (fn [x] (+ x 2)) wrap-println))
04:13tomojazkesz: ^
04:13tomojone way to do what
04:13tomoj..I think you are asking
04:14hyPiRionI think the question is more like (def prn [x] (do (prn x) x)), where the prn inside is the old fn.
04:14azkeszI didn't yet read about the "->"
04:15azkeszyes hyPiRion
04:15tomojhyPiRion: in that case, my answer is "don't do that"
04:15ro_stRaynes: any idea how i'd serve a static file with Noir? not necessarily a file in /resources/public
04:15azkeszi only want to know how it can be done, i don't really want to do it :)
04:15hyPiRionYou could do it by refering to the explicit namespace
04:15tomojazkesz: er, that could have been written more easily
04:15hyPiRion(defn prn [x] (do (clojure.core/prn x) x)))
04:15tomoj(def foo (wrap-println (fn [x] (+ x 2))))
04:15ro_sti just need to know how to tell ring to serve up a file i tell it to
04:15weavejesterro_st: A file or a resource?
04:16ro_sta file
04:16tomojazkesz: oh, define it twice in the same namespace, or in separate namespaces, like hyPiRion suggests?
04:16weavejesterro_st: You could just do (response (io/file "blah"))
04:16ro_stso i have a route /media/:uuid/:file and i want to use the uuid and file to find a file on disk and serve it up
04:16ro_stboom :-) thank you weavejester!
04:16weavejesterro_st: Where response is from ring.util.response and io/file is from clojure.java.io
04:17weavejesterro_st: Bastically just add a java.io.File object to the :body of the response.
04:17ro_stthat's awesome, thanks
04:18azkeszthat worked , as hyPiRion suggested, though I'm not really sure I got what's happening xD
04:18azkeszoh right, it's redefined in my own user namespace?
04:18ro_sthey, so now that i have your attention. i want to serve a ring app in production, but i dont want to do the jar thing, because i want to be able to modify files in resources/public/ without having to recompile. apache currently has port 80 on the machine in question. what can i use?
04:18azkeszi see what you meant tomoj
04:20weavejesterro_st: You can run your web app with an adapter, then use Apache or Nginx to proxy HTTP requests to it.
04:20ro_stahh, of course! forgot about proxy
04:20weavejesterro_st: If you're using "lein-ring" then you can run it with LEIN_NO_DEV=1 lein ring server
04:20ro_stany recommendations on the underlying web server to use? is jetty ok?
04:21ro_st-java noob-
04:21weavejesterro_st: An embedded Jetty started by "lein ring server" should be okay.
04:21ro_stawesomesauce
04:21weavejesterro_st: Jetty is the server used for the official adapter
04:23ro_stLEIN_NO_DEV stops code reloading, i presume
04:23tomojazkesz: if you did that you should do (ns foo (:refer-clojure :rename {prn core-prn})) (def prn [x] (do (core-prn x) x)))
04:23ro_stand stacktraces to the browser
04:23azkesztomoj, very interesting
04:23weavejesterro_st: Yes, and in pre-2 Leiningen in prevents :dev-dependencies as well
04:24weavejesterro_st: Lein-Ring uses it as a hint that development middleware is not needed
04:25weavejesterro_st: But with profiles in Lein 2, you can fine tune it, e.g. by having a profile for production with :ring {:auto-reload? false :stacktrace? false}
04:26ro_stthanks WJ! appreciate the help
04:27ro_sti only recently discovered the joy of code-reload in my compojure app. what a difference!
04:28weavejesterro_st: I actually need to take a look at wrap-reload. I've discovered rare instances where it doesn't seem to work as expected. I think it might be reloading the namespace, but then not reloading the dependent namespaces right or something. Most of the time it works find though...
04:29weavejesterro_st: You could also try wrap-refresh, but you'll need lein-ring 0.7.2 for it to work right. :ring {:auto-refresh? true}
04:29ro_sthow does that differ?
04:29weavejesterro_st: wrap-refresh needs wrap-reload to be useful
04:30weavejesterro_st: wrap-refresh refreshes the browser via javascript when it detects a file change
04:30ro_stbtw, CmdrDats is probably quite keen to know what you think of his pull-request on ns-tracker #justsaying
04:30ro_stoooh. yes please
04:30ro_sthttps://github.com/weavejester/ring-refresh ?
04:31weavejesterro_st: Yes, but if you're using Lein-Ring 0.7.2, it's included. You just need to add :ring {:auto-refresh? true} to your project.clj
04:31ro_stgotdcha
04:32ro_st0.7.2 is new?
04:32weavejesterro_st: I replied to CmdrDats - I like his changes, but I think they belong in a different library. ns-tracker is just for tracking changes to namespaces, not for reloading them.
04:32azkeszCmdrDats had that nice minecraft plugin in clojure thing, I took a look, but I've much to learn about clojure first :)
04:32weavejesterro_st: Yeah. 0.7.1 also has wrap-refresh, but it's a version with several big bugs!
04:32weavejesterro_st: 0.7.2 updates the version of wrap-refresh to fix them.
04:33azkeszis cljbin slow?
04:33ro_stazkesz: i can only imagine that'd be a fantastic way to learn clojure
04:34azkesznvm, it loaded (the page) :)
04:35azkeszany chance something like this would work? http://cljbin.com/paste/502e019de4b050e15148aab8 (just for proof of concept, not really gonna use it)
04:37ro_stweavejester: have you tested refresh with gzip middleware?
04:38ro_stwow it works beautifully .. when gzip middleware is disabled :-)
04:38weavejesterro_st: Nooo… I can see why that wouldn't work. It would need to be *under* the gzip middleware
04:38weavejesterro_st: But lein-ring only sees the outer part
04:39ro_stif you wrap your ring handler with dev-only middleware (like reload, stacktrace), how do you run that code in production with NO_DEV=1?
04:40weavejesterro_st: Well, lein-ring will add wrap-reload and wrap-stacktrace automatically for you if LEIN_NO_DEV is *not* set
04:40ro_stoh!
04:40ro_stwhere is that documented?
04:40weavejesterro_st: If you want something in-app, you could use environment variables… which is where I'd recommend a small library called environ
04:41weavejesterro_st: https://github.com/weavejester/lein-ring#starting-a-web-server
04:41ro_stthat is awesome!
04:42weavejesterro_st: Are you using the Lein 2 preview, by any chance?
04:42ro_stthings just got so much simpler
04:42ro_sti am. i use 1 and 2 side by side
04:42ro_stmostly 1, though
04:42weavejesterro_st: Environ needs Lein 2, but I've found it useful for managing configurations: https://github.com/weavejester/environ
04:43ro_stnice
04:43ro_stcan you mutate those values at runtime?
04:43weavejesterro_st: In development mode, you can specify configuration in your project.clj file, or in your ~/.lein/profiles. In production, you can run with environment variables, or with Java system properties
04:44weavejesterro_st: No, it's an immutable map, but you could use that immutable map to populate an atom
04:44ro_stwe currently use dynamic vars to store our System/getenv values, so that we can use binding to mutate them in midje contexts for testing
04:44ro_stwell, not mutate, rebind
04:44weavejesterro_st: I believe Clojure 1.3 or 1.4 has a function called with-redefs
04:45weavejesterro_st: You can use it to redefine a var within a scope
04:45jsyrjalaany idea when lein 2 is released? it is only preview 2.0 now
04:45weavejesterro_st: e.g. (with-redefs [env (merge env {:foo "bar"})] (your-tests))
04:46weavejesterjsyrjala: I imagine we'll be seeing a beta soon, as a lot of people are already using it a lot. But you'd have to ask technomancy :)
04:47ro_sthere's what we do: https://www.refheap.com/paste/4440
04:47ro_stworks beautifully
04:47ro_sti guess this is just as good as your with-redefs option, except yours supports the use of environ :-)
04:50weavejesterro_st: You approach will also work with older versions. Though I like with-redefs because it means I don't have to change my code to accomodate my tests.
04:50ro_sttrue
04:50ro_stwe're on 1.4 anyway
04:51ro_sti like that environ supports project.clj too. great for long lived config variables and api keys that are server independent
04:52azkeszhow can I undef a def-ed var?
04:54weavejesterazkesz: ns-unmap
04:55weavejesterazkesz: (ns-unmap *ns* 'foo) should do it, I think
04:55ro_st*downloads weavejester's talk*
04:56ro_stweavejester: what do you use for logging?
04:57weavejesterro_st: I haven't settled on something I like, yet...
04:57azkeszweavejester, thank you, that works awesomely
04:57ro_sthave you seen timbre?
04:58ro_stlooks pretty good. i like that you can write your own appenders. so you could push data off to a store, or into an atom (which then gets retrieved and sent as a log of the work done in that web request, for eg) or whatever
04:58ro_sthttps://github.com/ptaoussanis/timbre
04:59ro_stall pure clojure, too. no log4j braindeath
04:59jsyrjalahow about tools.logging?
04:59ro_sttoo much log4j braindeath :-)
04:59vijaykiran"tools.logging helps, but it doesn't save you from the mess of logger dependencies and configuration hell."
05:00weavejesterro_st: No, I hadn't seen timbre… hm...
05:01ro_stexcellent. i got to pay you back, a little :-)
05:01weavejesterro_st: Ack, no, I don't like timbre so much now I look at it
05:01ro_st… or not. haha
05:01ro_stwhy not?
05:02weavejesterro_st: Oops, sorry :)
05:02weavejesterro_st: I've gotten used to treating log messages as maps
05:03ro_stbut it is a map?
05:03ro_sthttps://github.com/ptaoussanis/timbre#custom-appenders, 3rd last line of code sample
05:03ro_stargs map
05:03weavejesterro_st: The API isn't set up that way, though
05:03sandboxhi, does anyone here know things about clojure on heroku? specifically i've recently started getting an error deploying that states 'LEIN_NO_DEV=y: command not found'
05:03ro_sti believe you can pass anything to the logging fns
05:04weavejesterro_st: I mean, I can't write (log {:foo "bar"}). It assumes things like levels and messages and stuff
05:04azkeszin this example, how would I append the string " printed" after thoser args ?(I tried cons/conj they prepend): http://cljbin.com/paste/502e0881e4b050e15148aaba
05:05sandboxi'm not entirely sure how the heroku buildpack works but if someone knows and could help me out that would be greatly appreciated, otherwise i can wait for a response from heroku
05:06weavejesterro_st: The appenders of timbre look okay, but everything looks very traditional logging.
05:06weavejesterro_st: And atoms for configs I don't like...
05:06ro_stwhat do you use?
05:07ro_stsome custom lashup? or tools.logging?
05:07weavejesterro_st: I've been developing some functions for myself, but nothing in a releasable state yet.
05:07ro_sti'm kinda surprised this particular thing isn't like totally solved for clojure already
05:07clgvcemerick: ping
05:07ro_stseems like it's the perfect problem for the solution that is clojure :-)
05:08CmdrDatsi'd love general (log) function in clojure.core that does nothing until you plug in tools.logging or something
05:08weavejesterro_st: In my view, most logging libraries get it wrong, so even with Clojure, it'll take a while before it can be done right
05:08weavejesterI'm a little opinionated about logging :)
05:09ro_stheck, you could use lamina too, i guess
05:09jsyrjalai hope that it doesn't happen like in java: everybody creates their own logging thing, then it is noticed that they do not interoperate, then come logging facades
05:09ro_stinstead of logging down to disk, you log up to the cloud
05:10ro_stthis talk was very interesting to me https://vimeo.com/45132054
05:11weavejesterYeah, Zach's talk helped form some of the opinions I have on logging
05:11weavejesterBut I haven't completely finished thinking about it
05:12weavejesterJust enough to come to the opinion that most logging has historical routes in linear text logs
05:12weavejesterAnd what we really want is a database of maps
05:12weavejesterYou'd need a timestamp, and who put the log in, but not necessarily levels or messages.
05:12ro_styeah. i think a key mindset shift is moving away from an archive of activity to a firehose of 'now'
05:12azkeszdatomic?
05:13weavejesterdatomic could do, but the pretty much anything would work...
05:13hiredmandatomic scales reads, not writes
05:13weavejesterro_st: Exactly
05:13azkeszall writes are serialized? but not the reads?
05:14weavejesterwrites are atomic in datomic
05:14weavejesterBut reads can be distributed
05:14ro_stwhat i like about lamina (if i understand it correctly) is that you just point it at your code and it instruments everything for you, no explicit logging calls.
05:14azkeszi like it, i wanna learn :)
05:15ro_stso you could just instrument and push all that data down some channel to a sink like a database or whatever, but at any time you can plug some viewer onto the channel and watch in real time
05:15weavejesterro_st: Yes, I like that approach… I'd need to think a little more about whether that's suitable in all circumstances, though.
05:16ro_sti speak from a standpoint of a complete lack of practical experience, of course. so i don't know how ideal that is in practice
05:16weavejesterAnyway, I gotta go
05:20clgvdoes cemerick's add-classpath in pomegranate not work for java projects? I have the following failing scenario: (add-classpath "my-dep.jar") (import 'my.dep.SomeClass) which gives a ClassNotFoundException for my.dep.SomeClass. I thought that should work
05:32tomojhas defn metadata gone before the params with no ^ for a long time?
05:36clojure-newcomerhi guys, I'm able to check metadata on a function as it stands in the REPL…. but I can't check the metadata on the same function when it is passed as a param to another function… does that make sense ?
05:36clojure-newcomerjust trying to get my head round a little introspection
05:44ro_stthat's because the meta is on the var, not the function the var points to
05:45clojure-newcomerro_st: can I resolve the function to get to somewhere I can query the metadata ?
05:45ro_sti believe so, although i don't know how
05:45clojure-newcomerro_st: or is that metadata lost to me the minute the fund goes into another func as a param ?
05:46ro_sthttp://stackoverflow.com/questions/5592306/how-do-i-dynamically-find-metadata-for-a-clojure-function
05:46clojure-newcomerro_st: *func
05:46clojure-newcomerro_st: that link looks helpful.. ail lead through, thanks
05:49clojure-newcomerro_st: nice, all good, thanks for that
05:49ro_stcool
06:18clgvtomoj: since 1.2 at least
06:19clgvclojure-newcomer: you can create the variable name from the class name of a defn instance
06:20clgvclojure-newcomer: the stack overflow answer is cheating^^
06:20clgvat least the accepted
06:21clgv,(class map)
06:21clojurebotclojure.core$map
06:21clojure-newcomerclgv: do you mean there are performance implications or complexity etc ?
06:22clgvclojure-newcomer: no. it just wont work, if you really get a function as object passed to a function where you want to query the metadata
06:22clgv,(meta map)
06:22clojurebotnil
06:23frankHi, could anyone help, I am having a wierd problem.
06:23hyPiRionfrank: Ask the question instead of asking for help ;)
06:23frankI am getting the following error: Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.RuntimeException: No reader function for tag ordered/map
06:24frankwhen running "lein ring server"
06:24weavejesterfrank: What does your project.clj file look like?
06:24frankafter running "lein new compojure hello-world; cd hello-world"
06:25frankfollowing the instruction in getting started in the compujure github page.
06:25weavejesterfrank: You haven't changed anything else?
06:25frankNope, nothing
06:25frankI just installed the newesrtversion of JDK 1.7 on the Mac
06:25frankAnd ran lein upgrade
06:26weavejesterWhich version of Leiningen are you using?
06:26franklein version │
06:26frankLeiningen 2.0.0-preview8 on Java 1.7.0_06 Java HotSpot(TM) 64-Bit Server VM
06:28weavejesterI'm on preview7 - let me upgrade to 8 and see if there's a problem.
06:28frankBTW, thx for the amazingly quick reply :-)
06:29frankAh, that could be it, am wondering though what it means, I find it a mysterious error message
06:30weavejesterfrank: I get the same error now in preview8
06:31frankOkay, mystery solved, now for the solution. What is going wrong you think?
06:31azkeszhow to append an item to a list ?
06:32bosiedo i always have to write (defn f [] …) if my function has no params?
06:32clojure-newcomerweavejester: a bit off topic sorry, but your username is cool… whats the story behind it ?
06:33weavejesterclojure-newcomer: "them am weavejesters" was the best anagram that could be made out of my name
06:33jsyrjalabosie: yes
06:33weavejesterazkesz: To the end of a list?
06:33bosiejsyrjala: ok
06:34weavejesterfrank: No idea… I'll need to investigate. Possibly a problem with eval-in-project.
06:34clojure-newcomerweavejester: definitely a good way to come up with a name
06:34weavejesterclojure-newcomer: It worked for voldemort ;)
06:35azkeszyes
06:35jsyrjalabosie: or (def f (fn [] ...)), but that doesn't help much
06:35azkeszI tried cons/conj but they prepend instead
06:35azkeszand I fail to find how to append, even though I'm betting it's expensive
06:37azkeszweavejester, i need it for something like this(just for tests): http://cljbin.com/paste/502e1e5de4b050e15148aabb
06:37frankweavejester: ok, I will either downgrade to preview7 or spend some time looking at the changes to see if I can figure out what is going wrong. Not sure if my Clojure is up to snuff for that though
06:37frankthx for the help
06:37weavejesterazkesz: Why not use a vector?
06:38weavejesterfrank: I'll look into this. It might be a bug in preview8, or it might be some incompatibility introduced. Maybe the syntax of a function is now different.
06:39azkeszweavejester, like convert args to vector ?
06:40azkeszthat works
06:40weavejesterazkesz: what exactly are you trying to do…?
06:40azkeszsomething like this(works in repl, but it still prints the quotes around the string): http://cljbin.com/paste/502e1f35e4b050e15148aabc
06:41clgvazkesz: there is a better method to alter the output of print for a custom datastruture you use. it's defining an implementation of the multimetoh print-method for that type
06:41azkeszI'm trying to redefine prn(in my own ns for now) and still call the old prn, but with an extra parameter at the end
06:41azkeszbut I'm doing this just for tests, while learning clojure
06:42clgvazkesz: for learning clojure thats probably a weird idea ;)
06:43azkeszyeah I know but, it's kinda fun to do it this way, rather than just read a book(although I'm doing that too)
06:43hyPiRionI don't know, fogus usually implement parts of the language he learns.
06:43hyPiRionAnd he seems like a smart guy.
06:43clgvhyPiRion: I meant it not in that generality ;)
06:43clojurebotTitim gan ?ir? ort.
06:44hyPiRionheh
06:44antares_Elastisch 1.0 RC1 is out: http://groups.google.com/group/clojure/browse_thread/thread/e7267051fd370e73 (or http://clojureelasticsearch.info)
06:45azkeszok it basically works just like prn, but still I have to wonder, is it possible to append to a list directly?
06:45azkeszreturning the new list, ofc
06:46hyPiRionazkesz: Do you mean like ##(concat (range 4) [:foo]) ?
06:46lazybot⇒ (0 1 2 3 :foo)
06:46clgvantares_: what is "elastic search" in comparison to "search"?
06:46antares_clgv: ElasticSearch is a distributed search engine, much like Solr but for modern age
06:48azkeszhyPiRion, yep that's the one
06:49azkeszworks as expected http://cljbin.com/paste/502e213fe4b050e15148aabd
06:50clgvantares_: that should be on the first page ^^
06:50antares_clgv: ElasticSearch is a pretty popular project and it is pretty easy to find the right site in google, I think most people will figure out what it is
06:50bosiehuh, replace-first prints the output?
06:50azkeszI gotta say, clojure is the answer to my prayers :D all of those little things that I considered lacking in java, are "fixed" in clojure
06:51clgvantares_: ok. I just wanted to know what it is you are announcing to decide whether I am interested to read more ;)
06:52clgvantares_: I just asked since the start page of http://clojureelasticsearch.info/ didnt help me
06:52antares_clgv: if not, you can always go to clojurewerkz.org and find something more relevant to your needs :)
06:52antares_clgv: I understand, I will add a link to elasticsearch.org
06:57bosienow i get this error: ClassCastException java.lang.String cannot be cast to java.lang.Number clojure.lang.Numbers.equiv (Numbers.java:206)
06:57bosiei know what causes it but how would i get from this exception to the actual line?
07:02antares_bosie: it should be there in the full trace
07:02bosieantares_: hm. repl doesn't output a full trace by default?
07:03azkeszwhat's the command for showing the last stacktrace ? I see ccw has the button for it
07:04azkeszI mean, if there's a function for it or maybe a dynamic variable like how *clojure-version* is
07:05azkeszor like ##*source-path*
07:05antares_bosie: correct
07:05azkesz,*source-path*
07:05clojurebot"NO_SOURCE_FILE"
07:05bosieantares_: lemme check
07:06hyPiRionazkesz: ##(pst) ?
07:06lazybotjava.lang.RuntimeException: Unable to resolve symbol: pst in this context
07:06hyPiRion,(doc pst)
07:06clojurebot"([] [e-or-depth] [e depth]); Prints a stack trace of the exception, to the depth requested. If none supplied, uses the root cause of the most recent repl exception (*e), and a depth of 12."
07:06azkesz##(*clojure-version*)
07:06lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap
07:06azkeszthanks hyPiRion =)
07:06hyPiRionAnytime.
07:07azkeszthat worked the pst
07:09bosieantares_: so the standard procedure is to use "java -cp …. clojure.main -i bla/bla/bla.clj" ?
07:09azkeszsymbols like *e are thread local dynamic and like *err* *in* *out* are global dynamic ? is that the convention(or where can i read about this exactly)
07:09antares_bosie: the standard procedure is to use leiningen and lein run
07:10antares_bosie: or use something like SLIME that will always output full traces
07:10bosiek
07:10antares_bosie: leiningen.org has all the info about getting lein ;)
07:10antares_(and don't worry about 2 not being final yet, many many active projects have been using it for a while)
07:11azkeszI see that binding can make any *var* to be threadlocal inside the binding block
07:11bosiei have lein already
07:12antares_azkesz: http://tech.puredanger.com/2010/02/17/clojure-stack-trace-repl/
07:12bosiethanks antares_
07:13magopian,(take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))
07:13clojurebot(0 1 2 3 4 ...)
07:13magopianso strange, it looks instant, however it timeouts on 4clojure Oo
07:18azkesz,(print-cause-trace *e 3)
07:18clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: print-cause-trace in this context, compiling:(NO_SOURCE_PATH:0)>
07:19azkesz,(pst)
07:19clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Throwable>
07:19weavejesterfrank: Lein-Ring 0.7.3 now works for preview8
07:19nbeloglazov&(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))
07:19lazybot⇒ "Elapsed time: 189.69069 msecs" (0 1 2 3 4 5 6 7 8 9 11 22 33 44 55 66 77 88 99 101 111 121 131 141 151 161)
07:20nbeloglazov,(take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))
07:20clojurebot(0 1 2 3 4 ...)
07:20nbeloglazov ,(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))
07:20clojurebot"Elapsed time: 10.978599 msecs"
07:20clojurebot(0 1 2 3 4 ...)
07:20nbeloglazov &(time (doall (take 1000 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))
07:21azkesz"Elapsed time: 306.868192 msecs"
07:21nbeloglazov:)
07:21hyPiRionmagopian: Clojail is a bureaucratic jail, where everything takes time.
07:21nbeloglazov ,(time (doall (take 26 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0))))
07:21clojurebot"Elapsed time: 5.292717 msecs"
07:21clojurebot(0 1 2 3 4 ...)
07:22nbeloglazovmagopian: are you sure it timeouts on simple tests? Not on hard?
07:22azkesz,(time (reduce + (doall (take 1000 ((fn [start] (filter #(= (seq (str %)) (reverse (str %))) (iterate inc start))) 0)))))
07:22clojurebot"Elapsed time: 487.041191 msecs"
07:22clojurebot40634649
07:23bosieis this wrong for :dependencies in project.clj "[org.clojure/clojure "1.4.0"]"}
07:23bosie?
07:23bosieno works
07:23bosienvm
07:23hyPiRionseems good
07:23azkeszyeah I have the same thing
07:25azkeszhow would one return the printed string instead of (just) printing it ##(time 1)
07:25lazybot⇒ "Elapsed time: 239.320027 msecs" 1
07:25magopiannbeloglazov: no clue, maybe it does timeout on hard ones, i just thought it would pass the first one (the easy one ;) green before timeouting on the others, seems i was wrong
07:25Sweden_jackazkesz: You want to print to string?
07:26azkeszSweden_jack: time already prints it, but what if I wanted to return it, as a function return value?
07:26hyPiRionazkesz: ##(with-out-str (time 1))
07:26lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
07:26hyPiRionTry it in your own repl.
07:26Sweden_jackDid you try googling "print to string Clojure"?
07:26azkeszyeah that works hyPiRion
07:26azkeszI didn't Sweden_jack :)
07:27Sweden_jackSeems to me like that finds what you're looking for :)
07:27magopiannbeloglazov: i wanted to try the "obvious" solution first ;)
07:27magopiani'm gonna think about the "good" one now
07:28magopian(well, think about how to program it, i think i know what the solution should be)
07:28azkeszSweden_jack, you're probably right, but I'm happy with hyPiRion's solution, also interesting to see ##(source with-out-str)
07:28lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
07:28magopian,(source with-out-str)
07:28clojurebotSource not found
07:28magopian$(source with-out-str)
07:28Sweden_jackazkesz: http://clojuredocs.org/clojure_core/1.3.0/clojure.core/with-in-str
07:29magopianwrong one ;)
07:29Sweden_jackOops, http://clojuredocs.org/clojure_core/clojure.core/with-out-str
07:29Sweden_jack;P
07:30azkeszawesome, how did you get that url ? I'm hoping from some script?
07:30azkeszor just type in that search bar?
07:31azkeszI wonder if clojure bots could trigger on source and show an url instead
07:31Sweden_jackazkesz: I personally used a keyword search (http://kb.mozillazine.org/Using_keyword_searches) but ClojureDocs generally shows up in search results as well
07:31nbeloglazov$cd with-out-str
07:31lazybotclojure.core/with-out-str: http://clojuredocs.org/v/1652
07:31lazybotclojure.core/with-out-str: http://clojuredocs.org/v/5848
07:32nbeloglazov$source with-out-str
07:32lazybotwith-out-str is http://is.gd/3ZQwpP
07:33nbeloglazovazkesz: you can use cd or source command for lazybot ^^
07:33hyPiRionazkesz: That should be doable - would probably be some fork.
07:33azkeszthank you, that's very clever
07:33hyPiRion~botsnack
07:33clojurebotThanks! Can I have chocolate next time
07:33hyPiRion~chocolate
07:33clojurebotIt's greek to me.
07:33azkeszlol
07:34Sweden_jack(don't feed it chocolate...)
07:34nbeloglazovonly source seems broken in lazybot :(
07:34azkeszit worked for me, but for 1.2 branch
07:35azkeszin this line: (let [s# (new java.io.StringWriter)] is s# the name of the variable ? or something special about it?
07:35Sweden_jackazkesz: it's a macro thing
07:36hyPiRionYeah, you should learn macros before diving into gensyms and backquotes.
07:36Sweden_jackIt basically creates a new symbol with a unique name, it's generally a bit neater than in Common Lisp
07:36azkeszoh i see, ##(`(x#))
07:36lazybotjava.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn
07:37Sweden_jackazkesz: (maybe wait a bit before diving into macros)
07:37azkeszalright, back to reading
07:38azkeszI'm only like page 77 of manning clojure in action
07:38hyPiRionazkesz: It's a thing to look forward to though. It's a very powerful construct. Keep it like a carrot to continue learning Clojure ;)
07:38azkeszthough I can't promise I'll remember anything:))
07:40azkeszbut in that context, why was it necessary to generate uniquely named local variable, it's not like it would overwrite (locally) some other same named variable right?
07:40azkeszi mean here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4181
07:41Sweden_jackazkesz: Do you know how macros work?
07:41hyPiRionazkesz: Imagine if it was just (let [s (new StringWriter)] ...) instead.
07:41azkesznope but I can guess why it was needed now lol
07:42Sweden_jackIf you don't create a variable with a unique name it might capture some non-free variable outside of the macro
07:42hyPiRionthen doing (let [s "hello"] (with-out-str (println s))) would expand to (let [s "hello"] (let [s (new StringWriter)] ... (println s))), which screws you up
07:42azkeszunderstood, that makes sense now
07:44azkesz,`(x#)
07:45clojurebot(x__27__auto__)
07:45Sweden_jack,(gensym)
07:45clojurebotG__56
07:45azkesz,(gensym)
07:45clojurebotG__83
07:46azkeszis it ever possible that the body could've already manually defined a variable which the next s# or gensym would create? or they auto detect if that variable was already taken and advances the counter to try next one?
07:46hyPiRionazkesz: Nope, it's impossible.
07:47bosieantares_: ok, so i got it to work with leiningen
07:48bosieantares_: but lein run is even slower than my regulara java apps (due to compiling)…. kinda defeats the purpose no?
07:48antares_bosie: it is very common to use REPL during development, with something like SLIME/swank or nREPL
07:49antares_I was saying that once you need to run an app, it is very uncommon to do it the way you run ruby or python programs (for example)
07:49bosieantares_: honestly, i use vim/intllij ;)
07:49antares_the same goes for lein test, SLIME/swank and probably vimclojure stuff lets you run tests without JVM restarts
07:49antares_as for La Clojure, I am not sure. I only use IDEA for Java :)
07:50antares_bosie: I am pretty sure VimClojure has support for this. Maybe ask on the mailing list? Sorry, I am an Emacs/IDEA user and can't help with that.
07:50azkeszlooks like the counter increases directly proportional with the number of chars that I type in repl (except spaces) (in eclipse+ccw at least), I found that interesting :)
07:50bosieantares_: coming from java, i would just miss all the goodies from intellij in vim ;(
07:51hyPiRionbosie: Both vim and emacs are extensible, so you can add those features if you want to :)
07:51hyPiRionI would be surprised if not someone has done something like that already.
07:51antares_bosie: La Clojure has REPL integration but probably not test runner that reuses the same JVM
07:51bosiehyPiRion: it is undone for java… would be surprisd if it were happening for clojure
07:51antares_hyPiRion: it will be pretty hard to implement Clojure/Java completion IDEA has
07:52bosiehyPiRion: rubymine beats vim, easily. which i hate
07:52antares_emacs and vim can do not-so-trivial completion but only with SLIME and without interop awareness
07:53bosieantares_: i only know what rubymine is capable of and that is miles ahead of vim
07:53antares_bosie: Vim for Ruby and SLIME are not really comparable
07:53antares_SLIME has code structure awareness, that's its main purpose
07:54bosieantares_: right. i don't know slime
07:54bosieantares_: so slime does refactoring?
07:54rbarraudHow about jack? ;-)
07:55antares_bosie: for Clojure it cannot do everything (you need to implement some adapters for every Lisp) but for Common Lisp it does
07:55bosieantares_: cool
07:55antares_and "find callers" kind of navigation
07:55antares_like Find Usages in IDEA
07:55antares_bosie: you can also try Nailgun
07:55antares_which is not specific to any JVM language
07:56bosieantares_: and create variables/methods/extract methods etc?
07:56antares_and override the command IDEA runner uses to run things over Nailgun
07:56bosiek
07:57antares_bosie: SLIME is a huge project and I don't know all of its capabilities but I don't think it focuses on refactoring operations like those you've mentioned
07:58antares_mostly navigation and find usages kind of things, documentation, REPL-oriented development
07:58antares_like eval-ing a region or buffer or form
07:58bosiebut it basically allows me to change a line in a code that is currently running and it dynamically loads those changes ?
07:58hyPiRionbosie: change function definitions, yeah
07:59hyPiRionand defs.
07:59antares_bosie: you will need to re-eval it (like the entire buffer/file) if your tools don't do that but yes, it sends code to the JVM you already ahve running and it is compiled and reloaded there
07:59antares_clojure-test-mode in emacs does it for you, you don't need to re-eval test files
07:59antares_or implementation files, for that matter
08:00antares_just hit C-c C-, and see a green or red line
08:00bosiewas more thinking along the lines of changing some number and see the changes right away
08:00antares_edit something, save, repeat
08:00bosienot necessarily about tests, but that is cool too
08:00bosiethanks guys
08:00antares_bosie: in that case you can either use a REPL buffer or reinstall a function with C-x C-e
08:00bosieappreciated
08:00XPheriorCan anyone help me write a macro to take a form and double it? IE (the-macro '(a b)) => ((a b) (a b))
08:00bosiegtg
08:00antares_REPL buffer is basically REPL inside your editor, so you can do multi-line editing easily
08:01antares_XPherior: something like (defmacro doublah [form] `(do ~form ~form)) ?
08:02antares_XPherior: the key for macros that produce lists of forms is to not forget the (do …) part
08:02XPheriorantares_: Ah. Yeah that's what I was missing. Also, I was trying to splice it with ~@
08:03antares_XPherior: you can use splicing if you want, too
08:03antares_as long as that's a collection
08:04XPheriorantares_: Hm, okay. Thanks :)
08:07XPheriorBe right back.
08:40XPheriorWhy does: (defmacro show [body] `(do ~body ~body)) and (show '(1 2)) return (1 2) ?
08:40XPheriorI'd expect it to spit back ((1 2) (1 2))
08:41stuartsierraWhen you "invoke" a macro, the expression it returns gets evaluated.
08:41XPheriorstuartsierra: Right. So how is it possible that my expectations evaluate to (1 2)?
08:42stuartsierra`do` returns the value of the last expression inside it.
08:42XPherior... Doh
08:42XPheriorHow does one return multiple forms from a macro, then?
08:43stuartsierrareturn a list
08:43XPheriorOh wait! I did it! `'(~body ~body)
08:43hyPiRionXPherior: Wrap it in vector or list
08:43XPheriorI was really overthinking this one.
08:46jweissis there a clojure FAQ somewhere that includes common pitfalls like "map is lazy"?
08:47stuartsierraclojurebot: faq?
08:47clojurebotFAQ #1 is http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b
08:48stuartsierraok, that's not what I meant
08:48stuartsierrahttp://dev.clojure.org/display/doc/FAQ
08:49jweissthat doesn't include the "map is lazy" problem
08:49stuartsierraSo add it.
08:49jweissok :)
08:49jweisswould that require a signed contrib agreement?
08:50stuartsierraoh shucks, I don't know
08:50stuartsierraprobably yes, because that's how you get wiki edit access
08:50jweissi'll try, probably about time i signed the agreement anyway
08:50stuartsierrathanks
09:06N8DawgHello Clojurists, I was wondering, a want a collection type which is non-standard, its basically a sorted-set-by but of a max-size, items can only be added when the set is full by displacing an existing item
09:06N8Dawgbasically, is there one out there already, or if not how would one go about building one?
09:07hyPiRionwhat do you mean by "displacing an existing item"?
09:07hyPiRionShould the structure remove the item for you, or should you get an error when it is full?
09:08N8Dawgit should remove and add the new item
09:08hyPiRionWhat item should it remove?
09:08N8Dawgbasically imagine i want the top 100 items of a seq with is 10000000 items long
09:08N8Dawgi could sort the entire set and take 100
09:08N8Dawgwhich is inefficient
09:09nz-N8Dawg: https://github.com/clojure/core.cache
09:09N8Dawgor I could build this collection type and reduce across irt
09:09hyPiRionUse priorityqueue
09:09hyPiRionLet me look it up
09:11N8Dawgnz-: So you suggest building something like a max-cache of a fixed size
09:11hyPiRionOkay, what you want is something like a max heap with a fixed size.
09:12tomojevery function has its own class, yes?
09:12N8DawghyPiRion: Yes if the heap is sorted
09:13nz-N8Dawg: well, cache doesn't provide ordering, so it wont suit you
09:14clgvtomoj: yes
09:14tomojso might it make sense to extend protocols to function's classes?
09:16hyPiRionI thought this was something already implemented. Huh.
09:17clgvtomoj: no idea. why do you want to do that?
09:17clgv,(class map)
09:17clojurebotclojure.core$map
09:18N8DawghyPiRion: Basically i'd like to wrote something like: (reduce conj (bounded-sorted-set 100) collection)
09:18clgvtomoj: or do you mean extending a protocol to clojure.lang.Fn?
09:18tomojno
09:18clgv,(-> map class ancestors)
09:18clojurebot#{clojure.lang.IFn java.lang.Object java.lang.Runnable java.util.concurrent.Callable clojure.lang.IObj ...}
09:18hyPiRionN8Dawg: Yeah, I realized.
09:19tomojI'm thinking about automatic differentiation
09:19clgvhow would you differentiat `map`?
09:19tomojI considered a metadata flag, but then I have to maintain a special list of exceptions
09:19tomojor vary-meta
09:20tomojalter-meta! or whatever
09:26tomojwell I would extend Differentiable to map and put the implementation there
09:26tomojit would assume f is Differentiable
09:26tomojare you asking what the implementation is?
09:27clgvtomoj: you do this as a hobby project or for work?
09:28tomojI'm not doing it yet, just thinking about it. hobby (that could someday be useful for work..)
09:30hyPiRionN8Dawg: I would just use (take 100 (sort ...)) as a temporary solution, and try to look up some PriorityQueue with a fixed size
09:31hyPiRionSomeone really should have made one.
09:31clgvtomoj: well in most interesting cases you would have to differentiate numerical...
09:31tomojnot in the cases I am interested in
09:31clgvpolynomials?
09:31tomojmostly simple matrix math, some simple nonlinearities
09:32clgvok
09:32tomojbasically I want to port theano to clojure
09:33tomojto my knowledge they don't need to use numerical methods for the derivatives, but I could be wrong
09:35jsabeaudryIs org.clojure/tools.logging the general consensus when it comes to logging?
09:55acheng /msg leafw ping
09:55@Chouserthat didn't work.
10:06achengi have this impression that jobs-where-clojure-is-one-of-the-main-languages-used are few and therefore require more programmer-skill to get than jobs for other languages. is this accurate or inaccurate?
10:08nDuffacheng: Folks with production experience with Clojure are also fairly few.
10:09Wild_Catas a non-mainstream language, Clojure requires, by definition, that you have invested some time of your own to learn it. Which usually implies more skills or at least more curiosity than the norm.
10:09achengnDuff: heh, my users are co-workers so i don't count
10:09hyPiRionacheng: It's a good conclusion, but I disagree with the reasoning to the conclusion.
10:09achenghyPiRion: what's a better reason?
10:09nDuffacheng: ...I can't give you a definitive answer, but last time I was job-hunting, there was at least one shop that was willing to hire me for a Clojure-centric position despite having only hobbyist experience at the time.
10:10achengnDuff: did you take it? :)
10:10nDuffacheng: ...granted, they were willing to hire me largely because I had experience in large-scale provisioning and deployment automation
10:10nDuffacheng: No.
10:10@Chouseracheng: that may be. I know there are a few places hiring Clojure devs that are having some trouble finding applicants that match their requirements.
10:11achenga recruiter just told me to learn scala instead.
10:11achengsigh
10:12achengsure i'll learn both. but i'm pretty sure i know which i'll always prefer
10:12Wild_Catin my (very) humble opinion, if you're going to learn a language like Scala, you might as well go all the way and learn Haskell instead
10:12hyPiRionarbscht: I haven't solid evidence, but I believe that companies who see the value of Clojure have bosses with higher technical competance than other bosses.
10:12@ChouserI think most shops that have chosen Clojure want a small team of top notch devs. Therefore getting a Clojure job right now may require one to be able to demonstrate they are top notch.
10:13@ChouserLonoCloud is hiring top notch Clojure devs: http://lonocloud.com/careers.html
10:14nDuff*nod* -- they're the folks I was talking to
10:14hyPiRionAnd I usually consider higher technical competance in a boss as higher technical competance in their underlings.
10:14scriptoronce you understand FP, haskell isn't even that hard
10:14scriptorbut a lot of companies seem to be starting to tinker with scala
10:14@ChousernDuff: May I ask why it didn't work out?
10:14achengare there Haskell jobs?
10:15scriptorsome, not as widespread
10:15nDuffChouser: Something came up with offices in Austin and extremely competitive pay
10:16@ChouserI think Relevance is also hiring
10:16achengthe class i took in haskell/ml was dominated by a jerk who sat down front -- he'd ask questions every two minutes that no one else could hear and it totally disrupted the lecture flow.
10:16hyPiRionYeah.
10:16@ChousernDuff: Ah, sure. What language are you using there?
10:16scriptorChouser: do you have to relocate to NC?
10:16xeqiwow, you have to download a pdf to see the job description
10:16@Chouserscriptor: I don't think so.
10:16nDuffChouser: They're officially a Java shop, but as I'm my own team, I can get away with Clojure for most things.
10:16@ChousernDuff: cool.
10:17achengnDuff: your team consists of you? :)
10:17Wild_Catscriptor: well, I've dabbled in Haskell, and kept finding things about its purity and balls-out laziness that disrupted my workflow more than it helped me.
10:18nDuffacheng: *nod*. Not as fun as it sounds -- place drew me in by interviewing with some of the smartest people I've met, and then I barely work with them in practice.
10:18Wild_Cat...that, and the community, while helpful, felt far too buried in PL theory and academic research for my tastes.
10:19scriptorhmm, I'll have to keep relevance in mind next time I go lookin
10:19@Chouserscriptor: and LonoCloud, right? :-)
10:19Wild_Cat(hence my learning Clojure, which, ironically for a Lisp, feels a *lot* more practical -- plus, I'm finally starting to get the elegance of the Lisp idiom)
10:19scriptorChouser: eww california ;)
10:20@Chouserscriptor: just to visit! It's a fully distributed team
10:20scriptoroh, really?
10:20xeqinDuff: is there a clojure group in austin?
10:20@ChouserAnd visiting San Diego occasionally is quite nice.
10:20nDuffxeqi: Yup -- just had a meetup this Monday
10:20scriptorI've gotten too used to non-telecommuter jobs where I just look at the location and leave
10:20redingerscriptor: No, Relevance doesn't require relocation to NC
10:20Wild_Catwhile we're on the topic of user groups: is there one in Montreal?
10:20achengif y'all could be a bit dumber, i'd stand a chance at being average :-P
10:21xeqiah, http://www.meetup.com/Austin-Clojure-Meetup/ it looks like
10:21scriptorredinger: are all interviews over the phone/skype?
10:21jkkrameris there something like a clojure-jack-out command? slime-disconnect doesn't appear to kill the swank server
10:21scriptorChouser: it is, been there once a while ago
10:21redingerscriptor: We do a phone interview, tech screen and remote pairing session. Then we bring you into the office for a day with the team here
10:21stuartsierrajkkramer: At the SWANK REPL, type a comma then type "quit"
10:21@Chouserah, there you go.
10:22redingerBut, half of our team is remote
10:22@ChouserI work at LonoCloud in case that wasn't yet obvious.
10:22achengstuartsierra: is that different than sayoonara?
10:22stuartsierraacheng: I don't think so
10:22achengstuartsierra: ok. just cultural preference :)
10:22scriptorChouser: figured, prinicipal software engineer eh?
10:23jkkramerstuartsierra: thanks. forgot about the comma commands
10:23scriptorwill let you know once I have 8 years of experience
10:27@Chouserscriptor: ok! or when you become as capable as someone who has 8 years experience...
10:33cshell_redinger: where do you work?
10:33redingercshell_: Relevance
10:35bosiewhat does ~ do?
10:35nDuffbosie: inside a syntax-quote, it causes something to not be treated as quoted.
10:36bosiek
10:36nDuffbosie: ..."unquote" is the keyword to search for in the docs.
10:37cshell_redinger: ah cool - I came into the conversation late, who is hiring a principal software engineer in Clojure?
10:37redingercshell_: Lonocloud
10:37ejacksonhow about an unprincipled one ?
10:37nDuff...in hindsight, Lonocloud may have actually been a better choice, with the position in question being ops-automation-centric.
10:37cshell_redinger: thanks
10:37redingerejackson: I think they are all set in that dept. ;)
10:38@Chouserejackson: not interested, thanks. ;-)
10:38@Chouserhey!
10:38ejacksonhehehe
10:40cshell_Chouser: that posting looks like it's from March - are you having trouble finding the right person?
10:42cshell_or is it just that you only hire principal software engineers? :)
10:42bosiewhats a principal software engineer?
10:42@Chousercshell_: I think it's more than just one position. We've hired a few people since March
10:43cshell_Chouser: cool, what % of your code is Clojure?
10:45@Chouseroh, probably around 90%. There's some JS for the browser (though that's being transitioned to clojurescript now) and some Java for providing interop for customers.
10:45bosieChouser: do you have problem finding _high quality_ clojure programmers in your area?
10:46cshell_Chouser: or just clojure programmers in general?
10:47@Chouserbosie: we're very intent on adding only high quality devs to the team, so that does narrow the pool, but we hire from all over the country. In fact I think we now have devs working from each time zone of the US.
10:48jsabeaudryWild_Cat, yes there is, it's called Bonjure
10:48bosieChouser: oh, you are doing remote hiring. that should of course solve your problem ;)
10:48cshell_that's awesome, I think that's a good philosophy to follow - hire the best regardless of where they live
10:49@Chouserbosie: well, helps. :-)
10:50Wild_Catjsabeaudry: ah, nice, I'll check it out once I come back from my vacation in France
10:51@Chouserwe just had our (roughly quarterly) physical meeting a couple weeks ago. This time they put us up here: http://goo.gl/maps/tuCZX
10:53clgvChouser: I hope there was no formal dresscode required ;)
10:55@Chouserno, though we did have lunch at a place one day that required collared shirts and close-toed shoes. Caused a bit of a panic among the team, but it worked out ok.
10:56scriptorbut you could still wear jeans?
10:56bosieChouser: cos you guys figured out you could order online? ;)
10:56@Chouserscriptor: heh, yes.
10:58bosiewhats wrong here: (defn current-path ((java.io.File. "") .getAbsolutePath))
10:58S11001001bosie: files aren't functions
10:58Wild_Catbosie: you're missing the argument vector here.
10:59bosieWild_Cat: thanks
10:59Wild_Cat...in fact, you probably want a regular def, not a defn -- or possibly even a let binding.
10:59Wild_Catwait, nevermind that.
11:00scriptorChouser: what kind of stuff do you guys typically work on? I see mentions of distributed archs and clouds
11:00bosieWild_Cat: and i also have to swap the two things
11:00Wild_Catyup.
11:00bosieWild_Cat: (.getAbso (java.io.file "")
11:00bosielogical
11:00bosiedan
11:02@Chouserscriptor: yep, distributed algorithms and services, virtual resource management, basically all the tricky bits needed by most of the more complex apps as they transition to the cloud.
11:03@Chousermaking use of all the normal clojure tech, but in some areas using ClojureScript, core.logic, or monads as appropriate.
11:04bosieChouser: distributed algorithms in the cloud? hadoop replacement?
11:04scriptorwhere does the distributed bit come in, managing all the machines behind the cloud?
11:05@Chouserbosie: oh, I don't think that's quite an accurate characterization. But there are contexts where hadoop is not currently a good choice, such as if the pool of servers used needs to change dynamically during a long run or for other reasons.
11:06bosieChouser: or if you want to run it quickly on less than 5TB of data ;)
11:08@Chouserscriptor: that, but also providing libraries for developers of apps that need to span multiple servers
11:08@Chouserbosie: :-)
11:12azkesz,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
11:12clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
11:40@rhickeyagent users - more pool flexibility: https://github.com/clojure/clojure/commit/f5f4faf95051f794c9bfa0315e4457b600c84cef
11:40@rhickeyconfigure the global pools and send-via a specific executor
11:41cshell_sweet, rich!
11:41trptcolinfantastic - thanks!
11:42stuarthallowayI think it needs some type checking and error messages to prevent misuse :-)
11:42trptcolinany plans for something similar for futures?
11:42hyPiRionAh, decoupling. Nice.
11:43cshell_it always feels great to decouple
11:43@Chouserexcellent
11:45@rhickeyfutures will get same soon
11:45@rhickeyhoping to build future pool in ForkJoin
11:45@rhickeyon
11:46dnolennice
11:46nDuffVery nice.
11:46@rhickeygotta run, have fun!
11:46trptcolinnice. and i just realized futures' executors will be customizable already because they use Agent/soloExecutor under the hood. seem right?
11:46@Chousersend-via is key. I have converted code from using agents to using executors directly because of not having this.
11:46nDuff...being able to have a separate pool for those would be very convenient.
11:47trptcolinalthough since the executor static you probably want more flexibility with futures anyway (per-execution)
11:48bosiehow is clojure financed these days?
11:48bosieback when i first looked at it it was through donation
11:48nDuffbosie: Many of the core contributors are employed by Relevance, which does consulting/training/whatnot
11:49bosiek
11:51pjstadighow does this affect shutdown-agents?
11:51pjstadigi guess you're responsible for your own pools
11:54y3diso is disclojure gone for good?
11:56trptcolinpjstadig: looks like shutdown-agents calls .shutdown on both soloExecutor and pooledExecutor, so assuming your executor honors those, wouldn't it be fine?
11:57trptcolinderp, of course i totally missed the binding version
12:06antifuchshugod: so ritz is failing to install deps for me when trying to get leiningen:leiningen:jar:2.0.0-SNAPSHOT
12:06antifuchshugod: this seems immensely weird, what's going on? (:
12:09hugodantifuchs: ah - leiningen doesn't publish snapshots - I had those in my local repo. I'll change them to preview8, hold on.
12:09antifuchsheh. I dropped the :dev dependencies for now (:
12:12antifuchshugod: how do you try out ritz vs emacs?
12:12antifuchshugod: as in, how do you run it? (:
12:12TimMcreiddraper: ^ see rhickey's ANN above re configuring agent threadpools
12:12hugodi do `lein ritz` and then M-x slime-connect
12:13antifuchshugod: it seems to have some stale source's code somewhere
12:13antifuchscomplains about symbols in a line that I fixed. do you compile anything / deploy somewhere?
12:14antifuchsmy question is, how do you test your development version while you develop?
12:15antifuchs("test" is a loaded term, let's say "use") (:
12:22hugodantifuchs: ritz runs two vms - the "debugger" and the "user" vms for want of better names - there is no way to eval code in the debugger vm, but you can eval code normally in the user vm
12:23hugodthis is something that I fixed in the nrepl-ritz, which can eval code in either vm, which makes dev much more pleasant
12:24antifuchsyeah, I don't really mind that. I just want the most convenient way to run the code that is currently in my ritz checkout as a swank server
12:24antifuchsright now, it's loading stale code ):
12:24antifuchsso the swank server can't start up, and no amount of lein clean'ing fixes it ):
12:25hugodthis is lein2 I take it
12:26antifuchsyeah (:
12:27technomancy_weavejester: what exactly was the trouble you were seeing with tagged literals in lein-ring?
12:27hugodantifuchs: did you run `lein install` in lein-ritz too?
12:28weavejestertechnomancy_: I was passing the project map to a function via eval-in-project
12:28antifuchsI think I did try
12:28weavejestertechnomancy_: As I didn't want to put too much logic in the plugin, I just passed the whole map
12:28technomancy_weavejester: oh, so the form would fail if the project didn't have ordered and clojure 1.4?
12:28weavejestertechnomancy_: But in preview8, the map contains an ordered map literal
12:28weavejestertechnomancy_: Yep
12:28technomancy_I see. hrm.
12:28hugodantifuchs: each version of lein-ritz tries to load it's corresponding version of ritz. So in profile.sclj you'll need 0.4.0-SNAPSHOT as well
12:29weavejestertechnomancy_: I solved it just with select-keys - taking only the keys I needed
12:29technomancy_I think that's the right solution, I'm just concerned that breakage is going to happen elsewhere.
12:29hugodantifuchs: or RITZ_VERSION=0.4.0-SNAPSHOT lein ritz should work with any version of lein-ritz
12:29technomancy_the problem is that bugs coming from unordered :repositories would be very nasty and hard to track down =\
12:30weavejestertechnomancy_: Yeah, I probably shouldn't be passing the whole project map in anyway
12:31technomancy_well... not in this context anyway
12:31technomancy_dsantiago: is this going to cause trouble for configleaf?
12:32antifuchsohhhhhh
12:32antifuchshugod: oho, that might do it. will try when I get home!
12:55antifuchshugod: that RITZ_VERSION string works, but it seems I have to "lein install" in the ritz dir every time
12:56antifuchsah, hm, appears I can do this in the ritz/ dir too, not only the ritz/lein-ritz dir
12:58hugodantifuchs: right, to run your local changes you will need to be in the ritz dir
12:58antifuchsok, cool.
12:58antifuchsthink I got it now (:
12:59antifuchsnow, to debug why this isn't connecting (:
12:59hugoda lot of pieces to get right...
12:59technomancy_any windows users running into this? https://github.com/technomancy/leiningen/issues/674
12:59hugodantifuchs: 'lein ritz 4005 localhost :log-level :trace' will give you a ton of output
13:00antifuchsyeah, it's what I'm doing now (:
13:00antifuchs(just not getting a ton of output. don't mind, I'll figure it out)
13:01hugodthe port and hostname are required in order to specify :log-level
13:02antifuchsah, oops (:
13:03dsantiagotechnomancy_: Not sure I understand the question?
13:04technomancy_dsantiago: the project map now contains tagged ordered map literals
13:04technomancy_so if you're going to try to read it from the project process, it'll fail unless you have ordered and 1.4+ on your classpath
13:05dsantiagoOh, hm. Yeah, well, it needs to handle the project map, so if that's not a data structure from clojure.core, it's gonna have a bad time.
13:05dsantiagoBut why wouldn't that be fairly easily fixable?
13:06technomancy_well you have to choose between a dependency upon ordered and the horrors of undefined :repository order
13:08dsantiagoSure, sure. I mean, if you're saying just adding an ordered dependency would fix it, that seems OK by me.
13:08technomancy_yeah, I guess as long as you don't need to support pre-1.4, you'll be good
13:08technomancy_since you can easily just add a dep to configleaf
13:09dsantiagoYup.
13:14scriptorhmm, the clojure35 coupon for joy of clojure still works
13:16antifuchshugod: yay, it seems to be working (:
13:19technomancy_any users of lein trampoline want to review a patch for me?
13:20antifuchshugod: how's it supposed to do backtraces? my canonical example of (/ 1 0) on the REPL just shows "; Evaluation aborted on java.lang.ArithmeticException: Divide by zero."
13:21nz-_what is this ritz thing? and how it is different from normal slime?
13:21technomancy_it should provide a significant speedup.
13:21hugodantifuchs: M-x slime-break-on-exception
13:22hugodI just changed the default to have it switched off
13:22antifuchsnz-: it's a less insane implementation of the swank side; you use normal slime, but ritz on the clojure side
13:22antifuchshugod: huh
13:23antifuchshugod: is that something that the swank decides? that seems odd (:
13:24hugodantifuchs: there are some issues with having it on by default - pretty much every exception is regarded as "caught" by the JVM, due to clojure's copious use of try-finally scopes
13:24antifuchshmm. that seems suboptimal
13:24hugodSo you get to see many exceptions
13:25hugodThe default filters take a stab at just showing you a reasonable subset
13:25technomancyemezeske: interested in your thoughts on https://github.com/technomancy/leiningen/commit/f9da16e37a3aa86b21321aceaea40a45541596d7 if you have a moment
13:25technomancysince you and your cohorts are probably the biggest trampoline users
13:26antifuchshugod: so I wonder how swank-clojure does this. it didn't look too spammy, re. backtraces
13:26emezesketechnomancy: Neat idea!
13:27emezesketechnomancy: So it wouldn't have to load the first JVM to know the trampoline command?
13:27technomancyemezeske: exactly
13:27technomancyemezeske: I believe that the trampoline task should always be a pure function, so it should be safe to memoize
13:27emezesketechnomancy: And the project.clj is hashed as part of invalidating the cache?
13:27hugodantifuchs: you were not using the jvm debugger there, I think, just seeing the exceptions that are truly uncaught.
13:28technomancyaye
13:28antifuchsoohhh
13:28emezeskeThat was the one corner case I could think of
13:28antifuchshugod: that makes sense
13:28hugodantifuchs: ie, after the stack had been unwound
13:28emezesketechnomancy: I think that should work great, although I agree it should be opt-in for a while
13:28antifuchsyeah, I was wondering about that. good to see it can be un-unwound, too (:
13:29technomancycool
13:30emezesketechnomancy: Damn it, my IRC client apparently lost it's nickname color cache. You just aren't the same in teal
13:30technomancyheh
13:30technomancyis the shasum executable present on OS X and Cygwin?
13:30scriptorlooks like it's on osx
13:31technomancyI wonder if posix specifies a standard name
13:31emezeskeWTF, shasum comes from the "perl" package on my ubuntu machine
13:32scriptorsourcing my shasum gives..weird errors
13:32technomancyany cygwinners?
13:32technomancyor (gasp) solarites?
13:32technomancyLicenser: you're on solaris, right?
13:33scriptorhmm, might depend on which cygwin packages you install, but I really have no clue
13:33Licensertechnomancy I use SmartOS yap
13:33technomancyLicenser: is shasum present?
13:34Licenseron smartOS yes
13:34technomancycool; thanks
13:34technomancybash doesn't have any equivalent of deleteOnExit, does it?
13:35Licensercksum -x sha256 is also valid on solaris
13:35technomancygood to know
13:35technomancywe'll go with shasum unless cygwin hates it
13:35rlbtechnomancy: you'd have to do it yourself I think, via 'trap EXIT ...'
13:35Licenserso I think cksum is preffered
13:36technomancyLicenser: why's that?
13:37technomancyFWIW it doesn't even need to hash to the same value across machines, just consistently locally
13:40technomancyrlb: thanks
13:42technomancyrlb: do you know if that will trigger if the script "exits" via execing another?
13:44@Chousertechnomancy: from my bash wizard friend: trap 'do something; exit' 0 1 2 3 15
13:44Licensertechnomancy because it's a pluggable system :) and more guaranteed to be present.
13:44technomancyChouser: the numbers indicate signals?
13:44@Chouserhe says that won't be triggered if you exec
13:45@Chouser"put cleanup in a function; call it from both places"
13:45technomancyChouser: oh, I actually do want it triggered for exec
13:45@Chouseryes, the numbers are signals
13:45@Chouserexcept 0 which is normal exit
13:46technomancyerr--I don't necessarily need it triggered at the time of exec, I just need it triggered at least when the exec'd process exits
13:47technomancyI guess I can do science to it
13:47l1xhey guys, how can i apply a java function to all the members in a hash-set and capture the result (only strings) in a list?
13:48y3dihas anyone messed around with neo4j?
13:48@Chousertechnomancy: "then don't exec; just run and exit"
13:50technomancyit's cleaner if I can exec, but I guess it doesn't matter
13:50emezeskel1x: (map (memfn yourMemberFunction) your-hash-set)
13:52l1xemezeske: awesome! (map (memfn getCanonicalName) (jmx/mbean-names "hadoop:*")) it just works like charm
13:53@Chousertechnomancy: he also wants me to note that bash, sh, and ksh treat trap differently. This advice only applies to bash.
13:53@Chouserwow, memfn!
13:55nz-somebody mentioned today about problems with heroku deploy
13:55nz- Running: LEIN_NO_DEV=y lein deps
13:55nz- /app/slug-compiler/lib/../../tmp/buildpacks/clojure/bin/compile: line 91: LEIN_NO_DEV=y: command not found
13:55technomancynz-: oh?
13:55nz- ! Failed to build.
13:55nz- ! Heroku push rejected, failed to compile Clojure app
13:55technomancynz-: I fixed that a couple days ago; are you still seeing it?
13:55nz-I have same thing noe
13:56nz-should I update heroku toolbelt?
13:56SegFaultAX|work2nz-: I think that's coming from the buildpack.
13:56technomancyno, it's not client-side. if you give me the app name I can investigate further
13:56technomancyfeel free to /msg me
13:56nz-ok, just a minute
14:00_ulisesnz-, technomancy: I was having the same issue this morning; I haven't checked if it's been fixed since
14:00_ulisesnz-, technomancy: I even started with a plain-vanilla clojure project (lein new) to see whether it was anything to do with my old project but nope
14:01technomancy_ulises: are you using lein2 locally?
14:01_ulisestechnomancy: no, lein1
14:02technomancy_ulises: here's a temporary fix; I should have something better soon: heroku config:add "BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-clojure.git#v4&quot;
14:02technomancyemezeske: btw, just pushed fast trampolines to master. export LEIN_FAST_TRAMPOLINES=y to try it out
14:02technomancy^ or anyone else interested in faster project boot via trampolines
14:03_ulisestechnomancy: that did it; thanks!
14:03emezesketechnomancy: woot!
14:04technomancy_ulises: did you try lein2 and have problems with it, or are you just on lein1 because you haven't gotten around to upgrading?
14:04_ulisestechnomancy: I haven't gotten round upgrading though it's in my TODO list
14:05_ulisestechnomancy: should I add that fix to my other projects or wait for a push from you?
14:05technomancy_ulises: I hope to have a fix out in a few minutes
14:05_ulisestechnomancy: cool; I'll hang out then
14:05SegFaultAX|work2technomancy: What's the easiest way to upgrade lein to 2?
14:05SegFaultAX|work2technomancy: I'm currently on 1.7.1
14:05technomancythat config will block you from getting buildpack updates in the future, so you'll want to drop it once this is fixed
14:05technomancyclojurebot: upgrading to lein 2?
14:05clojurebotlein is not the best way to learn java
14:05technomancyclojurebot: shut up
14:05clojurebotExcuse me?
14:06technomancyclojurebot: upgrading to leiningen 2?
14:06clojurebotupgrading to leiningen 2 is easy with this handy upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
14:06technomancythere we go
14:06rlbtechnomancy: wrt exec, didn't know myself offhand, but I'm not surprised if it doesn't work there. And note that you can also use the symbolic signal names, i.e. EXIT, INT, etc.
14:06_ulisestechnomancy: what was broken if you don't mind me asking?
14:06technomancy^ SegFaultAX|work2: ^
14:06SegFaultAX|work2technomancy: Thank'ye
14:06technomancy_ulises: I've added support for auto-detecting lein1 vs lein2 and the lein1 section has a bug in detecting whether you want dev/test stuff on the classpath.
14:07borkdudeSo, what must I do to get clojure code highlighted in html5?
14:07_ulisestechnomancy: right
14:07_ulisestechnomancy: so the alternate workaround is to upgrade to v2 ;)
14:08technomancy_ulises: that'd be ideal =)
14:08_ulisestechnomancy: soon enough :)
14:16ibdknoxLight Table 0.1.0 is up :D
14:16ibdknoxhttp://www.chris-granger.com/2012/08/17/light-table-reaches-010/
14:16technomancy_ulises, nz-: fix is pushed, just need to wait for it to propagate to the build machines.
14:16scriptor(inc ibdknox)
14:16lazybot⇒ 7
14:16borkdudeibdknox upgrading
14:17_ulisestechnomancy: thanks and yay \o/
14:18technomancy_ulises: ok, it's live now
14:19antifuchsibdknox: ugh, unsigned .jar ):
14:19antifuchsibdknox: os x 10.8 complains heavily and refuses to open it
14:19_ulisestechnomancy: pushing; will keep you updated
14:20borkdudeibdknox it seems to hang on "starting server", OSX here
14:21antifuchsibdknox: (of course, java -jar launcher.jar works, but that's not exactly as advertised)
14:21technomancypeople still run OS X in restricted mode?
14:21ibdknoxantifuchs: that's OS X being retarded
14:21ibdknoxI haven't moved to 10.8 yet
14:22ibdknoxtechnomancy: they turned it on by default with the latest update... :(
14:22antifuchsthey did
14:22technomancyibdknox: I would have thought everyone with the slightest bit of technical chops would have turned it off by now
14:22antifuchsand I'm not likely to turn it off (:
14:22ibdknoxtechnomancy: (me too)
14:22casionwhy would you leave it on?
14:22dnolenibdknox: SWEET
14:22antifuchsbecause I want to see what breaks.
14:22antifuchsalso, I like getting ridiculed in public
14:23casionI wasn't ridiculing you… yet
14:23borkdudeibdknox didn't know I had to download a launcher, never mind
14:23casionnow I think I will though ;)
14:23technomancyI guess it makes sense if you want to feel the pain of nontechnical users
14:23antifuchscasion: go on, it'll only reduce my motivation to contribute
14:23casion10.8 still isint usable for me anyway, not till avid updates their shit
14:23casionantifuchs: I was kidding :(
14:24antifuchsok ok (:
14:24technomancywe got bitten by that with the heroku client; all the macoseckists working at heroku turned off restricted mode the day they upgraded, so no one noticed the fact that our installer was getting blacklisted until the support tickets started rolling in.
14:24antifuchsso far, 10.8 has worked well for me, and the gatekeeper warnings have not been super annoying
14:25antifuchsor rather, this was the first that I saw that wasn't something I could live without
14:25ibdknoxtechnomancy: do you remember what you guys had to do to fix it?
14:26scriptoribdknox: small bug, when the tutorial has you enter code in the scratchpad, you can't enter a space in the scratchpad (unless you enter shift+space)
14:26technomancyibdknox: we had to sign up for a bullshit developer package and load a bunch of apple-approved certs into our CI box
14:26ibdknoxgr
14:26ibdknoxscriptor: ah, thanks, should be an easy fix :)
14:30dnolenibdknox: you didn't mention ClojureScript support in this version did you?
14:30antifuchswell well well. light table seems pretty nice and usable so far
14:30ibdknoxdnolen: I pulled it, it'll show up in not too long :)
14:30dnolenibdknox: gotcha, cool
14:31ibdknoxdnolen: it works as far as I know, but didn't have time to really test it and didn't want to release that until it happens
14:33_ulisestechnomancy: success! thanks again
14:35muhoohehehe, google closure makes javascript look like java
14:36stuartsierramuhoo: That's kind of the point.
14:36stuartsierraOr really, the point is to turn JS into a statically-compiled language.
14:37antifuchsibdknox: looking at ritz source code, the function overview of a lot of namespaces shows tons of (defslimefun …) forms
14:37antifuchsibdknox: would be interesting if LT could disambiguate them a bit (:
14:37ibdknoxantifuchs: you'll be able to specify rules for that
14:38antifuchsneat! (:
14:38ibdknoxantifuchs: didn't make it into this release, but hopefully the next
14:38scriptormuhoo: with GWT and all, probably not a coincidence :)
14:38antifuchsthere's this emacs thing that automatically disambiguates emacs file buffer names. it's really pretty good.
14:39jkkramer_ibdknox: on save, table seems to have removed all top-level comments from the file I was working on
14:40antifuchslike, have files ~/projects/foo/test/stuff.clj ~/projects/foo/lib/db/stuff.clj and ~/projects/something-else/test/stuff.clj open and it'll name them test/stuff.clj, db/stuff.clj and something-else/stuff.clj respectively. Very handy.
14:40gfredericksI'm having a surprisingly hard time coming up with a hacky way to parse some JSON from the middle of some not JSON
14:41Bronsaibdknox: i get "Error: Could not find or load main class lighttable.server"
14:42Bronsawait, i did light update, I'm trying with the launcher, maybe that's it
14:44muhoogfredericks: i'd guess the first task would be to separate out the json from the not-json, then send the json to something like cheshire?
14:44Bronsayeah, that was it
14:45gfredericksmuhoo: the second part is easy
14:46nz-antifuchs: do you happen to remember name for that emacs disambiguation thing?
14:47technomancynz-: it's uniquify
14:54mattmoss,(bytes [1 2 3])
14:54clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [B>
14:55dnolenibdknox: I did notice Light Table seems a bit slow if you load a largish file.
14:56dnolenibdknox: I mean slow to show the contents of the file initially.
14:56ibdknoxdnolen: yeah, it's creating a bunch of editors, which is really slow right now
14:57dnolenibdknox: ah individual CodeMirror editors?
14:57ibdknoxdnolen: yeah. I think we're going to work with Marijn a bit on that :)
14:57kovasbI wish it was easy to retain the exact same syntax highlighting, and just move the active editor from cell to cell
14:58kovasbno need to have more than 1 editor at a time, can only type in 1 place at once
14:58ibdknoxideally though, the thought was you wouldn't open full files a bunch
14:59kovasbibdknox: evaluating (+ 1 1) in scratch gives me clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: + in this context, compiling:(NO_SOURCE_PATH:2:2)
14:59@Chousertechnomancy: isn't "$INPUT_CHECKSUM" = "" always true on line 250 [this from a friend]
14:59kovasbibdknox: also, the spacebar didn't work while the tutorial mode was active
14:59ibdknoxkovasb: did you connect to a different project? it's probably in a NS that doesn't exist
15:00ibdknoxkovasb: yeah, just fixed the spacebar thing
15:00kovasbibdknox: connected to existing project right as the first thing i did
15:00ibdknoxhm
15:00ibdknoxit should fix itself if you open an editor
15:00kovasbjust reloaded. in the user namespace it works
15:01@Chousermattmoss: did you want (into-array (map byte [1 2 3]))
15:01kovasbwent into a namespace, not working
15:05mattmoss@Chouser: I was trying to figure out what makes a byte[][] signature using into-array. Figured it out: (into-array (class (byte-array nil)) ...)
15:05mattmossCalling into a Java API that uses byte[][] in a few places.
15:06@Chouserah
15:10@Chousermattmoss: another option: (make-array Byte/TYPE 4 4) for a 4x4 byte[][]
15:11mattmossChouser: Thanks... though I suspect the details of the byte[] values, it is an opaque object handed to me that I have to hand back later... so I don't really know the actual contents/dimensions.
15:12@Chouserok
15:34ibdknoxdnolen: ah, I also just realized I originally pushed one with only optimizations simple. Just uploaded a new 0.1.0 with advanced, that'd probably speed it some (though not immensely)
15:34dnolenibdknox: cool.
15:34ibdknoxdnolen: to force it to download again, just remove ~/.lighttable/bin/
15:35dnolenibdknox: thx
15:42eggsbyhmm, what's the simplest way to set http headers for all routes in compojure... just some sort of middleware?
15:46emezeskeeggsby: That sounds right to me.
15:46eggsbyjust wanted to make sure there wasn't some other convention
15:53AWizzArdAre non-primitive type-hints allowed (i.e. useful to not need to type-hint in later use) in deftypes?
15:54technomancyChouser: INPUT_CHECKSUM is set when LEIN_FAST_TRAMPOLINES is on
15:55technomancybut checking for LEIN_FAST_TRAMPOLINES might be better?
15:55technomancyI wanted to also support setting it on a per-project basis with touch .lein-fast-trampolines
15:55@Chouserah, I see.
16:07AWizzArdOh hmm. Why is .al not hinted to return an ArrayList :-( (deftype Foo2000 [^ArrayList al])
16:08amalloyAWizzArd: within the body of the deftype just referring to al works
16:08amalloybut it's stored as just an Objecr field, so external clients don't know it's an ArrayList
16:10AWizzArdYes, inside the body it’s working. I just thought it would be nice to see it on the outside too. Wouldn’t hurt.
16:10nyashhi, just playing with clojure and I am surprised by this behaviour: http://ideone.com/PYfYj Why is the output so different?
16:13symuynHey, I'm having trouble with a sequence transformation. If I wanted to change (2 0 0 2 5 0 9 0 0 0 10 2) into (() 2 (0 0) 2 () 5 (0) 9 (0 0) 10 () 2), how would I do this?
16:13symuynThe point of this is to count how many zeroes precede (or follow, maybe) each non-zero item.
16:14eggsbynyash: quote is a special form, not a function
16:14xeqi&(partition-by (partial = 0) '(2 0 0 2 5 0 9 0 0 0 10 2))
16:14lazybot⇒ ((2) (0 0) (2 5) (0) (9) (0 0 0) (10 2))
16:15xeqiwell, not quite
16:15emezeskenyash: Have you used macroexpand to look at what your macro is expanding to?
16:15emezeskenyash: I think if you look at that, you will understand the problem
16:15symuynHmm, yeah, I can't see how I'd do it with partition, or just partition, xeqi
16:16nyashemezeske: ah I see => (str quote (1 2 3)). Any way that I could prevent it from getting inserted?
16:17eggsbyhmm, is there any way to see what 'let' expands to?
16:18emezeskenyash: Since you're writing a macro, you don't need to quote the forms you pass to it
16:18eggsbyi.e. is it ever possible to see something like (let [x 1 y 2] (+ x y)) as (+ 1 2)
16:18emezeskenyash: So just (applies str (1 2 3)) should work just fine
16:18nyashemezeske: ah I see thank you.
16:19eggsbylet expands to let*, but the source for let* is not found... hm
16:20Raynesibdknox: Light table will never be successful unless you go the extra step and have a launcher that downloads an installer that downloads an installer that requires 2 consecutive restarts.
16:21technomancyRaynes: implemented in Adobe AIR, naturally?
16:21RaynesEven better.
16:21ibdknoxRaynes: technomancy: have you ever installed VS?
16:21ibdknoxI shit you not it required 4 restarts
16:21Raynesibdknox: No, but I've heard stories.
16:21technomancywat
16:21Raynes4!?!? I thought it was 2 and *that* horrified me!
16:22_tcaeggsby: that's not what let does anyway, if you want to see the values in place use symbol-macrolet
16:22ibdknoxthey eventually got it down to 2
16:22technomancyrestart... is that like when you start and then you start again?
16:22ibdknoxtechnomancy: reboots
16:22@Chouser,((fn f [xs] (lazy-seq (when (seq xs) (let [[zeros [num & more]] (split-with zero? xs)] (list* zeros num (f more)))))) '(2 0 0 2 5 0 9 0 0 0 10 2))
16:22technomancyoh, I've heard of those
16:22clojurebot(() 2 (0 0) 2 () ...)
16:22ibdknoxhaha
16:23technomancythey're for footwear enthusiasts, right?
16:23ibdknoxyep! We don't promote shoes with LT
16:23Raynesibdknox: How big is whatever this thing is 'fetching'?
16:23ibdknox28mb I think
16:24RaynesMethinks it might have stopped trying.
16:24Raynesibdknox: Where from?
16:24ibdknoxs3
16:24ibdknoxit was going a bit slowly for me eearlier
16:24RaynesI'm far enough away from the router to make it moderately slow, but I don't think it has moved in 5 minutes.
16:24RaynesOh, there it went.
16:25ibdknoxs3 must be getting hit hard
16:25RaynesIt didn't occur to me that the bar was so short.
16:25RaynesIt was exactly one equal away from being done.
16:25Raynes:p
16:25symuynJeez louise, Chouser—haha, thank you
16:25ibdknoxI think there are 20 segments if I remember right
16:25@Chousersymuyn: :-)
16:25symuynI was hoping it'd be possible without lazy-seq, but, oh well
16:25@Chousersymuyn: I'm sure there's something simpler, but maybe not that returns a lazy seq
16:26Raynesibdknox: omg block creature thingy cool
16:26symuynYeah, I mean recursion, of course
16:26symuynBut thank you again
16:26ibdknoxhaha
16:26RaynesHow long is connecting supposed to take?
16:27ibdknoxRaynes: however long it would normally take for eval-in-project to spin up for that project
16:27RaynesOkay, then should it give me an error if something went wrong?
16:28ibdknoxI *think* so, but there's definitely a non-zero possibility that something went wrong and I couldn't catch it
16:28ibdknoxspeaking of...
16:28RaynesApparently so.
16:28amalloyChouser, symuyn: zero? breaks on anything but numbers. i'd use #{0} rather than zero? if you're not sure your whole sequence will contain only numbers
16:28RaynesIt is just sitting there and hates me and stuff.
16:28ibdknoxtechnomancy: leiningen calls (system/exit) a lot
16:28semperosconnecting with lighttable was a little quirky for me today
16:28Raynesibdknox: Was I supposed to have lein-light and stuff set up.
16:28Raynes?
16:29amalloynot more than once per instance, i'd hope, ibdknox
16:29symuynYeah, amalloy, it's actually not for numbers at all; the predicate can be general of course
16:29ibdknoxRaynes: nope
16:29semperosfirst attempt at connecting to an existing project brough up no namespaces
16:29technomancyibdknox: always via leiningen.core.main/exit, hopefully?
16:29technomancywhich can be suppressed
16:29ibdknoxah
16:29symuynamalloy: It's for a sequence of string lines, and I want to determine how many blank lines precede (or succeed) each non-blank line
16:31Raynesibdknox: Good news, looks like it didn't break the second time around.
16:31ibdknoxyay
16:32ibdknoxonly sort of good news though
16:32ibdknoxinconsistent bugs are the hardest to fix :p
16:33RaynesThis looks really cool.
16:33RaynesNo paredit, but cool nonetheless.
16:34Raynes;)
16:36Raynesibdknox: Yo.
16:36Raynesibdknox: Can I change the codemirror color theme used?
16:37ibdknoxRaynes: hm, you could modify the jar, but I haven't made that stuff "easy" yet
16:37RaynesAw. I'd like to use the tomorrow night theme I wrote for refheap.
16:37RaynesSpeaking of which, you should look at it and make it default. Or, I mean, look at it.
16:39Raynesibdknox: You know what would be really cool?
16:39ibdknoxRaynes: space!
16:39RaynesIf you could arrange a sort of function-level dependency tree.
16:40RaynesAnd then rearrange the file based on it.
16:40ibdknoxRaynes: yeah, that's one of the next things on my list
16:40RaynesNot by default, but having it as an option would be cool.
16:40ibdknoxRaynes: being able to easily navigate the call tree so you can build that context up really quickly
16:40ibdknoxooo
16:40ibdknoxI misunderstood
16:41ibdknoxyou can drag and drop, but yeah, still manual right now
16:41ibdknoxit probably wouldn't be that hard to have it automatically order it
16:41AWizzArdibdknox: can you give a wc on clj vs. js?
16:41RaynesI'd be cool if the var (form?) list was a tree or something.
16:41ibdknoxAWizzArd: wc?
16:41AWizzArdshell tool
16:41RaynesNaNNaNNaNNaN
16:42ibdknoxoh it's all written in CLJ and CLJS
16:42ibdknoxI haven't written any JS myself
16:42AWizzArdAh (-:
16:42AWizzArdYou let the computer write it for you. Neat.
16:43AWizzArdAnd can you give loc of clj vs. cljs?
16:43ibdknoxoverwhelmingly CLJS
16:44AWizzArd20/80 ?
16:44ibdknoxlooks like around 1300 lines of CLJ and 3300 lines of CLJS
16:44ibdknoxthat includes the libs I wrote though
16:44ibdknoxso that's not quite right
16:44ibdknoxjust a second
16:45ibdknoxah, no it doesn't.
16:45ibdknoxThat appears to be the actual breakdown :)
16:46ibdknoxa lot of that will get cleaned up though
16:46ibdknoxmy suspicion is that in reality LT is about 3500 lines
16:46Raynesibdknox: How many lines of genreated js if you pretty print? ;)
16:46Raynesgenerated*
16:47ibdknox30k
16:47ibdknoxlol
16:47RaynesHaha
16:47ibdknoxwith simple optimizations on
16:47ibdknoxin dev?
16:47ibdknoxI think it was about double
16:47ibdknoxsomething stupidly high
16:48Raynesibdknox: refheap has never looked better than it does in light table.
16:48RaynesEven with this hideous color scheme.
16:49ibdknox:p
16:49RaynesPlease, for the love of God, make it possible to change that thing soon.
16:49RaynesI'll go write code on refheap and then copy it back to light table. :P
16:49ibdknoxhatin' on my colors
17:07Raynesibdknox: So, how do I add functions again?
17:12FrozenlockOh sure, just when I ask technomancy to stop being so awesome so that I could stop being ashamed of myself, ibdknox makes a new move.
17:13FrozenlockI should stop hanging in #emacs and #clojure, it's hard for my self esteem :(
17:14technomancyFrozenlock: or you could help out with Leiningen =)
17:15technomancynewbie tickets: https://github.com/technomancy/leiningen/issues?labels=Newbie&amp;milestone=&amp;page=1&amp;state=open
17:15devinuscan anybody tell me what neat things are going into clj 1.5?
17:16hyPiRiondevinus: Reducers is the main thing as of now, I believe.
17:17devinusReducers are the big 1.5 feature?
17:17Frozenlocktechnomancy: I'll take a look!
17:19hyPiRiondevinus: It's not a gamebreaking feature, but it's the one I know as of now.
17:19devinusit sounds interseting
17:20hyPiRionMr. Hickey also decoupled agents earlier today, so that you're now able to choose what thread pool it should be in
17:20hyPiRionSo it's more or less performance all the way (?)
17:21devinusoh nice
17:21devinusi was wondering if there was a way to do that earlier this week
17:43pepijndevosWhat is the most complete JNA wrapper for clojure? The one chouser wrote 3 years ago?
17:50SegFaultAX|work2Light Table 0.1.0 is being glitchy :(
17:51muhoohttps://www.refheap.com/paste/4451 w?
17:51muhoono checksums available from org.sonatype.aether wat?
17:53muhooFrozenlock: clojure has been great for my skillset, but absolutely horrible for my self esteem
17:53muhoothese guys are frickin' geniuses
17:54devnit's far better to be the worst guy in the band
17:54RaynesThan to not be in the band at all.
17:54technomancymuhoo: invoking pomegranate directly?
17:55technomancyyou can change its checksum policy
17:55muhootechnomancy: yes, via add-dependencies
17:55technomancymuhoo: but you should yell at the incanter devs; not having checksums sucks
17:55muhook, will do
17:56pepijndevosdasl https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html
17:58dnolenibdknox: whoa, that's a lot of CLJS
17:58dnolenibdknox: still, that's suprisingly little code for how much functionality you guys already have.
17:59bosiewhy is this false: (.equals "5" (get "12345" 4))
17:59dnolen,(get "12345" 4)
17:59clojurebot\5
17:59dnolen(= "5" \5)
17:59dnolen,(= "5" \5)
17:59clojurebotfalse
17:59bosieright
17:59dnolenbosie: String & Character are not the same.
18:00amalloyi didn't know get worked on strings
18:00bosiehm
18:00SegFaultAX|work2amalloy: Doesn't get work on any seq?
18:01nz-is there somewhere a log of this channel?
18:01bosiednolen: wrapping it in (str) ?
18:01SegFaultAX|work2nz-: Your backlog, for starters.
18:01dnolenbosie: yeah could do that or just compare to \5
18:01dnolen,(.equals \5 (get "12345" 4))
18:01clojurebottrue
18:01amalloySegFaultAX|work2: certainly not
18:01bosiednolen: \5 doesn't work either
18:01bosiehm
18:01nz-anything more reliable?
18:02bosieoh
18:02bosie\5 not "\5"
18:02dnolennz-: http://clojure-log.n01se.net
18:02SegFaultAX|work2amalloy: Oh, well sets I guess wouldn't make sense. But surely any fixed key seq, no?
18:03amalloyseqs don't have keys
18:03nz-ok, thanks
18:04hyPiRionget works on sets.
18:04SegFaultAX|work2amalloy: Position is a key.
18:04hyPiRion,(get #{1 2 3} 2)
18:04clojurebot2
18:04nz-so lein2 preview8 doesn't seem to work with compojure/ring projects
18:05weavejesternz-: Try lein-ring 0.7.3 if "lein ring server" is causing problems
18:05bosiednolen: so why can i write \5?
18:05SegFaultAX|work2hyPiRion: I wouldn't rely on that though, since the ordering is arbitrary.
18:05bosiednolen: and not like '5' or "5"
18:05SegFaultAX|work2bosie: \5 is the character 5. Not the string nor the number, the character.
18:05technomancySegFaultAX|work2: get on sets doesn't use ordering
18:05amalloySegFaultAX|work2: you are saying nonsense to me and to hyPiRion
18:05hyPiRionSegFaultAX|work2: Get doesn't work like that.,
18:06bosieSegFaultAX|work2: i know
18:06technomancyheh
18:06SegFaultAX|work2amalloy: Oh? What am I missing?
18:06hyPiRionWow, heh.
18:06jlewisamalloy: finally got to the bottom of my bug from the other day, by the way. it turns out that it was caused by http://dev.clojure.org/jira/browse/CLJ-829
18:06hyPiRion,(get #{:a :b :c} :c)
18:06clojurebot:c
18:06Frozenlocktechnomancy: I wanted to give a shot at this one https://github.com/technomancy/leiningen/issues/638, but I can't even find where the tests are generated! Could you give me a hint? :)
18:06jlewiswhich was fixed in clojure 1.4. megablah.
18:06SegFaultAX|work2Oh, I'm getting nth mixed up with get.
18:06amalloyget is not related to indexes, in general
18:06SegFaultAX|work2Disregard.
18:07technomancyFrozenlock: oh, I think that one's already fixed; it's in the lein-newnew project
18:07technomancyit just hasn't been pulled in by leiningen yet because I need to cut a release
18:07hyPiRionThink of sets as maps where both key and value have same value.
18:07amalloyjlewis: you had some iterator issue?
18:07FrozenlockOh...
18:07amalloyand it's somehow related to transients?
18:08nz-weavejester: tried but now it complains about Caused by: java.lang.ClassNotFoundException: clojure.lang.IHashEq
18:08FrozenlockWell at least after browsing the source code I have a better understanding of how it works :)
18:09nz-but time for bed
18:09weavejesternz-: Not sure what would cause that...
18:09nz-i'll investigate it more on weekend
18:09weavejesterGoodnight
18:17antifuchsoh bloody swank::%cursor-marker%
18:18zakwilso1So lighttable is looking good, but I can't seem to find any way to have it either eval everything in a namespace or in the document. Do I have to use load-file for now, or is there a better way to do this?
18:20Gnosis-is there a way to tell the Clojure compiler that a function is pure, for optimization purposes?
18:22technomancyGnosis-: unfortunately not
18:22SegFaultAX|work2What additional optimizations could occur if such information was available to the compiler?
18:22Gnosis-so the compiler assumes that no functions are pure?
18:23Gnosis-SegFaultAX|work2: memoization, maybe? I can't think of anything else off the top of my head
18:23zakwilso1A sufficiently smart compiler and/or runtime could automatically parallelize or memoize pure functions.
18:24SegFaultAX|work2At the cost of infinite memory, maybe.
18:24bosieGnosis-: being able to run it in parallel
18:25Gnosis-yeah, that would be nice
18:25SegFaultAX|work2Sure, parallelization would be nice. But even if the compiler did know it was pure, it couldn't memoize the calls.
18:27amalloy(let [x 1, y 2] (fn [] (+ x y))) could easily be memoized for you
18:27SegFaultAX|work2The best it would be able to do is condense calls in a single expression, eg (+ (purefn 2) (purefn 2)) (purefn 2) would only need to be calculated once for that expression.
18:27Gnosis-SegFaultAX|work2: well, if the compiler was *really* smart, it could identify cases where a function could be memoized with at most X bytes of storage
18:27technomancyyou'd need awesome type inference to pull that off
18:27bosietechnomancy: by awesome you mean?
18:28SegFaultAX|work2Gnosis-: The worst-case size for the memoization table would be equal to the domain U co-domain of the function.
18:28SegFaultAX|work2Even haskell doesn't do this.
18:28Gnosis-I don't understand "domain U co-domain" but it sounds like it's not feasible :)
18:29Gnosis-oh wait, okay, I get it
18:29SegFaultAX|work2Gnosis-: The union of all possible inputs and all possible outputs.
18:29SegFaultAX|work2Gnosis-: Addition for example (which is obviously pure) would require an infinite amount of memory to memoize.
18:31Gnosis-that's assuming the set of input numbers is infinite
18:31Gnosis-but whatever, this doesn't sound practical for the near future
18:33y3dioff by 1 errors are the bane of my existance
18:34y3digot get with the times and go functional
18:35emezeskey3di: There are only 3 hard problems in computer science: cache invalidation and naming things.
18:36SegFaultAX|work2emezeske: As programmer jokes go, you can't beat Ed, man! !man ed. http://www.gnu.org/fun/jokes/ed-msg.html
18:38emezeskeSegFaultAX|work2: lol @ emacs file size: 5.89824e37
18:38technomancyoooh, palindromic quines: http://www.rebol.org/art-display-article.r?article=j315vt
18:39technomancyoh, not quite. darn.
18:40technomancyhttp://golf.shinh.org/p.rb?Palindromic+Quine
18:42dotnullhello
18:56eggsbyhey technomancy why does lein new app do clj 1.3.0 and lein new to 1.4.0
18:57technomancyeggsby: working on that literally right now =)
18:57eggsby:D
18:57technomancyforgot to bump to the latest version of the lein new plugin
18:58FrozenlockIs there a function to help discover elements in a webpage? (clojure-script) I'm quite new to this and would like to mess around in the repl to make myself confortable with the 'environment'.
18:58SegFaultAX|work2What's the best resque-like library for Clojure?
18:59SegFaultAX|work2Lightweight asynchronous job queue.
18:59technomancydie roboter!
18:59technomancyit's ... pretty good.
18:59hyPiRiontechnomancy: Was that German?
19:00technomancyhyPiRion: http://www.youtube.com/watch?v=wHEoMpMvz7A
19:00technomancyalso https://github.com/technomancy/die-roboter
19:00SegFaultAX|work2technomancy: Whoa, you enqueue clojure forms as the job?
19:00technomancySegFaultAX|work2: of course
19:01SegFaultAX|work2technomancy: That's awesome! (Assuming it isn't abused, of course)
19:01technomancywell... the exception transport is questionable.
19:02SegFaultAX|work2technomancy: Go on...
19:02technomancyI really shouldn't; there are minors present
19:03daltenburg]
19:03daltenburg\\\\\\\\\\\\\
19:03hyPiRiontechnomancy: We are liberal, go on.
19:03technomancySegFaultAX|work2: so if an exception occurs remotely, it has to propagate it back to the caller, right?
19:03technomancysoooo in the current implementation, it uses java.io.Serializable and base-64-encoding to generate a form that will eval in the caller to the exception value that occurred remotely.
19:04amalloyoh god, i remember that
19:04technomancyif I did it from scratch, I'd use java.io.Serializable as the wire format rather than pr-str
19:05technomancyand I may still switch to that once I get a chance to revisit the code
19:05technomancyANYWAY it works but don't pass around exceptions with ginormous stack traces
19:05technomancyand stop looking at me like that
19:05hyPiRion... interesting.
19:10eggsbyibdknox: are you at the point where you are developing light table in light table yet
19:24danielglausereggsby: Yes, they are developing Light Table in Light Table: http://www.chris-granger.com/2012/08/17/light-table-reaches-010/
19:25danielglauser"As a matter of fact, we're actually working on Light Table in Light Table now (oh the meta-ness)"
19:31antifuchssooo smalltalk-y (:
19:31cpineraHi all. I'm looking for a code-coverage tool for Clojure. So far I've found radagast not to be maintained anymore and figleaf to be a bit too… minimalistic. guzheng looks more like the basis for such a tool, but not something I could use in a continuous build environment right away. What are you folks using?
19:38habitmelonI'm looking to learn clojure, and would like to know if there is a good book or site that any of you would recommend. I'm already proficient in C#, Ruby, Python and JS, if that makes any difference
19:38habitmelonI'm familiar with Java, but haven't gone too deeply into it
19:39ivanI like Joy of Clojure and 4clojure
19:39S11001001habitmelon: watch rhickey's video introducing the language, aimed specifically at java developers. You know C# so you basically know Java
19:39ivanand every single rhickey video, of course
19:39emezeskehabitmelon: I really like the book "The Joy of Clojure". I've heard that "Programming Clojure" is good too.
19:40habitmelonSweet, I'll watch those videos first
19:41habitmelonIs the CLR version of Clojure still in active development?
19:41S11001001habitmelon: yes, and it is up to date
19:41uvtchabitmelon: I wrote up some brief notes that you might find useful: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ .
19:41uvtchabitmelon: though, those are more aimed at GNU/Linux users.
19:42habitmelonthanks utvc!
19:42uvtchabitmelon: y/w. :)
19:42ivanhabitmelon: yes, but no lein, and a lot of Clojure libraries rely on Java libraries
19:42habitmelonI use GNU/Linux, as well as OS X and windows
19:42habitmelonAh
20:01symuyn(sort-by keyfn coll) compares the values of (keyfn x) for all x from coll. Is there a similar convenience function, but for multiple keyfns?
20:02S11001001symuyn: juxt
20:02S11001001(sort-by (juxt first-key second-key ...) coll)
20:02amalloysymuyn: "multiple keyfns" doesn't make sense. just compose a keyfn (eg, with juxt) that does what you want
20:02symuynFor instance, (whatever [:x :y] [{:x 2, :y 3, :z 0} {:x 2, :y 1, :z 5}) would—hmm.
20:02muhoomore interesting trampoline-isms, preview8, on a beaglebone: https://www.refheap.com/paste/4452
20:03symuynHuh, that…actually—oh, right.
20:03symuynVectors are comparable. Duh.
20:03technomancymuhoo: can you try master?
20:03symuynHeh, thank you. ^_^
20:04muhootechnomancy: how do i make standalone jar from master?
20:04technomancymuhoo: you can try running bin/release
20:04muhooah, perfect, thanks, will try
20:05antifuchsok, got ritz to no longer beep at me and display arg lists, too
20:06antifuchsnow it can show the REPL, perform M-., and give me slime-autodoc arglists with a quicklisp slime (:
20:06antifuchsnow I sleep
20:16muhootechnomancy: works, thanks
20:17technomancymuhoo: great
20:17technomancymuhoo: wait, bin/release works, or leiningen master works?
20:17muhooboth :-)
20:17technomancysweet
20:17technomancyshould have a preview9 release early next week
20:17muhoolein trampoline repl :headless & works on a beagleboard, with master, to be specific
20:17muhooawesome, thanks!
20:18technomancymuhoo: did you see this? https://github.com/technomancy/leiningen/commit/65a574d09a926133cd60d7c5966a6dad1abe0c57#L1R95
20:18technomancyshould be especially useful for embedded systems
20:18muhoowoo, fast trampoline
20:22muhootechnomancy: http://bace.s3.amazonaws.com/hs_err_pid869.log , maybe unrelated, but interesting
20:23technomancywhat's the context?
20:24muhoolein trampoline repl :headless (with .lein-fast-trampoline in proj root)
20:24technomancymuhoo: is it consistent?
20:24muhoonope, does that about every 3rd invocation
20:25muhoofast trampoline does appear to be faster tho, thanks
20:27technomancymuhoo: and it only happens on arm?
20:27muhoocorrect, only on this device (device details are in that stack dump)
20:28technomancylooks like it's crashing in the reflector, which I'd have a hard time imagining is Leiningen's fault
20:29muhooprobably isn't, though there may be some -X jvm args i can do to mitigate
20:30muhootechnomancy: is it possible in nrepl.el to connect to two different projects on two different jvm's yet?
20:31technomancymuhoo: no, though someone said they were thinking about adding that
20:31technomancyeveryone who's hacked on it so far uses a separate Emacs instance per project
20:35muhoothat might do, thanks
20:39muhoois there a cleaner way to disconnect in nrepl.el than killing *nrepl-connection* buffer?
20:39technomancynot yet unfortunately
20:40technomancythere's an open issue for it
20:40muhoowell i could just bind that to a keyboard command, and call it done :-)
20:41muhoo(defun nrepl-disconnect (interactive) (kill-buffer "*nrepl-connection*"))
20:41technomancysubmit a pull request =)
20:44muhoosomeone did talk about being able to reconnect without losing history. i may have a simpler way to do that
20:44muhoowhich is, kill *nrepl-connection* to disconnect, but then when connecting, if *nrepl* already exists, re-use that buffer instead of creating a new one.
20:45muhooinstead of *nrepl*<1>, *nrepl*<2>, etc
21:18CheironHi, for a function the defines multiple arities. what is the best practice of documenting the function?
21:19amalloymost functions just use prose to describe what various calls do
21:22Cheironso each arity describes what it does
21:22uvtcCheiron: afaik, you can still only put in one docstring to cover all the cases.
21:22Cheironuvtc: any example online?
21:23Cheironspeaking of arity, does it decrease performance? (lookup the correct version)
21:23uvtcCheiron: the docstring comes after the function name. Just remember to backslash-escape any double-quote marks (and I suggest using Markdown formatting in your docstring).
21:24Cheironafter function name and before args definition vector?
21:24amalloyugh markdown? markdown is great, but for docstrings? i do not recommend
21:24uvtc(defn foo "my docstring" ([x] (* x x)) ([x y] (+ x y)))
21:25Cheironamalloy: do you prefer any other format? or just plain Clojure strings?
21:25amalloytext. just text, with words
21:26amalloyif you need **bold emphasis** faux-formatting to make you function's description clear at the repl, you probably aren't writing very well
21:26uvtcamalloy: Sure. If you want to emphasize some word in your docstring, may as well do so *like this*. I think marginalia assumes docstrings are markdown-formatted. And my understanding is that a future version of autodoc may assume docstrings are markdown and render them as html.
21:27cjfriszWhere is a dnolen when you need him?
21:27CheironCeylon developers chose MD as the language when documenting code
21:28uvtcIt's just natural plain text markup as far as I'm concerned. Looks good as plain text and also can be made prettier as html if you so desire.
21:37hugodcrazy idea - allow defprotocol to re-use an existing interface so that protocols could be added to clojure for the Named, IFn, etc
21:43_zachhugod: I
21:44_zachhugod: I'm curious to know what your intended use-case would be
21:47hugodbeing able to extend support for those protocols onto deftypes, etc
21:51hugodyou might then be able to extend an interface on to another class, which would be nice for interop scenarios
21:51_zachhugod: Okay, I understand. I misunderstood your original statement -- this would be nice. :)
21:59uvtcIs this naming convention fairly customary: A Clojure lib that wraps a Java lib named "foo" might likely be named "clj-foo". Whereas, a Clojure lib that provides its own implementation of a well-known lib "foo" written in some other language might likely be named "foo-clj".
21:59uvtcFor example, clj-time (wraps Joda Time).
21:59uvtcmarkdown-clj (re-implements markdown in Clojure)
21:59clojurebotclojure is like life: you make trade-offs
22:00uvtcoh clojurebot, you are indeed very wise.
22:11S11001001uvtc: yes, but it's so boring that people keep doing that
22:11S11001001technomancy knows how to name libraries right
22:12uvtcS11001001: Ah, you prefer more exciting, more flavorful names.
22:12uvtcWell, I'm glad I was on the right track anyhow.
22:12S11001001I think that creativity is an important part of the spirit of programming, and that every aspect of a program should reflect that spirit
22:12uvtcI was going to post to the ML to see what others thought of this convention.
22:13CheironHi, what would be an idiomatic way to make this interface work in Clojurian way? http://hector-client.github.com/hector//source/content/API/core/1.0-1/me/prettyprint/cassandra/service/ColumnSliceIterator.html
22:14S11001001Cheiron: lazy seq instead of stateful iterator
22:16S11001001I can appreciate the desire to get a library out there, not taking time to think of a name, but I like to see some beauty every once in a while
22:17S11001001Cheiron: you have functions you call that take query as args and produce such lazy seqs; the "columns" are vectors or maps containing name, value, whatever else
22:18Cheironeye c
22:25uvtcS11001001: I posted my comment to the ML, thinking it might help solidify the standard, while at the same time encourage some fun project names too. :) Maybe it'll start a brief conversation.
22:26uvtcs/the standard/a standard/
22:30eggsbywhat do clojurescript people usually do for ajax? is everyone just using noir/fetch/etc ? or wrapped calls over the closure apis?
22:41rbxbxIs there a preferred replacement for clojure.string/replace in 1.4, or are people just rolling their own?
22:42rbxbxnevermind, it seems to still exist. Sigh. https://github.com/clojure/clojure/blob/master/src/clj/clojure/string.clj#L238
22:45Raynesmuhoo: You should go move refheap to compojure.