#clojure logs

2012-04-09

00:00autodidakto:) and that sketchbook link? dusting off a 3 year old project?
00:02technomancyyeah, that was a crazy pre-leiningen project.clj file
00:02technomancy:dependencies [["clojure" "1.0.0" "org.clojure"] ...]
00:02xeqiI'm more surprised by the :source-dependencies
00:03autodidaktoah yes I see. Sometimes it's embarrassing to look at old work, but that's part of always getting better :)
00:30aperiodiccan i access docs for the bots somehow?
00:34amalloywellll, i'm not sure how much they actually have in the way of documentation. depending on what you want, lazybot's github wiki might be enough?
00:38aperiodicyeah, i just resorted to ddg after the first two things i tried didn't work
01:28y3dinothing in disclojure for over 10 days =/
01:38amalloyi guess you missed the Great Disclojure Drought of '11?
01:49tbatchelliy3di, amalloy: sorry. Life gets busy sometimes
01:49tbatchelli:(
01:49amalloytbatchelli: i don't mind
01:49amalloysorry if i implied you have a civic duty or something; i was attempting to humorously put 10 days in perspective for y3di
01:50tbatchelliI didn't read it that way
01:50tbatchellijust letting you guys know that I'll be back soon :)
02:28aperiodic$mail samaaron i'm having a very odd issue with core protocols when using a particular java library with quil. could you take a look at this gist? https://gist.github.com/2341911#comments
02:28lazybotMessage saved.
03:40dsabaninhi guys!
03:40dsabaninif I have macro defined like this: (defmacro job [job-name args & body] ...) how can I print job-name to the screen?
03:41dsabaninif I do `(println ~job-name) I get #<my.namespace$job-name@4af14e50>
03:47lnostdal"Tying polymorphism to inheritance is bad, protocols free you from that" .. ok..... by typing the same code over and over again? .. declaring the same fields over and over again? .. i still do not get all this stuff .. and books and blog posts only show possible solutions as fragments of a whole .... x)
03:47dsabaninsolved it by doing `(println ~(str job-name))
03:49lnostdal"Encapsulation of information is folly" but then why isn't it possible to access the fields; ..not even from subtypes?
03:50lnostdalthis just does not make sense to me ... i see some of the benefits of extend-type and extend-protocol, but this other stuff i do not
05:45ngwhi *
05:45mega`good morning
05:45mega` *
05:48Iceland_jackhey *
06:13ngwdo you guys know of any example of noir not using hiccup for HTML?
06:13ngwI would like to use clostashe
06:16Bronsahttps://github.com/Raynes/refheap
06:16Bronsathis one is using stencil
06:19ngwoh very nice
06:19ngwthank you Bronsa
06:19ngwwhat are the differences between clostache and stencil?
06:21Bronsai believe stencil is a bit faster
06:25fliebelHow does eval work with namespaces?
06:29fliebelThere must be a way to do (symbol *ns* 'foo)
06:30Bronsaintern?
06:32fliebelBronsa: Lets see... it returns a var, but it might work.
07:42Cr8nuts
07:42Cr8i have an a list of numbers i really need to spit to a file as unsigned shorts
07:43mega`Oo
07:44AimHereHeh, dcpu16, I take it ;)
07:49Cr8AimHere: yes :)
07:52Cr8i'm surprised i haven't run into java's lack of unsigned types being a major pain before
08:10kahlinHey... I'm trying to grasp clojure concurrency. If I want to pass messages between threads (I want to get messages from RabbitMQ in one thread and "use" them in another thread), is it a good idea to use agents and add-watch?
08:29bhenrycan someone point me in the direction of an open source project that uses lobos?
08:39Cr8well, dealt with my unsigned short issue
08:40Bronsahow did you do?
08:40jayunit100hi guys
08:41jayunit100Wtf is a "chunked seq?"
08:41rod_jayunit100: doesn't clojure's lazyseq chunk by default, so probably that?
08:42jayunit100ah i see now
08:42Bronsait also refers to how some datastructures are implemented afaik
08:42jayunit100if you call "seq" on a vector, you get a "chunked seq" back.
08:42jayunit100and then, you cant call things like "subvec"
08:43jayunit100there should be a "subseq" thats analagous to (subvec)
08:43Bronsawhen a persistent vector is chuncked, it means that walking the persistent vector tree is necessary only after 32 elements
08:43Bronsaif i understand it correctly
08:44jayunit100,(subseq '("a" "b" "c") 0)
08:44clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$subseq>
08:45jayunit100toooo bad i guess. So is there a generic way to get a sublist (i.e. that works on vectors, seqs, anything seqable?)
08:46Bronsa,(drop 1 '(1 2 3))
08:46clojurebot(2 3)
08:47jayunit100hmm can we drop from both ends?
08:48Bronsa,(subvec [1 2 3 4 5 6 7] 2 5)
08:48clojurebot[3 4 5]
08:48Bronsa,(take 3 (drop 2 '(1 2 3 4 5 6 7)))
08:48clojurebot(3 4 5)
08:49jayunit100yup i guess that'll do it. definetly deserves a utility func.
08:49jayunit100should be in core. sublists are pretty fundamental.
08:49RaynesPretty slow too.
08:49Bronsayou just need to (take (- end start) (drop start seq)) i guess
08:50jayunit100sublists shouldnt be slow for vectors. maybe for lists.
08:50jayunit100and especially if they were lazy, they should be constant time for a vector.
09:25Raynesclj-php
09:25RaynesThis must be promising.
09:54dnolenfor CLJS users who may not have heard - there's a comprehensive optimizations branch https://github.com/clojure/clojurescript/compare/master...all-optimizations
09:55dnolenplease try it out. So far the reports have been positive. If I don't hear any serious complaints I'll probably merge it in a couple of days.
09:55halfprogrammerexit
10:02dgrnbrgtechnomancy: I was wondering if you could help me debug my lein-guzheng plugin? It's at github.com/dgrnbrg/lein-guzheng. It fails w/ a loader error, and I don't understand how the system works (lein 1.6.2)
10:05bhenrysurvey: what is the community consensus on what to use for creating and managing relational db schemas with clojure?
10:06bhenryspecifically postgresql if that makes a difference
10:27zaargyhi, i'm working through the book practical clojure and come across this error: http://pastie.org/3755803
10:28zaargyhelp? thanks!
10:29S11001001zaargy: why are you calling apply in with-line-item-conditions?
10:29zaargythat's what hte book says
10:29zaargyi don't even know why yet :)
10:30S11001001zaargy: did you follow the example for *calling* w-l-i-c exactly?
10:30rod_zaargy: looks like you don't need apply, just use (f price quantity)
10:30zaargyin the book, it's executed via repl
10:30zaargybut otherwise same
10:30S11001001zaargy: what about basic-item-total?
10:31zaargythe pastie is as it appears in the book
10:31zaargymaybe it's an older version?
10:31gtrak`apply takes sequences
10:31zaargyremoving apply works
10:31gtrak`you pass in 1 and it's not a sequence
10:31S11001001zaargy: most certainly not; apply is an old function with decades of the same semantics
10:32zaargywell the book is incorrect
10:32babilenHi, I am looking for the website that listed clojure libraries by number of reverse dependencies. Can't seem to find it again though :-/
10:32S11001001(except in clojure you can pass infinite sequences as the last arg, of course :)
10:32zaargybook is clojure in action actually
10:32zaargycan upload a screenshot of the page if you don't believe me ;)
10:32rod_zaargy: then last argument to apply needs to be a sequence. ie. (with-live-item-conditions 1 [2])
10:33gtrak`look at the function signature and you will understand: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L596
10:34zaargyhttp://dl.dropbox.com/u/29336917/clojurebookerror.png fwiw
10:34zaargygtrak`: thanks
10:34zaargyas i said, i've only just started working through the examples in the book
10:35zaargyopps, wrong page
10:35yangsxbabilen: maybe you mean 'used by' in http://clojuresphere.herokuapp.com/
10:36cemerickzaargy: yeah, that code is wrong :-(
10:36zaargyhttp://dl.dropbox.com/u/29336917/clojurebookerror.png now
10:36babilenyangsx: yes, exactly :) thanks!
10:37S11001001zaargy: Huh. Well, the manning forum's there for errata
10:38zaargyyes, yes. will add.
10:38fdaoudzaargy: I remember that exactly. It's an error in the book.
10:41fdaoudAuthors do their best to avoid errors. But readers -> working through those things are part of learning.
10:41gtrak`just add liberal use of 'an exercise left to the reader'
10:41fdaoudyeah that can be abused.
10:42gtrak`'you know that thing you're trying to learn? go figure it out'
10:42cemerickA living code repo helps.
10:43fdaoudgtrak`: mix with a healthy helping of "outside the scope of this book"
10:43gtrak`haha
10:43zaargysure. it's a pretty good book otherwise.
10:43gtrak`i'd rather them just not say anything if they start saying stuff like that
10:44fdaoudgtrak`: used in twice in my book :/
10:44gtrak`oh, did you write one?
10:44cemerickI think the only time we say something like that when discussing improvements you could make to the mandelbrot set visualization (e.g. use continuous colors instead of discrete, etc)
10:45cemericks/when/is when
10:45S11001001The benefits and drawbacks of automatic repl inclusion: http://book.realworldhaskell.org/read/systems-programming-in-haskell.html#x_Bc
10:46gtrak`cemerick, that sounds reasonable, I've had some texts that angered me though :-)
10:46fdaoudgtrak`: yes, this one- http://www.amazon.com/gp/product/1934356212
10:46gtrak`ahh, awesome, I hope one day I will know something enough to write about it
10:47fdaoudgtrak`: I'd like to write about Clojure. Still need to learn more though. :)
10:48cemerickoh right, there's also the question of whether the variant of Wilson's maze algorithm we show is probabilistically fair.
10:48cemerick"Empirical measures (looking at the maze distribution over samples generated by both Wilson’s and our algorithms) hint that this property still holds in our variant, but we haven’t proved it formally and we haven’t computed its time complexity. This is left as an exercise to the reader." :-|
10:48cemerickSo, two instances.
10:49fdaoudI know readers love that, so the first time I wrote "had to use that 'outside the scope' phrase didn't I" and the second time I wrote "going into more depth is--wait for it--outside the scope of this book."
10:49Bronsafair enough
11:13VinzentIs it just me or second level headers (##) in marginalia-generated page are bigger than the first level ones (#)?
11:35ScorchinANN: I was bored this morning and thought I'd start work on a simple PDF generation/manipulation library. Camelot: https://github.com/KushalP/camelot
11:53y3dido the devs of prismatic hangout in this irc?
11:53y3dichannel*
12:03groovehi guys, it looks like (dissoc-in) isn't working for me (I get a symbol not found error). I'm using (assoc-in) without any problems. Any ideas?
12:04Bronsathere's no dissoc-in in clojure.core
12:05groovedo I need to (:use clojure.contrib.core)?
12:06groovehere's the doc I'm looking at: http://clojuredocs.org/clojure_contrib/clojure.contrib.core/dissoc-in
12:06dnolengroove: old contrib is deprecated
12:06Bronsais it in core.incubator maybe?
12:06Bronsayeah
12:08grooveah, thanks. How do I add that to my namespace?
12:08grooveand, I suppose I should ask if there's a better, more up-to-date way to return a map without a nested object?
12:10Bronsagroove: put [org.clojure/core.incubator "0.1.0"]
12:10Bronsathen (:use [clojure.core.incubator :only [dissoc-in]])
12:11Bronsa*put on your :depenencies
12:11grooveBronsa: thank you! sorry I'm such a newb.
12:11Bronsanevermind :)
12:15nDuff...having CLJ-318 marked as closed in release 1.2 is very encouraging, but I'm having getting some trouble getting annotations to attach to static methods in the 1.4-beta series.
12:33llasramnDuff: Do you have it working for non-static methods, and just not for static methods?
13:22nDuffGah.
13:22llasram?
13:22mdeboardnnf
13:26kurtharrigerIs there a function in clojure 1.3 that will re-export a var imported from another ns into this one? e.g. (require 'other) (def somethingcool other/somethingcool), but also copying doc strings?
13:27lpetitEclipse users: I've just released the first beta version of Leiningen support for Eclispe
13:28lpetitAs a separate update site, here: http://ccw.cgrand.net/updatesite-lein-betas
13:28heowwoohoo!
13:28technoma`kurtharriger: that kind of thing is generally considered to be problematic unless done for backwards-compatibility reasons
13:28lpetitShould work both with Counterclockwise 0.6.0 and Counterclockwise 0.7.0.beta
13:29nDuff...hmm. Uncommenting the tests for the expected-to-work bits, they *do* work... so clearly I'm doing something different.
13:29lpetitI'm considering this Lein support Beta as quite stable, tho still not feature complete. Please install and report feedback on the Counterclockwise mailing list!
13:32kurtharrigeryeah thats mostly the idea, doing some refactoring and want to reorganize my packages a bit without breaking existing code.
13:32technoma`kurtharriger: here's what I did in Leiningen 1.x: https://github.com/technomancy/leiningen/blob/1.x/src/leiningen/core.clj#L13
13:32kurtharrigerI guess maybe a better option is to (def ^{:doc "deprecated, please use..."} dosomethingcool..)
13:33technoma`kurtharriger: I like using a delay to emit the warning only once
13:33kurtharrigeryeah thats cool
13:34kurtharrigertechnoma`: thanks, this looks even better than what I expected
14:01karchieI have a bunch of XML processing code done in clojure.xml and data.zip. I'd like to re-export as XML; is there a smart way to do this? c.xml/emit appears to be broken; c.data.xml has a working emit but uses an entirely different format.
14:28macwhats the sinatra/flask equivalent for clojure?
14:29technoma`compojure is often compared to sinatra
14:29macis noir more like a rails?
14:29Bronsai wont say so
14:30RaynesNoir is nothing like rails.
14:30technoma`it's ... more like rails than compojure is, I guess =)
14:30RaynesOne could compare noir to sinatra as well.
14:30Raynestechnoma`: A piece of string is more like rails than compojure is.
14:30technoma`Raynes: this is true
14:31fdaoudmac: if you want something that's trying to be like rails, you'd probably look at https://github.com/macourtney/Conjure
14:31rod_don't think anyone's made anything as "complete" as rails in clojure.
14:32macno rails is whack, i want a lightweight framework akin to flask (and sinatra i guess)
14:32RaynesDoes anyone actually use conjure?
14:32technoma`well, conjure is a long way away from rails, despite its intentions
14:32Bronsamac: I'd go with noir.
14:33machow would you compare noir to ring
14:33technoma`Raynes: http://clojuresphere.herokuapp.com/conjure
14:33fdaoudRaynes: I tried it, and it's kind of like rails, which is why I stopped using it.
14:33jaenWell, maybe it's for the better. I code in Rails and I still don't know how it works.
14:33jaenIf I implemented a site in Noir
14:33jaenI would be better off probablt
14:33jaen*probably
14:33Bronsamac: noir is built on top of compojure that it is built on top of ring
14:33macah
14:34Raynestechnoma`: Guess not.
14:34RaynesNoir is just a bit higher level than compojure with some built in niceties like stateful sessions and stuff.
14:35muhoocan anyone recommend an overview of how to deal with nosql stuff (like couch) for someone steeped in decades of thinking in SQL?
14:35Bronsaand a really nicer API
14:38macare there any options other than noir>
14:38devnmadison square clabango
14:38devnclabango
14:39devnhttp://clojure-log.n01se.net/date/2009-03-11.html
14:41devnclojurebot: I was just minding my own business, when suddenly...
14:41clojurebotNo entiendo
14:41devnclojurebot: suddenly is <reply>CLABANGO!
14:41clojurebotc'est bon!
14:44technoma`devn: clojurebot is fuzzy, but he's not THAT fuzzy
14:44devn:(
14:44devntechnoma`: i had issue with the lein-heroku plugin on lein2, you know about that?
14:44fliebelmuhoo: CouchDB has a guide, which has a cookbook full of common things in the SQL and Couch way.
14:45devntechnoma`: something about not finding core util or something
14:45technoma`devn: not specifically, but it doesn't surprise me. I'm still on the fence about whether lein-heroku is worth maintaining in addition to the gem
14:45technoma`would be interested in feedback on that question, actually.
14:45devngotcha -- i just went about upgrading to lein2 yesterday and found myself on the plugins page trying out a slew of them
14:46ibdknoxtechnoma`: I'd remove it
14:46devntechnoma`: i go back and forth. i re-watched neal ford's conj 2011 talk last night and the "productivity pirates" will be enticed by an easy story around heroku deployment
14:46technoma`devn: definitely interested in data on which other plugins need upgrading
14:46technoma`ibdknox: well, at most I'd just add a "don't use this" note to the readme/description
14:46ibdknoxdevn it's already stupid easy
14:46devntechnoma`: ill make you a list tonight.
14:47ibdknoxheroku create --stack cedar
14:47ibdknoxgit push heroku master
14:47ibdknoxdone
14:47ibdknoxyou don't even *have* to have a procfule
14:47technoma`devn: I think the more likely split re: enterprisey folks is that of CLI-phobes rather than people interested in avoiding ruby
14:47ibdknoxprocfile*
14:47devnnot so fast! if you have an .rvmrc and a Gemfile in your git repo
14:47RaynesProcfile*
14:47devnyou will be recognized as a ruby project
14:48devni dont use heroku in every project, so it's not a global for me.
14:48technoma`now that you can install the heroku CLI without using rubygems I think the main motivation behind lein-heroku goes away
14:48devnjust sayin... i guess i would say that having a heroku lein plugin is cool, but it could be a subset of features the gem provides to aid its maintainability
14:48devntechnoma`: good point
14:56fliebeltechnoma`: I thought one of the nicer things abour cake was that you could simply say gem install cake.
14:56RaynesSome people actually complained about that.
14:56fliebelSo what is good about heroku without gems?
14:56fliebelhm
14:57Raynes"HEY, YOU GOT RUBY ON MY CLOJURE!"
14:57muhoofliebel: thanks
14:57technoma`fliebel: lots of people prefer installing via apt-get
14:57technoma`it's much better integrated into the system and supports signed packages a lot better
14:58fliebelRaynes: I wasn't aware that windows users where using Clojure ;)
14:58muhoowow.
14:58fliebelmuhoo: ?
14:58muhoothis is the first time since the 1990's that i've had to register to read a white paper. :-0
14:58Raynesfliebel: Only Windows 95 users.
14:59muhooi've been in linux/foss land too long, i guess.
14:59emezeskedevn, technomancy: I've noticed that at least one plugin has to be installed with a different version under lein1 and lein2 to work (lein-midje). Probably worth keeping in mind during testing.
15:00technoma`yeah, I think we've been able to keep that to a minimum though
15:00technoma`afaik midje is the only culprit
15:00emezesketechnomancy: Oh, good!
15:01technoma`well, of the plugin authors that have asked me at least =)
15:01fliebelRaynes: Cool. That explains why I never see them on IRC, with their dialup modems.
15:01emezesketechnomancy: FYI, cljsbuild is 100% on lein2 now
15:04technoma`sweet
15:06technoma`emezeske: you mean 100% compatible, or 100% required for cljsbuild?
15:11dnolenemezeske: oh so did 0.1.7 go out?
15:12emezesketechnomancy: Oh, that was ambiguous
15:12emezesketechnomancy: 100% compatible ^_^
15:13technoma`cool
15:13emezeskednolen, technomancy: Err, 0.1.7 is not out yet, so I'm actually lying about 100% compat until the next release X)
15:14emezeskednolen: Is there a specific feature you need from 0.1.7?
15:14devntechnoma`: the immutant guys were sounding like they couldnt maintain compatibility between lein versions. i dont know if their issue was like the one you're referring to in midje, but if there's a fix for that maybe it's worth mentioning to jcrossley3 or tcrawley
15:15dnolenemezeske: not really - analyzing the source-path before launching the repl would be nice - but that can arrive at your convenience.
15:16emezeskednolen: Okay, cool. I *could* push it out, but I'm finally writing comprehensive unit tests, and want to wait till I'm done with that first
15:16tcrawleydevn: technoma`: it's been a couple of weeks since I looked at our plugin, so I don't remember the specific difficulty for not supporting both. I'll take a look at that soonish
15:16emezeskednolen: The analyze stuff might be 0.1.8, not sure yet
15:16ibdknoxthe analysis trees from the analyzer are hard to work with
15:17ibdknoxI'm finding
15:17dnolenemezeske: sure sounds good.
15:17dnolenibdknox: what are you finding problematic? Having spent a lot of time in the compiler this weekend they seem nice.
15:17ibdknoxthey weren't designed for some of the things I'm trying to do with them :)
15:18dnolenibdknox: like what?
15:19ibdknoxmaybe I'm just misreading it somehow, but take the case of (let [x 1 x (inc x)] x)
15:19technoma`wow, unit tests for a lein plugin; that's a first =)
15:20ibdknoxI can't seem to get the analysis tree to map cleanly back to that code such that I can known with certainty what x is at each point
15:20ibdknoxpart of that is I'm having trouble making sure that meta flows through the compiler for everything correctly
15:20ibdknoxdnolen: ^
15:21dnolenibdknox: metadata on forms?
15:21ibdknoxI have position data on symbols now too :)
15:22dnolenibdknox: well aren't symbols forms too? :)
15:22ibdknoxright lol
15:22ibdknoxright now I'm struggling with losing things from the sym -> var transition
15:23dnolenibdknox: yeah there will probably need to be changes to preserve metadata. I ran into that the same thing getting type inference to work.
15:37nDuffWhy does (meta ^{DoesNotExist true}[]) return nil? I would expect either a RuntimeException on being unable to resolve DoesNotExist or a map with some variant on DoesNotExist (as a symbol, perhaps?) as a key.
15:37TimMcnDuff: ^ attaches metadata for the compiler
15:37TimMcnDuff: meta acts on runtime-level values
15:38TimMcYou're probably looking for with-meta
15:39nDuff...well -- my *actual* intent is to better understand what's going on during add-annotations calls from gen-class
15:39amalloyquick, someone write a blog post about the difference between ^{:foo 1} and (with-meta x {:foo 1}) so we can give clojurebot a factoid
15:39TimMcamalloy: SOunds like you're volunteering!
15:39amalloyTimMc: my blog has been idle for like a year, man. it's your turn to write something
15:40TimMcI fail to follow this logic.
15:40amalloyyou can put that in your blog too
15:40TimMcsweet
15:40kurtharrigernDuff: I do get an exception unable to resolve symbol: DoesNotExist in this context. are you missing : (meta ^{:DoesNotExist true} []) returns {:DoesNotExist true}
15:40TimMcWell, DoesNotExist is presumably some imported class, here.
15:40nDuffkurtharriger: ...if I got that exception too, the world would make more sense.
15:41nDuffahh.
15:41amalloykurtharriger: the compiler's error handling changed in 1.3
15:41amalloyi believe is what makes the difference there
15:41nDuff(this is 1.4-beta6)
15:41kurtharrigerI'm using 1.3 now, just typed that in my repl... do you have a dirty repl where DoesNotExist is some how defined
15:42kurtharrigerah okay that might be it maybe its a 1.4 regression
15:45jondot_hi all, i have a list of predicate functions to run (each taking 2 arguments)
15:45jondot_what would be an idiomatic to run all of them on a single input and perform a logical AND between all?
15:45amalloyevery?/map?
15:45jondot_i was thinking map'ing all of the functions on an input and then collapsing the true/false result list
15:45ibdknox(every? #(% 1 2) funcs)
15:46jondot_ah. perhaps every? is more suitable
15:47nDuff...well, waitaminute here...
15:47nDuffdoesn't look like a 1.4 regression -- I get the same behavior in 1.3.0
15:47arohnerman does git make the worst mess of clojure merge conflicts
15:48muhoowe need a scm in clj that understands forms and can make merges at the symbol level :-)
15:48TimMcstructural diff
15:48TimMcthe holy grail
15:48arohnermuhoo: yes. line-based diffing has horrific results in lisps
15:48muhooarohner: indeed ))))))))))
15:49jtoyrecently when i reload my ode in the repl, i get this error: java.lang.Exception: Unable to resolve symbol: in this context (NO_SOURCE_FILE:0)
15:49jtoypretty hard to debug :(
15:50llasramnDuff: I'd asked earlier -- do you have annotations on non-static methods working fine? Only having problems with static methods now?
15:50RaynesObviously just need to find an invisible symbol.
15:50TimMcgrep for \b\b, duh :-P
15:51amalloyTimMc: that should match anywhere \b does, right?
15:51amalloyi mean, i get the joke, but it doesn't seem quite right
15:51nDuffllasram: sorry, I missed that question; initially I'd only tested with static methods, but non-static methods have the same issue.
15:51muhoojtoy: i suspect a macro has gone wonky somewhere
15:52llasramnDuff: pastie for how you're adding the metadata?
15:52jtoymuhoo: ok, i'll try to remove them one at a time
15:52llasramEr, refheap rather
15:52nDuffllasram: http://stackoverflow.com/questions/10049060/clojure-attaching-annotations-to-aot-compiled-methods
15:53foodooWhat kind of data types does the (shorts) function accept? I can't come up with a working example except for (shorts (make-array Short/TYPE 5)) which is pointless.
15:53hiredmanhave you read the docstring for shorts?
15:54foodoohiredman: yes, it just says that it casts to short[]
15:54gfredericksdoes emezeske or anyone know how easy it would be to use the lein-cljsbuild support module from maven?
15:55TimMcfoodoo: Well, that's all it does. It's just used for interop, as far as I know.
15:55llasramnDuff: From reading the source code, I'm pretty sure that the annotation metadata ... er, annotations :-) need to go on the method-name symbol. The :static metadata is in the right place though
15:55foodooTimMc: I'd like to write a sequence of shorts to a file. What is the best approach for this?
15:55nDuff*facepalms*
15:56emezeskegfredericks: I know very little about maven
15:56TimMcfoodoo: You probably don't want to mess with arrays, then.
15:56emezeskegfredericks: But I have tried to make the support module fairly generic
15:57TimMcHmm. It depends on what kind of serialization you are interested in.
15:57emezeskegfredericks: Mostly I've tried to keep all the config/lein-specific stuff in the plugin module
15:57nDuffllasram: ...thinking you're right -- at least I'm seeing them in the disassembled class files now.
15:57foodooMy current situation is that I have a list of Longs and I need to truncate them to 16 bits for writing
15:58foodooand these Longs should be smaller than 2^16 so truncating would be okay
15:58gfredericksemezeske: what's the interface like to the support module? I imagine it wouldn't accept the :cljsbuild map from the project.clj?
15:58emezeskegfredericks: Yeah, the :cljsbuild map stuff is all handled by the plugin itself
15:58TimMcfoodoo: What consumes this data?
15:58emezeskegfredericks: The support API is lower-level than that
15:58TimMcfoodoo: Humans? and/or Java? and/or Clojure?
15:58foodooTimMc: I'm writing an Assembler.
15:59foodooSo I have no choice about the output format. I have to stick to the specification
16:00TimMcfoodoo: Ah, a specified binary format? You may be interested in gloss.
16:00TimMchttps://github.com/ztellman/gloss
16:00gfredericksemezeske: my coworker wrote an ad-hoc build script that spits out the single-file compilation
16:00foodoothanks. I'll have a look
16:00gfredericksso I need to figure out how to emulate the everything-in-one-file thing that cljsbuild does
16:02emezeskegfredericks: I don't think cljsbuild does anything special there, really; it all comes out in one file if you use :optimizations
16:03mklappstuhlWhich Clojure book can you recommend for one who is also interested in the broader aspects of Lisp-alike languages?
16:04gfrederickshrm
16:04gfredericksI didn't think optimizations had anything besides :whitespace
16:04cemerickmklappstuhl: an odd question, methinks :-)
16:04ibdknox:simple :advanced
16:04ibdknoxgfredericks: either of those will concat
16:05mklappstuhlcemerick: Is it? There are just a few books out there but I am not enough into clojure to judge for myself I guess ;)
16:05gfredericksibdknox: yes I mean I thought my cljsbuild was configured with :whitespace yet still went to one file
16:05ljosHi - is it just my emacs/slime or is there a problem with (read) and (read-string) in slime? I've tried it in the repl and it seems to work there.
16:06cemerickmklappstuhl: well, talking about "Lisp in general" would be a dubious objective IMO, even leaving Clojure aside
16:06ljos(read-line) not string.
16:06ibdknoxgfredericks: ah, whitespace probably concats too then :)
16:06gfredericksibdknox: emezeske: just confirmed it was whitespace
16:06cemerickmklappstuhl: The closest you can get to that is e.g. On Lisp or Lisp in Small Pieces, but those hardly generalize to e.g. CL and all the schemes and dylan and…
16:07mklappstuhlcemerick: I want more pages on macros and functional programming idioms than on web-development related stuff for example
16:08cemerickah
16:08mklappstuhla more pure programming book and less a tutorial
16:08mklappstuhlI hope that makes it a little more understandable
16:08cemerickmklappstuhl: I am biased towards http://clojurebook.com of course; we try to hit both the principled and the practical very hard
16:09cemerickmklappstuhl: Joy of Clojure might be more of what you're looking for, if you're actively avoiding practicums, etc.
16:09emezeskegfredericks: Yeah, I think any non-nil :optimizations compile to one file if you provide an :output-to
16:09mklappstuhlcemerick: I read your history with the clojure community once, really great story :)
16:10cemerickmklappstuhl: someone wrote up my history with the community? o.0
16:10ljosmklappstuhl: I came in a little late and I am a bit unsure what you are talking about, but I very much enjoyed Let Over Lambda. Even though it's focus is CL it goes over macros in a very good way.
16:10nDuffllasram: ...well, not so much: I'm able to attach Deprecated now, which is an improvement, but the QueryModule$Requires and QueryModule$Deterministic annotations are nowhere to be seen.
16:10gfredericksemezeske: oh maybe I'll have to figure out what behavior :output-to triggers
16:11emezeskegfredericks: I think that's the right direction to look.
16:11gfredericksemezeske: ty sir
16:11emezeskegfredericks: No prob.
16:12mklappstuhlcemerick: Didn't you do? Maybe I'm mixing something up here but I though it would be you :p
16:12amalloyLet Over Lambda is not really a book i'd recommend to someone looking for a general survey of lispy things
16:13mklappstuhldid anyone walk through The Little Schemer with clojure?
16:13amalloythere was definitely some interesting stuff in there, but he spends a lot of his time talking about how the only sensible lisp is Common Lisp
16:14jaenDuh, another Clojure book I would have to get from overseas. I don't get it why they don't translate any FP books save SICP here ; <
16:14llasramnDuff: Ok, this is very screwy, but here's what I think is going on
16:14amalloyand a fair amount of other things that rather grate on my nerves. if you don't want to focus on specifically clojure, On Lisp is a great read
16:15amalloyand of course SICP
16:15llasramnDuff: It looks like `ns` emits `gen-class` *prior* to the `import` forms
16:15jayunit100i kinda feel like learning C before Java was helpful... But I dont know if its worth it to know Lisp before learning Clojure.
16:16llasramnDuff: `gen-class` tries to `resolve` symbols in metadata to see if they map to metadata classes. `resolve` returns `nil` if there's no mapping, and `gen-class` continues on
16:16llasramnDuff: I think if you pull your :gen-class ns sub-form out into a top-level `gen-class` form, it'll work
16:16jaenjayunit100: Because it is helpful I think. I think that CS courses that don't start out with C and Scheme in either order are doing it wrong.
16:19muhoois there a simple, quick hack to make lein 1.7 include java source files in jar?
16:19mklappstuhlamalloy: I think I'll give On Lisp a spin since it's available for free now
16:20amalloycool, enjoy
16:20emezeskemuhoo: symlink them into your resource-dir ?
16:21muhooemezeske: then i'd need a hack to get git to include symlinks
16:22muhooah, maybe git already does that
16:24nDuffllasram: That was it; thanks! This sounds like a bug; if you concur, I'll file a JIRA ticket.
16:25llasramnDuff: Glad to help! And I don't know. The documentation on gen-class is pretty sparse. If I hadn't been digging around in it recently, I wouldn't even have known it supported annotations. I'll defer to the judgment of others on the utility of a ticket
16:34llasramnDuff: If you're doing a lot of work with gen-class, I may be able to interest you in: https://github.com/llasram/shady
16:36jayunit100How to get the key out of a map, which corresponds to the max value?
16:36Bronsao
16:37jayunit100(without doing something crazy like sorting all the values and then doing an inverse selection)
16:37amalloyyou could use magic
16:37jayunit100oh actually i guess you could do (myMap (max (vals myMap)))
16:38jayunit100or maybe not gotta see
16:38jtoyclojure is magic
16:38ibdknoxIn the compiler what are these tag fields?
16:39jayunit100bimaps in clojure
16:40dnolenibdknox: in which compiler?
16:40ibdknoxJVM clojure
16:41dnolenibdknox: tag field on expression objects right?
16:41ibdknoxyessir
16:41hiredman^String
16:41ibdknoxah
16:41hiredmantype hint
16:41dnolenibdknox: type hint information
16:41jondot_long shot - is there a way to decompose a string into a clojure list by its parts? i.e "235;2352:33" without doing the splits and munges myself?
16:41dnolenibdknox: same thing that I'm doing in my all-optimizations branch.
16:41ibdknoxhiredman: dnolen: thank you gentlemen
16:42amalloy&(doc clojure.string/split)
16:42lazybot⇒ "([s re] [s re limit]); Splits string on a regular expression. Optional argument limit is the maximum number of splits. Not lazy. Returns vector of the splits."
16:43amalloy&(clojure.string/split "235;2352:33" #"[;:]")
16:43lazybot⇒ ["235" "2352" "33"]
16:43jondot_in my case i'd like ["235" ["2352" "33"]] but i get the direction
16:44TimMc&(require '[clojure.string :as str])
16:44lazybot⇒ nil
16:45TimMc&(update-in (str/split "235;2352:33" #";") [1] str/split #":")
16:45lazybot⇒ ["235" ["2352" "33"]]
16:46autodidakto,(doc update-in)
16:46clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
16:47autodidakto*head explodes*
16:50jondot_TimMc, yep, i kinda wanted some magic like C's scanf in a sense
16:51jondot_so not doing repetitive str/split again and again
16:51jondot_but ok it was a long shot
16:53TimMc&((juxt first rest) (rest (re-matches #"(.*);(.*):(.*)" "235;2352:33")))
16:53lazybot⇒ ["235" ("2352" "33")]
16:54TimMc*shrug*
16:56amalloyjondot_: you were looking for something like https://gist.github.com/2346469?
16:56jondot_amalloy, wow, yes.
16:57jondot_that'll be very nice to study, thanks!
17:06dnolentechnomancy: only in ClojureScript do you get your wish - https://gist.github.com/2346460
17:06technomancydnolen: oooooh nice!
17:06technomancythat is a thing of beauty =)
17:07TimMcWhat happens if his lib extends using re-matches and mine does it with re-find?
17:08ibdknoxooo
17:09fdaoudnice
17:09dnolenTimMc: won't work.
17:09dnolenTimMc: same problem exists in Clojure as well.
17:10technomancyoh yeah, that extending should happen in clojure.core
17:10TimMcSo the second extend will blow up?
17:10dnolenTimMc: no, it will replace
17:10TimMcOK
17:10gfrederickswhat's that thing ruby 2 was supposed to get?
17:11gfredericksthat would let you modify classes only in a certain context or something
17:11TimMctechnomancy: Any thoughts on which of re-find and re-matches is better for that protocol?
17:12technomancyI've never used re-matches
17:12kjellskiWhy is clooj always putting "" as input and never asking me for stuff to type in?
17:13rmarianskiis that possible because IFn is a protocol in clojurescript?
17:13gfredericksrmarianski: yes
17:13technomancyTimMc: I'd probably go with re-seq
17:13rmarianskithat is amazing
17:13gfredericksoh oh do extend-type for 'number'
17:14technomancyI usually use re-find in my conditionals because I only care about one match, but re-seq is more general
17:14dnolenfar as I know similar limitations exist for Haskell type classes - http://www.haskell.org/haskellwiki/Multiple_instances
17:17duncanmdnolen: i hope i didn't embarrass myself here, http://funcall.blogspot.com/2012/04/20-minute-puzzle.html, https://gist.github.com/2346450
17:17jondot_dnolen, you turned a regex into a function?
17:18eggsbynow you got 3 problems
17:18dnolenjondot_: not me Relevance's Alan Dipert
17:18duncanmdnolen: cool (regexp hack)
17:19jondot_oh.
17:19duncanmi thought regexps are already functions, the way sets are functions
17:19dnolenduncanm: they are not in Clojure.
17:19amalloyas long as you don't try to call them as functions, you can continue to believe that
17:19duncanmheh
17:21eggsbyis there an http mocking lib for clojure? Something where I can 'record' http responses and play them back for the purposes of a test suite?
17:21technomancyclj-http-fake IIRC
17:23eggsbythanks technomancy i'll look into it :)
17:25TimMcdnolen: Do you know if any work is being done on Source Maps in CLJS? http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
17:25dnolenTimMc: yes Brandon Bloom has submitted patches to Clojure and ClojureScript
17:25amalloyTimMc: someone is working on it
17:25TimMcNice!
17:26TimMcI was wondering if the two-step transformation of CLJS -> JS -> compressed JS would make trouble for that.
17:28dnolenTimMc: dealing w/ the 2 step case is a broader goal - at the moment I think most folks would be happy to be able to debug :simple or :whitespace optimizations
17:29TimMcI see.
17:31kjellskiIs is possible for counterclockwise to get some input from myself? Whenver I (real-line) it will show a null… not waiting for any input...
17:33kjellskiI want my clojurebox back! ^^
17:41jtoyI'm learning how to do io in clojure, what is wrong with this: (with-open [rdr (clojure.java.io/reader "/Users/jtoy/test.json")] ((json/parse-string (line-seq rdr)))) => java.lang.ClassCastException: clojure.lang.Cons cannot be cast to java.lang.String (NO_SOURCE_FILE:0)
17:42technomancyjtoy: missing a call to map, a call to doall, and has one level too many of parens
17:42jtoytechnomancy: why is a map needed?
17:43technomancyyou're trying to call parse-string on a seq of strings
17:47jtoytechnomancy: so do something like this? (apply str my-char-seq) instead of map?
17:47technomancywell... depends on what you're trying to do
17:48jtoyhmm, that gives me java.lang.OutOfMemoryError: Java heap space (NO_SOURCE_FILE:0)
17:48technomancyline-seq makes me think that your file has a bunch of json objects in it that need to be parsed independently
17:48technomancybut if it's only one, then you should use (json/parse-string (slurp "/Users/jtoy/test.json"))
17:48jtoytechnomancy: each line is json
17:48technomancyok, so you would need to map then
17:49jtoytechnomancy: with map I get : java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.String (NO_SOURCE_FILE:0)
17:49jtoy(with-open [rdr (clojure.java.io/reader "/Users/jtoy/test.json")] (json/parse-string (map str (line-seq rdr))))
17:50technomancythink about what line seq returns and what parse-string expects
17:55jtoytechnomancy: is there a recommended doc you have for lazy-seq, this is not informative enough: http://clojuredocs.org/clojure_core/clojure.core/line-seq
17:56Cyrikdoes anyone know why this throws and error? ((fn [{args :args}] args) '(:and :a :b))
17:56Cyriki would expect it to return nil
17:56technomancyjtoy: that page tells you everything you need to know. what type does line-seq return?
17:57kjellskiin the instructions for labrepl emacs, it said I should run emacs -l ~/.emacs.d/emacs-starter-kit/init.el but the file doesn't exist.
17:57kjellskitechnomancy, any hints?
17:58technomancykjellski: sorry, I haven't used labrepl. those instructions are sound highly suspect.
17:58jtoytechnomancy: right, i don't know why my conversion doesn't work
18:00technomancyjtoy: what does mapping str over the return value of line-seq get you?
18:00ipostelnikCyrik, your fn expects a map as input
18:01jtoytechnomancy: I'm not sure, i don't know how to test line-seq from repl, i want to test with something like (map str (line-seq "test"))
18:01technomancywhy can't you test line-seq?
18:02Cyrikipo i know, but it works fine on every datatype other then lists. only lists make it throw and i dont get why they do
18:02jtoyI'm writing a longer test now
18:05jtoystill testing: (with-open [rdr (clojure.java.io/reader "/etc/resolv.conf")] (map str (line-seq rdr))) => (java.io.IOException: Stream closed
18:06technomancyok, that's caused by laziness conflicting with dynamic binding. need to call doall on the result of map to force the lazy seq
18:06jtoythis works : (with-open [rdr (clojure.java.io/reader "/etc/resolv.conf")] (println (map str (line-seq rdr))))
18:07jtoyok, doall works: (with-open [rdr (clojure.java.io/reader "/etc/resolv.conf")] (doall (map str (line-seq rdr)))) it looks like it returns a list of strings as each line
18:08ipostelnikCyrik, actually any lazy sequence will fail
18:10antares_is there a good example of a library that uses, say, multiple data stores that users can choose from? I'm looking for approaches to implementing "adapters" in Clojure. I know tools.logging does it but it's the only one I know of.
18:10Cyrikipostelnik: oh thhat makes sense. i guess he´s trying to eval it at each step. thanks
18:11technomancyantares_: java.jdbc maybe?
18:12antares_technomancy: hm, well, that probably relies heavily on the JDBC part
18:12antares_while my code will be all Clojure
18:12jtoyhmm, I thought do all would fix it: (with-open [rdr (clojure.java.io/reader "/Users/jtoy/test.json")] (doall (json/parse-string (map str (line-seq rdr))))) => java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.String (NO_SOURCE_FILE:0)
18:12technomancyoh yeah, that's probably handled for you
18:13technomancyjtoy: what does mapping str over the return value of line-seq get you?
18:13antares_jtoy: are you trying to read a JSON file from the filesystem?
18:13jtoytechnomancy: it looks like a list of strings: ("#" "# Mac OS X Notice" "#" "# This file is not used by the host name and address resolution" "# or the DNS query routing mechanisms used by most processes on" "# this Mac OS X system." "#" "# This file is automatically generated." "#" "domain cic" "nameserver 204.9.221.30" "nameserver 204.9.223.18" "nameserver 204.9.223.19" "nameserver 8.8.8.8")
18:13jtoyantares_: yes
18:14technomancyjtoy: and what if you don't map str over it?
18:14antares_jtoy: https://github.com/michaelklishin/urly/blob/master/test/clojurewerkz/urly/test/url_dump.clj#L7
18:14jtoytechnomancy: the printed output is the same
18:15antares_jtoy: if it's OK for you to load it from the classpath (test/resources is a common location), then you can use the example above
18:16jtoyso using doseq is the main difference?
18:18ipostelnikCyrik, destructing code will call (apply hash-map arg) on any argument which is a se
18:18ipostelnikCyrik, s/se/seq/
18:19technomancyjtoy: the difference is that the parsing function gets the type it wants
18:20jtoytechnomancy: ok, I'm not sure why that is bc i think I'm still too much of a clojure newbie, but this does work: (with-open [rdr (clojure.java.io/reader "/Users/jtoy/test.json")] (doseq [x (line-seq rdr)] (json/parse-string x)))
18:21technomancythat's much better
18:21technomancynow the only problem is that doseq is intended for side-effects and doesn't have a return value
18:21technomancy(doc for)
18:21technomancy,(doc for)
18:21clojurebot"([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], ...
18:21clojurebot"([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], :while test, :when test. (
18:21technomancyoops
18:22technomancyhm; I suppose that is not very helpful
18:22jtoy(doc do all)
18:22clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$eval27$fn--28$my-doc>
18:22jtoy(doc doall)
18:22clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
18:22technomancyjtoy: for is the equivalent of doseq that produces a return value instead of executing for side-effects, but it's lazy
18:22technomancyso in the case of with-open you need a doall
18:22technomancyor consume the seq inside the with-open call
18:24jtoytechnomancy: yeah, i think i need to program more clojure before i fully understand what that mean
18:24jtoymeans
18:29jtoyhow does one sleep from the repl? this doesn't work (Thread/sleep 5)
18:30amalloyjtoy: you can count 5ms that accurately in your head?
18:30jtoyoh ok, i thought it was seconds, oops
18:31muhoollasram: what's the proper workflow in shady for reloading from the repl a class defined with gen-class?
18:31muhoollasram: i keep getting : ClassCastException clojure.lang.Symbol cannot be cast to java.lang.String shady.gen-class/reload-class (gen_class.clj:13)
18:37jtoyso i am finding errors in my file: (with-open [rdr (clojure.java.io/reader "/Users/jtoy/test.json")] (doseq [x (line-seq rdr)] (try (json/parse-string x) (catch Exception e (println e)) ))) is there a clojure method where I can get the line number with each line I process?
18:38technomancyjtoy: maybe (.printStackTrace e)
18:39antares_jtoy: clojure.stacktrace/print-stack-trace
18:39jtoytechnomancy: I mean the line where the error occurs, not stacktrace
18:40jtoyi have a 800K line file, with each line as joan, there are 5 lines that are broken
18:40emezeske,(map vector ["line" "line" "line"] (range))
18:40clojurebot(["line" 0] ["line" 1] ["line" 2])
18:41technomancyor just replace (println e) with (println e x)
18:42emezeske^^ what he said
18:43TimMcmap-indexed can help as well
18:43jtoythe println way does not work: #<JsonParseException org.codehaus.jackson.JsonParseException: Illegal character ((CTRL-CHAR, code 0)): only regular white space (\r, \n, \t) is allowed between tokens
18:43jtoy at [Source: java.io.StringReader@1cfb765a; line: 1, column: 2]>
18:43jtoyit says almost the same thing for all 5 lines
18:44muhoomaybe those are the bad lines? and they have illegal chars between tokens, like it says?
18:44muhoo0 is null, IIRC
18:45TimMcjtoy: Did you try the (println e x) thing?
18:45jtoyit can't be line 1 every time?
18:45jtoyTimMc: yes, that is println results
18:45TimMcOK, so maybe the whole line is "\x00"
18:45TimMcANyway, search for a NUL.
18:46muhoonulls in file, i've had that problem before
18:47jtoyok, so \x00 is 0 is NULL ?
18:48muhooya
19:03lynaghkemezeske: have you ever had problems running large datasets through CLJS?
19:04emezeskelynaghk: Hmm, what do you mean by "running through" ? Like processing them?
19:04lynaghkjust importing
19:04lynaghkI'm moving my data visualization grab bag to cljs: https://github.com/lynaghk/vomnibus/tree/cljx
19:05lynaghkI'm just trying to import (def large-vector [...]) into another namespace, and ClojureScript just pegs the CPU at 100% until I kill it after a few minutes
19:05emezeskelynaghk: I'm not sure that I've run into that
19:05emezeskelynaghk: But I haven't necessarily worked with really huge datasets
19:05lynaghkI believe this is an issue with ClojureScript, not cljsbuild, because I've run into it before
19:05lynaghkit's not even that huge, we're talking 100kb of state outlines
19:06emezeskelynaghk: Yeah, that doesn't seem huge enough to warrant breakage :)
19:06lynaghkI'll dig into it a bit more then.
19:06lynaghkyep. I've run it through Closure directly too, so I think it's some weird interface between Closure/ClojureScript
19:06lynaghkdid you have a nice time in PDX last week, btw?
19:06emezeskeEek, that could be interesting to track down
19:07lynaghkemezeske: interesting is one word.
19:07lynaghk=P
19:07emezeskeI actually was in salem, and just passed through PDX airport on the way out
19:07emezeskeBut yeah, it was good!
19:07lynaghksweet
19:07lynaghkback in the land of abundant sunshine now?
19:08emezeskeOh yes, it's very abundant!
20:03brehauta clojure implementation of http://www.webkit.org/blog/1875/announcing-remote-debugging-protocol-v1-0/ could be a great aid to web app testing
20:20autodidaktowhy is a one-sentence description and no external link the norm on clojars?
20:21aperiodicbecause those are the defaults in the project.clj that leiningen generates
20:21autodidaktoAhh. It reads the project.clj
20:22technomancyclojars 2 will require a URL and license info
20:22technomancyFWIW
20:22autodidaktotechnomancy: most awesome news
20:23autodidaktoLibrary discovery and organization shall separate us from that which is CL..
20:23technomancyautodidakto: in the mean time, try http://clojuresphere.herokuapp.com; it's pretty great
20:23autodidaktonice. I'll check that out
20:26technomancyalso leiningen 2 includes a nice little :url "http://example.com/FIXME&quot; in project.clj
21:27rplevyit's not possible to capture output from java libraries used in Clojure is it? *out* and *err* don't come into play so with-out-str won't work, is this true?
21:28rplevyin particular clojure.tools.log output?
21:29rplevys/log/logging/
21:29antares_rplevy: doesn't it depend on individual java libraries?
21:30rplevyinteresting, how so?
21:30antares_Quartz will use SLF4J if it is available
21:30antares_so if you use tools.logging with slf4j, you will also have Quartz log output in your log
21:30antares_by default, you can separate them, too
21:31antares_different Java libraries log differently, some may even log to stdout but that's not the norm (fortunately)
21:31rplevyis there some way to capture the output of clojure.tools.logging when I call it (in a unit test, just to make sure that it happens)
21:32antares_rplevy: tools.logging has pluggable loggers, it should not be too hard to implement one based on a string buffer or *out*
21:32antares_maybe there even is one
21:33rplevyinteresting, I didn't know that, and that explains what you said a above re sl4j, which I didn't quite understand, but now I do, thanks!
21:34nodenameHi, I'm sure I've seen an example of how to specify a github repo as a dependency in project.clj but I can't find it now. Any help?
21:36rplevyactually I just realized it's just as good to mock out the warning function, not sure what I was even thinking haha
21:39S11001001rplevy: as long as all warnings go through the function
21:40rplevyS11001001: yup
21:42muhoois there a way to have certain libraries loaded in lein 1.7, ONLY in the repl, but not included in jars?
21:42S11001001muhoo: that's what dev-dependencies are for
21:43muhooi thought dev-dependencies loaded only during the compiliation, not the repl?
21:43muhoook, thanks, will try.
21:43S11001001I don't know about the cmdline, but in swank dev-deps are available
21:44muhooalso, i don't necessarily want them in the project.clj, because they're only for my personal use, they can't ship with the project, they're not on clojars, etc
21:46muhooi suspect it'll be somewhere in ~/.lein/init.clj or :repl-init then
21:46S11001001Hmm. Well, you could always java -cp "`lein classpath`:myjar.jar" clojure.main --repl
21:47muhoogood point. i'm sure there's a more lein-y way to do it though.
21:47S11001001probably make a plugin
22:03rplevyis it the case that calling a function as a var breaks midje prequisites? e.g. (provided (#'v ...)) I am finding this to be the case but I may be doing it wrong
22:23llasrammuhoo: Hey, I was out earlier. The 'reload-class' function is just a private function which loads the class in a DynamicClassLoader
22:24llasrammuhoo: You should just need to use the shady.gen-class version of `gen-class` instead of the clojure.core version
22:25llasrammuhoo: And new versions of the class will be loaded as the class is re-defined
22:31antares_rplevy: if you have a function in a var f, you can call it as (f …) or (f)
22:31antares_rplevy: from your example I am not sure what #'v means
22:34brehautantares_: #' is var quote; #'v is equivalent to (var v). It means you get the var back from the symbol, rather than what the var references
22:35autodidaktobrehaut: can you talk about the differences between CL #' and clojure?
22:35brehautnope
22:35brehauti have no idea about how CL works
22:35autodidaktofair enough
22:35antares_brehaut: ah, ok. I am familiar with (var …)
22:36brehautall i can tell you is that a var lets you indirect the var, meaning that when the var is changed (ie, redefed at dev time) the code that has the var will change as expected
22:36S11001001autodidakto: Sure. #' means something completely different in CL, but it is similar in that it is sugar for a two-element list whose CADR is the form that follows the #', and whose CAR is a symbol
22:40muhoollasram: thanks, i decided to use defclass instead. much prettier, and works great.
22:41muhoohmm, is there a form of every? that takes multiple predicates but one value?
22:41muhooso instead of wanting to run onoe test on multiple data values, to run multiple tests on one data value, and return true if they're all true?
22:42S11001001muhoo: hint: functions are data values
22:42muhooS11001001: oh, so something with map, gotcha
22:43y3dihas anyone here used erlang?
22:43S11001001muhoo: not quite, you still only need every?
22:43muhooah
22:44S11001001muhoo: fill this in: (every? <something-with-my-test-val???> [function1 function2 ...])
22:45muhoobut wait, doesn't that do something like (pred item-from-collection) , so it'd be (value function1) (value function2), in otherwords, the wrong order?
22:45S11001001not literally your test value, something containing it
22:46muhoooh, a function that takes a function as an arg, calls the arg with the value as an, um, arg, i think.
22:46muhooi'll play with it, thanks
22:46S11001001np
22:47S11001001and sounds like you're on the right track
22:47muhooyeah, thanks a lot, a little brain-melting is what i needed there.
22:47muhoofun stuff.
22:49S11001001this is just the tip of the iceberg
22:50muhoo(every? #(% some-value) [pred1 pred2 pred3])
22:50S11001001looks cool to me
22:52Scriptor(every? ((juxt pred1 pred2 pred3) some-value)) might work too, muhoo
22:52Scriptoroh wait, never mind
22:52Scriptorwait, yes mind
22:52muhoojuxt'd work too, thanks.
22:53S11001001albeit strict over the predicates
22:53muhooi'd have to apply if i had a list of preds tho
22:53muhoogets kinda ugly then
22:53S11001001and their invocation results
22:56tmciverS11001001: what do you mean it would be 'strict over the predicates'?
23:01jtoyhello?
23:01clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline jtoy
23:02Scriptorhi jtoy
23:04jtoywas seeing if I'm still online
23:04jtoymy computer seems borked
23:04jtoyi hate computers