#clojure logs

2011-11-21

00:11alex_baranoskydo you all think colorization of Midje console output should be togglable, or would it be ok to just have colorization be the only option?
00:11ibdknox_alex_baranosky: I added that stuff to colorize btw
00:12alex_baranoskyif you think the former, what do you think is a good way to specify not desiring colorization?
00:12amalloyalex_baranosky: it needs to be togglable so that you can (eg) write it to text files or devices that don't support ansi color, right?
00:12alex_baranoskyibdknox: thanks!
00:12ibdknox_amalloy: those extra bytes won't hurt anyone, right? ;)
00:13alex_baranoskyamalloy: makes sense, so then the question moves onto the second step of what is the best medium for togglability
00:13amalloyibdknox_: i sure enjoy reading ^[[67A in my logfiles :P
00:14ibdknox_is midje used outside of the context of lein?
00:14alex_baranoskyas far as I know it is only used from cake and lein...
00:14amalloyibdknox_: there's a midje-mode for emacs that at least marick uses; dunno who else does
00:14ibdknox_project file
00:14ibdknox_hm
00:15ibdknox_Project file still probably makes the most sense as a default place
00:15devnseancorfield: the pprint issue was damned simple -- just a rename from earmuffed *code-dispatch* to code-dispatch
00:15devnseancorfield: it looked worse on the surface -- now I'm onto a new issue, (recur) within a (try ...)
00:15devnsome hairy code, taboot :|
00:15amalloydevn: whattttt? surely that should be setting *code-dispatch* to be dynamic
00:16amalloywell, i guess i don't actually know that
00:16amalloybut it sounds like the sort of thing that wants to be dynamic
00:16devnamalloy: I moved from clojure.contrib.pprint where it was earmuffed
00:16devnclojure.pprint => no earmuffs
00:16devnyes, it is ^:dynamic
00:16ibdknox_if it's dynamic it should have earmuffs :p
00:16alex_baranoskyibdknox_: maybe set a midje-colorize property based on what's in the project file?
00:17ibdknox_alex_baranosky: yep
00:17devnibdknox_: that's not a thing anymore
00:17ibdknox_devn: oh? The convention itself is not endorsed anymore?
00:17amalloyalex_baranosky: ideally you would query the output pipe/console and ask if it supports color - that's what grep does. but that's probably a lot of work and might not be possible in java anyway
00:17devnibdknox_: i dont think it was ever endorsed TBH
00:17devnibdknox_: i did it though :)
00:17amalloyibdknox_: fairly sure devn is talking nonsense here
00:17alex_baranoskyI might have to roll my own colorization code then to bake the property check into the function/macro calls
00:17devnamalloy: wha?
00:18amalloydynamic vars and earmuffed vars probably don't correspond 1:1, but they're closely tied
00:18ibdknox_devn: http://dev.clojure.org/display/design/Library+Coding+Standards
00:18amalloyand you should usually have one iff you have the other
00:18ibdknox_devn: that seems endorsed to me :p
00:18devnerr, yeah, you can say I'm talking nonsense
00:19devnthat's what I was saying
00:19devnthe code I'm fixing is using *earmuffs* for constants
00:19hiredmanpre-1.3's release there was a trnasition period where earmuffed vars were automatically made dynamic, which is no longer the case
00:19amalloyalex_baranosky: project.clj isn't very flexible though, right? maybe i usually want color but this time i'm writing to a log file
00:19devnand yes, that.
00:19amalloyyou might take a hint from lein and use an environment variable
00:19ibdknox_actually
00:19amalloyMIDJE_COLOR=false lein midje
00:19ibdknox_an env var makes sense
00:19ibdknox_you can then have the lein plugin set it
00:20ibdknox_based on the project var if it exists
00:20ibdknox_otherwise, amalloy can write his log files by setting it explicitly at the start of the command :p
00:22devnibdknox_: to your original point, I'm wrong again. code-dispatch used to be earmuffed, it's not anymore, but the whole structure of pprint is quite different, code-dispatch is now a multimethod
00:22ibdknox_devn: haha
00:23ibdknox_no one knows what's going on anymore! :D
00:23ibdknox_it's a mad house
00:23devnI've been a bit out of the loop.
00:25devnnow...need to figure out how to refactor this code to not use a (recur) inside (try)
00:25alex_baranoskyibdknox_: amalloy: thanks for the great ideas, I've jotted down some notes and will think about it tomorrow. It's getting later here.
00:26amalloydevn: it's a bit gross that that doesn't work anymore
00:26ibdknox_wait
00:26hiredmandevn: letfn
00:26ibdknox_that doesn't work at all?
00:26amalloyyou can probably fix it by turning (loop [] (recur)) into ((fn [] (recur)))
00:26hiredmanit doesn't work to recur across a try
00:27ibdknox_ah
00:27amalloyhiredman: there was a bug about this a while ago where it wasn't possible to recur even entirely-inside of a catch clause. is that still an issue?
00:27hiredmanamalloy: I believe the issue is still open
00:27hiredmane.g. for (catch E e (loop [] (recur)))
00:28amalloyright
00:28ibdknox_if it's in a function it's fine though?
00:28hiredmanI think so, I forget
00:31devnhttps://gist.github.com/1381725
00:32devnThat's what I'm looking at^
00:36scottjis there a pretty dates lib ("2 hours ago", "yesterday")
00:39hiredmandevn: seems like you can just hoist the try/catch outside of the loop/recur
00:41devnhiredman: ill give it a try -- clojure-refactoring is not light reading
00:41hiredmanloop recur seems kind of disgusting there
00:41hiredmanlooks like a reduce
00:42hiredmanreport is some horrible macro that lexically captures report-fn?
00:47devnhiredman: i think it was from clojure.test
00:47amalloyclojure.test is nothing but horrible macros
00:47hiredmaninc
00:48devnthe ns was (when (= (class clojure.test/report) clojure.lang.MultiFn) (eval '(do (require 'clojure.test) (ns clojure.test) (def old-report clojure.test/report))))
00:48devnwtf?
00:48hiredman:(
00:49hiredmanmonkey patching the reporting for clojure.test
00:49amalloythat's a really bad way to monkey-patch, even
00:49devnI'll give Tom the benefit of the doubt -- I think he wrote this back in 1.0
00:49devnbut yeah, agree
00:49amalloyi helped marick replace some code in midje that looked exactly like this. the result is still bad but at least doesn't use eval
00:50hiredmanthe reporting stuff for clojure.test get's monkey patched a lot
00:50devnI really like midje
00:50hiredmanmakes you wonder if someone should just provide a nice extension mechanism for it
00:52hiredmanit's kind of a shame clojure.test went it to clojure proper, then no further developement
00:54hiredmanI guess there have been some commits in 2010
00:56devnI haven't used clojure.test a whole lot
00:57devnI'm going to go ahead and take your word for it
00:58hiredmanclojure.test is what we use at work actually
00:58devnoh right, you're one of those lucky assholes who gets to write clojure all the time at work
00:58devn;)
00:58hiredmanand it is mostly fine, we had some trouble here and there with conflicting monkey patching of the reporting function
00:59hiredmandifferent lein plugins that format test output in different ways
00:59hiredmanthe few, the proud, etc
01:00devnhiredman: yeah, that sounds nasty
01:01hiredmanI've gone all avant garde recently, and used 'are' in a test or two instead of 'is'
01:01devnhhahahaha, that's so postmodern
01:02devnwe need to fuse the two worlds: iares
01:02hiredmanbe
01:02devnnot-to-be
01:02technomancyclojure-test-mode had a truly awful monkey patch
01:02technomancyfor clojure.test/report
01:02technomancybut I wrote that like three months after I started with clojure
01:02hiredmanmaybe that is what I was thinking of
01:03technomancyanyway, it's much better now
01:04devnI wish I could claim all of the clojure I write was created three months after I started
01:05devnwe've been talking about starting a clojure practice-- i'm in the process right now of rewriting an app we did that should have been done in clojure to show off what clojure is good at
01:06devnit's hard for me to explain clojure, i think. "it's different than what you're used to" doesn't seem to be getting the message across. ;)
01:06ibdknox_devn: we're hiring ;)
01:07devnibdknox_: meetup?
01:07ibdknox_you do :p
01:07ibdknox_https://www.readyforzero.com
01:08devnwhere are you guys located?
01:08ibdknox_San Francisco
01:08ibdknox_downtown
01:08devnif it's san francisco the whole debt thing should work out well for me as a service
01:08amalloyhahaha
01:08ibdknox_haha
01:08ibdknox_it's true
01:08ibdknox_:)
01:09devnthey always say to eat your own dog food
01:09devnbut this is ridiculous
01:09devnibdknox_: all kidding aside, looks cool
01:15slyphonthere's gotta be a better way to do this:
01:15slyphon(let [s {:a 1 :b 2}] (and (contains? s :a) (contains? s :b)))
01:16amalloy&(every? {:a 1 :b 2} [:a :b])
01:16lazybot⇒ true
01:16amalloyfails iff you have nil/false values in the map
01:17slyphonhrm
01:17slyphonok, bad example then
01:17slyphoni have a list that can contain :a or :b and optionally :c
01:17slyphon:a and :b is an error
01:18hiredman,(every? true? (map (partial contains? {:a 1 :b 2}) [:a :b]))
01:18slyphon(which is what i'm trying to detect)
01:18clojurebottrue
01:18amalloyslyphon: a list?
01:18slyphonlet's say, yes
01:18slyphona seq
01:18slyphoni'm not sure what the caller is going to provide, so i'd coerce into what i need
01:21hiredman(constantly promise)
01:22slyphon:D
01:22technomancy(do (not deliver))
01:23slyphonhah
01:24slyphon(require shorts)
01:24slyphontoo bad no "shoes"
01:24devn(deliver us "from evil")
01:24technomancy"There is no try" actually works semantically since try is a special form that doesn't exist as a var.
01:24slyphonhah
01:27amalloyi have to confess, after that bizarre ML post asking people to stop saying "idiomatic", i'm noticing that word used in some pretty absurd places
01:28slyphon(complement shorts)
01:28hiredmanamalloy: the solution to that is to stop reading the normal ml, and just read -dev
01:28amalloya comment on an old SO answerR: "I don't like reimplementing core functions, it's not idiomatic."
01:30hiredmanso :(
01:30amalloyhiredman: -dev is not terribly fun reading most of the time
01:30hiredmanthe regular list is mostly junk
01:31hiredmanat least there haven't been any blog posts to the list recently
01:34R4p70rI was reading this http://stackoverflow.com/q/8199046 and was wondering.. Why does Clojure have an "update-in" for nested associative structures but no plain "update" for updating "flat" associative structures?
01:35hiredmanwhat would update do?
01:35hiredman(and how would it differ from update-in?)
01:39Raynes&(update-in {:foo 0} [:foo] inc)
01:39lazybot⇒ {:foo 1}
01:39RaynesR4p70r: The only thing you'd gain from 'update' is two less square brackets.
01:42devnI have a buy order out for square brackets.
01:43devnIt's like Cash4Gold, but for syntax
01:43slyphonhah
01:44devnming slyphon?
01:44slyphonat one point
01:44devnslyphon: cool to see you in here -- I think you were the first nice guy I met on IRC
01:44slyphonhah
01:44devnseriously. :)
01:44slyphonwell, i try :)
01:45devnslyphon: still hacking the rubies?
01:45slyphonyeah, mostly
01:45R4p70rRaynes I can see that... But why is it like that in the first place? Is it more common to use this on nested structures somehow? I guess it's just more inconvenient than (assoc (get (get coll 3) 4) (f (get (get coll 3) 4)))
01:45slyphoni try other things, but i keep coming back
01:46devnslyphon: clojure might turn you! :D
01:46RaynesWhat do you mean 'why is it like that'? What other way could it be?
01:46amalloythere are support groups for that
01:46slyphonhah!
01:46devnI don't need a support group. I came out to my coworkers a year or two ago.
01:46amalloyR4p70r: that is not equivalent
01:46slyphonmy friend just said about ClojureScript "that's so fucking nerd-trendy that somewhere a cobol programmer just died"
01:47devnI never want to go back. This is who I am now, and everyone will need to learn to accept it. :)
01:47amalloybecause of immutability; it looks equivalent if you imagine this is python, but it aint
01:47slyphondevn: hahahah
01:47devnslyphon: only a hipster would say something like that
01:48devnor a nerd with an axe to grind
01:48slyphondevn: he's actually a crusty sysadmin type
01:48slyphon"haggard"
01:48devna filthy neckbeard is he?
01:48amalloy(update-in m [3 4] f) is roughly (assoc m 3 (let [m2 (get m 3)] (assoc m2 4 (f (get m2 4)))))
01:48slyphonhahaha
01:48slyphonindeed
01:48devnwell then, lisp should be right up his alley
01:48devn:)
01:48slyphonkind of guy you want there when shit goes down
01:48slyphonin production, on a friday
01:48devnso he carries a gun?
01:49devn"have gun, will admin"
01:49slyphonindeed
01:49zakwilsonNever know when you might need to headshot a zombie process.
01:49devn"kill all the children
01:49slyphonsometimes you need to be a little more persuasive than normal
01:50devnhaha. i think for a lot of the heavy-duty neckbeards the beard does most of the talking
01:50devnlike: "Hello I resemble PLATO. Ever heard of him?"
01:50R4p70ramalloy, Well ok. My point was it's more way concise. And that's probably why clojure has update-in in core.
01:51devnslyphon: there's a large overlap. "philosopher beard" and "unix beard"
01:52R4p70ramalloy, But you're right my version was bogus.
01:52amalloyyes. it's more concise, but also much easier to manage/understand. basically the same reason any function gets written
01:52daakuanyone familiar with clj-time/joda time? i can't seem to figure out why the 'T in this doesn't work: (parse (formatter "yyyy-mm-dd'Thh:mm'Z") "2011-11-21T05:51Z")
01:52amalloyi imagine it got into core because it's an operation that frequently needs to be done, given clojure's emphasis on immutable hashmaps
01:56devndaaku: what are you trying to get with T
01:57daakudevn: i want to define a formatter that has a literal T in it
01:57R4p70rAnd since updating a non-nested structure take less code we don't really need an "update" I guess. But I see how update-in can be used with only one key... Anyways I was just a bit curious about the choice of built-in.
01:57amalloydaaku: you're using mm in two places. that sounds wrong
01:58devndaaku: what is the output?
01:59daakuamalloy: ah, that was definitely wrong
01:59daakubut fixing that didn't help: (parse (formatter "yyyy-MM-dd'Thh:mm'Z") "2011-11-21T05:51Z")
01:59daakugives: IllegalArgumentException Invalid format: "2011-11-21T05:51Z" is malformed at "T05:51Z" org.joda.time.format.DateTimeFormatter.parseDateTime
02:00hiredman'T' is most likely what you need
02:02daakuhiredman: ah, i didn't realize it was not just a escape prefix
02:02daakuthanks
02:05slyphonwhy is it that (vector :a) returns [:a] but (seq :a) and (set :a) throw exceptions?
02:05hiredmanbecause that is what they do
02:06amalloyvector creates vectors from items; seq and set create seqs and sets out of seqs
02:06slyphonhrm
02:07slyphoni kind of want (flatten (vector arg))
02:07amalloynooooo, you don't
02:07hiredmanuh
02:07slyphonright, i know that
02:07hiredmanwhy would you possibly want that?
02:07hiredmanwhat do you think that does?
02:08brehaut~flatten
02:08clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
02:08brehautwow. thats larger than i remember
02:08amalloybrehaut: dangit, i always forget i taught him that
02:08hiredmanclojurebot: mapcat is useful
02:08clojurebotRoger.
02:09slyphonso, i have a function that will take a map, one key is :flags, which I want to treat as a set, but someone may hand me a single value
02:09slyphon:flags [:a :b] or :flags :a
02:09hiredman(if (coll? ...) (set ...) #{...})
02:10slyphonah
02:10slyphonyeah, or, that
02:10slyphon:)
02:10slyphonthanks
02:12R4p70rslyphon, the closest equivalent to set and seq in your example would be "vec" not vector
02:12slyphonah
02:13scottjslyphon: hash-set is the equiv of vector
02:13slyphonah
02:13slyphonok
02:14slyphon(again)
02:27georgekhi, I'm using emacs, lein, and swank-clojure, and up to now when I add something to the project.clj I have to M-x clojure-jack-in again to get the changes to take effect. Is there an easier way? Trying C-c C-k in project.clj just says that it can't resolve the symbol defproject
02:28seancorfieldaccording to technomancy no, there's no easier way at present
02:28hiredmanthat is how you do it
02:28georgekOK thanks, good to know
02:28amalloyclojurebot: classpath is <reply> You can't add things (libraries, dependencies) to a running JVM process. Java doesn't like it, and we just have to live with that.
02:28clojurebotIn Ordnung
02:29seancorfieldif you have :checksum-deps true in project.clj you don't have to run lein deps which is one less step
02:29seancorfieldmake sure you have clojure-mode 1.11.4 tho' - earlier versions barf on lein output when it fetches deps
02:30hiredmancemmerick has a project that is supposed to save us all from it
02:30seancorfieldi look forward to that :)
02:31georgekcool, that'll be nice, thanks for the tips in the meanwhile
02:31hiredmanwell, we'll see if it does
02:31seancorfieldnow if i can just persuade my team mates to switch to emacs...
02:31georgekI'm just happy I have a remote emacs, Ring and nginx finally working :)
02:32hiredmanhttps://gist.github.com/a1f737bfe0d70a385d4c
02:32seancorfieldyeah, i need to try this whole remote emacs thing... i only found out about the client / server aspect recently...
02:34seancorfieldgah, are there any good examples out there of how to use clojure.test.junit?
02:36seancorfield"locate-dominating-file" - really? *boggle*
02:36hiredmanelisp, it's fun
02:37amalloyhiredman: i didn't know about locate-dominating-file. very handy
02:38hiredmanme neither, cribbed from clojure-mode
02:38devnI wonder: Does github have a limit on the number of times you can clone/pull repos?
02:39amalloydevn: planning to strike it rich by running git-backed rapidshare site?
02:39devnhahahha
02:39devnNo just trying to pull down every single recognized clojure repo
02:40devnso I can start parsing ns macros 3:)
02:52slyphon<cartman> I hate you java </cartman>
03:00scottjdevn: do you have a list of all clojure repos?
03:05amalloyscottj: i'm pretty sure github's api will give you that
03:20scottjamalloy: was only able to find repositories matching a search term in the api, no equivalent of https://github.com/languages/Clojure/created that would filter out forks
03:22amalloysorry, i guess by "pretty sure" i mostly meant "random guessing"
03:23scottjdevn: did you run slamhound on clojure-refactoring?
06:57babilenHi all. I am looking for a project that exemplifies good midje practices and welcome any pointers. (Or is adopting midje a bad idea?)
07:00babilenThe most obvious answer seems to be: "Take a look at midje itself!" :) *sigh*
08:29babilenWhat is a good way to write tests that read/write external files? How do I read them in a portable way?
08:34michael_campbellwhat kind of portable; across different OS's, or different environments (production, dev, beta, ...), or something else?
08:35babilenmichael_campbell: I was merely thinking about different OS's and absolute paths
08:36michael_campbellugh, yeah. always a pita. I don't know enough clojure to give you solid advice here, but there are generally os-level "create a temp name for me" calls somewhere that you can use to make a temp directory and put stuff in there.
08:36babilenmichael_campbell: The first is not hard at all, but I am unsure how to actually find the files. I've seen plenty of examples of .clj files being read which relies on setting the CLASSPATH correctly.
08:37michael_campbellor the cheesy way out, which is what I'm all about, is to "mkdir c:\tmp" on any windows box I have, then use /tmp for most everything, since it'll damn sure be on any *nix boxen. (Well, rather, I've never seen one that doesn't have /tmp)
08:37babilenmichael_campbell: I have a bunch of files that contain data that I need for testing. As I would also like to test the actual reading of the files I don't want to define their content in a variable.
08:38michael_campbell<nod> Were it me, I'd just put them in /tmp. But I may be misunderstanding your needs here, and as I said I'm way, way too new at clojure to be depended on for anything =)
08:41babilenmichael_campbell: Sure. I could put them in /tmp, but that would require that I still keep their content in a variable. I would much rather use a PROJECT/resources/test directory that contains all the files. Just not sure how to actually figure out the PROJECT path.
08:43mdeboardIs Josh out sick today
08:43mdeboardwrong window
08:47jkkramerbabilen: (clojure.java.io/resource "test/data.txt"), which returns a file URL, which can be passed to io/reader, etc
08:49babilenjkkramer: Wonderful, that sounds as if it is exactly what I was looking for. Lets test it
08:57raekbabilen: also, 'resource' always uses forward slash as the path separator
08:58raekto join non-classpath paths in an OS-independent way, use c.j.io/file
08:59raekyou can also use the java.io.File class directly to create temp files, among other things
09:00babilenraek: I'll do that, thanks.
09:01raekbabilen: 'resource' will look for files on the classpath (a good fit for resource files bundled with the application), so (io/resource "foo/bar.txt") can resolve to src/foo/bar.txt or resources/foo/bar.txt etc
09:01raekresources/ is generally preferred for non-code files
09:09samaaronthings are a little quiet in here :-)
09:12TimMcsamaaron: East coast of US is just getting to work.
09:12TimMcor just finished settling in
09:13ejacksonbzzzzzzzzzzzzzzz
09:13samaaronhahaha
09:13samaaronejackson: when are we grabbing that lunch?
09:14ejacksonhow's your tomorrow looking ?
09:14TimMcejackson: "Are We There Yet?" was great.
09:14ejacksonTimMc: Yeah, it blew me away,
09:14ejacksonGlad you liked it
09:14TimMcI sent a few notes to my work mail address. :-)
09:14samaaronejackson: tomorrow is grand
09:15ejacksonsamaaron: sorted, we're on :)
09:19ejacksonTimMc: the other videos that I really enjoyed were these http://vimeo.com/seandevlin
09:22TimMcah, those
09:23TimMcThanks for reminding me -- I'll download some to watch at the airport. :-)
09:54zerokarmaleftyeesh, someone implemented a jvm in js
09:55chouserooh, so now we can compile ClojureScript in the browser?
09:56zerokarmalefttheoretically? heh
09:58joegallocan you run rhino in it?
09:58apgwozzerokarmaleft: was it just compiling the openjdk via emscripten?
09:58apgwozor actually wrote a jvm in javascript?
09:59zerokarmalefthttps://github.com/notmasteryet/jvm-js <= actually wrote a jvm
10:02zerokarmaleftjoegallo: ouroboros!
10:03apgwozwoah. this is awesome
10:04zerokarmalefthttps://github.com/nurv/BicaVM <= also this
10:05apgwozpretty crazy
10:06apgwozsomeone should implement a JVM in clojure...
10:12michael_campbelland run clojure in it?
10:15fbru02_hi all
10:17Saturnationpretty disappointed in the "Clojure in Action" index thus far... :(
10:21Saturnationcorrection, I'm pretty disappointed in MY ability to remember what I'm looking for... :)
10:34fliebelHow does meta data work with macros? (a-macro ^:foo argument)
10:37TimMczerokarmaleft: Pretty cool! The JVM isn't perfect yet, but it basically works.
10:38fliebelI half expected to get an expanded with-meta form, but not so.
10:55AWizzArd|workfliebel: because you used a reader macro. As soon Clojure read it, it's gone.
10:56AWizzArd|workreads
10:57fliebelAWizzArd|work: oh, okay, so I just get a symbol with meta on it, nice. :)
11:03raekhrm. a bit off topic: I think I saw a presentation (probably FP-related) where it was mentioned that a certain language had "reactors"... anyone heard about such a language?
11:03raekis it a widely known concept?
11:09fliebelIs a workoing version of this in core? ie like partition-by, but taking parts up to a predicate returns false: (defn partition-with [f s] (lazy-seq (cons (take-while f s) (partition-with f (drop-while f s)))))
11:18R4p70rraek, Isn't a reactor pattern something the direct I/O events to various callbacks?
11:20R4p70rs/a reactor pattern/the reactor pattern/
11:22duck1123doesn't scala web dev make use of reactors? I seem to remember the words 'scala' and 'reactor' used in the same sentence multiple times
11:25klauernI think you guys are talking about this paper: http://lamp.epfl.ch/~imaier/pub/DeprecatingObserversTR2010.pdf
11:42fliebelThis is impossible. 2 projects, both have the same core.match in lib, entering the same command on the repl, I get a different result.
11:44tcjI'm using clojure 1.3.0 and want to use some contrib.string (http://richhickey.github.com/clojure-contrib/string-api.html) stuff. How do I add this to a leiningen project?
11:44lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/string-api.html) and try to stop linking to rich's repo.
11:45apgwoz... why doesn't rich just remove his repos if they're so out of date?
11:45duck1123also. all the string stuff is in clojure.string now
11:45cemerickamalloy_: well done :-)
11:45tcjWill have a look, lazybot :)
11:45cemerickapgwoz: Unknown.
11:45apgwozcemerick: ok. :)
11:46cemericka message to clojure-dev would probably be worthwhile
11:46duck1123tcj: So here are the new clojure.string stuff http://clojuredocs.org/clojure_core/clojure.string you don't need to add anything for them, just require (not use) clojure.string
11:46apgwozi'm sure if someone asked him nicely to remove the repos, or put a big warning in the readme with instructions on where to go, he'd comply
11:47tcjduck1123: Thanks
11:47dnolenfliebel: sounds strange, what command?
11:48dnolenfliebel: if it seems like a bug, it would nice to have a very small set of instruction to reproduce.
11:48fliebeldnolen: something without a vector, so one throws an exception, while the other does not.
11:48fliebeldnolen: No, certainly a environment issue :(
11:48hugoddnolen: I am trying to match a map with a constrained set of keys, some of which are optional. I can't see a way of doing this with the current :only. Also :guards can not be or'd (I wanted a guard that matches if a key was not found or a predicate matches).
11:50fliebeldnolen: When was the vector-less binding introduced?
11:51dnolenhugod: ok, enhancement tickets please to at least get the discussions started.
11:51hugoddnolen: will do
11:51fliebelBoth have 0.2.0-alpha6 in lib.
11:52dnolenfliebel: hmm, I think that landed in alpha5.
12:01R4p70rI've just seen this headline on Hacker News "GCC 4.7 adds transactional memory extensions for C/C++" http://goo.gl/kvUee Haven't read the article yet but I'm kind of curious about it.
12:05R4p70rThat page doesn't say much.
12:11fliebeldnolen: http://pastebin.com/CKdhBgud http://pastebin.com/WGg1QGyb
12:11tcjI'm using compojure. Is there a way to assign a default value to a parameter using the compojure destructuring syntax. I read this page https://github.com/weavejester/compojure/wiki/Destructuring-Syntax and didn't see anything. I like to do something like
12:11tcj(defrouts name (GET [p1 (or p2 "none")] "My response here"))
12:12dnolenfliebel: is that the same jar, did you try replacing w/ the jar that works?
12:13TimMcR4p70r: Looks less powerful than Clojure's STM,
12:14TimMcsince it probably locks pessimistically.
12:16fliebeldnolen: hm, will try...
12:16fliebeldnolen: match does not include a version number in the source, does it?
12:17fliebeldnolen: Are you sure it landed in alpha5? because I figured out I still had a copy hanging around in checkouts.
12:18fliebel*doh*
12:20fliebelah, now it is at least consistently broken :)
12:23fliebeldnolen: Is there any way to get something more recent than 0.2.0-alpha6 via maven?
12:25dnolenfliebel: ah sorry, the fix is in HEAD, but release for that yet
12:25dnolenfliebel: I was hoping to get some bigger tickets in before cutting another alpha, but who am I kidding? :) I'll cut alpha7 tonight.
12:46hugoddnolen: is this expected? (let [x [:a 1 :b 1]] (clojure.core.match/match [x] [{:a _ :b _}] true)) => true
12:54dnolen,(bases (type []))
12:54clojurebot(clojure.lang.APersistentVector clojure.lang.IObj clojure.lang.IEditableCollection)
12:54dnolen,(supers (type []))
12:54clojurebot#{clojure.lang.Seqable clojure.lang.IPersistentCollection clojure.lang.ILookup java.lang.Comparable clojure.lang.Sequential ...}
12:55dnolenhugod: the interface I test for is clojure.lang.ILookup, not sure if there's a better one.
12:56gfredericksthe weirdest thing about that is that [:a 1 :b 1] is not a list of pairs
12:56dnolengfredericks: that has nothing to do with it, Vectors support ILookup
12:56gfredericksdnolen: I know, I mean from a user-expectations perspective
12:57dnolenthose map pattern keys are wildcards, so they aren't even tested
12:57gfredericksoh hm
12:57gfredericksso (match [x] [{:a 1 :b 1}] true) would not match?
12:57dnolengfredericks: it would not
12:58gfrederickskay that's good
12:58gfredericksdnolen: I used match seriously for the first time yesterday, it went quite well.
13:01dnolenhugod: I suppose I could add an additional type constraint - java.util.Map. But seems odd since hardly anyone would go through the hassle to implement that.
13:02hugoddnolen: java.util.Map?
13:02dnolenhugod: but I don't like that idea. You might for example want to match a vector with map pattern syntax!
13:03dnolen(match v [{0 3 13 :Foo}] ...)
13:03dnolenis kinda nice
13:03dnoleninstead of [3 _ _ _ _ _ _ _ _ _ _ _ _ :Foo]
13:04dnolenhugod: I just mean check for some other thing to ensure map-like-ness, but I'm not convinced it's much of an issue.
13:05dnolen,(let [{a 0 b 5} [:a :b :c :d :e :f :g :h]] [a b])
13:05clojurebot[:a :f]
13:05fliebeldnolen: yay for release :)
13:05dnolenI rest my case
13:06hugodI can always use a guard, but just wanted to check that it was expected behaviour - I found it surprising.
13:07dnolenhugod: was kidding about "I rest my case". If you got better ideas - I'm listening.
13:11TimMcdnolen: So {:a _} means "lookup on key :a and confirm that any value is returned"?
13:11TimMcas opposed to (contains? :a)
13:13fliebelIs nil a value?
13:13hiredmanwhat else would it be?
13:14dnolenTimMc: no, wildcards might not be tested.
13:15dnolen{:a _} is next to useless
13:15dnolen{:a a} at least will force extraction of the value.
13:17tcjI'm trying to create a jar from clojure code to use in a Java application. I've done ~10min of googling and see a few different solutions (Clojure.RT, and :gen-class). Is there a "preferred" way to go? I tried the gen-class method, but couldn't get it going (only spent ~5min... for some reason lein jar does not seem to create .class files in my output jar).
13:20raektcj: you need to either add a ahead of time compilation entry for the namespace to the project.clj like ":aot [the.ns]" or declare the namespace as main like ":main the.ns". in both cases you need to add :gen-class to the ns form like (ns the.ns (:gen-class))
13:20raektcj: the clojure.lang.RT way is a bit simpler
13:21tcjraek: Thanks!
13:22dnolenhugod: as far required keys, got something shorter than :required ?
13:26hugoddnolen: :mandatory, :at-least or :enforce are the only things that spring to mind
13:27gfredericks:has
13:27dnolengfredericks: nice
13:28hugoddnolen: so in the meantime, to enforce the presence of a key requires a guard expression on it's value, checking for c.c.match/not-found?
13:28dnolenhugod: hmm, have you tried that?
13:29gfredericksdnolen: also :contains would be consistent with the core function name
13:29hugoddnolen: nope
13:30dnolengfredericks: good suggestions ticket updated.
13:30dnolenhugod: I don't think that will work.
13:30dnolenhugod: I think I feed c.c.match/not-found only for :only
13:31gfredericksdnolen: has it been suggested to have a similar modifier without an argument that requires all the keys listed in the pattern? e.g., :has-all
13:32gfredericks({:a 1 :b 2} :has [:a :b]) <==> ({:a 1 :b 2} :has-all)
13:33dnolengfredericks: not a bad idea though sugary stuff I hope other people will send patches for, I really need to tackle the remaining big things :)
13:34gfredericksdnolen: I just took a glance at the jira issue, did you mean to include the :has/:contains inside the map?
13:36dnolengfredericks: oops thx fixed
13:36dnolengfredericks: sadly we can't put things in the map since we can't reverse keys like destructuring does.
13:36tcjI'm trying to use Clojure from Scala (just using the Scala repl to test using Clojure from Java). One problem I've run into is that clojure.lang.RT.var conflicts with Scala's var keyword. Am I just out of luck here?
13:36hugoddnolen: :has/:contains still doesn't allow the restriction of which keys are present without enforcing their presence, iiuc.
13:37dnolenhugod: you want not-contains?
13:37gfredericksI suppose that's because destructuring has the luxury of requiring that keys be symbols for normal usage, whereas match allows arbitrary keys?
13:38robbritis there a good clojure "package manager" like cpan or rubygems?
13:38dnolengfredericks: arbitrary anything, which might mean duplicate keys
13:38tcjHere's what I'm seeing:
13:38tcjscala> RT.var("clojure.core", "require").invoke(Symbol.intern("cfr.web.core"))
13:38tcj<console>:1: error: identifier expected but 'var' found.
13:38tcj RT.var("clojure.core", "require").invoke(Symbol.intern("cfr.web.core"))
13:38gfredericksdnolen: the reader will allow duplicate keys?
13:38raekrobbrit: Leiningen (which uses Maven for dependency resolution and fetching)
13:39dnolengfredericks: it won't that's why we can't reverse keys like destructuring does
13:39hugoddnolen: more like :may-contain-only
13:39tcjSorry, should have googled first. I found the solution: http://www.scala-lang.org/node/8471
13:40gfredericks:may-not-contain-any-keys-other-than-these
13:40robbritraek: great, thanks!
13:40hugodgfredericks: :)
13:40dnolenhugod: oh, that whatever keys are there, below to a specific set
13:40dnolenbelong
13:40hugoddnolen: yes
13:40raekrobbrit: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
13:42dnolenhugod: ok, noted on the ticket
13:43ajsharpi don't understand why i'm getting a tail recursion error here -- I think I'm misunderstanding something about recur
13:43ajsharphttps://gist.github.com/1383464
13:44hugoddnolen: thanks - though :has/:contains certainly looks useful too :)
13:46gfredericksajsharp: your recur isn't in tail position
13:46gfredericksyou can't use recur that way
13:46raekajsharp: tail position is basically the "top level" of a function or a branch of an 'if'
13:47ajsharpraek: gfredericks so i can't use recur inside an if?
13:47gfredericksajsharp: it has to be such that the recursive call is the last thing the function does
13:47ajsharpah
13:47ajsharpright
13:47raekajsharp: in your example 'recur' is not in tail position since the call to (:created_at ...) remains to be evaluated after the "recur" would have returned
13:47gfredericksyou can inside an if, the issue is you have it inside a vector
13:47gfredericksand the :created_at that raek just mentioned
13:48raekajsharp: so the important thing is that whatever (recur ...) returns should be the result of the function
13:48raekthen it's a tail call
13:48ajsharpraek: gfredericks: got it, thanks much
13:49TimMcdnolen: Interesting. So matching against x with {:a _} where (:a x) would produce an error... might not throw an exception?
13:49TimMcbecause match might not even bother asking?
13:50gfredericksTimMc: why would (:a x) produce an error when x passes the type requirements?
13:50gfredericksa funky implementation that throws exceptions?
13:50TimMcBecause x might be a bastard lying piece of reified fraud.
13:50TimMcright
13:50dnolenTimMc: what I mean is {:a _} without some qualifier is non-information. this could be changed, but I haven't heard anything convincing.
13:50gfredericksTimMc: oh those darn BLPORFs
13:50TimMcdnolen: Oh, I think it makes sense. I'm just curious. :-)
13:51TimMcGIGO
13:51TimMcor "Ask a stupid question..."
13:54gfredericksYesterday I had a collection of objects that were either {:foo x} or {:bar y :baz z} and wanted to differentiate them with pattern matching, but ended up changing them to [:foo x] and [:bar y z]
13:54gfrederickssince it seemed to fit core.match better
13:55gfredericksmay have been a better representation of the data anyhow
13:56dnolengfredericks: hugod: all this is good feedback, stuff to ponder ...
14:06TimMcgfredericks: So you needed to find out if they had a certain key?
14:06TimMcOr you could have an additional field :type -> :foo
14:11gfredericksTimMc: yeah, a :type field would have worked. Certainly I could have done it with guards, but that was more verbose than I wanted.
14:12gfredericksdoing the vector thing ended up being a lot more syntactically distinct, and it wasn't important enough code to care how readable it is next week
14:12gfrederickss/distinct/succinct
14:13duck1123I find that lazybot actually doing that replacement is usually a bit much
14:14duck1123I'm perfectly capable of doing a simple word replacement in my head
14:16amalloyduck1123: yeah, that's why we turned it off
14:18hiredmantechnomancy: google wave, it's the future
14:19sridno more clojure; need to rewrite my project in python (thinking of using gevent - to replace lamina-based code)
14:20technomancyhiredman: I'm all for retro-futurism
14:20hiredmantechnomancy: you've seen http://www.paleofuture.com/ ?
14:20hiredmanwell, I guess they moved
14:20hiredmanhttp://blogs.smithsonianmag.com/paleofuture/
14:21technomancyyeah, a while ago, but I had forgotten it; thanks
14:21TimMcamalloy: I just got in the habit of putting a space in front of my s/.../.../
14:23Raynesamalloy: No, we turned it off because people whined like baby pigs. I'm not going to sugarcoat it.
14:23licensercemerick: I finished the translation :)
14:24cemericklicenser: nice, send a pull req :-)
14:24Raynescemerick: I demand that my conversation be posted immediately.
14:24licenseraye aye :)
14:24RaynesOr I withdraw your rights to my beautiful voice.
14:24RaynesYour rights? Some legal thing.
14:25cemerickRaynes: are you having a conversation with yourself now? ;-)
14:25RaynesI hope not.
14:25cemerickI was going to combine yours and Chris' into one, since they were on the shorter side.
14:25RaynesThat sounds good.
14:25cemerickWasn't planning on it until next week.
14:26RaynesI was kidding about immediately.
14:26RaynesYou can have a week. ;)
14:26cemerickThat's good, 'cause it wasn't gonna happen this week. ;-)
14:26RaynesYou would have given in.
14:27licenseralso Raynes clj-highlight is updated to clojure 1.3.0
14:28RaynesNeat
14:28devnHow would one implement "method_missing" using multimethods?
14:28Raynesdevn: :default
14:28hugoddnolen: c.c.match/not-found seems to be getting passed to the guard quite happily. I'm finding (defn key-found? [x] (not= x :clojure.core.match/not-found)) to be useful.
14:28hugod
14:28devnRaynes: ah yes, thanks
14:28cemerickRaynes: most other times, probably. :-)
14:28devnalso, fastest way to take {:a 1 :b [2 3 4]} and get (:a 1 :b [2 3 4])
14:29devnI'm doing something silly
14:29TimMc&(apply concat {:a 1 :b [2 3 4]})
14:29lazybot⇒ (:a 1 :b [2 3 4])
14:29devnduh. I was even using concat
14:31dnolenhugod: ok, good to know :)
14:31TimMcdevn: I'm probably complecting some things there. :-P
14:32gfredericksTimMc: the simple way to do it is (constantly '(:a 1 :b [2 3 4]))
14:32TimMchaha
14:32TimMcYou've been doing too much 4clojure.
14:32gfredericksno reason to complect output with input
14:33TimMcnice
14:47gfredericksI'm thinking about writing tests for an existing java web app. Is the simplest method to deploy it to a server (tomcat?) and test it as a black-box HTTP server?
14:48gfredericksand if I go that route, do I want to use enlive?
14:48gfredericks(not very familiar with it)
14:48TimMcI'm finding enlive's documentation problematic.
14:48TimMcThe lack of it, you see.
14:48tcjI'm trying to run a some Clojure code from Java. I ran 'lein uberjar' to create a jar file (all my files are .clj files in the resulting jar). I can then us this using clojure.lang.RT in a Scala REPL. Now I'm trying to use this in Tomcat and getting a FileNotFoundException saying it can't find a .clj file on my classpath. I'm stuck... The jar is in the correct place for Tomcat to see it. Any...
14:48tcj...idea why Tomcat doesn't fine my .clj file?
14:49gfredericksTimMc: I don't imagine you have an alternative in mind?
14:50TimMcgfredericks: Not yet. :-(
14:50TimMctcj: I thought uberjar AOT'd all the clj.
14:50ibdknoxhah korma ended up on HN again.. For those wanting to hear more about why I wrote it despite ClojureQL's existence: http://news.ycombinator.com/item?id=3261479
14:51tcjTimMc: There are .class files for everything except for my files
14:51tcjI'm still confused why this works in a Scala REPL, but not in Tomcat
14:53hiredmantcj: tomcat != scala repl
14:53hiredmanthe environments are different (the most likely do different kinds of classloader tricks)
14:54tcjhiredman: Thanks. Understood. I guess I'm looking for somebody that has experience running Clojure from Tomcat using clojure.lang.RT
14:54hiredmanthe fact that code behaves differently in different environments should not be surprising
14:55tcjI feel like I have a pretty good grasp of Tomcat's classloading... Anything in WEB-INF/lib should be in the app's classpath
14:56tcjI guess i'll dig into the RT code to see how it uses the CP to load files
14:56hiredmantcj: what makes you say that? (about WEB-INF/lib)
14:56tcjibdknox: You wrote korma? Thanks! I've been using and like it.
14:57ibdknoxtcj: you're quite welcome :)
14:57tcjhiredman: the docs at tomcat.apache.org
14:57hiredmantcj: WEB-INF is a war thing, you mentioned jars
14:58devnibdknox: extra korma love from me
14:59tcjhiredman: thanks.
15:07mefestotcj: i've used tomcat to load some clojure code from java ... been a while though.
15:08mefestotcj: have an example of how you are working with the clj files?
15:09Raynesdevn: So, is pair.io awesome?
15:09RaynesI bet it's awesome.
15:10tcjmefesto: RT.var("clojure.core", "require").invoke(Symbol.intern("cfr.web.core")); return RT.var(ns, function);
15:10devnRaynes: It's pretty great.
15:10devnI could show it to you later if you'd like to pair
15:11RaynesI don't have an account.
15:11tcjmefesto: it blows up with this message: java.io.FileNotFoundException: Could not locate cfr/web/core__init.class or cfr/web/core.clj on classpath:
15:11devnYou don't need one Raynes. You wont be able to administer the instance, but I could invite you to pair
15:11RaynesOh. Awesome!
15:11RaynesSure then, ping me.
15:11devnwill do
15:11devnback to work for now :)
15:12RaynesLikewise.
15:12mefestotcj: and that file is definitely bundled in your war? either in WEB-INF/classes or in a jar under WEB-INF/lib ?
15:12tcjmefesto: Yes
15:12tcjI've triple checked it
15:12tcjinspected the jar
15:14mefestotcj: just for debugging to make sure that resource is available, in your java code can you log the result of something like: Thread.getCurrentThread().getContextClassLoader().getResource("path/to/clj/file");
15:16tcjmefesto: I think this may be something wrong on my end (surprise! :) The (uber) jar has clojure.lang.RT.class in it, but that class it not found. I discovered this after I removed clojure.jar from my classpath (it should be redundant with the uber jar, I think).
15:17mefestotcj: so you have the clojure.jar in tomcat's shared lib dir?
15:18tcjmefesto: No, it was in my app's WEB-INF/lib dir
15:18mefestothe error message you pasted earlier doesn't complain about RT not being there ... instead it's specifically complaining about the clj file you are trying to load: cfr/web/core.clj
15:19tcjmefesto: I found the problem
15:19tcjINFO: validateJarFile(/home/ian/work/cfr/target/cfr-0.0.36/WEB-INF/lib/cfr-1.0.0-standalone.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
15:19tcjI'm using compojure, which I'll be included the Servlet.class
15:19tcjTeach me to look at my logs :)
15:20tcjmefesto: Thanks for the help debugging!
15:20mefestoyou shouldn't be bundling the servlet api classes with your war files ... is that what you think is happening?
15:20ibdknoxtcj: you should try out Noir ;)
15:20technomancythat's twice in an hour I've wished for :when-let inside a for call
15:20technomancywonder what that means
15:20tcjmefesto: I agree. I didn't realize I was..
15:21gfredericksgiven I have a generic java web-app which I've been able to deploy to tomcat easily, should it also be straightforward for me to use jetty to test it?
15:21gfredericks(instead of tomcat, which I imagine would be a lot more sluggish)
15:21mefestotcj: maybe you have the servlet api listed under :dependencies instead of :dev-dependencies ?
15:21mefestotcj: if you're using leiningen ... not sure if that's the case
15:22amalloytechnomancy: i want it fairly often. it'd be nice to have but probably not worth the syntax pollution
15:22mefestotcj: i think you said you were using lein uberwar so maybe so :)
15:22technomancyamalloy: pollution is more onerous when it results in new top-level vars
15:23tcjmefesto: No servlet API, just compojure and some other stuff. I'm pretty sure it's compojure. I'll just do a normal jar and include the necessary jars in my Tomcat app
15:24ibdknoxdoes anyone know of a simple way to format currency? (add commas and such)
15:24amalloytechnomancy: i agree, but it's still more complexity/load to remember and document inside of for
15:24tcjibdknox: I'll prolly eventually go to noir, but I want to start from the beginning. From what I understand, Noir builds on ring and compojure?
15:24ibdknoxtcj: it does indeed
15:24technomancyamalloy: I agree enough to just gripe about it on IRC and not open a jira ticket
15:24mefestogfredericks: it should be. you might find jetty to be nicer :)
15:24brehautibdknox: i *think* format should be able to do that with the right gibberish
15:24ibdknoxbrehaut: I see... *goes to read more about format*
15:25amalloygood, good. we're on the same side then. as you were
15:25gfredericksmefesto: kay, cool. Also I was making sure I wasn't ignoring any easier option.
15:26ibdknoxor there's also java.text.NumberFormat :D
15:27mefestois clj-http top of the heap as far as clojure http clients go?
15:27amalloyibdknox: yeah, java has a built-in currency formatter somewhere
15:28hiredmanmfoemmel: yes
15:28ibdknoxyep, for future reference: (.format (NumberFormat/getCurrencyInstance) 32049852)
15:29brehauti wonder if format should be extended to take a string or a java.text.Format instance?
15:32scottjdoes clj-http support just downloading the headers, not the actual content? (idk, does http support that?)
15:33mefestoscottj: that would be an http HEAD request
15:33brehautscottj: although HEAD is only a GET without the content; theres no provision for a POST without content beside what the server implements itself
15:34brehaut(because that would be meaningless)
15:34scottjahh so clj-http.client/head
15:42brehautibdknox: i think the gibberish for format i was thinking of was (format "%,(.2f" (double 32049852)) and its not workable because if the number is negative, then you cant get the $ sign inside the parens as best i can tell
15:53oreillsHi all
15:55gfredericks,(println "oreills: hi.")
15:55clojurebotoreills: hi.
15:56oreillsHaha, very nice!
15:56oreills,(println "Hello, world")
15:56clojurebotHello, world
16:01ibdknoxdsantiago: Got a stencil question for you
16:01oreillsHas anyone had any luck setting up http://clojars.org/org.clojars.ibdknox/lein-nailgun with Clojure 1.3?
16:03ibdknoxoreills: I haven't had any issues
16:03oreillsHeh, seems like I asked that at a good moment. =P
16:04oreillsWhen I install it as a leiningen plugin, lein starts kicking up errors and refuses to work until I delete the plugin from .lein/plugins/
16:04ibdknoxwhat version of lein?
16:05oreillsInstalled from bootstrap: Leiningen 1.6.2 on Java 1.6.0_22 OpenJDK 64-Bit Server VM
16:06ibdknoxoreills: and what are the errors you're getting?
16:06oreillsHangon, I'll stick it in pastebin
16:06devnAnyone here running the new Java release for OSX?
16:07devnI thought I'd hold off for a bit until I knew it didn't break muh clojures.
16:07hiredmanthe beta?
16:07hiredmanruns fine
16:07devnhiredman: iyes
16:07devnhiredman: cool, thanks
16:07hiredmanhaven't tried any ui stuff
16:09chousertechnomancy: emacs starter-kit is fantastic. That plus evil and about one week of usage and I'm pretty productive in emacs.
16:10oreillsibdknox: http://pastebin.com/cncs0Gvv
16:11ibdknoxlikely due to the JVM mismatch
16:12ibdknoxtry to clone the repo and install it, then plugin install
16:12oreillsOk, thanks very much, will give it a try. =)
16:15scgilardiah, specific evil. cool.
16:16technomancychouser: sweet; glad to hear it
16:16gfredericksis enlive not appropriate for http testing? Glancing through the code suggests it just does GETs?
16:18TimMcdevn: What is pair.io?
16:18brehautgfredericks: (enlive/html-snippet (:content (request something))) i think ?
16:18TimMcgfredericks: Use something else to get the data; feed the string to enlive.
16:19devnTimMc: Pure unadulterated awesome?
16:19brehautenlive just uses the (not particular sophisticated) java url plumbing to fetch remote resources
16:19technomancyTimMc: http://pair.io has a video that explains it pretty well
16:19gfredericksTimMc: okay, so clj-http for the http part and enlive for the assertions?
16:19devnTimMc: heh, it's zkim's (clojuredocs) setup for spawning AWS instances with default templates
16:20devnTimMc: on top of that you can invite github users to your repo, it imports their pubkey into the instance
16:20devnTimMc: finally, you can save off an image for use later, or save the full current state of the image so you can resume where you left off
16:20TimMctechnomancy: Call me old fashioned, but I prefer to skim over several paragraphs of text rather than subject myself to a forced audio/video linearization of a topic.
16:21TimMcdevn: So, um... what does it *do*?
16:21TimMcRun websites?
16:22TimMctechnomancy: Also, no headphones.
16:22gfrederickslike heroku for tmux?
16:23TimMcor vice versa
16:23gfredericksor something
16:27gfredericksI just realized this app is a client-heavy javascript app :|
16:29gfredericksdangit I need some kind of crazy browser simulator. There's nothing clojure-oriented in that arena is there?
16:29ajsharpis there a way to see in the docs or otherwise all the functions available to say, a hash map?
16:30gfredericksajsharp: there's that whatsit-doohicky what cemerick made
16:30gfredericksajsharp: http://www.clojureatlas.com/
16:30cemerickgfredericks: that's what I should've called it from the start
16:30ajsharphaha
16:30ajsharpwhatsit-doohickey
16:30brehautcemerick: was the domain already taken?
16:31cemerickbrehaut: that's *always* the problem
16:31cemerickbrehaut: saw you released. Congrats, looks nice. :-)
16:31brehautcemerick: thanks :)
16:31gfrederickscemerick: I had the complementary problem. I snagged lolwaffle.com but had not a clue how to make a million dollars with it.
16:31brehauti feel the need to make a better CSS file for it now ;)
16:32gfredericksajsharp: the clojure cheatsheet can be helpful too
16:33ajsharpgfredericks: aren't there ways to introspect on types in clojure?
16:33cemerickgfredericks: I have about a dozen domains like that :-)
16:33brehautcemerick: id like to have a few people bash on it in the wild before trying to get it onto wordpress
16:34cemerickbrehaut: understood.
16:34brehautthe domain registration industry would collapse if nerds stopped speculating on random fun domains
16:34gfredericksI think becausetheluckystiff.com might be still available
16:34cemerickbrehaut: I'd help, but I can't let my yak-shaving descend into running a blog myself, etc.
16:35gfredericksajsharp: the functions that you'd typically use to handle maps are not instance methods of the map type
16:35brehautcemerick: thats no problem
16:35gfredericksajsharp: so it depends on what exactly you're after
16:35brehauti send a pull request to marginalia; no idea if they will accept it
16:35ajsharpgfredericks: right, but like, for ruby, i'll often look at the docs for the Enumerable module
16:36brehautand seancorfield has expressed interest in getting it going himself
16:36cemerickbrehaut: fixed that for you: https://twitter.com/#!/cemerick/statuses/138730619369816064
16:36brehautcemerick: awesome :)
16:37gfredericksajsharp: I guess things aren't really organized that way. There are the two resources I mentioned, and also lazybot's findfn feature can be quite useful
16:37ajsharpi see
16:37gfredericks$findfn {:foo "bar"} :baz :bang :bang
16:37lazybot[clojure.core/if-not clojure.core/dosync clojure.core/sync clojure.core/with-loading-context clojure.core/with-redefs clojure.core/condp clojure.core/get clojure.core/and clojure.core/locking clojure.core/io! clojure.core/when clojure.core/trampoline]
16:37ajsharpcemerick: i presume this is why you're building clojureatlas??
16:37lazybotajsharp: Definitely not.
16:37gfrederickshaha weird
16:38ajsharphrm
16:38wilkesajsharp: you can also checkout http://clojure.org/sequences and http://clojure.org/data_structures
16:38cemerickajsharp: this, being?
16:38cemerickThe project's rationale is below the fold.
16:38cemerickSadly falling behind at the moment. seancorfield is going to whack me one if I don't get 1.3 up there, pronto.
16:39ajsharpyea, so far what i see looks interesting
16:39ajsharpi'm definitely finding myself missing the introspection of ruby as a way to discover what i can do with an object / type
16:40gfredericksajsharp: also I believe basic questions are welcome in #clojure. Especially hairy questions about manipulating data structures people seem to have fun with.
16:42cemerickajsharp: the operations available for a particular type of value in Clojure are an open set. The tradeoff is that you have very, very few base types, and tons of operations that work with them, so composition is natural and *expected* in Clojure, rather than something you need to design for explicitly.
16:42gfredericks(inc cemerick)
16:42lazybot⇒ 8
16:42cemerickThat's not actually a tradeoff, more like just one way that Clojure is OP. :-P
16:42gfredericks^ I knew there was something to say along those lines, but didn't know what it was :)
16:43cemerickThe actual tradeoff is that you can't just do (dir some-value), and instantly know what operations can be used with values of that type.
16:43hiredman~#9
16:43clojurebot9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures.
16:43ajsharpcemerick: awesome, thanks, that's very helpful
16:44wilkesajsharp: it's a big part of the learning curve. It's disorienting at first but a fair tradeoff in the long run
16:44cemerickhiredman: you should have clojurebot emit "— Perlis, http://www.cs.yale.edu/quotes.html&quot; at the end of each quote.
16:45cemerickThat may be the most useful bot command ever, though.
16:45cemerick~#119
16:45clojurebot119. Programming is an unnatural act.
16:45cemerickThat takes care of a lot of the others.
16:49oreillsibdknox: Still no luck, am I meant to plugin install ibdknox/lein-nailgun or scott/lein-nailgun? The lein install creates a file in ~/.m2 called scott/lein-nailgun : http://pastebin.com/C4nh3tJz
16:49TimMc~#55
16:49clojurebot55. A LISP programmer knows the value of everything, but the cost of nothing.
16:50nickikcemerick: Have you seen the Standford-Class on Probabilistic Graphical Models. I have read your conj slides and I hope this class will help me understand them :)
16:52TimMc(inc hiredman)
16:52lazybot⇒ 6
17:01mebaran151I'd like to teach lein to use a 32 bit jvm. I have both Java 1.6 and Java 1.7 installed. What's the best way to set up a project to use the 32 bit jvm (have to interact with an old school ODBC database...)
17:02cemericknickik: I did. Her book is very good.
17:02TimMcmebaran151: It can't do 32-bit by default?
17:02technomancymebaran151: set the JAVA_CMD environment variable
17:02cemerickOr, I should say, very good from my thumbing through it. I happened to choose the Darwiche, but either will likely do just fine.
17:02technomancyor use update-java-alternatives if you use a debian-based system
17:02TimMcOh I see, you just want to select a JVM.
17:09nickikcemerick: Have you been to Standford? I will have to stuide up on math befor I can take the class. I will do the algorithems class for sure (im only self taught and lack some basics) and I hope I will have time for one other class. Either ML or PGM (or AI but thats not jet offered). Not sure witch one is preferable.
17:10cemericknickik: nope, never been to Stanford
17:11cemerickI'm self-taught too.
17:11cemerickThough, I hope people take that as a cautionary tale and not a recommendation. :-)
17:15nickikcemerick: I wanted to go to collage next year but the will trie to get me to programm everything in java or c++. So maybe Ill to an Experiment on my self and embrace chances offered by standford.
17:16gfredericksis there a way with leiningen to do "provided" dependencies?
17:16nickikThats more of a creazy idea then a plan.
17:16cemericknickik: learning how Java works isn't the worst thing in the world if you really want to understand Clojure top to bottom.
17:18mebaran151technomancy: thanks! anyway to tell that directly to the lein project?
17:19mebaran151rather than polute the environment (I'm running off of Windows Powershell)
17:20gfredericksmaybe that's not really what I want anyhow
17:20gfredericksor maybe it is
17:20technomancyno, it can't be checked into the project
17:20gfredericksif I want to avoid (Class/forName ...) everywhere
17:20technomancyusually JAVA_CMD is specific to the machine you're on anyway
17:23gtrakgfredericks, you could do the eval approach
17:24gfredericksgtrak: eval! dang thing is so shunned I forgot it existed.
17:25gtrakthey do that trick in clojure.tools.logging to compile at runtime, with a class that might not exist in the classpath
17:26gtrakgfredericks, https://github.com/clojure/tools.logging/blob/7694fd2067e3366b63b50dc698c32da17488ea10/src/main/clojure/clojure/tools/logging/impl.clj#L82
17:26oreillsHow do I install a lein plugin after cloning the repo? I've tried lein install and it's created a folder in ~/.m2/repositories, but how do I now point lein plugin install at that location rather than the central repos?
17:27mebaran151technomancy: thanks, yeah this project is weird; I have to interface with an old 32 bit odbc sybase db, so I'm little bit pickier with regard to my jvm than I usually would be
17:28technomancyyeah, leiningen doesn't really attempt to manage system-level dependencies
17:28technomancyit's outside the scope
17:29gfredericksgtrak: looks right
17:29gtrakoreills, when you do a lein plugin install, it copies it to a folder whose name escapes me
17:29duck1123~/.lein/plugins
17:29clojurebotExcuse me?
17:29gtrakoreills, ~/.lein/plugins$ ls
17:29gtraklein-eclipse-1.0.0.jar ritz-0.1.7.jar swank-clojure-1.3.2.jar
17:30oreillslein plugin install seems to fetch from clojars/maven repos and copy to ~/.lein/plugins
17:30oreillsI've tried copying the jar generated from lein install there manually
17:30oreillsBut it's giving me lein errors still
17:30technomancyoreills: you should be able to do "lein plugin install" if you've done the regular "lein install"
17:31R4p70rDoes anyone have an idea for a simple Clojure project that can benefit the community? Look into some bug or develop a simple lib maybe.
17:32oreillstechnomancy: Using the original url? e.g. lein plugin install org.clojars.ibdknox/lein-nailgun "1.1.1"
17:32technomancyit's not a URL, but yeah
17:33mebaran151ah technomancy, I found a cleverer hack: I just launch lein from a 32 bit version of powershell and Windows handles the rest
17:33technomancyjust match whatever's in project.clj
17:34oreillsYeah, it seems to install, but then it makes lein throw "java.lang.NoSuchMethodError: clojure.lang.KeywordLookupSite.<init>" errors for every task after that
17:34oreillsI guess I haven't got the right environment for the plugin
17:35technomancysounds like the plugin is broken
17:35oreillsibdknox said I should clone the repo, install it and then install plugin because of a JVM mismatch
17:36oreillsAm I causing problems using openjdk?
17:36oreillsShould update-java-alternatives to sun and then reinstall lein?
17:36technomancynah, openjdk works fine
17:37oreillsHm. =/ Could it be a 64bit thing then?
17:37technomancyI don't think so
17:38oreillsHm, ok, I'll just submit a bug report on github, then, unless you have any other advice?
17:41technomancyyou'll have to run it by him
17:41oreillsOk, thanks very much for your time.
17:42oreillsAlso, thanks very much for leiningen, it's brilliant. I was dreading getting clojure set up on another laptop and the bootstrapping made it take about 5 mins. =)
17:44technomancyheh; great
17:45gfredericksif I do (eval '(new foo.bar.Baz)) and nobody has loaded Baz yet, will it still work?
17:45oreillsAm off, see you later
17:45oreillsThanks again
17:47gfrederickshm, eval doesn't see locals :/
17:48hiredmanclojure doesn't have reified environments
17:48hiredman(at runtime)
17:49gfredericksGuess I can pass something in with a dynamic var?
17:49hiredmanbest to think on it
17:49hiredmanyou most likely don't need eval
17:50gfrederickshiredman: I'm using classes not available at compile time
17:50gfredericksso else I could do Class/forName
17:50hiredmanand?
17:50gfrederickswhich I mentioned earlier and it was suggested I do eval instead
17:50hiredmanright, you could just use reflection
17:50gfredericksso I suppose you're saying eval is worse instead of better
17:51hiredmanwell, I dunno, possible whoever it was the suggested it have more information available
17:51hiredmanyou could also consider using clojure.lang.Reflector directly
17:51hiredmanbasically you are using eval as a wrapper for it
17:53gtrakhiredman, I suggested it, I pulled it out of my ass :-)
17:53gfredericksReflector/invokeConstructor I suppose is what I need
17:53gfredericksstill will be doing Class/forName, but oh well
17:53gfredericksthe var trick didn't even work for some reason
17:53hiredmanvar trick?
17:54gfredericks(def ^:dynamic eval-arg)
17:54gfredericksthen (binding [eval-arg ...] (eval '(new Foo eval-arg)))
17:55gtrakgfredericks, i think what you want there is a macro
17:55gfredericksmaybe it has to be fully qualified?
17:55gfredericksgtrak: eh?
17:55gtrakah, that might work
17:56amalloygfredericks: ` is way better than ' here
17:56amalloyif you're going to be eval-ing
17:56gfredericksamalloy: good tip
17:57gfredericksamalloy: wait will that not trip up on the non-existent class?
17:57gfredericksif the class isn't available and my method is never called then nothing should break
17:57amalloywell Foo wouldn't work anyway
17:58amalloybut com.bar.Foo would probably be unaffected by whether you use ' or `
17:59gfredericksah right
17:59gfredericksof course
17:59mebaran151I'm having a little bit of swank trouble; installed the lein swank plugin but clojure-jack-in fails with an invalid unicode escape
17:59mebaran151maybe my emacs is out of date?
18:00mebaran151I just resurrected my Clojure environment for this new project, so the toolkit got a little rusty
18:00gfredericksdang. Creating a jruby array doesn't seem to be as simple as you'd expect
18:02headiusgfredericks: how so?
18:02mebaran151exact error is non-hex digit used for unicode escape
18:02gfredericksheadius: I'm looking at http://www.docjar.com/docs/api/org/jruby/RubyArray.html
18:02gfredericksheadius: can't do anything without acquiring one of them Ruby objects
18:02headiusthat's correct; because we have a lot of runtime state, you need to associate it with some jruby runtime
18:03gfredericksheadius: isn't there only one Ruby though?
18:03headiuscertainly not
18:03headiusthere can be arbitrarily many with their own classes, etc
18:03headiusor just one
18:04hiredmanhow else would you get fast forking on the jvm?
18:04headiushah
18:04gfredericksoh I should have read through the second sentence in the docs there
18:04headiuswell, we can certainly spin up isolated ruby environments :)
18:04mebaran151also when I use slime-connect
18:04mebaran151it fails unexpectedly, without any error, as though it connected, but the slime buffer doesn't pop up
18:04hiredmanclojure, sort of painfully, makes you fiddle with classpaths
18:05gfredericksheadius: so is there a method here for getting the "default"? Do I even know what I'm talking about?
18:05gfredericksah, I see a getDefaultInstance method :)
18:06gfredericksor maybe getCurrentInstance
18:13hiredman~#68
18:13clojurebot68. If we believe in data structures, we must believe in independent (hence simultaneous) processing. For why else would we collect items within a structure? Why do we tolerate languages that give us the one without the other? -- Alan J. Perlis
18:35Raynesdakrone: ping
18:35dakroneRaynes: pong
18:37Raynesdakrone: https://github.com/Raynes/tentacles/blob/master/src/tentacles/repos.clj#L214 is the stuff I was working on that requires multipart (I didn't know it at the time). Just something you can work with to test, if you so desire.
18:38dakroneokay, I'll take a look and see if I can get the multipart uploads working
18:45Raynesdakrone: In other news, thanks for the awesome work maintaining clj-http. It has been a total breeze to use.
18:46dakroneRaynes: glad to hear it, thanks for the feedback
19:01patchworkwhat repository can I get algo.generic from? it is not on clojars.org
19:01hiredmanclojure.org stuff is all in the sonatype oss repos
19:02patchworkHmm… this one?
19:02hiredmanif it doesn't have a release it is in the snapshot repo, otherwise release
19:02patchwork :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot;}
19:02hiredmanhttps://oss.sonatype.org/content/repositories/snapshots/ is the snapshot repo
19:02patchworkAha
19:04patchworkHmm, lein still fails to find it:
19:04patchwork[INFO] Unable to find resource 'org.clojure:algo.generic:jar:0.1.0-SNAPSHOT' in repository sonatype-oss-snapshots (https://oss.sonatype.org/content/repositories/snapshots/)
19:04hiredmanis that a good version for algo.generic?
19:05patchworkAha, it is at 1.1
19:05patchworkI am trying to use a project that is including it
19:05patchwork*requiring it
19:05patchworkand apparently they have the wrong version in there
19:05patchwork: (
19:07patchworkSo I can just override this in my local project
19:07patchworkand it will figure it out
19:12brehauthow do i get emacs to recompile and reload elisp ?
19:23moogatronicI'm trying to perform an operation on each line of a file with (with-open … (doseq [line]) … but I also need to aggregate counts of things I find inside of each line I have a (reduce f {} col) going on in there. I'm a FN noob and am having trouble reasoning about how to "save" my map from line to line…
19:26alex_baranoskymoogatronic: reductions, maybe?
19:28moogatronicin my mind I need to somehow preserve the map I generate in my reduce and pass it back into the next "iteration" of the doseq, but i don't know how to do that.
19:28moogatronicor if that's what i should really be doing. heh.
19:29bhenrymoogatronic: is the file too big to hold the seq in memory?
19:29hiredmansounds like you want reduce
19:30hiredmanwhy do you have doseq?
19:30moogatronic(with-open [rdr (io/reader in)] (doseq [line (line-seq rdr)] …)
19:31moogatronicwell, i guess i'm not really producing any output this time..
19:31moogatronicmaybe i don't need doseq
19:31hiredmanwhy do you have a doseq?
19:31moogatronicI have some more code in the body that is reducing maps that I create from the values in the Input file's line.
19:32hiredmanwhy do you have a doseq?
19:32moogatronichiredman: my answer is that i"m a noob and I found an example that had doseq and copied it.
19:32moogatronicbecause another part of my program had to produce output from simple text processing as well.
19:32hiredmanunless you know why you are using something, stop using it
19:32moogatronicbhenry: yeah, way too big.
19:33bhenrymoogatronic: (reduce your-fn-here {} (line-seq rdr))
19:33moogatronichiredman: obviously, but I can't magically generate knowledge without trying thigns.
19:33moogatronicand reading, and trying and googling and asking ,etc.
19:34moogatronicbheary: yeah, i think that is probably what i need to do.
19:34hiredmanmoogatronic: yes, but unless you have a theory, you are just flailing around, you aren't learning
19:35moogatronichiredman: I had an incorrect theory based on prior success at another task earlier in the day. that is all.
19:35hiredmanok, so you just didn't want to share your theory?
19:36moogatronichiredman: dude, i'm not sure what your issue is? I pretty much described to the best of my ability what I was trying to do… Anyway, bhenry has assisted, no more discussion from you necessary.
19:37hiredmanI mean, I asked, and I think the closest thing to a "I am using doseq because" was "y answer is that i"m a noob and I found an example that had doseq and copied it."
19:38moogatronicThe expanded version is I used doseq to iterate over some lines to produce some sideeffects in code earlier, was adapting this code, and am a noob and don't fully understand every aspect of clojure AND/OR functional programming as I hail from imperative roots.
19:38hiredmanso you were looking for an imperative for loop?
19:39moogatroniczomg.
19:40hiredmanhow am I trolling?
19:41hiredman~fire
19:41clojurebotfire is “Give a man fire and he's warm for a day; set a man on fire and he's warm for the rest of his life”
19:41bhenrymaybe if you answer the questions and receive the responses openly you will learn what is necessary to know which tool to use next time.
19:41hiredmanyou have a specific problem, which is a sympton of a general lack of understanding
19:42hiredmanin this case it seems like you were looking for a for loop
19:42hiredmanwhich in clojure you almost never want
19:42hiredmanyou want sequence processing, map/reduce/filter
19:43hiredmanso now you know more about clojrue then you did from just "use reduce"
19:43hiredmanwhich was my first response
19:47moogatronichiredman: I think what was happening was "the chicken and the egg problem" -- I'm not articulate enough currently to even undersand how to translate my deficiencies in undestanding.
19:48moogatronicBut thanks for the continued explaination.
19:50devnman, mutlimethods are a blast
19:50devntechnomancy: is the new lein templating stuff getting into lein today?
19:50technomancydevn: yeah, as of ~4 hours ago?
19:51devntechnomancy: cool, looking forward to using them
19:51devntechnomancy: I was imagining something sort of akin to gemsets like in rvm
19:51tolstoyIs there a discussion somewhere for using "hidden" name spaces? my.lib.internal, or something like that?
19:51technomancydevn: that's profiles, which is actually a completely different discussion
19:51devntechnomancy: a skeleton project with a default gemset sort of thing
19:52devntechnomancy: interesting, didn't know that was on the table
19:52technomancydevn: not sure how much of that has made it to documentation beyond channel logs, but it's definitely in the planning stages
19:52technomancyprobably deserves its own wiki page at this point
19:52devntechnomancy: I think a really great combination would be clojars.org/templates or something along those lines
19:53devnan easy way to share templates
19:53technomancydevn: yep, templates are just mvn artifacts
19:53technomancylein plugin install lein-newnew 0.1.0 # <- to use it in lein 1.x
19:53devntechnomancy: sorry I keep bringing this up whenever I talk to you, but what is the status on clojars being dev'able in a local env?
19:54devntechnomancy: should I remove lein-newnew if I'm upgrading?
19:54technomancyupgrading to master?
19:54technomancybasically: you shouldn't upgrade to master right now
19:54devnah, okay -- i was under the impression there was a full release ~4 hours ago
19:54technomancyoh, that was just the merge
19:54devngotcha, nevermind! :)
19:55technomancyno progress on clojars, sorry
19:55devntechnomancy: no need to apologize. is there anything I can do to push it forward? Is a rewrite worth considering?
19:56technomancyyou can hack on it from my "heroku" branch, but it's likely that won't be merged into master, we'll probably just be taking code from that bit by bit over to master
19:57devnthe primary force right now is "pull" from build tools -- would be nice to see clojars.org get some life of its own to push new capabilities back down
19:57technomancyif you want to get hacking, it would be great to investigate the viability of deploying to s3
19:57technomancyactually you should be fine to do that off my heroku branch; the odds of conflict are low
19:58technomancyonce lein settles down a bit I'll try to put together a plan of action for clojars
19:58technomancystep-by-step for getting my new features into master
19:58technomancydevn: would be good to look into github's pledgie integration for prior art
19:58devntechnomancy: sounds good -- ill give it a look this evening
19:58technomancywhich ISTR got disabled
19:58technomancydevn: glad to have help with that, thanks
19:58devnIntl Society for Third-Sector Research?
19:59devnNever heard of 'em. Seriously.
19:59technomancy~istr
19:59clojurebotGabh mo leithscéal?
19:59technomancy~istr is I seem to recall
19:59clojurebotc'est bon!
19:59devnahhh
19:59devnsorry, I'm not up on the hip new lingo.
20:00technomancythat's why we have a bot
20:00devntechnomancy: anyway, I'm going to get back to toying around with a REPL-driven documentation swiss army knife
20:00devnbut clojars is next.
20:00technomancysweet
20:01devncheers
20:02technomancyare there any lisps in existence whose readers allow preservation of comments?
20:12TimMctechnomancy: Hmm. The reader would need to look ahead to know it was done.
20:12technomancyTimMc: already has to; you can't read off a reader unless it's a pushbackreader
20:12TimMcI guess that's needed for some literals.
20:16amalloytechnomancy: so you'd want some kind of modal reader? like, (read-string :with-comments "(foo ;; is awesome\nbar)") => '(foo #<comment is aweomse> bar)?
20:17technomancyyeah, what good is code-as-data if you can't round-trip it through a file?
20:17hiredmanyeah, I don't think metadata is a good a idea, just have comments as an object in the stream of objects
20:17technomancyjust seems like things like marginalia and clojure-refactoring have to do a lot of extra work because the reader is missing this functionality
20:18amalloytechnomancy: you'd want to keep whitespace as well
20:18technomancyamalloy: not as important as comments, but yes, you'd need it if you couldn't agree on a pretty-printer.
20:19amalloytechnomancy: if you're round-tripping source code, you need to keep newlines., i don't trust any pretty-printer to decide where the newlines go in my function calls
20:19technomancywell, that's a personal matter. =)
20:20brehauti think the rules for good lisp style are concrete enough that if there was a tool like this, the pretty printer could achieve that style consistently
20:21brehaut(ie if everyones pretty printing efforts were focused on one project rather than 3)
20:22amalloybrehaut: i welcome emacs's indenter into my heart, but it can't have my newlines
20:22TimMctechnomancy: What brings this up?
20:22technomancyTimMc: just fooling around with marginalia
20:23TimMcAh.
20:23TimMcThat's an interesting point.
20:23brehauttechnomancy: would a round tripping reader need to preserve map and set ordering?
20:23gfrederickskids these days and their newfangled drugs
20:23technomancybrehaut: interesting! probably.
20:24technomancywell, maybe only for array-maps?
20:24gfredericksand metadata tag ordering
20:25gfredericksand reader macro info
20:25brehautgfredericks: yes true. i made a prefix node type in my brush to handle that case
20:26gfredericks(let [s (slurp "source.clj")] (with-meta (read (str "(" s ")")) {:source s}))
20:26gfredericks^ round tripping reader :)
20:27gfredericksoh and reader-eval?
20:27technomancyperhaps we've discovered the reason(s) why no other lisps do this!
20:28gfredericksare there any issues with back-quote?
20:28brehautis this something that should be jumped on while the reader is only moderately complex though ?
20:30gfredericksnumber radices
20:30brehauthuh. the code that ` generates caught me by surprise
20:30gfredericksfloat forms
20:30technomancybrehaut: it does seem to jive with Rich's "knobs to turn down *and* up the dynamicity/richness level" talk.
20:30brehaut,(read-string "`(1 2 ~@(map inc [1 2]))")
20:30clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list 1) (clojure.core/list 2) (map inc [1 2])))
20:31gfredericksbrehaut: ##(read-string "````````a")
20:31lazybotjava.lang.StackOverflowError
20:31hiredmanhttps://github.com/hiredman/syntax-quote *cough* *cough*
20:31brehauttechnomancy: sadly, i havent seen that yet, so i'll take your word for it
20:31gfrederickshiredman: I like the word "smacros"
20:32hiredmanit's fun
20:32gfredericksI would use a library by that name regardless of what it did
20:32technomancymore like smackros, am I right?
20:32brehautgfredericks: i still havent managed to wrap my head around the nested concats stack overflow
20:32TimMcOK, so it would be interesting to have a surface-form reader.
20:33gfredericksbrehaut: in this case I think it's just because the forms generated by nested backquotes grow exponentially, and I suppose the reader ties the stack to the nesting of the forms it generates
20:33amalloytechnomancy: how would you do it, though? comments can't be actual "source code forms" in ordinary programs. if they were, then macros would get passed them, and would have to explicitly ignore them. so if your turned on a special comment-preserving reader, it would be returning objects that aren't "really" code
20:34hiredmanwell, concat eats the stack
20:34TimMc```foo becomes (#<squo> (#<squo> (#<squo> (#<sym> "foo"))))
20:35hiredmanadding layers of lazy seqs without realizing them means you have to call at least N methods on the stack for N layers of lazy seqs to realize a single item in the seq
20:35hiredmanamalloy: actually the compiler could discard them when doing macro expansion
20:36TimMchiredman: I think I understand, but what's an example?
20:36hiredmanbut meh, yeah, sounds like an AnnotatedLispReader
20:36brehauthiredman: ah right. for some reason in my head i had some magic trampolining in the realisation of lazy-seqs. clearly not matching with reality
20:39gfredericks,(for [i (range 1 7)] (count (flatten (read-string (str (apply str (repeat i "`")) "a")))))
20:39clojurebot(2 8 41 221 1202 ...)
20:39brehaut,(count (flatten (read-string "{:a 1 :b {1 2 3 4}}")))
20:39clojurebot0
20:40brehaut,(flatten (read-string "{:a 1 :b {1 2 3 4}}"))
20:40clojurebot()
20:40gfrederickso_o
20:40gfredericksbrehaut: maybe clojure is broken
20:40brehautgfredericks: nah, flatten and maps dont mix
20:40gfredericksoh
20:40brehautamalloy has a treeseq trick for it
20:41hiredmanflatten just means you failed to use ->> and mapcat correctly
20:41brehaut~flatten |just means| you failed to use ->> and mapcat correctly
20:41clojurebotAlles klar
20:41gfredericks~shrimp
20:41clojurebotshrimp must be #=(str "super" "awesome")
20:42fbru02hi all, how do you use proxy ? my understanding is that you have to do : (proxy [ClassToReify] (at-least-one-method-to-override ... ))
20:42amalloybrehaut: well, not much of a trick, since i just copied the source of flatten and then made it behave more like i want
20:42alex_baranoskydoes anyone know of a way to set an environment variable from Clojure?
20:42moogatronichiredman: crap. =) I have lots of flatten in my code too. =)
20:42brehautamalloy: lol :)
20:42fbru02?
20:42hiredmaninfered because shrimp are endofunctors, endofunctors are monads, and monads are #=(str "super" "awesome")
20:42amalloy&(count (remove coll? (tree-seq coll? seq {:a 1 :b {1 2 3 4}})))
20:42lazybot⇒ 7
20:42brehautthe difference between flatten and mapcat is why coffeescript is a dead end ;)
20:43hiredmanso says that guy who that blog post that one time
20:43hiredmanwrote
20:43brehautindeed :P
20:43technomancyalex_baranosky: that would require the JVM not completely failing at unix
20:43brehautand went and pissed off a bunch of coffee script fans apparently
20:43alex_baranoskytechnomancy: I'm working on adding colorization to Midje console output, and thought about using an environment variable for it
20:44gfrederickshiredman: holy crap. It was simpler for me to just misremember that amalloy had set shrimp to #=(str "super" "awesome") directly.
20:44hiredmanI know, inference is sweet
20:44technomancyalex_baranosky: there's a heinous hack you can do with reflection, but it's probably better to think of another way
20:44hiredmanthe problem is all these complicated verbs, adjectives, and adverbs
20:45TimMcfbru02: Looks about right. What are you asking?
20:45hiredmanand part of speech tagging slows everything down too much
20:45alex_baranoskyI could just make people set the envirnoment variable manually if they want to turn colorization *off*
20:46ajsharpso i'm getting an OutOfMemory error from the jvm, but I thought I had written this pretty efficiently (not holding on to head position)
20:46ajsharphttps://gist.github.com/1384628
20:46fbru02TimMc: actually i was asking for advice ... so if i override one method in my proxy then the other methods still call the superclass method ?
20:46ajsharpi'm passing the function a lazy seq of about 50,000 items
20:46brehautajsharp: puppies are injured whenever closing parens get their own line
20:47TimMcfbru02: Yes, it is basically like "extends" in Java.
20:47ajsharpbrehaut: nice, good to know
20:47fbru02TimMc: thanks
20:47fbru02amalloy: was awesome meeting in the conj
20:47ajsharpbrehaut: still trying to figure out all the style rules and idioms
20:47brehaut~style
20:47clojurebotstyle is http://mumble.net/~campbell/scheme/style.txt
20:47TimMcThat's a decent guide.
20:48ajsharpbrehaut: fixed ;)
20:48amalloyajsharp: looks like you're rewriting merge-with
20:49brehautajsharp: ##(update-in {} [:a] (fnil inc 0))
20:49lazybot⇒ {:a 1}
20:49ajsharpamalloy: looks like merge-with actually merges the values in the two maps, no?
20:49TimMcbrehaut: fnil!
20:49amalloy(apply merge-with + (for [obj coll] {(str (year obj) "/" (month obj)) 1}))
20:49brehautajsharp: also, you still have one injured puppy
20:50amalloyfbru02: thanks, nice to meet you as well
20:50ajsharpbrehaut: heh, you're right, fixed again
20:50amalloyoh, and of course this merge-with is actually just frequencies
20:50alex_baranoskytechnomancy: what do you think about simply making people set the environment variable manually if they want to turn colorization *off*
20:51amalloy&(doc frequencies) ; ajsharp
20:51lazybot⇒ ------------------------- clojure.core/frequencies ([coll]) Returns a map from distinct items in coll to the number of times they appear. nil
20:51technomancyalex_baranosky: I did something like that with lein-difftest; worked out fine
20:51brehautajsharp: did that update-in make sense above? (even though amalloy is showing you a generally better approach, that if pattern you used is generalised with update-in)
20:52amalloyRaynes: why is doc so ugly today?
20:52ajsharpbrehaut: i'm trying it now, but i understand what it does
20:52Raynesamalloy: Dunno. It shouldn't be.
20:52ajsharplooks like it's often more concise than reduce
20:52alex_baranoskytechnomancy: its the most straightforward, which I can tweak if need be
20:53Raynes&(doc frequencies)
20:53lazybot⇒ "([coll]); Returns a map from distinct items in coll to the number of times they appear."
20:53brehaut,(frequencies "Hello, world!")
20:53clojurebot{\space 1, \! 1, \d 1, \e 1, \H 1, ...}
20:54ajsharpbrehaut: or would i use the update-in inside the reduce?
20:54bhenry&(doc frequencies) ;with comment???
20:54lazybotbhenry: How could that be wrong?
20:54lazybot⇒ "([coll]); Returns a map from distinct items in coll to the number of times they appear."
20:54brehautajsharp: update-in is just a replacement for that (if (get …) (assoc … (get …)) …) soup you have
20:54ajsharpah ok
20:54brehauterr you were using merge not assoc
20:55ajsharpyea, to continually build the accumulated map
20:56brehautajsharp: update-in lets you update a nested associated structure given a path through the structure (as a sequence of keys) and a function to apply to the value at the end.
20:56brehautajsharp: fnil lets you wrap up a function that doesnt accept a nil argument so that it has a default if a nil is passed
20:57brehaut,(for [f [inc (fnil inc 0)], a [nil 10]] (f a))
20:57clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NullPointerException>
20:57brehauthaha fail
20:57brehaut((fnil inc 0) nil)
20:58brehaut,((fnil inc 0) nil)
20:58clojurebot1
20:58brehaut,(inc nil)
20:58clojurebot#<NullPointerException java.lang.NullPointerException>
20:58technomancy,(into {} (map #(.split % "=") ["one=1" "two=2"]))
20:58clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map$Entry>
20:58amalloyajsharp: https://gist.github.com/1384650 for what it's worth
20:58technomancywhat's going on there?
20:58TimMc&(map (fnil inc 1) [2 nil 0])
20:58lazybot⇒ (3 2 1)
20:58TimMcerm
20:58TimMc&(map (fnil inc 0) [2 nil 0])
20:58lazybot⇒ (3 1 1)
20:58TimMcmuch better
20:59amalloytechnomancy: split returns a String[], which isn't a MapEntry?
20:59technomancyyeah, but it doesn't really require a mapentry
20:59ajsharpbrehaut: wow, fnil is so simple but a really nice tool to have around
21:00TimMc,(into {} [1 2])
21:00clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
21:00TimMc,(into {} [[1 2]])
21:00clojurebot{1 2}
21:00technomancy,(into {} ['(1 2)])
21:00clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>
21:00TimMc,(into {} '[(1 2)])
21:00brehautajsharp: theres lots of great little funs like that in the core lib. juxt is another #clojure favorite
21:00clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>
21:00amalloytechnomancy: no, but it doesn't do what you hope
21:00TimMc$source into
21:00lazybotinto is http://is.gd/7toqQd
21:00technomancyjust seems odd that it's so particular
21:00technomancythe root is trying to conj on a tranisent hashmap
21:01TimMcugh lazybot why 1.2.x?
21:01technomancy*root cause
21:01amalloyif the input to conj is seqable, then it assumes it's a seq of MapEntries
21:01technomancy,(instance? clojure.lang.MapEntry [1 2])
21:01clojurebotfalse
21:01amalloy&(conj {} '([1 2]))
21:01lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
21:02amalloythe exception for vectors is only if they're pairs at the top level
21:02TimMcIrritating.
21:03TimMc,(into {} [[1 2 3]])
21:03clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Vector arg to map conj must be a pair>
21:03TimMcAh, *very* specific.
21:03amalloyeg, if you got a seq of pairs you could conj them all sequentially (as into does), but you can't just conj the whole thing (like you could if they were a seq of MapEntry)
21:03TimMc,(into {} [[1 2] [4 5 6]])
21:03clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Vector arg to map conj must be a pair>
21:04technomancyit just seems odd to make an exception for 2-element vectors and not 2-element lists
21:04amalloytechnomancy: "the root is trying to conj on a tranisent hashmap" - i don't understand this. it's calling conj! on the transient, which works fine if it's passed a correctly-typed arg
21:04technomancyI'm just disputing the narrow definition of "correctly-typed"
21:04amalloyi agree about the silliness of the exception for two-element vectors, but i think it's probably practical
21:05TimMcWould there be anything wrong with accepting anything it can call first and second on?
21:06amalloyTimMc: i think it would break the *other* crazy exception conj makes
21:06TimMcWhat's that?
21:07amalloythat you can conj a seq of MapEntries instead of conjing them each individually
21:07TimMcew
21:07amalloyit would make (conj x (list (MapEntry...) (MapEntry...))) ambiguous - is it a pair of objects, or two entries?
21:07TimMcThis is in PersistentMap or whatever?
21:08amalloyAPersistentMap.cons
21:08TimMcSounds like a pretty bad idea in the first place.
21:08amalloyagreed
21:08TimMcWell, there's always 1.4... :-)
21:08hiredmanAPersistentMap.cons is sloppy with the case analysis
21:09amalloyyeah, rich was really enthusiastic about making sure that every future release has some breaking changes like 1.3
21:09amalloyhiredman: i'm sure you're right, but what in particular are you referring to?
21:09hiredmando people really use conj that much?
21:09brehautamalloy: poes law has just bitten me. i cant tell if you are joking
21:09hiredmanI have seqs of maps, seqs use cons, maps use assoc or merge
21:10amalloyhiredman: i think conj mostly gets used "transitively" by into
21:10amalloybrehaut: hah. well you'll just have to wait till the video comes out
21:11amalloy(no. he said they want to avoid more breaking releases)
21:11hiredmanamalloy: well, you can pass a pair (2 element vector) but not a vector of pairs, but you can pass a seq of pairs
21:11brehautamalloy: thanks :)
21:12hiredmanthe utility of the last for loop there just seems questionable
21:12TimMc(into {} [[1 2] [3 4]])
21:12TimMc,(into {} [[1 2] [3 4]])
21:12clojurebot{1 2, 3 4}
21:12amalloywell, the whole thing is crazy, but it looks vaguely like it was designed to be crazy, so i'm not inclined to call it sloppy
21:12hiredmanutility vs. errors from accepting to large a variety of input arguments
21:12hiredmantoo
21:13TimMc,(into {} [1 2] [3 4])
21:13clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$into>
21:13amalloyTimMc: you're looking for ##(conj {} [[1 2] [3 4]])
21:13lazybot⇒ {[1 2] [3 4]}
21:13TimMcright
21:13amalloyvs ##(conj {} '([1 2] [3 4]))
21:13lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
21:13amalloyer, except those would have to be map entries
21:13hiredmanalso, into only take one thing to into is meh
21:13amalloy(inc hiredman)
21:13lazybot⇒ 7
21:14amalloythat's one that actually impacts me sometimes, unlike the crazy options for conj
21:14bobhopeIf I'm writing a compiler in clojure, if I want to do typechecking, should I learn core.logic, or just implement the checks/unification/etc myself with zippers?
21:15hiredmanthe pain
21:15TimMcamalloy: Are there two distinct inputs to conj that give the same result, just using vectors?
21:16amalloyTimMc: that's trivially true with something like (conj {:a 1} [:b 2]) vs (conj {:b 2} [:a 1])
21:17amalloybut no, if the input map is originally empty, and the argument is a vector, no two vectors would yield the same map
21:18gfrederickswould a clojure->jruby data converter be useful as a public lib? does it already exist somewhere?
21:19hiredmandoes it give you something beyond what you get via java interop?
21:19gfrederickshiredman: calling a clojure function from jruby just gives me a bunch of native-seeming objects
21:19gfredericksif there's an easy way to rubyize them I couldn't figure it out at the console
21:20gfrederickse.g. keywords don't become ruby symbols
21:21gfredericksso the point is that the jruby consumer does not have to do interop
21:21hiredmanoh, I was just thinking, jruby can deal with java.util.Map maps
21:21hiredmanwhich clojure maps are
21:21gfredericksright
21:21gfredericksI'm writing this for ruby-coworkers who do not want to have to think about the jvm
21:22hiredmantheir loss
21:22gfrederickshiredman: indeed. but my question still stands.
21:25headiusin general, utilities for the JRuby side to make Java types feel more like Ruby types would be preferable to anything language or library-specific
21:25headiusi.e. if the lists and maps you get back from clojure don't feel ruby enough, help us make them feel better
21:25headiusit will apply to any lists and maps coming in from java
21:26gfredericksheadius: that's an interesting point
21:26TimMcWow, that's annoying: Occurrences of ".cons" in the Java side of Clojure are really conj operations.
21:26gfredericksheadius: keywords are kind of clojure-specific though
21:27TimMcNot confusing at all!
21:27gfredericksTimMc: you betcha!
21:27headiuswhat exactly are keywords
21:27TimMcheadius: interned thingies
21:27gfredericksheadius: equivalent to ruby symbols
21:27gfredericksso ideally when the rubyist calls the clojure function the clojure keywords become ruby symbols
21:27TimMcheadius: Globally interned no-namespace character sequences.
21:27headiusmmm
21:28headiusif they're backed by interned strings in clojure, it wouldn't be too bad a conversion to do
21:28headiusbut we'd never know going the other way if we should turn something into a clojure symbol or just a string
21:28brehaut(namespace :no.namespace.on/keywords) ; TimMc: really?
21:28gfredericksthe basic use cases for both are the same
21:28headiusRubySymbol just wraps an interned java.lang.String
21:28brehaut,(namespace :no.namespace.on/keywords)
21:28clojurebot"no.namespace.on"
21:29gfredericksheadius: the conversation is confused by the fact that clojure also has "symbols" which are different
21:29headiusI wish other language implementers were more interested in interop...we could come up with a common set of interfaces we all implement for some of these "atoms" of the language
21:30gfredericksthat'd be cool
21:30gfredericksare erlang atoms more like clojure symbols or keywords?
21:30TimMcbrehaut: New in 1.3, right?
21:30brehautnope
21:30TimMchrmph
21:30gfredericksTimMc: ##::whats-this
21:31gfredericksdammit lazybot
21:31gfredericks&::foo-bar
21:31lazybot⇒ :clojure.core/foo-bar
21:31TimMcgfredericks: I thought that was just a convenient shorthand for putting the namespace on.
21:31TimMc*current namespace
21:31gfredericksTimMc: the point is that the keyword then has a namespace
21:31TimMcRight, but it's not as supported as Symbol.
21:31TimMcI just don't remember how.
21:32amalloy"not as supported as"?
21:32brehaut,(symbol "imagination!" "foo")
21:32clojurebotimagination!/foo
21:32gfredericksamalloy: I had no idea what he meant either but assumed it was my fault
21:32TimMcArgh, there was something about them that did not have parity re: namespaces.
21:33brehautTimMc: it appears that keywords are actually interned symbols
21:33brehaut(https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java)
21:33TimMcGonna have to go log-diving now.
21:35TimMcheadius: Anyway, yeah... they can have namespaces. -.-
21:35gfrederickswhich could just map to ruby symbols with slashes, if that happens to come up
21:36brehautheadius: the main difference between symbols and keywords in clojure is that symbols are often used to reference something else (ie, locals and vars), and keywords reference themselves
21:37TimMcI think the conversation that misled me was in the context of (derive) and the use of ::foo.
21:37TimMc,*ns*
21:37clojurebot#<Namespace sandbox>
21:37TimMc&*ns*
21:37lazybot⇒ #<Namespace sandbox17060>
21:38headiuskeywords references themselves...
21:38headiuswhat a useful concept
21:38headius:)
21:38brehautheadius: modulo poor wording on my part ;)
21:38gfredericksbrehaut: I liked it
21:38headiussounds like symbols are probably closer to what we think of ruby symbols as being
21:38headiusthey're generally used for symbolic lookup of variables, methods, etc
21:39gfredericksheadius: I think clojure keywords are much closer to ruby symbols
21:39brehautheadius: keywords in clojure implement the IFn interface and are used as accessor functions on maps and records (just to muddy the waters)
21:39headiusI guess I don't understand either
21:40brehaut,(:foo {:foo 1})
21:40clojurebot1
21:40headiusgeh
21:40gfredericksheadius: half the reason symbols exist is the code/data thing. "Variables" in clojure are represented by symbols from the data perspective
21:40gfredericksclass names are symbols
21:40gfredericksfunction names are symbols
21:40gfredericksetc.
21:40TimMcheadius: Ruby's symbols probably complect named fields and binding.
21:40TimMc:-P
21:41TimMc*named lookup
21:41TimMcScheme languages also just have symbols, I think.
21:41gfredericks(foo bar baz) is a list of three symbols as data, but as code it is calling the foo function with arguments named bar and baz
21:43brehautheadius: i should have said 'evaluate to' instead of 'reference' above. http://clojure.org/data_structures#Data%20Structures-Keywords
21:43headiusin Ruby, it's never really exposed how method names or classes are represented, but they're usually accessed by symbols
21:43headiusso whether they "are" symbols or not isn't relevant
21:43clojurebotsymbols are kind of fun
21:43gfredericksheadius: yeah, I think that's the most clojure-symbol-like use of ruby-symbols
21:43headiussymbols are little more than a unique identifier
21:44devntechnomancy: I fixed clojure-refactoring to work with 1.3 FWIW
21:44gfredericksheadius: unlike ruby-symbols and clojure-keywords, clojure-symbols are not often used with data
21:44gfredericksunless the data is code, of course
21:45headiusmmm yeah...in ruby symbols are often used to reflect named keys in data structures
21:45headius[:foo, [:bar, 1]]
21:45TimMcheadius: Clojure uses keywords for that (idiomatically).
21:45headiussymbols can also be lifted to functions in a way that sounds like keywords
21:46headius:foo.to_proc[1] == 1.foo
21:47gfredericksclojure keywords aren't really used that way, but neither are symbols. I think that usage is kind of specific to instance methods, so doesn't apply much in clojure
21:47gfrederickssymbols name things the same way ruby variables do
21:47amalloygfredericks: disagree, i think it's fairly symmetric
21:48gfredericksamalloy: to clj-kws or clj-syms?
21:49amalloykeywords
21:49gfrederickswhat usage of keywords corresponds to instance-method-reification?
21:49gfredericksthere's even a clojure.core function for that isn't there?
21:50gfredericks $findfn will not help me here :/
21:50amalloygfredericks: getting keys out of a map. in ruby there are (as i understand it) often objects which have a .foo method returning the value of their internal @foo variable
21:50amalloygfredericks: memfn?
21:50gfredericksamalloy: yep that's it
21:51gfredericksamalloy: I can see how you might make an argument out of that, but I don't think the typical use cases overlap much
21:51gfredericksevery such instance I've seen in ruby is calling real methods, not just accessing data
21:52gfredericksI often do (apply concat ...) by .inject(:+), for instance
21:52gfredericksbrehaut: I hesitated before I used it
22:14R4p70rblip.tv always displays totally irrelevant ads on the side when I’m watching Clojure videos.
22:15R4p70rHow-To Cook a Turkey With Kat...
22:31TimMcI get "hot babe photoshoot" stuff.
22:31gfredericksTimMc: well at least that's related to clojure
22:31TimMcindeed
22:31amalloybased on prior internet activity, eh?
22:31TimMcamalloy: haha!
22:31amalloycross-site cookies
22:31TimMcI doubt it.
22:33TimMcamalloy: No, I'm getting the turkey ads now, in both browsers.
22:34RaynesIn both browsers?
22:34RaynesHow many do you use at any given time?
22:35gfredericksI bet he has a meta-browser with tabs for each of his active browsers
22:35gfredericksthat sounds like some kind of fantasy web developer's tool
22:36brehautgfredericks: a fantasy web developers tool removes internet explorer and ffx 3.5 from the world
22:36TimMcRaynes: I have about 5 Firefox profiles, 2 of which I use frequently. The main one has Flash disabled.
22:36RaynesYou're insane.
22:36gfredericksbrehaut: that already exists
22:36RaynesFirst the password stuff and now this.
22:36gfredericksRaynes: what's he do with his passwords?
22:37brehautgfredericks: your world is a better place than mine
22:37TimMcRaynes: I do web dev sometimes, and it's important to test sites *without* all my extensions interfering.
22:37RaynesTimMc: P.S. I accidentally gave amalloy my password last night while demonstrating new tentacles features.
22:37TimMchaha
22:37RaynesIt was fun.
22:37RaynesI was due for a new one anyway.
22:37TimMcgfredericks: I don't hand them out, that's what. :-P
22:37gfredericks(str "hunter" (swap! pw-int inc))
22:39TimMcRaynes: Actually, a big part of the pain is that my passwords are mostly random ASCII, so it's annoying to retrieve them from Firefox's password manager. I either have to use Firebug to nab one from a login page (which may require logout) or I can do a "search" in the password box and type in the password incrementally until I can copy it.
22:39TimMcA different password manager might help.
22:39RaynesI don't do password managers.
22:40TimMcamalloy is your password manager amirite
22:40brehautmy password manager is M-x butterfly
22:54amalloybrehaut: my password is M-x butterfly
23:08aamarHuh, M-x butterfly actually does something.
23:08brehauthttp://xkcd.com/378/
23:16amalloy$learn some-key some-value
23:16lazybotMy memory is more powerful than M-x butterfly. I won't forget it.
23:17brehautamalloy: ??
23:17lazybotbrehaut: Uh, no. Why would you even ask?
23:17amalloyjust pointing out some more butterflies
23:17brehautoh right
23:17dhmAnyone used an html parser in clojure? Worth using one of the clojure native libs over a java one?
23:18brehautdhm: if you use enlive, its built ontop of the java tagsoup library
23:18dhmbrehaut: thanks, does it parse html or just do transformations?
23:19tmciverI hope M-x butterfly doesn't actually flip any bits . . .
23:19brehautdhm: both
23:19dhmbrehaut: ah, totally sweet. thanks again.
23:21devnis there already some facility for doing a bunch of (derive ::foo ::bar)?
23:22devnlike passing a map to (build-hierarchy {::foo ::bar ::bar ::baz})
23:26spoon16technomancy: I'm getting an error in 1.6.2 on lein deps if I have a repositories entry for centeral
23:26spoon16I'm trying to override with my own proxy server
23:26spoon16something change, or should I file an issue and debug?
23:32amalloydevn: uh, i think that facility is doseq
23:32devnamalloy: sure, already did that, just curious if there was some contrib library or somesuch I didn't know about