#clojure logs

2012-12-28

00:00callenjlewis: read it a long time ago.
00:00callennice recall.
00:00jlewiswell, we named a program at work 'granger' for that exact reason. so it's not too crazy.
00:01technomancynice
00:02callenI wonder if the rate of usage of literary references in library names is higher among Clojurians than other communities?
00:02Raynesyogthos: Do you use the twitters?
00:02callenRaynes: what are you in birdland?
00:02yogthosRaynes: never made an account :)
00:02yogthosRaynes: probably should
00:02Raynesyogthos: Just wondering how we should announce this.
00:02RaynesPerhaps a mailing list post?
00:02callenyogthos: believe it or not, it's actually good for following other programmers.
00:02RaynesDo you have an existing post about luminus, yogthos?
00:02callenyogthos: as long as you're very choosy about whom you follow.
00:03callenyogthos: you have to learn to unfollow the people that retweet garbage.
00:03RaynesYou have to learn to block the people who still do follow friday.
00:03yogthosRaynes: just the blog, I'll make one with the updates
00:03callenmy marginal utility for twitter is higher than facebook. Boring people I'm socially obligated to "friend" are on there, Twitter is voluntary.
00:03RaynesGah.
00:03yogthosbut yeah it would make sense to twitter that sort of stuff eh :)
00:03yogthosok on it :)
00:03RaynesI twitter all my blog posts and have become pretty famous for it.
00:03callenRaynes: what's your twitter?
00:04RaynesIORayne
00:04callenthank you.
00:04RaynesBecause every bloody useful permutation of 'Raynes' has been taken.
00:04yogthosoh turns out I did make a twitter account :P
00:04yogthosit's just very unused :P
00:05Raynesyogthos: If you tweet it, they will come.
00:05yogthosRaynes: noted :)
00:05yogthosI just need people to follow me now ;P
00:05mpanI've considered getting a twitter
00:05mpanpossibly a separate one for coding vs personal life
00:05RaynesMeh.
00:05RaynesI don't bother.
00:05RaynesIf people don't like my personal tweets, they just don't like me anyways.
00:06callenmpan: just don't do anything "personal" on Twitter, it's a pessimal use-case.
00:06mpanwell, I think I have two separate audiences in my life, and each is likely to get very bored of the other
00:06callenmpan: it's way more interesting for professional/coding stuff. Who cares if I'm going to an Indian restaurant on Twitter? jesus.
00:06callenI don't use twitter because I want to broadcast minutiae.
00:06RaynesI don't make a habit of tweeting about my bowel movements and crude thoughts about the opposite sex.
00:06amalloythere are indian restaurants on twitter?
00:06mpanlol parsing
00:07callenamalloy: I didn't know comedy was allowed in #clojure
00:07callen$GUARDS
00:07yogthosha
00:07Raynes$guards
00:07lazybotSEIZE HIM!
00:07callenI even got the prefix right this time.
00:07mpanI heard someone recommend we write english in s-expressions to denote desired parsing
00:07amalloycallen: ~guards is more popular
00:08callenmpan: no, you have to go full-virgin and just use lojban.
00:08Raynescallen: I follow Gerard Way.
00:08nodenamecore.logic question: can I add a constraint that will choose a random value from what would have been the return list?
00:08mpancallen: is that unambiguous parse?
00:08RaynesHe is about the most useless twitterer ever, but I <3 him anyways.
00:08callenmpan: unambiguous logic too.
00:09callenmpan: what?
00:09mpanabout such a language for humans
00:09callenmpan: *shrug*
00:10mpandunno
00:10mpannot sure how happy creative writing would be about such a language
00:10callenmpan: I don't know, I'm pretty sure the sort of people that learn lojban are all sysadmin trekkies.
00:11Raynesyogthos: Anyways, good work. Happy to be working with you on this.
00:11yogthosRaynes: likewise :)
00:11RaynesTogether we shall fix web development in Clojure.
00:11amalloynodename: you can't do "random" anything relationally. and i don't understand what you meant by "return list"
00:11yogthosthat is totally the plan
00:11mpanI like the sound of that
00:11yogthos:)
00:11callenRaynes: and your little dog too.
00:11mpanI would be very interested in fixed web dev in clojure
00:12nodenameby 'reurn list' I mean the list of values returned by run*
00:12yogthosmy main plan is to make it dead simple, especially for people who are curious about doing clojure stuff coming from python or whatever
00:12yogthosfirst one's free :P
00:12Rayness/simple/sexy/
00:12RaynesI'M DEAD SEXEH
00:12callenwhy is batsov trying to drop slime support in clojure-mode?
00:12yogthos:)
00:12mpancould be quite compelling if you make a good alternative to the heavy frameworks out there
00:13mpanand sell people on the "easier to get started" angle
00:13yogthosthat's what I'm thinking
00:13nodenameah dnolen can you see my core.logic question from a few minutes ago?
00:13callenmpan: compojure and ring get us close to something like Sinatra, but the story isn't full yet and some people are going to be looking for something like Rails or Padrino. I haven't decided how to address that yet.
00:13yogthosI find with big frameworks a lot of time it doesn't actually save work, you just end up having to do different work
00:13mpanI mean, I'm probably going to learn <framework redacted> for the sake of a job before long
00:14mpanbut honestly, yea, it feels like
00:14callenOTOH, the Rails community today was bickering over the default scaffold .gitignore, so they may not be the role models we want.
00:14yogthoshaha
00:14yogthosI think we have a big advantage with the jvm
00:14mpanthe amount of work I save implementing is more than made up by the amount of work I'd need to spend mentally juggling the knowledge of said framework
00:14yogthosstuff like lein is way ahead of a lot of build tools
00:14yogthosand the performance is good
00:15yogthosreally the only thing to do is to package all these nice things into a pretty bundle :)
00:15callenmpan: I come from Django and Flask land, so I've fully explored both ways.
00:15callenmpan: in my experience, long-term, the "minimalist" path only works if you 1. Have great libraries 2. Aggressively promote the idiomatic usage of those libraries.
00:15callenotherwise people will, in the absence of guidance, revert to using the heavy-handed stuff.
00:15mpanfirst part is huge
00:16yogthoscallen: yeah I agree good libs are key
00:16mpanotherwise people will hit you with the argument of
00:16yogthosand one place for docs
00:16mpan"I can do X in framework F..."
00:16yogthosI can't stress that enough
00:16Raynesyogthos: lib-noir + luminus = http://www.youtube.com/watch?feature=player_detailpage&amp;v=5110hk9W71E#t=24s
00:16yogthosROFL
00:16eggheadI like the build your own framework approach, some lein plugin or something that asks you what you want to use for templates/persistence/routes
00:17RaynesI highly suggest you close the browser window immediately after that scene, for what follows may offend your sensibilities.
00:17mpanRaynes: I was expecting informative but I got humorous instead
00:17mpanthat works too
00:17callenyogthos: mpan: do not under-estimate the importance of pedagogy and idioms in teaching them to use those libraries.
00:17yogthos:)
00:17yogthoscallen: that's kind of the plan for the luminus site
00:17mpanwell, I may be the poster-boy for being unable to focus long enough to learn a heavy framework
00:17mpan=P
00:18yogthosI should actually change it to pull the md files straight off gituhb :)
00:18callenI figured, that's why I was keen on it.
00:18yogthosthen people can just send pull requests with tutorials and whatnot
00:18callenmpan: I got very familiar with Django, to the point that I was comfortable writing patches and knowing the least-pain path for most things you could want.
00:18callenmpan: it took a long time before i became more productive in Flask.
00:18callenand even then, it was almost a wash in some circumstances.
00:19callenmpan: you cannot learn from the mistakes of others if you don't also know what they did right.
00:19yogthosI personally much prefer libs to frameworks, I just want lego blocks to put together :)
00:20yogthoswith a real framework you gotta get inside somebody's head and think the way they were thinking when they wrote it
00:20callenI eventually came to the same conclusion, but there is a *reason* Django and Rails are so popular.
00:20yogthoscallen: easy to start with :)
00:20mpanand they've got huge ecosystems of stuff that only works with them
00:20yogthosmpan: but django is relatively new, so it ramped up pretty fast
00:20callenyogthos: partly, they're really productive in the beginner and intermediate stages.
00:21callenyogthos: Django isn't new, it's 7 years old.
00:21dnolennodename: I did not, what was it?
00:21yogthoscallen: it's been around that long? :)
00:21callenyogthos: yes, keep in mind I have no small amount of affection for that community. They saved from the .NET world.
00:21yogthoscallen: ha!
00:22nodenamecan I add a constraint that will 'choose' a random element from what would have been the list of possible values for q?
00:22callenyogthos: just because I believe I've found something better doesn't mean I'm going to damn them when I've seen the Hell that is ASP.NET, J2EE, etc.
00:22yogthoscallen: I find J2EE crowd has a serious case of stockholm syndrome
00:23callenyogthos: spot on.
00:23callenshortest and sweetest summary I've ever heard.
00:23callen"Why is a monad like a writing desk?: A presentation by Carin Meier at Clojure/West" <--- the monad analogies need to stop.
00:24dnolennodename: yes that's possible
00:25nodenameyes? how?
00:25dnolennodename: one second
00:25dnolennodename: it doesn't even require a constraint
00:26dnolennodename: hmm actually, I probably need more information about what you're trying to do ...
00:27nodenamednolen: trying to generate random legal strings in a dsl
00:27nodenamednolen: that conform to a dsl, that is
00:27dnolennodename: and you don't need to run any other operations on them w/in core.logic?
00:28amalloydnolen: i responded to him earlier, before he re-asked the question. i'm surprised you answered so quickly that he can do it; what's wrong about my answer? -- you can't do "random" anything relationally. and i don't understand what you meant by "return list"
00:28nodenamednolen:um I guess; I do have to do random generating recursively to a given depth
00:28nodenameamalloy: seems dnolen knew what I meant
00:29dnolenamalloy: that's not totally true ... though I haven't tried it much so it possible some of the things I menat mention are "unsound"
00:29dnolenmight mention
00:29nodenameamalloy: and there are "things" on stackoverflow about doing random in prolog
00:30nodenamednolen: not entirely sure core.logic is the way to do what I want but it sort of smells like it
00:31dnolennodename: again I still don't have any idea what you're trying to do
00:32dnolennodename: it's easy to make a value that hooks into value forcing, but this doesn't account for unification and many other things.
00:32nodenamewant to genreate random expressions in the dsl defined in mikera's clisk library; the exprs when evaled will produce images
00:32dnolennodename: what will (== random-unforced-value0 random-unforce-value1) mean?
00:33nodenamednolen: sorry I don't understand
00:33dnolennodename: yeah, I can show you something, but I have no idea if it will do what you want.
00:33nodenamednolen: ok please do
00:33dnolennodename: when you're adding custom types to core.logic you have to be aware of the interactions.
00:34nodenameI do think a few defrels are appropriate
00:34dnolen(run* [q] (== q (rand-nth vector-of-stuff)) coudl just work.
00:35dnolennodename: yeah there no support for random selection over defrels
00:35nodename(def named-colors
00:35nodename ["black" "blue" "cyan" "darkGray" "gray" "green"])
00:36nodename(for [c named-colors]
00:36nodename (fact color c))
00:36nodename(run* [q]
00:36nodename (color q))
00:36nodenameoh yeah there was (defrel color c)
00:36dnolennodename: yes that won't work. Will had something call condp that kinda does what you want but I haven't implemented it.
00:36nodenamedamn
00:37callendnolen: I take you liked Bodil's tweet too?
00:37dnolennodename: support for stuff like that is definitely something I'm thinking about but I don't have bandwith for it at the moment.
00:38callendnolen: it actually comforts me that I see this sort of thing in Rails and not clj.
00:38nodenamednlen: can't think of another approach atm
00:38dnolencallen: I just thought it was funny
00:39dnolennodename: yep sorry, list of core.logic todos is just too long at this point. I'm really at the point where if people want to see stuff they gotta send me patches.
00:39nodenamednolen: haha
00:39dnolennodename: at the same time don't lose hope - condp is like 50 lines of code or something - so I might feel inclined one day.
00:40tomojis the version someone already wrote not available? :(
00:40nodenamednolen: I am trying to do this project NAO
00:40dnolentomoj: one second, I can paste, someone can port
00:40callendnolen: No, this was the funniest one - vmg: Everybody in Rails core has great plans for the future of the framework, but they all involve cutting the brakes of a very expensive racecar
00:40dnolenyou hae understand syntax-rules which ain't so bad
00:40tomojport.. from minikanren?
00:41callendnolen: have you seen gfredericks' 4clj for core.logic?
00:41dnolenhave at it, http://gist.github.com/4394782
00:41dnolendoesn't look very challenging.
00:41dnolenwill take a port from first person w/ a CA
00:41dnolencallen: yes it's cool
00:42dnolennodename: NAO?
00:42nodenamednolen: yes, RIGHT NAO
00:43dnolennodename: oh heh :) yeah sorry I can't help!
00:43nodenamednolen: so this condp, is it related to may question?
00:44dnolennodename: yep, it's a weighted version of conde, so it will randomly pick a branch based on weight - it's non-terminating tho so you have to specify your # of answers I think - which may or may not work for you.
00:45tomojcan't just get a lazy seq of answers I guess?
00:46dnolentomoj: that actually on the list of todos - I finally see how to make core.logic queries properly lazy.
00:46tomojcool
00:46nodenamednolen: I see, well time for me to get to studyin then, I'm not too savvy w macros yet tho
00:46tomojI will try to understand this condp in hopes that it will let me write a nice shuffleo
00:50nodenameBuffalo
00:54UberNerdGirlhullo again
00:55UberNerdGirlI'm a bit more familiar with Scheme than Clojure. Would the Clojure equivalent of Scheme's (null? foo) be (empty? foo) ?
00:55dnolenUberNerdGirl: depends, empty? if foo is a collection, but (nil? foo) works as well too depending.
00:56mpanwhat specifically are you trying to test for? note that clojure has a few more values that may be interesting to that question
00:57UberNerdGirlI would like to check for quality to (), or an empty list
00:57UberNerdGirldnolen: oh hello :)
00:57mpanum, would you want [] or similar to qualify?
00:57dnolenUberNerdGirl: hey! empty? works.
00:57UberNerdGirlmpan: i'm afraid all of that escapes me
00:57UberNerdGirlokay, i shall use empty? for this case
00:57dnolen,(empty? ())
00:58UberNerdGirldnolen: i think that's for the HS room
00:58dnolenhmm clojurebot is gone.
00:58dnolenUberNerdGirl: it works here too
00:58UberNerdGirloh
00:59dnolen$(empty? ())
00:59dnolenhmm, I never remember the lazybot commands
01:00tomoj&(empty? ())
01:00lazybot⇒ true
01:00UberNerdGirlrad
01:00dnolenright
01:00tomoj&(if (seq ()) :not-empty :empty)
01:00lazybot⇒ :empty
01:00tomoj&(doc empty?)
01:00lazybot⇒ "([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
01:01mpannil is empty, list-of-zero-elements is empty, but so are the other collections-of-zero-elements
01:05callenso uh...is this where we link the egal CL paper again?
01:06Raynesdnolen: lazybot forgives you.
01:06tomojwonder how long till you saying that will automatically cause my client to show me a link to the paper
01:06lazybotI does not exist in my database.
01:07tomojhmm, lazybot knows it's not self-aware?
01:07lazybotI do not forgive dnolen.
01:07mpanyou guys have made me curious now; which paper is this?
01:08tomojgoogle says http://home.pipeline.com/~hbaker1/ObjectIdentity.html
01:10tomojhmm, I must not understand syntax-case, cus lambdag@ looks just like lambda
01:10mpanthanks!
01:10tomojer, s/case/rules/
01:10dnolentomoj: it is just lambda, it a macro that's done just to denote something - has no meaning.
01:10dnolener I mean as far as what it becomes
01:11dnolenlambdag@ just becomes lambda
01:11tomojgreat
01:12dnolentomoj: only real weird thing is the generate-temporaries
01:16tomojI'm guessing just gensyms np0# ...
01:17dnolentomoj: yeah
01:21dnolenhugod: ping
01:43yogthosso we have profiles now in luminus :) http://luminus.herokuapp.com/docs/profiles
02:15dimovichhello ppl
02:15dimovichhow can I make the fetcher function less CPU intensive...?
02:15dimovichhttps://www.refheap.com/paste/7895
02:18Ember-dimovich: you have 5 workers doing stuff like crazy for one second? No wonder it is cpu intensive?
02:18dimovichThread/sleep was an example
02:18dimovichI'm waiting till all work queues are empty...
02:19Ember-yeah well, your cpu intensity comes from ;do stuff
02:19Ember-you have 5 threads doing infinite loop (until you set the atom to false)
02:20dimovichhow do I block these threads until sth comes up? or do I have to use some other concurrent primitive?
02:20Ember-place (Thread/sleep 1) inside that while to get the cpu usage down, not that it really helps you...
02:20Ember-dimovich: use the future's return values
02:21Ember-http://clojuredocs.org/clojure_core/clojure.core/future
02:21Ember-when you dereference the future's return value it will block until future is done
02:22dimovichok
02:22Ember-thus no need for (Thread/sleep 1000) and your workers will return immiadetly after they've done their job
02:23Ember- /s/immiadetly/immediately
02:24dimovichthe thing is, I'm using clj-http, and I'm wrapping that fetcher future in a clj-http.client/with-connection-pool
02:25dimovichso I can reuse the connections... therefore the future can't return... it has to continually poll for new tasks and download stuff :)
02:25Ember-create a queue for stuff the http connections get?
02:26dimovichyeah, possible
02:26Ember-http://clojuredocs.org/clojure_core/clojure.core/seque
02:27callenEmber-: I snorted at the name. Also why are we still using ClojureDocs?
02:27Ember-use BlockingQueue with that
02:27Ember-callen: hmm?
02:28callenEmber-: it's not updated to 1.4.0, he refuses to release the source, and it's in fucking Ruby.
02:28callenWe shouldn't have to use this for our stdlib docs.
02:28Ember-well, it's better than plain ol' docs due to examples
02:28Ember-when learning stuff
02:28Ember-but I agree, should be updated to 1.4.0
02:29callenEmber-: I know that, I'm just saying. It also irritates me that it isn't dogfooding.
02:29tomojI remember feeling bad for complaining about that at the time
02:29tomojat least he put something out there.. :/
02:29callentomoj: you've got a point, but I'm testing the waters to see if anybody else would even care.
02:29callentomoj: another question, do we want a wiki?
02:29Ember-well, it shouldn't be too hard create clojuredocs-with-clojure :)
02:30Ember-after all, it's kinda trivial to parse documentations from clojure sources
02:30Ember-with clojure of course
02:30Ember-:)
02:30tomojI wonder if whatever it is should go at the confusingly-named clojure-doc.org
02:30Ember-examples are the hard part
02:30callenEmber-: I don't want to just clone it, I want ++. Do you think something wikified would be valuable so that examples can be expounded upon?
02:31callenclojure-doc, AFAIK, have said they don't want to touch stdlib docs, generally speaking.
02:31Ember-wiki isn't exactly a good way to do this, it needs some kind of release management system in it
02:31callenIt would have that
02:31Ember-so that you can create an example but it isn't published right away
02:31RaynesCalm down, guys. Give me a month or two and I'll write a documentation site.
02:31Ember-an admin should do the release
02:31Ember-Raynes: cool
02:32RaynesI wouldn't count on me though. I'm pretty fickle.
02:32Ember-anyway, clojuredocs will suite me until then, even if it is 1.3.0 :)
02:32callenRaynes: you're like the nature god Pan.
02:32callenI think a Clojure Wiki with examples and discussions of idioms all in one place would be really nice.
02:32callenStack Overflow doesn't work great unless you have a very specific issue.
02:33callena lot of the questions that get asked here are about idioms, once answered, are essentially lost into the aether.
02:33Ember-a good documentation site with api docs with good examples and faq etc would be great
02:33Ember-should be part of clojure.org (and in a way it is)
02:33RaynesI might really do it though.
02:34RaynesMight.
02:34RaynesAlso, is my name not capitalized?
02:34Raynes._.
02:34atyzIt's a lot of work
02:34Ember-09:25 < Raynes> Also, is my name not capitalized?
02:34RaynesStrange. This client lower cases it.
02:34tomoj.. so you see "ember-" ?
02:34Ember-atyz: not that much really. Sure when doing it at your freetime it will take several evenings
02:35RaynesIt's a fairly big project, but I can't see it being *that* much work.
02:35callenEmber-: what you describe is more of a clojure-doc.org + clojuredocs
02:35RaynesThe hardest part is just design. Someone else might have to make it prettier.
02:35callenI'd really like to get something like the EmacsWiki rolling.
02:35atyzDocumenting the language and usage examples?
02:35RaynesIf I do it, it will be a pure documentation/source/example website though.
02:35Ember-atyz: producing the examples will take time, but the code providing the platform is easier
02:35atyzThe building of the site isn't too much work
02:36Ember-and the documentations are already there, just generate them from sources
02:36atyzDon't get me wrong, I'm not trying to put anyone off it. I love the idea
02:36atyzWas just stating that it may or may not be more work than anticipated
02:37RaynesIt would give me a decent opportunity to write something from the ground up with laser.
02:38callennobody else is intrigued by the notion of something like the EmacsWiki? I've found the EW to be amazing.
02:39RaynesClojure has/had a wiki, but nobody cared.
02:39Ember-callen: this? http://emacswiki.org/
02:39callenEmber-: yes
02:39Ember-and agreed, wiki in general will not work
02:39Ember-unfortunately
02:39Ember-wikis tend to get cluttered
02:39callenI don't see why, EW has shepherded the community for a long time.
02:39Ember-those need active moderators to maintain
02:40callenthe clutter is the collected wisdom, a little disorder is better than losing knowledge, like what I said about idioms earlier.
02:40Ember-I've worked with wikis and currently work with them
02:40Ember-the problem is, knowledge does get outdated too
02:40callenI'm fully aware. I have improvements to the wiki model in mind for addressing that.
02:40Ember-the older the wiki, the more it has of the old information which might be outright misleading
02:41Ember-at work we have all of our documentation about *everything* in confluence
02:41Ember-works great, except you can't find shit from it anymore since it has huge amount of stuff in it
02:41callenworkplace environments are a pathological case for wikis.
02:42Ember-search just doesn't work anymore, you find stuff from 2003 with it
02:42callenmostly CYA documentation, nothing intended to be meaningful or actively maintained.
02:42callensearch is another matter. Come on dude, are you seriously comparing a potential Clojure wiki to a shitty unmaintained Confluence?
02:42Ember-like I care about how some java stuff was done back in 2003
02:42callenthat's just being disingenuous and comparing the incomparable.
02:42Ember-callen: yes I know that is kinda unfair, but I've seen how bad full blown wikis can get
02:43Ember-thus I'm suggesting a wiki-like experience with moderators which accept the edits before they get published
02:43Ember-a public wiki can get really ugly really fast if it has even one moronic troll
02:44callenEmber-: for one thing, reverting changes and banning accounts/IPs isn't that big of a deal.
02:44callenEmber-: second, I like the original wikis where actual discussions and flows happened. Not this bullshit publishing format.
02:44callenthat can't happen with a moderator queue.
02:45callenThere are plenty of ways to handle Joe Troll.
02:45Ember-commenting can be there
02:45Ember-but anyway, do it the way you like :)
02:45Ember-I'm just happy if the information is there
02:45Ember-I'd do it in this slightly more moderated way but hell, if we get an active and maintained wiki then I'm all for it
02:47callenEmber-: http://c2.com/cgi/wiki
02:47Ember-callen: yup, seen that
02:47callenEmber-: you've seen it, but you don't seem to appreciate it very much :(
02:47Ember-no, that's kinda unreadable and unusable mess in my opinion
02:47Ember-hate sites like that
02:48callenthe design and delineation of content can be done sensibly.
02:54Raynescallen Ember-: Are guys going to kiss now?
02:56callenRaynes: only if you join in
02:56callenRaynes: pink hair is obligatory.
03:00Ember-Raynes: make us our love nest!
03:03callenso today I learned the English J is actually a hybrid of d and zh.
03:14callentechnomancy: At least look at the reviews? http://www.amazon.com/Mistborn-Final-Empire-Series-Book/dp/0765350386/ref=sr_1_1?ie=UTF8&amp;qid=1356681911&amp;sr=8-1&amp;keywords=Mistborn
04:05tomojhmm.. condw?? https://www.refheap.com/paste/052e41e272010c7a695ec46e9
04:46nodenameHahahaha CompilerException java.lang.ClassFormatError: Invalid method Code length 175586 in class file clevolution/cliskenv$eval176496, compiling:(NO_SOURCE_PATH:1)
04:49ziltiWhy is ##(conj {:three 3} [{:one 1}{:two 2}]) not => [{:one 1}{:two 2}{:three 3}]? Sometimes clojure is weird.
04:49lazybot⇒ {{:one 1} {:two 2}, :three 3}
04:50borkdudezilti because conj first takes the coll to conj on
04:50borkdude,(doc conj)
04:50pyrtsa##(conj [{:one 1}{:two 2}] {:three 3})
04:50lazybot⇒ [{:one 1} {:two 2} {:three 3}]
04:50ziltiargh. I see
05:32tomojmy logic version of (rand-nth [1 2 3]) is only 250x slower..
05:34dbushenko:-)
05:34dbushenko"only" :-D
05:35tomoj:(
05:42callentomoj: as in core.logic?
05:42tomojyeah
06:48ogrimAnyone have experience using SOAP Web Services with Clojure?
06:52dbushenko+1
06:52dbushenkoactually I had to use apache cxf for that...
06:52ogrimI was looking at that, seems nice enough
06:53ogrimbut would really like to have clj-soap working, that would be very usefull
06:55dbushenkoclj-soap looks weird for me
06:56dbushenkoseems like it is a bit too simple
06:59ogrimit's very powerfull to generate clients quickly from a wsdl. Visual Studio makes this very simple, so I'm thinking of writing a data provider in C#. It would be less hassle still to be able to auto-implement the client in native clojure
07:08RaynesYou're best off using Java libraries for that.
07:09RaynesSOAP is an evil, evil monstrous thing that nobody wants to mess with.
07:09RaynesIn other news, https://github.com/Raynes/laser#screen-scraping laser can do screen scraping type stuff now.
07:09RaynesMe go night night.
07:10dbushenkoRaynes, how does it differ from clj-tagsoup?
07:10callendbushenko: it's a simplified enlive, not clj-tagsoup.
07:11dbushenkoaha, ok then
07:11callendbushenko: focuses more on zippers and tree traversal, less on CSS selectors.
07:11ogrimI like enlive, so will check out laser :)
07:12callenogrim: enlive *and* SOAP? I'm keeping my distance from you.
07:12ogrimOn SOAP: you can find many undocumented APIs using a man-in-the-middle proxy when surfing the web (fiddler, mitimproxy) - sometimes you need to touch the old crap to get the good stuff (data)
07:13callenogrim: I'm a huge fan of carting off with data :)
07:13ogrimcallen: also, I'm programming PowerBuilder (for work ... sometimes)
07:13borkdudealgernon which static site generator is that?
07:13callenborkdude: there are only like 200 written in Clojure alone.
07:14algernonborkdude: my own (github.com/algernon/madness), one of the million similar ones :P
08:06Raynesalgernon: I support this decision. If you decide to, let me know if you need help or run into any pain points.
08:10algernonRaynes: will do
08:49borkdudeRaynes using laser, how to feed it html from a file, slurp it yourself?
09:01borkdudeRaynes to select an element from a particular form (div, etc) and class, write this? (laser/select-and (laser/element= :table) (laser/class= "names"))
09:04borkdudeRaynes how do I write a selector like this (from Enlive): [:table.names :tbody :tr]
09:40moominpapaHi, could I ask a stupid question? Does lein always set up an nrepl connection or is it just the repl job? In particular, if I use lein ring server, can I connect via nrepl? Because it doesn't print a port.
09:44ziltimoominpapa: lein ring server won't provide you with a nrepl connection. You'd have to add the nrepl-server-startup-code yourself to the server.
09:45moominpapaAh, thankyou :)
09:47moominpapaI think it might be simpler to take lein ring out and use ring-server. Only just discovered this had been split out.
09:55dimovichhey people, is this idiomatic? https://www.refheap.com/paste/7898
09:59ziltiIf someone wants to have a more dynamic korma which can also create and modify tables this might be for you: https://github.com/zilti/tetrisql </shamelessplug>
10:01dimovichcool
10:01moominpapa@dimovich It's fine in context, but I'd rather see the parameters passed down explicitly.
10:01moominpapaIf you're going to do things like that, the config is probably the place to do it :)
10:02chouser+1 moominpapa
10:02chouserdimovich: what you've got there makes your entire (run-program-code) impure.
10:03chouserEven passing in a giant config object as a single parameter, while having drawbacks of its own, is a better place to start than dynamic vars.
10:11dimovichthanks for feedback
10:22cemerickThere was a fellow (and his wife) at the conj who were working on educational software; if anyone knows who I'm talking about and has contact info for him or her, please pm me. :-)
10:40dimovichhow can I convert :some/Key to "some/Key"
10:46oriig,(.substring (.toString :some/Key) 1)
10:46oriigdon't know if that's idiomatic though :P
10:48dimovichthanks
10:50ziltihttps://www.refheap.com/paste/7899 What does "variadic overload" mean?
11:06milos_cohagenwhere did the syntax of mixing lispy func invocation with square brackets for args array originate? eg (myfn [args])
11:23milos_cohagen?
11:29thorwilmilos_cohagen: i would guess it is an original idea
11:30thorwilborn out of the desire to have a bit more "flavor" than all (), and having literal syntax for certain types
11:30milos_cohagengiven function args often are represented as arrays i guess it was natural
11:32milos_cohagenjust been getting into clojure after years of java and a bit of scheme in uni and luvin it
11:35TimMcI've certainly seen it in PLT Scheme (now, Racket).
11:37Anderkenthow do I attach a debugger to leins process? Trying to add the java opts gives me errors 'ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options'
11:53dimovichhow can I make the second example work? https://www.refheap.com/paste/7900
11:54thorwildimovich: what's the motivation for the read-string?
11:54dimovichI'm keeping the selectors in a separate config
11:55dimovichlazily read-string'ing them :)
11:56thorwildimovich: maybe you have a good reason, but my gut reaction to that is: that's insane ;)
11:56dimovichjust hacking my way... and thought I would try that :)
11:56thorwildimovich: however, if you insist on such acrobatics, use a macro to generate the whole elive form along with selector
11:57dimovichthanks, will try that
12:01dimovichyep, that works :)
12:01dimovich(eval `(enlive/select html ~(read-string "[:div (attr? :href)]")))
12:29technomancycallen: I noticed you rambling about clojure-doc.org; thought I should let you know that a re-write is already in process
12:30technomancythere's a rest API in clojure already that cd-client (in lein repl) uses, just no HTML interface yet
12:51AnderkentQuestion: it seems the clojure compiler ignores the 'name' meta field, and only looks at the second part of (fn* ...) form to figure out the name. How come (defn foo) gives the right name in backtraces if it only supplies the meta?
12:58ilyakhi *.
12:58tomoj&(macroexpand-1 '(defn foo []))
12:58lazybot⇒ (def foo (clojure.core/fn ([])))
12:58ilyakWhat's the right way to find the biggest element in the collection?
12:58ilyakof something comparable
12:59tomoj&(meta (second (macroexpand-1 '(defn foo []))))
12:59lazybot⇒ {:arglists (quote ([]))}
12:59Bronsailyak: apply max
12:59ilyakI fing the fact that < >, max and max-key work with numbers only extremelly frustrating
12:59ilyakBronsa: isn't max limited to numbers only?
12:59Ember-,(last (sort [1 2 5 4 2]))
12:59Bronsaoh, i missed your second line, sorry
12:59Ember-&(last (sort [1 2 5 4 2]))
12:59lazybot⇒ 5
13:00Ember-sure, ain't necessarily fast with every possible collection
13:00ilyakthe sad thing: even though clojure is a very new language, its core library already contains quite a few bullshit
13:00ilyakAs in: "Why is X? Because life is pain, that's why!"
13:00ilyakWhy is max limited to numbers? Because life is pain, that's why.
13:01ilyaksort is n * logn
13:01ilyakmax is linear
13:02Ember-true but sort works for all kinds of stuff
13:02Ember-and it all depends on how large your collection is
13:03ivaraasenilyak: do max-key
13:03Anderkentilyak: (reduce (fn [x y] (if (> (.compareTo x y) 0) x y)) coll) ?
13:03Anderkent:P
13:03ivaraasen,(max-key count "asd" "bsd" "dsd" "long word")
13:04Anderkentivaraasen: that doesn't work if you can only compare two items instead of assign a number to them
13:05Anderkentah, you can use compare instead of .compareTo, and there's probably some way to make the comparing a bit prettier
13:06ivaraasenAnderkent: yeah, you're right
13:07tomoj(reduce (comp pos? compare) coll) maybe ?
13:07tomojno, of course not
13:07jonasenkovas: pull request sent..
13:08tomojjust woke up :)
13:10dnolenilyak: I don't really see why max needs to work w/ anything else besides numbers. Even if it didn't it would be any more convenient that (reduce your-max-fn some-seq) vs. (reduce (weird-max your-comparator) some-seq)
13:10dnolen"Even if it did"
13:11Anderkentdnolen: having (max some-seq) when all elems implement comparable would be convenient though
13:14dnolenAnderkent: yeah but it's a one-liner you could add yourself - (reduce #(if (pos? (compare x y)) x y) some-seq)
13:15Anderkentwell, so is max.
13:15dnolenAnderkent: looks more closely at the implementation of max and tell me why this is a bad idea :)
13:16Ember-the whole point of clojure and lisps is for it to be extendable
13:16ilyakivaraasen: max-key is all about numbers, too
13:16Ember-it has a lot of stuff out-of-the-box but if you need more, then do it
13:16Ember-writing a one liner function ain't too much work...
13:17ilyakdnolen: I don't really see why I should be writing my-max-fn instead of application codez
13:17Ember-at least in my opinion
13:17ilyakI've found but I do have to hack in an awful lot of stuff that should it in the standard library
13:18dnolenilyak: like I said max works only on numbers for a very specific reason - it inlines on primitives numbers. At some point you will realize many decisions are made in Clojure for reasons you might not yet understand.
13:18systemshi
13:19ilyakdnolen: Cool story, but why isn't there a way to do a normal proper max?
13:19ilyakI mean, there are a lot of objects in the world
13:19ilyaklike dates
13:19ilyakwhy limit yourself to numbers? makes no sense
13:19dnolenilyak: whatever, moving on.
13:19ilyakSpecial handling of primitive numbers is the kind of Javaesque crap I thought everyone is happy to run from
13:20ilyakLife is pain :(
13:20dnolenilyak: you're well on your way to ignore list now.
13:20ilyakdnolen: That won't hurt much as you never said anything useful
13:21Ember-ilyak: read the source of max
13:21Ember-and you'll understand
13:22Ember-and if you refuse to see the :inline -stuff then well, like dnolen said: whatever, moving on
13:22Ember-:)
13:22tomojyeah.. life is pain
13:22tomojideally we wouldn't have to be pragmatic like that
13:23tomojbut, good thing we are :D
13:23tomojs/we/not me/
13:23ilyakEmber-: We don't have a limit on a number of functions in core do we?
13:23Anderkentwhere can I find out how java methods with the same arity are resolved (using type hints)? Compiler.java? Reflector.java?
13:23ilyakWhy doesn't it has max for humans?
13:25ilyakAnd I don't see why it's OK to assume everyone does number grinding
13:26Ember-ilyak: like you said yourself, clojure is a new language. And if you want max-compare or whatever, then write it yourself. Even better, assign a pull request for clojure core after you've tweaked it to perfection and maybe you'll get it into core
13:26Ember-it's an open source project, one *can* take part
13:27technomancyEmber-: well... in theory
13:27Ember-technomancy: I know, it is going to be hard going to get your own code to core
13:27ilyakIn practice if everyone agrees "only hardcore grind in core", my pull requests will be ignored
13:28ilyakI can have my own extras but the whole community will never get any benefits from that
13:28Ember-but I just don't see the reason why anyone would rave about something which could be done with a one-liner and added to one's own library if needed...
13:28Ember-ilyak: and why's that? Because you don't want to share your code?
13:28Ember-of course the community will get benefits if you release your code as open source in github or similar
13:29ilyakEmber-: Because nobody is going to dig other people's extras for the insight
13:29ilyakPeople just don't do that
13:29ilyakThe only notable exception is apache commons
13:29Ember-eh
13:29Ember-don't be offensed but you are wrong
13:30Ember-google guava and a bunch of other libraries out there prove you wrong
13:30ilyakMost people aren't good at making tools. They don't see it as a priority. So, given a weak set of tools, they're going to use that and make weaker code than they could.
13:30ilyakSee PHP
13:30Ember-you are seriously calling clojure as a weak tool? o_O
13:30ilyakThe problem is, with minimal and arcane core lib, some people are surely going to make a nice extras lib
13:31ilyakbut the most of the community will write weaker code than they could.
13:31ilyakEmber-: Well, when it comes to tuple handling, clojure core is weak
13:31Ember-oh come on, Rome wasn't built in a day
13:31ilyakI believe it has group-by
13:31Ember-it has
13:32ilyakbut no zip-with, no map-keys/map-values
13:32ilyakof course those are trivial to write
13:32Ember-it also has partiton-by and frequencies
13:32ilyakbut most people (I believe) will learn to go without
13:32Ember-partition-by
13:33ilyakpartition-by is an example where clojure/core has some advanced, use with care tools. While still lacking some obvious ones
13:33ilyakI mean, zip-with is an obvious thing. Or am I missing something?
13:34ilyak(defn zip-with [f s] (into {} (for [k s] [k (f k)])))
13:34dnolenilyak: no
13:34dnolen&(map #(+ %1 %2) [1 2 3] [3 2 1])
13:34lazybot⇒ (4 4 4)
13:34technomancyzip-with is a crappy name, but yeah that comes up with some regularity
13:34dnolen(map f (keys ...))
13:34dnolen(map f (vals ...))
13:35dnolenthese aren't even one liners, the fns in core compose to the point that to have a function is almost ludicrous
13:36Ember-composability <3
13:38tpopebitsweat came up with the name "associate" for this zip-with
13:38tpopeI like it, but I guess that's confusing with assoc
13:38ilyakNo, I mean a different thing by zip-with
13:38ilyak(I don't know why it's called that)
13:38technomancyoh, misread zip-with. yeah, that's not a common function.
13:39ilyakit's (a -> b) -> [a] -> [(a, b)]
13:39tpopewell *I* meant ilyak's definition
13:40ilyakHaving zip-with and group-by changes your coding style forever
13:40technomancyhaha
13:40dnolen&(map (juxt identity str) [1 2 3])
13:40lazybot⇒ ([1 "1"] [2 "2"] [3 "3"])
13:40ilyakit's like mapreduce: you can represent most computations as a composition of zip-withs and group-bys
13:41ilyakdnolen: yes, but (zip-with str [1 2 3]) is kind of snappier
13:42dnolenilyak: yes you save a couple of characters, but honestly there many interesting equally useful other ways in which Clojure helps you save characters.
13:52dnolenhugod: ping
13:58tomojif you write a bunch of composed zip-with's and group-by's in clojure, your code will probably not be very fast :1
14:00tomojI suppose there is a tradeoff of putting stuff like (defn ___ (into {} (for ...))) into the language, where it may be useful, but people who use it too much without understanding it will just say "clojure is slow!"
14:00tomojamong other tradeoffs..
14:00AnderkentIs there a tag/branch in clojure git repo for 1.4.0 ?
14:01xeqiAnderkent: tag "clojure-1.4.0"
14:01Anderkentthanks, couldn't find it :P
14:02technomancywhat's the reason tag names aren't the actual version name?
14:02tomojlooks like they used to be, before 1.3.0. was that post-github?
14:03tomojI wonder if github was creating zipballs called 1.2.1.zip
14:03technomancyheh
14:03technomancythe switch to github was right after 1.0 iirc
14:03Anderkentonto debugging the clojure compiler to find out what I'm doing wrong! TT
14:03tomojlooks like that is the case
14:03tomojnot sure it's a very good reason to switch tag naming
14:13augustlI'm struggling with a "java.lang.RuntimeException: Can't embed object in code, maybe print-dup not defined" when I have a ref that points to a Java object inside a defmacro.. Any suggestions? My macro basically looks like this: (defmacro [& body] `(some-other-macro (with-redefs [some-thing (a-function-call ~my-java-obj)] (do ~@body))))
14:14tomojdon't do that?
14:14augustltomoj: don't do what exactly?
14:15tomojmy-java-obj there needs to evaluate to some code, not a java object, in order for the macro to work
14:15tomojwell, in order to avoid the error
14:15tomojdon't embed objects in code :)
14:15augustlI think what I want is for my macro to expand to the ref itself, not the object the ref refers to
14:16tomojbest refheap the actual macro if you can, hard to tell where your confusion lies
14:16tomojif you really have a java obj at macro-time.. I'm not sure how you'd get it to runtime
14:16augustlallright
14:17tomojnormally you want the macro to expand to code that creates the java obj
14:17tomojinstead of creating it in macro time
14:18augustltomoj, anyone: https://www.refheap.com/paste/7901
14:18augustlI could "solve" it by using a higher order function, but that's boring!
14:19tomojwhy not just write sso-private-key instead of ~sso-private-key ?
14:19augustlno idea tbh..
14:20tomojtry that, good luck
14:20augustlinteresting, that worked
14:21dbushenkowhich is the default lein profile?
14:22technomancydbushenko: there are a number of profiles applied by default that pull from different sources. :user, :dev, and :default
14:22technomancyyou typically set :user or :dev depending on context
14:22dbushenkothanks :-)
14:22dbushenkobut is :user default?
14:23dbushenkoyes, I've just read that there is :default
14:23technomancyyeah
14:23dbushenkoso what is :default for?
14:23technomancyit's for settings that are built-in to Leiningen
14:23dbushenkothanks!
14:23technomancyerr-sorry, that's changed
14:23technomancy:default is now a composition of :base, :user, :provided, and :dev
14:24technomancy:base is the stuff that ships with lein; adding dev-resources, the newnew plugin, and checkout deps
14:26technomancyyogthos: interesting; I was wondering how long it would take before someone created a template with customization options
14:27technomancyI wonder if it would make sense to have additions like that which could be stored in their own artifact and shared between templates
14:42ppppaulcan someone help me out with my template? https://gist.github.com/4401133
14:43ppppaulit's working (when i run tests they are doing the right thing), when i load my file into the repl the body of the do-template evaluates and throws an error related to datomic
14:44AnderkentSo (def ^{:name my-fn} my-fn (fn ...)) and (def ^{:name my-fn} my-fn (do (fn ...))) are not equivalent. I'm sad now.
14:56chouserreally? how do they differ?
14:58Anderkentthe do makes it lose track of the name, so you get an autogenerated name for the function and I *think* it might mess something up with type hints and resolving java methods, but still debugging that
15:00chouserThat surprises me. I thought fn got its name exclusively from (fn <here> [args...] ...)
15:02ziltiCan someone here confirm that, when having korma entities "one" and "two", when "one" has-many of "two", and "two" belongs-to "one" and has a column "one_id", (select two (with one)) merges(!) "one"'s columns into "two"'s result, but (select one (with two)) gives a result where the map entry :two only contains an empty vector?
15:02Anderkentchouser: unfortunately (defn ...) expands into (def name (fn [args)), without the middle part...
15:03chouserwow, you're right.
15:03chouserI wonder if that has changed...
15:04ziltiAnderkent: I think it's pretty obvious why in the second example the fn doesn't get a name.
15:04chouserindeed. a year ago it changed.
15:05ziltiIt probably changed because it's inconsequent
15:05chouserClojure 1.3
15:06chouserI was aware of the previous behavior because of long running self-recursive functions in the face of dynamic redefinition
15:06Anderkentwell, it matters for the stacktraces, so I wouldn't call it inconsequent... I suppose I can work around it
15:06ziltiAnderkent: I mean it's inconsequent that, in the first example, the first expression inside def gets the metadata and in the second you expect the nested expression to get it
15:06chouserThat is, if you've got something like (defn f [a] (Thread/sleep 5000) (do-something) (send a f))
15:07chouser...and start that running, and then redefine f -- if f is a local name, redefining the var does nothing.
15:07AnderkentIn both cases the metadata is on the naming symbol, it's just the compiler carries around the 'name' but drops it when entering a do
15:07chouserbut apparently since 1.3, defn doesn't make a local symbol anymore.
15:07zilti (def ^{:name my-fn} my-fn (fn [args] ...)) = (def my-fn (do (fn my-fn [args] ...)))
15:08ziltiIs this assumption correct?
15:08chouserno, this is what I was just saying.
15:08Anderkenteh no I think that should work
15:09dnolenAnderkent: why should it given the init expr could be arbitrarily deep?
15:09Raynestechnomancy: https://github.com/magnars/dash.el
15:09zilti,(macroexpand '(def ^{:name my-fn} my-fn (fn [x] x)))
15:10zilti,(macroexpand '(def my-fn (fn my-fn [x] x)))
15:10technomancyRaynes: yeah, looks promising
15:10AnderkentI expected the def to evaluate the init expr then tell it its name, but now I see it needs it at compile time so that cant work
15:10dnolenAnderkent: yep
15:10dnolenAnderkent: I don't see how you get what you want w/o even more ugliness in the compiler
15:10technomancyRaynes: my biggest complaint doing elisp has always been the lack of a good associative data structure, and I don't think that can be addressed in libs =\
15:11ppppaulanyone have a good resource on how to deal with exceptions in clojure?
15:11Raynestechnomancy: But… but… ALISTS
15:11technomancyor even if it were, you would still have to interface with libraries that use crappy hash tables, crappy vectors, and (ugh) eieio
15:11Anderkentdnolen: Do you know any reason why it doesn't expand to (def <name> (fn <name> ...)) ?
15:11Anderkentit being defn
15:11dnolenAnderkent: because of redefinition
15:12dnolen(fn <name>) should shadow the var the name.
15:15chouserAlso because of self-calls to fns with primitive args (looking at the comment in the source code)
15:53yogthostechnomancy: yeah I gotta play around with that some more
16:28ravsterdoes '::foo' turn into something special?
16:28ravsterlooking at slingshot code
16:28ravsterexamples
16:28chousernamespace-qualified keyword
16:29ravsterbeen looking for documentation on it.
16:29gfredericks,::foo
16:29gfredericks&::foo
16:29lazybot⇒ :clojure.core/foo
16:30ravsterchouser: oh, okay
16:30ravstertnx
16:38technomancyyogthos: also: you'll want to drop the sqlite bits out of your template. not worth the trouble
16:38yogthostechnomancy: yeah I'll switch it to something more respectable :P
16:38yogthostechnomancy: figured it would do for proof of concept ;)
16:39yogthostechnomancy: I don't have too much experience with embedded dbs, I normally just use postgres myself
16:39yogthostechnomancy: is hsql or derby considered to be better?
16:39technomancyyogthos: the other danger of embedded DBs is that people think they can develop against them and then swap them out for postgres later, which never actually works =\
16:39technomancyyogthos: I haven't looked into them in detail.
16:40yogthostechnomancy: yeah for sure, but doesn't hurt to have the option and it gives people something to play with out of the box
16:40yogthostechnomancy: I do love the postgres userspace on the mac though, awesome for doing development with
16:40technomancyyogthos: yeah, as long as people don't get unrealistic expectations
16:41yogthoshehehe
16:41yogthostechnomancy: I'll add a profile for postgres as well and then expand the section to explain the benefits/drawbacks so people know what they're getting into :)
16:42technomancycool
16:42technomancyif you could strategically omit an option for mysql that would be great too =)
16:42yogthosfor a lot of sites embedded is fine too, if you have something like a blog, postgres is probably overkill ;)
16:42yogthoshaha that's totally the plan :P
16:42technomancyexcellent; carry on
16:42yogthosI can't see any reason to use mysql over postgres
16:42p_lyes, please "forget" mysql
16:43yogthosnot going to encourage bad practices :P
16:43Anderkentwhat's mysql?
16:43p_lAnderkent: a troll
16:43Anderkent:(
16:43yogthosAnderkent: a recipe for disaster :P
16:43yogthosto be fair it's not that horrible, it's just postgres is better all around and has saner defaults
16:46p_lyogthos: it is that horrible. Or at least was in the most disastrous version, that is, 3.x
16:46p_l(which is still the basis of many tutorials etc.)
16:47yogthoscertain things are best left forgotten :P
16:47p_lyogthos: certain things are best remembered unless you get yourself pondering about using certain shit :P
16:48yogthosp_l: point :)
16:48p_llike the fact that MySQL team considered "foreign key constraint" to be "dumb something for ODBC apps to draw connections between tables"
16:48yogthosp_l: lol for real? this I have not heard of
16:49yogthosp_l: foreign keys it's just a fad, it'll pass :P
16:49p_lyogthos: it was in MySQL 3.23 docs, afaikl
16:49p_l*afaik
16:49yogthoswhich part of relational in rdbms is not clear exactly
17:07ziltiyogthos: I toss h2-database into the game, it has some nice features, is pure-java and supports full-text search
17:08jkkramer+1 for H2
17:08jkkramerhad a pleasant experience with H2 when I used it once. I think datomic uses it too
17:10yogthoszilti: noted :)
17:10technomancydoes it roll its own search or integrate with lucene?
17:10ziltitechnomancy: both options are available
17:11technomancyhard to imagine they could do better than lucene =)
17:12ziltiBut the fulltext search documentation of h2 sucks enormously. Or the features are really as limited as the insight in the tutorial. At least it's enough info to get it working.
17:12mabes_I have a lazy-seqs of lazy-seqs (coming from repeatedly), what is the best way to concat them into a single lazy-seq? The lazy-cat macro doesn't seem to be the solution since I need to pass each lazy-seq in.
17:13jkkramer(apply concat …)
17:14mabes_jkkramer: apply would force the realization of the lazy-seq wouldn't it?
17:14ziltiThe builtin fulltext implementation is somehow funny. It creates a table where every word it has found (it only checks for spaces) is in and a join table to your table. And when you search for a word it pretty much does a "SELECT FROM indextable WHERE word = queryword" :)
17:14technomancymabes_: concat is lazy
17:15jkkramer,(first (apply concat [(range) (range)]))
17:15jkkramer&(first (apply concat [(range) (range)]))
17:15lazybot⇒ 0
17:16S11001001moreover, apply doesn't force the seq used as restargs beyond...some point I'm not clear on.
17:17S11001001,(ffirst (apply concat (repeat (repeat 42))))
17:17S11001001&(ffirst (apply concat (repeat (repeat 42))))
17:17lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
17:18S11001001&(ffirst (apply concat (repeat [(repeat [42])])))
17:18lazybot⇒ [42]
17:18S11001001ww
17:18technomancyanyone have strong opinions about emacs faces? https://github.com/technomancy/clojure-mode/pull/113
17:19S11001001technomancy: I agree provided that the consequences of redefining core library functions/macros are undefined
17:20S11001001which puts the lie to the "you can optimize if-not in ways you can't optimize if (not ...)" that I've seen
17:21technomancyS11001001: eh? not sure I follow.
17:21technomancythis is about highlighting
17:21S11001001technomancy: if the consequences of redefining core functions are defined, they aren't "built in" and so shouldn't be highlighted suchly
17:21ziltitechnomancy: I find it a bit weird that they want font-lock-keyword-face for the real builtins and font-lock-builtin-face for non-builtin stuff?
17:21technomancyS11001001: it wouldn't be able to distinguish between redefinition of a core var vs just pulling in another var of the same name using :refer-clojure/:exclude
17:22S11001001technomancy: that's fair
17:22S11001001you can see I'm more concerned with this other thing than the highlighting though
17:23S11001001next up I'll be advocating for the elimination of loop*; I'll be here all week
17:23technomancyheh
17:23technomancyzilti: yeah, I don't really follow. I think "keyword" means something different here?
17:24technomancybut consistency with other modes is probably good
17:25ziltitechnomancy: I assume "keyword" as in "language keyword". Sure, if it's the standard, use it.
17:25technomancy"keyword" as in "my language doesn't expose its means of abstraction to the user" =)
17:26S11001001&(let [fn* list] (fn* [] 42))
17:26lazybot⇒ #<sandbox7657$eval11702$fn__11703 sandbox7657$eval11702$fn__11703@72bcaa>
17:26ziltiS11001001: What are those "loop*", "let*" and stuff anyway? Are they any different from let and loop?
17:26S11001001&(let [fn list] (fn [] 42))
17:26lazybot⇒ #<sandbox7657$eval11724$fn__11725 sandbox7657$eval11724$fn__11725@dde202>
17:27S11001001ptthhhh
17:27S11001001zilti: yeah, go look at the source of loop and let to understand
17:28Anderkentzilti: they're special symbols that the compiler looks for and then treats magically
17:28Anderkentzilti: while loop and let are macroes that do some work then expand to these special symbols
17:29ziltiAnderkent: Ok
17:30bbloommore importantly: they are implementation details
17:30bbloomthe *documented* specials are loop and let
17:30bbloombut in the current implementation, they are macros that expand to loop* and let*
17:31Anderkentbbloom: it was recently shown to me that it's not quite that simple:
17:31Anderkent,(let [loop inc] (loop 1))
17:31Anderkent,(let [do inc] (do 1))
17:31Anderkentuh, dead bot
17:31Anderkent&(let [loop inc] (loop 1))
17:31lazybotjava.lang.IllegalArgumentException: loop requires a vector for its binding in clojure.core:1
17:31Anderkentah! works for me in local repl
17:31Anderkentthink clojail makes it not work
17:32Anderkentwell, anyway, macroes can be shadowed but special symbols can't
17:32bbloomAnderkent: i think that's also an implementation flaw
17:32bbloomspecials are not namespaced, but should be
17:33bbloomand the lookup table for specials is in the compiler, but doesn't necessarily have to be
17:33bbloomthere could, in theory, be metadata like isMacro on the vars: isSpecial
17:34Anderkentyeah, I suppose. Still that's how it currently works so sometimes you need to be aware whether someting is actually a macro or a special
17:34bbloomtrue
17:34S11001001bbloom: No, it's quite good that it's in the compiler.
17:35bbloomS11001001: why?
17:35S11001001It gives the compiler an invariant "there are only these evaluation strategies and no more".
17:35bbloomi think that's a short coming, when you start considering multiple backends...
17:36S11001001And any tool can also rely on that invariant.
17:36S11001001Because all other evaluation strategies must be implemented in terms of transforms to those built-in evaluation strategies.
17:36S11001001Multiple backends is codegen, this is a question of the language.
17:37bbloomcs.au.dk/~hosc/local/LaSC-1-1-pp53-75.pdf
17:37bbloommacros are one type of expander
17:37bbloomyou can further generalize: a fn is a lambda abstraction of value -> value
17:37bblooma macro is of form -> form
17:37S11001001I know you can do more. But doing more there means you can do less elsewhere.
17:37bbloomand a special is of form -> target code
17:38S11001001Because specials aren't *just* -> target code to us
17:38bbloomyes, if you allow arbitrary expanders, then tools can't inspect into those
17:38bbloombut if you require expanders be named and enumerated, ie store them in a map
17:38bbloomthen you can write tools that operate on a closed set of expanders
17:39bbloomand then for those of us who *do* care about other backends, we can write those :-P
17:42bbloomon a related topic, i've been spending a lot of time thinking about how to create declarative systems
17:42bbloom*extensible* ones, that is
17:42bbloomI think angular.js' Directives are a good model to be inspired by http://docs.angularjs.org/guide/directive
17:51UberNerdGirlhi…. anyone know if there is there a multi-user interactive Clojure interpreter in a browser?
17:51UberNerdGirlsomething that mixes a paste bin w/ an interpreter and aids in remote teaching?
17:52UberNerdGirl(that's precisely what ghclive does for Haskell, but I seek one for Clojure)
17:52S11001001bbloom: I think your special form extension interface would necessarily be unstable from release to release, unless you wanted to freeze the compiler.
17:52technomancyUberNerdGirl: tryclj.com isn't multi-user, but it exposes a sandboxed clojure compiler
17:53bbloomS11001001: wouldn't it be AST -> target-vm ?
17:53technomancyclojure doesn't have an interpreter
17:53UberNerdGirli thought tryclj.com was a tutorial like tryruby?
17:53UberNerdGirl?
17:53bbloomUberNerdGirl: interpreter != interactive
17:53S11001001bbloom: In this expression, where do' is a special form that just does what do does, (let [x ...] (do' (f x)) (do' (f x))), the do's should generate different code.
17:54ToxicFrogI wonder if you could do it with multiple people screen(1)d into a clojure REPL
17:54ToxicFrogI've never used screen's sharing features, though
17:54S11001001bbloom: And that's setting aside whether the first do' should emit any code at all, which a compiler can figure out only with the context.
17:54ziltiOr open a temporary IRC channel with a clojure bot
17:54technomancyToxicFrog: it's easier with tmux than screen, but it's definitely possible
17:54technomancywe do it every month at seajure
17:55yogthosUberNerdGirl: have you checked out 4clojure.com ?
17:55UberNerdGirlyogthos: yea i went through several of those a months back
17:56technomancythe easiest way to share a session with someone is over SSH and tmux
17:56bbloomS11001001: of course. hence you need to pass the environment as an argument... which is precisely what happens now with macros. see &env in clojurescript
17:56technomancya multi-user tryclj would be cool, but it doesn't exist yet
17:56S11001001bbloom: There isn't enough information there.
17:56technomancymaybe you could trick Raynes into writing it
17:56S11001001bbloom: the necessary piece of information is whether x will be used *later*
17:56darius2might not be too hard to fork ghclive
17:56yogthosUberNerdGirl: I found it was pretty helpful, especially seeing how others solve things
17:56UberNerdGirltechnomancy: yeah, i'm familiar w/ setting that up in a Debian environment but not Red Hat (my friend's server)
17:57darius2the collab-editor stuff is largely in javascript
17:57bbloomS11001001: you can promote that transformation to a parent node in the AST
17:57bbloomS11001001: however, more robustly, you'd transform to an intermediate representation
17:57bbloomand then iteratively operate on that representation
17:57bbloomie compiler passes
17:58technomancythis kind of thing would be so much easier if it weren't for NAT
17:58S11001001How can you do a compiler pass on the inner forms of a special form invocation?
17:58bbloomS11001001: the same way the compiler does....
17:58technomancyNAT: destroying the Internet since time immemorial
17:58S11001001bbloom: The compiler can do it if it knows what the special forms do.
17:59S11001001bbloom: It can lambda lift all day if it knows just what lexical bits to pull along.
17:59bbloomi'm confused by what you're arguing against/for...
17:59UberNerdGirlinteresting
17:59UberNerdGirlsounds like a good project to write one day. multi-user clojure repl
17:59S11001001That allowing arbitrary special forms would require instability in such extension interface from release to release, or crippling the compiler.
17:59UberNerdGirlalright thanks anywayzzzz
18:00yogthostechnomancy: does nrepl allow multiple connections?
18:00technomancyyogthos: sure, but that's not the difficult part
18:00yogthosI guess actually seeing what's in the buffer would be handy too :P
18:01bbloomS11001001: *shrug* i'm not understanding your position, but i suspect it's not going to get conveyed with any fidelity via irc
18:01S11001001The compiler can't lift lambdas in do' unless do' tells it how.
18:01S11001001The compiler can't pick out the last reference to x and assign it a locals-clearing unless do' tells it where its x references are.
18:02yogthostechnomancy: I thought emacs had a shared network buffer mode no?
18:02technomancyyogthos: yeah, but it's not as good as tmux
18:02technomancyenabling it on a per-buffer basis is actually really annoying in practice
18:02technomancyyou typically want to share your whole Emacs instance
18:02ziltiyogthos: There also seems to be a multi-user nrepl emacs client.
18:03technomancy(unless you don't trust the other user)
18:03technomancythough in that case you can't run clojure code either
18:03yogthosyup
18:04UberNerdGirlzilti: interesting, what is that you speak of?
18:04technomancywhat I want is a third-party proxy server that I can add someone's pubkey to and use to allow SSH connections to a guest account on my machine
18:05technomancyto route around the brain-damage of NAT
18:05UberNerdGirltechnomancy: i did that on a Debian it was hella fun
18:05UberNerdGirli also installed chat
18:05UberNerdGirland screen-sharing. so fun
18:05technomancyactually what I really want is for https://pair.io/ to get fixed
18:05ziltiUberNerdGirl: https://github.com/jamii/concerto/ (from https://github.com/clojure/tools.nrepl/wiki/Extensions)
18:05technomancybecause dayum; that was amazing
18:05UberNerdGirlzilti: jamii is one of my bestest buddies :P
18:06UberNerdGirli'll get on his arse about that
18:06technomancyzilti: whoa; nice
18:06UberNerdGirlhe and I were students at Hacker School, which just ended last week :)
18:06UberNerdGirlzilti: i told him to name it concerto :D
18:07Raynestechnomancy: Trick me into writing what?
18:07technomancyRaynes: multi-player tryclj
18:08RaynesYeah, no.
18:08RaynesI don't want to ever touch jquery-console.
18:08RaynesEver.
18:08RaynesNot that I wouldn't like it, it's just unlikely that I'd ever do it myself.
18:10UberNerdGirlclojurescript :P
18:10devnShould clojure.core/range still be using Double/POSITIVE_INFINITY, or should it be using Long/MAX_VALUE?
18:10bbloomtechnomancy: step 1, trick Raynes into implementing cljs-console
18:10devn,Double/POSITIVE_INFINITY
18:10technomancyit'd be neat if you could just wish software into existence
18:10devn,Long/MAX_VALUE
18:10bbloomtechnomancy: i believe there are people who do that... they are called executivies
18:10devn&Double/POSITIVE_INFINITY
18:10lazybot⇒ Infinity
18:10UberNerdGirllolz
18:10devn&Long/MAX_VALUE
18:10lazybot⇒ 9223372036854775807
18:10technomancybbloom: where can I get me an executive?
18:11bbloomtechnomancy: how much money do you have? i hear they are for sale
18:11bbloom*zing*
18:11technomancynice
18:11ziltiChallenge accepted. https://github.com/mui-nrepl
18:12ivanheh Datomic ORM https://groups.google.com/forum/#!topic/datomic/8yLTATMjUrM
18:12technomancyit's really surprising how often that works
18:12zilti*https://github.com/munrepl
18:12devn"ginandtomic"
18:15devnAnyone know anything about numerics? I'm wondering why clojure.core/range uses Double/POSITIVE_INFINITY when called like (range) instead of Long/MAX_VALUE
18:16bbloom&(range 2 4 0.5)
18:16lazybot⇒ (2 2.5 3.0 3.5)
18:16bbloomdevn: i presume that's why
18:16devnoh, duh
18:17devnerr bbloom -- hm
18:17bbloomalso fun:
18:17devnthat wouldn't make sense bbloom i dont think
18:17bbloom&(range 2 4 1/2)
18:17lazybot⇒ (2 5/2 3N 7/2)
18:17bbloomwhy wouldn't it?
18:18devnbbloom: because Double/POSITIVE_INFINITY is only used in the case of calling range like (range)
18:18bbloomoh dur yes
18:18bbloomum
18:18devnthat should be Long/MAX_VALUE, no?
18:18AimHere&(range 4000000000 15000000000 4000000000)
18:18lazybot⇒ (4000000000 8000000000 12000000000)
18:18AimHereWhy restrict yourself to MAX_VALUE?
18:18S11001001devn: probably because it used to work and since it was "fixed" in 1.3 it doesn't.
18:18bbloomum no b/c it's exclusive
18:18bbloomyou want MAX_VALUE + 1
18:18bbloomwhich you can't represent
18:18ivan&(range (dec Long/MAX_VALUE) (inc Long/MAX_VALUE))
18:18lazybotjava.lang.ArithmeticException: integer overflow
18:18devnthanks
18:19devnthat makes sense
18:19S11001001like so.
18:19AimHere&Long/MAX_VALUE
18:19lazybot⇒ 9223372036854775807
18:19devnwhy does Long not have a POSITIVE_INFINITY?
18:19AimHereI still think in 32-bit, it seems
18:19S11001001no now the stream'll just crash if it's longs eventually. Hopefully you never get there
18:19bbloomdevn: because there is no representation of infinity in two's complement integers at the machine level on all common CPUs
18:19bbloomand hence the JVM doesn't provide such a representation
18:20devnmuch appreciated
18:20devnthanks guys
18:20S11001001hence always write (iterate +' 0) instead of (range) :)
18:20devnthat makes me curious about clojurescript's range -- i think we ended up using MAX_VALUE in there.
18:21devnI assume there's no equivalent to Double/POSITIVE_INFINITY in that world?
18:21S11001001devn: I thought it was the other way 'round.
18:21bbloomjavascript doesn't really support integer types, only doubles
18:21squidzwhats the easiest way to give (partial ... ) the second argument instead of the first?
18:21bbloomjavascript's numbers are defined as ieee doubles
18:21bbloom(i think)
18:22ivanyes
18:22bbloomor maybe it's like a 60 bit version or something, i forget exactly
18:22devnjs numerics are weird
18:22technomancyit's a truncated version
18:22S11001001MAX_VALUE is 1.79E+308
18:22bbloomtechnomancy: yeah, thought so
18:22devn([] (range 0 js/Number.MAX_VALUE 1))
18:22devn^-clojurescript's range
18:22tpope1/0.0 is positive infinity in javascript
18:22bbloomdevn: that's probably a bug
18:23devnbbloom: i wrote it! :X
18:23bbloomthat will result in the range ending, when you should expect an overflow
18:23bbloombut you won't get an overflow in JS anyway
18:23bbloomso it probably doesn't matter :-P
18:23S11001001it'll just spin there once you can't +1 anymore, right?
18:23tpopeyeah
18:23S11001001which won't even be max value
18:23bbloompersonally, i think we should define clojure.core/infinity and clojure.core/-infinity
18:23devnbbloom: so it should be js/Double.POSITIVE_INFINITY ??
18:23lazybotdevn: Definitely not.
18:24technomancyS11001001: wait what?
18:24tpopewith floats, at some point x + 1 == x
18:24S11001001technomancy: as tpope says
18:24tpopebecause they...float
18:24technomancyoh yeah, heh
18:24tpopein precision
18:24technomancyyou just gradually lose accuracy
18:24devn"Everything floats down here..."
18:24bbloomhahaha oh right
18:24technomancyhilarious
18:24S11001001I love it, fixed-point of inc
18:25bbloomyou'd get an infinite range! it would just tend towards a zero step size
18:25bbloomhaha
18:25devnbahaha
18:25technomancyZeno's numerics
18:25bbloomfuck i hate javascript's semantics
18:25devnbbloom: should I make a bug for that in Jira?
18:25bbloomdevn: well, probalby doesn't matter, given the above discussion
18:25pppppppaulAnyone can recommend a more complete set lib for Clojure than what is in core?
18:25bbloomif you can produce a test case that fails & using infinity fixes it, then by all means
18:26ivanhttp://bclary.com/2004/11/07/#a-8.5 I am confused, what makes it truncated? the 2^53 thing?
18:26devnbbloom: probably not, but why *not* use Double.POSITIVE_INFINITY to match Clojure?
18:26S11001001pppppppaul: aside from the extra fns in clojure.set you mean?
18:26bbloomdevn: b/c matching clojure's implementation details isn't a priority
18:26S11001001pppppppaul: what ops are you looking for?
18:26bbloomhowever, platform independency is a stretch goal, hence my suggestion for clojure.core/infinity
18:27devnbbloom: it used to be, no?
18:27pppppppaulIn verse projection
18:27bbloomdevn: matching behavior is a priority
18:27bbloomdevn: matching implementation isn't
18:27devnbbloom: fair enough!
18:27bbloomivan: http://en.wikipedia.org/wiki/Double-precision_floating-point_format
18:28S11001001pppppppaul: that's apply dissoc
18:28pppppppaulOh
18:29bbloomivan: hmmm you may be right & technomancy and i may be wrong
18:29S11001001pppppppaul: map, blah blah :)
18:30Raynesbbloom: I'd be surprised if you could convince me to do much of anything with cljs. :p
18:35pppppppaulHow do I deal with cyclic deps in Clojure?
18:35bbloompppppppaul: step 1: avoid making them, they are a serious code smell
18:35bbloompppppppaul: step 2: it depends on the particular type of cyclic dep you have, so you need to provide more info
18:35pppppppaul./code smells
18:36RaynesThe answer to cyclic deps is to not have them.
18:36pppppppaulIt's been easy for me to avoid them so far
18:36pppppppaulJust wondering
18:37bbloompppppppaul: you basically need to explicitly decide which dependency is "primary" and then break the other one. then you can use a mutable cell to install the link at the end
18:38bbloomit's ugly, but sometimes it happens with extensible systems
18:38bbloombut in that case, the extensible module *really doesn't know* about the client
18:38bbloomjust pretend you're in that situtation
18:38amalloyhuh? why do you need a mutable cell at all?
18:39bbloomamalloy: you really don't, you just need some identity where the value can change
18:39bbloomie how you make a graph with cycles using immutible data structures
18:40amalloyyou don't need that either. for cyclic dependencies or for a graph with cycles. in both cases, you can do it by adding a layer of indirection
18:40bbloomyeah, that's what i'm failing to say
18:40pppppppaulLike a cake
18:42hyPiRionCyclic deps? Like, say, a set containing itself?
18:43hyPiRionOr two sets A and B, both containing the other?
18:43pppppppaulYes
18:50hyPiRionYeah, a bit hard, if not impossible, that thing.
18:50hyPiRionAt least without indirection
18:52pppppppaul(sad-face)
18:52ahihi2such sets do not exist in ZFC!
18:53pppppppaulOh
18:53pppppppaulZfc?
18:54bbloomZermelo-Fraenkel Set Theory
18:54pppppppaulHmmmm
18:54bbloomif you've never accidentally fallen down the wikipedia set theory hole, it's worth 4ish days of not showering :-P
18:54pppppppaulSweet
18:54ahihi2I suggest reading Enderton's Elements Of Set Theory instead
18:55pppppppaulI will start not showering right now
19:05bawrbbloom: arrgh, not the ZFC discussion again
19:06bawrlast time it happened, I lost a week of my life
19:06bbloomshall we advance to the category theory discussion?
19:06bawrwoke up with in vegas
19:06technomancywake up face down in a gutter in reno with no recollection of the days gone by but a deeper knowledge and appreciation of set theory?
19:06bawrat a math conference
19:06bawrdrunk in a ditcj
19:06technomancydang beat me to it
19:06bawrxD
19:07bawrI approve of the way you're thinking, technomancy.
19:07AimHereYou might want to count your kidneys
19:07bawrEh, everybody knows the kidney thing is an urban legend.
19:07bawr(It's lungs they're after.)
19:08technomancy"stuff like that is so difficult to orchestrate since the 70s" http://achewood.com/index.php?date=09132004
19:09AimHereYou complain about websites sending you on 4 day binge blackouts, then link to early-period achewood!
19:09bbloomAimHere: I have π/2 kidneys!
19:09bbloomdamn mathematicians.
19:10bbloom(that joke was delayed while i flailed around figuring out how to type π before googling for a character to copy paste)
19:11bawrUppercase π is so pedestrian. </math-hipsterism>
19:11bawrxD
19:12hyPiRionHah, I have π on my keyboard.
19:12hyPiRionAnd lots of other useless things
19:13bawrSpace Cadet keyboards for everyone!
19:13bawrBring back APL, I say.
19:13bawr;)
19:20ppppaulI have a macro that starts out with a deftest call. How do I make it not expand to 'namespace/deftest'
19:22ivanjudging by how many times I've seen ~'thing, probably that
19:24hyPiRioncallen: Have you read On Lisp?
19:25hyPiRionppppaul: ##[`(+ 1 2) :vs `(~'+ 1 2)]
19:25lazybot⇒ [(clojure.core/+ 1 2) :vs (+ 1 2)]
19:25ppppauloh, I just figured it out. Need to call the namespace-qualified deftest, and things are fine.
19:25callenhyPiRion: I've poked around, when I said "for sane people" I was mentally contrasting Let Over Lambda
19:26callenwhich is decidedly not exclusively about macros, but you get my meaning.
19:27hyPiRionI've not read LOL, but yeah, I've heard about it.
19:28callenhyPiRion: author snorts parentheses and rails lambdas directly into his veins.
19:29hyPiRionheh
19:29SirSkidmoreHow does conj actually work on a map
19:29Bronsa,(conj {} [:a 1])
19:29Bronsa&(conj {} [:a 1])
19:30lazybot⇒ {:a 1}
19:30hyPiRion&,'nowadays
19:30lazybot⇒ nowadays
19:30hyPiRionWhere did clojurebot go by the way?
19:30Bronsa&(conj {} {:a 1 :b 2})
19:30lazybot⇒ {:b 2, :a 1}
19:30SirSkidmoreI should rephrase, sorry.
19:30Bronsahmh
19:31SirSkidmore(I'm on my cell phone)
19:31callenSirSkidmore: that's unfortunate. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L75
19:32ivanwriting Clojure on your phone? ;)
19:32SirSkidmore&(conj {:a 5 :b 6} [:c 7])
19:32lazybot⇒ {:c 7, :a 5, :b 6}
19:32Bronsasomebody knows the rationale of conj acceptina a map as it's argoument when conjoining int maps?
19:32Bronsaaccepting*
19:32Bronsaits*
19:32Bronsaderp
19:32technomancyBronsa: it's inconsistent and weird
19:32Bronsatechnomancy: yeah
19:33SirSkidmoreI get that. But when I put that same map in a var 'm'
19:33BronsaSirSkidmore: when conjoining in a map, you have to make sure your second argument is a 2 element _vector_
19:33Bronsawon't work with seqs
19:33SirSkidmoreAnd conj the same value. It returns {:a 5, :c 7, :b 6}
19:33Bronsanot sure if that's your case though
19:34BronsaSirSkidmore: hashmaps are not ordered
19:34SirSkidmoreOh. Why does it conj differently then?
19:34Bronsaheh i know why
19:35Bronsait's not a bug
19:35Bronsabut I'm pretty sure it shouldn't behave like that
19:35hyPiRion$source conj
19:35lazybotconj is http://is.gd/oWilE0
19:35Bronsaso, when the clojure compiler reads a map literal, if it contanins < 16 elements, it uses a PersistentArrayMap
19:35Bronsaotherwise a PersistentHashMap
19:35Bronsa&(array-map :a 1 :b 2 :c 3)
19:35lazybot⇒ {:a 1, :b 2, :c 3}
19:35Bronsa&(hash-map :a 1 :b 2 :c 3)
19:35lazybot⇒ {:a 1, :c 3, :b 2}
19:36Bronsathe problem there is that, when def'ing the hashmap, the compiler ALWAYS uses a hashmap if it's not an empty map literal
19:37Bronsai got a patch in jira to fix that, but it got rejected i because the testcases i was showing were not reproduceable
19:37SirSkidmoreOhh okay. That makes sense. Thank you
19:37SirSkidmoreI appreciate it
19:38Bronsalet me see if i remember where the problem is in the clojure compiler
19:39SirSkidmoreWell I need to save some battery life.. I was just reading on my Kindle
19:39SirSkidmoreThanks Bronsa
19:39hyPiRionBronsa: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L39-44
19:39Bronsanvm
19:40Bronsayeah, that doesn't make too much sense to me anyway
19:40hyPiRion&(conj {:a 1} (seq {:b 2, :a 3}))
19:40lazybot⇒ {:b 2, :a 3}
19:40hyPiRion&(conj {:a 1} (vec (seq {:b 2, :a 3})))
19:40lazybot⇒ {[:a 3] [:b 2], :a 1}
19:41Bronsayou're never going to convince me that that makes sense.
19:42hyPiRion&((juxt merge conj) {:a 1} {:b 2} {:a 3, :c 5})
19:42lazybot⇒ [{:c 5, :b 2, :a 3} {:c 5, :b 2, :a 3}]
19:42hyPiRionOh well.
19:44S11001001&',42
19:44lazybot⇒ 42
19:44S11001001&'',42
19:44lazybot⇒ (quote 42)
19:44S11001001doh
19:44Bronsaoh here it is
19:44Bronsahttps://github.com/Bronsa/clojure/commit/28ca956d9e59e23c502b30b9a766236dba64b50f
19:44S11001001&'~42
19:44lazybot⇒ (clojure.core/unquote 42)
19:45Bronsamaybe.
19:45Bronsaoh no, it had'nt been rejected
19:45Bronsahttp://dev.clojure.org/jira/browse/CLJ-944 it's still there
19:46callenyogthos: planet clojure follows you. damn dude.
19:46ivanthere's some hope, you included the mandatory tab/space mixup ;)
19:47yogthoscallen: yeah Alex emailed me a while back and asked for my rss feed :)
19:47Bronsaivan: the second patch doesn't include it
19:47callenyogthos: me likey extensions.
19:47ivanI think Clojure core uses whitespace mixups as a blame tool
19:47yogthoscallen: lol at that point I didn't actually have rss ended up making this for it https://github.com/yogthos/clj-rss
19:47yogthoscallen: good to hear
19:48callenyogthos: I'm starting clojurewiki btw.
19:48yogthoscallen: it's kind of draft, but seems like it should work overall
19:48callenyogthos: I got tired of people having to use clojuredocs
19:48technomancycallen: wait
19:48technomancydid you see my message earlier?
19:48yogthoscallen: nice! more docs is good, not using clojuredocs also good :P
19:48callentechnomancy: no
19:48technomancyclojuredocs has a rest API in Clojure
19:48technomancyjust no frontend yet
19:48callentechnomancy: but does your thing have a wiki?
19:49technomancythe cd-client thing included in lein repl uses it
19:49callentechnomancy: if not, I can leave the docs to your thing, but I still need a wiki ala EmacsWiki.
19:49yogthosclojure-doc is kind of going in that direction too btw
19:49callenyogthos: it's CWZ though, so their whole stack/situation is weird.
19:50technomancythe only reason EmacsWiki works is that there was a huge vacuum in which there weren't any places to put emacs-related tidbits
19:50callennothing wrong with it, much love for them.
19:50yogthoscallen: what's the deal with that totally not in the loop :)
19:50technomancy(also because kensanata is a machine)
19:50technomancyclojure has the opposite problem; these "I know, I'll gather all the informations" sites spring up every other week
19:50callenyogthos: so clojure-doc is run by the ClojureWerkz people (Timbre, etc)
19:50yogthosI think the idea behind clojuredocs is really good, the api + examples really works
19:50callenyogthos: they're like uh, a special forces strike group of people obsessed with batteries included and idioms
19:51yogthoscallen: that doesn't sound too bad :P
19:51callenyogthos: it's not bad, clojure-doc is great
19:51technomancyclojure-doc is like a wiki, you just have to use pull requests to submit stuff
19:51technomancythe turnaround time is really pretty impressive
19:51callenyogthos: it's just that their process for it is a little weird. It's a meritocratic deal though, if something inspires you, write a pull request.
19:51yogthosyeah I added an eclipse tutorial there, then got lazy lol
19:51callentechnomancy: there's nothing that covers praxis or practicum.
19:52yogthosit's very active though, I get notifications on git activity like once an hour about it :)
19:52callentechnomancy: too many questions get asked and answered on here regarding 'why' or what's idiomatic, they get answered and the knowledge is lost to the aether.
19:52callentechnomancy: you may be fine with because you're already adept at Clojure, I don't think it's fair to the noobies though.
19:52callenwith that*
19:52yogthoscallen: yeah a lot of basics could be captured better in my opinion
19:52technomancyI think you're underestimating the effort something like that would take
19:52bbloomtechnomancy: i wish github's wikis weren't in a separate repository... i like my documentation in the code base and readable from vim
19:53callenyogthos: well not just bare-bones examples of an API function, but "do do this, don't do that, here's why..."
19:53technomancybbloom: I like just checking a doc/ dir full of .md files in
19:53bbloomit would be so nice to have a wiki that makes the clojure/doc/ folder fill up
19:53bbloomtechnomancy: yeah, i agree completely
19:53technomancyit's basically a wiki
19:53callensandbar vs. friend, any opinions?
19:53bbloomtechnomancy: basically, but it misses on critical feature:
19:53yogthoscallen: yeah that's useful too, I think you kind of go through stages, first you need bigger examples and to see idiomatic code
19:53bbloombeing a "wiki"
19:53callenyogthos: yes.
19:53bbloomthe fact that something is a "wiki" is a feature b/c it means people are less scared to change it
19:54yogthoscallen: and then you get to the point where you kind of know your way around and you just need an easy way to find functions and examples of using them
19:54bbloomif there was some magic web ui wiki thing that let you contribute an edit, people would do it
19:54technomancybbloom: github has a fork+edit button, doesn't it?
19:54technomancyfor arbitrtary files in the repo
19:54bbloomyes, i was just about to mention that
19:54bbloomfork&edit is a huge improvement
19:54callenyogthos: in particular for the concurrency and macro stuff it would be nice also to have all the potential pitfalls collected in one place.
19:54bbloombut i wish there was an an edit without fork, if that makes any sense
19:54yogthoscallen: it took me a long time to grok macros :)
19:54bbloomtechnomancy: it's totally a trivial, semantic detail, but this stuff counts
19:55yogthoscallen: the main issue wasn't understanding how they work, but finding legit uses for them :)
19:55technomancybbloom: yeah, but allowing that in your mainline repo would be awful
19:55bbloomtechnomancy: recall the JIRA bitching :-)
19:55yogthoscallen: it's one of those things that just has to click eventually
19:55bbloomtechnomancy: i'm not saying edit without a PR
19:55bbloomi'm saying, PR with a patch instead of with a fork
19:55callenyogthos: in general I only when macros when I want to suspend evaluation of something until I'm done reformulating the final result.
19:55technomancyoh, gotcha. sure.
19:55bbloomit has to *feel* light weight
19:55callenyogthos: I don't think of them in terms of syntax, unlike most guides I've seen.
19:55bbloomeven if it's not, or even if it already is, but doesn't feel like it
19:56technomancyI always edit wikis with a local clone anyway
19:56bbloomtechnomancy: totally
19:56technomancyso forking doesn't seem like much of a difference on top of that
19:56bbloombut we're weirdos.
19:56technomancybut I can't speak for other workflows
19:56bbloomnot so long ago, i'd see spelling errors in a README.md and just ignore them
19:56yogthoscallen: I find I think of them in terms of templating, like if I have code repeating over and over it's a sign for a macro :)
19:56bbloomb/c even with the fork and edit button, it felt intrusive
19:57bbloomnow, i just don't give a shit and do the fork & edit, but it required a concious thought: "fork & edit isn't heavy weight, just do it"
19:57callenyogthos: that's a good way to think about it.
19:57bbloomit's the whole free vs a penny thing
19:57callenyogthos: that's how I used to think about it, but I've gotten even more conservative about it.
19:57bbloomright now, contributing to documentation feels like it costs several pennies of my time
19:57technomancybbloom: reminds me I want to make a bot that opens pull requests that replace (C) with ©
19:57technomancyhmm; seajure is coming up next week....
19:57bbloomtechnomancy: heh, that would be awesome
19:57devnmake one that does kibit replacements
19:57bbloomtechnomancy: dammit, if i'm in irc before seajure, remind me
19:57yogthoscallen: I find you don't want to be afraid of using them, but it's good to keep them short and focused
19:58technomancydevn: not till kibit #2 is fixed; ugh
19:58bbloomtechnomancy: i'm likely to forget, considering i'm like meeting free :-P
19:58devnthere's a kibit 2?
19:58technomancybbloom: will do =)
19:58yogthoscallen: also kind of have to weigh whether it's really a repeating pattern or not
19:58technomancydevn: https://github.com/jonase/kibit/issues/2
19:58technomancyooooh slamhound bot
19:58yogthoscallen: you can use same heuristic as for refactoring stuff, if I do it once or twice it's ok, if I notice myself doing it a lot then it's time to refactor :)
19:59yogthoscallen: and most of the time you can refactor with a function, but if that doesn't work I up it to a macro
19:59technomancyI got a pull request from a whitespace cleanup bot once
19:59technomancyit were a blast
19:59BronsaI'm the only one who thinks that the ::foo/bar syntax is not really a good idea?
20:00technomancyhttp://achewood.com/index.php?date=08162002
20:01pppppppaulWhat does that syntax mean? I I'm using it in slingshot
20:02technomancyare people using clojure-test-mode with nrepl successfully?
20:02technomancyISTR a few lingering issues
20:02bbloomBronsa: yeah, i've been burned by :: a few times
20:02bbloomBronsa: just stopped using it and started using explicit namespaces
20:03callenanybody have any opinions as far as sandbar vs. friend?
20:03callenyogthos: ? ^^
20:03devntechnomancy: i think i followed the directions on the slamhound repo correctly, but it doesn't seen slamhound as a task
20:03yogthoscallen: friend seems to be a bit more popular I think?
20:03technomancycallen: friend is from cemerick, a trusted household name in Clojure Library providers.
20:03technomancydevn: an alias in your user profile?
20:04bbloomBronsa: ::keywords are only really useful for private sentinel values, but i think a gensym are probably better for that
20:04callenI was hoping for specifics, but okay.
20:04technomancycallen: I don't think sandbar is actively maintained either.
20:04bbloom(def sentinel (gensym))
20:04devnin ~/.lein/profiles.clj => {:user {:dependencies [slamhound "1.3.0"]} {:aliases {"slamhound" ["run" "-m" "slam.hound"]}}}
20:04technomancybbloom: eh?
20:04devntechnomancy: ^
20:04Bronsait's like one of the few places (if not the only) where the clojure reader needs to talk to the runtime
20:04technomancybbloom: it's not nearly as readable when looking at the data
20:05callenyogthos: technomancy: works for me, thanks!
20:05technomancybbloom: and you have to at least defonce it
20:05bbloomtechnomancy: yeah, so use a qualified keyword
20:05bbloomtechnomancy: you're right, hence i don't ever really do that :-P
20:05devntechnomancy: err: [[slamhound "1.3.0"]]
20:05dnolenbbloom: that's not re: ns'ed keywords
20:05dnolennot true
20:06technomancydevn: do other aliases work?
20:06bbloomdnolen: i was referring to the ::keyword syntax with the automatic namespace
20:06bbloomdnolen: not namespaced keywords in general
20:06devntechnomancy: i don't have any others
20:07dnolenbbloom: oh right, I've been burned by :: as well, but still useful I think.
20:07bbloomdnolen: i don't think it's useful enough to justify the complication to the reader
20:07technomancydevn: try adding a few? maybe one that maps to a string and one that maps to a vector?
20:07devntechnomancy: here's my full current profiles.clj
20:07devnhttps://gist.github.com/4403577
20:07bbloomdnolen: it's useful at a level for which *a lot* of other clojure feature proposals were, rightfully, rejected
20:08dnolenbbloom: given the ubiquity of maps, I'm not sure I agree
20:08dnolenkeyword will clobber otherwise.
20:08bbloomdnolen: just use explicit namespaces
20:08technomancydevn: you defined an :aliases profile =)
20:08bbloomotherwise you can't copy paste your maps, which is where you get burnt
20:09dnolenbbloom: I'm sorry I don't think anyone will want to write :clojure.core.logic.nominal/foo
20:09dnolenever
20:09dnolenanybody doing serious work with maps will want a shorthand
20:09bbloomdnolen: it doesn't need to be a real namespace... just use :nominal/foo
20:10bbloomotherwise, they'd *have to* write :clojure.core.logic.nominal/foo if they aren't inside clojure.core.logic.nominal anyway
20:11dnolenbbloom: there's no reason to hide information from anyone - :nominal/foo is just waiting to clobber with another :nominal/foo
20:12squidzcan anybody tell me why I get an exception when applying max on a empty list generated with filter (apply max (filter ..))? When I run it just passing in a plain ol empty list, it doesnt complain though: (apply max ())
20:12bbloomdnolen: if you're worried about that, write out the whole namespace.... you only have the option of the :: shortcut *in the namespace itself*
20:13bbloomBronsa: you got me going, feel free to jump in and get my back here anytime :-)
20:13devntechnomancy: so... how should this look?
20:13Bronsaew, i wasn't even reading
20:13technomancydevn: put :aliases in the :user profile
20:13Bronsawait for me to check the backlog
20:13dnolenbbloom: not sure why I should write the whole namespace why I can take two different packages and alias
20:13dnolenwhen I can.
20:14technomancydevn: reindent and it'll be clear
20:14callenyogthos: http://weavejester.github.com/compojure/compojure.handler.html hokay so.
20:14Bronsa02:00:03 bbloom: dnolen: it doesn't need to be a real namespace... just use :nominal/foo
20:14Bronsawell, that's one thing that bothers me about keywords
20:14dnolenBronsa: certainly we've run into this problem in CLJS as well - but I think the reliance on maps and similar named packages you want ns aliasing.
20:14Bronsathey *are* namespaced
20:14callenyogthos: am I missing something, or is the handler missing a lot?
20:14Bronsabut they needn't the namespace
20:14yogthoscallen: yeah the lib-noir handler adds a lot now :P
20:14Bronsa:foo/bar will work even if the namespace foo doesn't exist
20:15dnolenBronsa: they are not namespaced to the package level which what you want in world of maps from anywhere.
20:15Bronsathat's not the point for any other clojure namespaced construct
20:15yogthoscallen: app-handler and war-handler on the bottom https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/middleware.clj
20:15Bronsabut the :: syntax makes them partecipate in that namespace abstraction
20:15callenyogthos: ah I see it. Why is the namespace noir.util instead of lib-noir?
20:15dnolenBronsa: which is good, because I don't know what *your* keys mean.
20:16yogthoscallen: it was like that when I got there :)
20:16technomancyBronsa: if the namespace had to exist we couldn't hijack it for Leiningen :dependencies declarations =)
20:16bbloomso the main difference between keywords and symbols are that keywords always resolve to themselves and symbols resolve to something different
20:16bbloomi think you could make the case that keywords should resolve to some expanded namespaced version of a keyword
20:16bbloombut that's not how it is currently, and it isn't immediately obvious to me how that would work
20:16bbloomparticular with respect to the reader
20:16callenRaynes: ring ring, bananaphone. noir.middleware.utils -> lib-noir?
20:16technomancynamespaces hold vars
20:16technomancythey don't hold keywords
20:16Bronsawell my point is that ##(namespace :foo/bar) is not a namespace
20:16lazybot⇒ "foo"
20:17Bronsawhere ##(namespace ::clojure.core/foo) is
20:17lazybot⇒ "clojure.core"
20:17dnolenBronsa: but ::foo/bar *is* which is useful, but yes complicates the reader
20:17Bronsaand ##(namespace +) is too
20:17lazybotjava.lang.ClassCastException: clojure.core$_PLUS_ cannot be cast to clojure.lang.Named
20:17Bronsadnolen: I'm not saying it's not useful
20:17devntechnomancy: d'oh! thanks
20:17BronsaI'm saying that in my head it's not entirely consistent
20:17technomancywait, :: workon already-qualified keywords?
20:17Bronsatechnomancy: yeah
20:17technomancythat's ... weird
20:17Bronsa,(alias 'c.c 'clojure.core)
20:17bbloomdnolen: ::foo/bar isn't valid
20:17bbloom::bar is
20:18Bronsa&(alias 'c.c 'clojure.core)
20:18lazybot⇒ nil
20:18bbloom:foo/bar is
20:18bbloom::foo/bar isn't
20:18Bronsa&::c.c/foo
20:18lazybotjava.lang.RuntimeException: Invalid token: ::c.c/foo
20:18dnolenbbloom: it is, if you've aliased a namespace
20:18technomancyok, whew
20:18Bronsahmh?
20:18Bronsawell, in the repl it works, it must be lazybot doing something
20:19Bronsa&(do (alias 'c.c 'clojure.core) ::c.c/foo)
20:19lazybotjava.lang.RuntimeException: Invalid token: ::c.c/foo
20:19Bronsaw/e
20:19bbloomit's not working in my repl....
20:19Bronsauser=> (do (alias 'c.c 'clojure.core) ::c.c/foo)
20:19Bronsa:clojure.core/foo
20:19bbloomi get "Invalid token"
20:19Bronsait is in mine
20:19bbloomjust tried (alias 'core 'clojure.core)
20:19dnolenbbloom: trust me it works, it's worked forever
20:19dnolenlike pre 1.0
20:19bbloomthen just did ::core/inc
20:20Bronsawoah
20:20Bronsaoh, whell
20:20Bronsawell*
20:20Bronsait's not working with the do
20:20bbloomi can't get it to work at all lol
20:21Bronsauser=> (alias 'foo 'clojure.core)
20:21Bronsanil
20:21Bronsauser=> ::foo/+
20:21Bronsa:clojure.core/+
20:21devntechnomancy: that's like...magic
20:21bbloomi get #<RuntimeException java.lang.RuntimeException: Invalid token: ::foo/+>
20:21Bronsaweird
20:21dnolenbbloom: probably lein repl goofiness
20:21technomancydevn: woooo
20:21Bronsait is working in my lein
20:22bbloomlol ok well then let me revise my prior arguments:
20:22Bronsausing lein repl not in a project works fine too
20:22dnolenBronsa: oops, works in both
20:22devntechnomancy: really cool. for a minute there I didn't think it did anything, so I jump to my file and it says it changed on disk, reload, and it's the exact same ns declaration i had a moment prior
20:22devnthanks
20:23bbloomfinally got it to work: doesn't work with a project
20:23bbloomwtf?
20:23Bronsaweird
20:23bbloomtechnomancy: bug report ^^
20:23bbloomheh
20:23technomancybbloom: master or a preview?
20:23bbloomdnolen: thanks, i had no idea that this existed
20:24Bronsayeah bbloom
20:24bbloomtechnomancy: Leiningen 2.0.0-preview10 on Java 1.6.0_37 Java HotSpot(TM) 64-Bit Server VM
20:24technomancyI think some of the repl reader stuff has been fixed recently to be less interpretive
20:24Bronsathat's not working for me either
20:24technomancydon't know if it was after 10 though
20:24Bronsaonly in a project though
20:24bbloomtechnomancy: try (alias 'core 'clojure.core) followed by ::core/+
20:25bbloomdnolen: well in light of this, i revise my opinion on ::
20:25Bronsauser=> ::foo/+
20:25Bronsa#<RuntimeException java.lang.RuntimeException: Invalid token: ::foo/+>
20:25Bronsauser=> 1
20:25Bronsa:clojure.core/+1
20:25Bronsai get this
20:25bbloomit had features i didn't know it had :-P
20:25bbloomin fact, it has the features i was literally proposing to you as an improvement heh
20:25technomancyhah
20:26bbloomdammit that hickey guy knows wtf he is doing
20:26technomancyworks for me
20:26Bronsatechnomancy: beta10 inside a project?
20:26technomancyoh wait, this is nrepl.el
20:26Bronsarunning clojure 1.4
20:27technomancyyeah I get Exception Ambiguous match for "::core/+"
20:28gfrederickswhat is it that depends on thneed again?
20:28bbloomdnolen: thanks, learned something here... actually quite relevant to what i'm working on
20:28gfrederickslein keeps piping up about looking for snapshots
20:28dnolenbbloom: yes I don't know how anyone could sell the idea of working only maps w/o real namespaced keywords
20:29technomancyhttps://github.com/trptcolin/reply/issues/new
20:29technomancyerr: https://github.com/trptcolin/reply/issues/94
20:30Bronsaw/e I still don't like that
20:31bbloomdnolen: i had just never seen a keyword of the form ::foo/bar, only ever ::bar
20:31dnolenBronsa: heh
20:31Bronsa(read-string "foo/bar") works if foo is not defined AND if foo is an alias or a namespace
20:31bbloomhttp://clojure.org/reader says "A keyword that begins with two colons is resolved in the current namespace:"
20:31Bronsai don't see why ::foo/bar requires it to be loaded
20:31bbloomand then provides the example ::rect
20:31bbloombut no other examples :-/
20:32bbloomalso technomancy's stuff is broken, blame him
20:32bbloom:-)
20:32technomancybbloom: nah I never use lein repl
20:32dnolenBronsa: that's a different issue, in my opinion tho I don't know anyone would read ::foo/bar from some random place, it should arrive fully-namespaced.
20:32technomancyI got a vim user to write it for me =)
20:33Bronsadnolen: to be honest, i think it will never be a problem to me or hardly for anybody
20:33Bronsabut it bothers me.
20:33dnolenBronsa: haha, that's Clojure for you.
20:34technomancythinking about cutting a clojure-mode release soon; any issues remaining worth addressing?
20:34bbloomoh shit, *cringe*
20:34bbloomi just did (read-string "::core/+") after making an alias
20:34bbloomit expanded it
20:34BronsaYEAH
20:34Bronsathat's exactly what bothers me
20:34bbloomthat seems *wrong*
20:35Bronsait resolves the namespace at read time
20:35Bronsasymbols resolve it at eval time
20:35Bronsait should throw when trying to eval it
20:35seancorfieldtechnomancy: will that be a clojure-mode that no longer enables slime?
20:35Bronsanot when trying to read it
20:35bbloomworse than that: it's impacted by the dynamic environment of the read caller!
20:35technomancyseancorfield: yeah
20:36bbloomsurely the reader should be parameterized with aliases and that a default empty set of aliases should be used
20:36technomancyseancorfield: I vaguely recall issues with clojure-test-mode and nrepl.el, have you been using that?
20:36Bronsaew
20:36BronsaI'm still using slime
20:37seancorfieldah, just saw the email notifications about #108 and #115 - thanx! no, i don't specifically use clojure-test-mode (i use expectations-mode which already works with nrepl.el)
20:37bbloomBronsa: please make Blind let you read with an explicitly provided set of aliases :-)
20:37technomancyBronsa: slime will still work, you'll just have to copy clojure-jack-in into your own dotfiles
20:38Bronsathat's enough work to do to make me switch to nrepl
20:38technomancymaybe that should become its own lib or something
20:38technomancyheh; or that
20:38pppppppaulCan I get some datomic help?
20:38Bronsabbloom: what do you mean?
20:39pppppppaulTrying to understand cardinality many
20:39seancorfieldBronsa: switch to nrepl - you know you want to :)
20:39pppppppaulWhat would a db/add look like?
20:39bbloomwhen resolving ::foo/bar read-string is looking at (ns-aliases *ns*)
20:39Bronsaseancorfield: i'm don't really want to, I'm actually quite lazy
20:39Bronsaoh, i see bbloom
20:39bbloomBronsa: it would be nice if the underlying implementation looked at some parameter
20:39bbloomor dynamic config var or something
20:39bbloomsuch that i could override it
20:40Bronsayeah, it must be a dynamic var
20:40technomancythe whole "you have to compile the whole ns before you can do anything in nrepl" behaviour reeeeeeeeally sucks
20:40technomancyplus I miss the inspector
20:40technomancybut apart from that it's pretty good
20:40bbloomyeah, and then you have like read-string* with a config, but the default read-string produces a config from *ns* and then calls read-string*
20:40Bronsabbloom: it's quite easy to do, really
20:40Bronsahttps://github.com/Bronsa/blind/blob/master/src/blind/reader.clj#L508-L510
20:40bbloomBronsa: yes, quite easy. hence please do it :-)
20:43dnolensomeone w/ more concurrency chops then me wanna verify my thinking is correct here, http://gist.github.com/4403838
20:43dnolenwhat I care about is whether the swap! is how this should be done.
20:44dnolenit seems to me I do need to test contains? twice right?
20:44bbloomdnolen: yeaah you need to move the contains into the swap
20:45dnolenbbloom: there is contains? there too
20:45technomancy(add-hook 'nrepl-mode-hook (lambda () (setq nrepl-buffer-ns (clojure-find-ns))))
20:45technomancyfixes the lousy default nrepl.el buffer-ns behaviour
20:45bbloomer, i mean more generally: you can't make a decision about a derefed value if you're then going to deref it a second time
20:45bbloomdnolen: the swap is an implicit second deref
20:46dnolenbbloom: but if we deref and we have an entry there's nothing to do
20:46dnolenbbloom: it's only if it's missing that we run into trouble, and thus the second contains check in the fn passed to swap
20:47bbloomdnolen: sorry, im not looking very deeply at your particular use case
20:47bbloomall i'm saying is that if you deref, then conditionally swap, you need to recheck your assumptions inside the swap
20:47bbloomin theory, you can just unconditionally swap, but only conditionally change the value
20:47bbloombut i dunno about the exact impact of that with respect to perf and watcher callbacks, etc
20:47dnolenbbloom: ok, I'm rechecking my assumptions so I think I'm ok.
20:47Bronsabbloom: http://sprunge.us/iRBN?diff is this what you wanted?
20:49dnolenfinally tabled core.logic goals don't need to be reset via hacks
20:49bbloomdnolen: concurrency is hard :-) i've seen a bunch of code that does (when (pred @x) (swap! x ...)) which is just *clearly wrong* b/c they don't recheck inside the swap
20:49bbloomBronsa: looks like it!
20:50bbloomBronsa: i'm working on something that's extremely map and keyword heavy... plus i want to make a few dev tools for it, so i suspect in some months time i'll thank you and dnolen for this :-)
20:50amalloydnolen: your first swap! looks fine. the second one is a little more worrying but i can't quite tell what's going on
20:50Bronsaoh damn
20:50Bronsamy slime-repl
20:50Bronsai just outputted the result of reading core.clj in my repl
20:51dnolenamalloy: ok you're right, I'll fix that one too. Thanks!
20:51amalloyit looks to me like you're doing exactly what bbloom (incorrectly) thought you were doing in the first swap!: checking the whether @table# contains cache# outside of a swap, and then unconditionally modifying it inside the swap!, even if some other thread has beaten you to it
20:52bbloomamalloy: i didn't really read his code. i just jumped to the general principal. forgive me!
20:53Bronsaheh bbloom binding every read slows thing down a bit
20:53bbloomBronsa: blah
20:53Bronsamaybe i should get *alias-map* to be public
20:53amalloyno blame attaches! you gave the right advice in the wrong place
20:53Bronsaso that you bind only once
20:54Bronsait gets from 560ms to read core.clj 10 times to 850
20:55loliveiracan anybody please point me the original post that states that some programmers are 10x faster than others?
20:55seancorfieldnice to see mac os x full screen support in the emacs nightlies... i thought i'd seen mention of a pretest build but 24.2.91 is the latest i found and that doesn't have the full-screen fix
20:55bbloomside note, here's a macro i've used a bunch: (defmacro swapping [sym & body] `(swap! ~sym (fn [~sym] ~@body)))
20:55bbloommaybe better named swapping!
21:00hyPiRionuh
21:01dnolenhey finally understanding swap! after 4 years of Clojure, better late than never!
21:02bbloomdnolen: heh. have you ever written any meaningfully concurrent code before?
21:03bbloomdnolen: there are *a whole bunch* of places in cljs that get swap! wrong... luckily js is single threaded....
21:04ziltihttps://github.com/munrepl/server <- Multi-user nREPL proof of concept
21:05ziltigood night
21:06dnolenbbloom: no, I've had no need in any of the software I do for work. Heh, yes about CLJS, but I don't see JS ever going shared memory w/ threads.
21:07bbloomdnolen: yeah, but it's worth doing swap! right for when some function's impl is inevitably copy pasted to somewhere that does have shared memory...
21:09amalloybbloom: i'm sure dnolen would take pull requests fixing such places as you've noticed
21:09dnolenbbloom: yeah, the mulitmethod implementation will need some looking over ...
21:10bbloomamalloy: next time i spot one, i'll patch it :-P
21:10bbloomdnolen: use my dispatch map! :-)
21:13dnolenbbloom: I need to find time to actually check it out :)
21:13bbloomdnolen & Bronsa: hmmm... do tagged literals respect aliases like ::foo/bar ?
21:14dnolenbbloom: don't think so
21:14bbloomdnolen: should they?
21:14dnolenbbloom: I think they should yes
21:14bbloomi'd agree...
21:15gfrederickswhat are the ways that a project can have a dep not listed in `lein deps :tree`?
21:15gfredericksdependency in the sense of things that lein checks for when you run it
21:17Bronsabbloom: I can make blind do that, however, it's 3:07AM and I think I'm going to bed now
21:17Bronsawill do it later :)
21:17bbloomBronsa: by all means, throw a ;;TODO in there and go to bed
21:23bbloomdnolen: ok so that thing i was asking about the other day re core.logic: it's called a "Topological Sort"
21:23bbloomi was unable to find a reasonable prolog implementation
21:25bbloomi basically want to take a map of the form {:foo {:deps #{:bar} :before #{baz} :after #{bat}} ...} and some set of keys #{:foo} and produce a sequence of keys obeying the before and after values, sucking in all the other nodes based on dependencies
21:28dnolenbbloom: amalloy: thanks again on the swap! help. Only 5 more unprincipled uses of swap! in core.logic, but that's for another day.
21:28dnolenbbloom: that's surprising I see a couple of links on google.
21:29gfredericksoh it's lein-ring I think
21:29callenis there a version of Google I can use where it stops second-guessing me?
21:29bbloomdnolen: i saw one or two implementations, but there was discussion of O(N) vs O(N^2)
21:29bbloomcallen: turn on the verbatim option
21:30bbloomdnolen: it seemed like it would be easier to just hand code one of these algos with the tweaks i need: http://en.wikipedia.org/wiki/Topological_sorting#Algorithms
21:30bbloomrather than encode it at a logic problem, which was making my head hurt
21:30callenbbloom: thank you
21:31xeqigfredericks: yeah, plugins don't show up in lein deps :tree
21:32xeqiare you asking about a thneed snapshot?
21:32callenbbloom: it's not actually showing me the option for a verbatim search. http://zipmeme.com/uploads/generated/g1334961617145439732.jpg DuckDuckGo it is.
21:32gfredericksxeqi: yeah I think I've traced the whole story (lein-ring), am trying to figure out the easiest place to patch it
21:32xeqigfredericks: I use https://github.com/ato/clojars-web/blob/master/project.clj#L35
21:33gfredericksxeqi: I'd think lein-ring should upgrade leinjacker, but I know nothing about leinjacker so can't guess if that's straightforward or not
21:33callenoh wow. if I duckduckgo 'clojure swap!' (without quotes) it shows me the clojure doc.
21:33dnolenbbloom: it makes my head hurt too :)
21:33gfredericksxeqi: that looks like a great bandaid, thanks
21:34xeqiI don't htink upgrading would require much work
21:34xeqicould file an issue / bug weavejester when hes around
21:35ivanit appears &tbs=li:1 turns on verbatim
21:36callenivan: thank you, but it seems a little ridiculous that I have to go to those lengths.
21:36ivanfor just one billion dollars I can make a good search engine for you
21:38ivanit is too bad Google didn't preserve their real indexes from 2000-2004, I would have really liked to search those
21:38bbloomdoes here anyone actively use metadata for anything outside of compiler-ish stuff?
21:38bbloomie convey meaningful program state
21:38dnolenbbloom: sometimes yes
21:38bbloomdnolen: curious, what?
21:39gfredericksxeqi: I'll file an issue
21:40dnolenbbloom: ad-hoc runtime stuff - it's a great way to provide extensibility - users can leverage existing types w/o committing to create new types etc.
21:40dnolencreating
21:40bbloomdnolen: hm ok...
21:40dnolenbbloom: I don't make types w/o meta field because you just never know
21:41bbloomdnolen: so i've got one use case where i have a pluggable system that has a bunch of functions that run in order. however, i want to be able to convey an "abort" state of some kind, but i also need to convey the return value. the return value will *always* be a map
21:41bbloomi'm thinking about conveying that abort signal via metadata: ^:abort the-return-value
21:41bbloomor rather with-meta the-return-value
21:41dnolenbbloom: seems reasonable to me
21:42dnolenbbloom: I use that trick to convey information about return values as well
21:42gfrederickshttps://github.com/weavejester/lein-ring/issues/57
21:43bbloomdnolen: my initial reaction was "well, this is a dirty hack for not having multiple return values" but then i realized that multiple return values have the problem of not knowing what they are, since they are positional... so metadata as a associative multiple return values is interesting
21:43bbloombut only works on types that support metadata
21:43bbloomthis is the first time i've ever wanted to use metadata for something other than the compiler itself, so it feels kinda unnatural to me... but i guess i'll just go for it
21:44bbloomdnolen: and entertainly enough, this is a short circuiting reduce situtation like we just talked about lol
21:46dnolenbbloom: heh
21:48SgeoShort-circuiting reduce?
21:48SgeoWhere?
21:48Sgeo(Don't tell me Haskell or I'll slap you)
21:49bbloomloop/recur :-P
21:54bosiei use leiningen. i have pdfbox in my dependencies
21:55bosie(org.apache.pdfbox.util.PDFTextStripper. ) results in "CompilerException ClassNotFoundException)
21:56bosienow the obvious question is... am i doing sth wrong?
21:57callenbosie: refheap
21:59bosiecallen: refheap what?
21:59bbloomdnolen: metadata approach worked out nicely. thanks for calming my fears :-)
22:00dnolenbbloom: cool!
22:00bosiecallen: https://www.refheap.com/paste/7909
22:00dnolenbbloom: metadata is definitely one of those things I miss elsewhere. The fact that it works so great for compile & runtime is really sweet.
22:00bbloomdnolen: https://www.refheap.com/paste/7910
22:01dnolenbbloom: nice
22:01bbloomthat allows some pass function to optionally restart expansion by just calling expand again
22:01bbloomworks absurdly nicely
22:11callenbosie: you have to add the dependency mate.
22:11callenbosie: it works like maven.
22:11bosiecallen: but thats what i am doing, no?
22:12bosieoh
22:12bosieisn't this line taking care of it? [pdfbox "0.7.3"]
22:14callenbosie: refheap the output lein deps :tree
22:14callenof*
22:15bosiehttps://www.refheap.com/paste/7912
22:16callenbosie: [org.apache.pdfbox/pdfbox "1.4.0"]
22:17hyPiRionyeah, that should work
22:18bosiehuh
22:18bosieit works
22:19bosieoh
22:19bosiei see
22:19bosiethank you callen
22:19callenbosie: all I did was google your problem.
22:19callenIt's not like I'm some repository of arcane knowledge.
22:19bosiecallen: thats what i did too
22:34Rich_MorinI'm a bit confused by something in https://github.com/daveray/vimclojure-easy. It says "Hit \ef to evaluate the file." This doesn't work and I can't find anything about that syntax in my vi docs. Help?
22:46wingyhey datomic users .. can i have meta data for an attribute in datomic?
22:53wingyoh i can use the :db/doc key
23:10RaynesWatching router firmware flash is like nerd porn.
23:12RaynesIt's hilarious, they fix an issue with non-updating data usage statistics that I pretty much required, and they do it a month before I leave Alabama and no longer require this particular router because I wont be using mobile internet anymore.
23:27wingyi forgot .. maybe i can add my custom property to a attribute definition
23:27yedishould functions reformat input data to fit their needs, or should they just assume the input data is formatted correctly?
23:29ivan(process (fix-data junk))
23:30Raynesyedi: That's way too vague a question to answer.
23:31yedihm yea
23:56chouseryedi: would you consider reformatting the input data to be a different thing from whatever else the function is going to do? Do you want your function to do two different things?