#clojure logs

2012-12-11

00:00RaynesIt isn't my fault cemerick is dumb.
00:00rbxbxbbloom that's why I like y'all. Weirdies from all walks of life, coming together to talk about important things. Like how everything sucks.
00:00bbloombut luckily, we're armed with the word "decomplect" let's decomplect the shit out of all those fancy live compiler support features and move that shit into libraries that nrepl and friends can expose to any damn editor you choose
00:00technomancytpope: sure, because the first one wasn't that good
00:01cemerickRaynes: You cut me deep, man.
00:01technomancycemerick: my point is that getting a Dr. Racket-alike for editing Clojure only covers a tiny sliver of why people use Emacs
00:01rbxbxtpope: to hop back to that article you linked ages ago I totally agree. I do think a deadline without distraction is probably better though... ie: false dichotomy?
00:02tpoperbxbx: if I'm reading twitter at work, the problem isn't that twitter is too easy to read at work
00:02bbloomand now with fressian and datomic and distributed systems and all that stuff on rich's radar, simpler service oriented stuff is going to come into the vernacular. that can only be a good thing for editors :-P
00:02Scriptorif anything, Dr. Racket for clojure *might* get a lot of eclipse/other ide users
00:02Scriptormaybe even a few vim users, though I have no idea how key bindings work on it
00:02rbxbxtpope: okay. I'm sold. When I'm in my flow I could give a fuck about the latest cat gifs on twitter.
00:02Scriptorbut one tool/one job doesn't seem like it's prevalent in Dr.
00:02cemericktechnomancy: Right, whole-system hackability. I get it.
00:02n_b(speaking_from_ignorance "I thought Dr.Racket was just a customised emacs install with the equivalent of vimtutor")
00:02rbxbxor could not, rather.
00:03rbxbxn_b: are you not confusing it with mozart/oz ?
00:04n_brbxbx: 've been up so long at this point I've honestly no idea. Shouldn't be commenting at all
00:04technomancynot that I'd mind using an OS written in Clojure; I just think it's at least half a decade from being usable by the adventurous
00:04cemerickMy problem is I'm an unprincipled, disloyal type. I'll switch tools at the drop of a hat, if something better comes along. Hackability is actually a downside for me in that scenario, insofar as I don't want to lock myself into anything in particular.
00:05cemerickn_b: most certainly not an emacs install
00:05tpopetell me about it
00:05Scriptormight it not be more efficient to change the tool itself to fit you better rather than a whole new environment?
00:05tpopetry locking your very identity to it too!
00:06cemericktpope: The first step is to stop digging. But, finish foreplay, first, thanks. ;-)
00:06bbloomcemerick: yeah, too much customization can kinda lock you in
00:06bbloombut dammit man, vim bindings are deep in my brain
00:06rbxbxcemerick pros and cons, pros and cons. The fact that an individual like Tim can come along and have his first Clojure project make a significant splash would not be so had he not so deeply locked himself into Vim (along with others!)
00:06bbloomand my fingers
00:07rbxbxbut go on, lording your freedom over us.
00:07rbxbx:p
00:07bbloomi'm a total prisoner
00:07bbloom:q!
00:07Scriptorbbloom: same, it's a little unwieldy since clojure and other lisps really lend themselves better to sexpr-based editing
00:07Scriptorwhile vim is just more line-oriented
00:07cemerickrbxbx: was definitely not evangelizing anything there :-)
00:08bbloomScriptor: text objects make it quite a bit better… i don't use paraedit or anything
00:08RaynesI love ALL the editors.
00:08technomancyRaynes: even sublime?
00:08RaynesI use two editors at the same time all the time.
00:08rbxbxScriptor bbloom not to mention surround.vim
00:08n_b++Raynes
00:08bbloomi use that too
00:08Raynestechnomancy: Yes, actually. I think it is a great editor with horrible Clojure support.
00:08Raynestechnomancy: All it needs is to be open source so more than one person can work on it at a time.
00:08technomancyn_b: it's pronounced inc
00:09ScriptorRaynes: I made a php ide in vb once, I should dig it up for you
00:09cemerickI actually wrote the whole book in sublime :-P
00:09technomancyRaynes: yeah that kind of seems like a big problem
00:09n_bWhen working on Java stuff Ill often use Eclipse for finding things and generating stubs and then vim for the bulk of editing
00:09Raynestechnomancy: That one person does great things with it. He just doesn't focus on what I want him to, which is my only problem.
00:09cemerickOr, I did all of *my* writing in sublime, I should say
00:10technomancyRaynes: your problem is that you and people who think like you aren't allowed to do what you want with it
00:10Raynestechnomancy: If it was open source I still wouldn't fix my problem with it. In fact, I could do my own bundle for Clojure for it right now but I wont.
00:12benediktIn the Noir framework, i'm trying to use clojure.string/join on a vector of (link-to): http://codepad.org/nrEEvwjz
00:12technomancywhy spend time hacking on something you are only allowed to use by virtue of someone else's good will?
00:13Raynestechnomancy: Because it's nice and I'm not a FOSStard?
00:13technomancy"your help isn't welcome here" offends me, regardless of license
00:13technomancyRaynes: FOSStard is not the preferred nomenclature, dude.
00:13technomancy(it's freetard.)
00:15Raynestechnomancy: I once bought oil for my mom's car.
00:15RaynesI'm pretty crazy.
00:17benediktRaynes: cool story bro
00:17RaynesI guess you noticed my ignoring your noir question.
00:18RaynesFoiled!
00:18cemerickYeah, why would anyone think that this is where people talk about Clojure? o.O
00:19Scriptorwasn't there a clojure-lounge or something once?
00:20rbxbxbenedikt to be fair, it was a statement
00:20rbxbx;)
00:20rbxbx"I mapped over an set today" /me waits for a response
00:21rbxbxan set. ugh.
00:21RaynesI answered his question in #noir. Just so nobody things I'm an ass.
00:21rbxbxRaynes good man :)
00:25seangroveWhy do I get "namespace not found" when trying to C-x C-e a cljs form while having a cljs nrepl session open?
00:26seangroveOnly seems to happen on one namespace so far
00:34Raynesdsantiago: How do you go from hickory zip -> hickory?
00:49benediktHow would it make sense to represent a bunch of objects (papers in my case) in clojure. I represent each paper with a hashmap (:name, :abstract, etc, etc.), but i have more than one paper.
00:49n_bWhat do you mean represent?
00:49n_bIOW, what's your end goal?
00:50ToxicFrogAs in, what collection type you want to store them in? Depends on what you're doing with them.
00:50benediktn_b: oh, the XY problem. Printing out a list of papers
00:50seangrovebenedikt: first pass, sounds like a vector of hashmaps
00:50ToxicFrogIs order significant?
00:50benediktseangrove: thats what i thought.
00:50benediktToxicFrog: no, but i need to be able to select paper by e.g. name
00:50ToxicFrogA map (name => paper hash), then?
00:50benediktbuilding a website with noir. i thinking of a /paper/name thing
00:51n_bah
00:51benediktToxicFrog: How would that look in clojure pseudocode?
00:51n_bYou might look at sets benedikt
00:52n_bProgramming Clojure had a good section on building a little in-memory database using the basic clojure datatypes
00:52n_bTo recommend anything more than that I'll defer to someone with more experience :)
00:52ToxicFrogsets don't get you the name->paper mapping, though, you'd need to filter it
00:53benediktToxicFrog: how would your idea look?
00:54n_bToxicFrog: You can use something like (select pred col) though can't you?
00:55ToxicFrogbenedikt: you're already using hashmaps for the papers themselves, you'd just store those in another hashmap - (hash-map "Performance Evaluation of a ..." { :name ... :abstract ... } "An Integrated ..." { :name ... :abstract ... })
00:55zackzackzackI just ran `lein check` for the first time ever on a project. I'm scared. What's going on?
00:55ToxicFrogThis does assume you only ever want to lookup by name, though
00:55n_bbenedikt: Why not stuff them into a proper DB?
00:56n_bat least something like BerkeleyDB or SQLite?
00:56benediktn_b: i just want to keep it simple with as few layers as possible. its update at most twice a year
00:56n_bSo how is it getting loaded as is?
00:57n_bJust something like (def papers [paper1, paper 2])
00:57benediktstatic html :)(
00:57n_band you're parsing it out with enlive or something?
00:57benedikti just have some spare time and i want to familiarize myself with clojure
00:57benediktso i'm rewriting this simple webpage with clojure
00:58benediktToxicFrog: that makes perfect sense for what i want to do.
01:02benediktn_b: where were you going with (def papers [paper1 paper2]) ?
01:07n_bbenedikt: using sets and relations with predicates to query it like an in-mem db
01:09benediktn_b: nice. did you find that link?
01:10n_bhttp://clojuredocs.org/clojure_core/1.3.0/clojure.set
01:10benediktthat hardly explains how to do that
01:11n_bslam all your hashes into a set, then query that like any filter statement would
01:12bbloombenedikt: what types of queries do you need to support?
01:12bbloomif you need precise lookups, simply store your data in a map keyed by the lookup value
01:13bbloomif you need range lookups, you can use a sorted-set or a sorted-map in conjunction with subseq
01:13bbloom(doc subseq)
01:13clojurebot"([sc test key] [sc start-test start-key end-test end-key]); sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true"
01:13bbloomsubseq enables you to treat a sorted collection as an index
01:13n_bwhoa, did not know about that
01:13n_bnifty
01:13n_bstdlib just keeps getting better and better the more I learn.
01:14benediktbbloom: only by name. but i'm all for doin unessecarly cool stuff.
01:14bbloomdirect access by name? any kind of substring matching?
01:14benediktdirect
01:14bbloomyeah, then don't get fancy: use a map
01:15bbloomif your data set fits in memory, and all you care about is direct lookup by name, then the simplest thing to do is to store your entire database in a single top level atom
01:16bbloomwrite a few functions to use with swap! on that atom that insert, remove, or "modify" items in your database
01:16bbloomif your change rate is small enough and you don't need transactional storage, you can slurp up that database from a file on startup, and write it out on save
01:17benediktits actually that simple
01:17bbloomif you need fancier querying or better transaction guarentees or higher throughput, use a real database
01:17bbloomi'm all for simple single atom slurp/spit databases in apps
01:17bbloomanytime you can reasonably get away with that, do it!
01:17benedikti like your thinking.
01:17bbloomwell then we have that in common :-P
01:30benediktSeems like that if i try to pass it a value that isn't in the hashmap, i'm getting served an empty page
01:30benediktseems like a sensible approach.
01:31n_bjust return a different result if you get back nil
01:32benediktaye
01:37rbxbxbbloom I like that approach as well :)
01:38rbxbxMay have to give it a go with the next app I undertake with trivial persistence requirements
02:08dsantiagoRaynes: zip/root doesn't work?
02:08RaynesGood question. I didn't try it. Note that I'm very new to zippers and pretty dumb in general too.
02:12Raynesdsantiago: Yeah, that works.
02:12dsantiagoPhew.
02:12Raynesdsantiago: Hickory is suck good stuff.
02:12dsantiagoThanks, I thikn.
02:12Raynessuch
04:43hcumberdaleHi there ;)
04:52andrewmcveigh|woMorning.
05:03kralmorning
05:18thorwilmorning
05:19thorwilso i can test private fns just fine using #'
05:19thorwilbut that does not work for macros. is there a way around that?
05:20thorwil(though just not making the macros private has no real cost to it)
05:21RaynesMaking nothing private has no real cost to it.
05:22RaynesIt'd be better if there was some other flag to tell whatever documentation generator one is using to ignore it.
05:22bbloomRaynes: I think that flag is :private :-)
05:22RaynesI should send weavejester a pull request to make it ignore vars with :nodox metadata.
05:22thorwilsure. i just use it to mark stuff that is used inside a ns, when it's not worth it to spin off a new ns for it
05:22bbloomit's just bugged: the flag also makes things private
05:23Rayneslol
05:23bbloomalthough, to be fair, there is an orthoginal concern: automatic import on :use
05:23clgvRaynes: why not :public to mark the intended public api without any restrictions
05:23RaynesBecause ew.
05:24RaynesI don't want to have to attach metadata to *everything*
05:24Raynes:P
05:24bbloomif i author a namespace that i expect to :use-d, then i use :private
05:24bbloomotherwise, i just don't write doc strings for private stuff
05:25RaynesI wish I could write namespaces that break when use'd.
05:25bbloomeh, add a rule to kibit :-P
05:26bbloomuse is perfectly acceptable for interactive work and for my "shit that i wish was in core" utilities
06:47rasputnikis this the right place to ask ring questions?
06:48thorwilrasputnik: it is probably one right place
06:49rasputnikok, well just writing a dead simple ring app and trying to add some middleware. things are not going so good.
06:49rasputnikParameter declaration wrap-json-response should be a vector
06:49rasputnikhang on, i'll pastie the code somewhere
06:51Rayneshttps://www.refheap.com is a popular choice.
06:51rasputnikhere's the problem code, can't see what's wrong with it
06:51rasputnikhttps://gist.github.com/4257968
06:51RaynesFoiled!
06:51rasputnik:)
06:52rasputniki'm too rusty on the basics here to be sure whether the (ns …) form is correct
06:52thorwilrasputnik: defn is for defining functions and ths must have an arg list
06:53thorwilline 10/11
06:54Sgeo|webWell, my simplistic attempt to replace the clojail macroexpander failed and crashed
06:55rasputnikthorwil: bloody hell. Why do i bother coding before coffee, it's always a waste of time.
06:55thorwilheh
07:03Sgeo|webEven blindly throwing mexpand-all in there it fails some tests
07:04Sgeo|webI'll need to look at this more closely later, I think. I should be sleeping.
07:13tgoossensi'm making a little game. to paint all the players i do
07:13tgoossens(map #(paint g (deref %)) players))
07:13tgoossensbut that doesn't work?
07:13tgoossensbut (paint g @(first players)) works
07:13tgoossensi don't get it
07:14ucbtgoossens: map is lazy, maybe that's it?
07:14tgoossenshmmm
07:14tgoossensyes of course
07:15tgoossensis there a better way
07:15tgoossensor should i just
07:15tgoossensdo
07:15tgoossens(seq ..)
07:15weavejesterrasputnik: It can be
07:15ucbtgoossens: you could try with doseq
07:15tgoossenslet my try this
07:15tgoossens*me
07:19tgoossensthat seems to work
07:19tgoossensnow i ran into a classical problem
07:19tgoossenson linux holding a pressed button gives you , pressed, released, pressed, released
07:20ucbheh
07:21clgvtgoossens: I doubt that general happens on linux. what GUI framework do you use?
07:21tgoossensswing. based on the snake example in "programming clojure"
07:22wilfredhI'm trying to add prettytime (http://ocpsoft.org/prettytime/ ) to a Clojure project, but adding [org.ocpsoft.prettytime/prettytime "2.0.0.Final"] to my project.clj dependencies can't find it any repository.
07:22wilfredhAny suggestions as to what I'm doing wrong?
07:24wilfredhhttp://ocpsoft.org/prettytime/ says "To use snapshots, you must also use the Sonatype Snapshots repository" but AFAICT I'm not using a snapshot, just a stable release
07:27wilfredhah, got it. Looks like 1.0.8.Final is the most recent version of maven.org
07:40rasputnikweavejester: wrapping the app in wrap-json-repsonse is still giving me troubles, fell back to just ring.util.json-response for now.
07:40rasputnik(PEBKAC no doubt, but don't need the entire app to generate JSON anyhow)
08:31Sgeo|webWhy would someone need to make a new object just to use what is essentially a function that has nothing to do with the object it's on?
08:31Sgeo|web(Looking at that PrettyTime thing)
08:31Sgeo|webI blame Java
08:36clgvI get a java.lang.NoClassDefFoundError for an interface of a protocol in a namespace where the deining namespace of the protocol is "require"d
08:37clgvI only get that when running the uberjar
08:38clgvso what is the reason for that?
08:41firesofmayWhat would be the best way to get and generate sentences for testing in various languages?
08:42maleghastHey there y'all
08:44Chousukefiresofmay: "best" is a difficult question, but I would start by defining word classes, then some words in each class, and some data structure which describes how each kind of word can be used to form complete sentences. that's enough for at least simple languages if you don't require semantically correct sentences :P
08:45maleghastI was wondering… I was Clojure eXchange in London last week (awesome 1 day conference set up by Skills Matter and London Clojurians, esp otfrom) and Rich Hickey's talk made me think about a bunch of (sadly non-Clojure) things that I am working on at my day-job at the moment, particularly interchange between systems… So here' s the thing, and don't throw stuff at me, does anyone know of an implementation of edn in PHP..?
08:45Chousukefiresofmay: but in general that problem is extremely difficult
08:46firesofmayChousuke, I just want random text. Semantics are not important. I just want to generate sentences (meaning is not important). Criteria is to able to generate sentences from various languages.
08:47firesofmayChousuke, One way is I copy general words of various langauges. And put them in a list. I was wondering if I can do this in some better way then copy pasting myself.
08:47Chousukeput the words in a file, read the file, and parse it into a list?
08:48ro_stfiresofmay: seen brian marick's talk? there's a topic on the group now that might interest you: https://groups.google.com/forum/#!topic/clojure/Q53aRaiwDCQ
08:48firesofmayro_st, checking.
08:48Chousukeusing a pure dictionary-based approach will only work for reasonably simple languages though
08:48Chousukelike, say, english :ÖP
08:48Chousuke:P
08:49firesofmayChousuke, Hmm. What about languages like manderin?
08:49Chousukemandarin might work too
08:49Chousukesince words are mostly immutable
08:49ro_stmaleghast: if there is, it hasn't been shared with the maintainers yet: https://github.com/edn-format/edn/wiki/Implementations
08:49Chousukebut eg. in Finnish you'd be very limited with a dictionary-only approach
08:50maleghastro_st: Yeah, I looked there first - wanted to see if there was anyone in here prepared to put their hand up and admit to one...
08:50Chousukesince you need to actually modify words depending on their grammatical role in a sentence and relation to other words.
08:50maleghastro_st: Thanks though :-)
08:51ro_stmaleghast: condolences that you need it.
08:52ro_stwe're just over a month away from switching to our pure clojure v2 stack. v1 stack has php AND flash in it.
08:52maleghastro_st: Thanks :-S Truth is I might not - I might (at least) be able to use this issue as one of the reasons for moving even our top layer up out of PHP and into Ruby (well jRuby) and there is a Ruby implementation of edn.
08:52ro_stby pure, i mean: datomic, clojure, clojurescript, and pallet for aws ec2 configuration. even the campfire bot is in clojure.
08:52maleghastro_st: Sounds like you are properly moving up in the world - nice stuff
08:52maleghast:-)
08:52Chousukefiresofmay: for example if you consider the two sentences "I bought a red car" and "That is a red car you bought", "red", "car" and "bought" would not map to the same words when translated into Finnish
08:53maleghastro_st: Who is "we" if I may ask..?
08:53ro_st<spam>www.cognician.com</spam>
08:53firesofmayChousuke, As long as I can generate some finish looking sentence I am good :) (for now at least)
08:53maleghastro_st: Thx - *looking*
08:53Chousukefiresofmay: that's probably possible
08:54firesofmayChousuke, this is just to populate and see if its working fine. What it means is of no importance to my testing.
08:54ro_stfiresofmay: what about grabbing some version of finnish lipsum and using chunks of that?
08:54firesofmayro_st, I could, what I am asking is should I grab them manually and save them, or do you know any one place I can get standard words for all languages?
08:55firesofmayro_st, Chousuke Then I can just write functions which would take them and genreate random sentences for given language.
08:55ro_sti have no idea
08:55firesofmayro_st, Okay no problem :)
08:56ro_sthttp://generator.lorem-ipsum.info/
08:56ro_st"Other languages/charsets"
08:56ro_stboom
08:57ro_sti googled for "lipsum for other languages". this ws the first hit
08:58firesofmayro_st, checking
08:59rcg-workthere is only one lorem ipsum generator: http://slipsum.com/
08:59rcg-work;)
09:01firesofmayrcg-work, lmao :)
09:01si14_is there anything for parsine Erlang datastructures out there?
09:01firesofmayro_st, that links great for now :)
09:01si14_or should I write something for this by myself?
09:01firesofmayrcg-work, I wish it had more languages ;)
09:08ro_stsi14_: you could use erlang
09:08rcg-workfiresofmay, ;)
09:10PudgePacketHey, I've just been going through the koans, and I was wondering what the differente between (peek '(1 2)) and (first '(1 2)) was
09:10si14_ro_st: what do you mean?
09:11noidiPudgePacket, http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/peek
09:11noidi,(doc peek)
09:11clojurebot"([coll]); For a list or queue, same as first, for a vector, same as, but much more efficient than, last. If the collection is empty, returns nil."
09:12HolyJakPudgePacket: You'd use peek when you use the collection as a queue to indicate it is a queue
09:14firesofmayro_st, Chousuke this is also good enough alternative : http://www.adhesiontext.com/ & http://randomtextgenerator.com/
09:14firesofmaythese are*
09:14ro_stsi14_: you want to parse Erlang data structures. isn't Erlang a good fit for that?
09:15si14_ro_st: I need to parse Erlang's config. I can parse it in Erlang, emit some JSON and use it in Clojure, but it would be easier to use config files themself
09:16PudgePacketThanks
09:16ro_stsi14_: you might find that's actually not easier. a cursory google doesn't reveal anything
09:17cemerickHaving an erlang reader implemented in Clojure wouldn't be the worst thing in the world...
09:19pbwHi folks. N00n00b question follows:
09:21pbwIf I do this in the repl, it woks. (filter #(java.lang.Character/isUpperCase %) "AbcDef") gives (\A \D)
09:21ro_stisn't the erlang vm so small that you can just embed the whole vm in a source file somewhere? -disclaimer, i know *nothing* about erlang-
09:22si14_ro_st: nope :)
09:23HodappErlang is a lot of things, but I don't know that I've ever heard it called "light"
09:23pbwBut I can't seem to apply 'str' to this in a 'comp' in order to string the function processes together.
09:23cemerickOh, I totally forgot about http://erjang.org/
09:24cemericksi14_: might want to look in there for a reader ^^
09:25si14_cemerick: yeah, nice idea! thanks, I'll look there
09:26cemericksi14_: A super-quick browse of the javadoc doesn't turn up anything obvious; ping back if you find a reader in there :-)
09:27p_lHodapp: someone got Erlang to start fast enough that a fresh request time outs slower than the VM boots
09:28Bahmanp_l: That's nothing compared to JVM :-P
09:28Hodappp_l: I have no doubts it can be made quick, I'm just saying it's rarely called "light" :P
09:29p_lBahman: hmm?
09:29Bahmanp_l: Use your imagination!
09:29p_lHodapp: well, it doesn't need to be complete VM from start to boot
09:30Bahmanp_l: "False" imagination of course :-)
09:30tbaldridgep_l: let's not forget that the Erlang VM is miles simpler than the JVM
09:30Hodappp_l: so it loads only what's needed?
09:30tbaldridgeno classes, no string, just ints, lists, and dictionaries.
09:30tbaldridge*no strings
09:31Hodapptbaldridge: No strings? Didn't know that.
09:31si14_cemerick: found this: https://github.com/trifork/erjang/blob/master/src/main/java/erjang/jbeam/beam.g
09:31tbaldridgein Erlang strings are arrays of 32 bit integers
09:31si14_cemerick: not sure if I know how to use it standalone
09:35cemericksi14_: it's an antlr grammar; presumably the build process or some script in the repo uses it to generate the lexer and parser
09:48tbaldridgeanyone with emacs skills know a shortcut to "go to start/end of sexpr"?
09:48zerokarmaleftC-M-b and C-M-f
09:49noidior C-M-u for "go up"
09:50tbaldridgecool. Is there one for "go to start of top level form"? Or should I just hit C-M-u a bunch of times?
09:50si14_cemerick: yeah, thanks.
09:50ro_stthe latter
09:50daimrodtbaldridge: C-M-a
09:51tbaldridgeawesome! thanks guys.
09:51ro_stawesome. didn't know that!
09:51daimrodand C-M-e to go to the end
09:51tbaldridgeC-M-a C-space C-M-e C-w the combination I've wanted for a long time. :-)
09:52noidifor any lurking eclipse users, you can do all this in Counterclokwise as well :) http://code.google.com/p/counterclockwise/wiki/EditorKeyBindingsFeatures
09:52zerokarmalefttbaldridge: C-M-a and C-M-e already set marks
09:53zerokarmaleftso you just need C-M-a C-M-e C-w
09:53ro_stC-M-space
09:53tbaldridgecool, didn't know that since it wasn't highlighted.
09:53ro_stor C-M-k
09:54si14_and finally I decided to generate my configs from YAML instead of parsing them :)
09:55ro_stC-M-a C-M-k
09:56ro_stgo to begin of top form and cut the whole form
09:56ro_sts/cut/kill
09:56zerokarmaleftro_st: nice, didn't know about that one
10:04yeditest
10:05yediis there a #clojure log?
10:05vijaykiran,log
10:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: log in this context, compiling:(NO_SOURCE_PATH:0)>
10:05vijaykiranhttp://clojure-log.n01se.net/
10:06vijaykiranyedi: ^^
10:06yedity
10:06clgv$log
10:07cemerickhuh, it used to be in there
10:07cemericklog?
10:07clojurebotsee logs
10:07cemericklogs?
10:07clojurebotlogs is http://clojure-log.n01se.net/
10:15vijaykirancemerick: ah, thx!
10:15ppppaulhey guys
10:15ppppaulwhat's a good lib for builing REST apis?
10:16ppppaulnoir/compojure/ring/other?
10:16weavejesterYou might want to look at compojure + liberator
10:17ohpauleezpreviously I really enjoyed ring+moustache, but if you google around, you'll find something called liberator
10:17ohpauleezgah, late to the party
10:17ohpauleez:)
10:17ppppaulmoustache?
10:17clojurebotmoustache is http://github.com/cgrand/moustache
10:17ro_stnoir, plain old compojure, liberator, bishop
10:17ro_sttake your pick
10:18ohpauleezohh bishop
10:18ohpauleezgood call
10:18ohpauleezro_st: I just saw your tweet
10:18ro_stohpauleez: :) i ended up not using your fine efforts
10:18ppppauli'm wondering what would be most productive, also i haven't used clojure in a while, so i'm almost a noob again
10:18ro_stwhich one?
10:19ro_stppppaul: i believe liberator is the thing, now
10:19ohpauleeztwo things - a freshening up of Shoreleave (now that a chunk is in CLJS proper)
10:19ohpauleezand I have a bunch of notes on reactive stuff
10:19ro_stwe're using noir and shoreleave-remote but that's because our consumer is cljs
10:19ro_stoh, that tweet :-)
10:19ppppaulpeople's thoughts on bishop?
10:19clj_newb_2345is there a gallery of websites done in clojurescript?
10:20ro_stppppaul: cmiles74 is bishop's author
10:20ohpauleezro_st: But Shoreleave needs to be touched up and unified across the board, and I'm about to get some more time to work on it soon-ish
10:20ro_stclj_newb_2345: not that i know of, but i think it'd be awesom if there is
10:21ro_stohpauleez: reactive looks very interesting. it's in the direction i want to go - real-time websockets stuff
10:22ohpauleezDefinitely
10:22ro_stohpauleez: i just put this out a couple days back http://github.com/cognician/fusebox
10:23ohpauleezYS!
10:23ohpauleezYES***
10:23ciphergothWhen I google for async support in Ring/Compojure, I find posts from a couple of years ago setting out how it might work. Is there a working mechanism now?
10:23ro_stit's ridiculously simple. i'm releasing a composition of this and datomic soon
10:23ohpauleezthat's pretty solid
10:24weavejesterciphergoth: Try looking into Aleph
10:24ivaraasenciphergoth: looked at Compojure + Aleph sample applications?
10:24ohpauleezro_st: You should submit a cognician ClojureWest talk
10:24weavejesterciphergoth: After some experimentation with Ring, we found that adding async support direct to Ring didn't really work
10:25ivaraasenlike this: https://github.com/alexkehayias/clojure-aleph-chat
10:25ciphergothweavejester, ivaraasen: thanks
10:25weavejesterciphergoth: It really needs a separate protocol, as Aleph has
10:25ciphergothOK
10:25ro_stohpauleez: the implementation is almost non existant. but i think the value is in having the abstraction in place. was such a pleasure to write it up, wire it in to the backend, write a remote, and wire it into the frontend, all in a matter of hours. cljsbuild's crossovers rock.
10:26ohpauleezro_st: Yes, I totally agree - there's definitely real power there
10:26ro_stohpauleez: i totally want to get to the USA next year to attend the conj
10:26ppppaulweavejester, what do you mean by async support? do you mean realtime web stuff?
10:27weavejesterppppaul: Yeah
10:27ppppaulerlang chloe
10:27ro_stthis is going to play nicely with a/b testing, too. i just got the datomic stuff done in our server code today. fuses are datomic schema attributes, and i can tag either the whole system, a user, a user role, or a user group with a fuse
10:28ro_stand query out a flat list of enabled fuses for the ring middleware
10:28ppppaulrealtime web means state... state on a web server = bad
10:28ro_stjust have to build a simple ui for setting fuse state now
10:28weavejesterppppaul: You mean threading state between requests
10:28ciphergothis Aleph a web server, or something that runs within a servlet container
10:29weavejesterBut yes, websockets and HTTP are fundementally two different protocols that happen to share a common handshake
10:29weavejesterciphergoth: It's a async server that covers several protocols, including long-polling HTTP and websockets.
10:29ro_sti remember reading that, in production, you should put your websocket server far away from your webserver
10:30ro_stas they have totally different scaling semantics
10:30ciphergothweavejester: I was hoping to use long polling within Jetty on Heroku
10:30ohpauleezro_st: Yes
10:30ppppaulweavejester, not just websockets, even long polling counts in this case... updating clients in real time means lots of state management... it's not good for the webserver that is used to having all it's state in a db
10:30ohpauleezthat is VERY true
10:30weavejesterro_st: That tends to be my approach. I don't think there are many advantages to having them on the same server.
10:30ppppaulalso i can't imagine having an easy time scaling realtime stuff
10:30ppppaulit should really be on it's own server
10:31clgvWhat do I do wrong if a defprotocol is compiled correctly in REPL and when building the uberjar but I get a ClassNotFoundException for the interface of that protocol when I start the uberjar?
10:32ppppauldoes ring handle sessions/cookies?
10:32ro_stppppaul: yup
10:33ppppaulby default, or do i have to enable it?
10:33ro_stohpauleez: i'd love it if you'd check fusebox out and holler if you see any weaknesses.
10:33ro_styou can enable/disable them as you wish
10:33ppppaul^_^
10:33ro_stthey're implemented as middleware
10:33ppppaulhope it's easy to deal with
10:34ro_styou can start with a bare http server or a full featured cookies sessions param parsing much-ado
10:34weavejesterppppaul: Yep, but as middleware
10:34ro_stdead easy.
10:34ppppaulno cookie sessions for me, but i want mappings from cookies to sessions (i'm planning to put the session data in datomic, if this is easy)
10:35ro_stcemerick: 100 tabs? you trying to set a record?
10:35ohpauleezro_st: I'll definitely add it to my day
10:35cemerickro_st: Just SOP for me for years now :-P
10:35cemerickTree-style tabs + firefox's tab spaces makes it all quite manageable
10:35nDuff...though my browser tends to bog down if I try to go above 175 or so.
10:36ro_stthanks :-)
10:36ro_stppppaul: we use memcached for sessions, but we do put a session id into datomic
10:36cemerickEver since FF14 or so, it hasn't flinched
10:37ro_stppppaul: you don't want to persist-for-eternity session flash messages, for example, or session redirect-after-login urls
10:37ppppaulthink that putting the whole session in datomic is too much?
10:37ro_stwe tried it. it's good for the stuff you want to keep for ever (session info like user-agent and ip) but not for transitory stuff like redirects and flashes
10:38ppppauli'm under a lot of time pressure now, so i want to do what ever is simplest to get the product out... using multiple stores seems like an optimization
10:38ro_stbecause datomic doesn't forget anything, ever. that's its design
10:38ppppauli don't know what flashes are, and i wont have redirects
10:38ppppauli'll just have some tiny meta data for the user
10:40ro_stif you have total control over the keys written to session storage (which you can totally have), and you want to retain 100% of that session data, then datomic is totally fine
10:40ciphergothSo from what people have said here, and some negative results from Googling, it looks like the situation is the following:
10:40ciphergothif you want to use eg async long polling, and your entire stack is Clojure, you're golden: you can use aleph and laminar.
10:41ro_stwhy the control over keys? each key, or attribute, has to be preconfigured as schema for datomic
10:41ciphergothHowever, the Clojure net frameworks do *not* currently allow you to use the support for long polling in servlet-3.0 or Jetty.
10:41ciphergothdoes that sound right?
10:41ro_stwe use noir, which likes to put all sorts of its own stuff into session. which caused datomic to cry about unknown attribs
10:44ppppauloh
10:44ppppaulwell, i really only want one field in the session store
10:45ppppauldoes noir use memory for sessions by default?
10:45ro_stit does
10:45ppppauli'm not sure i'm using noir yet, though. looking at a lot of libs for api building right now
10:45ppppaulbishop seems pretty nice
10:46ro_stgotta go. good luck :-)_
10:46ppppaulthanks
10:46weavejesterciphergoth: I don't know of any libraries for using the long polling in servlet 3.0
10:47weavejesterServlets are pretty poorly designed
10:47ciphergothweavejester: agreed
10:47ciphergothweavejester: However a colleague points out that Heroku allows us to use Netty, which has much more direct control
10:48weavejesterciphergoth: Heroku allows you to use almost anything
10:48ciphergothweavejester: ah, really? We could use aleph in Heroku?
10:48weavejesterIt's limited only by what is supported for compilation
10:48weavejesterAnd what their proxy servers support
10:49ppppaulheroku doesn't like the erlang or haskell
10:49weavejesterciphergoth: Yep
10:49weavejesterppppaul: Isn't that just a question of compiling it, though?
10:49ciphergothAha, that's much more appealing
10:49ciphergoththank you!
10:50borkdudewhy not use a VPS, they're not that expensive anymore and full control
10:50weavejesterHeroku and other similar service have advantages in terms of managing server nodes
10:50ciphergothand it sounds like it offers the control we need
10:50weavejesteri.e. with a VPS you have to setup your own cluster
10:51borkdudeah yes
10:51ciphergothyeah we are keen to avoid system adminsitration
10:53ppppaulare noir's session and cookie apis a big improvement ontop of what ring offers?
10:54borkdudethere was an idea of a linux distro / VM image geared towards Everthing Clojure last year, I wonder if that became something?
10:54borkdudeEverything
10:54ppppaulseems odd
10:54weavejesterppppaul: They use Ring's middleware underneath, but Noir is more stateful
10:54ppppauljust make a vagrant box
10:54ppppaulweavejester, for better or worse??
10:54lazybotppppaul: Uh, no. Why would you even ask?
10:55weavejesterppppaul: It kinda depends. I'd say that Ring's approach is better for middleware. Noir's approach is maybe more convenient for direct use.
10:59ppppaulcan you elaborate (i haven't seen how ring does it yet)
11:05weavejesterppppaul: Ring sets session and cookies via keys on the response. Noir sets them via side-effectful functions.
11:11clgvwhen exactly do I need to AOT a namespace containing a defprotocol?
11:11ohpauleezclgv: Only when you're going to expose that code to a Java system (where you want to program Java against Clojure)
11:12clgvok that's what I thought. but I still get a weird ClassNotFoundException for the protocol interface...
11:12ohpauleezyeah I saw the message earlier, no idea where that's coming from
11:13ohpauleezhave you confirmed, via test or REPL that everything is named correctly, everything works
11:14clgvyeah from REPL it works
11:14ohpauleezdoes the name have dashes in it?
11:14ohpauleezor the ns
11:14clgvno
11:14ohpauleezwell, I'm out of ideas :(
11:14mthvedtyou're running things in a fresh JVM?
11:15clgvI added printlns to the two namespaces which are printed just before the exception. so the namespace with the protocol gets loaded
11:15clgvyeah several fresh repls and a lot of rebuilt uberjars
11:16mthvedtdoes it work if you use a non-uber jar?
11:18clgvoh, lein's "run" fails as well
11:20clgvso the non-uber jar probably fails as well
11:21mthvedti actually don''t have any ideas… just fishing
11:21technomancyppppaul: FWIW heroku supports erlang
11:21technomancywe have a harder time with haskell since the build chain is enormous
11:22mthvedtyou could check if the class is present in the jar
11:23clgvmthvedt: no the class is not in the jar. but that shouldnt be a problem since the namespace is required
11:24mthvedtoh right
11:25clgvbut maybe that is the problem - the class should be there if it is called from the compiled -main method
11:28mthvedti'm no expert, but iirc java isn't supposed to load a class until it hits the code that actually uses the class
11:28mthvedtso if the RT loads it before main hits it, it seems you should be good...
11:28mthvedton the other hand, class loader stuff like this is very easy to break...
11:28gfredericksokay I think korma's (select foo (with bars)) returns a lazy seq that has remaining queries to make
11:29clgvI think the interface is needed for the inline implementation in a deftype
11:30mthvedtit would be odd if loading the deftype didn't load the interface
11:30technomancygfredericks: so it's a leak if not fully consumed?
11:30gfrederickstechnomancy: well I think what hiredman was saying yesterday about there being no with-connection macro means that korma is at liberty to assume that the connection is always available
11:30gfredericksI don't think it leaves queries open
11:31gfredericksI think as you consume each foo, it makes an individual query for all the bars of that foo
11:31gfredericksso each query is self-contained; but when the select returns there are more queries to make to realize the thing
11:32gfredericksin my case this means it makes way more queries than I'd like
11:37ppppaulis it possible, in emacs jacked in to lein/swank, to get lein to get lein to download new deps without me calling lein deps on the command line?
11:38ppppaulactually calling lein deps from the command line while my program is running is ok
11:38ppppaulis there an easy way for my program to use those deps without starting lein again?
11:38ppppaulwould C-c C-l do what i want?
11:39clgvppppaul: pomegranate
11:39gfredericksI expect you'd have to restart processes to get new deps in? So the classpath could be updated?
11:40clj_newb_2345is it possible to have both horizontal and verticlal wheel scrolling to work in java? (In particular, I'm using a trackpad on ubuntu 12.10)
11:40clj_newb_2345soI'm reading around, and it appears getting this to work requires recomioing the JDK or something
11:41clj_newb_2345is it possible to get both horizontal and vertical mouse wheel scrolling to work in swing/awt?
11:41clj_newb_2345i'm reading around, and it appears this requires recompiling the jdk
11:42clgvclj_newb_2345: you have more chances to get an answer in ##java I guess
11:43borkdudewhy does ##java have two #'s?
11:44clgvborkdude: there is some naming convention I forgot ;)
11:45gtrakborkdude: #java is more official, and invite-only
11:48gtrakborkdude: one time, during a netsplit, I successfully joined #java, but got kicked when it reattached :-)
11:54clj_newb_2345how does one join #java ?
11:54clj_newb_2345who sends out the invites?
11:54acron^Hi guys
11:54gtrakhow does one know if he's in the illuminati?
11:54acron^Cheshire is giving me "java.lang.ClassNotFoundException: org.joda.time.DateTime"
11:55clgvclj_newb_2345: join ##java instead
11:55dakroneacron^: cheshire doesn't use joda at all, can you paste a code example?
11:55devnwhat's that fancy pants lib that you add to your project.clj that will automatically pull in new deps to your repl session when you change project.clj?
11:55acron^It's stumping me a bit
11:55hiredmanacron^: that exception is cheshires weird way of telling you it does not know how to encode a joda time object as a json
11:56acron^http://pastebin.com/WxG81VUm
11:56acron^^ code
11:56TimMcdevn: pomegranate?
11:56dakronehiredman: cheshire *should* be throwing a JsonGenerationException if it can't encode it
11:56dakronenot a ClassNotFoundException
11:56hiredmandakrone: well I've seen it do that
11:57dakronehence the *should* :)
11:57dakroneacron^: and what does find-maps return?
11:57acron^A clojure map
11:57acron^from MongoDB
11:57dakroneacron^: cheshire has no encoder for joda dates, you'll need to add one yourself if you want to be able to encode them
11:57acron^(http://pastebin.com/KNQXhzxb < deps)
11:58dakroneI am guessing that is the issue
11:58acron^What's joda on clojars? "clj-time" ?
11:59dakroneI have no idea, I assume it's something monger is bringing in and using
11:59gtrakclj-time is a wrapper over joda
11:59dakronecould be noir also
11:59dakroneif you do a lein deps :tree you can see who's bringing it in
12:01ppppaulcould someone help me debug this simple error i'm getting related to package management https://gist.github.com/4260243
12:03ppppauli'm having a problem loading fs.core
12:03gfrederickshuh. I'd expect that to work.
12:03TimMcppppaul: The problem is likely with fs.core's ns header.
12:03gfrederickso_O
12:04gfredericksRaynes would never release a bug.
12:04TimMcOh, fs is something external?
12:04cmiles74ppppaul: I have more work to do on Bishop, but I used it on a couple real projects and it worked well.
12:05TimMcfs.core is a bad package name -- just waiting for a collision.
12:05ppppaulawesome
12:05ppppaulthe dsl looks very nice cmiles74
12:06cmiles74ppppaul: thank you! There's some cleanup that could still be done, I think. But that's always the way. :-P
12:06ppppaulTimMc, i removed the require, and i'm still running into compile errors (looks like my project still thinks that i'm requiring it, even after saving and recompiling)
12:06ppppaulcmiles74, how easy is it to use session store (ring or whatever) with bishop?
12:07TimMcgfredericks: I guess it's not Raynes' fault... in this case.
12:08ppppaulmaybe i need to re initalize the namespace
12:08gfredericksTimMc: that statement is always true
12:08cmiles74ppppaul: All of the work I've done so far has been geared toward web-services... Working with other Ring middleware is straightforward, but I haven't done any work using sessions. I don't think it'd be a big deal.
12:09ppppaulcmiles74, sessions are very important for me, is there an easy way to put ring middleware in bishop?
12:10cmiles74Session data comes through the request map under the :session key, I don't think you'll have to do anything.
12:10ppppaulwoot!
12:12cmiles74ppppaul: Looking at the pieces, IMHO it should all just work. :-D
12:12ppppaulTimMc, i had to use (remove-ns)
12:14cemerickpjstadig: Did you ever get your invokedynamic fork cooking? It'd be interesting to see how the cons/conj example fares under that.
12:16alexnixonTimMc: (thanks for pointing me at "locals clearing" at around this time yesterday - I had to go afk but didn't miss your message)
12:21ppppaulhey, i want to slurp a file that may not exist, and i don't want my program to break, but getting a nil back or something is ok. how would i go about doing this?
12:22thorwilppppaul: wrap it in a try?
12:23technomancy(if (.exists f) (slurp f))
12:23ppppaulgreat!
12:23ppppaulthanks technomancy
12:23gfrederickstechnomancy: ugh, so much code
12:23technomancyactually use and instead
12:23gfrederickswat.
12:23gfredericksfor unreadability?
12:23technomancygfredericks: you mean it could be 3x shorter with monads?
12:24gfredericks(-> f .exists (if (slurp f))) is clearly the most readable
12:24ppppaulhmm
12:24technomancygfredericks: logically you're looking for the existence of the file and the contents of the file
12:24ppppauli am mapping over a list of files
12:24cemerickI was going to wat at the binary if, but... #deadhorse
12:24ppppauli don't want to keep the nils in my array, would i use keep for this?
12:25gfrederickscemerick: what's a binary if?
12:25technomancygfredericks: the best kind of if
12:25cemerickvs. ternary
12:25cemericki.e. using if instead of when when there's no 'else' branch
12:25technomancyppppaul: if you're going to have to run a filter over it anyway you might as well check for existence before slurping
12:25ppppaulok
12:25cemericktechnomancy and I have been arguing about this for far too long :-P
12:25ivaraasengfredericks: the best solution is obviously to make the reader bind the symbol æ to (-> f .exists (if (slurp f))) and just use æ instead.
12:26gfredericksis technomancy's position that when indicate's side effects? I've always liked that interpretation.
12:26technomancyanother ally!
12:27gfrederickswhen is in the same pile with do
12:27ppppaulok, i have a (-> files (filter .exists) (map slurp))
12:27technomancygfredericks: as has been the lisp tradition since the dawn of time
12:27gfredericksI didn't know that.
12:27technomancyppppaul: .exists isn't a function; it's a method
12:27cemerickgfredericks: I guess you put let in that bunch too? :-P
12:27ppppaulhnmm
12:27cemericksymbol-macrolet, and we could all be writing APL by now
12:28gfrederickscemerick: I wouldn't mind there being a separate let for side effects. But that's probably being unnecessarily strict about it
12:29ppppaultechnomancy, i changed from using the method to using fs.core/exists?
12:29ppppaul:D
12:29gfredericksbut to the extent that the built-ins encourage you to make side-effects explicit, I think that's a good thing. Too far down that road lies haskell, and apparently we hate that. But maybe a little bit is okay?
12:29ohpauleezcemerick: Are you starting fires in here again? :)
12:29cemerickohpauleez: again? I thought that was my only job?
12:29ohpauleezhaha
12:30cemerickgfredericks: of course, nothing about these forms actually has anything to do with side-effecting or not
12:30cemerickin contrast to e.g. io!
12:30gfrederickswell, the only thing when gives you over binary if is the ability to add side-effect statements
12:31gfredericksso if you only use it when you need that, then you've got a side-effect flag. in a loosy sense.
12:31cemerickactually, it allows you to avoid the impression that perhaps you've accidentally left out a branch.
12:31cemerickWhich is what I think when I see (if x y) ;... where's z?!
12:31gfredericksright. So there's two reasons to distinguish between if and when. I guess the question is whether it's more useful to flag side effects or binary intentions
12:31technomancyaccidentally used a "dirty" arity of the macro?
12:32gfrederickswe could fix all this by (defmacro bif [x y] (list 'if x y))
12:32cemerickWe'd all need blotters under our keyboards if we wanted to mark side effects generally
12:32gfredericksand that would be more like back-to-the-future so I think that's always the way to go
12:33technomancyor a jira issue to fix the bug that if has multiple bodies
12:33seangroveWhat happened with recet versions of magit, everything takes way more key strokes now
12:33gfrederickstechnomancy: you'd prefer it ternary-only?
12:33technomancygfredericks: no; I'm pointing out how silly it is to claim that `if` is broken out of the box
12:34gfrederickstechnomancy: phew. I thought for a second you had said something that I didn't quite agree with initially.
12:34gfredericksCRISIS AVOIDED
12:34ohpauleezCARRY ON
12:34ohpauleeztechnomancy: No, I haven't the option to toggle things off and on
12:35ohpauleezbut the output isn't that verbose
12:35ohpauleezso I don't think it'll make it unusable
12:35ohpauleezyou just ignore whatever you think is nonsense
12:35technomancyI'll just wait till it's fixed
12:40seangroveIs kibit the standard clojure linter? I haven't used any yet, and would like to run some over my cljs
12:42ohpauleezIt's form-based static analysis - looking for common patterns of text to substitute, but there is no program or whole-function analysis
12:42ohpauleezit makes suggestions, for example, instead of using interpose on a string, you should use clojure.string/join
12:42seangroveYeah, just saw it referenced yesterday in dnolen's talk
12:43seangroveAny recommendations for a similar tool? Not urgent, just thought it'd be nice
12:43ohpauleezKibit is pretty good
12:43ohpauleezand it's as good as you're willing to make it
12:48SegFaultAXseangrove: Do you have a link for that talk? I meant to watch it but wasn't able to find the time yesterday.
12:49seangroveSure, one second
12:49seangroveSegFaultAX: http://skillsmatter.com/podcast/scala/the-refined-clojurist
12:49SegFaultAXseangrove: Danke!
12:50seangroveDe rien
12:52devn(print-table (:members (reflect Math)))
12:52devn(use 'clojure.pprint)
12:52devn,(use 'clojure.pprint)
12:52devn,(print-table (:members (reflect Math)))
12:52clojurebotnil
12:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reflect in this context, compiling:(NO_SOURCE_PATH:0)>
13:03SegFaultAXWhat is the best paraedit plugin for vim?
13:04ohpauleezSegFaultAX: paredit.vim
13:05ohpauleezhttps://github.com/vim-scripts/paredit.vim
13:05ohpauleezI believe this is the new home
13:11ppppaulwhere does lein keep it's deps?
13:11gfredericksin ~/.m2
13:11ohpauleezppppaul: in the .m2 // it uses maven
13:20rbxbxIs there a builtin fn that acts as a composition of map && dissoc ?
13:20rbxbxso given a collection of maps remove a key from all of them
13:21gfredericksI don't think so
13:21rbxbx(map #(dissoc % :key) coll)
13:21rbxbxgfredericks okay, thanks :)
13:21TimMcIf there were, I would wonder why someone wouldn't just use map and dissoc.
13:22gfredericksTimMc: well there are _some_ functions that are trivial compositions of others
13:22rbxbxgfredericks I dare say many ;)
13:22gfredericksbut I agree that one sounds a little too specialized given how often I haven't needed it
13:22gfrederickslike for example just today I didn't need it
13:22SegFaultAXohpauleez: Thanks, I've looked at that one a number of times but I wasn't clear if I should be using slimv with it.
13:22rbxbxhaha
13:23SegFaultAXohpauleez: If I would have just read the documentation I would have seen that it's part of slimv, but also it's own standalone plugin. ;)
13:23rbxbxalso, perhaps on the same subject, is there a prefered way to compose when the argument order is reversed?
13:23ohpauleezSegFaultAX: Nope, it was just pulled out of Slimv. There's even hooks for other systems in it (vimclojure, for example)
13:23rbxbxOr should one just use a single argument anon fn
13:23gfredericksrbxbx: I expect that's how most people do it
13:23ohpauleezrbxbx: Check out clojerks
13:24rbxbxohpauleez I moved, too late :)
13:24ohpauleezNOOOOOOOO
13:24ohpauleezrbxbx: back to NYC?
13:24rbxbxYeah. It's a net neutral move.
13:24rbxbxPortland and Brooklyn will have both lost and gained a clojurian
13:24rbxbx;)
13:24ohpauleez:)
13:24rbxbxohpauleez I do regret that we weren't able to hang out more though
13:25ohpauleezrbxbx: same
13:25SegFaultAXohpauleez: I'm seeing that now! By the way, do you use nrepl?
13:25ohpauleezSegFaultAX: vim+foreplay+paredit+surround
13:25ohpauleez+VimClojure (static)
13:26ohpauleezI've definitely been enjoying the nREPL life
13:26rbxbxohpauleez do you find paredit necessary with surround?
13:26rbxbxI mean, I'm guessing so, since you listed it.
13:26ohpauleezhaha, good guess!
13:27rbxbx;_;
13:27rbxbxPerhaps I'll give it another whirl.
13:27devthI find paredit annoying with surround - but that's because I've used surround forever and haven't taken the time to learn paredit
13:27rbxbxdevth ditto
13:27ohpauleezmoving parens, splicing, joining, navidating across parens and defns/top-levels, etc
13:27ohpauleezsurround is great for…. the surrounding things, but that's about it
13:28ohpauleezparedit, takes over from there
13:28ohpauleezkeeps things balanced, keeps the cursor where it needs to be, makes clearing up full forms easy
13:29duck1123I've never heard of surround, but how is it better than just M-(
13:29ohpauleezduck1123: cs'"
13:29ohpauleezchange surrounding ' to "
13:29ohpauleezds"
13:29ohpauleezdelete surrounding "
13:29devthysiWb
13:29TimMcrbxbx: You haven't lived until you've M-x paredit-convolute-sexp
13:30ohpauleezonce you learn it, paredit makes you far faster, saves keystrokes, and adds to the fun
13:30rbxbxI'll probably revisit. I can only learn so much at once :)
13:30TimMcIndeed.
13:30ohpauleez:)
13:31rbxbxTimMc just think how many people have died without ever really having lived
13:31rbxbx;P
13:31TimMcIt fills me with sorrow.
13:31rbxbxohpauleez did you find a clojure gig in pdx or are you still with ... tutor.... tutor... something?
13:32hiredmanparedit: harder better faster stronger
13:32ohpauleezstill with tutorspree and running my own R&D lab - NDensity
13:33rbxbxohpauleez neat :)
13:38hyPiRionSo, except for (not (nil? ...)), what other succinct ways are there to map a truthy value to true, and a falsey to false?
13:38hyPiRion/s/falsey/nil/
13:39technomancythere's `boolean`
13:40TimMc(comp not nil?) won't do that
13:41metellus,(boolean :x)
13:41clojurebottrue
13:41hyPiRiontechnomancy: well, that should fit my needs. Thanks.
13:41metellus,(boolean nil)
13:41clojurebotfalse
13:41hyPiRionTimMc: Well, strictly speak I only need to return non-falsey objects as true.
13:41hyPiRion/s/speak/speaking/
13:42metellusoh, technomancy beat me to it
13:42TimMc,(->> [1 true false nil] (map (juxt (comp not not) boolean)) (every? (partial apply =)))
13:42clojurebottrue
13:44TimMc(-> identity complement complement)
13:46hyPiRion(mapv #({false false, nil false} % true) [1 true false nil [] {}])
13:46hyPiRion,(mapv #({false false, nil false} % true) [1 true false nil [] {}])
13:46clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol:   in this context, compiling:(NO_SOURCE_PATH:0)>
13:47hyPiRion,(mapv #({false false, nil false} % true) [1 true false nil []])
13:47clojurebot[true true false false true]
13:53TimMc,(->> [1 true false nil (Boolean. false)] (map (juxt (comp not not) boolean)) (map (partial apply =)))
13:53clojurebot(true true true true false)
13:55TimMc(Boolean. false) strikes again!
13:55SegFaultAXohpauleez: When you say static vimclojure, do you just mean sand nailgun?
13:59ohpauleezSegFaultAX: Yeah, sans nailgun - I'm using foreplay/nREPL now
13:59ohpauleezVimClojure is just doing the syntax highlighting, indenting, etc
14:00ohpauleezbut with that setup you can `cpw` to eval the symbol your on, `cpp` for the paragraph, cqq to take the current form and put it in the "REPL" and I aliased cpr to require the file
14:01ohpauleez[d for source lookup, K for doc lookup
14:01rkingI wonder how I'd get 'lein' on Gentoo. dev-lang/clojure provided clojure-1.{1,4}, and dev-lang/clojure-contrib added a clojure-contrib.jar. Not seeing lein anywhere though
14:02technomancyrking: there was a package a while ago but it was pretty buggy. best to install 2.0.0-preview10 by hand.
14:02rkingtechnomancy: OK, thanks.
14:02rkingtechnomancy: Do you advise against installing from VCS?
14:04technomancyrking: you can run from git if you're interested in contributing to Leiningen. otherwise it doesn't make sense
14:05llasramHuh: ##[(compare [0 0] [1]) (compare [0 0] [1 :whatever])]
14:05lazybot⇒ [1 -1]
14:05technomancyrking: bootstrapping a self-hosted program is always a bit tricky
14:06rkingtechnomancy: OK, thanks.
14:08SegFaultAXohpauleez: That sounds awesome. I don't really like using nailgun. It feels a lot more painful than it should be to setup.
14:14hyPiRion,(let [b (Boolean. false)] (= b (not b)))
14:14clojurebottrue
14:15SegFaultAXhyPiRion: Huh?
14:15SegFaultAXHow?
14:15clojurebotwith style and grace
14:16hyPiRionIt's all in the details, isn't it.
14:17rbxbxDoes anyone have examples of some alternate credential-fn's for usage with friend? /cc cemerick
14:17marcellowhat's the best way to begin to go about splitting a large text into chunks that each have no more than 10k characters and no more than 250 lines
14:18rbxbxTrying to suss out the contract that function must uphold from the readme and builtin bcrypt-credential-fn and having a hard time
14:18marcellois a recursive loop my best bet?
14:18hyPiRion,(let [conj (memoize conj)] (map #(conj % 2) [[1] '(1) (ArrayList. [1])]))
14:18clojurebot([1 2] [1 2] [1 2])
14:19hyPiRionhurray.
14:19rkingHrm. Trying to install Datomic codeq (with little JVM / clojure) knowledge. java.lang.NoClassDefFoundError: clojure/lang/IFn means I should…
14:20hyPiRionmarcello: You're splitting a string either on 10k elements or 250 lines, whichever comes first?
14:20andrewmcveighrbxbx: from memory, the function needs to return a map containing {:username "foo" :password "bcrypted pass"}
14:20rkingFWIW 'lein repl' is working.
14:20marcellohyPiRion: exactly
14:20rking(And the above exception came from: java -server -Xmx1g -jar /home/rking/pkg/codeq/target/codeq-0.1.0-SNAPSHOT.jar datomic:free://localhost:4334/git )
14:21hiredmanrking: you need to build an uberjar
14:21hiredmanrking: read the datomic docs, do what they say
14:21hiredmanerrr
14:21hiredmanthe codeq docs
14:21rbxbxandrewmcveigh: hmm.. Thanks :)
14:21hyPiRionWell, you're accumulating over two things, so I'd use loop, yes.
14:21rkinghiredman: I did do that. That's what that codeq-0.1.0-SNAPSHOT.jar is
14:22hyPiRionWrite it in Java if performance is an issue.
14:22rbxbxandrewmcveigh I guess I could just throw a prn in there and see what the default is doing.
14:22hiredmanrking: you didn't
14:22hiredman"lein uberjar"
14:22andrewmcveighrbxbx: It's not working for you?
14:23rbxbxandrewmcveigh the default is, I'm trying to write my own though
14:23rkinghiredman: From a few minutes ago: https://gist.github.com/d7b2ce2eb68e5e1df8f2
14:23rbxbxandrewmcveigh dealing with legacy data that has been hashed differently
14:24hiredmanrking: ok, compare the jar name you are using with the jar name in the readme
14:25rkinghiredman: Theirs says -standalone.jar
14:25andrewmcveighrbxbx: ah, afaik thats what the bcrypt-credential-fn expects.
14:25rkinghiredman: Thanks.
14:26rbxbxandrewmcveigh this is a bit clearer than bcrypt-credential-fn to me, perhaps I'll use it as a reference – https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109
14:26andrewmcveighrbxbx: Oh, and it returns the "user" map, without the password key.
14:27rbxbxandrewmcveigh: I think associng on the identity was throwing me
14:28cemerickrbxbx: if the hashing is the only thing that differs, then you should be able to follow the pattern set by bcrypt-credential-fn
14:29rbxbxcemerick that and hitting the database to return the user vs looking up in a map
14:29technomancywho was in here yesterday saying that git doesn't suck?
14:29cemerickrbxbx: That's entirely separate from the hashing verification
14:30cemericki.e. if you keep them separate, then you can mix and match easily with partial
14:30Mr_Bondtechnomancy: I imagine that could have been a number of people :)
14:30rbxbxcemerick that was my next question. Indeed it is.
14:31rbxbxcemerick: https://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109 was throwing me a bit since it combines the two
14:31rbxbx...also, if I'm not mistaken, that function doesn't actually seem to get used in the example app
14:31technomancywell I just wasted a day working around the fact that git appears to have two different implementations of .gitignore parsing
14:32rbxbxcemerick cheers, thanks for the guidance :)
14:32cemerickrbxbx: you mean bcrypt-credential-fn?
14:32llasramtechnomancy: Huh. For what differing contexts?
14:32technomancyllasram: git ls-files claims to use the same logic as .gitignore, but actually completely ignores directory entries
14:32rbxbxcemerick I mean the private fn credential-fn defined on line 109 of that mock_app
14:32rbxbxhttps://github.com/cemerick/friend/blob/master/test/test_friend/mock_app.clj#L109
14:33rbxbxcemerick ^^
14:33technomancyyou have to use a glob if you want to ignore anything inside a dir
14:33technomancya triple-glob
14:33cemerickrbxbx: oh, indeed it does not
14:33amalloytechnomancy: triple-glob?
14:33technomancyamalloy: /dir/**/*
14:33llasramtechnomancy: Even with --exclude-standard ?
14:33technomancyllasram: ayup
14:33llasramhuh
14:34technomancybloody nonsense
14:35rbxbxcemerick I'd considered submitting a pull request removing it, but wasn't sure your original intent.
14:36cemerickIt's probably just cruft.
14:36llasramThat's weird... I'm not sure I'm seeing that behavior. I ask and am curious because I recently switched from `find-file-in-project` to a `find-file-in-repository` extension, and hacked in new-file-unless-.gitignore'd feature using those flags to git-ls-files
14:36cemerickrbxbx: submit away :-)
14:36rbxbxcemerick also I'm not comfortable enough with the clojures at this point to go submitting pull requests willy nilly and risking public shaming :p
14:37technomancyllasram: mkdir ignore; cd ignore; git init; mkdir hello; touch hello/world; echo "/hello/" > .gitignore; git ls-files -i -o -X .gitignore | wc -l
14:37technomancyzero here
14:41llasramOh! Weird. And yet with --directory, it will then show you the ignored directory
14:42llasramGood old git
14:42technomancyyeah, great behaviour for a command called ls-files =\
14:45Mr_Bondtechnomancy: ahh, that sucks (the git-ls parsing) are you using a recent version?
14:46cemerickis there a git incantation that will apply a patch without mucking with the of the tip of the patch? It seems github pull requests aren't closed when the patch is applied with e.g. `curl patch-url | git am --`
14:46technomancyMr_Bond: I have to make it work in production where we're running 1.7.0
14:46cemerickwith the SHA*
14:46Mr_Bondtechnomancy: I see, that's not to old anyway
14:47Mr_Bondthought maybe it was a difference in c/perl apps, and that if one of the tools where perl maybe it had been re-implemented in C
14:49tpopecemerick: git apply applies a single patch to your work tree without committing
14:50ppppaultaking advice from some of you guys from earlier today, i'm going to use liberator for my web api... however it actually has a symbol/dep bug in it. can someone point me to a resource that will help me learn how to use a patched version of the lib in my project. thanks
14:53rbxbxppppaul you can fork it and upload a version under your own org to clojars
14:54rbxbx(while submitting a pull request with the bugfix, of course ;) )
14:55rbxbxppppaul https://github.com/ato/clojars-web/wiki/tutorial explains that process
14:55rbxbxYou can probably also link against a local version, but I'm not sure how to do that.
14:57ppppaulthanks
14:58rbxbxnp
14:58cemericktpope: sorry, I botched my question. I was hoping to find a way to git am, but as if I were merging with --ff-only, say.
14:58cemerickBut, nm; it's inconsequential.
14:59cemerickGithub's change some time ago to merge pull requests with --no-ff still bums me out.
15:03rkingcemerick: What does that affect?
15:03cemerickrking: you get merge commits even when they're unnecessary
15:04rkingOh, OK
15:05tpopeyeah I hate that
15:05tpopebut it's consistent with "commit message closes the issue"
15:05pbuckley_I have two lists of maps with some overlap between them (both ways) and I want to merge them into a single list of merged maps - any pointers at what to look at? I'm banging my head on the cheatsheet and not finding anything suitable on my own.
15:05tpopeI cherry-pick and close the issue by hand :/
15:05ppppaulrbxbx, http://blog.cymen.org/2012/03/12/leiningen-and-lein-localrepo-how-to-create-local-maven-repository-for-jar-files/
15:05technomancyllasram: also apparently --directory only works with top-level directories, not nested ones woooooooo
15:06llasramI guess Linus wants you to do something like ( git ls-files -o -X .gitignore ; git ls-files -o ) | sort | uniq -u ?
15:06llasramIt's already 90% shell scripts, so one more layer can't hurt
15:06rbxbxppppaul good to know, bookmarked should the need arise again. Thanks :)
15:07tpopellasram: what's the goal?
15:07technomancyllasram: nope; still doesn't work
15:07raekpbuckley_: something like this? (let [x [{:a 1} {:b 2}], y [{:x 1} {:y 2}]] (map merge x y) )
15:08cemericktpope: you can still ff merge locally and push, but it's a PITA
15:08technomancygit: it mostly works, if you don't look too closely
15:08tpopeyep
15:08cemerickI still do it, just because merge commits bother me, unreasonably so
15:09hyPiRioncurl http://link.to.pull/request.patch | git am ? Not too hard
15:09tpopeI am so anal about my git history it probably qualifies as a disorder
15:10rkingtpope: It does.
15:10rkingBut at least it elevates the rest of us. ☺
15:10tpopeI rejected rking's commit because it had a unicode arrow in it
15:10hyPiRionJust a pity you can't configure whether merging or applying directly on top.
15:10cemerickhyPiRion: that produces a separate commit that isn't recognized by github as closing the pull req
15:11tpopecemerick: does a ff merge close it?
15:11pbuckley_raek - that seems to work, but discards maps that aren't in both lists
15:11cemericktpope: yeah, but you have to pull from the other remote and push
15:11raek,(map merge [{:a 1} {:b 2}] [{:x 1} {:y 2}])
15:11clojurebot({:x 1, :a 1} {:y 2, :b 2})
15:11cemerickI was hoping to be lazy and just copy/paste the .patch file URL from the pull req email, etc.
15:12hyPiRioncemerick: Oh, I thought it would close it. Well then, that sucks.
15:12raekpbuckley_: so you didn't want to merge the two sequences element wise?
15:12pbuckley_raek: they're not balanced - one list is two elems long, the other is three
15:12tpopeI have been being lazy, but it means I have to close my hand
15:12cemerickhyPiRion: nope, does one of those X authored, Y committed commits
15:13tpopehub is pretty good about encapsulating some of these workflows
15:13cemericktheir pull req UI used to be *perfect* in this way
15:13tpopee.g hub remote add cemerick to git remote add cemerick git://github.com/cemerick/reponame.git
15:15cemericktpope: hah, I thought you were just referring to github as 'hub' :-P
15:15tpopethe idea is alias git=hub
15:16tpopehttps://github.com/defunkt/hub
15:16cemerickoh, that's cute
15:16tpopelet's you cherry-pick github urls
15:16tpopelittle niceties like that
15:16cemerickand here I had just started using bitbucket more often
15:18tpopegit merge https://github.com/defunkt/hub/pull/73
15:18tpopecemerick: ^ probably does exactly what you want
15:18bbloomlast i tried hub, it had a 3 second startup time thanks to rubygems
15:18tpopeerr no, it passes --no-ff :(
15:19tpopebbloom: you probably installed it wrong
15:19rbxbxcemerick following the pattern laid forth by bcrypt worked. I still don't quite understand the cred-fn's contract though.
15:19tpopeor installed it before there was a right way
15:19bbloomi think the latter
15:19bbloomi'm usually pretty good with readmes :-)
15:19sshack(map fund :key (my-records)) maps over a key in a list of records, right?
15:19rkingI wish they wouldn't recommend 'alias git=hub'. That's really dumb.
15:20amalloypbuckley_, raek: if you want map to walk along the longest seq, rather than the shortest, your best bet is probably to pad the shorter ones with some placeholder element. for example, if you had https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L39 then you could (map (partial apply merge) (zip xs ys))
15:20cemericktpope: I get "fatal: http://.... —not something we can merge"
15:20cemerickanyway
15:20tpopecemerick: that's with alias git=hub
15:20amalloysshack: no
15:20cemerickoh, oh, right
15:21sshackamalloy: What did I get wrong?
15:21amalloyare you looking for (map (comp fund :key) records)?
15:21tpopecemerick: but it does --no-ff, so don't bother
15:21cemerickwait, I'm gonna get ruby all over me using hub? :-P
15:21cemerickheh, oh well
15:21sshackPossibly. I'd like a list of all the :key from values from each record.
15:21sshackSay, bank balances.
15:21amalloythat's just (map :key records)
15:22amalloyit's unclear what 'fund is doing there
15:22tpopecommand line scripts are one area where you clojure guys have no right to be snobbish :)
15:22sshackAhh. Perfect.
15:22amalloy(inc tpope)
15:22lazybot⇒ 1
15:22tbaldridge(inc lazybot)
15:22lazybot⇒ 10
15:23cemericktpope: I fix that by being snobbish w.r.t. scripts in general. ;-)
15:23seangroveDamn, it's basically impossible to get away from js' callback passing
15:23seangroveif it infects one method, it infects every method that needs to call it...
15:23bbloomseangrove: *sigh* i really really need to finish my CPS transform :-P
15:25seangrovebbloom: I'd love to see something like that... I have a sense I'm about to build a massive-ish event-coordinating service in cljs and going to have to re-write most of our things to work with it
15:25TimMcI don't mind the callback passing so much until there's a loop.
15:26bbloomTimMc: the operators in https://github.com/caolan/async are super useful
15:26bbloom(and trivially ported-to/used-by cljs)
15:26seangroveTimMc: the problem I have is that something written in callback style can't be used by non callback-oriented code
15:26seangroveI think that's my main problem... or at least one of them
15:27bbloomdammit, i have too many projects to choose from, but i think the CPS would have the largest impact on the community...
15:27bbloommaybe i'll just knuckle down and finish that this week
15:28seangrovePlease do ;)
15:28tbaldridge+1 bbloom
15:28seangroveIt's over my head to make it, but I'd love to use it
15:28amalloybbloom: have you looked into what, uh, whatshisname did on that topic a couple months ago?
15:28bbloomamalloy: the tail call recursion thing?
15:28amalloyyeah
15:28bbloomyes
15:28bbloomi'm following the same research papers he was
15:28tbaldridgeI really want to see Rx in Clojure. And I think it's not going to happen until someone just does it as a library.
15:28bbloombasically, it's a *selective* transform
15:29bbloomie doesn't transform expressions into CPS if they are *definitely not* going to execute any control forms
15:29bbloomhis project, however, used a totally custom form parser, analyzer, and AST representation. plus did some weird decidedly unclojurety things
15:30tbaldridgeI gathered that from his talk at the Conj. A few times I thought "this is awesome...but yeah...he doesn't use Clojure much".
15:30bbloomalso TCO doesn't require reifying continuations in any meaningful way
15:31pbuckley_amalloy, thanks that flatland.useful stuff was just what I needed
15:31bbloomok, fine, i'll try to finish that damn transform this week :-)
15:32seangrovebbloom: Have it on my desk by tomorrow morning, along with the tps report
15:32tbaldridgerofl!
15:33tbaldridgesorry, I saw that movie for the first time ever, this year. So it's still funny at times.
15:33bbloomheh, on that note: lunch time
15:35rbxbxtbaldridge I think the comparison of cps and tps is pretty funny even not having just seen it :)
15:39solussdany suggestions for a analog to Objective-C "Notifications" in clojure? E.g. "post"ing events (with some data) that are sent to anyone listening for them? Agents + watchers aren't a good fit, since agents really just guard state (agents could be used to approximate KVO in Objective-C)
15:39seangrovesolussd: Sounds like you want an internal pubsub mechanism?
15:41solussdmaybe (did soe quick googling)
15:41solussd*some
15:41seangroveI'm using shoreleave, which is just a wrapper around atoms (via add-watcher) and closure's javascript bus
15:42aphyrsolussd: could use the Observer interface...
15:42seangroveBound to be something similar for clojure
15:42ohpauleezaphyr: Shoreleave's pubsub is the Observer interface
15:42solussdaphyr: ah, I had forgotten about java. :)
15:42solussdmaybe I'll write something..
15:43ohpauleezohhh he wants it in Java
15:43solussdno i dont!!!
15:43solussdI had forgotten about Observer from Java
15:43ohpauleezsolussd: you want it in Clojure proper, on the JVM, right? or you want it on CLJS?
15:43solussdyes, clojure proper
15:44ohpauleezoh yeah, that's what I mean, Java ~ JVM
15:44solussdso, I *can* use java.. btut it doesnt need to be consumable from java
15:44solussdgotcha
15:44aphyrsolussd: https://github.com/aphyr/riemann/blob/master/src/riemann/pubsub.clj
15:44aphyryou can roll your own
15:44solussdthanks
15:44ohpauleezsolussd: Also take a look at the protocols used in Shoreleave's pubsub. You can copy them over direct to Clojure, drop in a bus, and you'll be good to go
15:45solussdinteresting. I'll investigate
15:47rbxbxIs there a cli friendly variant of javadoc?
15:48nDuffjavadoc proper isn't?
15:48rbxbxor would I just define my default browser as w3m/lynx/etc
15:48nDuff...oh, for the viewing end.
15:48rbxbxnDuff yeah :)
15:51bmaddySo is Noir still the general web framework to use these days?
15:52ohpauleezbmaddy: Ring+Compojure+lib-noir is pretty popular
15:53brehautbmaddy: eschew frameworks, go with just libs as ohpauleez suggests
15:53dr1Hello. I am new to functional programming. I'm working with a project that normally gets built using "lein uberjar", which creates a jar that I can then run from the command line. I am now trying to run it from the repl. I open a repl and go to the project's namespace using (in-ns …). But I don't see a main function that starts the project and nothing else shows the GUI. How can I find the "main" function that will launch it?
15:53ohpauleezI've dropped noir these days for that combo - mostly just to get around all the embedded statefulness in noir
15:53hiredmandr1: in-ns doesn't load code
15:53dr1well, after I switch to the namespace, I can see the related functions and can run them
15:53hiredmanit just creates an empty namespace with the given name
15:54hiredmanso you have loaded it some other way
15:54bmaddyohpauleez: Sweet, thanks for the advice.
15:54ohpauleezbmaddy: totally welcome, more than happy to help
15:54Raynesbmaddy: I maintain noir these days, but even I'd recommend ring + compojure + lib-noir.
15:54dr1I started the repl in the project's directory and ran (in-ns project-name.core)
15:54hiredmandr1: most of the time when a clojure project is uberjared and runnable that way the main function will be something like -main
15:54hiredmandr1: you did not
15:54dr1I do see that
15:54dr1how can I run it?
15:54hiredmanthat would throw an exception
15:55dr1I tried doing (project-name.core/-main) but that doesn't work
15:55hiredmanat the very least is would be (in-ns 'project-name.core)
15:55dr1right, sorry.. that's what it was
15:55dr1I'm very new to Clojure :)
15:55dr1so then, I see the -main, but I can't run it
15:56dr1ahh, actually…. I just started a fresh repl and am seeing a different error (that I recognize)
15:58dr1uhh… well now it works! not sure what I messed up before, but thanks!
16:01solussdaphyr: so, your code is licensed under the EPL and I want to use the pubsub namespace, in its entirety, in my project. Do I add attribution to the top of it even though you have not? Not sure what's appropriate.
16:02aphyrOh, hah, go right ahead and use it wholesale.
16:02aphyrDrop a comment in the top mentioning "adapted from riemann (https://github.com/aphyr/riemann)
16:02solussdthanks, but more just wondering what's the right thing to do (since I doubt your code will be the last epl licensed code I use)
16:02solussdexcellent- i'll do that.
16:02solussdthanks
16:02aphyrYeah I chose EPL just cuz it's what most of clojure seems to do
16:03seangroveAlright, I should just ask this to get it over with instead of trying different contortions: Is it possible (in cljs) to make async callback functions look like sync functions that can be called synchronously, if I write a wrapper function around each target async function that uses promises/dirty-black-magic?
16:03aphyrsolussd: not sure what the correct thing to do re epl code is, but as far as my stuff I'd just like some attribution. :)
16:04seangroveSomething like: my-happy-normal-function -(sync-looking call)-> my-individualwrapper-function -(call via promises/setInterval/something)-> original-js-callback-oriented-fn
16:04solussdaphyr: EPL says to leave "intact" contributor information, but given none I think it's appropriate to add it. :)
16:05seangroveI can see ways of doing it if I wrap the outside of it all in a kind of queue-manager, but ideally I could wrap the functions
16:10azhimI have an atom (def foo (atom #{})) -- I have a function that returns '("a" "b" "c"), how do I put "a" "b" and "c" directly into #{}, instead of conjing '("a" "b" "c") and getting #{("a" "b" "c")}?
16:11AimHere,(into #{} '("a" "b" "c"))
16:11clojurebot#{"a" "b" "c"}
16:11azhimAimHere: but in the context of a (swap! foo ...)
16:12azhimi wouldn't say (swap! foo into #{} '("some" "stuff"))
16:12azhimoh, duh, nevermind
16:12azhim(swap! foo into '("some" "stuff"))
16:12seangroveI suppose it's not possible without some pre-processor or compiler support
16:13seangroveEven macros can't really get around this, needs to be in the compiler I think
16:15bbloomhuh? just use a function...
16:15tnbdHello, concurrency question. I am trying to run two always running threads in parallel.
16:15tnbdOne is the noir webserver, the other is a web-scraper. The scraper writes to an atom periodically, the webserver reads from it. I tried pcalls, but the scraper gets almost no scheduling time. Any help would be appreciated.
16:15AimHereWouldn't you just wrap the function? (swap! atom #(into {} (foo %))) ?
16:15bbloom(swap! foo #(into % '("some" "stuff")))
16:15bbloomer yeah what aimhere said
16:15mpenetseangrove: you can use some sort of monad for that
16:16mpenetjayq has something like this for ajax & deferreds
16:16bbloomalso, if azhim if you want to wholesale replace the value in foo, you can use reset!
16:16mpenetseangrove: its looks like a let form, but it's all async underneath
16:17mpenetseangrove: so yeah, macros
16:17seangrovempenet: Yeah, I've seen it, but let me take another look
16:17mpenetseangrove: the do-> macro is the starting point, you could build what you want on top of it
16:18seangrovempenet: Yeah, I'll play around with this and see if I can wrap my head around it
16:19mpenetseangrove: look at the generated code maybe, it's quite straightforward
16:20bbloomtpope: did you say foreplay was supposed to auto-connect when you have target/repl-port ?
16:20seangrovempenet: is *-m supposed to signify it's a monad?
16:21rbxbxbbloom that's correct
16:21bbloomhm, not working for me
16:21mpenetseangrove: yes, but there is no convention for this I think, it's just to indicate it's supposed to be used with do-> since it's in a file where most of the fns are public
16:22mpenetseangrove: it's more or less a direct port of http://roy.brianmckenna.org/ stuff on this
16:22seangroveAnd is there any quick example of using do->?
16:22mpeneton the readme
16:23rbxbxbbloom if you explicitly connect does it work?
16:23mpenetseangrove: let-ajax and let-defered are just thin wrappers around do-> and bind/return definitions
16:23rbxbxvia :Connect and walking through the 'wizard'
16:23bbloomrbxbx: yes
16:24bbloomi've been using :Connect
16:24seangrovempenet: Got it, thanks for humoring me
16:24bbloomi'm trying to debug it now
16:24rbxbxif you :set verbose=1 and try to eval something without connecting what does it say?
16:25bbloomoh weird, it seems to be workign now
16:25bbloomhmmm
16:25bbloom*scratches head*
16:25bbloomoh
16:26mpenetseangrove: if you have a look at roy's example, specificaly the generated js, it might help understand
16:26bbloomweird. i guess it works, nevermind :-P
16:26tpopethought so
16:26bbloommy apologies for ever doubting :-P
16:27bbloomok, seangrove i need to push the CPS transform down 1 on the stack… gotta get foreplay working with cljs, i miss it already
16:27seangrovebbloom: Yaks to be shaved, I understand
16:28seangroveTook a day out last week and that's why I have piggieback and friends working, it's helped out *hugely*
16:28bbloomseangrove: i'm gonna investigate getting piggieback incorporated into cljs proper
16:28bbloomwhere's dnolen when you need him? :-)
16:28mattmosssay his name three times?
16:29seangroveHeh, once in irc, once on hn, and then once on twitter?
16:29bbloomheh, i'll avoid beattlejuicing him until i really need him
16:35bbloomcemerick: piggieback question
16:35bbloomwhat's the incantation to connect to a cljs session?
16:36bbloom(cemerick.piggieback/cljs-repl) works nicely
16:36cemerickbbloom: well, that was the answer I was going to give you :-P
16:36bbloomheh, i mean to ask about connecting sessions
16:36cemerick"connecting sessions"?
16:37bbloomis there some kind of "run this only if this is a new session"
16:37bbloomie when there is no terminal, if i evaluate (cemerick.piggieback/cljs-repl) it won't terminate, right?
16:38cemerickbbloom: no, it'll start a Rhino env if you don't override its defaults
16:38cemerickI'm not grokking your Q, I think.
16:38bbloomthe cljs-repl function is a blocking loop, right?
16:39cemerickno
16:39bbloomoh
16:39bbloomok, then i guess i don't understand anything about nrepl and probably should study it before i continue :-)
16:40cemerickit "installs" a cljs environment in your *Clojure* dynamic environment, which the piggieback middleware then uses to drive evals, load-file, etc.
16:40bbloomah, ok, looking at it now
16:40cemericknREPL doesn't use stdin/out at all
16:40bbloomok cool
16:42cemerickbbloom: if you really want to screw with your head: the same pattern could be used to hoist a JRuby/Groovy/Scala/Scheme/whatever REPL on top of nREPL
16:43bbloom+1 for generality :-)
16:43cemerickor something :-)
16:43scriptorwait, nrepl for other languages?
16:44cemerickpurely theoretical at the moment, but quite doable
16:44technomancycemerick: someone in #emacs was wondering whether nrepl could be useful for elisp-to-elisp communication.
16:46cemerickhrm
16:47cemerickpeople there generally don't like jvm startup, etc
16:47bbloommy VimL skills are hopeless
16:47technomancycemerick: yeah, I told him the idea was bonkers =)
16:48RaynesOh look, github rewrote gist.
16:49technomancyhuh; they stopped using the word "private"
16:49technomancyprobably wise
16:50RaynesThe paste creation screen looks to be on par with refheap for simplicity, but it uses ace instead of codemirror for paste authoring so that's a lot worse. The actual paste pages are pretty bad imo, especially with comments. I thing I still win on actual paste pages because I make a point of making code the most important thing there.
16:50RaynesI don't make it smaller by putting menus on the sides and stuff.
16:51RaynesThe actual features are perfectly doable in refheap, I just haven't gotten to them yet.
16:51technomancyrefheap has the advantage that when I want to change the language, I can click on the drop down and do so
16:51RaynesExcept for the git repository crap which I still thing is pointless.
16:51technomancyfor some reason gist is stuck on "text"
16:52RaynesI've never once wanted to download a git repository of a paste. I guess maybe some people do. I'm just not one of them.
16:52technomancyRaynes: it's just solving a different problem from refheap
16:52bbloomRaynes: I've forked a gist before…. but it's because some weirdo made like a 5 file gist project
16:52technomancyI've forked one to give feedback on a draft blog post
16:52amalloytechnomancy: my experience has been that if your gist "filename" is weird, eg *scratch*, their web ui loses the ability to change language
16:52Raynesbbloom: Refheap has forking, but it isn't that useful until I add paste history and history diffing.
16:53RaynesThis is why I don't do a 'file' thing.
16:53technomancyamalloy: this is on a fresh visit to gisthub.com; nothing created yet
16:53amalloyi fork gists all the time. only a few times have i cloned the git repo though
16:53RaynesI'll add multi-paste support, but each paste on the page will be a new refheap paste.
16:53bbloomyeah clone is what i mean
16:53RaynesIt makes it tons easier to work with the API, for example, because of no confusing nested json.
16:55Raynesamalloy: Is Justin using refheap yet?
16:55RaynesSeems like I've seen him throw you or Lance one here or there.
16:56amalloysometimes
16:56Raynes"I managed to drag gist users half way to refheap."
16:58RaynesI'd have markdown support finished on refheap right now had I not got side tracked into writing an enlivealike.
16:59RaynesI got to a point where it was like "Well, I have this html, and I'd like to change this node here. Enlive would work." so the obvious conclusion was to write my own library.
16:59nDuff...I already _have_ a unified identity, damnit. :)
16:59ivanmay you crush hastebin and vaporize its ashes
16:59RaynesnDuff: Just log into google and pretend it worked.
16:59RaynesI haven't seen anybody use that thing in 100 years.
17:00RaynesHastebin has a nice UI, but it doesn't *do* a whole lot.
17:00RaynesWhich is great for some people, but not really for me.
17:00nDuffRaynes: Sorry? I _am_ logged into Google, but refheap's Persona setup doesn't appear to be able to take advantage of that.
17:00RaynesI want markdown, forking, history, diffing, etc.
17:00RaynesnDuff: It was a joke.
17:00RaynesSorry.
17:00RaynesI'd add alternative ways to sign up, but I'd almost rather kill myself than add a "Or sign up with…" link up there.
17:01bbloomcemerick: how do i opt into the nrepl with the sessions fix?
17:01bbloompresumably just a dependency in my project file?
17:02cemerickbbloom: use "0.2.0-SNAPSHOT" and add the sonatype OSS repository to your project.clj
17:02Raynesamalloy: I could understand him not wanting to use it without good history. Seems like it's the thing you guys use/like the most about gist.
17:02ivaraasenRaynes: better add support for img links to meme pictures as well. the gist users will go wild.
17:02nDufferr, "#### users!" count
17:02bbloomcemerick: use just means dependency, no fancy repl-options or anything, right?
17:02RaynesBut it's at the top of my todo list after markdown support.
17:02Raynesivaraasen: Hah.
17:02cemerickbbloom: right, no special config required
17:02Raynesivaraasen: Well, you can embed a link to an image in markdown files when markdown support is done. ;)
17:03bmaddynDuff: I have a friend who works on Persona, want me to share some of your complaints with him? (or are most of them inherent in their system?)
17:03ivaraasenRaynes: you should offer some premade ones as well
17:03Raynesbmaddy: Oh yeah, didn't I tell you a long time ago that I'd delegate all bitching to you? :p
17:03technomancybmaddy: doesn't work with my browser (Conkeror)
17:03nDuffbmaddy: the core thing is lack of interop. If I have an OpenID provider with physical token authentication, I absolutely, positively don't want any new identity which I can't sign into with that token.
17:04ivaraasenRaynes: like this http://www.quickmeme.com/meme/3s5fro/
17:04bmaddyWell, fire away everyone. I'll just point him to this chat. :) He'll be happy to see feedback from a smart community.
17:06aphyrivaraasen: dead
17:10bbloomcemerick: ok got it, but this might be a lot of work, since cljs doens't support (require ...)
17:12cemerickbbloom: what might be a lot of work?
17:12bbloomgetting foreplay and cljs to (fore)play nice together
17:13bbloommainly cljs' fault for having an insufficient module system
17:14cemerickpiggieback works like a charm with lein and ccw; why not foreplay?
17:15bbloompiggieback is working
17:15bbloomit's just all the require and namespace switching and stuff
17:15bbloomim looking into it
17:16cemerickhrm
17:16cemerickI mean, once you start a cljs-repl, you can't send clojure code on the same session
17:17cemerickI generally have two sessions going when I'm going cljs stuff; one for piggieback/cljs, one for Clojure and the backend.
17:17bbloomyeah, i'm not even to that stage yet :-)
17:19cemerickbbloom: FWIW, I've been sitting on a cljx nREPL middleware that helps tremendously
17:19cemerickone of these days...
17:19tomojwhen I (in-ns 'foo) with piggieback, my require(-macros) :as aren't visible
17:22amalloyi remember one of the things rich said at some point is that clojure provides a la carte the features that OO gloms all together into the single "Objects" feature. polymorphism, namespacing, whatever. does anyone know where he said that? i'd like to find the full list of features he mentions, if possible
17:23cemericktomoj: there is no in-ns in cljs
17:23cemerickamalloy: sounds like the strange loop talk
17:23tomojstrange
17:23tomojit definitely seems to work in a limited way
17:23amalloycemerick: simple made easy, from last october? thanks, i'll give it a look
17:24bbloomcemerick: eh, there sorta is
17:24cemerickamalloy: don't remember the name; it was the guardrails talk IIRC
17:24tomojthe prompt changes and I can use the defs in that namespace without qualification
17:24bbloomin-ns is special cased in the repl code
17:24cemerickheh
17:24tomojI see, but because no in-ns in cljs, require :as doesn't work?
17:24bbloom(in-ns 'foo) ; works
17:24bbloom(do (in-ns 'foo)) ; doesn't work
17:25tomojstrange :refer does work
17:25tomojmaybe not that strange
17:26cemerickI'll just carry on thinking that there's no in-ns in cljs ;-)
17:27bbloomi kinda wish core was split into core.compiletime and core.runtime
17:27bbloombecause core.compiletime isn't available at all in cljs ...
17:28seangroveAny reason (js->cljs obj) would just be returning a normal js-obj?
17:30tomojit doesn't implement IEncodeClojure and the default case doesn't cover it
17:31seangroveAh, something inside it maybe?
17:31seangroveInteresting
17:31tomoj..interesting that IEncodeClojure has the unary arity in the protocol
17:31seangroveI wished it failed or mentioned something though
17:32seangroveSuppose it's easy enough to get around it though
17:37bbloomok i don't think i know enough about vim or nrepl to tackle this :-/
17:37bbloombut i do know enough about cljs to know it's not gonna make this easy
17:37bbloomso maybe my time is better spent fixing up cljs and then leaving the vim and the repl to the experts....
17:37bbloom:-P
17:37bbloommeanwhile, that means i have to live without foreplay for cljs...
17:38tpopedon't look at me, I don't even know where to start
17:39cemerickbbloom: maybe send a message to clojure-tools for me to look at later? I'm not following much at the moment.
17:39bbloomcemerick: ok
17:39bbloomtpope: my hope is that we can improve cljs until it's practically zero work for you
17:39seangroveheh, the yak-stack gets deeper
17:39bbloomcljs and clj should work nearly identically
17:39cemerickFWIW, I didn't need to make any changes to lein or ccw to use them with piggieback/cljs
17:40bbloombut there are *a lot* of differences for tooling currently b/c cljs doesn't provide a lot of core features…. like the require function....
17:40cemerickSo, whatever's wrong, it shouldn't be *too* tough to fix. :-)
17:40cemerickbbloom: that's a cljx/feature expression problem
17:40tpopebbloom: first step is getting it to where I can talk to it from the command line
17:40tpopeif framing things that way makes it easier for you
17:41bbloomcemerick: maybe the fact that ccw works implies that foreplay is doing stuff that it should be
17:41bbloomtpope: i have cljs running in a terminal under nrepl just fine
17:42bbloomand i can send it expressions to evaluate, but foreplay does some conveninence things like calling 'require for you
17:42tpopeI mean I need to be able to run a command that evals and returns the result
17:42tpopeyeah step 2 is the tricky stuff like the require
17:43bbloomtpope: oh, step 1 is easy. i'll post my project for you
17:44tpopeso would something like changing eval to in-ns work?
17:44tpopeerr require to in-ins
17:44tpopeerr require to in-ns
17:44bbloomtpope: i think what you actually want is require to (ns ...)
17:44bbloomi think you need to evaluate the top form in the file
17:45seangroveWhy would the first object (pulled from another object) not encode into cljs, and the second one (made fresh) will: http://dl.dropbox.com/u/412963/Screenshots/ar.png
17:45bbloombut i might be wrong
17:45tpopeimplicitly evaluating *part* of the file sounds like trouble waiting to happen
17:45bbloomagreed...
17:46bbloomanyway, see this gist and comment: https://gist.github.com/4262975
17:46bbloomtpope: that will get your a working cljs nrepl in zero time
17:46tomojseangrove: hmm, cljs.core.type(r) is Object ?
17:46tomojlooks like it
17:46tpopebbloom: what happens if I talk to that repl over the network?
17:46seangrovetomoj: Yeah
17:46seangroveBut so is cljs.core.type(t)
17:47seangroveAh, interesting...
17:47bbloomtpope: it responds reasonably, it's just that you get errors for trying to use 'require etc
17:47seangrovecljs.core.type(t) == Object
17:47seangroveThat's true, but with r it's false
17:47seangroveMaybe r's prototype has been altered...
17:48seangrovehttp://dl.dropbox.com/u/412963/Screenshots/as.png
17:48tomojhmm.. wat ?
17:48bbloomtpope: i'll write up some notes and put them an in an issue
17:49tpopebbloom: yeah that's good, can't really get into it this very second anyways
17:49tomojObject is not cloneable, so what the hell else could that be?
17:49bbloomtpope: no worries
17:49seangroveMaybe I'm missing some js runtime detail...
17:53seangroveNo, no idea
17:53seangroveTime for a nap
17:58tomojdo you have multiple js files?
17:58tomojshouldn't matter I guess
17:59tpopebbloom: the nrepl eval call lets me send along an ns. maybe the solution is to drop the require entirely?
18:00bbloomtpope: that'd be nice
18:00technomancysomething to watch for when sending require across the wire: http://technomancy.us/143
18:01gfrederickstechnomancy: please rewrite that sentence so that it rhymes more
18:02zodiakstrange question perhaps but.. is there anything like lisa (the expert system) for clojure ?
18:02technomancyhow about iambic pentameter? "A caveat to watch for with require"
18:02gfredericks(inc technomancy)
18:02lazybot⇒ 41
18:02gfrederickswoah man he's on the brink
18:03gfrederickstechnomancy: you get to do one more good deed and then you have to stop
18:03ssiderishello, I do a lein push and I get no error, but the jar is not showing up in clojars... any ideas?
18:03technomancygfredericks: still got 87 to go assuming an unsigned int
18:03tomojseangrove: where's that r come from? I think you'll have to extend IEncodeClojure to the other Object. which is.. weird
18:03technomancyssideris: try `lein deploy clojars`?
18:03ssideristhanks
18:03technomancyunsigned byte rather
18:05tomoj(identical? (type x) js/Object) (from the default IEncodeClojure) only works if x was creating in the same js context
18:05tpopetechnomancy: ran into a similar issue with in-ns, and solved it with eval \o/
18:05tomojI wonder if protocols have a similar problem?
18:06Sgeo|web_What problem?
18:06Sgeo|web_Oh, that thing I don't quite understand
18:11ssideristechnomancy: lein deploy clojars asks me for my username and after I enter it, it stops
18:17technomancyssideris: some kind of networking issue maybe? proxy?
18:17ssideristechnomancy: nope, i'm at my straightfoward home network :-)
18:17ssiderisLeiningen 2.0.0-preview8 on Java 1.6.0_26 Java HotSpot(TM) Client VM
18:18ssiderison windows
18:18ssiderisin cygwin
18:18ssiderisscp is installed
18:18ssideris(if that's relevent)
18:19technomancyhrm; scp shouldn't be necessary
18:19technomancymaybe try preview10? can't remember if we fixed any deploy bugs.
18:19ssiderisok, let me see...
18:19S11001001ssideris: what kind of terminal?
18:19ssiderismintty
18:20ssiderislet me try from vanilla cmd
18:20S11001001oh windows huh
18:20ssiderisyes
18:21ssiderishm, with cmd it goes a bit further, but then it complains about the lack of gpg
18:21ssiderisso I take it needs to be in the path
18:21technomancyssideris: you can disable the signing of releases if you just want to get it out to the clojars classic repo
18:22ssiderisoh sure
18:22ssiderisis it easy?
18:22technomancycrap; it looks like that might not be documented
18:22technomancy:deploy-repositories {"clojars" {:url "https://clojars.org/repo&quot; :sign-releases false}} ; IIRC
18:23ssiderisin profiles.clj?
18:23technomancyyeah, in the :user profile
18:23ssiderisok, thanks, let's see...
18:23technomancythat means your jar won't get promoted to the releases repository though
18:23technomancyso in the long run it's best to get GPG installed so you can sign your deployment
18:24brehauthaving just done the GPG thing for lein / clojars recently: its such a simple process if you follow the instructions that its totally worth taking ten minutes to do it
18:25technomancybrehaut: well, on unix anyway =(
18:25technomancythanks for the vote of confidence though =)
18:25brehauttechnomancy: oh. yeah windows. balls
18:25technomancyit's really worth learning how to use public-key encryption anyway though because it's an invaluable tool every professional developer should be comfortable with
18:26ssideristechnomancy: thanks, it worked! i'll set it up properly at some point...
18:27technomancycool
18:27technomancyssideris: so it worked from lein.bat but not mingw?
18:27ssiderisit seemed to be an input problem
18:28technomancyoh, like it was unable to prompt for credentials?
18:28ssiderismitty (the cygwin terminal) would exit after pressing enter after the username
18:28ssiderisyes
18:28technomancyyou can use gpg to encrypt your credentials so you don't have to re-enter them every time
18:28technomancyuseful thing to have! =)
18:28ssiderissure, I'll do it soon, it's my first time through the process, so I'm still setting up
18:28technomancyyeah, one step at a time
18:29ssiderisso, there is a "more official" repo that contains signed jars and the old clojars repo is being decommissioned soon?
18:30technomancyssideris: it's not being decommissioned; it's just not going to be checked by default in lein 2.0.0 final
18:30technomancyyou still use the classic repo to deploy to the releases repo
18:30technomancyI really need to get better docs around that
18:32ssiderisoh so the old one is like a staging repo for snapshots etc?
18:33technomancyyeah, it's the "anything goes" repo
18:33technomancyand qualifying non-snapshot jars may be promoted into the releases repository, which is backed by S3 and only accepts jars with signatures and proper metadata (:url, :license, etc)
18:34ssiderissounds like a good plan
18:34technomancyin theory anyway
18:35ssiderisI'm trying to make the new C2 :-)
18:35ssiderispromoting fragmentation in the community
18:35tomojI wonder if delay was left out of cljs on accident
18:36ssiderismaking sure that newcomers are overwhelmed by too many libs :-D (joking)
18:37eggheadi missed the LA data viz talk last week :(
18:37eggheadbeen reading cljs up and running, good stuff
18:59tomojs/I wonder if delay was left out of cljs on accident//
18:59tomoj..duh
18:59tomojit's just in the macros file
19:28kirindaveGot an odd problem.
19:28kirindave~/.m2 has clj-json installed
19:28clojurebotGabh mo leithscéal?
19:28kirindaveIt's in my project.clj
19:28kirindavelein deps runs cleanly.
19:28clojurebotLeiningen 2 is still in a preview release, but see the upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
19:28kirindaveBut (:require [clj-json [core :as json]]) fails
19:29kirindaveAnyone seen anything like that beofre?
19:30seancorfieldhow does it fail kirindave ?
19:30kirindaveCaused by: java.io.FileNotFoundException: Could not locate clj_json/core__init.class or clj_json/core.clj on classpath:
19:30technomancykirindave: any reason you haven't upgraded to cheshire? clj-json is pretty outdated.
19:30nDuffHrm.
19:30seancorfieldwhat does lein classpath show? (to make sure it picks it up)
19:31kirindaveIt certainly does
19:31kirindavetechnomancy: This is not new code.
19:31kirindaveJust trying to recompile.
19:32kirindavetechnomancy: Also 90% of what chesire adds does not interest me whatsoever. clj-json's austerity was liberating.
19:32kirindaveseancorfield: Lein classpath does indeed have the right path to the jar.
19:33kirindaveAnd I've already checked (and re-downlaoded). It's a valid zip file that contains the files I'd expect.
19:34kirindaveI've been off in haskell land for awhile so I haven't touched this build for 2 months. Kinda confused where it'd go wrong over that short a span.
19:34technomancykirindave: you're just more likely to end up with version conflicts the more libs you add since clj-json brings in a really old jackson
19:35kirindavetechnomancy: Interesting. Could that manifest as a failure to find clj-json.core?
19:36kirindaveIt's trivial for me to just rip it out. I guess I'll try that.
19:38technomancykirindave: no, it'd be classnotfound in jacksonland
19:39jonasacanyone got some recommendations for database-migrations/dsl to query a defined connection and also maybe something to mock db calls
19:39technomancykirindave: maybe check `lein classpath` matches (System/getProperty "java.class.path") from inside the repl?
19:39kirindavetechnomancy: It does.
19:39technomancyjonasac: I use this for migrations: https://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj
19:40kirindavetechnomancy: Cheshire seems to work fine.
19:40technomancykirindave: how about (clojure.java.io/resource "clj_json/core.clj")?
19:40kirindaveSo, uh, I'm going to pretend I didn't see this.
19:40kirindavetechnomancy: Unless this is valuable feedback for you to chase a bug.
19:40technomancykirindave: heh probably not?
19:41kirindavetechnomancy: One thing you learn doing fulltime scala: stop pretending java deps are anything but sane and as a result your sanity is retained. :)
19:41kirindaveErr, but insane.
19:41seangrovetomoj: What do you mean created in the same js context?
19:41technomancyyeah; at least with clojure there are only a few layers and it's pretty transparent to peer around them
19:41kirindaveCan't spend time caring about maven or ivy anymore. Got too many stress lines already. :D
19:42kirindavetechnomancy: Btw what I was talking about in that tweet is that like… if you have an emacs paredit error in the NS macro it still fails to really tell you what happened. :)
19:42tomojseangrove: like if the object was created in another frame
19:43kirindaveProbably because everyone uses raw macros and not MBE so error reporting is something of a pain.
19:43seangroveAh, ok, makes sense
19:43technomancykirindave: oh man that's like a confluence of badness
19:43technomancythe ns macro and error messages
19:43kirindavetechnomancy: Every macro, really.
19:43kirindavetechnomancy: I love chas's bandalore library, for example. But argument errors propagate a lot of weirdness that is not always obvious. :)
19:43seangroveI suppose I could deep-copy the object into a new one in the local context
19:44kirindavetechnomancy: At least we get more error messages now. Remember when it was just silent fail? :D
19:44kirindavetechnomancy: Those were the kinda errors you huddle around the campfire at night scaring your friends with tales of.
19:44tomojI wonder if extending IEncodeClojure to object would work
19:45tomojI don't really know what 'object' means
19:46chillenioushi folks. quick n00b question.... I'm trying to call a static method of a class without any parameters, but that seems to confuse Clojure into thinking it should be looking for a field
19:47chilleniousin Java, I'd do CsvSchema.emptySchema(), so I thought I'd do (CsvMapper/emptySchema) in clojure
19:47chilleniousany hints?
19:49jonasactechnomancy: thanks
19:49seangrovetomoj: seems like that was the issue, yes: (js->clj (json/parse (json/serialize obj)) worked
19:49nDuffchillenious: Generally, what you're doing now is the right thing.
19:49seangroveUnfortunately I think it might be in one of the more performance-critical paths, we'll see if there's too much overhead
19:50nDuffchillenious: ...of course, it'd be (CsvSchema/emptySchema), to make the class names match up.
19:51tomojseangrove: maybe try this: https://www.refheap.com/paste/74e81f0e917f54c4f7bdba415 (untested)
19:51tomojer
19:52tomojthat won't work ofc
19:52chilleniousgives me java.lang.NoSuchFieldException: emptySchema, compiling:(com/teachscape/libview/views.clj:90)
19:52seangroveS'alright, you already helped me figure out the problem for now
19:52tomojI left out the thisfn from the default IEncodeClojure impl
19:52tomojbut that won't really work since that's the problem
19:52seangroveI can at least make some progress now
19:53tomojand recurring on -js->clj incurs option parsing too many times
19:53chilleniousoh, duh good point nDuff
19:54chilleniousyeah, that was the problem
19:54chilleniousthanks
19:56technomancyRaynes: the great thing about the new gist is that *all* existing tooling/clients for gist are broken
19:56technomancyconsider it an opportunity =)
19:57tpopetechnomancy: whoa, they broke the api?
19:57technomancyapparently
19:58technomancyI just use scpaste, so I don't particularly care.
19:58tpopecurl https://api.github.com/gists
19:58tpopeworks for me
19:59sshackThis is a bit left field. There are no clojure libraries for dealing with /bad/ date/times are there?
19:59technomancys/all existing tooling/all nontrivial tooling/
20:00sshackThings like parsing 61/19/1983, into something incorrect, but at least a correct date.
20:00technomancysshack: I couldn't find anything when I looked
20:00technomancythat was like 2 years ago though
20:00tpope*shrug*
20:00sshackI have a feeling there's a million of them, all baked into insurance applications on ibm mainframes.
20:00tomojseangrove: http://dev.clojure.org/jira/browse/CLJS-439
20:00sshackWritten in cobol of course.
20:01technomancysshack: there's at least one in clojure baked into a document processing pipeline =)
20:01seangrovetomoj: Thank you
20:01technomancymy favourite was one where the timezone was "X-User-Defined"
20:06tomojI wonder what the options for IEncodeClojure are supposed to be for, other than keywordize-keys
20:07tomojsee a possible path to a fix if it were changed to a boolean or keyfn, cheshire style
20:07sshacktechnomancy: Sigh. See that's my trouble.
20:08sshackYou'd think that handling malformed dates would be built into time/date libraries. But no, authors seem to think the real world is some pristine beautiful place.
20:08sshackFull of unicorns, and pixie dust.
20:08technomancyyou'd think people who have studied the history of the Gregorian calendar wouldn't be capable of that fallacy
20:09technomancyon the other hand: do one thing and do it well
20:09technomancythey are certainly orthogonal concerns, and I'd much rather have a solid foundation than a library that tried to do everything and didn't get it right
20:10sshackI think that leads us to where we are now.
20:10sshackLots of individual programmers making kludges "just so I can get this done and move on"
20:11technomancyright; but Joda as a foundation is pretty solid
20:11technomancywhereas Ruby's has parsing built in, but isn't immutable
20:11brehauti frequently wish i had joda in python
20:11technomancyI guess Ruby did get interval calculations though at least
20:12sshackCan joda guess an invalid date?
20:12hiredmannlp is not a solved problem, dates are a large subset of nlp
20:12technomancysshack: no
20:13brehauteven humans cant guess invalid dates correctly
20:13technomancyyeah, and then you have issues with the stupid american month order introducing ambiguity too
20:13brehautyeah
20:13brehautfirst step is to ban ##/##/year date formats all together
20:14sshackbrehaut: Correct.
20:14sshackYYYYMMDD only
20:14sshackno two digit years.
20:14brehautyup. dots optional
20:14technomancynah just switch to metric time
20:14brehauttechnomancy: are you sure you are an american?
20:15hiredmankiloseconds!
20:15technomancybrehaut: difficult to self-identify as such
20:17brehautin america do you get to use the really wacky imperial units like hogsheads etc?
20:17brehautor just the boring ones
20:17technomancyfurlongs and fortnights
20:17hiredmandepends how committed to the bit you are
20:18technomancyat least our money is base-100 though
20:20seangroveThink it might be time to add edn as an output format in the rails format
20:21seangroveerr, rails app
20:21amalloyfathoms, probably
20:24seangroveHas anyone used edn much in javascript-land? We have an rpc-bridge that has to speak json over Chrome's postMessage method, and slightly worried about the overhead of parsing/serializing edn in hotpaths
20:25brehautseangrove: have you looked at https://github.com/shaunxcode/jsedn ?
20:25seangrovebrehaut: on second thought, I may be able to use the cljs reader, no?
20:26brehautseangrove: if you are clojurescript, definately
20:26seangroveYeah, I'm in cljs-land, but they have to communicate over a js-pip that'll convert everything to json
20:26tomojchrome extension?
20:26seangroveYeah
20:27brehautseangrove: i cant speak for the clojurescript reader or jsedn, but theres no reason that the deserializer cant be screaming fast
20:27tomojcould both sides share the same exact compiled cljs?
20:27seangroveI believe so, though there might be some problems
20:27seangroveWhy?
20:27clojurebotwhy not?
20:27tomojif so maybe you could just send cljs objects over directly
20:27brehautseangrove: i implemented a sort of lossless clojure reader for a SyntaxHighlighter mode and was able to get it to be quite snappy
20:28tomojnot sure about that..
20:28seangrovetomoj: Well, they're not allowed to share objects, they just have methods to post messages to one-another
20:28seangroveThe messages have to be json-serializable without circular references
20:29seangroveBut I could presumably have a kludge of {"payload": "{:a 5 [1 2] {:name :mike :age 40}}"} and have the cljs reader read it in on every message
20:29tomojhuh, do the cljs data structures have circular references?
20:29seangroveOh, no
20:29seangroveJust mentioning the full set of restrictions
20:32tomojI think hashes will make that not work anyway
20:36brehautim curious how edn → js works wrt to objects being shitty maps
20:37hiredmanalists!
20:39brehautaha
21:02arohnerare there any examples of active/recent clojure projects using native deps?
21:11mpanI'm wondering if the following would be a good example of a program to try to solve while learning core.logic or not. It asks to find all solutions to a constraint satisfaction problem. I think they expect "normal" solutions to use explicit search, backtracking, and subproblem memoization, and they're very clear that you need an efficient solution to be able to run in a reasonable time.
21:12mpanI guess the problem is essentially isomorphic to finding all strings of given length satisfying given constraints about some of their characters in some positions with regard to each other.
21:13mpanA difficulty is that they expect you to count the number of solutions, and that number is exponential in problem size.
21:14mpanI suppose in that regard it shares some features with Sudoku, but all the core.logic examples I've seen for Sudoku essentially hardcode the board size with a logic var per position, so I'm not sure if this is an appropriate approach or where to begin.
21:19tomojthey ask you to find all solutions or just count them?
21:19mpanThey say to count them, but as far as I can tell, that does involve actually finding them.
21:20tomoj..so exponential is efficient enough?
21:20mpanOr, rather, the "normal" solution is expected to traverse the answer space modulo subproblem memoization, even if it doesn't explicitly keep track of all the valid solutions.
21:20tomojah
21:20mpanExponential with really good subproblem memoization is supposedly good enough, but that's just hearsay.
21:22mpanThe only thing preventing the "normal" solution from recording all valid solutions is memory issues, I think.
21:22mpanIn the sense of, if you were to record them all to RAM, you might start swapping.
22:19mthvedtwhat do clojurians use for continuous testing on a local machine
22:22amalloymthvedt: `watch lein test` is about as advanced as it gets
22:23mthvedtthat is not very advanced
22:24mabesmthvedt: lazytest has an autotest feature. I use it with midje and it fits my needs
22:29mthvedtmabes: neat, having a look
23:03technomancymthvedt: most people use in-editor auto-tests rather than watching the filesystem
23:03jaimef_technomancy: !
23:03technomancythere's an emacs after-save hook, etc
23:03mthvedttechnomancy: anything for vim?
23:03technomancywell maybe not "most people" but most people who do auto-testing
23:03technomancymthvedt: asking the wrong person =)
23:03jaimef_technomancy: what's the way to fix the 'jack-in is not a task' issue with emacs/swank?
23:04technomancyjaimef_: nrepl? =)
23:04technomancyjaimef_: just need to make sure lein-swank is installed as a plugin
23:05jaimef_code for M-x package-install nrepl :P
23:05jaimef_seems to be a lot of movement in the syntax for lein
23:05jaimef_will use nrepl thanks
23:09tpopewould in editor testing delegate to a repl, or would it spawn something like lein test?
23:17technomancytpope: lein test is way too slow
23:17technomancyclojure-test-mode builds on slime (originally) and now nrepl.el
23:17technomancyhighlighting which lines had failures
23:18tpopeyeah that was going to be my next question
23:18tpopemost of this stuff shouldn't be that hard now that we have a vim nrepl interface
23:21amalloytechnomancy is telling tpope lein test is too slow! today must be backwards feature-request day
23:21tpopeha!
23:22technomancyoh snap
23:22technomancyyeah tpope can you make lein test faster while you're at it?
23:22xeqi+1
23:22technomancyxeqi: hey good to see you
23:23technomancybeen offline traveling?
23:23xeqitechnomancy: a little, more trying to compartmentalize irc usage to evenings, when it gets quiet
23:23technomancyI hear ya
23:25technomancyjust been realizing lein progress has stalled out a bit; hope to spend some time on docs for the new repo this week
23:25lynaghkAny iPhone owners interested in testing out a ClojureScript-powered iOS weather application?
23:25xeqihaha, yeah, my hopes for more time have been dashed by holidays/family
23:26technomancyxeqi: well, priorities
23:27xeqitechnomancy: I remember a issue for lein search indexes and using some library for searching, did that get implemented?
23:28technomancyxeqi: sorta
23:28technomancywe switched to the maven implementation, and it's faster, but it has a different set of problems
23:29xeqiah, was hoping for seomthing easy to replace the sqlite3 text search for clojars :p
23:29dr1Hello, how do I load project files so I can run them? When I do (in-ns 'project.core) followed by (project.core/-main), I get this output: IllegalStateException Attempting to call unbound fn: #'project.core/-main clojure.lang.Var$Unbound.throwArity (Var.java:43)
23:29technomancyxeqi: the analyzer is a bit of a mess. we have a lot less control.
23:31xeqidr1: hmm, I haven't used a plain repl for awhile.. maybe (load "project/core.clj") ?
23:32dr1this project has a number of files, so hopefully there's a way to load them all. but when I try that, I get back FileNotFoundException Could not locate project/project.core__init.class or project/project.core.clj on classpath: clojure.lang.RT.load (RT.java:432)
23:34xeqiloading that file will also load any it requires
23:36technomancydr1: most libraries don't have a -main function
23:36dr1it's not a library
23:37technomancytypically "unbound fn" means -main has been created but not given a value
23:37dr1it's an application (built by someone else). I'm very new to clojure so I'm sure this is simple. I actually had it running earlier after executing a bunch of the project's functions.
23:37technomancy(declare -main) or some such
23:38dr1it definitely exists… I just seem to not be loading the files properly
23:38dr1though I am in the namespace and can call functions from it
23:44dr1hmm… I think I may have made some bad modification to the code… I got a fresh copy and it seems to load using the steps above :/
23:54amalloydr1: in-ns doesn't load anything from the filesystem
23:54amalloyyou need to (require 'the-project) first
23:55dr1amalloy: I realized what I was doing… I ran lein repl from the project directory so it was automatically loading the project files
23:55dr1in-ns wasn't doing anything
23:55dr1I'm used to OOP… this is reeeeeeally confusing :)
23:57amalloynah, you haven't even gotten to the paradigm shifts yet; this is just the usual confusion that happens with any new language
23:57Sgeo|webOh hey apparently Raynes has ... talked in a Reddit thread about Factor -- mostly complaining about lack of docs
23:57Sgeo|web(I seem to be interested in Factor again for some reason)
23:58dr1haha yea, I got a brief overview… it was impressive and a bit overwhelming
23:59dr1I'm definitely going to be doing a good amount of googling and asking stupid questions for a while