#clojure logs

2012-01-13

01:10devnHello all.
02:17romanandreghas anyone tried to used the implementation of a multimethod defined in a namespace you are requiring? say you are working on namespace a, and the namespace b has a definition of a multimethod from a namespace c
02:18romanandregI want to be able to use the impl of the multi method defined on namespace b in namespace a
02:18romanandregany thoughts?
02:18jcromartieI'd say try iy
02:18jcromartieit
02:18romanandregno luck
02:18jcromartiemake a quick test
02:18jcromartieok
02:20romanandregI could do a copy-paste, but I wouldn't feel clean after that :-p
02:21jcromartiebut really, that's the whole point multi methods
02:21jcromartieof multimethods
02:21jcromartiethe interface is the only thing you reference directly
02:21jcromartieincluding the implementations in *any* way installs them
02:22jcromartieand then you are isolated from that implementation
02:22romanandregwell I'm doing a require :as for namespace b from namespace a
02:24romanandregns a requires b and c; c has a defmulti, b has a defmethod of mulit defined on c; a wants to use the defmethod defined in b
02:24romanandreguhmm…. gotta be a way
02:25jcromartieso it would not be sufficient for namespace "a" to require the multimethod from namespace "c"
02:25romanandregjcromartie: it should, but is not, it seems the "defmethod" from b is not being loaded
02:26jcromartiehuh, so the implementation itself is not loaded?
02:26romanandregjcromartie: that's my wild guess
02:26jcromartieand you're sure it's not just a problem with the dispatch value
02:26jcromartieand you're sure namespace b is loaded
02:27romanandregjcromartie: yes, as soon as I'm trying to use the symbol (dispatch value is a symbol in this case) on ns a, the thing barfs back at me
02:27romanandregsaying there is no dispatch for the given symbol
02:27jcromartieok let's try it in a REPL
02:30jcromartiein my experiment, doing (ns c) (defmulti foo …) (ns b) (defmethod c/foo …) (ns a) (c/foo b-dispatch-val) seems to work
02:31jcromartieI'd check the dispatch function
02:31jcromartiebut well it's a symbol
02:31jcromartieso
02:31romanandreguhmm weird
02:31jcromartieyou know already :P
02:31romanandregI can show you the actual real code, or at least where is coming from
02:31jcromartieanyway time for be… it's 2AM here
02:31jcromartiesure
02:31jcromartieI'll give it a second
02:31romanandregok
02:32romanandreggetting sources
02:32romanandregfrom github links
02:33romanandregjcromartie: I'm working with this library => https://github.com/rnewman/clj-apache-http/blob/master/src/com/twinql/clojure/http.clj#L190
02:33romanandregalso with this other
02:33romanandregI'm trying to use this impl
02:33romanandreghttps://github.com/mattrepl/clj-oauth/blob/master/src/oauth/client.clj#L44
02:34romanandregthat also requires that project
02:34jcromartiewith entity-as
02:34romanandregmy project uses those two project
02:34romanandregs
02:34jcromartieso what about your code
02:34romanandreg (:require [com.twinql.clojure.http :as http]
02:34romanandreg [oauth.client :as oauth])
02:34romanandreg access-token (oauth/success-content
02:34romanandreg (http/post access-token-uri
02:34romanandreg :as :urlencoded))
02:34romanandregbarfs at me
02:35romanandregException: java.lang.IllegalArgumentException: No method in multimethod 'entity-as' for dispatch value: :urlencoded
02:35romanandreghttp/post uses internally entity-as
02:36jcromartie:urldecoded
02:36romanandregLOL
02:36jcromartieDE not EN
02:36jcromartie:P
02:36jcromartiehave a good night
02:36jcromartielater
02:36romanandregLOL
02:36romanandregjcromartie: I'm sleepy
02:36romanandregthaaaaaanksss!
02:36romanandreggosh 2 am at your TZ and like a sharp
02:36jcromartie_sleepthanks
03:07AWizzArdMoin moin.
03:13devnis it right to assume that if i have a sorted map and call (vals) on it that I will get a sorted seq?
03:14devn,(let [sorted-m (sorted-map :0 10.11 :1 9.10 :2 8.9 :3 7.8 :4 6.7 :5 5.6 :6 4.5 :7 3.3 :8 2.1 :9 1.0)] (vals sorted-m))
03:14clojurebot(10.11 9.1 8.9 7.8 6.7 ...)
03:14devnDoes that work all the time? It's type is ValSeq.
03:14devnIts*
03:18AWizzArdYes, this works.
03:19AWizzArddevn: a sorted map sorts its keys, so when you call vals it can be any result.
03:20AWizzArddepends on the keys
03:20AWizzArd,(vals (sorted-map :a 5 :b 2 :c 17))
03:20clojurebot(5 2 17)
03:21AWizzArdWithout this feature a sorted map would be mostly useless, because the random lookup of keys is for practical reasons nearly O(1).
03:31Blktgood morning everyone
03:33amalloyAWizzArd: i'm not quite clear on what you mean by the random lookup of keys being O(1)
03:37AWizzArdamalloy: (get a-sorted-map some-key) ==> this is +/- O(1) for maps, if they are sorted or not doesn't matter.
03:37amalloyno way. for sorted maps it's O(log2(n))
03:38AWizzArdOkay good, thanks for clarifying that.
03:38amalloyfor hashmaps it's log32, which i agree is effectively constant given that the max size is 2^32
03:39AWizzArdYes, I was thinking of Clojures hashmaps.
03:39amalloyyeah. clojure uses red/black trees for sorted maps
03:39AWizzArdBut when the lookup for sorted maps is even more expensive then this underlines the point that I was trying to make: sorted maps deliver a sorted seq for the (keys of-a-sorted-map)
03:40AWizzArdOtherwise this data structure would be useless, if even the lookup is already more expensive.
03:41AWizzArdamalloy: do you know if there is a way to implement fully persistent sorted maps that have a lookup time closer to O(1)?
03:41amalloyi doubt it
03:42amalloyyou can't even do it with ephemeral maps
03:57notostracaAWizzArd, maybe Judy Arrays? they are a kind of trie
03:58AWizzArdnotostraca: are Judies fully persistent, as the second paragraph here explains? http://en.wikipedia.org/wiki/Persistent_data_structure
03:58notostracabut they are mostly known by one implementation in C, 20,000 lines of C, though you can do it in under 1,000 i think
03:59notostracaAWizzArd, absolutely they are not
04:00AWizzArdnotostraca: so mvcc doesn't work on them I guess.
04:00notostracaAWizzArd, I believe it does
04:00AWizzArdI need something that can be modified while I traverse a snapshot.
04:01notostracaI have never tried a zipper myself
04:01notostracabut that sounds like what you are talking about
04:01notostraca,google zipper data structure
04:01clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: google in this context, compiling:(NO_SOURCE_PATH:0)>
04:01notostracano idea the syntax you want, clojurebot
04:18kralnamaste
04:19G0SUBkraft: hello
04:27amalloy$google zipper data structure
04:27lazybot[Zipper (data structure) - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Zipper_(data_structure)
04:27amalloynotostraca: ^
04:29notostracathanks amalloy
04:34RaynesG0SUB: I am not prejudice! Damn Indians, always thinking I'm prejudice. :p
04:34G0SUBRaynes: lol
04:35G0SUBRaynes: well, TBH, you expected people to tweet back at you and ask you to use emacs instead. that's prejudice :-)
04:36RaynesG0SUB: I'm pretty sure that you yourself did that when I tweeted a while back about my editor experimentation.
04:37RaynesWhich is the whole reason I tweeted that. :p
04:37G0SUBRaynes: I did. Unfortunately there is no well-established emoticon to denote a "tongue-in-cheek" comment.
04:37RaynesHehe
04:37G0SUBRaynes: I see your point.
04:39RaynesSomeone else has done that as well. I was just trying to avoid 10 "why not Emacs" tweets by morning, since I already use it and just like playing with editors.
04:40G0SUBRaynes: true. people are passionate about their tools and try to evangelise given any opportunity.
06:07bprdoes anyone know if there's a fork of clj-http that allows you to accept unsigned ssl certs?
06:08AWizzArdbpr: which one are you using?
06:09bprmedSage
06:10bprAWizzArd: well, i just forked it and i'm adding that functionality, but I was thinking that I shouldn't reinvent the wheel
06:10AWizzArdbpr I know the one from dakrone.
06:10AWizzArdThat one supports it.
06:10bproh nice
06:10bprthanks, you just saved me some time :)
06:11AWizzArdThe original author is mmcgrana.
06:11bproh
06:11bprok
06:11AWizzArdHe now says himself to use the version of dakrone.
06:11AWizzArdAnd in the dakrone version you can say :insecure true
06:11bprah. i seem to have a hard time finding the "real" version of libraries on github
06:11AWizzArdor :insecure? with a questionmark
06:11bprgreat
06:12AWizzArdbpr: yes, there is this posting about the github forking model: t-machine.org/index.php/2012/01/13/2012-the-year-of-uncollaborative-development-or-when-github-kills-open-source/
06:12bpryeah, i was just looking at that too haha
06:23AWizzArdbpr: you can also specify as an option: {... save-request? true ...}, which will give you the request object which was used by clj-http. Helpful for debugging.
06:23jowagwhere is destructuring handles in clojure? Is it in reader?
06:24AWizzArdAnd there is the option :debug true too.
06:24jowag*handled
06:32G0SUBbpr: dakrone is the canonical repository of clj-http now. mmcgrana mentions that on the github page.
06:35bprAWizzArd, G0SUB: thanks
06:50tsdhHi.
06:52tsdhDoes anybody know where I can find documentation about Clojure's JIRA issue procedure? For example, what are the "Fix Versions" Backlog, Approved Backlog, etc. meant for?
06:55AWizzArdtsdh: you typically want to add bug reports and feature requests to the 1.4 milestone.
06:56AWizzArdWhen you click on “Versions” you will find a short description.
06:56AWizzArdThough the description “Backlog” for the Backlog doesn't really add much information ;)
06:56tsdhAWizzArd: See. ;-)
06:57tsdhWell, I only have a minor enhancement request + the patch implementing it. I guess, I'll say Backlog. Sounds somehow right...
06:59tsdhShould I add myself as Assignee? Basically, I only need a review by some core team member...
07:00tsdhI'll stick with automatic, whatever that means... :-)
07:03AWizzArdtsdh: when it is not your turn to review the issue, then assign the one who should do it.
07:03tsdhAWizzArd: How should I know who's responsible?
07:05tsdhHopefully, that's the intention of the Backlog. You add patches, and eventually some core team member picks them up and reviews them.
07:28AWizzArdtsdh: then leave the assignee unfilled.
07:42tsdhAWizzArd: Did so./
08:36_carlos_hi
08:43bpr_carlos_: heya
08:49`fogusOK. I am determined to roll out CLJS prop access syntax today even if it kills me (it will)
09:24pjstadig`fogus: doooooiiiiiiiittttt!!!!!
09:32`foguspjstadig: Underway
09:32`foguspjstadig: BTW, I am ready to move to StadigOS. Please finish it post haste
09:33jcromartieis there any chance of continuations getting first-class support in Clojure?
09:34`fogusjcromartie: Vegas odds are very low
09:39jimdueyjcromartie: I'd love to see that but don't think it'll happen on the JVM at least not until the JVM supports it.
09:39jimdueyand maybe not even then.
09:46duck1123are there any good ways to get Korma to retry a query in the event of a communications link failure? Or do I have to explicitly wire in retries
09:56pjstadig`fogus: you may be waiting quite a while :)
10:10TimMc`fogus: Only if it kills you temporarily.
10:10TimMcOtherwise, where would we get our footnotes?!
10:14WorldOfWarcrafthey guys what is this question asking for me to do: (= (__ (sort (rest (reverse [2 5 4 1 3 6])))) (-> [2 5 4 1 3 6] reverse rest sort __) 5)
10:17joegallomy initial read: (= a b c) is true if a and b and c are all equal, so it wants you to fill in the blanks with expressions that will get you 5 for all three expressions
10:17joegalloso, how do you get 5 out of the first expression and the second expression?
10:17joegalloi'm not sure if it wants you to use the same exact function for each, though
10:17WorldOfWarcraftoh so last
10:17WorldOfWarcraftill try last
10:18joegallothat seems like a nice short answer
10:18WorldOfWarcrafthooray it worked thx for getting me started :)
10:18joegallonp, good luck with the rest of the problems
10:19kralWorldOfWarcraft: nice nick! :)
10:29FujitsuCan anybody help me with this exercise? http://www.4clojure.com/problem/19
10:29manutterFujitsu: sure
10:30manutterhow much help do you want?
10:30FujitsuWell, I tried using (reverse (first))
10:30kralWorldOfWarcraft: if only i could have back all the time wasted playing wow...
10:30Fujitsubut that didn't work...
10:30WorldOfWarcraftlol wasted noooooooo
10:31WorldOfWarcraftno its (first (reverse))
10:31WorldOfWarcraftwow is the best thing in the world its not wasted time
10:32FujitsuWorldofWarcraft: That didn't work at all...
10:32babilenFujitsu: Which makes sense.. you want the last element which is why you reverse it first and take the first element (formerly the last) afterwards.
10:32WorldOfWarcraftright
10:32babilenFujitsu: You might want to understand why #(peek (vec %)) works
10:33manutterFujitsu: he gave you the short version, but you need to make it an anonymous function to fit it into the exercise
10:33FujitsuOh
10:33FujitsuI see
10:33FujitsuGotchya
10:33WorldOfWarcraftok cool
10:34babilenmanutter: "he" == I?
10:35tvadakumcheryif there a way todefine an anonymous multimethod?
10:35tvadakumchery*is
10:36babilenI would be surprised, but don't take my word for it. (fairly new to clj)
10:36tvadakumcherynot that it would be particularly useful, but still
10:36tvadakumcheryI'm on 4clojure
10:37tvadakumcheryand I'm trying to shorten my character count
10:37WorldOfWarcraftwhat problem is this?
10:37stuartsierraNo, there are no anonymous multimethods
10:37tvadakumchery#128
10:37manutterbabilen: no, wow
10:38babilenack :)
10:41stuartsierra1.4.0-alpha4 released
10:42manutterSweet
10:43tvadakumcheryspeaking of that
10:44tvadakumcheryhow do I instal 1.3.0 on emacs
10:44tvadakumcheryI have 1.2.0 running now
10:45Fujitsumore specifically clojurebox
10:45tvadakumcheryYeah
10:57tvadakumcheryhow do I instal 1.3.0 on emacs
10:59gtraktvadakumchery: you should be using leiningen to manage projects, specify 1.3.0 in the project and emacs can connect to a swank server with slime-connect
11:10aravartHey all. I had a quick question. Let's say I had a hash map {:a 1 :b 2} and I wanted to write a let-form where a and b got bound to 1 and 2, is there some way to do that dynamically for all the keys of a map (in other words, where I don't know at compile time what the map's keys will be)?
11:12gtrakif you don't know them at compile-time, you also won't know to use them in code within the scope, why not just keep them in a vector instead of generating a let?
11:16joegallogood answer
11:17`fogusaravart: you'll need eval for that
11:18`fogusaravart: I have a little lib that does just that https://github.com/fogus/evalive
11:21meliponehow can I upgrade to clojure.contrib 1.3.0? I'm using lein but I get an error with lein deps on that.
11:22gtrak~contrib
11:22clojurebotIt's greek to me.
11:22jamiltronThere is no clojure.contrib in 1.3
11:22jamiltronhttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:22meliponei know, but i don't understand it. what do I do now?
11:22gtrakhttp://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:23meliponeI wanted duck-streams and priority-map
11:23gtrak"clojure.contrib.duck-streams mostly migrated to clojure.java.io"
11:23jamiltronduck-streams is mostly handled by clojure.java.io
11:23jamiltron^ What he said :)
11:23jamiltronhe or she
11:23meliponewhat about priority-map?
11:24jamiltronMigrated to clojure.data.priority-map
11:24duck1123usually what I do is go to clojuredocs and search for the fn I'm looking for, It'll usually show up as being in both the old and the new spot
11:24meliponeduck1123: okay, I'll do that.
11:24meliponejamiltron: thanks
11:26duck1123also a quick scan down the clojure user page on github finds the library I'm looking for
11:30meliponeduck1123: what's the url for the clojure user page on github?
11:44raek_melipone: https://github.com/clojure
11:51meliponeraek: I've downloaded clojure.data.priority-map form github. What do I do now to have it installed on my machine?
11:57raekmelipone: you most often don't download the source and build it yourself. it should already be available in a maven repo (assuming it is maintained and has been released. this is not the case for all new contrib libs)
11:57raekmelipone: first, do you know about leiningen
11:57raek?
11:58meliponeraek: a little. clojure.contrib 1.3.0 is not available on a maven repo, tho?
11:58raekthere is no clojure.contrib 1.3.0 (and will not be)
11:58IntersessionCan anybody here help me out with http://www.4clojure.com/problem/26 ?
11:59raekmelipone: you want to find the group id, artifact id and the version of the library. it should be something like [org.clojure/data.priority-map "0.0.1"]
12:00raekfor any mature library this should be the first thing mentioned in the readme
12:00jamiltronIntersession: Sure, what do you need help with?
12:00IntersessionI just don't know where to begin....
12:01manutterIntersession: do you know how to make a lazy seq?
12:01raekmelipone: so you add that line in your project.clj file and run "lein deps". then you should be able to just use it from that project
12:01IntersessionNope, lol
12:02raekmelipone: this workflow is explained here (I recommend reading at least the first half): https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
12:02jamiltronIntersession: do you know how to make a function that infinitely generates the fibonacci numbers?
12:03IntersessionJamiltron: No, I don't
12:03raekmelipone: also this is quite useful when migrating a contrib-using project to 1.3: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
12:04meliponeraek: I'm familiar with lein deps.
12:04meliponeraek: lein deps didn't find org.clojure/data.priority-map though
12:05manutterIntersession: it's a bit old, but have a look at http://formpluslogic.blogspot.com/2009/07/clojure-lazy-seq-and-recursion.html
12:06manutterIntersession: if you know how lazy-seq's work, a fibo sequence is pretty easy to write
12:06Intersessionmanutter: Thanks, I definitely will :)
12:08IntersessionOut of curiosity, did anybody here learn clojure as their first programming language?
12:08raekmelipone: what did you specify as a dep in your project.clj?
12:08IntersessionBecause I'm having a hard time with it, and it's the first programming language I've tried to tackle
12:09raek(note that I have no idea whether priority-map is actually ready to be used.)
12:09jamiltronIntersession: It takes time, you're doing good by getting practice like 4clojure in. My first language wasn't Clojure but it was a Lisp, and I certainly think Clojure is suited to be a good first-language.
12:10raekthis seems to indicate that there is a version available though: http://repo2.maven.org/maven2/org/clojure/data.priority-map/0.0.1/
12:10manutterIntersession: you're the first person I've heard of who took clojure as their first programming lang
12:10manutterIntersession: I don't think there's a whole lot of material specifically geared to "Intro to Clojure for people who've never coded before"
12:11manutterIntersession: however I think with the right approach Clojure could be the best, or at least among the best, of any lang you could choose to start with
12:11IntersessionI'm taking a crash course on clojure for my high school, but apparently I missed the "previous programming experience recommended" in the fine print
12:12mabesIntersession: this is a helpful tutorial if you haven't seen it already: http://java.ociweb.com/mark/clojure/article.html
12:13Intersessionmabes: That seems... thorough. I'll take a look
12:13TimMcI think that's a little old.
12:13mabesIntersession: Yeah.. it is a little dated, and is geared more to an experienced programmer.. still worth the read though.
12:14mabese.g. it talks about clojure-contrib
12:15manutterI was thinking about putting together a VirtualBox image of a system already set up for Clojure/emacs/NetBeans/etc, but I wouldn't know where to host an image that big
12:16TimMcmanutter: clojars :-P
12:16manutterHeh :)
12:16duck1123man, I envy Intersession. Programming has got to be so different coming to Clojure with a completely clean slate
12:19tmciverduck1123: yeah, I was thinking the same thing.
12:20devinusanybody in here use protobuf or thrift?
12:20TimMcI dunno about Clojure as a first language -- you *have* to poke around in Java from time to time, and that's confusing. Better to have Scheme as a first lang, I think.
12:20tmciverIntersession: I recommend just getting a good book on Clojure, if you haven't already done so. Programming Clojure by Halloway is good, though a little dated now.
12:21tmciverTimMc: what about Java -> Clojure?
12:21manutterIntersession: Another good book is Clojure in Action, a bit more recent
12:22tmciverI almost feel like it would be better to start with a non-functional programming so you can better see the virtues of it.
12:22manutterThough I hear there's a new edition of the Halloway book either coming soon or recently released
12:22manuttertmciver: Heh, start with PHP, you'll REALLY appreciate Clojure
12:25TimMctmciver: I feel like Scheme allows you to focus on the important stuff first, then broaden your scope to implementationy stuff.
12:25TimMctmciver: e.g. no one needs to be focusing on 1/5 vs. 1/5.0 while they're learning their first language.
12:25duck1123You don't really appreciate modern languages unless you start by numbering your lines by 10. (started with Atari Basic)
12:26jamiltronTimMc: I agree with that, as someone who started with Scheme.
12:26TimMcand the REPL is essential for exploration
12:28dnolentmciver: I'm not sure that's true. mutable variables fly in the face of basic math taught in schools.
12:28TimMcOh yeah, that definitely confuses newcomers.
12:32flazzi have clojure and repl installed via brew. any reason readline seems to not work anymore?
12:38meliponeraek: I probably didn't have the right name or the right version, he?
12:39meliponeraek: I couldn't see what the right version of clojure.data.priority-map was until after I ran mvn install. Where is the version specified?
12:41meliponeraek: unless it's on clojars, I'm completely lost on where to find the libraries
12:47dnolenflazz: installing clojure via brew is not a great idea, just use lein.
12:48flazzdnolen: is there a way to use lein without a project for a repl?
12:48dnolenflazz: lein repl
12:48flazzduh, sorry/thanks
12:48flazz:)
12:48flazzi should just get used to emacs
12:48`fogus-awayOK, I'm about to break ClojureScript... ready?
12:51TimMcyay
12:59ljosHi - is there a map similar to this : (map #(f %1 %2) l1 l2) where %1 becomes the element in l1 and %2 is l2. %1 %2 is the same placement in each list.
13:00mrBlissthis one: ##(map + [1 2] [10 100])
13:00lazybot⇒ (11 102)
13:00dnolen`fogus: hurrah!
13:00mrBlissso just map ;-)
13:01ljosOh. I understood that map didn't do that but something else when there where two lists.
13:01ljosThanks.
13:02_carlos_hi
13:03_carlos_why is "partial" name used for a function that returns, say HTML?
13:04TimMc_carlos_: partial doesn't have anything to do with HTML -- you'd have to provide context.
13:05_carlos_TimMc: that is why I said "say", like an example. in the context of Noir. probably hiccup
13:06amalloyhe probably means defpartial
13:06TimMcOh!
13:06_carlos_amalloy, TimMc, yes I am sorry. I mean "partial" from defpartial
13:06TimMc_carlos_: I thought you were talking about ##(map (partial + 2) [5 9])
13:06lazybot⇒ (7 11)
13:07amalloy*shrug* it returns "part of a page". there's no deeper meaning
13:07TimMcWhat API is it part of? hiccup?
13:07amalloynoir
13:08`fogushttp://groups.google.com/group/clojure/browse_frm/thread/9367b4d6ed4bc96b
13:08`fogusAnnounced
13:08`fogusNow to ClojureScript One
13:08_carlos_TimMc: Noir. I said also hiccup, because I suspected Noir is using it, but not sure
13:12_carlos_amalloy: partial is cool!
13:13seancorfield_carlos_: tell amalloy juxt is cool and you'll have a friend for life :)
13:13amalloyhaha
13:13seancorfieldi'm actually surprised how often i use juxt...
13:16technomancy_does 4clojure only score by char count rather than token count?
13:17amalloytechnomancy: yes
13:18amalloytoken count is easy to compute but harder to explain, and none of us were clever enough to make a graph that combines the two results
13:19dnolen`fogus: sweet
13:32priv_cooperAre there any lein plugins for auto code reloading?
13:32priv_cooperAs in, the equivalent to "lein run" every time a file is saved?
13:33priv_cooperOr, lein plugin or not, what would be the best way to achieve this?
13:33technomancypriv_cooper: usually that's achieved through editor integration
13:34manutterNoir does that by default, doesn't it?
13:34manutterDepends on what you're re-running
13:34priv_coopermanutter: Not building a web app
13:34priv_cooper:)
13:34manutterAh well, worth a shot :)
13:34priv_cooperHmm..
13:34priv_cooperI use vim :/
13:35manutterjark might help?
13:35manutterAre you in a unix/linux environment?
13:36priv_cooperYeah, osx
13:37manutterHmm, ubuntu has a watch command, but I don't think osx does
13:38emezeskepriv_cooper: Are you using vim-clojure or slimv?
13:39emezeskepriv_cooper: I believe both plugins support sending the current file to a repl
13:39priv_cooperemezeske: Ahh, I need to check these out
13:39emezeskepriv_cooper: You could easily set up a "file saved" hook that did that
13:39priv_cooperI believe I have vim-clojure setup.
13:39emezeskepriv_cooper: I personally use vim-clojure, it is very nice
13:40jowagdoes vim have paredit-like mode?
13:40emezeskejowag: The slimv plugin has that.
13:40emezeskeAlthough I ripped it out of there so I could use it with vim-clojure :)
13:45technomancybabilen: have you updated clucy to fix the ^:dynamic warnings in 1.3?
13:53babilentechnomancy: Yes
13:54technomancybabilen: is it ready to merge or do you have more work to do?
13:54babilentechnomancy: Along with an update to lucene 3.5.0 and other things -- I'll push it to GH as soon as I am happy.
13:54technomancyvery nice; thanks.
14:01jsabeaudryWhat are the good libraries for working with binary data? I've seen bytebuffer and Gloss but are there more?
14:06anntzerhi, is there an easy rule as to when arguments to :use/:require/:refer/use/require/refer need to be quoted? (at least it's unclear for me)
14:07`fogusI think I have both Domina and CLojureScript One migrated to the property lookup functionality. That was almost too easy. :p
14:07technomancyanntzer: the ns form is declarative, so no quoting there. the repl versions of the functions are lower-level and require quoting
14:08anntzerook
14:09TimMc`fogus: Any idea when cljs leaves alpha?
14:10`fogusTimMc: Not sure. Once we have our release process in place it'll be more clear.
14:10TimMcAh, right -- still no artifacts.
14:10anntzeralso, it seems that there is a problem with circular dependencies if declared in (ns), but not using the low-level functions?
14:11anntzer(I had a nullpointerexception when the circular dependency was in the ns but it disappeared when I moved one of the "use"s out of the ns)
14:11anntzeris that correct?
14:12jsabeaudryanntzer: My reflex would be to remove the circular dependency
14:12jowag`fogus: btw is accesing deftype fields with (.-field t) idiomatic in CLJS?
14:12dnolenanntzer: circular deps are not allowed
14:13dnolenjowag: yup
14:13`foguswhat dnolen said
14:13jowagthank you
14:14jowagand what about persistent collections, are they on a roadmap?
14:15jowagI have to be carefull where I use dis/assoc now :)
14:15jowagand it's more performant to have atoms allover the place rather than have one megaatom
14:15ibdknox`fogus: didn't know about as-this :) That'll be fine
14:17`fogusibdknox: Excellent!
14:20ibdknoxjowag: you've profiled that?
14:21jowagibdknow: yep, assoc/dissoc is doing shallow array copy
14:21TimMcBut have you profiled it?
14:22jowagyes :) in chrome, had 25ms and got it down to 12ms in my keyboard input handling fn
14:23jowagprofiled with advanced compiler turned on
14:23TimMcFactor of 2? Yeah, that's significant.
14:23amalloyin a single-threaded language like javascript, isn't an atom just a simple mutable variable?
14:24amalloyheh, yes, looks like it is
14:24devthwhat regex would match a mixed line ending character ^M in clojure?
14:25amalloywell, #"\r" would, but i doubt that's what you mean
14:25TimMcI *think* \n is cross-platform.
14:25devthI was using #"\n" but it didn't seem to match. I'll try \r
14:26amalloy&(re-seq #"\n" "\r\n")
14:26lazybot⇒ ("\n")
14:26amalloy&(re-seq #"[\r\n]" "\r\n")
14:26lazybot⇒ ("\r" "\n")
14:26TimMcI always forget if ?m is important here...
14:27emezeskeI hope \n isn't auto cross-platform
14:27emezeskeTcl tried making newlines all cross-platformy, and it was a nightmare
14:27emezeskeAlways doing subtle things you didn't expect
14:28TimMcI might have been thinking of another language.
14:28emezeske(Tcl maybe? Although nobody uses that.)
14:29TimMcNot that. :-)
14:32technomancyquick survey: what are your top lein tasks?
14:32technomancyhistory | grep lein | awk '{print $3}' | sort | uniq -c | sort -nr | egrep -v "^ +1"
14:32_carlos_in noir: when I remove [noir.content.getting-started] from welcome.clj, the home page doesn't render and a java exception is thrown. how do I enable the server to point to the content described in welcome.clj?
14:33ibdknox_carlos_: did you define /
14:33ibdknox_carlos_: or is it only /welcome
14:33jcromartierepl
14:34amalloytechnomancy: i don't think that's very accurate, simply because history files don't work very well when multiple sessions/shells are open. my history alleges i've never run lein swank, despite that being my most common
14:34jcromartietechnomancy: repl is the winner
14:34dnolenjowag: it could probably be done but I wouldn't expect performance to be acceptable outside the fastest JS engines.
14:34_carlos_ibdknox: no, just a second
14:34technomancyamalloy: yeah I don't expect swank to show up in there anyway due to M-x clojure-jack-in
14:34amalloyi don't do that though
14:34technomancydefinitely not scientific, but interesting.
14:34ibdknox_carlos_: if you update to noir 1.2.2 that exception will no longer happen and you'll get a 404
14:35technomancyamalloy: right; just saying there's lots of reasons not to trust it =)
14:35amalloy*chuckle*
14:35amalloyanyway, apparently: deps, protobuf, self-install
14:36jowagdnolen: but it would't have worse performance than it has now, right?
14:36manutterlein upgrade, lein test too
14:36_carlos_ibdknox: how do I clean the cache withou restarting the server?
14:37ibdknox_carlos_: the cache?
14:37ibdknox_carlos_: just refreshing your browser should work
14:37TimMctechnomancy: I run repl all the time on my work machine, but I leave one open on my home server.
14:38_carlos_ibdknox: I just removed that getting-started and it still loads that page. refreshing the page and cleaning cache doesn't work. I know restarting the server will work, but it's not practical
14:38tmcivertechnomancy: repl, new, swank, help
14:38ibdknox_carlos_: it can't knowingly remove a page, but it can replace it just fine
14:38tmciverdeps
14:39technomancycool; thanks
14:39jowagdnolen: Even if JS does not have such concurrency problems as JVM has, I try to have most of my functions pure and mutate only through atoms in a very few places, so I'm producing lot of garbage right now.
14:39ibdknox_carlos_: in other words, the only time you have to restart is if you completely remove a page and expect it to 404
14:40dnolenjowag: for small amounts of data - persistent data structures aren't a huge win. remember Clojure data types are generally constructed in sizes of 32
14:42dnolenjowag: what type of code are you writing? 15ms sounds like a lot of time for anything.
14:43_carlos_ibdknox: grr.. only after I restarted the server it worked.. -.-' yes, I had to set a "/" like you said. thanks! still, it would be nice to know why the page wasn't refreshing. restarting everytime is not practical
14:43ibdknox_carlos_: you don't need to restart
14:43ibdknox_carlos_: one potential reason why it may not have worked is if reloading the given code throws an exception
14:43_carlos_ibdknox: yeah, of course, but I still have to find out why this is happening
14:44_carlos_ibdknox: ha yes, it was throwing this: java.lang.IllegalStateException: GET-- already refers to: #'noir.content.getting-started/GET-- in namespace
14:44_carlos_ibdknox: this even after removing the getting-started line
14:45_carlos_ibdknox: anyways, probably this wont happen often. thanks!
14:45clojurebotexcusez-moi
14:46ibdknox_carlos_: np
14:46jowagdnolen: some kind of an editor :) 15ms is good but I have to keep an eye on it that it won't go up or else it lags
14:46acagle 50 deps 42 help 24 search 20 swank 6 jar 5 upgrade 5 noir 4 localrepo 3 version 3 new
14:46devthamalloy: TimMc: not sure why, but I could only match with #"\cM". even #"\r?\n?" did not match.
14:47solussdwhy does this cause an integer overflow? (take 100 (iterate #(* 2 %) 1))
14:47TimMcsolussd: Try *'
14:47TimMc1.3 stopped autopromoting to BigInt(eger) with normal arith ops
14:47solussdreally? why?
14:47_carlos_can someone add some cool sentences for lazybot in japanese? it's so cool! or nevermind
14:48TimMcI don't think there's a whole lot of demand...
14:50solussdSeems it should be the other way around- if I want efficiency I should go out of my way- correctness should be default
14:50TimMctechnomancy: 72 repl, 54 run, 29 deps, 22 new, 6 uberjar... but I suspect that last one will change quite a bit after my lein-jit terminal is closed and its history absorbed.
14:51TimMcAlso, I just don't believe that I've only run deps 29 times.
14:51technomancyTimMc: yeah, having multiple shells makes history very lossy
14:51rabblersolussd: I agree with you, I can see how that could be a big issue if upgrading clojure and now you start getting a bunch of exceptions you never got before. Perhaps you could rebind the non-promoting to the promoting versions in you code.
14:52rabblerbut I am still very green when it comes to clojure.
14:53_carlos_haha, I can see pain in the future and some rvm coming into spring
14:54TimMcrabbler: That's not enough -- range uses + directly, for instance.
14:54_carlos_cvm - clojure version manager ^^
14:55rabblerAhh.
14:55_carlos_rabbler: wait, I don't know if this exists really...
14:56gtrakbut range still promotes, yea?
14:56TimMcgtrak: Nope!
14:56TimMc&(take 5 (range Long/MAX_VALUE Double/POSITIVE_INFINITY))
14:56lazybotjava.lang.ArithmeticException: integer overflow
14:59raek&(take 5 (range 9223372036854775807N Double/POSITIVE_INFINITY))
14:59lazybot⇒ (9223372036854775807N 9223372036854775808N 9223372036854775809N 9223372036854775810N 9223372036854775811N)
14:59gtrakwell, my opinion is if you are relying on unbounded input, you should use promotion, in the majority of cases, you're not?
15:00raekif any argument of an arithmetic operation is a BigInt, then the result will be a BigInt too, I think
15:01gtrakI think I remember reading that it made substantially more code faster than the code it broke
15:02solussdill buy it
15:02amalloy_carlos_: cvm doesn't make any sense for clojure. lein already handles that part of the equation
15:02solussdI guess it is safe, since it at least throws an exception
15:03amalloy(because, unlike ruby, clojure doesn't want to be installed system-wide, or even user-wide)
15:03gtrakit looks like clojure still promotes ints to longs and floats to doubles
15:04_carlos_amalloy: I have to think about those sentences. I have to go now, if I still don't undertsand, I will look for your nickname here. thanks!
15:04amalloygtrak: clojure does arithmetic with 64-bit quantities
15:05gtrakamalloy: so it ALWAYS promotes?
15:05amalloy&(class (short 1))
15:05lazybot⇒ java.lang.Short
15:05amalloy&(class (int 1))
15:05lazybot⇒ java.lang.Long
15:06gtrakdocumentation says "Clojure will seamlessly promote ints to longs and floats to doubles as needed"
15:06gtraknot whenever it feels like it :-)
15:07amalloyit's a complicated topic that has been in flux from 1.2-1.4
15:07gtrakah, but it gets boxed to be used by 'class'
15:07amalloyright
15:08TimMcClojure functions only accepts objects, yeah?
15:09gtrakprimitives too if you do it on purpose with hints AFAIK
15:09dnolengtrak: my mental model - Clojure basically only has 64 bit numerics. anything else is interop.
15:09dnolenTimMc: gtrak: up to 4 arguments.
15:10TimMcoh right, I've seen that
15:10gtrakdnolen: yea, that makes sense, probably because there's no perf gain for 32-bit math on 64-bit chips. why 4 args?
15:10dnolengtrak: because interfaces are generated to support it. exponential in the number of args.
15:11amalloygtrak: because 4 args require 273 interfaces, and 5 require 342749823615
15:11gtrakoh, gross
15:11gtrakare you serious? it generates 273 classes for that?
15:11amalloyyes. check out IFn.java
15:11TimMcgtrak: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L91
15:12gtrakomg, that's awesome, I hadn't looked at the 1.3 IFn
15:12TimMc"static public interface LOL"
15:12ibdknox /win
15:12replacadnolen: Interfaces or signatures?
15:12dnolenreplaca: interfaces
15:12replacawow
15:12amalloyapparently 358. i misremembered
15:12TimMcdnolen: I see 5 in IFn
15:13TimMcAh, one is return
15:13amalloyTimMc: return type
15:13dnolenthis is of course all old news
15:13dnolenlike 1.5 years old
15:13TimMcYeah, never really investigated it though.
15:13gtraki need to follow the dev list more closely
15:13replacayeah,, I just don't look that closely at how the sausage is made :)
15:21gunsHello, is there a convention regarding the capitalization of `foo` in (require '[some.ns :as foo])?
15:22RaynesNever ever doing it is the convention.
15:22gunsWhat's problematic about it? Seems better than a straight up (use)
15:24gunsI'm just wondering if capitalization of symbols is supposed to be reserved for Java classes
15:24amalloynever capitalize it, not never require
15:24gunsoh
15:25gunsok ty
15:26replacaguns: yeah, in general folks will read capitalized syms as Java classes/interfaces.
15:26hiredman(Foo/bar 1 2) looks like a static method call
15:27amalloyguns: the only clojure things we capitalize are types (as in deftype/defrecord) and protocols (which generate interfaces of the same name)
15:27TimMcguns: It will mess up your editor's syntax highlighting. :-)
15:27TimMcand your readers
15:27gunsamalloy: ah, that's helpful
15:27gunsTimMc: my vim setup doesn't seem to mind; too primitive I suppose
15:28TimMcYeah, depends on the highlighter.
15:59amalloysiiiiigh, i hate when i find i've written ten lines of code, including writing out three lines twice. so i figure out a way to condense it into eight lines with no duplication at all, and (as expected) at the end i look at it and am like..."that's too confusing, there's no way i'd want to read that. i'll go back to the lame way"
16:00technomancyamalloy: the worst part about that is you know that someone else is going to do the exact same thing when they're looking over it three months in the future.
16:00technomancys/else //
16:00technomancybecause it will probably be you
16:00amalloytechnomancy: aw man, sniped my fix
16:00technomancyhah
16:01technomancyamalloy: you should come join #leiningen
16:01technomancyit's the hip place to be
16:01amalloyi'm in too many dang channels. you better make this worth my while, buddy
16:02technomancyrcirc has this cool feature where you can put someone on notification-ignore
16:02technomancyyou still see their lines in the channel, but when they speak it doesn't cause the client to consider that channel as having unread messages
16:03technomancyanyway, if your client has something like that you should use it for the travis-ci bot.
16:03technomancybecause he's noisy
16:03technomancywell, he's noisy when I'm not lazy
16:06amalloythat sounds nice. maybe i'll look for a decent client one of these days
16:06technomancyyou're not on irissi, are you?
16:07technomancy(you don't have to answer that question if it's embarrassing.)
16:07amalloyno, but i'm not allergic to perl either
16:08amalloyno, it's cool. i tell people i use pidgin, and i refuse to be embarrassed
16:09amalloya bit of "comfort food", if you will, from my "use windows but kinda wanna be a hacker" days
16:10technomancysometimes it's OK to follow your heart.
16:11Raynestechnomancy: It is NOT okay to use Pidgin for IRC.
16:11RaynesIt just isn't.
16:12foodooNow that the topic is up: What kind of IRC clients do you use? I use irssi
16:12technomancyRaynes: http://www.youtube.com/watch?v=lYMRsngqPAc I guess
16:12jsanda_afksorry, my irc client froze up
16:13technomancyfoodoo: I just switched to rcirc from erc.
16:13RaynesI use ERC when I use Emacs. I've been using Textual for the past two days because I'm using Vim.
16:14ibdknoxI use LimeChat
16:14RaynesBut now that technomancy is using rcirc, I probably will to. He's mah role model.
16:14foodoodammit, I'm a Vim user so rcirc and erc are not an option for me ;)
16:14ibdknoxhe's everybody's role model ;)
16:14Raynesibdknox: Textual is better than LimeChat.
16:14ibdknoxhow so?
16:15technomancythere are a couple things I miss about erc, but the fact that I can have join/part hiding active for idlers only is pretty rad.
16:15RaynesBecause I use it.
16:15RaynesThe whole client is based on LimeChat and designed to suck less.
16:19scottjriece is an interesting emacs irc client that has a feature that appears to be designed for users who are in many non-active channels in that you have one window for your current channel and another for all the others.
16:21`fogusTales from the CLJS migration trenches ---> http://groups.google.com/group/clojure/browse_frm/thread/9367b4d6ed4bc96b
16:22ibdknox`fogus: does it break doing (set! some.thing.blah 4)?
16:22`fogusibdknox: no
16:23ibdknoxcool
16:23`fogusibdnox: Only (set! (.old-prop-style obj) 42)
16:24ibdknox`fogus: yeah. I'm glad this is finally out :) I can stop worrying about it now.
16:24`fogusibdknox: me too ;-)
16:25ibdknoxdnolen, `fogus: thanks for the effort!
16:25`fogus:-)
16:26dnolenglad it's over with, onward!
16:26`fogusyay!
16:26`fogusI'm going to get a drink now. ;-)
16:27ibdknoxhaha enjoy
16:27`fogusse ya at Clojure West. :-)
16:30foodoois this information still current? https://github.com/clojure/clojurescript/wiki/Quick-Start ./bin/cljsc hello.cljs '{:optimizations :advanced}' > hello.js produces a JS file that does /not/ define the goog object.
16:31foodooand therefore my browser complains
16:32amalloytechnomancy: guess what other client gives you join/part hiding for idlers only
16:32technomancysurely not pidgin?
16:33amalloysorry to break it to you, but it's pidgin
16:33technomancymind: blown
16:33technomancyI hate using programs that don't have a repl, but I actually do keep pidgin open because it's the only thing I've found with decent libjingle support.
16:34TimMcwhatever that is
16:34technomancyTimMc: voip that doesn't crash all the time
16:34technomancyit's what google talk uses
16:35TimMcgot it
17:06augustlhi folks. Trying to find out how to make noir/compojure/ring do asynchronous/concurrrent things, but failing
17:06augustlI'm new to clojure, but it would seem sensible to be able to, say, return an actor in a route, but it seems all I can do is to synchronously return a string/map
17:08augustlperhaps these frameworks perform every request in a single thread already, so it doesn't matter if I'm being synchronous?
17:10augustls/in a single thread/in a separate thread/
17:11dnolenaugustl: those libraries are already concurrent (because of jetty). is there something else you're trying to accomplish?
17:12augustldnolen: currently not trying to accomplish much, other than grokking how these things work :)
17:12dnolenaugustl: I believe aleph provides an async http server (on top of netty) that conforms to the ring spec
17:12augustlI'm a jvm noob as well, that doesn't help I guess.
17:13dnolenaugustl: I'm assuming you're coming from the node.js world :)
17:13augustlrails, then node, some iOS, then a whole lot more node :)
17:13augustlyou'd think I'm some kind of a hipster
17:14vijaykiranWhat does "In traditional Lisp, only the list data structure is structurally recursive" mean ?
17:14yoklovtraditional lisp only has lists
17:14vijaykiranwhich is related to clojure "Extends the code-as-data paradigm to maps and vectors"
17:15yoklovwhich is defined as the first element (the ``car'') attached to the list of the rest of the elements
17:15yoklov(the ``cdr'')
17:15yoklovcar and cdr are weird terms that refer to outdated technology.
17:15yoklovbut a list is defined as the first element attached to the list of the rest of the elements
17:15yoklovwhich is structually recursive
17:16augustldoes it make sense to say that most APIs in clojure are blocking/synchronous, then threads are used for concurrency?
17:16yoklovvijaykiran: finally, it will end with the empty list, nil (or, in scheme () or null)
17:16yoklovdoes that make sense?
17:17dnolenaugustl: pretty much, though again, you do node.js like things with Netty / aleph
17:17dnolenaugustl: in anycase unlike node.js real multithreading programming is possible - and not too scary.
17:17amalloyaugustl: to clarify/simplify what dnolen said: clojure's popular web servers do service each request in its own thread
17:17vijaykiranyoklov: thanks .. yes. But the second statement - clojure extends the code-as-data to maps, vetors - means they are also seqs ?
17:19augustlamalloy, dnolen: I see. Makes sence, since threading apparently is both simple and easy in clojure
17:19augustlsense*
17:19brehautaugustl: its also fairly trivially to turn a blocking function into a nonblocking function, but going the other direction requires a bit more work
17:20amalloyi don't think i would allow the word "trivial" to be used anywhere near those sentences
17:21brehautlol
17:21yoklovclojure provides literals for vectors (e.g. [1 2 3 4]), maps (e.g. {:a 1 :b 2 :c 3}) and sets (e.g. #{:a :b :c :d}) as well as lists, all of these implement seq, meaning that you can use the seq functions (conj, first, next, rest, etc) on them.
17:21yokloverr
17:21yoklovthat was directed at vijaykiran
17:21amalloyyou can take a blocking function and run it in a future; that much is easy. but actually taking advantage of that and not breaking the rest of your app...
17:22brehautamalloy: i was just talking about that at the level of a single function call, not the whole app
17:22brehautthe equivalent promise / deliver setup for going the other direction is a bit clunkier
17:24vijaykiranyoklov: ok .. got it! thanks!
17:25yoklovno problem! i used to TA a course on scheme so i've explained lists many many times :)
17:26amalloytechnomancy: spoiler alert: you can compile clojure to javascript
17:26amalloyand since clojure and javascript each rock independently, this necessarily will rock in concert
17:26TimMcamalloy: You can compile *clojurescript* to javascript.
17:27TimMcand cljs looks like clj
17:27scottjtechnomancy: did you have some code that let you pick a user agent from a list in conkeror?
17:27vijaykiranbrehaut: (assuming you are guy who wrote) thanks for the article .. http://brehaut.net/blog/2011/ring_introduction inspired me to bootstrap my web dev post http://www.vijaykiran.com/2012/01/11/web-application-development-with-clojure-part-1/
17:27brehautvijaykiran: i am, thanks :)
17:35yoklovnice going TimMc, now everyone is too afraid to talk.
17:35TimMcOK, heading home, everyone can talk now.
17:43technomancyamalloy: you're saying that rockingness is composable?
17:44technomancyscottj: https://github.com/technomancy/dotfiles/commit/2904fe4868d6254820b1c2519d85327158df4394#.conkerorrc
17:44technomancyscottj: beware though, if you claim to be FF or chromium, the google search results page becomes unusable
17:44technomancyjust starts stealing keystrokes left and right
17:45technomancyOTOH mobile.twitter.com becomes a lot more pleasant
17:45technomancyis it just me, or does "ditch jquery for gclosure in order to use clojurescript" sound an awful lot like "learn emacs in order to learn clojure"? as far as advice goes?
17:45scottjtechnomancy: yeah, I've noticed the annoying google page when I tried to fix the weird o's in Google on conkeror page
17:46ibdknoxtechnomancy: yeah :(
17:46amalloytechnomancy: yes. it's way easier to just use jquery and not enable advanced optimizations
17:46ibdknoxamalloy: jQuery doesn't prevent advanced optimization, we need to stop telling people that :p
17:47amalloyreally?
17:47amalloywell stop telling me that, then
17:47technomancy"That thing you are really familiar with that has a technically-superior alternative? Yeah, you're going to want to get rid of it. This other thing is way better."
17:47ibdknoxI said that?
17:47amalloyno, not you specifically
17:47ibdknoxah
17:47ibdknoxyeah
17:48ibdknoxit will prevent jquery names from being munged, but properly wrapped that happens exactly once per name
17:48ibdknoxif you're trying to optimize size to that degree, you're probably doing it wrong
18:01technomancyis anyone using swank with cljs-one?
18:02technomancyswank kind of assumes you aren't going to be doing insane things like script/setup_classpath
18:04Raynestechnomancy: Do you have some kind of insatiable urge to do *everything* in Emacs?
18:05augustlhmm, noir seems to use a lot of side effects, such as cookies being set with (session/put! ...)
18:05emezeskeRaynes: isn't that a trait of all emacs users?
18:05augustlis that bad?
18:05ibdknoxRaynes: technomancy *us* emacs
18:05ibdknoxmeh
18:05ibdknoxis rather
18:05yoklovyeah thats just an emacs user thing
18:05Raynesaugustl: Web development is a side-effecty thing.
18:06ibdknoxaugustl: try the alternative, it's painful
18:06augustlRaynes: true that, I'd imagine a more clojure-esque soltion would simply be to return something
18:06Raynesaugustl: Setting sessions inside of a highly isolated environment is okay imo, especially when the alternative is insane code for something that should be easy.
18:06technomancyRaynes: inferior-lisp is in emacs too
18:06technomancyit's just gross
18:06augustl{:cookies {:foo "bar"}, :body "test} or whatever
18:06RaynesYou can do that if you want.
18:06technomancyhttp://penny-arcade.com/comic/2005/06/06
18:06augustlRaynes: in general, or in Noir?
18:06ibdknoxaugustl: both
18:06RaynesBoth.
18:07technomancys/have a regular DVD player/use a repl via a shell command/
18:07RaynesNoir's stateful session is a layer on top of existing session infrastructure in ring.
18:07ibdknoxaugustl: But I can tell you from experience that that adds an immense amount of complexity for literally no benefit
18:07RaynesSame with cookies.
18:07augustlhmm, is this documented somewhere?
18:08ibdknoxaugustl: "Alternatively, you can return a map with keys that correspond to the Ring spec. Here's an example of returning a response with a different status code:"
18:08ibdknoxaugustl: http://www.webnoir.org/tutorials/routes
18:08augustlhmm, can't seem to find anything about setting cookies in there
18:09augustloh
18:09ibdknoxaugustl: why do you want to, though?
18:09augustlibdknox: not currently writing an application, just exploring a bit
18:10ibdknoxthe reason I don't talk about it in the docs is because it doesn't work very well
18:10ibdknoxeven before Noir there was sandbar which made sessions stateful
18:10RaynesNot using stateful sessions is like a one night stand. It feels really good at first, but you're gonna hate yourself in the morning.
18:10ibdknoxlol
18:11augustlRaynes: what exactly do you mean by stateful sessions?
18:11Raynesuggtghtgbhrh WHAT HAVE I DONE TO MY CODEEEE!?!?!
18:11RaynesThat's what we're talking about here.
18:12augustlso stateful sesions == storing data in cookies?
18:12ibdknoxhm?
18:12augustlor do you mean storing additional session data on the server?
18:12ibdknoxthey're intrinsically tied
18:13ibdknoxthe way a session is stored is by setting a session id cookie for the user
18:13augustlhmm, good point, it's refering to data on the server
18:13ibdknoxsessions are inherently stateful things, as are cookies
18:13yoklovuse continuations!
18:13ibdknoxyou're storing some state to later be read (and usually modified)
18:13RaynesMonads are like burritos!
18:13augustlare ring cookies signed btw? Doesn't seems so according to the docs.
18:14ibdknoxNoir has a way to sign cookies
18:14RaynesI like to use a pen.
18:14augustl:D
18:14augustlhttp://www.webnoir.org/tutorials/sessions doesn't mention signing either
18:15ibdknoxaugustl: not many people have asked about it
18:15ibdknoxand it's not generally something a beginner needs to know
18:15augustlit makes sense that you can't simply set the data of the cookie to an arbitrary user ID..
18:15RaynesThose tutorials are kind of a getting started sort of thing and less of a "this explains EVERYTHING" sort of thing.
18:15RaynesThe API docs explain ALL the things.
18:15ibdknoxaugustl: http://webnoir.org/autodoc/1.2.1/noir.cookies-api.html
18:15augustlbut then I have to learn how it works :)
18:16ibdknoxaugustl: you don't store sensitive info in cookies usually
18:16augustlibdknox: indeed, but when storing the users ID for authenticatino, you do want signing
18:16amalloyaugustl: ring cookies are just a session-id; all the important data is stored server-side in a map keyed by the session-id
18:17augustloh, didn't know that, I thought setting session data just meant storing that data directly in the cookie
18:17amalloysomeone sniffing the network could steal the session-id and claim it as their own afaik, but they could do that with a signed cookie too
18:18ibdknoxsorry, I thought I made that clear earlier
18:18augustlamalloy: right if they get the contents of the cookie they own the session
18:18augustlamalloy: but ideally that won't happen (https yay)
18:18ibdknoxno real data should ever be stored in a cookie
18:18amalloyindeed
18:18augustlbut it would be a shame if all it took was storing the value "1" in the cookie to log in as user with id 1 :)
18:18RaynesI only store fake data in my cookies.
18:18ibdknoxme too
18:19amalloyRaynes: #clojure's expert on one night stand psychology?
18:19augustlstoring a session ID only is more security than obscurity
18:19augustlI don't know what the session ID looks like but I have a feeling it's easier to guess than a signature..
18:19ibdknoxit's a high entropy uuid
18:19amalloyaugustl: ring has configurable cookie storage backends, though
18:19Raynesamalloy: I guess I'm just not great at metaphor.
18:20amalloythere's a backend which uses a private key or something to encrypt (not sign) the cookie data and send it across to the client
18:20ibdknoxaugustl: either way, you can easily set the session cookie options and make it http only
18:20augustlwhere is this documented? Not here, it seems http://mmcgrana.github.com/ring/ring.middleware.cookies.html
18:20ibdknoxaugustl: where is what documented?
18:20Raynesamalloy has a mongo-session for storing session data in mongodb. It's the best thing ever.
18:20amalloydocumented in "read the source" mode, i imagine
18:20technomancyRaynes: "I'm like a shark; I just gotta keep... making analogies."
18:21technomancyhttp://www.penny-arcade.com/comic/2006/03/01
18:21augustlibdknox: ring storing the session data on the server
18:21ibdknoxaugustl: http://mmcgrana.github.com/ring/ring.middleware.session.html
18:22augustlah, didn't know there was a separate "sessions" api
18:22ibdknoxthat's essentially how all sessions work though, I'm not aware of a server implementation that stores sessions actually in the cookie
18:22augustlibdknox: Ruby on Rails does this by default
18:22augustlall session data is stored in a cookie, then it's signed with a server-side secret
18:23augustlyou can tell it to store in memory, in db, memcached, etc too, though
18:23amalloyibdknox: there's a backend which uses a private key to encrypt (not sign) the session data and send it across to the client via the cookie
18:24ibdknoxaugustl: really? http://guides.rubyonrails.org/security.html
18:24augustlnot sure why Rails just signs, instead of encrypring everything
18:24augustlibdknox: really :)
18:25augustl"To prevent session hash tampering, a digest is calculated from the session with a server-side secret and inserted into the end of the cookie."
18:25jcrossley3augustl: ibdknox: that's only the default for dev convenience. sadly, some leave it that way in production.
18:25ibdknoxah
18:25augustlin other words, signing
18:25ibdknoxthat's a new change
18:25augustlit's been there since 2.3 iirc
18:25ibdknoxjcrossley3: yeah, cookiestore didn't used to be the default
18:25ibdknoxI'm out of date :)
18:26jcrossley3ibdknox: the default used to be in the db, which had other problems.
18:27vijaykiranplay! does same thing too (like RoR) saving "session" in a cookie
18:27ibdknoxjcrossley3: yeah, being painfully slow was one of them lol
18:27augustljcrossley3: why is it "sadly" that someone uses it in production?
18:28jcrossley3augustl: it's always a risk to store user data in the browser, but i take your point -- it depends on the data.
18:29augustlI guess there are situations where you don't even want to expose the user ID
18:29ibdknoxin memory seems like a nice compromise
18:29augustlor more generally, want to store any user-specific information in a cookie
18:29jcrossley3i just meant that some folks accidentally store sensitive data due to the default.
18:32jcrossley3ibdknox: agree about in-memory, until you need replication
18:32ibdknoxjcrossley3: sticky sessions
18:32jcrossley3that is a common choice, yes.
18:33augustlmemcached makes sense
18:34ibdknoxjcrossley3: at the point at which you need replication, it's time to use an in-memory store (redis or memcached)
18:34ibdknoxwhich is pretty easy to do
18:35ibdknoxwriting a session-store is pretty simple :)
18:37hiredmanjcrossley3 would prefer, I am sure, that you use infinispan
18:42jcrossley3`ibdknox: did you answer my last question? (i got bounced)
18:43ibdknox_jcrossley3`: I didn't see your question :)
18:43jcrossley3`[18:39] <jcrossley3> ibdknox: is redis or memcached what you meant when you first referred to "in memory", cuz i took you to mean "sharing ring's memory"?
18:43jcrossley3`
18:43ibdknox_jcrossley3`: nope, I meant in process
18:44ibdknox_but you brought up the point of replication, at which point it's easy enough to just go out of process
18:44ibdknox_and use something like memcached
18:44jcrossley3`ibdknox_: right. does ring/noir support using memcached/redis as a session store?
18:45ibdknox_jcrossley3`: it supports anything you want if you write your own session store
18:45ibdknox_jcrossley3`: amalloy has a mongo one
18:45ibdknox_jcrossley3`: we have a postgres one
18:46jcrossley3`ibdknox_: so you're not aware of one written for memcached or redis?
18:47ibdknox_jcrossley3`: I don't know of one off the top of my head, but that doesn't mean there isn't one
18:48amalloyjcrossley3`: confirmation of how easy it is configure session-store backends: https://github.com/amalloy/mongo-session/blob/develop/src/mongo_session/core.clj is the whole library i wrote for doing it, and https://github.com/4clojure/4clojure/commit/1249c6d is the change i made to my app to use it
18:49Rayneshttps://github.com/Raynes/refheap/blob/develop/src/refheap/server.clj#L23 weeeeee
18:49jcrossley3`amalloy: perfect example, ty!
18:50ibdknox_has anyone used the new mongo library?
18:50RaynesMonger?
18:50ibdknox_yeah
18:50RaynesI've been thinking of moving refheap to it.
18:50ibdknox_it looks nicer
18:50RaynesProbably after the 1.0.0 release.
18:50RaynesMoving will be a bitch though.
18:50RaynesPlenty of queries/updates to screw up.
18:51ibdknox_lol
18:55jcrossley3`/nick jcrossley3
18:55jcrossley3`
19:05_carlos_hi!
19:05_carlos_how am I supposed to use repl doc to find documentation about stuff installed inside a project by lein?
19:06technomancy(find-doc #"set")
19:06technomancy,(find-doc #"set")
19:06clojurebot-------------------------
19:06clojurebotclojure.core/*flush-on-newline*
19:06clojurebot When set to true, output will be flushed whenever a newline is printed.
19:06clojurebot Defaults to true.
19:06clojurebot-------------------------
19:06clojurebotclojure.core/*loaded-libs*
19:06clojurebot A ref to a sorted set of symbols representing loaded libs
19:06clojurebot-------------------------
19:06clojurebotclojure.core/*print-dup*
19:06clojurebot When set to logical true, objects will be printed in a way that preserves
19:06ibdknox_oh god
19:06TimMcugh
19:06technomancyoh cripes
19:06clojurebot their...
19:07technomancyclojurebot: you had me panicking there for a minute.
19:07clojurebotExcuse me?
19:08_carlos_technomancy: was that for me?
19:09_carlos_wait ._. you are the one who did this lein script right?
19:09technomancyI had some help.
19:09TimMchaha
19:10technomancyamalloy: hey, you use M-x slime-connect rather than jack-in right?
19:10technomancyit used to be that as long as slime-repl.el was loaded, M-x slime-connect would open a repl buffer
19:11technomancybut now I just get the connection opened without a repl, and M-x slime-repl opens some CL-USER> nonsense
19:11technomancywhat did I break?
19:12technomancyand is it broken for you too?
19:13_carlos_technomancy: (find-doc #"drop-down") nil <- I get this I am sure I have hiccup installed, because it's not complaining about the name when running the app
19:13technomancy_carlos_: find-doc only works with code that has been loaded
19:14_carlos_technomancy: yeah, makes sense. thanks!
19:15technomancysure
19:16TimMcAh, it looks at ns-interns for all-ns
19:27brehautTimMc: i love how easy it is to read the implementation of so much of clojures stuff.
19:28brehautim pretty sure i know more about the internals of clojures functions in a few years of dabbling than i know about python after many years of serious use
19:28alexbaranoskybrehaut, my thoughts exactly
19:29gtrakthe scope of python's implementation is much broader than clojure's, comparatively, clojure is a thin layer over java i think
19:31brehautgtrak: im not sure thats relevant or especially accurate
19:31clojurebotTitim gan éirí ort.
19:33TimMcHmm, why don't I have clojure-jack-in... I bet I'm using an old repo site.
19:35tmciverTimMc: are you using marmalade as a repo?
19:36tmciverTimMc: I believe that's where you should get clojure-mode
19:37_carlos_after lein repl inside the project, I run (:require [hiccup.form-helpers :as form-helpers]) , but I get compiling:(NO_SOURCE_PATH:1) . something is escaping me
19:38tmciver_carlos_: did you do lein deps first?
19:38tmciver_carlos_: and do you have a version of hiccup listed in :dependencies in project.clj?
19:38TimMctmciver: Right now I'm trying to figure out whehter it's bad that I have el-get commands in my .emacs
19:38gtrakbrehaut: well I'm trying to run cloc on jython and clojure, that'd be more apples
19:39gtrakto apples
19:39_carlos_tmciver: no, I ran lein run, which copied alot of files. I thought it ran deps implicitly. probably I'm wrong, but anyways, form-helpers/drop-down name is recognized, so I assume it is loaded
19:40_carlos_tcrawley: form-helpers/drop-down name is recognized when running the web app
19:40gtrakbrehaut: I also know some python and the semantics are much more involved than clojure imo, there's a lot more magic going on
19:40brehautgtrak: thats exactly my point.
19:40_carlos_sorry, tmciver above, it was for you
19:40tmciver_carlos_: you may be right; not sure. If you're getting form-helpers, then it's loaded.
19:40brehautgtrak: i can read clojure.core and understand it; the equivalent python code is much more magical
19:40gtrakbrehaut: yea, we agree
19:41gtrakI just wanted to try to explain *why*
19:41tmciver_carlos_: ahh, it's not (:require . . . it's (require . . .
19:42ibdknoxI can't tell you how many people I've seen run into that...
19:43gtrakbrehaut: fyi, jython's at 97k lines of java and 83k lines of python
19:44mdeboarddat JPype
19:44tmciverTimMc: I'm not even sure what el-get is . . . it's spanish for 'the get' right?
19:44gtrakclojure has 35k lines of java
19:44TimMctmciver: or elpa-get, dunno
19:45TimMcSomething that pulls from a repo.
19:45technomancytmciver: you shouldn't ever have to run lein deps by hand
19:45technomancy_carlos_: :require is meant for ns declarations; for repl use you want require
19:45technomancywithout the colon
19:46tmcivertechnomancy: really? I don't usually use lein run.
19:46technomancytmciver: for any task
19:46technomancyif it needs the deps, it will get them
19:46RaynesI use lein run more than I use my text editor.
19:46ibdknoxtechnomancy: even if you update the project?
19:46RaynesIt's just… it's just magical.
19:46technomancyibdknox: as of 1.6.2, yes
19:46ibdknoxhah, didn't know that
19:46hiredmanor if you task you want to run is a lein plugin
19:47TimMctechnomancy: Right, you don't have to run lein deps... you just have to delete lib. >_>
19:47Raynestechnomancy: As soon as I get a chance, I'll set us up with a dependency on lein-newnew in Leiningen.
19:47Raynestechnomancy: Don't want you to think I've forgotten or am being lazy or anything. I just haven't gotten around to it.
19:47technomancyibdknox: just noticed I left it out of the release notes.
19:47technomancywhich I'm sure you study thoroughly!
19:47technomancyTimMc: no, not even that
19:47RaynesIt isn't like I haven't looked at your elisp for like a week and a half or anything like that. I'm not a bad person.
19:47tmcivertechnomancy: then you're to blame!
19:47ibdknoxtechnomancy: study the kerning of each letter
19:47technomancyguys
19:47technomancyguys
19:47TimMctechnomancy: Oh, is it schmott enough now?
19:47technomancyI just want someone to answer my slime question
19:48technomancyhalp
19:48ibdknox~guards
19:48clojurebotSEIZE HIM!
19:48Raynes$guards
19:48lazybotSEIZE HIM!
19:48technomancyit checksums the concatenation of :dependencies and :dev-dependencies or whatever
19:49technomancysmartypants lein
19:49hiredmantechnomancy: that doesn't seem to work well if you delete a file from lib/
19:49technomancyseriously though, why does the slime-repl buffer not show up when I do M-x slime-connect. it used to do that, but then I got spoiled by jack-in and stopped paying attention.
19:49technomancyhiredman: true, unless you're also using :local-repo-classpath, in which case lib/ isn't even populated
19:49hiredman(because you are working on a mvn project and installed a new snapshot and what to pull it in)
19:50tmcivertechnomancy: it does for me (sometimes)
19:50tmciversometimes I get an error that I don't understand.
19:50technomancytmciver: the plot thickens!
19:51hiredmantechnomancy: interesting
19:51tmcivertechnomancy: it seems that sometimes when I ', quit' slime, swank continues to run and I can connect to it.
19:51tmciverI think that's what's happening anyways.
19:52tmciverBut as with many errors I run into I just restart emacs and fuh-get abaht it!
19:52_carlos_(require [hiccup.form-helpers :as form-helpers]) CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: hiccup.form-helpers, compiling:(NO_SOURCE_PATH:1)
19:52hiredman'
19:52_carlos_probably I'm just doing something dumb..
19:53ibdknox_carlos_: you need to quote it '[hiccup...
19:53_carlos_hiredman: I need '?
19:53_carlos_ok
20:00gtrakbrehaut, check it out: clojure: 35k lines java, 15k clj; jython: 97k java, 84k python, jruby: 191k java, 5k yacc, 1.5k ruby.
20:00gtrakno tests
20:00_carlos_thanks ibdknox, technomancy, I can require and read documentation properly now
20:00ibdknoxso a 3-4x difference
20:00gtrakerr, wait, I got the python one wrong
20:01gtrak94k java, 3k python
20:01ibdknoxlol
20:01ibdknox2-4x then
20:03ashafahello
20:05_carlos_hello
20:05ashafaQuestion ... is there a new way of setting *main-cli-fn* with a recently pulled clojurescript master?
20:05yoklovwhat do people use for 2d grids in clojure. vector-of-vectors is kind of… awkward to use
20:05ashafasorry, this is fore nodejs
20:06ashafafor*
20:07ibdknoxyoklov: depends on what you're doing with it, you can use a map with positions as keys {[0 0] "x" [0 1] "y"}
20:08yoklovwell it's going to be representing a square that's totally full
20:08yoklovso thats probably not that good.
20:08ibdknoxit's easy enough to flatten it
20:08brehautgtrak: thats pretty interesting
20:10yoklovhrm.
20:10yoklovyou know that might actually be really convenient.
20:10yoklovand they're probably not going to be significantly higher than 20 by 20 so performance isn't a big issue.
20:10ibdknoxif I remember right, that's what I did for the sudoku solver I wrote
20:11ibdknoxit was straightforward
20:11yoklovyeah, this is for a small game
20:11ashafaAnyone use the new clojurescript master with nodejs?
20:11ibdknoxashafa: I don't know of many folks using CLJS with node yet
20:12ashafaI thought so...
20:13ashafahttp://mmcgrana.github.com/2011/09/clojurescript-nodejs.html this worked perfectly till I pulled latest from github
20:13ashafa*til
20:15ibdknoxashafa: the property syntax changed
20:15ibdknoxashafa: so things like (.end x) need to be (.-end x)
20:17ashafaibdknox: you, i knew about that and changed my code base accordingly... but the error i'm getting is genereated by core
20:17ashafasorry typing is off
20:18ashafa(= ibdknox swanodette)
20:19ashafa?
20:19ashafacause I used that same example earlier on twitter
20:20ashafawhen swanodette was helping me out
20:24ashafathanks all... i'll do more investigating when I have the chance
20:31ibdknoxashafa: no, I'm not swanodette :) that would be dnolen
20:33ashafaibdknox: sorry about that... it seems core has changed but my compiler is still emitting old js
20:34ashafamaybe i need to delete my repo and re-bootstrap
20:36yoklovif i do something like (derive ::foo ::bar) in one namespace (ns1) and use ns1 in another (ns2), i then need to call refer to those by :ns1/foo and :ns1/bar in order to be talking about the same thing, right?
20:39ashafai take that baske
20:39ashafaback
20:41yokloverr, really i just want to know where i can learn more about hierarchies :/
20:41yokloveven some code that uses them a lot
20:42ashafaok found the problem
20:42ashafaline 8 of nodejscli.cljs needs to change to (apply cljs.core/*main-cli-fn* (drop 2 (.-argv nodejs/process)))
20:43ashafawill start the github process
20:45priv_cooperWhat would you say is the best tutorial for setting up clojure/swank/slime with aquamacs?
20:45babilenyoklov: Joy of Clojure and Clojure in Action have good chapters on it.
20:45hiredmandon't
20:45babilenheh
20:45yoklovoh i think i have one of those
20:45hiredmanpriv_cooper: http://emacsformacosx.com/ is what you want
20:46yoklov^^^^^^
20:46yoklovthat is really true.
20:48priv_cooperhiredman: Thanks
20:50`fogusashafa: Just pushed the node.js changes
20:51ibdknoxwhen doing read-string/eval is there a way to preserve line numbering such that an exception would still reference lines correctly?
20:51ibdknoxpeople who know the compiler well ^
20:54_carlos_its really hard for me to find out what is the second argument of hiccup.form-helpers/drop-down. am I missing something reading the doc?
20:55hiredmanibdknox: you can try putting :line metadata on the form passed to eval
20:56brehaut_carlos_: its a seq of the options in the dropdown
20:56_carlos_brehaut: how did you find out?
20:57brehaut_carlos_: i looked at the source
20:57brehaut_carlos_: https://github.com/weavejester/hiccup/blob/master/src/hiccup/form_helpers.clj#L76-91
20:57ibdknoxhiredman: no luck :(
20:58hiredman,(eval '[do 1])
20:58clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
20:58brehaut_carlos_ looks like (drop-down "foo" ["a" "b"]) and (drop-down "foo" [{:name "a" :id "1"} {:name "b" :id "23"}]) are both valid ways to use it
20:59brehautwait. screwed that up. second should be (drop-down "foo" [["a" "1"] ["b" "23"]])
21:19_carlos_brehaut: thanks, that worked
21:21_carlos_its time to continue studying the language. I still look at the language like I'm seeing just alot of parentheses
21:22yoklovi miss the parentheses when i program in non-lisps
21:34TimMcHow do I tell which library is the culprit for a "not declared dynamic" warning?
21:34TimMcNo namespace is provided in the warning.
21:35TimMcI guess creating an uberjar, unzipping it, and grepping that will have to do.
21:35babilenTimMc: Isn't the var name included in the warning? You might be able to track it down by using that.
21:36babilenyeah, something like that :) (not very elegant, but it probably works)
21:58yoklovis it frowned upon to have a bunch of maps with :type keys?
21:59yoklovshould i just be using defrecord
22:01TimMcyoklov: No, maps are fine.
22:02TimMcThey're recommended over defrecord (unless you need interop).
22:02yoklovand using a :type tag isn't bad?
22:03TimMcI don't see why it would be.
22:06TimMclancepantz: Oh good, I see clj-json is getting 1.3-ified. Any idea when that will be released?
22:12yoklovoh damn.
22:12yoklovi don't even have the _slighest clue_ how to write a flood fill functionally.
22:12TimMcyoklov: Want a hint?
22:12yoklovbadly.
22:13TimMcyoklov: Are you familiar with the concept of a worklist?
22:13yoklovoh, yeah.
22:13yoklovuse a queue?
22:13yoklovthat makes sense.
22:13TimMcI would use a set, I guess.
22:13TimMcBut a queue would probably be more efficient, and prettier if it is graphical.
22:14yoklovit's not
22:14TimMcWell, I'd say use two sets -- a completed set and a todo set.
22:15yoklovhm
22:16TimMcyoklov: Are you actually modifying, say, an image, or are you just gathering the set of points in the fill?
22:17yoklovneither i'm setting every point in a 2d array to be a certain thing. it's for a game, the grid is a room the value i'm setting is the floor tiles
22:18yoklovtypically its been more expressive/easier for me to implement describing rooms in terms of bitmap operations (e.g. (fill room floor) (outline room wall))
22:18TimMcYou start with both sets empty and a current element. Process the current element. For each neighbor, if it is not in the completed set, add it to the worklist. Add the current element to the completed set.
22:18TimMcRecur with the first of the worklist, dropping it from that set.
22:18yoklovright, i've done it imperatively before
22:18yoklovw/o recursion
22:19yoklovi'm just wondering if this might be vastly harder in clojure than, say, just drawing ascii art to represent it
22:19yoklovwhich seems very likely.
22:19TimMcYou'll probably end up with a little library of grid operations.
22:22yoklovthat's certainly true
22:22TimMcQuick way to read a SQL table out as a collection of records?
22:27TimMcOh, doall on a sql/with-query-results result seems to do it!
22:31yoklov\# is the '#' character in clojure, right?
22:31yoklovemacs seems to balk at the idea of allowing me to type it.
22:33jodarooh, logging
22:34TimMcyoklov: Mine isn't giving me any trouble.
22:36yoklovhm.
22:37yoklovyeah, i must have been mistaken, i can't get it to happen again.
23:28yoklovwell thats all the code i got in me tonight
23:28yoklovthanks for all the help
23:40gunsIf I wanted to map values of a hashmap and return a hashmap, is (into {} (map λ hm)) an optimal way to do it, or do I use assoc?
23:44TimMcmap
23:44TimMc'for can also be nice, since it has destructuring.
23:44gunsfor with assoc?
23:44gunsinto {} is too roundabout?
23:45TimMc(into {} (for [[k v] hm] ...))
23:45gunsTimMc: Oh that's nice
23:45gunsty
23:47TimMcguns: (zipmap (keys hm) (map λ (vals hm)))
23:47gunsTimMc: oh like interleave, but → hashmap
23:47gunsnice