#clojure logs

2013-03-13

00:21binskihow can I un-nest this this s-expression? https://www.refheap.com/paste/12480
00:21akhudekwith ->
00:22binskiakhudek: yea, trying to but failing.. can you show?
00:22jeremyheilerarrdem, Would Clojure's for macro work for you?
00:23akhudekhttps://www.refheap.com/paste/12481
00:23jeremyheiler,(-> "foo-bar" (clojure.string/replace "bar" "baz") (clojure.string/replace "foo" "goo"))
00:23clojurebot"goo-baz"
00:24binskiahh.. thank you
00:25jeremyheilerbinski, Think of it as a lest of expressions, where the return value of an expression becomes the first argument to the next.
00:25jeremyheilerlist*
00:26binskijeremyheiler: oh ok, thats quite clear now
00:28arrdemjeremyheiler: gah I remembered loop but forgot that we had for. thanks.
00:28jeremyheilerarrdem, np
00:29jeremyheilerbinski, good :-)
00:49technomancyarrdem: there's an implementation in old contrib, but please don't use it =(
00:49technomancyTheBusby: you could use unquote in defproject to conditionally include it
00:56TheBusbytechnomancy: excellent, thank you!!!
00:56TheBusbyI suspect many other's may soon run into this same issue :(
00:56technomancyTheBusby: be aware that if you create an uberjar using java 1.7 it won't work on 1.6
00:57technomancydoes it blow up if you try to include it on 1.7?
00:58TheBusbyno, should I just include it for all then?
00:58technomancyI think so, yeah
00:59TheBusbydoes that mean anything using Clojure 1.5.1 should also includes jsr166?
01:00technomancyno, lots of projects don't need it
01:00TheBusbyahh okay, I wasn't sure
01:02amalloydoes the compile-if clause in clojure.core.reducers work now? it seems like it's still a totally broken approach, to me - they do conditional compilation of jsr-166 or java7 so that it can work in either context, but then they AOT the jar so that macro only gets run on their build servers
01:06TheBusbyamalloy: I thought they disabled AOT for reducers.clj a couple versions back (I'm not sure though)
01:08amalloydid they? that would solve the problem, all right
01:08amalloyalthough then i'd be worried about the (set! *warn-on-reflection* true) at the top of the file
01:09TheBusbyI'm pretty sure that they fixed it at some point in beta, but in alpha I would have to build my own
01:09TheBusbyamalloy: details -> http://dev.clojure.org/jira/browse/CLJ-1066
01:30arrdemtechnomancy: no worries about that... I was looking at porting my CL-idiomatic parser combinator instead of using fnparse again but opted to just fnparse again.
01:30arrdemthe CL side-effect-full itteration thang just doesn't slide in clojure
01:34brehauti wish we had a better option than fnparse
01:34brehautthere was a cottage industry in parser combinator libs for a while, and then tumbleweeds
01:36jeremyheilerbrehaut, I don't know much about fnparse, but what don't you like about it?
01:36arrdemfnparse does a a pretty good job..
01:36arrdemno complaints so far
01:36arrdemjust that we need a maintainer who isn't jchoi
01:36brehautjeremyheiler: its pretty dead. theres a couple of people whove forked it to work with 1.3+
01:37jeremyheilerAh, so it's just dusty.
01:37brehautbut thats about all the support it has had in years
01:37arrdem[factual/fnparse "2.3.0"] is 1.4.0... using it now
01:37brehauthuh well thats good
01:37arrdemdusty sure but it's off of contrib.monads
01:37arrdemso anything else is just lack of new dev
01:38brehautarrdem: old contrib monads, or algo.monads?
01:38arrdembrehaut: it uses algo.monads now, from contrib monads originally
01:38brehautright
01:38arrdemfactual ported it, and for that I owe him karma
01:38brehautthem
01:38brehautfactual is a company i believe
01:38jeremyheilerit is
01:39brehautarrdem: i could have been ported to protocol monads was the other thing
01:39arrdemany ideas for a simple html page I could point my new html -> compojure tool at?
01:39arrdembrehaut: oh ok
01:40arrdemoh bugger this tool doesn't support comments or javascript...
01:40brehautjeremyheiler, arrdem: there are a couple of weird cases where fnparse implements some ops as macros rather than functions which makes them a little awkward to compose. i suspect some of it is to work around problems with state monads in non-tail call optimized languages
01:41brehautarrdem: they are actually kinda simple. state monad in particular (the basis of fnparse) is a bit complicated.
01:41brehautarrdem: jimduey's clojure.net has some good introductions to monads in general though
01:42brehautarrdem: and i would suggest manually doing the substitutions for a state monad to get how it works. its kinda magically otherwise
01:42jeremyheilerDitto for Jim Duey's blog posts. Lenoardo Borge's four part series was really good, too. http://www.leonardoborges.com/writings/2012/11/30/monads-in-small-bites-part-i-functors/
01:42arrdembrehaut: okay thanks I'll push that onto the reading list
01:43brehaut"Today I join the already bloated group of people who wrote monad tutorials. It’s a bit of a ritual, really." love it
01:43jeremyheilerhaha yeah
01:43brehautmonads: super hard till you grok it, then super easy and you feel like you have an insight that will help everyone else grok them too
01:44brehautand then you read about arrows.
01:44amalloyi liked http://cdsmith.wordpress.com/2012/04/18/why-do-monads-matter/, which came from a rather different angle than macro blogs i'd read previously. rather long, though
01:44jeremyheileramalloy, 404
01:44brehautworks here
01:44jeremyheilerNevermind, sans the comma.
01:44amalloyjeremyheiler: your irc client is including my , in the url
01:44amalloybut i'm sure that i'm just falling for the "the *last* article i read will be the *first* article anyone needs to read" trap
01:45jeremyheilerlol
01:45amalloythe first one will never make sense; you have to take your own spiritual journey
01:45brehauthaha
01:45brehautso true
01:45jeremyheilerThat's so true.
01:46brehautim pretty sure everyone has a different "hey you guys, you just need to understand X" moment
01:46amalloyeven there, i've really just regurgitated the "monads are burritos" meta-tutorial and claimed it as my own
01:47brehautive never actually read the burritos one
01:48amalloybrehaut: it's really just what you said: everyone has their own 'you just need to understand X' moment
01:49brehautoh right
01:50jeremyheilerThe analogies never really worked for me. Ultimately I concluded that I just need to ask myself what exactly the particular monad I was trying to grok wanted to hide or ignore.
01:51brehautjeremyheiler: i find that works for the simpler monads, but the state stuff really spanners it
01:51brehautbecause you also need to consider what constitutes a value and why
01:52brehaut(where state monad uses functions to describe a rube goldberg machine that you eventually kick into life outside the monadic code)
01:56jeremyheilerbrehaut, True, but the value is really no different then thinking about function args and return values anyway. Then the state monad is just about hiding the state when you're using the monadic functions.
01:57brehautand this is why the X is different for everybody ;)
01:57jeremyheilerYep
01:58jeremyheilerIt's definitely interesting
01:59brehautfwiw, my lightbulb moment was understandign the relationship between function application and composition and bind and >=>
02:02brehauthuh, colloquay thinks the kleisli arrow is an emoticon. how odd
02:02jeremyheilerNice
02:03amalloybrehaut: i've seen people use it. IME it signifies "i'm a twit"
02:03brehautamalloy: remarkably apropos then
02:25arrdemaaand +1 to fnparse, html -> compojure translator works a treat the first time
02:32Raynesfnparse isn't maintained anymore, Why did you use it
02:32Raynes?
02:33RaynesOh, I guess Aaron Crow is maintaining it.
02:33RaynesOh, not.
02:33RaynesHe just released a version with a dep update.
02:33RaynesSo yeah, why fnparse?
02:34Rayneshttps://github.com/blancas/kern and https://github.com/protoflex/parse-ez and...
02:34Raynesamalloy: What's that other parser library?
02:35RaynesThe one that I ask you the name of on a monthly basis because I always forget?
02:35amalloythe parsatron
02:35RaynesYes. That.
02:35jeremyheilerparsley?
02:35clojurebotparsley is an incremental parser with docs at http://wiki.github.com/cgrand/parsley/design-notes and at http://cloud.github.com/downloads/cgrand/parsley/parsley.pdf
02:35amalloyor parsley?
02:35RaynesThat one too, but I was thinking of the parsatron.
02:37arrdemRaynes: because fnparse is something I've used before and was the first thing that sprang to mind. I messed with parse-ez once and had trouble with it, never touched kern before.
02:37Raynesarrdem: That's fine. I'm criticizing you anyways. Newb.
02:38amalloyi think given that factual has taken ownership of fnparse, it would be the first thing i'd try
02:38Raynesamalloy: I don't know if I would call this ownership.
02:38RaynesHe literally just released a version with deps that another fork had updated.
02:39amalloyheh
02:39RaynesFactual has no commits.
02:39arrdemRaynes: lol I see what you did there.
02:39amalloywell, i remember zack was saying he was looking into some bugs in it
02:39amalloyzach. i always get that wrong
02:40Raynesarrdem: Are you an old man, sir?
02:40arrdemRaynes: if you call 20 old...
02:40RaynesOh, the 'survived' bit sounded like "I didn't die of old age before I got called a nub"
02:40RaynesIn other news, fantastic. Nice to meet other people in the young as shit club, arrdem.
02:42Oddmanlol Raynes
02:42Oddmanyou sound like an old, grumpy twat
02:43arrdemhaha
02:43RaynesOddman: I'm a young, abrasive twat!
02:43arrdemI aspire to grow up into a crotchety lisp fanatic...
02:43arrdemjust hope I get to do something cool first XP
02:43Apage43I used to aspire to becoming a crotchety academic type
02:44RaynesI think Oddman may be one of the few people left in Clojureland who doesn't know my age.
02:44Apage43but didn't finish any degrees so I have up on it =P
02:44Apage43*gave
02:46OddmanRaynes, probably one of the many who doesn't care, also
02:46Iceland_jacklol
02:47RaynesI also think you may have misinterpreted my fun-making with arrdem as genuine crotchetiness.
02:47arrdemTHE SARCASM. CANNOT INFER WITHOUT FACIAL EXPRESSIONS OR VOICE.
02:47Raynesarrdem is approximately one year older than I.
02:48arrdemRaynes: holy shit dude
02:48RaynesHaha
02:48arrdems/Raynes/Raynes's?/g
02:48jeremyheilerarrdem, Remember all that time you wasted in high school? Well, Raynes didn't waste it :-P
02:49Apage43I spent highschool enamored with Common Lisp
02:49arrdemgod fucking... I was doing so well with homeschooling before that too..
02:49jeremyheilerlol
02:49RaynesThat's the truth behind my github profile is homeschooling.
02:49arrdem(inc Raynes)
02:49lazybot⇒ 24
02:49RaynesAnd the truth behind that sentence is that it was really confusing.
02:50RaynesBut yeah, I was homeschooled k-12 so I had lots of time on my hands.
02:50Apage43picked up Clojure in '08, once I was out of high school and at my first job. Was wildly more practical =P
02:50arrdemRaynes: nice... I was homeschooled K-8 and did 9-12 in public
02:50arrdemstill managed to pick up Python, C++, Java and some Clisp tho.
02:51jeremyheilerRaynes, Nice, I wish I had the opportunity to do that.
02:51arrdemthe shock of meeting other homeschoolers never quite goes away...
02:52Apage43I was a terrible PHP-for-everything guy for a time, once I started learning C to write PHP extensions I took a step back and started playing with a lot more stuff
02:53Raynesarrdem: Where does arrdem call home?
02:53RaynesTexas.
02:53RaynesAustin, Texas.
02:53arrdemyep.
02:53arrdemyou got me...
02:54arrdemwhether or not it was a good idea to leave so many direct links to my real life I have yet to decide.
02:54RaynesYour Github profile has a location.
02:55arrdemas does my blag (I think) and the whois of this irc connection is my office at UT
02:55RaynesI'm also well known for my ability to stalk. I spend most of my days across the room from amalloy but I still google him occasionally.
02:55arrdemhaha
02:55RaynesMan, that poor Oddman guy really thinks I'm a terrible person now.
02:56arrdemoh come on. this is the internet.
02:56Raynes(this is the part where amalloy helpfully notes that Oddman's suspicions are correct)
02:56arrdemamalloy: ping ^
02:56arrdemhad to.
02:57arrdemRaynes: so that puts you at Flatland?
02:58Raynesarrdem: http://geni.com
02:58Raynesflatland is our open source stuff (most of it).
02:58arrdemthat's hillarious
02:59arrdemwould never have expected you two to be comming from a geneology startup
02:59arrdemalthough I suppose Lisp plays well with graphs and geneology is a graph so...
03:00amalloy"coming from" is an odd way to put it
03:01Apage43they conjured you into existence somewhere in their office
03:01Apage43with backstories, even
03:01arrdemlets go with that one.
03:02Apage43Raynes was homeschooled because it was an easier simulation.
03:02RaynesThis is accurate.
03:03arrdemaw all I got was a few decades of making pots when I got uploaded.
03:05arrdemOkay guys 2am and I need to hit the hay Raynes nice to "meet" you, hope to see you at a con one day. amalloy sorry to ping you in at this ungodly hour
03:05Raynesarrdem: Night Mr. Reid. It's only midnight here, so all is well.
03:06RaynesMe too.
03:37muhoobest code comment evar https://github.com/technomancy/syme/blob/master/src/syme/db.clj#L47
03:51ambrosebsHow can I use the ClojureCLR master branch from lein-clr?
05:00talioshow often are you lot ( anyone whose awake ) using protocols in your clojure code?
05:00ambrosebshardly ever.
05:01ambrosebsI always choose multimethods.
05:02talioswe were discussing the use of, and passing around arbitrary maps/lists to everything rather than records, or "types" - I'm still in favour of types over loose structures for larger projects, or ones with multiple programmers/modules/libraries.
05:03talioscoworker seems to want to avoid types as much as possible, imho maybe too much to
05:03taliostho
05:05ambrosebsYou'd rather records?
05:07ambrosebsThe safest I've found (I use this strategy in the core.typed implementation) is to use records backed by core.contracts. And use raw field lookups where possible, so it's a runtime error to look up an incorrect field.
05:07taliosI'm not sure :) One instance was the postal email lib, that takes a map with set keys, like :host :user :pass , but since they're all optional if you pass in a map with :hst by accident, there's zero checking other than no email :)
05:08taliosmmm, I need to look into core.typed, and hadn't heard of core.contracts - time to go read!
05:08ambrosebsHighly recommend core.contracts. See defconstrainedrecord.
05:09ambrosebscore.typed can help you here too.
05:09ambrosebs(in theory, it's still early development)
05:12ambrosebstalios: Also check out fogus/Trammel, it's a predecessor to core.contracts.
05:13talioswilldo
05:13talioscheers
05:14ambrosebstalios: cool
05:14ambrosebs:)
05:15taliosdidn't know you were an aussie :)
05:16acron^show videos!
05:16taliosarbscht just started a clojure group here in town ( hosted at our work ) - if you're ever in Auckland - come visit
05:17taliosacron^ - its http://www.youtube.com/watch?v=wNhK8t3uLJU i'm watching, from 2012 conj
05:18ambrosebstalios: It's true :)
05:18ambrosebstalios: it's why I'm awake right now ;)
05:18taliosi just thought you were a hard core lisper ;p
05:18ambrosebsLOL
05:19ambrosebstalios: I submitted a talk to YOW! Lambda Jam, I might get close to Auckland ;)
05:19taliosnice
05:20ambrosebsthanks for the invitation
05:24cemericktalios: In practice, silly stuff like :hst doesn't really happen.
05:25cemerickOr, it happens as often as a whole range of other typos you can't typecheck, like a 0 where a 1 should be, etc.
05:26taliostrue, in one particular I hit today the argument was a map, that contained a list, that contained a map, and that last map had invalid keys - that silently got ignored, or produced broken results
05:27taliosit just seems that if you've got code that really wants known keys, that are documented in code comments, or on a wiki page, why not encode that in a type. same argument most people have with javascript and js-duck type comments etc
05:29cemerickI think that's putting the cart before the horse. Just because a fn expects a certain set of slots doesn't mean that that describes a type.
05:30taliosnot neccesarilly a type, but a well known/checked structure i guess
05:30ambrosebstalios: This example of a pretty complex heteroengeous map type in core.typed might interest you https://github.com/clojure/core.typed/blob/master/src/test/clojure/clojure/core/typed/test/compiler.clj#L61
05:31ambrosebsSay you had a type that needed at least one of :host :name :phone, you could encode that in a static type.
05:31ambrosebsIf anything, it's very useful to use the syntax to standardise your expectations, even if you don't use the checker.
05:32talios*nod*
05:34taliosHMap looks like that would satisfy my gripe from this morning
05:35clgvtalios: there are libs for checking map structure
05:42talioshazah - and now ambrosebs is talking about HMaps on my screen :)
05:43ambrosebstalios: I think I just skip over them.
05:43ambrosebs*skim
05:43taliosit'll give me an overview :))
05:54taliosmmmm 11pm and I'm feeling like bed already
06:00clgvtalios: oh. where are you from. it's 11 am over here ;)
06:00taliosclgv - Auckland, New Zealand - 11:01PM
06:00clgvtalios: guessed for australia. close miss ;)
06:01taliosthe better nation :)
06:01taliostho Aus gets better tours
06:04taliosgrr - I hate how emacs prelude removes the arrow keys for navigation. for all the good things it gives, it just kills everything in the name of purity and crippled hands
06:31corecodetalios: yea, bad for beginners
06:34maiotalios: (setq prelude-guru nil)
06:34maiohttps://github.com/bbatsov/prelude#no-arrow-navigation-in-editor-buffers
06:41taliosmaio - hrm, that doesn't seem to do anything hitting esc-x then typing that in, emacs is not meant for love
06:43taliosahh - read the page and i'm all good :)
07:39ljosbrehaut, ambrosebs: In core.typed, how do I annotate records? Do I just use the same as for deftype?
07:45ambrosebsljos: not supported yet.
07:45ambrosebsThere's a subtle design issue. A record loses it's type if you dissoc all the base keys
07:46ljosabrosebs: yeah, I can see how that would be problematic.
07:46ljosambrosebs: does a defrecord unify to a HMap per chance?
07:46ambrosebsunify?
07:47cemerickambrosebs: s/all/any, right?
07:47ambrosebscemerick: hmm I forget.
07:47ljosambrosebs: I think I have been doing a bit to much prolog lately. Can I treat a record as a HMap when I give it to a function right now? or would that be a type error?
07:47cemerickyeah, any
07:48ambrosebscemerick: cheers. Doesn't make it any easier though :)
07:48cemerickambrosebs: pay no attention to the peanut gallery :-)
07:49ambrosebsljos: I doubt it works
07:50ljosambrosebs: Ok, I will test and report back. If it doesn't work I can just do something else here I think...
07:50ambrosebsIn theory a record is an intersection of a datatype and a HMap, but I've made no implementation yet.
07:57mpfundsteinis here anyone with lamina experience? i try to use it with aleph and i can't find a way to see if a client closed the connection
08:13ambrosebsljos: find out anything exciting?
08:18ljosambrosebs: First of all I had to fight a little with not being allowed to do a list with Symbols.
08:19ambrosebsreally?
08:20ljosambrosebs: I figured out that it seems like it does not like to be a HMap, but I am trying some things with IPersistentMap now, but I get some strange error that I haven't figured out why yet.
08:20ljosThe thing with the symbols is probably because I don't understand core.typed yet.
08:22ljosambrosebs: what am I doing wrong here: (ann-form '(a b) (List* Symbol Symbol)) ?
08:23ambrosebsList* should be IPersistentList
08:23ambrosebsHmm.
08:23ambrosebsOk that probably should work.
08:23ambrosebsWhat's the error?
08:24ljosit does work if I change it to IPersistentList.
08:24ambrosebsljos: Ah, it's one of *these* errors.
08:24ambrosebsIf you get a multiple methods error, that's a bug.
08:24ljosThat is the one.
08:25ambrosebsLet me know when you find more, they're easy to fix.
08:25ambrosebsI may abandon using a multimethod here anyway.
08:26ljosit seems to happen for any type here that is not of (Value X) when I use List*.
08:27ambrosebsYep, makes sense.
08:29ambrosebsljos: FYI heterogeous List and Seq are half baked and not well tested.
08:29ambrosebshmaps and hvectors are much more solid atm
08:30ambrosebsThere shouldn't be too much issue though.
08:37ambrosebsljos: The List* example should work in master
08:42ljosambrosebs: sweet!
08:54ljosambrosebs: I get this error that I don't understand at all. I was wondering of you could have a look at it. I have put up a minimal version here http://pastebin.com/XWKcLLtx that shows the problem.
08:55ljosI don't understand how I could have the wrong number of arguments to a type I don't use.
08:57ambrosebsljos: Yea, the record type just isn't set up to be used. I think core.typed is trying to go through the record's ancestors and instantiating them, but things don't match up to what is expected.
08:57ambrosebsljos: thanks, that's useful
08:59ljosambrosebs: yeah, I was thinking it was something like that, but would expect it to look for the type in the supers that match the type I have specified for the function.
09:00ambrosebsWhat the error means is core.typed found an ancestors IPersistentCollection, when it should be (IPersistnetCollection x)
09:01ambrosebscore.typed isn't very lenient with that at the moment. It's helped me find a few bugs so I'll keep that behaviour for the early versions.
09:04ljosambrosebs: I managed to force the record into a IPersistantMap now and now it works how it should, though I loose the record type in the process.
09:05ambrosebsljos: hehe really? that's interesting.
09:05ambrosebsI don't know how that worked.
09:06ljos(into {} (R. 1)). I annotated into as (ann clojure.core/into (All [x y] [x y -> x])).
09:08ambrosebsljos: right. That's cheating :)
09:12ljosambrosebs: I know. into is way to lenient, but at least know I can work a bit with records, just that I won't know if the into function will crash everything or not.
09:13ljosor, the data in the record. Everything else is forgotten.
09:13ambrosebsljos: you've given a quite inaccurate type to into :) you could put anything you want as the second argument
09:14ljosI know.
09:14Kototamahi, I have put my JS files in the project/src-js/libs directory and add the :libs ["src-js/lib"] to :compiler option for clojurescript, but cljsbuild does not compiler the source
09:14Kototamawhat I am doing wrong?
09:14michaelr524hello
09:58greg_Hello all. Anybody here have any experience using 'lein deploy' to send jars, automatically, to Bitbucket's download section (of a given project)?
10:01rcggreg_, did you consider pushing to clojars.org?
10:02rcgit's fairly straight forward and lein will automatically fetch your lib for you from there
10:02greg_rcg, thanks, but this is a private project right now. The JARs are for release to a customer.
10:02rcgin case your project is a lib you use in other projects ;)
10:02rcggreg_, right, i see :)
10:05delihiro_Hi all. I'm using compojure to build my website. How should I keep ring server running? So far doing ``lein run&`` and when killing ``kill -9 blabla``...
10:06ljosambrosebs: shouldn't ((Seqable Long) -> (Seqable Long)) be a subtype of ((Seqable
10:07ljos((Seqable x) -> (Seqable x)) ?
10:07hyPiRiondelihiro_: lein uberjar, then java -jar ... & (or even better, set up a supervisor for it)
10:07ambrosebsljos: Yes I think so.
10:07delihiro_hyPiRion: thank you, I'll try that now
10:09ljosambrosebs: my bad, I put [Fn [Long (All [x] (Fn [Seqable...]))]] instead of on the outside of the whole expression. That was what tricked it up.
10:09ljosinstead of All on the outside*
10:10ambrosebsYes ok.
10:11juhuchapaHi guys!
10:13yediy did that clojure all grown up post get so many upvotes
10:22michaelr524because hn ;)
10:24Pupnik-its not grown up until it has TCO!
10:30jtoy_can anyone tell me what is wrong with this: https://www.refheap.com/paste/12491 my code works if I just use map, but if I add a filter, it dies with: java.lang.RuntimeException: java.lang.NullPointerException
10:30jtoy_im just trying to process rows from a file and then filter then so i can do a count
10:32frenchypcan cheshire.core/parse-string return nil?
10:33jtoy_frenchyp: I dont think so, it should raise an exception instead
10:34dakronefrenchyp: if you parse the string "null", yes it can
10:34clgvPupnik-: well, then Java and all JVM languages are not grown up :P
10:35frenchypjtoy_: does it work if you wrap (map ..) with (first (map..)) to realize the lazy seq?
10:35jtoy_frenchyp: I just tried with only: (filter #(= % "m" ) (line-seq rdr)) and I get "(java.io.IOException: Stream closed" instead which makes me think im just doing it wrong
10:36clgvjtoy_: you are using with-open I guess and your lazy-seq leaves the with-open scope unevaluated
10:36frenchypya, I'd guess that's related to line-seq returning a lazy seq
10:37frenchypif you are trying to process the whole file anyway, i'd try to add a doall around the map, or possible around the filter
10:37jtoy_yes, (first (map #(cheshire.core/parse-string %) (line-seq rdr))) works
10:38frenchyp*possibly
10:38clgvjtoy_: the problem is that the with-open statement closes your reader "rdr" before you evaluated your lazy-seq
10:39jtoy_uh, sorry to ask, but i've tried all the different combinations, can one of you guys show me a simpl example that should work with with-open, map, and filter ?
10:40clgvjtoy_: (with-open [rdr (io/reader "myfile.txt")] (doall (filter #(= % "m" ) (line-seq rdr))))
10:41jtoy_clgv: thx, i think i tried that before, but ill try it now
10:42clgvjtoy_: if your file is huge though, you should do the analysis in the with-open scope to benefit from the lazy nature of the line-seq
10:42clgv*the whole analysis
10:43clgvhmm probably a lazy-reader-seq would be great ^^
10:44frenchypjtoy_: example with map https://www.refheap.com/paste/12492
10:44clgvfrenchyp: "please paste the result"? :P
10:45frenchyplol, not that interesting: ("ROOT:X:0:0:ROOT:/ROOT:/BIN/BASH")
10:45jtoy_I jsut got it to work, thx
10:46clgvah right, password hashes are in a different file usually and you compare for equality
10:46frenchypyes, /etc/shadow
10:47jtoy_clgv: your example isnt lazy bc of the doall, is that correct?
10:47frenchypwas my first try actually, but tight reading permissions reminded me of my foolishness
10:48clgvjtoy_: the lazy sequence in both examples (frenchyp's and mine) leaves the scope of the with-open evaluated completely, yes
11:01jtoy_if it leaves the scpoke, does that make with-open useless in that case?
11:02frenchypno
11:02frenchypthe with-open is here to ensure that your file and its reader get closed properly when you are done working with them
11:03frenchypso it is not useless
11:03frenchypthe fact that line-seq is lazy does become useless if you load the whole file, processed or not, into memory
11:03frenchypbut you get that lazyness for free, whether you end up using it or not
11:13ambrosebsJust ported analyzer to CLR https://github.com/clojure/clr.tools.analyzer
11:15clgvambrosebs: how much work was it?
11:15ambrosebsabout 2 hours.
11:16ambrosebsI'd never used CLR before, and have basically zero .net experience.
11:16clgvthen thats probabably pretty fast ;)
11:16clgvoh my spelling module failed^^
11:17ambrosebsI was pleased :) Some pretty nasty error msgs in CLR though.
11:17Pupnik-is clojure on clr much different to jvm clojure?
11:18ambrosebsInternals are identical.
11:19noidiambrosebs, wow, worse than on the JVM? ;)
11:19noidithe erro messages
11:19jtoy_what is the idomatic way to get vales from a clojure.lang.PersistentArrayMap, I see that its not (:key persistentarraymap)
11:19nDuffjtoy_: if the key is a keyword, that is indeed it.
11:19ambrosebsnoidi: well, they're different looking now :)
11:19nDuffjtoy_: otherwise, you need to use get
11:19john2xwould anyone recommend PeepCode's Clojure screencast? https://peepcode.com/products/functional-programming-with-clojure
11:21joegallowait -- isn't it idiomatic to (persistentarraymap "some-string") or whatever
11:23jtoy_idiomwhat do you mean by keyword?
11:23blrmjohn2x: i have only watched about 20 minutes of it so far, but I like it well enough. It is probably pretty dated though, it was made before Clojure 1.0
11:24clgvjtoy_: use (:mykeyword my-map) and (my-map anything)
11:24Pupnik-john2x, updated 2009, it might be pretty badly out of date
11:24joegallo:this :is :a :keyword
11:24blrmjohn2x: however the code used in the video has been updated to work with clojure 1.4.0: https://github.com/technomancy/mire
11:25clgvambrosebs: what is your clojure clr setup concerning IDE/editor?
11:26john2xhmm right.. maybe i'll just wait for lispcast's screencasts. :)
11:26ambrosebsclgv: lein-clr plugin, lein clr repl + rlwrap, and vim for editing.
11:26Pupnik-ambrosebs, does it interop with c# (presumably) as easily as it does with java?
11:26clgvambrosebs: ah ok. there is no good visual studio plugin, yet, is there?
11:27ambrosebsclgv: no idea, I'm in ubuntu :)
11:27clgvambrosebs: ah, so you use clojure on mono^^
11:27ambrosebsPupnik-: I think there's a little extra ceremony from looking at the docs.
11:27ambrosebsclgv: yep, and it seems to work!
11:27clgv:)
11:29ambrosebsdmiller has done an awesome job, it's a pretty complete language.
11:36jimdueyambrosebs: I'm starting to annotate protocol-monads. :) Looks like it's going to be quite the task.
11:37ambrosebsjimduey: really? Interesting, which bits are hard?
11:39jimdueyI don't know yet. :) Working on the first function which takes a list of monadic values. And the mv's can be pretty much any type.
11:40ambrosebsjimduey: cool! :)
11:40ambrosebsI'd love to help if you need it.
11:47jtoy_ah, i see
12:01llasramambrosebs: Is type inference in the roadmap for typed clojure?
12:04jtoy_can someone show em the correct way to create 1 large hash-map when processing a file: https://www.refheap.com/paste/12496 this built the wrong things, its a map of hashes
12:06ambrosebsllasram: nope. I'm working on squeezing a little more local type inference though.
12:06ambrosebsllasram: I'll be happy once we only need to annotate vars and rarely have to touch actual code with annotations.
12:07ambrosebsllasram: I don't think you could design a satisfying type system for Clojure with inference.
12:08llasramambrosebs: Ok. I was wondering if it would just be too difficult/infeasible to get useful results. Oh well
12:08faust45can any one suggest up to date clojure wrap around lucene ?
12:08technomancyfaust45: clojars uses clucy, but it's pretty minimal
12:09ambrosebsllasram: you'd probably end up with something like soft typing or Dialyzer, where you would be lenient about type errors. And that's fine, but that's not what I'm going for with core.typed.
12:09llasramambrosebs: I'm interested in the idea of using typed clojure to figure out types for serialization, but needing to specify the types so proximately makes it less attractive vs just specifying the serialization
12:09faust45technomancy: thanks
12:09llasramambrosebs: Although I suppose you would then have greater confidence that you could serialize correctly
12:10llasramambrosebs: Gotcha. Thanks for the info
12:11ambrosebsllasram: core.typed offers very precise types, so there would probably be some utility documenting the code.
12:35tgoossensany ideas for a good website name for a belgian clojure user group?
12:35tgoossenssuggestions : belgiumclj.org (naar http://amsclj.nl/) , be.clojuregroup.org , clojureusers.be clojuregroup.be clojurians.be cljug.be
12:37bbloomgrumble grumble namespaces again
12:37dnolencore.logic 0.8.0-rc3 going out, probably the last one, hopefully more incremental updates after this.
12:38bbloomi want people to be able to import and single namespace with a single alias, but i redefine *a lot* of core names, so I basically do [:refer-clojure :only ()] so it's MEGA ANNOYING to write non-trivial functions in this namespace
12:38bbloombut those non-trivial functions rely on stuff defined in that namespace
12:39technomancybbloom: (:require [clojure.core :as cc])?
12:40bbloomtechnomancy: yeah, that's what i'm doing, but the issue is that there is a big disagreement between the API i want to provide and the 'ns macros that I need to not pull my hair out during development
12:42jonasendnolen: no LOGIC-118 for rc3?
12:45dnolenjonasen: doubtful, waited long enough. But don't worry I'm sure 0.8.1 will be hot on the trail of 0.8.0 - there are issues of the same importance as 118 that also need to be addressed.
12:46jonasendnolen: that's ok
12:46jonasendnolen: Do you want tests for patches also?
12:46dnolenjonasen: yes, that's preferred
12:46jonasendnolen: I'll add some then
12:47dnolenjonasen: thanks!
12:49jonasendnolen: when I updated kibit to 0.8.0-rc2 I got two bug reports which I think is related to core.logic. One is LOGIC-118 and the other one I have not yet reproduced: https://github.com/jonase/kibit/issues/78
12:51dnolenjonasen: hmm, sounds like they have a really deep structure or a circular reference.
12:55juhu_chapaWhat is a closure in clojure?
12:56nDuffjuhu_chapa: When you generate a function that refers to names it inherits from surrounding scope, it "closes over" them.
12:56clgvjuhu_chapa: something like that (let [x 2] (fn [y] (+ x y))
12:57clgv+)
12:57nDuffjuhu_chapa: In the example clgv just gave, the fn closes over x
12:57nDuffjuhu_chapa: see also http://en.wikipedia.org/wiki/Closure_(computer_science)
12:59juhu_chapaThank you guys!
13:03skoodgeis there any way to get the arguments to a macro in syntax-quoted form instead of simply quoted?
13:05bbloomskoodge: unfortunately, it's somewhat non-trivial to resolve a symbol the same way syntax quote does, there is no standard function for it
13:06bbloomskoodge: you can use the resolve-symbol function from backtick: https://github.com/brandonbloom/backtick/blob/master/src/backtick.clj#L85-L99
13:06bbloomskoodge: or just look at what it does and decide which code paths you care about and copy paste inline
13:08skoodgebbloom: ok, I guess I'll use it inline then
13:08skoodgenot very pretty, but seems like the best solution :-/
13:09clgvskoodge: a shortcut is using `resolve` and using the fields ".ns" und ".sym" - but you will need to check if it still works when a new release of clojure is released
13:09bbloomskoodge: yeah, there's a lot of stuff going on in there: dealing with special forms, constructors, type names, method calls, constructor invocations, namespace resolution, etc
13:12clgvskoodge: in terms of the backtick source `resolve` + `var-symbol` gets you a resolve symbol for normal clojure symbols
13:12grebusanyone had luck with clj-iterate in clojurescript?
13:12Pure_Loulouhello :))
13:13Pure_Louloumy code has a bug,but i cant find the line of the bug in the stack frama
13:14Pure_Loulouit shows me code only from java, or from clojure.core
13:15Pure_Loulouis there a way to automatically track the line of my code that produces the exception?
13:15nDuffPure_Loulou: Short answer? No. Long answer? We'd need more details.
13:15nDuffPure_Loulou: Are you getting your exception from (clojure.stacktrace/e), from (clojure.stacktrace/print-exception), or somewhere else?
13:15nDuffPure_Loulou: ...is this evaluating a lazy sequence? Using concurrency primitives? etc etc.
13:15Pure_LoulouIllegalArgumentException Don't know how to create ISeq from: clojure.lang.Keyword
13:15Pure_Loulou clojure.lang.RT.seqFrom (RT.java:494)
13:15Pure_Loulou clojure.lang.RT.seq (RT.java:475)
13:15Pure_Loulou clojure.core/seq (core.clj:133)
13:15Pure_Loulou clojure.core/map/fn--4087 (core.clj:2426)
13:15Pure_Loulou clojure.lang.LazySeq.sval (LazySeq.java:42)
13:15nDuffPure_Loulou: ...is this Java 8?
13:15Pure_Loulou clojure.lang.LazySeq.seq (LazySeq.java:60)
13:15Pure_Loulou clojure.lang.RT.seq (RT.java:473)
13:15Pure_Loulou clojure.lang.RT.countFrom (RT.java:526)
13:15Pure_Loulou clojure.lang.RT.count (RT.java:519)
13:16Pure_Loulounothing from my code....
13:16nDuffPure_Loulou: the point is that we need to know the actual _code_.
13:16nDuffOh -- it _is_ a lazy sequence.
13:16nDuff...well, not quite.
13:16nDuffTrying to use a keyword as a sequence is a pretty clear error. :)
13:17clgvPure_Loulou: you provided a keyword where a sequence was expected in a map statement
13:17Pure_Loulouyes but where i did that...
13:17Pure_Louloui dont know......
13:17nDuffPure_Loulou: *shrug*. If you give us the code, we'll help you track that down and give you pointers about how we did.
13:17clgvPure_Loulou: please paste additional code at refheap.com
13:17nDuffPure_Loulou: Thing is, I don't know how I do it myself right now -- it's something I _do_, but that I don't understand well enough to explain.
13:18clgvif it does not happen in a macro, you should get a source file and line of your project
13:18ieuretechnomancy, Have you run into this with lein-tar before? https://gist.github.com/ieure/5154240
13:20Pure_Loulouthanx guys i will try a little by my self,but why in clojure you cant get the line of the bug automatically?
13:20Pure_Loulouis this something that can be fixed?
13:20nDuffPure_Loulou: Mostly you _can_.
13:21clgvPure_Loulou: you usually get it if the error does not happen in a macroexpansion
13:21nDuffPure_Loulou: Since you haven't given your code, we haven't been able to explain why that isn't the case in your current usage.
13:21Pure_Louloui dont know where the error occurs to give you code
13:22nDuffPure_Loulou: ...and I presume the context is proprietary or otherwise can't be shared for some other reason?
13:22Pure_Louloui think this is the evil function https://www.refheap.com/paste/12498
13:22Pure_Loulouno i am totally newbie no proprieraty
13:24nDuffPure_Loulou: Have an example of how you invoke/run that?
13:25Pure_Loulou(parse-graph {:a0 {:label :a, true :b1, false :b0}, :b0 {:label :b, true :zfalse, false :zfalse}, :b1 {:label :b, true :ztrue, false :zfalse}, :zfalse {:label false}, :ztrue {:label true}} :a0)
13:25nDuffRuns fine here.
13:26Pure_Loulouyes but the output is probably not normal for some other part of the program,anyway thx guys for trying
13:27nDuffPure_Loulou: Why don't you give us your _entire_ program, in enough context we can reproduce your problem?
13:27nDuffPure_Loulou: ...instead of trying to guess at what function it's hiding in?
13:27clgvPure_Loulou: that is not the function. search for "map"
13:28owengalenjonesdumb question, is there an easy way to see what interfaces (java or clojure) classes implement?
13:28technomancyieure: can't say I have. I haven't used lein tar in years though.
13:28technomancyhiredman: do you guys still use it?
13:28clgvowengalenjones: yes ##(ancestors (class []))
13:28lazybot⇒ #{java.util.List clojure.lang.Indexed clojure.lang.Seqable clojure.lang.ILookup java.util.concurrent.Callable clojure.lang.Counted clojure.lang.IPersistentVector clojure.lang.AFn clojure.lang.IMeta java.io.Serializable clojure.lang.IFn clojure.lang.Reversible j... https://www.refheap.com/paste/12499
13:28ieuretechnomancy, Okay. Just using a Makefile instead.
13:29technomancyieure: geez you didn't have to say that out loud
13:29hiredmantechnomancy: yes?
13:29hiredmanI think
13:29owengalenjonesclgv: thanks!!!
13:29ieuretechnomancy, I love make.
13:29technomancynow you're just messing with me
13:29ieureNo way man.
13:29ieureMake is great.
13:30hiredmanyes, lein tar
13:30ieurelein tar wouldn't have done what I needed anyway.
13:30ieureMoving a thing to lein from mvn.
13:30ieureAnd need to replicate what assembly did.
13:33bbloomanyone know of any attempts at fressian for javascript?
13:34danielglauserhiredman: technomancy: Just used lein tar on one of our projects yesterday
13:42clojure-newHello, i have this in my .lein/profiles.clj {:user {:plugins [[jonase/kibit "0.0.9-SNAPSHOT"]]}}
13:43clojure-newBut lein kibit says "'kibit' is not a task. See 'lein help'."
13:43clojure-newWhat i did wrong?
13:45chronnotechnomancy: I'm preparing for the key signing party, any tips for creating the keys and such?
13:45chronnotechnomancy: Right now I'm reading http://wiki.debian.org/Keysigning, but I'm not quite sure if such a big key (4096) is recommended/needed...
13:48peat... I'm beating my head against a problem that seems like it should have an elegant answer. I'm looking for a way to turn [[:foo "bar"] [:baz "quux"] [:foo "doh"]] into { :foo ["bar" "doh"], :baz ["quux"] }. Any recommendations on where to start looking?
13:48Pure_Louloumy code i tried to example what it does ... https://www.refheap.com/paste/12500
13:49jtoy_can anyone show me how to make this more idiomatic or "beautiful"? https://www.refheap.com/paste/12501 I feel this is pretty crappy code and probably repeated
13:51clgvjtoy_: you do not need `doall` if you feed the lazy-seq into `into` ;)
13:51clojure-newGuys?
13:52Gonzih&(->> [[:foo "bar"] [:baz "quux"] [:foo "doh"]] (group-by first) (map (fn [[k v]] [k (map last v)])))
13:52lazybot⇒ ([:foo ("bar" "doh")] [:baz ("quux")])
13:52jtoy_clgv: ok, i took that out, thx
13:52Gonzihpeat: take a look
13:52clgvjtoy_: and I think you can improve it via `for`
13:53Gonzih&(->> [[:foo "bar"] [:baz "quux"] [:foo "doh"]] (group-by first) (map (fn [[k v]] [k (map last v)])) (into {}))
13:53lazybot⇒ {:foo ("bar" "doh"), :baz ("quux")}
13:53jtoy_the map seems extra to me, but i coudlnt figure out how to create a hash-map iteraviley
13:54peatGonzih: Hah! Thank you!
13:55Gonzih&(->> [[:foo "bar"] [:baz "quux"] [:foo "doh"]] (group-by first) (map (fn [[k v]] [k (vec (map last v))])) (into {}))
13:55lazybot⇒ {:foo ["bar" "doh"], :baz ["quux"]}
13:55Gonzihwith vectors
13:55clgvjtoy_: try that one https://www.refheap.com/paste/12502
13:55Gonzihpeat: no problem :)
13:56technomancychronno: hmm... so actually I didn't get to run a key signing party at the conj due to illness unfortunately
13:56technomancyplanning on doing one at clojurewest but haven't really gotten a chance to think through it much
13:56clojure-newjonasen: Can you help me?
13:56technomancychronno: I don't think the huge key size is necessary, but honestly it can't hurt
13:56Gonzihclojure-new: try lein with-profile user kibit
13:57clojure-newPerforming task 'kibit' with profile(s): 'user'
13:57clojure-new'kibit' is not a task. See 'lein help'.
13:57clojure-newGonzih: ^
13:57jtoy_clgv: what is that :let syntax? I, there is no x here: (for [line (line-seq rdr) :let [[i1 i2] (clojure.string/split (clojure.string/lower-case x ) #"\s+")]]
13:57jtoy_and im not sure how to put the x/% item in bc i dont know that syntax
13:57chronnotechnomancy: ok, then I'll follow the debian docs and will wait to see how it rolls at clojure/west :-)
13:57Gonzihclojure-new: ok, give me one sec
13:58clgvtoy_: I renamed "x" to "line"
13:58chronnotechnomancy: thanks
13:58technomancychronno: do you use emacs?
13:58jtoy_clgv: ah, can you recommend a page that shows how to use :let
13:58technomancyoh, I see you're in #emacs
13:58clgvjtoy_: ##(doc for)
13:58lazybot⇒ "Macro ([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, right... https://www.refheap.com/paste/12503
13:58technomancychronno: the easypg package in emacs makes gpg really easy to work with
13:58technomancyhighly recommend reading up on it
13:59Gonzihclojure-new: Could not find artifact lein-kibit:lein-kibit:jar:0.0.9-SNAPSHOT in clojars
13:59clojure-newGonzih: I've installed it locally.
13:59Gonzihclojure-new: change kibit line to [lein-kibit "0.0.7"]
13:59clojure-newCloned from git and then 'lein install'.
13:59Gonzihclojure-new: it should be then on classpath to work properly i think
13:59Gonzihclojure-new: hm
13:59chronnotechnomancy: Yep, long time emacs fan. I'll check it out.
14:00clgvjtoy_: that's what I meant https://www.refheap.com/paste/12504
14:00jtoy_clgv: thx
14:00Gonzihclojure-new: I have no idea how that supposed to work. 0.0.7 works fine for me, don't know how to run 9-SNAPSHOT
14:00Gonzihclojure-new: sorry :(
14:00clgvjtoy_: play a bit with `for` to understand how it works
14:01ustunozgurhow does one get a sorted by value set with priority-map? Neither (priority-map {:a 3 :b 1 :c 5}) nor (into priority-map {:a 3 :b 1 :c 5}) works.
14:02jtoy_clgv: yes, im still not sure about the difference in map vs for, i know in ruby for is for iterating while map is map
14:02jtoy_so still learning
14:02Gonzihjtoy_: I think for is list comprehension function and map is just map
14:03clgvjtoy_: `for` creates a lazy sequence as well but has a different syntax and is able to do nested loops
14:03chronnotechnomancy: although I was kinda wondering what I needed before arriving at the party. Obviously the key, and maybe some printouts?
14:03clgvjtoy_: e.g. ##(for [i (range 4) j (range 5) :when (< i j)] [i j])
14:03lazybot⇒ ([0 1] [0 2] [0 3] [0 4] [1 2] [1 3] [1 4] [2 3] [2 4] [3 4])
14:04technomancychronno: I'm actually hoping some people can show up with nothing and the people who are more familiar with the tools can help them through things
14:04technomancybut showing up with your key and a little up-front research would be really helpful =)
14:05technomancyif you want to bring cards with your key fingerprint on it that would save a little bit of time but imo it's not really worth worrying about
14:05jtoy_clgv: cool, i see
14:06chronnotechnomancy: Great then I'll create the key and that will be it :-)
14:17jtgi cant believe raynor dies at the end of heart of the swarm
14:19arrdemjtg: GODDAMNIT DON'T RUIN IT FOR ME
14:20technomancyugh wtf
14:21jtgoops, sorry, i was only trying to spoil it for cheezey
14:21arrdemdoes weavjester not idle here?
14:21arrdem*weavejester
14:22technomancyarrdem: he's often here
14:22arrdemtechnomancy: mmkay just surprised he isn't forever logged in like you Raynes and amalloy
14:23technomancythey do things differently in the UK I guess
14:23arrdemsilly brits
14:38technomancyso, anybody tried Syme for pairing yet? https://syme.herokuapp.com
14:40arrdemnope, looks like a good idea if you don't have a share(ed/able) *nix host tho.
14:40technomancyarrdem: yeah, sharing your own machine can get tricky.
14:41technomancyif you don't have problems with port forwarding, the trust issues are problematic; you can't offer your pair sudo access, and you shouldn't give them access to your SSH agent.
14:41bbloomtechnomancy: will lein be updated to default projects to 1.5.1?
14:41technomancybbloom: I think it might be already?
14:41dnolenlynaghk: have you looked at Ejecta at all?
14:42bbloomtechnomancy: i just did `lein upgrade` and then `lein new asdf` and it was 1.4.0
14:42technomancybbloom: I mean on master
14:42bbloomtechnomancy: ah ok
14:43technomancyqwerty users... man.
14:43bbloomtechnomancy: `lein new aeou` just doesn't have the same ring to it
14:44pjstadigtechnomancy: for real
14:44technomancybbloom: I was thinking of http://common-lisp.net/project/asdf/ actually
14:45bbloomheh, i use asdf almost as much as "foo" and "bar"
14:45arrdemtechnomancy: Dvorak man
14:45arrdems/technomancy/bbloom
14:46bbloomarrdem: not worth the trouble
14:49finishingmovewhat IDE can I use for Clojure on Windows?
14:49daydreamtfinishingmove: Eclipse and Intellij both have Clojure plugins
14:50finishingmovedaydreamt thanks
14:50daydreamtfinishingmove many people seem to use emacs and vim though
14:50technomancythere is only one clojure IDE, and lpetit is its prophet?
14:52lynaghkdnolen: no, I haven't heard about this at all. Thanks!
14:52lynaghker, dnolen_.
14:52finishingmovetechnomancy, hm? what do you mean by that
14:53technomancyeh, nothing
14:53dnolen_lynaghk: http://github.com/phoboslab/Ejecta
14:53dnolen_lynaghk: sounds right up your ally, target *native* OpenGL from JS using Canvas API
14:54dnolen_lynaghk: my studio mate who does lots of fancy graphics stuff uses it and was pretty impressed by the perf, 60fps and all that.
14:54nDufffinishingmove: Are you looking for something for learning/experimenting with the language, or real work?
14:54nDufffinishingmove: if the former, I also suggest looking at LightTable
14:54lynaghkdnolen_: most of the work we do leverages CSS pretty heavily, so I dunno how far we'd be able to go with something like this.
14:54arrdemlol@ "real work"
14:54dnolen_lynaghk: gotcha
14:54nDuffarrdem: (?)
14:54finishingmovenDuff: learning / experimenting
14:54finishingmovei'll check it out
14:54technomancyfinishingmove: CCW seems like the most polished IDE by a significant margin
14:55lynaghkdnolen_: it's a cool idea, though if we're going to drop CSS and other browser pieces we might as well take a look at ClojureC =P
14:55technomancynDuff: well, yeah if you want to discuss semantics. =)
14:55rabbit_airstrikebut our friend here is looking for windows IDEs
14:55dnolen_lynaghk: heh, this at least seems promising for supporting remote REPL and all that.
14:56lynaghkdnolen_: could use it to do something goofy like http://www.fourthdimensionapp.com/
14:56rabbit_airstrikemy experiences with emacs on windows have been less than pleasant
14:56technomancynDuff: I was having a rare fit of non-pedantry there; it won't happen again.
14:56dnolen_lynaghk: haha
14:56lynaghkdnolen_: yeah, sure. Though I have never really used the cljs repl---I get by with the plain Clojure REPL just fine
14:56finishingmovetechnomancy, where can i find CCW? (i can't seem to google it)
14:57technomancy~ccw?
14:57clojurebotccw is http://github.com/laurentpetit/ccw
14:58auseris anyone in here using riemann?
14:59nDuffHrm. Anyone know if Manning has a discount for folks buying new editions of books they already own a prior edition of?
15:01finishingmovewow, LightTable looks awesome, I have to say
15:02finishingmovetechnomancy, thanks for the link to CCW, I will definitely consider it
15:03technomancyfinishingmove: it's the only IDE afaik that has Leiningen integration
15:10S11001001nDuff: I don't think so.
15:12supersymyea i love the instarepl :)
15:14erikonDuff: FWIW, just received a half-off offer from Manning for upgrades on JoCv2
15:16nDufferiko: I don't think that offer is specific to upgrades
15:16nDufferiko: ...for that matter, it _includes_ an ebook of v1, so it's clearly aimed at folks who don't already own it.
15:18erikonDuff: True. And apparently is also a MEAP at this point. Thanks for reading it carefully for me :)
15:23finishingmovedoes eclipse provide these rainbow parentheses like http://writequit.org/blog/?p=386 ?
15:24nDufffinishingmove: CCW adds them to Eclipse, yes.
15:24GlenjaminHi guys, is noir actually deprecated? I started learning it then stumbled across a blog post from Raynes =/
15:24nDuffGlenjamin: Yes, but libnoir isn't.
15:25Glenjaminwould be nice if webnoir.com mentioned it :(
15:25Glenjamin.org even
15:25arrdemGlenjamin: I mean it still works fine... I'm pullint 35ms latencies on my Noir backed site
15:25arrdem*pulling
15:26amalloynDuff: i thought its paredit was pretty reasonable
15:26arrdemnDuff: is paredit worth it? I never bothered to master the keybinds so it just got in the way.
15:26Glenjamini'm just getting started with clojure, so i guess i'd be better off with compojure + lib-noir
15:26amalloyarrdem: yes
15:26nDuffarrdem: The emacs one is so, so, _SO_ very worth it.
15:26llasramarrdem: So very worth it
15:26arrdemokay I'll give it another shot one day.
15:26Glenjamini've been trying to find something non-emacs with strict paredit + barf/slurp, but i don't think it exists
15:26amalloyediting lisp without paredit is like editing java without autocomplete
15:26nDuffamackera: A lot of my finger-memory motions require having barf and slurp.
15:27nDufferr, amalloy ^^
15:27llasramarrdem: Learning it may be the best time/code-productivity investment you can make
15:29blrmi like paredit.vim, but it says it isn't a complete implementation of paredit.el, so I assume I'm missing some of the magic
15:30arrdemblrm: I'd suspect so given how much magic I gained going from vimclojure to nrepl
15:32arrdemis there a good way to have README.md files auto-update when I bump project.clj's version number or am I just stuck hand-updating
15:32borkdudethere was a gist or blogpost popular on twitter some times ago that contained comparison between clojure, python, haskell, etc. in the example three things were done in parallel and then combined, in the clojure solution promises were used. who remembers this?
15:33borkdudeIt could be something slightly different, I don't remember it clearly
15:37amackeranDuff: haha
15:38nDuffamackera: ...heh. I suppose that _does_ sound a little odd when taken out of context.
15:42amackerai know this is probably an often-asked question, but I'm looking for some beginner resources for clojure
15:43amackerai've used scheme a bit, and java
15:43bbloomamackera: http://clojure-doc.org/
15:43amackerais it best to hunker down with a book? or is there a web-accessble resource that's recommended?
15:43amackerabbloom: excellent, many thanks!
15:43nDuffamackera: The best resources are typically books.
15:44nDuffamackera: http://www.clojurebook.com/ and "The Joy of Clojure" are the two leaders, IMHO.
15:44frozenlockcemerick: Can I haz more podcasts?
15:44amackeranDuff: thanks!
15:44nDuffamackera: ...do you learn better starting from high-level concepts or concrete examples?
15:45amackeraconcrete examples
15:45nDuffamackera: then you're better off with clojurebook.com
15:45borkdudenobody remember this example?
15:45amackerai have a moderate understanding of lispy concepts from scheme
15:45nDuffamackera: There are a lot of concepts to Clojure you won't have from there
15:45blrmamackera: 4clojure.com and the clojure-koans github repo are good, but they don't teach the concepts very well
15:46nDuffamackera: ...particularly around being a functional language with immutible data types and transactional memory.
15:46nDuffamackera: ...knowing Scheme will help, but it might not help as much as you expect.
15:46amackeraroger that, i expected as much
15:46lynaghkfrozenlock: I think cemerick is bringing his podcast equipment up to Clojure/West and to a mini-conference the following week, so we should be able to get a lot of Clojure-related rants on tape
15:47amackeraand any suggestions for vim + clojure development? some googling indicates that vimclojure is no longer the hotness in this regard
15:47nDuffamackera: Personally, I use vim for everything _but_ Clojure; the tools available for emacs are just that good.
15:47frozenlocklynaghk: Nice! I might 'almost' feel like I'm there :p
15:48amackeranDuff: aw :( it's been years since i touched emacs
15:49blrmamackera: vim-foreplay picked up the torch from vimclojure.
15:49amackeraperfect
15:53amackerathank you!
15:55ivanbarely-audible bootlegs from Clojure/West would be much appreciated
16:01supersymhaha
16:11finishingmovehas anyone worked with LightTable? I was writing something in an instarepl tab
16:12finishingmovehow would i save that in a file now?
16:12bbloomfinishingmove: you summon ibdknox
16:12nDufffinishingmove: "save file as..." works in the instarepl same as anywhere else.
16:13finishingmoveUncaught TypeError: Cannot read property 'offsetLeft' of
16:13finishingmove...AppData/Local/Temp/nw6452_19414/deploy/js/bootstrap.js:20110
16:13nDuffAre you updated to 0.3.8?
16:13finishingmovei just downloaded LightTable 10 mins ago
16:13nDufffinishingmove: Right, and it upgrades itself after you run it.
16:14nDufffinishingmove: The download is 0.3.0
16:14nDufffinishingmove: ...you have to restart it to get to whatever's current.
16:14nDufffinishingmove: go to "Light table version" in the menu, and see what you have.
16:14finishingmoveit says version 0.3.8, binary 0.4.2
16:14nDuffAhh. That's current, then.
16:14nDuff*shrug*. Works for me, so talk to ibdknox.
16:14finishingmovebut i didn't restart it so far
16:14nDuff(or report to the mailing list)
16:15finishingmovei will try to restart it now
16:15nDuffIf it says that, you really do have the new one.
16:15finishingmovebut i don't want to lose what i wrote
16:15nDuff...so restarting shouldn't be necessary.
16:15finishingmoveso how would i save the file ?
16:15finishingmovewhat format?
16:15nDuffHmm? The conventional extension is .clj
16:15finishingmovelike i said, i tried saving the contents of my instarepl as a .clj
16:15finishingmovebut i can't open it
16:15nDuffRight, and if it doesn't work, there's a bug, and you should report it.
16:15finishingmove:\
16:15finishingmovek
16:15nDuffIn the meantime, copy it to the clipboard or something.
16:16nDufffinishingmove: re: bug reporting, https://groups.google.com/forum/?fromgroups#!forum/light-table-discussion
16:16nDufffinishingmove: I've not had much luck with #lighttable on IRC, whereas things mentioned there tend to get fixed quickly.
16:16finishingmoveok thanks
16:16nDufffinishingmove: ...btw, I suspect that said bug is Windows-specific, since I can't repro it here (Linux).
16:17finishingmovecould be
16:17finishingmoveit's actually trying to
16:17finishingmovefile:///
16:19vurmaIs there a way to make a function call not be printed in repl?
16:20nDuffvurma: you mean have the value it returns not be printed?
16:20nDuffvurma: (do (your-call) nil)
16:20nDuffvurma: ...that way the nil is what gets returned.
16:20vurmaEven if i juse java.io.FileReader to read it?
16:20nDuffvurma: might I ask why?
16:20nDuffHuh?
16:20vurmaI tried that ^^
16:21nDuffYou can't have a FileReader read a function call
16:21nDuffso I don't understand the question.
16:21borkdudenobody remembers a comparison example on the web between clojure, haskell, python, java in which three parallel things are calculated and then combined?
16:22nDuff(...now, you could eval something that a FileReader reads, but why you'd be doing that in a REPL and trying to hide the result...)
16:22vurmaIm sure im using the wrong approach here, but what im doing is first (def dataslurp (slurp "my-file.db")), then (def datamap (java.io.FileReader. dataslurp))
16:22vurmafor example
16:22vurmaWell im just messing around with some functions and wanted to work with that in the repl, thats why.
16:23nDuffvurma: Okay, so you're creating two vars.
16:23vurmaWould make little sense otherwise, yes.
16:23vurmaYep
16:23nDuffvurma: ...now, what do you _want_ to do, and how does that differ?
16:24vurmaWhat i would like to do is not to have the contents of my-file.db printed in the repl when i define datamap, as shown above.
16:24vurmaIts kind of a large file.
16:25nDuffvurma: err. It shouldn't be printing that at all. It should be printing something like #'user/datamap
16:25vurmaThats what i was thinking when i wrote it, but apparently not.
16:25nDuffvurma: or, rather, it would if that were a valid constructor for FileReader
16:25nDuffvurma: ...which it isn't.
16:26nDuffvurma: You're seeing the file's contents printed as part of an exception, not as part of output.
16:26vurmaGot it. Yes, that makes sence.
16:26vurmasense*
16:26nDuffit'd just be (FileReader. "my-file.db")
16:26nDuff...if you really needed a FileReader for some reason.
16:28vurmanDuff, i will explore more optimal ways of doing this.
16:28vurmaThanks a lot for the input! :3
16:43frozenlockYArrrr! "IllegalAccessError app-handler does not exist clojure.core/refer (core.clj:3849)"
16:43frozenlockI know it exists, I can see it in the source!!! https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/middleware.clj#L84
16:44RaynesGlenjamin: Dunno if anyone mentioned it, but luminus is a good way to start.
16:44Raynes$google luminusweb
16:44lazybot[Luminus - A Clojure Web Framework] http://www.luminusweb.net/
16:45Raynesarrdem: Morning pardner.
16:45nDuffMmm; shiny.
16:46arrdemRaynes: 'sup?
16:47Raynesarrdem: Apartment hunting. Super fun (not).
16:47arrdemfeh
16:47arrdemI have yet to have the pleasure
16:47arrdemand get one that is
16:53dnolennew miniKanren / core.logic google group http://groups.google.com/forum/?fromgroups=#!forum/minikanren
17:27ubun22how do i restructure a map with namespace qualified keys
17:27ubun22i mean destructure
17:28bbloomubun22: you don't
17:28ubun22its a limitation?
17:28amalloybbloom: what? of course you can
17:28ubun22or a design choice
17:29bbloomamalloy: then i have the same question as ubun22
17:29hiredmanyou just can't use the shortcut destructuring, which is what most people use all the time
17:29amalloy&(let [{the-value :foo/bar} {:foo/bar 123}] the-value)
17:29lazybot⇒ 123
17:29ubun22ok so no :keys shortcut
17:30amalloyyou can destructure maps that have keys of any sort at all
17:30hiredmansame thing if you want to do destructuring in nested maps
17:30bbloomamalloy: ah, interesting. i had no idea that existed
17:30bbloomamalloy: i've never seen it (or recall seeing it) in any other code i've read
17:30hiredman~destructuring
17:30clojurebotdestructuring is http://clojure.org/special_forms#let
17:30amalloybbloom: try macroexpanding a :keys let-clause
17:30amalloywell, i guess that's no good
17:30amalloytry reading hiredman's link :)
17:31hiredmanfuh, looks like the website changed
17:31hiredmanclojurebot: forget destructuring | is | http://clojure.org/special_forms#let
17:31clojurebotI forgot that destructuring is http://clojure.org/special_forms#let
17:31hiredman~destructuring
17:31clojurebotHuh?
17:32hiredmanclojurebot: destructuring is http://clojure.org/special_forms#binding-forms
17:32clojurebotAck. Ack.
17:32hiredman~destructuring
17:32clojurebotdestructuring is http://clojure.org/special_forms#binding-forms
17:32ubun22,(let [{:keys [item/name]} {:item/name :foo}] item/name)
17:32clojurebot#<CompilerException java.lang.RuntimeException: Can't let qualified name: item/name, compiling:(NO_SOURCE_PATH:0:0)>
17:34bbloomamalloy: thanks
17:34hiredman,(let [a-a 1 a_a 2] a-a)
17:34clojurebot1
17:34hiredmanhuh
17:34hiredmanmust be fixed in 1.5
17:35joegallohow nice for 1.5!
17:36amalloyhaha gross
17:36Raynesamalloy: See why we should use 1.5? :p
17:58jeremyheilerhiredman, What were you expecting?
17:58cemericklynaghk: I have podcasting equipment? :-P
18:08keedsclear
18:08auserwrong window keeds
18:09arrdemanyone here using the Mono build of Clojure care to comment on the unility of CLJ sans JVM/Java ecosystem support?
18:10technomancyit works on mono now?
18:11arrdemis the .net port not mono-compat?
18:11technomancylast I heard it required Windows
18:11technomancyI guess that was a long time ago
18:12finishingmovehow would i write the equivalent of return "str1"+"str2"; (javascript example of string concatenation) in a Clojure function?
18:12brehaut,(str "str1" "str2")
18:12arrdem,(str "a" "b")
18:12clojurebot"str1str2"
18:12clojurebot"ab"
18:12arrdemHAH
18:13brehaut\o
18:13finishingmovehah cool thanks :D
18:15finishingmovehm, but that returns the hardcoded values
18:15finishingmoveor not
18:15finishingmoveit's working :)
18:18brehautfwiw, str is smarter than + in JS; it uses a StringBuilder under the hood for concatenation so you dont need to do the build array, array.join trick
18:18ivandidn't Closure Library's StringBuilder revert to doing + without an array and join?
18:19brehautive never looked at clojurescript
18:21dnolenivan: non-higher usage of str actually compiles to Array.join("") in CLJS
18:23arrdemso an IRL buddy of mine and I keep throwing around this idea for a Lisp micro-runtime OS
18:24arrdemwould there be value in giving said lisp Clojure's semantics without JVM or Mono support?
18:24technomancyarrdem: persistent data structures without a world-class GC would be really slow
18:24ivandnolen: heh, interesting
18:25technomancyarrdem: of course, it's better to be slow and correct than fast and wrong
18:25technomancybut building a good runtime is way more difficult than building a language
18:25arrdemyeah...
18:25arrdemno expectations of speed
18:27ivanman Google Code's code browser is terrible, it won't even give you all of the folders in a folder
18:34bbloomivan: google's internal processes are so formalized and streamlined that anyone who would be interested in working on any kind of code management system would rather work on internal tools than on the public google code
18:38ieuretechnomancy, Is there any way to make lein deploy an artifact without signing it?
18:38technomancysure; :sign-releases false
18:38ieureAwesome, thanks.
18:39technomancyneed to make that more obvious probably
18:39ieuretechnomancy, Yeah, it's not in sample.project.clj.
18:40ivanwondering why lein cljsbuild wasn't building anything... named my file .js instead of .cljs :(
18:49ivanbeing the kind of fool who learned about the JVM and -XX:+PrintCompilation after Closure Compiler, the JVM will always be a really neat version of advanced_optimizations for me
18:56borkdudedid someone read this book? http://pragprog.com/book/mbfpp/functional-programming-patterns-in-scala-and-clojure - seems interesting
18:57ivanClojureScript's way of macros and function sharing the same name is really cool
18:57ivanwhich makes ClojureScript macros sort of like Clojure special forms, though no doubt this analogy sucks in some way
18:58borkdudethis seems interesting for my target audience: students who know OO and want to try clojure http://pragprog.com/book/mbfpp/functional-programming-patterns-in-scala-and-clojure
19:02keedsborkdude, there is also: https://leanpub.com/fp-oo
19:03borkdudekeeds I also have that one
19:09ivaninteresting how :optimizations :advanced actually changes what ClojureScript emits
19:15tyler__can i vote for this to be in core? https://github.com/rplevy/swiss-arrows heh
19:16tyler__i need more parallel diamond fishing rod in my life
19:16tyler__heh
19:19rlbIs there a way to get the root tag when using xml->? (i.e. if you have an xml fragment -- doesn't start with <xml></xml>)?
19:20rlbGetting the root attributes is fairly straightforward.
19:21rlbAlso, if you're using xml->, is there a way to stop at a given depth, and say "give me everything below here" as a clojure.xml style map (as you would receive from parse)?
19:22finishingmovedoes anyone know what's the default font LightTable uses? I really like it..
19:24bbloomfinishingmove: try whatthefont.com
19:24finishingmovebbloom, oh cool. didn't know about that
19:27NeedMoreDesuWhat is the way to do let* ?
19:27bbloomfinishingmove: looks like Riccia Light from Hubert Jocham Type Riccia
19:27NeedMoreDesuAh, sorry.
19:27bbloomfinishingmove: http://www.myfonts.com/fonts/hubertjocham/riccia/light/
19:37pandeiroare people doing clojurescript coding in lighttable? is it possible to build dom and things inside the lighttable node/webkit instance itself?
19:42finishingmovebbloom it doesn't look like the Riccia to me, tbh
19:42finishingmovecan't test it since it's a commercial font i don't own
19:42bbloomfinishingmove: *shrug* i'm bad at those font identification games
19:42finishingmoveofc, np
19:43finishingmovethe website itself is kind of bad, at least from a programmer perspective
19:43finishingmovei mean you'd think they'd at least differentiate between monospaced fonts
19:43finishingmovebut they don't have that category at all
19:43finishingmove._.
19:44pandeiroriccia is very beautiful
19:44pandeiro(the aquatic plant i mean)
19:44pandeironever heard of the font
19:44bbloomfinishingmove: it's presumably for designers
19:57squidzIm having a problem using lazy sequences. I am passing a lazy sequence to my compojure handler, but it is still not evaluated. If for example I wanted a string representation of the sequence. Am I doing something wrong?
20:00squidzI tried calling doseq/doall/dorun on it but the lazy sequence still isnt being realized
20:01qbgIs the Datomic support in core.logic documented anywhere?
20:02brehautsquidz: what do you mean you are passing it to your compojure handler?
20:02brehautsquidz: compojure handlers are just ring handlers; they take requests and return responses
20:02brehautsquidz: do you mean you are wantiung the seq to be the :body of the response?
20:03squidzI have something like (GET "/r" [] (generate-page)) in the generate-page function I am passing a lazy sequence to clostache to use
20:04squidzand I dont know how to get the actual values from that lazy sequence
20:04brehautthat sounds more like a clostache problem than compojure
20:04amalloyhiredman: what's the syntax for teaching clojurebot to use <reply> again? i'm afraid if i experiment with it i'll teach him something i can't unteach
20:05brehautkey is <reply>value or phrase
20:05brehaut(at least, thats what i have pinned behind my monitor)
20:05squidzbrehaut: okay, so then is there no way to force evaluation of a lazy seq?
20:06brehautsquidz: of course there are. but it sounds liek something else is gone arwy. i think you'll need to paste up more than that snippet of code to get an answer
20:06squidzokay ill do that
20:08IntensityHi. I'm wondering: apart from using transients, are there any other key ideas for efficiency out there to build a multidimensional hash map from a seq input? For example, suppose I have a list of strings and I want to put each word into a hash indexed by its first letter or first two letters.
20:09squidzbrehaut: okay here are some snippets of what I got https://www.refheap.com/paste/12520
20:09finishingmovebbloom: it was Inconsolata
20:10hiredmanyeah, what brehaut said
20:11brehautsquidz: you arent returning a response
20:12brehautsquidz: https://www.refheap.com/paste/12520#L-21
20:12squidzhow can I return the string representation of transitions-seq
20:12brehautsquidz: https://github.com/ring-clojure/ring/blob/master/SPEC#L93-L120
20:12amalloy~helpme
20:12clojurebotA bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.
20:13brehautsquidz: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/util/response.clj#L36-L42
20:13brehautsquidz: which is to say, instead of (apply str …) you can call (ring.util.response/response …)
20:15squidzbrehaut: the sequence still isnt being printed out
20:16brehautsquidz: either ids is nil or has a length of zero then. you are into the wilds of your own code at this point though
20:16squidzokay ill look into it again
20:16brehautsquidz: test your handlers from the repl. its trivial and makes life much easier
20:17brehautsquidz: once you have sorted out this bug, your next task is to go and learn a) what ring is and b) how compojure relates to ring
20:17squidzi do sometimes but the output is sometimes too much for my emacs and id sometimes rather see the rendered html
20:19squidzAlso, I was passing content of my sequence inside hiccups (html5 [:body ... which was giving ring what it wanted
20:19squidzI guess it is just my own bug of the sequence being emtpy
20:27squidzbrehaut: okay, it seems that my function that was to be called by rings :init option in my project.clj wasnt being called. That function populates an in-memory DB which is why my results were just empty
21:08yediin typical mvc, the controller is the only thing manipulating state righ?
21:13hyPiRionyedi: yes
22:04ubun22how do i retrieve a maximum of 10 records from datomic?
22:11tyler__would the statement "edn is turing complete" be true?
22:11tyler__ubun22: i believe queries are lazy loaded, so (take 100 query) ?
22:11tyler__not positive though
22:12TimMctyler__: No.
22:12xeqihmm, does edn include data readers?
22:12hiredmanyes
22:12tyler__TimMc: to my statement or my question?
22:12TimMctyler__: To your question.
22:23dobladezSo, Google Reader will be shut down July 1st... Is anybody here using https://github.com/shenfeng/rssminer ? (it's Clojure)
22:29tyler__dobladez: a buddy of mine entertained the thought of making a SaaS rss reader in 48 hrs and charging 5 bucks a month
22:32ivanheh heh 48 hours
22:34scottjtyler__: why wouldn't people just use newsblur, a saas rss reader that's been developed for years and costs 1 buck a month (for premium account)
22:34brehautmake a feed syncing service and sell it to everyone rushing to make new reader apps in the wake
22:37finishingmovewhat does this represent
22:37finishingmove :something
22:37finishingmove?
22:37finishingmove(i'm new)
22:37brehautfinishingmove: it represents :something
22:37brehautits a keyword
22:37igorwI'm writing an implementation of edn, is there a test suite that I can run against somewhere?
22:38finishingmoveso what is the difference between :something and something ?
22:38brehautsomething is a symbol
22:38brehautsymbols refer to something else
22:39brehautkeywords always refer to themselves
22:39brehautkeyworlds also happen to implement IFn so they can be used as functions of maps
22:39brehauthttp://clojure.org/data_structures#Data%20Structures-Keywords
22:41xeqiigorw: you might be able to port https://github.com/relevance/edn-ruby/blob/master/spec/edn_spec.rb
22:43bbloombrehaut: symbols implement IFN too
22:43bbloom,('foo '{foo 1})
22:43clojurebot1
22:43brehautbbloom: huh.
22:43igorwxeqi: that suite seems rather poor, my own is already more advanced at this point. that's why I was hoping for something more generic, that I can at least read, write back and compare.
22:44brehautbbloom: how long has tht been the case?
22:44bbloomas long as i've been using clojure...
22:44bbloombrehaut: finishingmove: keywords are guarenteed to be unique, so identical? works & is fast. however, this means that symbols can have meta data, but keywords cannot
22:44brehautits not exactly surprising given keywords are kinda special symbols
22:44tyler__what *is* an IFN? i see it all the time but haven't quite groked it fully yet
22:45tyler__i just assumed it was a function
22:45bbloomtyler__: Fn is for functions, IFn is for things that are callable
22:45brehautIFn is the interface you implement to make a type callable
22:45tyler__ah
22:45bbloom,(map (juxt fn? ifn?) [inc :inc])
22:45clojurebot([true true] [false true])
22:46tyler__so keywords are ifn but not fn
22:46tyler__if i read that right
22:46bbloomtyler__: yes
22:47tyler__what does clojure "do" when you call a symbol?
22:47bbloomtyler__: Fn is just a marker interface (protocol in CLJS), IFn is the real interface that might as well be called ICallable
22:47bbloomtyler__: the same thing it does when you call anything: execute the .invoke method of the IFn interface
22:47tyler__whats the "i" stand for?
22:47bbloomtyler__: Interface (or protocol, lol)
22:48tyler__bbloom: whats in the invoke method of a symbol?
22:48bbloomtyler__: don't be shy: read the source! https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Symbol.java#L126-L132
22:48tyler__omg
22:48tyler__im so scared ;)
22:49brehautthe source for clojure is pretty reasonable (except the whitesmith formating style ;)
22:49bbloomtyler__: clojure's source is quite aprochable, if a bit... um... non-idiomatic java
22:49bbloombrehaut: lol oh yeah, :set nolist
22:49bbloombrehaut: :set nolist sooo hard
22:49tyler__oh wow
22:49brehautbbloom: ?
22:49tyler__that is some clean code
22:50bbloombrehaut: vim-ism for disable showing of whitespace
22:50cgagnote that the .invoke method gets called when you do ('foo <args>) not (foo args)
22:50brehautaha
22:50tyler__i have a feeling its only non-idomatic java because theres not enough clojure people writing java ;)
22:51brehautbbloom: so symbols got invoke in june of 2008, so i have no excuse other than perhaps clojure.org was still out of date in october of 2008
22:51bbloomheh
22:53tyler__not sure what RT is assuming its in java.io.Serializable or java.io.ObjectStreamException, my java-fu is kinda weak
22:53bbloomtyler__: the first thing you need to know about non-IDE based java-fu is that class names match file names
22:53tyler__ah
22:53bbloomtyler__: go to github, press "t" to open the fuzzy finder, and type "rt.java"
22:54brehautRT = Run Time
22:54bbloombrehaut: entertainingly, RT.java does not mention that
22:55brehauthuh
22:55brehautclojure's java code is not exactly overflowing with comments :P
22:55brehaut(except of course commented out code)
22:55bbloomlol
22:56bbloomclojure's code base and popularity has jointly reminded me of the value of GETTING SHIT DONE
22:56brehauthaha
22:56bbloomit's not BAD code
22:56bbloomit's just GOOD ENOUGH code
22:56brehautcertainly
22:57brehautits also surprisingly approachable
22:57cgagwhat keeps it from being good code?
22:57bbloomit's only not really approachable in a few parts that only really exist only in the code generation phase
22:57brehautcgag: http://this-plt-life.tumblr.com/post/44333853864/when-i-look-at-a-pls-implementation
22:58bbloomcgag: i feel like good code at least has consistent whitespace lol
22:58tyler__,('foo ["bar" 'foo])
22:58clojurebotnil
22:58tyler__meh
22:58brehauttyler__: vectors have int keys
22:58bbloomtyler__: ##(1 ["bar" 'foo])
22:58lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
22:58bbloomtyler__: ##(["bar" 'foo] 1)
22:58lazybot⇒ foo
22:58tyler__,('0 ["bar" "foo"])
22:59clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
22:59tyler__ah '0 isn't a symbol
22:59tyler__is that a correct statement?
22:59brehautcorrect
22:59bbloom,(symbol? 0)
22:59clojurebotfalse
23:00bbloom,(= 'foo ''foo)
23:00clojurebotfalse
23:00brehauttyler__: its a quoted long
23:00bbloom,(= '0 ''0)
23:00clojurebotfalse
23:00bbloom,(= 0 '0)
23:00clojurebottrue
23:00bbloomtyler__: it's subtle :-) see ^
23:00tyler__i still haven't really grokked what the difference is between quoted things and unquoted things
23:00tyler__or double quoted things heh
23:00tyler__don't even think ive seen that before
23:01jeremyheiler,'0
23:01clojurebot0
23:01jeremyheiler,''0
23:01clojurebot(quote 0)
23:01jeremyheilerheh
23:01bbloom,'''''''''''''''0
23:01clojurebot(quote (quote (quote (quote (quote (quote (quote (quote (quote (quote #))))))))))
23:01jeremyheilerahhh
23:01bbloom,'''''0
23:01clojurebot(quote (quote (quote (quote 0))))
23:01brehauttyler__: quoted things are only really useful for lists and symbols (or other collectiosn containing lists or symbols)
23:01brehauttyler__: when you want the list or the symbol itself rather than the value of the expression the list represents or the thing the symbol refers to
23:02bbloomtyler__: in the lisps of yore, quoted things were symbols or trees made out of lists and symbols
23:02tyler__i thought they were used to escape stuff
23:02tyler__like in datomics query syntax
23:02bbloomtyler__: now they are symbols or numbers or strings or integers or some other primtives.... or trees of those plus composites like lists, vectors, maps, etc
23:02tyler__'[:find ?foo :where [?e :bar ?foo]]
23:02bbloomtyler__: quoting basically says "disable evaluation, treat the following as data"
23:02tyler__like a macro?
23:02bbloomno
23:02tyler__or bad analogy?
23:02tyler__ok
23:03brehauttyler__: so datomic wants the symbols ?foo and ?e rahter than the value they may point refer to
23:03bbloomtyler__: well maybe....
23:03bbloomtyler__: macros are functions that quote their arguments
23:03bbloomtyler__: and also return quoted values that expand as if unquoted
23:04tyler__so macros use quotes *because* of their ability to disable evalution and treat as data?
23:04danneutyler__: (1 2) will give you error "cannot cast 1 to function" because clojure is trying to expand 1 as though it's a symbol. so '(1 2) is saying not to evaluate it. you're 'escaping it' from evaluation.
23:05tyler__danneu: thnx
23:06cgagi've been to chicago, i know how to spell "chicago"
23:07yunfanhi,guys, i want you to recomment a rss parser for me, since GR would be shutdown sonner and i am a heavy user of them, i need to make my own
23:07tyler__so does `[]` cause evalution? still haven't grokked what gets evaluted yet
23:07tyler__yunfan: blurnews
23:07bbloomtyler__: everything is evaluated except forms marked by ' and `
23:07tyler__newsblur rather
23:07yunfantyler__: what is blurnews ? an alternative service?
23:07tyler__damn dyslexia
23:08bbloomtyler__: you can think of [1 2 3] as (vector 1 2 3)
23:08tyler__yunfan: yeah its kinda slammed right now though because everyone is going there since google reader is closing
23:08tyler__bbloom: aaaaaaaaah lightbulb
23:09yunfantyler__: is it just yet another GR or it has some enhancement?
23:09danneu,(= [] (vector))
23:09clojurebottrue
23:09tyler__yunfan: not really sure i don't really use it, its just what everyone is talking about
23:10yunfantyler__: ok ,i will have a try, but GR really make me a lesson, i need to roll my own
23:11yunfanback to my question, didnt there a rss parser for cloujure?
23:11tyler__https://github.com/scsibug/feedparser-clj
23:11cgagmaybe rssminer?
23:11tyler__not sure if thats good
23:11tyler__first result googling rss clojure
23:11tyler__heh
23:12danneuclojure is making it hard to focus at my ruby dayjob
23:13tyler__i personally like a vanilla xml parser but thats just me
23:13yunfanwell i need really efficient one, i have built a rss spider for my ex-company using python, the library is toooo slow
23:13tyler__danneu: i started a movement to convert our ruby code to clojure ;)
23:13ToxicFrogI'm starting to get my feet wet with Android + Clojure, hoping I can come up with a fun Clojure project for my 20% time.
23:13tyler__ToxicFrog: ive been thinking about attempting that
23:13ToxicFrogBased on my experimentation, though, I'm not sure Android meets the "fun" requirement~
23:13yunfandanneu: me too, when i wrote my python code, i just think if could be written shortly in cloujure
23:14ToxicFrogIn any case, though, I'll be writing up the results once I actually get stuff running.
23:14tyler__ToxicFrog: i would read it
23:14tyler__:)
23:14ToxicFrogI'll post it in here when it's done, then!
23:14danneuyunfan: yeah, 'unnecessary complexity' describes a lot of the codebases i work in.
23:15tyler__OO has a way of turns things to shite. not sure if jaded or just truth
23:16tyler__turning*
23:16arrdemI mean... OO can be done right
23:16danneui don't think it's OO
23:16arrdemit just doesn't largely lead to code reuse
23:16tyler__"can be" heh
23:16arrdemwhich was its main goal
23:16tyler__ironic
23:16arrdemI mean you can model yourself into a corner happily
23:17arrdemthen realize your data is too fragmented to do anything
23:17arrdemthe trick is devising the data model that suits your problem, which may involve an object hierarchy
23:18danneunah, i'm reading
23:18tyler__arrdem: devising the data model *is* really the tricky part
23:18arrdemokay so tell me I'm wrong or something...
23:18arrdemtyler__: ^^ that.
23:19arrdemwhich is why I like Clojure's "map" pseudotypes
23:19danneui think OO is hard. OO design is not trivial. what objects should i make? what should i put in them? it's too easy to get stuck designing something that should just be an array of hashmaps. i like clojure because it forces immutability and simplicity.
23:19arrdemand MongoDB
23:19tyler__even in clojure with datomic you still have to figure out how to model your data so it all fits together
23:20tyler__although its easier
23:20yunfani like py's list comprehension, and i like to use the sideeffect of it, but the community avoid this
23:20brehauttheres no silver bullet, news at 11
23:20tyler__lol
23:20arrdemso you (ab)use mongo until the dust settles, and then transition.
23:20arrdembrehaut: lemme dig that essay back out..
23:21arrdembrehaut: SO IT IS WRITTEN https://en.wikipedia.org/wiki/No_Silver_Bullet
23:21tyler__danneu: "it's too easy to get stuck designing something that should just be an array of hashmaps" man i so feel you there. especially with coworkers who want to create classes for *everything*
23:22arrdem~bullet
23:22clojurebotmagic bullet is http://www.infomercialcentral.com/store/files/images/d_77.jpg
23:22arrdemwut
23:22brehaut~botsnack
23:22clojurebotthanks; that was delicious. (nom nom nom)
23:22tyler__https://en.wikipedia.org/wiki/No_Silver_Bullet was written before the creation of clojure
23:23tyler__he didn't know any better
23:23tyler__;)
23:23arrdemhaha I think he's still right...
23:23tyler__"Brooks makes a distinction between accidental complexity and essential complexity,"
23:23arrdemClojure solves a lot of issues but doesn't fix the fundimental one that humans suck at software engineering
23:23tyler__i think rich addresses that in "simple made easy"
23:24arrdemtyler__: lunk?
23:24tyler__http://www.infoq.com/presentations/Simple-Made-Easy
23:25bbloomarrdem: we suck at more than just software engineering: we suck at both generalization AND specialization :-)
23:25tyler__lol
23:26arrdemhaha
23:26arrdem(inc bbloom )
23:26lazybot⇒ 1
23:26arrdemwat
23:26bbloomarrdem: apparently string/trim error, try again :-P
23:26arrdem,(doseq [x (range 3)] (println "(inc bbloom)"))
23:26clojurebot(inc bbloom)\n(inc bbloom)\n(inc bbloom)\n
23:27arrdemdamnit
23:27arrdemalways wanted to try that one
23:27arrdem(inc bbloom)
23:27lazybot⇒ 7
23:27arrdemthat's retarded
23:27bbloomhurray! still prime!
23:27arrdemsomeone fix the lazy as shit bot
23:27brehautarrdem: patches are accepted
23:27yunfan62;9;cnewsblur seems down when i friends checking it
23:28arrdembrehaut: I didn't say I would...
23:28arrdemXP
23:28yunfanhuge user are comming i think
23:28bbloomyunfan: Google's "not enough interest/traction to justify" is a startups "OMG THE SERVERS ARE ON FIRE"
23:29danneuarrdem: re "humans sucks at software engineering" <-- which is why i think it's smart to reduce the paths for making code unreadable to other developers.
23:29yunfanbbloom: yes, i used want to roll my own enhancement for GR, but since it could use those years, i just give up, now , it cut down my backway
23:29arrdemoh. my. god. M-x google-this
23:30arrdememacs... you have outdone yourself
23:30ivando Google employees not use Reader every day?
23:30bbloomivan: i can only assume the internal uproar is hilarious
23:32ivanhopefully I will not have to spend a lot of time backing up all of their feed archives
23:36technomancyisn't it more "we want people using G+" rather than "not enough interest"?
23:39TimMctechnomancy: I feel like there's a Hanlon's Razor variant in here somewhere.
23:39TimMc"Assume marketing rather than incompetence", perhaps?
23:39ivanhttp://googlesystem.blogspot.com/2012/12/google-reader-constantly-on-chopping.html
23:41brehautTimMc: i like it
23:41TimMcIt can be very hard to tell the difference, after all.
23:43danneuIs there a way to get 'lein repl' to autorequire some namespaces?
23:44bbloomdanneu: see sample.clj in the lein codebase, you can add code or files to be evaled in your profile
23:47tyler__the lein samples are really nice and fleshed out
23:59arrdemdanneu: okay great. now we have Lisp and our incompatible languages are only regular transforms away. still unreadable.