#clojure logs

2012-10-23

00:04Sgeo,(resolve 'resolve)
00:04clojurebot#'clojure.core/resolve
00:05SgeoHmm.
00:05Sgeotryclj yells at resolve
01:52tomoj"extends java.lang.Object" makes me cry
01:53muhoodoesn't everything ultimately extend java.lang.Object?
01:59SgeoExcept primitives. Because hey, there's no reason to have a _completely_ universal subtype, is there?
02:05Licensergrrr
02:06tomojmuhoo: I mean the high frequency of directly extending object and not implementing any interfaces
02:09SgeoThen again, I guess I don't do much OO programming... or any programming...
02:10antares_Sgeo: that's not bad, just wasn't practical efficiency-wise in mid-to-late 90s
02:11SgeoAnd something relevant to then bothers tomoj now?
02:19amalloytomoj is objecting because it means all your application code has to be custom-built to deal with specifically the new "bespoke data holders" you made up
02:24Licenserantares_ I think that explains it, java is efficiency-wise in the mid-to-late 90s too ;)
02:31amalloyi can't think of any "efficiency-wise" concerns related to extending Object directly
02:36alex_baranoskydo any of the JSON serialization libraries have default Object serializer that just toStrings the Object? I'm using Cheshire and if it doesn't know of a Class it throws an exception which is too strict for my needs
02:36Raynesalex_baranosky: Can't you extend its protocol?
02:36alex_baranoskyRaynes: hmmm good question. Probably. Let me see
02:37RaynesI've done it before. Not sure if it was for cheshire, but I've done it for some json lib.
02:37alex_baranoskyRaynes: not Cheshire. It doesn't use protocols
02:38alex_baranoskybut in general I'll look for a Protocol-using library. Thanks
02:38Rayneswat
02:38Raynesalex_baranosky: clojure.data.json is extensible.
02:38Raynesalex_baranosky: Can you use this add-encoder stuff?
02:39RaynesI see why it doesn't use protocols, duh, the JSON parser is Java.
02:39Raynesalex_baranosky: https://github.com/dakrone/cheshire/blob/master/src/cheshire/custom.clj
02:40RaynesThere is too a protocol.
02:40RaynesFor the Clojure stuff.
02:40alex_baranoskyRaynes: thanks for the help, I appreciate it
02:44alex_baranoskyRaynes: it looks like the curom.clj is meant to be used separately from the standard Cheshire stuff, is that right?
02:45Raynes"In version 3.0.0 and above, custom encoding first attempts to encode the object using the core encoding (because it would be faster). If the encoding fails, it uses the custom encoding mechanics to encode the JSON. If this is undesirable, use the generate-string*, generate-stream* and generate-smile* methods to overwrite this."
02:45Raynesalex_baranosky: ^
02:47RaynesWell, that seemed more helpful when I read it the first time.
02:47Raynesalex_baranosky: Strangely, yes, it appears the core stuff doesn't touch custom.
02:48alex_baranoskyRaynes: I've just spent some time reading through it. Sounds like custom was added later
02:48alex_baranoskybut it will work for me.
02:48Raynesalex_baranosky: It appears that you can just use custom instead of core. It's a drop-in replacement.
02:48alex_baranoskyI'm just going to extend the JSONable protocol to Object
02:48RaynesI'm not sure why this isn't the default. I imagine because of performance.
02:54amalloyRaynes: because throwing an exception is better than silently serializing to garbage
02:54Raynesamalloy: I think you read that wrong.
02:55amalloyi see. i thought you were replaying to alex
02:55SgeoI'm not sure how JSONifying arbitrary Objects is useful?
02:56antares_alex_baranosky: Cheshire is now extensible, too
02:56Raynesantares_: Backlog.
02:56antares_alex_baranosky: I switched clojurewerkz.org projects to use it, had to sacrifice no functionality, works great
02:56RaynesWe just had a whole discussion about that.
02:56antares_Raynes: I know, just sharing my experience
02:56alex_baranoskySgeo: is that a rhetorical question? :D
02:56RaynesYeah, but you said "Cheshire is no extensible" even though we had already established this.
02:56Raynes:p
02:56antares_Raynes: imma to busy writing clojah docs to read backlogs :P
02:56antares_*too
02:57RaynesSgeo: In his case he wants to do something with objects that aren't by default serializable to json that isn't throw an exception.
02:57Raynesantares_: You're going to the conj this year?
02:58antares_Raynes: nope
02:58RaynesBah.
02:58RaynesNobody is.
02:58SgeoHmm, does serializable-fn use &env?
02:58RaynesSgeo: Yes.
02:58alex_baranoskySgeo, Raynes: at Runa we're experimenting with logging as JSON. The OPs guys prefer data because they can script over it easier
02:58Raynesalex_baranosky: Why not edn?
02:58SgeoRaynes, cool
02:58antares_Raynes: I live too far away, hold the wrong citizenship and my international passport is expiring in less than 6 months (so, no US visa) :)
02:59antares_alex_baranosky: logs-as-data is a fantastic practice
02:59SgeoWhat other uses are there for &env ?
02:59alex_baranoskyRaynes: what is edn?
02:59Sgeoedn : clojure :: json : javascript
02:59antares_alex_baranosky: https://github.com/edn-format/edn
02:59Raynesalex_baranosky: https://github.com/edn-format/edn
03:00alex_baranoskySgeo: macros that do crazy stuff with symbols, and want to be able to discern between ones that are locally bound
03:00alex_baranoskyRaynes: ahhhh EDN, I knew of it, but forgot the acronym
03:01alex_baranoskyRaynes: I think in general the answer to that question I always get is "JSON has better tool support"
03:01RaynesI can't imagine what tools you'd use.
03:01RaynesBut I don't know the set up.
03:01alex_baranoskyI can't either, but talking to them, they preferred JSON
03:01alex_baranoskynot a big deal.. it is in experimental mode now anyway
03:02RaynesWho needs those darn reasons anyhow!
03:02alex_baranoskyeasy to switch to printing Clojure data
03:30muhooin the beginning, there were sexps. then, there was xml. now, there is json.
03:34RaynesAnd then there was muhoo...
03:36brainproxydatomic's aggregators are pretty cool :)
03:37Sgeofml. Remind me to never tutor without documenting everything in 20 different places
03:37Sgeo*tutor for money
03:39_ulisesonly 20?
03:39_ulisesmake that 50 and add some friendly reminders every 5 min to go and read those notes
03:55tomojhah
03:55tomojuser> (easy!)
03:55tomoj:awesome
03:56tomojdatomic.samples.repl/easy! to be precise
04:08wingycan anyone get this
04:08wingyactual: (not (= (["en-US" 1] ["en" 0.8] ["en-GB" 0.6]) (["en-US" 1] ["en" 0.8] ["en-GB" 0.6])))
04:08wingyits a clojure.test result .. they seem to be identical .. i can't get why the test fails
04:10wingyhaving quotes around them and running in repl: (not (= '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]) '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]))) ;; => false
04:10wingyso they should be identical
04:10wingysome hidden caveat of clojure i'm not aware of?
04:12_uliseswingy: ordering?
04:12_ulisesoh, sorry, didn't see they're identically ordered
04:12wingy_ulises: but they have the same ordering
04:12_uliseswingy: can I see the test?
04:13hyPiRionAhh, numbers.
04:13hyPiRion,(not (= '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]) '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6])))
04:13clojurebotfalse
04:13hyPiRionThis seems to work quite well though. You have a not in front.
04:14hyPiRionIf you suspected them to not be equal, the result should be true.
04:14_uliseshyPiRion: the not is appended by the clojure.test lib. I think
04:14hyPiRionoh.
04:14_uliseshyPiRion: to tell you they're not =
04:14_uliseshyPiRion: yeah, it's confusing
04:14wingysure … wait
04:15hyPiRionwingy: Try to remove the floats with integers instead. Might be that.
04:15_uliseshyPiRion: +1 I was about to say
04:15kralnamaste
04:16alex_baranoskyis there standard community-supported bit of code for making Compojure routes ignore trailing slashes?
04:16wingynope
04:16wingy(not (= (["en-GB" 1.0] ["en" 1.0] ["en-US" 1]) (["en-US" 1] ["en" 1] ["en-GB" 1])))
04:16wingywait the ordering is wrong
04:17alex_baranoskywing, you are saying a list is equal to itself
04:17alex_baranoskywingy: you want, (not (= ["en-GB" 1.0] ["en" 1.0] ["en-US" 1]) (["en-US" 1] ["en" 1] ["en-GB" 1])) ;; right?
04:18alex_baranoskyotherwise its like you're saying (= 1) ;; always true
04:19hyPiRionalex_baranosky: He's comparing two seemingly equal lists, and get false.
04:19_uliseswingy: a tangential comment: have you considered midje? it's got great matchers for collections
04:19wingyhyPiRion: i used ints and it works
04:19alex_baranoskyahhhh my fault, I see.
04:19hyPiRionwingy: ahh, floats. Those bastards!
04:19wingyputting 1.0 instead of 1 yield unexpected behaviour again
04:20wingybut on the repl when i run: (= '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]) '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]))
04:20wingyit yields true
04:20wingyso float is struggling just for clojure.repl?
04:20wingyi found a bug?
04:21_ulisesperhaps there's some odd boxing going on?
04:22hyPiRionwingy: It's just floating point representation which is terminated early.
04:22hyPiRion,(= 0.80235 (+ 0.12345 0.67890))
04:22clojurebotfalse
04:23_ulisesthis is why I was suggesting midje, it's got good matchers for collections and floats/doubles
04:23_ulisesso you can say "is this number within the vicinity of this other one" when you want to check 0.8 against 0.8
04:23wingyis there any way to get that test passing in clojure.test?
04:24wingythe real test looks like: (is (= (util/parse-accept-lang "en-US,en;q=0.8,en-GB;q=0.6") '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6]))))
04:24_uliseswingy: can't think of anything other than manually checking each pair and checking for (< (abs (- n1 n2)) delta)
04:24tgoossens,(= 1.0 (+ 0.9 0.1))
04:24clojurebottrue
04:24hyPiRionA nasty hack could be, like.
04:24hyPiRion,(= (str '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6])) (str '(["en-US" 1] ["en" 0.8] ["en-GB" 0.6])))
04:24clojurebottrue
04:25hyPiRionThough I wouldn't exactly recommend it, heh.
04:25_uliseswingy: I'd first break the check into individual contains? checks
04:25wingy_ulises: yeah i wanted to use midje but: https://github.com/marick/Midje/issues/152
04:25_uliseswingy: is that a showstopper? you can have lazytest watch code changes for you
04:26wingy_ulises: im not a fan of watchers .. that would run yet another jvm instance
04:26wingyim more a fan of repl based dev
04:27wingyalso the lazytest thing is so buggy!
04:27wingyyield duplication of output
04:27amalloywingy: what does ##(= (Long. 1) (Integer. 1)) say for your clojure version?
04:27lazybot⇒ true
04:28wingyamalloy: it says true
04:30wingyhyPiRion: i did that .. it worked .. i'll stick with that
04:30wingyat least its more accurate then having a delta like midje
04:30wingyclojure was not flawless!
04:30clgv"delta like midje"?
04:31wingyclgv: _ulises: so you can say "is this number within the vicinity of this other one" when you want to check 0.8 against 0.8
04:31clgvah ok. delta distance for equality check on floats..
04:32amalloyhyPiRion, wingy: str is an especially bad measure, because lazy-seqs print as LazySeq@hashcode; at least use pr-str
04:34wingyamalloy: done
04:34wingythx for the help all
05:17wingyi need to rebind System/currentTimeMillis but it says unable to resolve var
05:17wingy(with-redefs [System/currentTimeMillis #(do 1350981302764)]
05:17wingydo i need to import it first?
05:17_uliseswingy: not sure that's a var
05:18jaleywingy: it's not a far, that's a java static function
05:18wingyok
05:18_uliseswingy: can you not depend on a wrapper to currentTimeMillis and then rebind that?
05:18wingyis there a way to mock it?
05:18jaleywingy: a var, sorry
05:18_uliseswingy: wrap it with an fn then mock that
05:18wingyok
05:18jaleywingy: you'd need to change the code calling it to use some wrapper, afaik
05:18clgvwingy: no thats a static function call
05:19wingyyeah .. :(
05:23wingy_ulises: did as you said .. everything for testability
05:23wingythen i made the wrapper a private fn .. private fns dont need tests (its untestable anyway)
05:24clgvwingy: btw. do is not the idiomatic choice there. use (constantly 1350981302764)
05:24wingyok thx for pointing out
05:24clgvwingy: `constantly` works also for functions with arguments
05:24_uliseswingy: yeah, +1 on constantly and wrapping :)
05:24wingyyeah do should be for side effects?
05:25_uliseswingy: no side effects ever ;)
05:25wingy_ulises: im sure (do) is used for side effects, but perhaps you thought i meant constantly
05:26_uliseswingy: I meant you shouldn't have side effect ever
05:26_uliseswingy: do is generally used for side effects, yes
05:27wingyyou always need some side effects eg. printing out things
05:27_ulisespotentially yes
05:27wingybut yeah i hate side effects
05:28wingyhaving hard time to test them .. especially http requests
05:28_ulisesI mean, if by side effects you mean sending a response over the wire (in the case of a web app) then sure
05:29_uliseswingy: how are you trying to test them?
05:30wingy_ulises: im not sure yet, that will be the next thing i do, to test some service libraries using http to communicate with the services .. i think i'll just mock the requests/responses
05:30wingy_ulises: if you have suggestions for testing please share though
05:30wingyespecially for side effects
05:31_uliseswingy: well, it depends on what libs you're using; I think ring has helpers for this, noir does too
05:31_uliseswingy: but in principle, it should be enough to test your handlers, and if you're handlers are simple function calls, then testing those function calls it another thing you can test
05:32_uliseswingy: it also depends on what type of testing you want to do, at what level, etc.
05:32wingyi think that mocking/stubbing is good for: 1. execution speed 2. you see clearly what you send and receive, and only the http header values you return
05:32_uliseswingy: again, it depends on what you're wanting to test. If you only care about http headers, then sure.
05:33wingy3. good documentation as well .. i wasn't a big fan of TDD before but it got too uncontrolled without a good understanding for the code
05:33_uliseswingy: midge is great for tdd
05:34Licenserthis is a bit confusing: (list? (map inc [1 2 3])) => false
05:34lucianLicenser: it returns a seq, i think
05:34_ulises,(doc map)
05:34clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
05:34wingycan't start another jvm for it … imagine when Light Table is out .. i wanna programmatically run things from that process
05:34_ulisesLicenser: see the doc; it returns a lazy seq
05:35Licenserisn't a lazy squ a list too
05:35lucianno
05:35_ulisesLicenser: I think it's the other way around
05:35lucianthey're both collections though, i think
05:35wingythe more jvm instances are up the more RAM is eaten up and slower my laptop gets .. also just bad style altogether .. i hated to start watchers on node.js as well
05:35_ulisesLicenser: actually, no, what lucian said methinks
05:36lucianso if you do (coll? (map ...)) it should be true
05:36lucianjust like (coll? []) or (coll? '())
05:36_uliseswingy: not sure what you're on about? I generally have a small JVM for my slime/nrepl and another small one for midje and I don't have a stunning laptop really
05:37Licenserbut isn't a lazy seq behaving like a list
05:38_ulisesLicenser: not necessarily; seq is an abstraction over several collections
05:38_ulisesLicenser: the fact that it has (first ...) etc. which are common list operations doesn't mean it's a list
05:38_ulisesalthough duck-typers would say otherwise
05:39hyPiRiona list and a lazy-seq are both seqs, but a list is not a lazy-seq and vice versa.
05:39lucianyou can do (seq [1 2 3]), which returns a seq that is certainly not a list
05:39Licenser_ulises what I mean is, aside from the way how it's stored it behaves like a list, the performance characteristics etc are all listy or do I misunderstand it
05:39Sgeo_ulises, operations on a lazy seq can cause side effects, whereas operations on a list cannot. Is that sufficiently different for a duck-typer to say they're different?
05:57_ulisesSgeo: potentially :)
06:06RaynesI sometimes duck when I type,
06:07_ulisesheh
06:08michaelr525i never dype when i'm tuck
06:10ejacksoni'm more of the duck 'n cover type, myself.
06:27alex_baranoskywhat's the modern way to handler trailing slashes in routes in composure these days?
06:39clgvLicenser: you can use sequential? for that purpose
06:39goraciohi if i use :production profile how i can reference this in my -main func to use prod db and if profile :dev which is default i use devdb
07:07goracioso no one using profiles :)?
07:09RaynesMore that it's 4-7AM in the US and everybody is asleep.
07:14goracioRaynes: but you don't )
07:15Raynesgoracio: And my life suffers for it.
07:15goracioRaynes: so can you suggest the answer ?
07:16RaynesProfiles aren't visible in code. You can probably use https://github.com/davidsantiago/configleaf or project middleware for it, but I don't know the specifics.
07:20goracioRaynes: heh ok i just did this ( if (= (first args) ":dev")) ( connect to dev db) ( connect to prod db)
07:21goracioRaynes: it seems like heroku launch proj with something like - lein run :production
07:24tgoossensi have a function called format-string. What is currently does is
07:24tgoossens(clojure.string/replace string "\"" "==")
07:25tgoossensi also want a function deformat-string
07:25tgoossensthat does the inverse
07:25ljosHello, I was just wondering, does anyone have an example of how to use definline properly. I am not exactly sure if I understand the documentation.
07:25xeqigoracio: I've started using https://github.com/weavejester/environ for profile specific config
07:25tgoossensbut I prefer not to duplicate all the differenct replaces i'm going to do
07:25ljosShould have been a questionmark in there as well.
07:27goracioxeqi: ok wiil look at that but my hack works ok so far :)
07:36tgoossensif have a collection
07:37tgoossens(a b c d e f g)
07:37tgoossensand i want to make it into a string
07:37tgoossensa | b | c | d
07:37tgoossenswhat is a good way to do this?
07:38hyPiRionstring/join
07:38clgvgoracio: you could add the info via jvm parameters like describer in 2.14 *compiler-options* Var in https://github.com/clojure/clojure/blob/master/changes.md
07:38hyPiRion,(clojure.string/join " | " [1 2 3 4 5 6 7])
07:38clojurebot"1 | 2 | 3 | 4 | 5 | 6 | 7"
07:38tgoossenshmm
07:39tgoossensok that works but
07:39tgoossensi get this
07:39tgoossens"clojure.lang.LazySeq@9e3ad37c | clojure.lang.LazySeq@9e3ad37c | clojure.lang.LazySeq@c78525b7"
07:39tgoossensa b c d e f g are lazy sequences
07:39tgoossensand guaranteed to be finite
07:42hyPiRiontgoossens: (seq a) (seq b) etc.
07:42tgoossensok cool
07:42tgoossensit worked :p
07:42tgoossens(clojure.string/join " | " (map seq coll))
07:42tgoossensthanks
07:44hldfrOn http://www.4clojure.com/problem/22 , I'm trying to use for, this works in REPL, but fails on 4clojure -
07:44hldfr5:07 PM
07:44hldfr(#(apply + (for [x %] '1)) "Hello World")
07:44hldfr5:07 PM
07:44hldfr-> 11
07:44tgoossensnot quite there yet :) now it prints
07:44hldfrhow does this trip alarm on 4clojure -> "You tripped the alarm! count is bad!"
07:45tgoossens(a0 a1 a2 ..) | (b0 b1 b2 ..) | ...
07:45tgoossensmust become
07:45tgoossensa0 a1 a2 | b0 b1 b2 | ...
07:46hldfrWhy should use of 'for' on http://www.4clojure.com/problem/22 trip the alarm meant for use of 'count' ?
07:48tgoossens(clojure.string/join " | " (map #(clojure.string/join " " (seq %)) s)
07:48tgoossensthat did it
07:49clgv,(macroexpand-1 '(for [x (range 5)] 1))
07:49clojurebot(clojure.core/let [iter__2887__auto__ (clojure.core/fn iter__33 [s__34] (clojure.core/lazy-seq (clojure.core/loop [s__34 s__34] (clojure.core/when-let [s__34 (clojure.core/seq s__34)] (if (clojure.core/chunked-seq? s__34) (clojure.core/let [c__2885__auto__ (clojure.core/chunk-first s__34) size__2886__auto__ (clojure.core/int #) b__36 ...] (if (clojure.core/loop # #) (clojure.core/chunk-cons # #) (...
07:49clgv&(macroexpand-1 '(for [x (range 5)] 1))
07:49lazybot⇒ (clojure.core/let [iter__4468__auto__ (clojure.core/fn iter__318475 [s__318476] (clojure.core/lazy-seq (clojure.core/loop [s__318476 s__318476] (clojure.core/when-let [s__318476 (clojure.core/seq s__318476)] (if (clojure.core/chunked-seq? s__318476) (clojure.cor... https://www.refheap.com/paste/6052
07:49clgvhldfr: the expansion contains a `count`
07:50hldfrAh! so 4clojure restricts internal use of count too :) nice
07:51Chousukehow would you use for to solve that anyway?
07:51hldfrlike this - #(apply + (for [x %] '1))
07:51clgvhldfr: it's the chunked buffer implementation that bites you there
07:51Chousukehldfr: :P sounds like a complicated way to avoid reduce
07:52clgvChousuke: thats what I thought^^
07:52Chousukeyou have a seq and you want to produce a single value -> use reduce
07:55Chousukeif clojure had an "ignore second argument" HOF you wouldn't even need anonymous functions.
07:57Chousukehldfr: oh, and it's not necessary to quote literal numbers. it's a no-op.
07:57wingywhy do we even mock http requests responses .. isn't it much better just to run the live test code?
07:57wingyso it will be real data returned
07:58wingywrong channel nvm
07:59hldfryes, quoting wont be needed
08:00hldfrChousuke why would (map #(1) [1 2 3 4]) not work, where by #(1) I mean a function that returns 1 for anything passed into it
08:00hldfrI get an ArityException on this
08:00hldfrIf I explicitly state it in fn form with one arg it works (map (fn [x] 1) [1 2 3 4])
08:01hldfrwhat would be anonymous equivalent fo (fn [x] 1)
08:01Chousukehldfr: #(1) expands to (fn [] (1))
08:02Chousukeyou can do #(do 1) to circumvent that
08:04hldfr#(do 1) still gives back ArityException
08:05Chousukehldfr: use a fn form then
08:05hldfryeah
08:06Chousukebut you don't need to create a seq of 1s to solve this problem
08:06Chousuke(there's also the "constantly" function
08:07Chousukebut reducing over the parameter once is all you need, if you can figure out which function to reduce with
08:07hldfrah nice, I could map (constantly 1) over the seq
08:08hldfrthat too, that sounds more better
08:10hldfrOkay, I figured out this with reduce - #(reduce (fn [x y] (+ x 1)) 0 %)
08:11Chousukeyou can actually remove the #() wrapping the whole thing and just write "reduce (fn ...) 0" as the answer
08:11hldfryes
08:12Chousukealso there's a way to simplify your anonymous function just a bit even though it's correct :)
08:12Chousukeyou could use inc :P
08:12hldfrdamn yes :)
08:22Cubic,(doc .)
08:22clojurebotCool story bro.
08:59clgvChousuke: inc increases the golf score ;)
08:59clgv"+ x 1" => 3 chars, "inc x" => 4 chars ^^
09:01Chousukeclgv: they're both 5 characters
09:02Chousukespace counts too
09:07clgvChousuke: I dont think so. I checked that some time ago
09:10clgvChousuke: just checked - whitespace does not count
09:13wingy_ulises: you get duplicate output using lein midje --lazytest as well?
09:13_uliseswingy: I don't think I do. I don't use lazytest much though, I use midje-mode to run my tests
09:14wingy_ulises: that is for emacs?
09:14_uliseswingy: yeah
09:16wingy_ulises: https://github.com/marick/Midje/issues/149
09:16wingy:/
09:16wingythis is what i hate with midje
09:16wingyso buggy
09:17wingyand the creator is not taking it seriously
09:17wingyhas been there forever
09:17_uliseswingy: :/
09:18_ulisesyeah, well brian's a bit tied up, perhaps some delegation is in order
09:18_ulisesor even forking midje
09:30clgvwingy: he is currently writing a book.
09:30wingyclgv: i noticed that
09:30wingyperhaps i'll buy it
09:30clgvwingy: I cannot say that midje is very buggy. but I do not use lazytest mode
09:31wingyhttps://www.refheap.com/paste/6055
09:32clgvwingy: does the symbol "animal" exist?
09:32wingyclgv: no i thought that was what provided did
09:32clgvit has to. thats a design choice I guess.
09:32wingyso declare
09:32clgvyou can "declare" it or define an empty function
09:33wingyclgv: ok thx it works now
09:33clgvusing facts about something non-existent doesnt sound very reasonable. I'd like to get an error there since it might be a typo
09:34wingyright
09:34duck1123provided has to have something to mock, the macro doesn't convert code at that level. IIRC
09:51wingya comparison between midje and clojure.test
09:51wingyhttps://gist.github.com/3938823
09:54_uliseswingy: if you're going the midje way then you don't need the pr-str type of testing
09:55wingy_ulises: removing them caused failure
09:55_uliseswingy: see (roughly ...) in https://github.com/marick/Midje/wiki/Checkers
09:55_uliseswingy: you'd check something like 1.0 => (roughly 0.000001) or something silly like that
09:56wingy_ulises: i dont get how to use that one in my test
09:56_uliseswingy: I'm wondering now whether the collection checkers will use roughly for you already
09:57wingyi wrapped the right form within (contains)
09:57wingystill error
09:57_ulises:/
09:57wingyi'll use pr-str til i figure out how to use roughly with my test
09:57_ulisessounds like something one would want to do often enough to have predefined checkers
09:57_ulisessounds good
09:58wingy_ulises: but i dont like it checks for roughly
09:58wingythen its not accurate
09:58wingyso perhaps pr-str is a better solution .. ugly but it is correct
09:59clgvwingy: pr-str is semantically wrong there
10:05_uliseswingy: again on roughly, you use it like 1.0 => (roughly 1.0), as for checkers that use it I guess you'd have to write your own
10:06_uliseswingy: roughly takes 2 args: number and delta, if delta is omitted then it's taken to be 1/1000 of the number given
10:08wingy_ulises: yeah but i dont get how to make it work in my test:
10:08wingy(util/parse-accept-lang "en-US,en;q=0.8,en-GB;q=0.6") => '(["en-US" (rougly 1)] ["en" (rougly 0.8)] ["en-GB" (rougly 0.6)])
10:08wingydidnt cut it .. am i doing something wrong
10:09_uliseswingy: no you're not; I mean, you need your own checker along the lines of the contains checker. Something like (contains-languages ["en-US" 1] ...)
10:09_uliseswingy: then in (contains-languages ...) you'd use (roughly...)
10:09wingyokay
10:09_uliseswingy: thing is, your test would be a lot more readable too
10:09wingyyeah
10:10_uliseswingy: because (contains-languages ...) reads better than any other combination of contains, fns, roughly and any other magic you might put in place
10:10_ulisesIMHO
10:20wingythe reason i stick with midje is that i rather read midje tests when reading other devs code
10:20wingycan understand their code faster
10:20wingyrather than acting like a compiler in my mind
10:23clgvwingy: yeah they are more declarative than clojure test which is almost as programming tests in java ;)
10:24wingyyepp
11:21hammeri don't suppose midje plays nice with maven sites?
11:22hammeri know i know, how enterprisey :)
11:45lynaghk`Is there a nice way I can run a string of code in a certain namespace as if it were just pasted into that namespace? (i.e., it can refer to vars that have been imported into that ns by :use)
11:46lynaghk`And before anyone gets crazy about read-string + eval, this is for getting clj code from within markdown and replace it with the result, so I'm open to better ideas if there are any...
11:48wingywhat does this do: (fact (function-generator 3) => (exactly odd?)
11:48wingyi cant get it
11:48wingyfrom https://github.com/marick/Midje/wiki/Checkers
11:52noidiwingy, it checks that function-generator returns the function `odd?`
11:53noidiwithout the `exactly` it would check that calling `odd?` on the return value of `function-generator` returns a truthy value
11:54hcumberdaleHi
11:54wingynoidi: i see .. but that was a weird way to describe what function-generator does
11:54hcumberdalehow to pass the wrap-file-info from ring custom mime types ? (wrap-file-info {"woff" "application/x-font-woff"})
11:54wingywhy would passing 3 as arg return a odd? function
11:55noidiwingy, maybe the body of function-generator is (if (= arg 3) odd? even?)
11:55noidi:)
11:55hcumberdalewhen (wrap.... is included in -> macro: (-> my-routes ....
11:56wingyhehe yeah weird
11:57wingykinda cool that you can compare functions
11:57wingy,(= '(fn [] 1) '(fn [] 1))
11:57clojurebottrue
12:01amalloywingy: those aren't functions
12:01wingyamalloy: isn't that how midje is comparing
12:02amalloyi don't know anything about that. but you just compared two lists
12:02scriptorwingy: got a link to the code? Either way, what amalloy said
12:02wingyyeah
12:02scriptorclojure has no clue that those are functions
12:03wingyso to compare two functions you can make a list out of them and compare them
12:03wingy: ,(= (list (fn [] 1)) (list (fn [] 1)))
12:03scriptoras in comparing the code of the functions or the function objects themselves?
12:03tomoj`you get functions from lists, not lists from functions
12:03amalloywingy: given the impossible step 1, yes, your step 2 would work
12:03tomoj`&(= (list (fn [] 1)) (list (fn [] 1)))
12:03lazybot⇒ false
12:04wingyscriptor: the code of the fns
12:04tomoj`I suppose you can get lists from many functions, but unless the function is a quine..
12:05wingysomething that just came into my mind since midje is comparing fns .. if i didn't mistake
12:05tomojby identity?
12:05tomoj&(= odd? odd?)
12:05lazybot⇒ true
12:06scriptorwouldn't it be possible to create your own macro like fn that saves the function as a list in the fn's metadata?
12:06scriptorand by "like fn" I mean wrapping around defn
12:07TimMcscriptor: serializable-fn
12:07scriptorsweet
12:07TimMcAnother product of the HagelBorg.
12:08TimMcI think it came out of some caffeinated code swarm in Seattle.
12:08scriptoris it possible to rebind macros?
12:09TimMcI... I don't see why not...
12:09duck1123you'll have to re-eval where that macro is used
12:09jamiiIs there a way to locally 'use a namespace? Like (using 'my-ns (do ...)). I don't want to pollute the whole ns with imports but I have one fn that could really do with them...
12:09TimMcscriptor: You mean dynamic binding?
12:10TimMcjamii: I wrote something for use in tests.
12:10scriptorTimMc: right, but just wondering how different it'd be since the bindings are created in compile time
12:11TimMcjamii: https://github.com/timmc/handy/blob/master/src/org/timmc/handy.clj#L53
12:12TimMcjamii: In use: https://github.com/timmc/handy/blob/master/test/org/timmc/test/handy.clj#L56
12:13TimMcThe downside is that vars from the "containing" ns aren't visible.
12:14jamiiTimMc: I think that will work. I'm just building a huge AST to boostrap this compiler and I don't want the compiler namespace to be full of AST forms. Thanks :)
12:15TimMcWhy not use an actual separate namespace, then?
12:16technomancyyou can easily create throwaway namespaces with gensym; see slamhound for an example
12:18TimMcThat's what with-temp-ns does, except it has to do some extra stuff since it doesn't know what ns it will be called from. :-)
12:19technomancycool
12:19TimMcThis is probably the one time I have committed eval.
12:41CubicWhat does some-name# mean in macros?
12:42tomoj`foo#
12:42tomojer, ##`foo#
12:42lazybot⇒ foo__318513__auto__
12:43CubicSo it's like a gensym?
12:43dakroneCubic: it's shorthand for a gensym
12:43Cubicdakrone: I see
12:44eggheadhi #clojure, does anyone here have experience with defining a 'catch-all' route for compojure?
12:44clgv,(read-string "`foo#")
12:44clojurebot(quote foo__29__auto__)
12:44clgv,(read-string "foo#")
12:44clojurebotfoo#
12:45eggheadah, didn't know I could use * as the route url
12:45clgvit's not really a shortcut literally. the reader already does something
12:47amalloyTimMc, jamii: if you wanted something less like temp-ns and more specifically a "local" 'use, you could write https://gist.github.com/3939975
12:48jamiiamalloy: thats perfect :)
12:50amalloymacrolet solves so many problems in interesting ways
12:54tgoossensin leiningen when i do read-line
12:54tgoossensi can type something
12:54tgoossensbut how do i "enter" something
12:55tgoossenspressing enter doesn't seem to work
12:55technomancytgoossens: try lein trampoline repl
12:56tgoossenssorry making it clearer
12:56tgoossensit is when doing
12:56tgoossenslein run
12:56technomancylein trampoline run then
12:56tgoossensthe main function expects user input
12:56tgoossensah
12:56tgoossensok
12:56tgoossensi need to look wat what trampoline is then. never heard of it
12:57tgoossenscool that worked :p
12:59technomancythough it occurs to me this could be fixed in lein itself
13:03tgoossenshmm?
13:04technomancyfor a while we couldn't support it, but I think we can now
13:05tgoossensdo you work on the leiningen project
13:05tgoossens?
13:05technomancyyeah
13:05technomancyI just pushed a fix
13:05tgoossensnice :)
13:07tgoossenslein uberjar also gives problems: can't find main class
13:08tgoossensdo i have to add something to project.clj file?
13:08technomancyyeah, have you read `lein help tutorial`?
13:08oskarthTrying to write more readable tests for macros. How do I trim of clojure.core namespace qualifications in macroexpand? That is, turn clojure.core/defn into defn, or something to that effect
13:08tgoossensNope. thanks for the tip
13:13emezeskeoskarth: It seems like if the macro is supposed to produce clojure.core/defn, that's what you should check for in your test
13:13emezeskeoskarth: If it's just producing the raw symbol defn, it's not actually working correctly, right?
13:13oskarthemezeske: right, that is true - it just gives very unreadable tests when it is just standard clojure.core functions being used
13:14oskarthoh, it does other things too
13:15oskarthemezeske: here's the test https://www.refheap.com/paste/6059
13:15oskarth(changed macroexpand to macroexpand-1 tho)
13:18emezeskeWell, you could use syntax quote in the compared expression, but then you'd need to unquote-quote the symbols like not* in* and out*
13:19clgvoskarth: doesnt a test with macroexpand just repeat the macro implementation and is thus useless?
13:19emezeskeWhich would likely be uglier: `(~'not* (fn [~'in ~'out] ...
13:20oskarthyou are both right
13:21oskarthjust trying to add tests to a macro which isn't working the way I expect it to, but I think I'm approaching it the wrong way
13:22emezeskeoskarth: One problem with the macro is that it emits (fn ([...] ...)) instead of (fn [...] ...)
13:23emezeskeoskarth: Also, I disagree with clgv, that test is perfectly useful
13:23oskarthemezeske: so the use case is to have two arguments, representing a vector of inputs and a vector of supposed outputs
13:23oskarthso it's a non-standard in having two params vectors
13:23emezeskeAh, gotcha
13:24emezeskeI was being silly calling that a problem anyway
13:24oskarthand then there's some threading going on which binds outputs to other inputs
13:24oskarthemezeske: do you have any examples of good tests for macros?
13:24emezeskeclgv: The test doesn't just repeat the macro implementation; it ensures that the name (not*) and params ([in], [out]) are put in the right places, etc
13:24emezeskeoskarth: I'm afraid I don't
13:25nightfly_How can I do something like: `(fn [example#] (when ~(contrived example#))) expect that works?
13:25emezeskeoskarth: I don't see anything bad about your test
13:25emezeskeoskarth: (although I'm not an expert in testing macros)
13:26clgvnightfly_: (fn [example#] (when (~contrived example#))) but if `contrived` is a function you do not need the unquote
13:26clgv`(fn [example#] (when (~contrived example#)))
13:26oskarthI see, thanks for your help!
13:27oskarthand I guess the ns qualification is better than doing unquoting and stuff, too complex
13:27clgvoskarth: you can use clojure.walk/postwalk with `name` to replace namespaced symbols by their names only
13:28emezeskeoskarth: I don't think the qualified names look bad, but that's just IMHO.
13:28clgvor you could use ##`defn
13:28lazybot⇒ clojure.core/defn
13:28SgeoWait, what's the problem?
13:28oskarthhm, that seems doable, will play around with that, thanks
13:28oskarthit's supposed to map the other way around though
13:28Sgeo##`~'bla
13:28lazybot⇒ bla
13:28oskarthclojure.core/defn to defn
13:29oskarthor that I misunderstand you?
13:29Sgeo##`(~'defn foo [bar#] baz)
13:29lazybot⇒ (defn clojure.core/foo [bar__318544__auto__] clojure.core/baz)
13:29oskarthemezeske: in general I agree, but with clojure.core it feels odd somehow, not used to seeing it that way
13:29SgeoBut what's wrong with
13:29Sgeo##`(defn foo [bar#] baz)
13:29lazybot⇒ (clojure.core/defn clojure.core/foo [bar__318555__auto__] clojure.core/baz)
13:29Sgeoexactly?
13:30clgv,(= `(defn ~'bla []) (`defn 'bla []))
13:30clojurebotfalse
13:30nightfly_contrived is function I want to evaluate at in a macro at compile time that also takes another argument that isn't a generated symbol. I want to pass the generated symbol into the function untouched so the generated code can use it by name.
13:30clgvlol k
13:30clgvnightfly_: you have to manually create a gensym outside the syntax-quote and use that one
13:30Sgeoclgv, symbols are literally just a name string with an optional namespace string
13:31oskarthbbl
13:31clgvSgeo: I know
13:31SgeoIt's different from Common Lisp symbols
13:33Sgeo:(
13:33SgeoClojure doesn't like opaque objects being embedded in code
13:33SgeoThis makes me uneasy
13:33SgeoOr maybe ideone is just really really weird
13:34Sgeohttp://ideone.com/8i92E3
13:34amalloySgeo: you can't do it in any other language afaik
13:34SgeoNot exactly the sort of exception I'd expect to get
13:34Sgeoamalloy, Common Lisp I think
13:34clgv,(read-string "#=(java.lang.Object.)")
13:34clojurebot#<RuntimeException java.lang.RuntimeException: EvalReader not allowed when *read-eval* is false.>
13:35Sgeoclgv, oh hey that works http://ideone.com/Z9Drik
13:35SgeoSo why does this not work http://ideone.com/o2u3PT
13:36Sgeo(doc print-dup)
13:36clojurebot"; "
13:36Sgeo...
13:36Sgeo,(print-dup 5)
13:36clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$fn--2718$fn>
13:37SgeoOh hey I guessed the name of a class and got it right
13:37Sgeo(StringWriter)
13:38Sgeo,(with-open [w (java.io.StringWriter.)] (print-dup w 5) (.toString w))
13:38clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No method in multimethod 'print-dup' for dispatch value: class java.io.StringWriter>
13:39TimMcIt doesn't make sense to serialize a writer.
13:40nightfly_clgv: Thanks, trying that now
13:40TimMcMaybe someone can figure out how to do that in some crazy language, but I don't think Clojure can support it meaningfully.
13:40clgvSGeo: you want (defmacro env [] (let [symbols (keys &env)] (zipmap (map (fn [sym] `(quote ~sym)) symbols) symbols))) ?
13:40clgvSgeo: ^^
13:41Sgeoclgv, I wrote a simpler version of that macro a while back I think
13:41SgeoOr... depends if you prefer for and into over map and zipmap
13:41clgvSgeo: it looked like you wanted that in http://ideone.com/o2u3PT
13:41Sgeoclgv, I wanted to learn more about those weird values
13:42Sgeoclgv, seriously, I was giddy with glea after writing https://www.refheap.com/paste/5886
13:42TimMcYou might be better off reading the compiler.
13:45Sgeo,(with-open [w (java.io.StringWriter.)] (print-dup 5 w) (.toString w))
13:45clojurebot"5"
13:45Sgeo,(with-open [w (java.io.StringWriter.)] (print-dup (Object.) w) (.toString w))
13:45clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No method in multimethod 'print-dup' for dispatch value: class java.lang.Object>
13:46SgeoHmm, so how come #=(Object.) is acceptable?
13:47amalloySgeo: one is printing and the other is reading...?
13:47SgeoOh, I just realized a cheap trick to ... wait, no.
13:47SgeoHey, is there anything terribly gross about def'ing to a gensym... oh, that doesn't even help me
13:48SgeoBecause I can't def to a gensym from the macro itself without using eval
13:51SgeoHmm. Maybe all my problems are because I was attempting to print the &env and I got that confused with it disliking the &env being in code
13:51alex_baranosky: what's the modern way to handler trailing slashes in routes in composure these days?
13:52SgeoI blame Clojure's horrible stack traces.
13:52SgeoWait, it actually does say "Can't embed object in code"
13:52SgeoOh, hmm, that time I surrounded it by quote
13:53Sgeo,(quote (Object.))
13:53clojurebot(Object.)
13:54SgeoYeah, it's because of the quote
13:55SgeoI don't entirely get it, why it shouldn't work
13:58Sgeo(doc special-symbol?)
13:58technomancyemezeske: just a heads-up; pushed a change to leiningen that may interfere with cljsbuild's repl
13:58clojurebot"([s]); Returns true if s names a special form"
13:58Sgeo,(special-symbol? with-meta)
13:58clojurebotfalse
13:58Sgeo,(special-symbol? 'with-meta)
13:58clojurebotfalse
13:58SgeoHmm.
13:58SgeoIt's mentioned in LispReader.java
13:58technomancyeval-in-project will now hook up *in* to the subprocess's stdin unless you bind leiningen.core.eval/*pump-in* to false
13:59xeqialex_baranosky: rewrite :uri or return a redirect with middleware
14:00emezesketechnomancy: Okay, thanks for the heads-up
14:00emezesketechnomancy: I'll try to give it a test tonight
14:00technomancyemezeske: I think your plugin is probably the only one that uses *in*
14:00alex_baranoskyxeqi: such a common feature has to be rewritten by every web app writer ?? :\
14:00technomancybut if anyone knows of any others, let me know
14:00emezesketechnomancy: So if it is a problem, I can just bind *pump-in*?
14:01amalloyalex_baranosky: you can be the hero who saves us all from our drudgery. write it once in a library, and heavily advertise your solution so everyone uses it
14:01xeqialex_baranosky: could use the one in lib-noir if desired ; https://github.com/noir-clojure/lib-noir/blob/master/src/noir/util/middleware.clj#L28
14:01technomancyemezeske: yeah, if you don't bind it to false you'll have race conditions reading from *in*
14:01xeqi(inc amalloy)
14:01lazybot⇒ 33
14:01technomancyemezeske: for reference: https://github.com/technomancy/leiningen/commit/ecdc783f2da25b8c8fd1c0af051d7c1f6af7a09a
14:01emezesketechnomancy: Thanks
14:02alex_baranoskyamalloy: I'm hearing a Peter Cetera song now in my head. I think I can be that hero!
14:02alex_baranoskyamalloy: http://www.youtube.com/watch?v=69hglPNOiTI
14:03alex_baranoskyxeqi: thanks for the noir link.
14:03amalloyRaynes: is that function in lib-noir borrowed from 4clojure? i know i told you and chris to take whatever you wanted, but i didn't realize you had
14:04amalloy(obviously you could have written that yourself, but it's identical down to the character, so i'm curious)
14:08SgeoSo much for embedding atoms into code.
14:08SgeoNamespace polluting gunk with eval, here I come!
14:14SgeoI am an absolutely terrible person http://ideone.com/BTJxYN
14:15nDuff*shudder*.
14:17nDuffSgeo: I've pulled LocalBindings out of the thread-local space before, after doing a bunch of reflection to make them accessible.
14:17nDuffSgeo: ...it's also dirty, but at least it leaves the namespace as it found it.
14:17amalloySgeo: no, but that's a useless thing to do anyway. what are you going to do with a LocalBinding object?
14:18amalloythe only thing you can usefully do is get its value, which you could do without eval, and can't do the way you've written it
14:18SgeoIs there any way to undef?
14:20SgeonDuff, I'm curious what that looks like
14:22SgeoI was going to ask, doesn't eval accept an env, but apparently it doesn't
14:22nDuffSgeo: https://gist.github.com/2912188
14:23SgeoI don't think I can begin to comprehend that
14:24Urth|Schoolgirl next to me in English left the sleeve tag on her overcoat
14:24Urth|Schoolwoops
14:24Urth|Schoolwrong channel ><
14:24Bronsalol
14:24Urth|SchoolToo many irssi windows open, sigh
14:24nDuff...actually, I think the clojure-frame-vars function in there would have been a good answer to the person in here yesterday asking when you'd ever have a use case for for as opposed to fn+map. :)
14:24pandeirohow can i get nrepl.el 0.1.5 from marmalade? when i package-install it only seems to find 0.1.4
14:25technomancypandeiro: M-x package-refresh-contents?
14:25Iceland_jackUrth|School: Solution, turn off IRC client; go outside
14:25scriptorpresumably he's in class
14:25SgeoI think anytime you're drawing from more than one list is a good use case
14:25Sgeoerm, more than one seq
14:26Urth|SchoolThe English major affords plenty of opportunity to go outside, thankfully
14:27pandeirotechnomancy: doh thks
14:29wingyim reading about identity/states in JoY .. it says that an identity has a notion of time so you can go back and forth between different states .. how is this done in clj?
14:30seancorfieldeach state is immutable and has its own identity
14:30wingyi know values are immutable, but how does one have an identity with different values over time, allowing us to time travel (like in Datomic)
14:31nDuffwingy: You have to actually deref at an older time to have an instance of it.
14:31Sgeowingy, you can store the old values somewhere and look at them again later
14:31nDuffwingy: ...instances that aren't referenced anywhere get GC'd.
14:31seancorfieldwhat they said (more coherently than me)
14:31SgeoAlthough I imagine it can't be that difficult to make sort of atom-like thing with time travel capability
14:32nDuffs/have an instance of it/have a reference to that prior time's instance/
14:32wingySgeo nDuff seancorfield : okay i thought you could have one identity (reference type) to hold different values over time
14:32nDuff...you could almost start from an atom with a listener.
14:33nDuffwingy: Not to give you a single point of access for all those values, no, unless you build that yourself. But Clojure _does_ give you the tools to build that yourself, if you want to.
14:34wingygood that datomic did it for us then :)
14:35wingyreading the book one think you can time travel (the flip book example with a runner)
14:35Sgeowingy, you want time travel, try Scheme
14:36wingythey have time travel? :)
14:36seancorfieldwingy: in datomic it uses an identity for a series of values, i believe, so you use identity + time to retrieve an entity at a given point in time
14:36wingyseancorfield: yeah
14:36Sgeowingy, call/cc is nuts
14:36SgeoAlthough apparently not as good as shift/reset, but whatever
14:37Sgeohttp://en.wikipedia.org/wiki/Call-with-current-continuation
14:47CheironHi, assoc-in is going to create array-map, correct? is it possible to create sorted-map?
14:50hcumberdaleIs there a better way to write: (filter #(and (= "example" (:category %)) (= true (:active %))) (read-posts))
14:50scriptorCheiron: it's not possible to assoc onto a sorted-map in the first place, right?
14:50nDuff...ahh, need to go through nrepl.cmdline/-main
14:50scriptorCheiron: sorry, disregad that
14:51Cheironscriptor: not sure actually. assoc is going to add entry according to map implementation , i guess?
14:51scriptorright
14:51nDuffhrm; getting "java.lang.ClassNotFoundException: complete.core" on attempts to use tab completion in nrepl.el...
14:52nDuff...separate dependency? Ahh.
14:52SgeoWhy are you comparing with true rather than just using truthiness? (There are reasons that that might make sense, but good to think about)
14:53scriptorCheiron: you'll still get a sorted map back, specifically a PersistentTreeMap, if you assoc-in onto a sorted map, it seems
14:54scriptor,(class (assoc-in (sorted-map 1 :foo 2 (sorted-map 10 20)) [1] 4))
14:54clojurebotclojure.lang.PersistentTreeMap
14:54scriptor,(class (assoc-in (sorted-map 1 :foo 2 (sorted-map 10 20)) [2 10] 4))
14:54clojurebotclojure.lang.PersistentTreeMap
14:54scriptorCheiron: ^
14:55Cheironscriptor: thanks!
14:56hcumberdalemhh!
14:58pelismoso i've written a clojure based API (mostly handing out json), but i'm unsure at how to implement gracefull errors (other than just exploding 406 and 500 at the client's face)
14:59pelismowould love a pointer to any examples/idea of projects on github I could learn from
14:59nightfly_Have pretty 406's and 500's?
15:00pelismowell somewhat. my code either throws exception (when clients submit invalid params, such as malformed uris), or just fails because it has no results in DB (applicative errors)
15:00nDuffpelismo: If what you want is better exception handling tools, have you looked at Slingshot?
15:02wingywhich one is better if i wanna make a concat a string: using protocol and extend the String class with it (cat "foo" "bar") .. or just defining a fn taking strings as args (cat-str "foo" "bar")
15:02SgeoI still wish I knew what was so terrible about embedding opaque objects into code
15:03wingyi am curious if protocol/class is worth the trouble with thinking about classes and interfaces which reminds me about oop
15:03pelismonDuff: so wrapping my head over functional programming, and the fact that i'm returning data structures doesn't help mee
15:03wingyor should we stay simple and just have a simple fn taking expected args
15:03nightfly_(str "this" "that") not good enough?
15:04Sgeowingy, the typical thing is to just make a fn, I think
15:04nDuffwingy: Look at where/how/why Clojure itself uses protocols.
15:04wingynightfly_: yeah im talking about an imaginary fn we need to make ourselves
15:04SgeoUnless you want the function to work with different types in different ways that you might not anticipate
15:04nDuffwingy: If you don't need one, don't use one -- but if you're writing something for which extension points make sense, they're often perfect.
15:05SgeonDuff, except they work based on classes which are leakage from Javaness :(
15:05wingyi guess it boils down to: writing an abstraction (for implemetations) or implementation directly
15:05nDuffSgeo: ...which makes them fast. If you care about performance, letting underlying implementation leak through makes sense sometimes.
15:06SgeonDuff, which might be a good reason to hate the fact that Clojure is on the JVM
15:06nDuffSgeo: At least for me, I work in an environment where performance _does_ matter, quite a lot; I'm barely able to justify Clojure as it is, on those grounds -- if it didn't take advantage of things the JVM is good at, it'd be flat out.
15:06nDuffSgeo: Heh. I wouldn't be able to use it at all if it weren't.
15:06SgeoAh
15:07wingynDuff: what are you working with if I may ask?
15:08nDuffwingy: The employer is a search engine. The individual project involves event stream processing -- at present, using Esper as backend.
15:09wingyokay
15:14wingynDuff: I searched for "defprotocol" in the clojure git repo without matches .. how does it use protocols?
15:15nDuffwingy: well, the biggest one is ISeq :)
15:16nDuffwingy: ...yes, they're implemented as Java interfaces there, but they're the whole reason the standard library functions work across more than one datatype each.
15:23wingyJoY says numbers, strings and keywords evals to themselves .. it didn't mention character, boolean and collections. don't they evaluate to themselves as well?
15:24SgeoLists don
15:24SgeoLists don't evaluate to themselves
15:25wingy,'(1)
15:25clojurebot(1)
15:25wingywhy doesn't it?
15:25Bronsa,(1)
15:25clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
15:25Sgeowingy, quote prevents the usual evaluation rules
15:25Bronsait does not
15:25wingyok
15:25Sgeo(1) is a list containing 1
15:26Sgeo'(1) is (quote (1)) which is a list containing the symbol quote and the list (1)
15:26wingyyeah, quote means dont eval
15:26ttimvisherany way to pass a `-D` property through to leiningen?
15:28andrewmcveighttimvisher: you can use a :jvm-opts ["-Dany.prop=true"] in project.clj
15:28ttimvisherandrewmcveigh: thanks!
15:28ttimvisheranyone had to deal with jvm dns cacheing before? might have some insight into how to flush it or set it to never on jvm start up?
15:29ttimvisherpreferably looking to flush it in a running jvm
15:30hiredmanttimvisher: never heard of such a thing, are you sure it isn't your os?
15:30ttimvisherhiredman: absolutely
15:30TimMcBronsa: You're lagging: https://www.refheap.com/paste/6067 :-P
15:31Bronsalol
15:31ttimvisherhiredman: http://javaeesupportpatterns.blogspot.com/2011/03/java-dns-cache-reference-guide.html if you're interested
15:31Bronsano wait.
15:31hiredmanttimvisher: http://docs.oracle.com/javase/6/docs/technotes/guides/net/properties.html#nct
15:31ttimvishernot that it's helpming me much :)
15:31hiredmaninteresting
15:32TimMcThat's a strange default.
15:32ttimvisherhiredman: it's looking like the only way to successfully set that property is to actually edit the `java.security` file in the jvm
15:33ttimvisherand then restart the server
15:33hiredmanttimvisher: it is a -D property
15:36ttimvisherhiredman: setting it via -D takes no effect
15:36hiredmanttimvisher: *shrug* seems unlikely, are you really setting it?
15:40llasramttimvisher: How are you checking for effect? By asking sun.net.InetAddressCachePolicy/get ?
15:40ttimvisheryep
15:40ttimvisherllasram: yes
15:40ttimvisherand by getting google.com
15:40ttimvishervia InetAddress
15:40ttimvisherhiredman: yes. System/getProperty returns the right value when we set it
15:40tomojI want emacs commands for folding/unfolding arrows
15:41ttimvisherbut sun.net.InetAddressCachePolicy/get returns 30
15:41ttimvisherunless you set it in java.security, and then it returns the right thing
15:41ttimvisheras does the system property
15:41gf3Hey #clojure, I'm off in #scala land and… I miss you guys
15:41llasramttimvisher: Looks like InetAddressCachePolicy sets things in a static initializer
15:41llasramhttp://hg.openjdk.java.net/jdk7/jdk7/jdk/file/9b8c96f96a0f/src/share/classes/sun/net/InetAddressCachePolicy.java
15:41hiredmanbut how did you set in the other way?
15:41wingysymbols are referring to vars and not values?
15:41ttimvisherllasram: yep
15:42llasramSo if something (bootstrap classes?) causes that class to be loaded prior to the value getting set, then the property has no effect
15:42hiredmanyeah, a lot of -D stuff is static, so you cannot set in via setProperty
15:42ttimvisherNow you can call sun.net.InetAddressCachePolicy/setIfNotSet but you can only increase the strictness
15:42ttimvisherif you try to decrease it you get a Security exception
15:42hiredmanyou could just reflectively fiddle the field
15:43hiredmanhave you checked propertySet ?
15:44llasramMan, this is why I always seem to end up writing my own IP address type
15:44ttimvisherhiredman: reflection is a possibility we haven't tried yet. not going to burn any more time on this now but thanks for the ideas!
15:47hiredmanreflection is a must
15:48wingydo you call 1 a form?
15:51wingynow i get why collections don't eval to themselves .. they can contain a list
15:52emezeskewingy: Some collections do evaluate to themselves. ##[1 2 3 4] does, for instance
15:52lazybot⇒ [1 2 3 4]
15:53wingyyeah
15:53amalloywingy: containing a list isn't really the point. a vector [x y z] evaluates to [(x evaled) (y evaled) (z evaled)]
15:54emezeskeamalloy: That is a good point, I guess I kind of lied
15:54amalloyemezeske: nah, you said something true but misleading
15:55wingyso it depends what they contain .. if they contain self-evaling data structures, they are self evaling
15:57SgeoSuppose my code has a map like {(quote a) a, (quote b) b}
15:57Raynesemezeske: I updated lein-cljsbuild last night and ohmahgawd, I compiled my two-file node.js cljs test program and it worked. New cljs release ftw.
15:58SgeoThe first key is a list which will be evaled to a symbol, the value for that key is a symbol which gets evaled to whatever a is in that context, and similarly for the other entry
15:58emezeskeRaynes: Haha, awesome! Did that project work with the naked clojurescript compiler before?
15:58dnolenRaynes: that's good to hear tho it still doesn't seem to to work for some people.
15:58Raynesdnolen: Really? Who says it doesn't work?
15:59Raynesemezeske: I don't know. Never tried it. I don't really know how to use the naked clojurescript compiler.
15:59dnolenRaynes: http://dev.clojure.org/jira/browse/CLJS-395
15:59dnolenRaynes: it's not fun, using the compiler by itself :)
15:59emezeskeRaynes: I don't blame you :)
16:00emezeskeRaynes: I just wondered if whatever started working was lein-cljsbuild or the compiler itself -- probably the compiler.
16:00Raynesdnolen: Well, to be fair, at least it's broken properly this time and not insanely.
16:00Raynesemezeske: It was the compiler for sure, because I reproduced without lein-cljsbuild before.
16:01emezeskeRaynes: Okay, cool
16:02Raynesdnolen: That's pretty weird. :(
16:03dnolenRaynes: what the ticket?
16:03Raynesdnolen: My code probably works because I require cljs.nodejs.
16:03dnolenRaynes: I'm assuming from the ticket that the idea is to make it implicit
16:04RaynesYeah, doesn't break for me at all, even without the require.
16:04dnolenRaynes: interesting ...
16:05RaynesAh, yes it does. There was another in another file.
16:05Raynesdnolen: I can reproduce that guy's error
16:05Raynestomoj is right, the workaround is to require cljs.nodejs manually somewhere in code.
16:05dnolenRaynes: so does making it implicit seem like a good approach?
16:06tomojmakes sense to me
16:06tomojnot much you're pulling in, and who cares on node.js anyway
16:06dnolenRaynes: implicit does seem preferred to me
16:06dnolentomoj: yeah
16:07tomojhopefully cljs.nodejscli is unlikely to change (or at least to change deps)
16:07Raynesdnolen: Makes sense, I think.
16:08tomojmaybe the bigger problem is that the dependency order sort is unstable?
16:09dnolentomoj: the whole dependency order needs to work a la carte. source mapping needs it to provide accurate line number.
16:10tomojnot sure what you mean. that special injections like this disturb source mapping?
16:11dnolentomoj: without knowing the final total order I'm not sure how we can know what lines map to what lines.
16:11dnolentomoj: files are compiled individually by CLJS compiler, then ordered, then put through Closure compilation
16:12dnolenor ... that's what seems to happen far as I can tell.
16:12tomoja stable sort won't hurt
16:13dnolentomoj: oh yeah, I'm agreeing w/ that too.
16:13tomojso what about the way things are is unsuitable for source mapping?
16:15dnolentomoj: you need to know what line number to start at for each CLJS file - user might include GClosure libs, externals libs, etc. There are no hook currently to extract this information to produce accurate mappings.
16:15dnolenand I mean the generated line number of course, we know the original line / col easily.
16:19tomojis that the major missing piece on source maps?
16:19tomojthat seems doable after a cursory look at cljs.closure
16:23dnolentomoj: it's *a* major missing piece. the other piece - 1) merging in-memory CLJS compiler source map w/ GClosure source map and writing that out
16:24dnolentomoj: I stalled a bit because I need the other piece before the merge can be done
16:25dnolentomoj: the source-map branch already generates decent info for ever var occurrence (which means locals as well). soon as Clojure 1.5.0 goes out would like to move CLJS to use it and incorporate reader column information.
16:25tomojget the feeling that will be soon
16:25dnolenyeah
16:25tomojI think source maps could really help push coworkers over the line
16:26dnolentomoj: it would help everyone :)
16:27dnolennot being able to sensibly debug / benchmark advanced compiled code in browsers is flying blind.
16:27RaynesIt would fix global warming.
16:27CheironHi, I would like to know how much memory a datastructure occupy during the runtime . is is possible?
16:28nDuffCheiron: I've been able to figure that out using YourKit, though it's very much not free software (though there are zero-cost licenses available for OSS development).
16:29Cheironpossible with VisualVM ? I would like to have something that dump the size of a data structure during the runtime to the log
16:39sritchiealex_baranosky: hey dude
16:39sritchieyou around?
16:39alex_baranoskyAoE… talk after :)
16:42sritchiealex_baranosky: cool
16:45alex_baranoskysritchie: what's up?
16:45sritchiewas just taking a look at clj-schema, good stuff
16:45sritchieI'm writing a thrift parser in clojure --
16:45wingyIt says that (fn) is a special form .. looking at the source I see it's using (defmacro) .. so special forms can be macros?
16:45sritchiewas going to ask if you thought it made sense to build the clojure AST for thrift as a clj-schema
16:46sritchiealex_baranosky: that'd be useful because we could go directly from a clj-schema (with some limitations) to thrift, without the whole idl parsing stage
16:46sritchieor clj-schema -> protobuf
16:47alex_baranoskysritchie: neat. Let's talk about that
16:47sritchiesounds good
16:47alex_baranoskynot this second though, busy
16:47sritchieAoE, get 'er done
16:48Raynesalex_baranosky: You asked about stripping trailing slashes in Compojure last night.
16:48Raynesalex_baranosky: There is a piece of middleware in lib-noir for that.
16:48alex_baranoskyrayes: yep. I stole it from there :), thanks for looking out for me though
16:49RaynesEw.
16:49RaynesI wish people wouldn't 'steal' small pieces of middleware. Just depend on the darn library.
16:49RaynesYou'd think Clojure was javascript or something!
16:50dnolenif anyone has some free cycle could someone confirm that println doesn't work w/ browser-repl anymore?
16:51dnolencemerick: speaking of which, making sure we don't break browser-repl is a good candidate for browser automation ;)
16:51S11001001Raynes: "no dependencies" is a virtue for some reason
16:53cemerickdnolen: Quite. I've been building automated tests that run browser-side and are driven through a browser-repl. The bits under that could probably be factored out into something that could be used to verify browser-repl generally.
16:53dnolencemerick: that would be awesome to get that into CLJS
16:54cemericker, well, nREPL over piggieback and browser-repl, so perhaps that's not suitable
16:54cemericks/over/with
16:55dnolencemerick: honestly the most minimal thing would be sweet - I don't know selenium well enough to know to tackle this myself quickly. but our command line tests aren't enough, it's easy to break browser-repl and we don't test it at all.
16:55cemerickoh, I'm not using selenium
16:55dnolencemerick: what do you use? phantomjs?
16:56cemerickgoodness no; clojure.test assertions on values returned by evaluating expressions browser-side with nREPL
16:56cemerickAll the JS-oriented testing libs/frameworks looked absolutely horrific.
16:57emezeskecemerick: All phantomjs is is a headless webkit browser
16:57brehaut“All the JS-oriented libs/frameworks looked absolutely horrific.” FTFY
16:57tomoj:D
16:58dnolencemerick: so you wrote some scripts to launch the browser and all that?
16:58emezeskecemerick: E.g. phantomjs is nice for running browser-side tests without launching a big GUI, etc
16:59cemerickdnolen: well, the JVM can open a url in a browser.
17:00cemerickemezeske: Sure; I don't remember all the project names. At the moment, I don't mind closing the test browser tab that gets popped up when my tests finish.
17:01emezeskecemerick: Yeah, I wouldn't say phantomjs offers a huge advantage, developing on your workstation. It can be handy for running on CI servers and stuff, though.
17:01cemerickSure. Someday soon.
17:03cemerickIt's actually been quite handy to have the option to twiddle away at the js state halfway through a test suite sometimes.
17:03emezeskeFor sure -- when a test fails, you almost certainly want access to the JS console
17:03cemerickbrehaut: good catch, goof on my part
17:04cemerickbugger the JS console, I want my REPL. :-)
17:04emezeskeWell, phantomjs will run your REPL just fine!
17:04emezeske:)
17:05cemerickI like to see those DOM nodes a-twinkling
17:06emezeskeThe other features of modern browser dev tools are pretty un-live-withoutable too
17:06tomojis there an easy way to get from "2.5" to 5/2 ?
17:06cemerick,(rationalize 2.5)
17:06clojurebot5/2
17:06tomojeh, nvm, datomic doesn't have ratios (surprising)
17:06tomojwow
17:07tomoj&(map (comp class rationalize) [5 5.0 5.5])
17:07lazybot⇒ (java.lang.Long clojure.lang.BigInt clojure.lang.Ratio)
17:09tomoj&(rationalize (/ 1.0 3))
17:09lazybot⇒ 3333333333333333/10000000000000000
17:10tomojexpected, but I guess (rationalize (Double. s)) should never do that?
17:28BaldandersSo I'm trying to use Leiningen 2 with noir. Leiningen can't seem to find a couple of jars- the org.mortbay.jetty jars. I'm not that familiar with Maven or Leiningen, but I'm wondering if there is something else I should be doing.
17:35jsabeaudryBaldanders, can you pastebin your project.clj?
17:35jsabeaudryBaldanders, many people are using noir with lein2 so we know it can work
17:40Cheironclojurebot: if you can make a God bleed, people will cease to believe in him
17:40Cheironclojurebot: hello? in vacation?
17:41emezeskeHmm, Jesus bled, and people still believe the heck out of him
17:42Baldandershttp://pastebin.com/XaKK0MBR
17:42Raynesemezeske: AFAIK he wasn't considered a God.
17:43BaldandersIt's just what was create by running "lein new noir pman"
17:43emezeskeRaynes: Depends on the flavor of Christianity.
17:44BaldandersAlso, it often takes hours for lein to get things from the maven repos. I started getting noir last night, and wound up leaving it running overnight in the office... same thing happened this morning when trying to do lein run.
17:44BaldandersCan I just find the two jars it is looking for and put them in the cache directory?
17:44emezeskeBaldanders: Looks like noir 1.3.0-beta10 is the latest
17:45BaldandersYes- seems like 1.2.1 won't run with leiningen 2, or at least with older Clojures, because of a change in the way dynamic variables are handled.
17:45BaldandersAh, I see...
17:46BaldandersOK, this is what leiningen created when doing lein new noir- should I edit it to use 1.3.0-beta10?
17:47BaldandersI tried that and it is currently trying to get a later version of jetty from the maven repos. Will probably take a while.
17:47emezeskeBaldanders: I don't know if it will help, but given that it's a beta, you probably want the latest one (bugfixes, etc)
17:47emezeskeBaldanders: Not a magic bullet, but a place to start.
17:49BaldandersOK, thanks. Since it seems to take hours to get jars from maven even when they are found, is there something else I can do? Like figure out the dependencies on my own and go looking for the jars myself, and put them in Leiningen's cache directory?
17:49hiredmanhttp://www.infomercialcentral.com/store/files/images/d_77.jpg
17:49hiredmanclojurebot: magic bullet is http://www.infomercialcentral.com/store/files/images/d_77.jpg
17:49emezeskeBaldanders: For reference, "lein deps" on my machine, with a ton of deps, usually takes at most under a minute
17:49hiredmanclojurebot: ping
17:50emezeskehiredman: :P
17:50emezeskeBaldanders: Are you on a satellite link or something?
17:50BaldandersAha. Well it has been taking hours every time leiningen has needed to get jars from the maven repos on my machine.
17:50BaldandersNo, the connection is fast. But the amount of time I am seeing would be very, very slow even over a 14.4k modem.
17:51emezeskeBaldanders: Unfortunately I don't know much about maven, etc. But I can say that what you're experiencing is not normal.
17:53BaldandersThee is this issue on Leiningen: https://github.com/technomancy/leiningen/issues/534
17:53BaldandersBut it seems as if at the time it was resolved by adding mirror support.
17:54emezeskeHuh..
17:56wingyi can tell now that JoY should _not_ be the first book of clojure :)
17:57wingyit's a great source when you know the basics from other books
17:57emezeskewingy: JoC*
17:57wingyyeah
17:57emezeskeFor the record, I thought it was an excellent first book of clojure
17:57wingylol
17:57emezeskeTo each his own, though
17:58wingyemezeske: did you have lisp knowledge before that book?
17:58emezeskewingy: Not a bit.
17:58thorbjornDXI want to pmap a function that includes a 'spit to file', I'm going to hit an I/O cap pretty quickly, right?
17:59emezeskewingy: I had a tiny bit of haskell knowledge (basically just working through Learn you a Haskell for Great Good)
18:00emezeskethorbjornDX: map/pmap are not really meant for I/O operations
18:00wingyemezeske: i think i read this one as the first book .. someone here told me to drop it and read programming clojure programming instead
18:01thorbjornDXemezeske: understood. Am I better off doing the writes sequentially, or are they both going to be slow? The file output is the final thing I do in the code, so doing it in a pmap doesn't really affect me
18:02emezeskewingy: More reading can only help! :)
18:03emezeskethorbjornDX: Writing to disk is a fairly serial thing, particularly with rotating media you probably will hurt performance by doing a bunch of scattered writes in parallel
18:03emezeskethorbjornDX: I guess things may be different with flash, though
18:05thorbjornDXemezeske: gotcha, I'm pretty sure there's a few spinning platters somewhere down the layers
18:07wingyemezeske: agreed
18:07emezeskethorbjornDX: YMMV, of course -- I can only give general hints. The proof is in the profiling :)
18:10jamiiIs this expected behaviour?
18:10jamiistrucjure.test> (defrecord Foo [])
18:10jamiistrucjure.test.Foo
18:10jamiistrucjure.test> (class #strucjure.test.Foo{})
18:10jamiiclojure.lang.PersistentArrayMap
18:11Bronsalooks like a bug to me
18:11Bronsauser=> (defrecord a [])
18:11Bronsauser.a
18:11Bronsauser=> (a.)
18:11Bronsa#user.a{}
18:11Bronsauser=> #user.a{}
18:11Bronsa{}
18:17devthif i have a macro in one namesapce: (defmacro ensure-config [body] `(when (every? identity *config*) ~@body)) ;;; how do i ensure that *config* is eval'd in the namespace that the macro is used (not defined)?
18:28emezeskedevth: What you want to do is called "unhygienic", and is generally frowned upon. However, you can probably make it happen with ~'*config*
18:28devthah, i was trying #'*config
18:29devthyeah, familiar with hygienic macros, just experimenting
18:29emezeskeCool, I just felt like it needed a disclaimer :)
18:29devthi *always* forget the correct quote/unquote/splice usage
18:29devthcool. thanks.
18:29emezeskeExperiment away!
18:35unnalidevth: you can see why it happens like that here: http://clojure.org/reader (search for "Syntax-quote" in the body)
18:38devthunnali: makes sense. thanks.
18:41Sgeo"A shorthand version allows the metadata to be a simple symbol or keyword, in which case it is treated as a single entry map with a key of :tag and a value of the symbol provided, e.g.:"
18:41SgeoI don't think that's accurate
18:41Sgeo,(meta ^:foo :bar)
18:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
18:41Sgeo,(meta ^:foo 'bar)
18:41clojurebotnil
18:41Sgeohrm
18:42unnali,(meta ^:xyz {})
18:42clojurebot{:xyz true}
18:43Sgeo,(meta ^:abc ^:xyz {})
18:43clojurebot{:abc true, :xyz true}
18:43unnali,(meta ^String {})
18:43clojurebot{:tag java.lang.String}
18:44Apage43lei
18:44Apage43ack
18:44Apage43wrong window =P
18:46tgoossensclojure.core/destructure what is it fore exactly?
18:47dnolentgoossens: not meant to be used directly really.
18:47RaynesIt is used internally for destructuring.
18:47tgoossensok
18:47tgoossensi was just wondering how internally let and loop did their bindings
18:48dnolentgoossens: yes, they do use clojure.core/destructuring
18:48tgoossenswhat is a good way to do the following
18:48tgoossensi have a string
18:49unnaliSgeo: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L724
18:50tgoossensand i want to define a collection with "replacements" for characters. For example: a must be mapped on b, c must be mapped on d.
18:50tgoossenseventually this will happen with clojure.string/replace
18:50Sgeo,(meta ^'blah {})
18:50clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Metadata must be Symbol,Keyword,String or Map>
18:50Sgeo,(meta ^blah {})
18:50clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: blah in this context, compiling:(NO_SOURCE_PATH:0)>
18:50tgoossensnow the one way mapping is not really the problem
18:50SgeoOh
18:50Sgeo,(meta ^"blah" {})
18:50clojurebot{:tag "blah"}
18:50tgoossensi want it to happen in both ways
18:50unnali,(let [x 'x] (meta ^x {}))
18:50clojurebot{:tag x}
18:51tgoossensso that i can do the reverse replacements
18:51unnalireader has trouble with ^'x
18:51unnalii guess because you're really saying ^(quote x), and it doesn't like that.
18:51Sgeo,(meta ^{:honk "honk"} ^{:honk "HONK"} {})
18:51clojurebot{:honk "honk"}
18:51unnaliassociativity!
18:53tgoossensi don't understand what you did
18:55emezesketgoossens: ##(apply str (map {\a \b \b \c} "aaabbb"))
18:55lazybot⇒ "bbbccc"
18:55emezeske##(require 'clojure.set)
18:55lazybot⇒ nil
18:55emezesketgoossens: ##(apply str (map (clojure.set/map-invert {\a \b \b \c}) "bbbccc"))
18:55lazybot⇒ "aaabbb"
18:55tgoossenswow
18:56emezesketgoossens: Is that sort of what you're talking about?
18:56tgoossensi'm digesting what you typed one sec :D
18:57tgoossensi don't understand what happens here (why does it what it does?)
18:57tgoossens,(map {\a \b \b \c} "aaabbb")
18:57clojurebot(\b \b \b \c \c ...)
18:58emezesketgoossens: A map is a function of it's keys
18:58emezesketgoossens: ##({:foo "bar"} :foo)
18:58lazybot⇒ "bar"
18:59tgoossensyes correct
18:59tgoossensoooh
18:59tgoossensi get it :D
18:59emezeske:)
18:59tgoossenscool
18:59emezeskeOf course you don't have to use a map, that was just my example
18:59tgoossensbut i'm not quite sure that will do what i want
18:59tgoossensthe problem is
19:00tgoossensi'm using (read-string
19:00tgoossensto read data like
19:00tgoossens"(grep (ls -la))" (more info here: http://tgoossens.wordpress.com/2012/10/20/funix-enhancing-the-linux-terminal-by-thinking-functional/)
19:01tgoossens(note that the code on my blogpost is already outdated, will update it tomorrow)
19:01tgoossensthe problem is
19:01tgoossenssometimes i get a string like this:
19:01tgoossens(ls ~)
19:01tgoossens(ls Documents/)
19:01tgoossensand clojure doesn't accept those symbols
19:01tgoossensso i "encode" them
19:02tgoossens\" -> $quot
19:02tgoossens~ -> $tilde
19:02clojurebotTitim gan ?ir? ort.
19:02tgoossenswhich are valid symbols for the reader
19:02unnaliclojurebot: wow.
19:02clojurebotCool story bro.
19:02tgoossensand at the end
19:02tgoossensi decode
19:03wingyare (next) and (rest) the same except that the former returns nil and the latter '() when there are no more elements?
19:03tgoossensbut currently the decode and encode functions must be specified apart
19:03tgoossensi want them to use a single collection/mapping which can be used in both ways
19:04emezeskeI see
19:04unnaliwingy: there's a difference in forcing the tail seq, I think.
19:05emezesketgoossens: FWIW: ##(apply str (map #({\" "$quot" \~ "$tilde"} % %) "hello\"world~"))
19:05lazybot⇒ "hello$quotworld$tilde"
19:05emezesketgoossens: But that won't work in reverse, because $quot and $tilde are not single characters
19:05unnaliwingy: (let [x (next (cons 1 (lazy-seq (do (print "hi") '(5)))))] 'ok)
19:05unnali => hiok
19:05emezesketgoossens: You'd have to do something more fancy to reverse it.
19:05unnali(let [x (rest (cons 1 (lazy-seq (do (print "hi") '(5)))))] 'ok) => ok
19:05tgoossens:p
19:06unnaliwingy: to be more precise, (rest (cons 1 (lazy-seq …))) returns a clojure.lang.LazySeq; (next …) forces the seq into a PersistentList (or whatever)
19:06tgoossensI have to go now (unfortunately). if you suddenly have a great idea on how to do it. Please post it as a comment so I can still read it :)
19:07emezesketgoossens: Sure
19:07emezesketgoossens: Good luck with it.
19:07wingyunnali: a bit too hard for me to get atm .. ill think about it
19:07tgoossensthanks! It's not that important project, but nevertheless a good exercise for myself. I really am starting to like clojure
19:07unnaliwingy: the question is if you want to force the potentially lazy seq or not.
19:19nonrecursivehi all - I'm using cemerick's friend and trying to hash a password but it returns a different result every time
19:19nonrecursiveif I do (cemerick.friend.credentials/hash-bcrypt "password") then I get a different string every time the function is called
19:19nonrecursiveit seems like that just started happening… is that expected?
19:19unnalinonrecursive: I'd imagine so.
19:20unnaliit'd be using a random salt each time.
19:20unnalinonrecursive: https://github.com/cemerick/friend/blob/master/src/cemerick/friend/credentials.clj
19:21unnaliit generates a salt, so it changes each time.
19:21unnalicreds/bcrypt-credential-fn does a check, apparently used with cemerick.friend/authenticate.
19:21unnaliso I guess there's some builtin mechanism to do authentication
19:22Iceland_jack> Besides incorporating a salt to protect against rainbow table attacks, bcrypt is an adaptive function: over time, the iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks even with increasing computation power.
19:22nonrecursiveunnali: thanks. it looks like for some reason the authentication is failing
19:22unnalinonrecursive: I suspect something else is afoul, then.
19:22Iceland_jacknonrecursive: you should read up a bit on bcrypt before using it, that was from the Wikipedia page
19:23nonrecursiveIceland_jack: cool. I really don't know anything about these hashing algorithms
19:23nonrecursiveIceland_jack: very good suggestion :)
19:23nonrecursiveunnali: thanks for the help
19:23SgeoDoes helping out in #clojure count as résumé-able?
19:23Iceland_jackCryptography is notoriously tricky to get right
19:24unnaliSgeo: I'd say sure.
19:24Sgeo##1 ##2 ##3 just want to see if bot does these in order
19:25brehaut##(identity 1) ##(identity 2) ##(identity 3)
19:25lazybot(identity 1) ⇒ 1
19:25lazybot(identity 3) ⇒ 3
19:25xeqinonrecursive: are you using bcrypt-credential-fn as part of :credential-fn ?
19:25unnali"sometimes, if at all"
19:25brehauti think the paren is part of the syntax
19:25nonrecursivexeqi: I am
19:26SgeoWhat happened to 2?
19:26brehautRaynes: your bot is weird
19:26brehautif i were to guess, i would blame regexps
19:27xeqiis your user finding part in it returning a map with {:username .. :password .. } ?
19:27SgeoStill better to actually use identity of course, clearer etc.
19:27brehautin this case do wins
19:28brehautbut do is a macro / special form
19:28brehautyou cant pass it to something
19:28nonrecursivexeqi: yep it is
19:28amalloybrehaut: good guess
19:28Sgeobrehaut, but #(do %) is lambda syntax, so that form is a function, which you can pass to things
19:28Sgeo,(map #(do %) [1 2 3])
19:28clojurebot(1 2 3)
19:28nonrecursiveI wonder if the salt is changed every time the server is restarted?
19:29brehautah sorry , i misread
19:29seancorfieldhaving a weird problem with lein-expectations - it seems to be running all the expectations twice (in concurrent threads) - not sure what recent library change has caused this... :(
19:29SgeoErm, inaccurate to say that the form is a function, I guess, but it evaluates to a function
19:30unnalinonrecursive: it's a new salt on every execution!
19:30nonrecursiveunnali: ah right, right
19:31nonrecursiveunnali: heh yeah I realized that as soon as I wrote that :P
19:31unnali:D
19:31nonrecursivethe password checking works in a repl so something else must be the problem
19:32yehohanan7Hello, I am a new to clojure, I am trying to learn clojure by writing a clojure wrapper for mongodb java driver. here is the code -https://github.com/yehohanan7/tikvah/blob/master/src/com/tikvah/info/mongo/core.clj can anyone have a quick look at it and let me know if its idiomatic?
19:32xeqinonrecursive: are you including session middleware?
19:32nonrecursivexeqi: I am - this was working earlier in fact
19:33nonrecursiveoh man
19:33nonrecursiveI think I will need to slap my head
19:33nonrecursived'oh
19:34nonrecursiveI changed the :login-uri so authentication wasn't even being attempted
19:34nonrecursivethanks xeqi unnali and Iceland_jack!
19:36yehohanan7 Basically my query would look like : (-> (store "dbname") (collection :products) (scan :having [[:_id :eq "12345"]]))
19:36nonrecursivesorry for your trouble!
19:42dnolenohpauleez: http://dev.clojure.org/jira/browse/CLJS-359, I think you're simple patch is OK
19:43ohpauleezdnolen: ok, excellent - glad to see that fix getting through
19:43dnolenohpauleez: metadata on top level defs are always stored in cljs.analyzer/namespaces - your patch would address runtime metadat
19:43dnolenohpauleez: we can't optimize that case really since we won't have that information at runtime.
19:45ohpauleezdnolen: I can make a formal patch out of it for you
19:45dnolenohpauleez: excellent
19:49ohpauleezdnolen: I also have some core.logic cljs patches for you in the pipeline
19:49dnolenohpauleez: SWEET
19:50ohpauleezcore.logic on node.js for scripting apps has been both amazing and a struggle :)
19:51gfrederickshow much code-sharing is there between core.logic on jvm vs js?
19:56dnolenthis should knock down CLJS compile sizes a bit http://github.com/clojure/clojurescript/commit/97e5fbd1e1597d58be35fd8320c8044ccc9d3a3d :) thanks to bendlas``
19:57dnolengfredericks: none
19:57dnolengfredericks: would love to fix that - esp now that core.logic is significantly larger than it was
19:57dnolengfredericks: feature expression can't come soon enough in my opinion
19:58dnolenohpauleez: whoa :) COOL
19:58emezeskebendlas``, dnolen: grazie!
20:07SegFaultAXWhat are some good Clojure message queues?
20:10technomancySegFaultAX: rabbitmq, hornetmq, redis
20:10technomancyredis if you want simplest, hornet if you want the option to run it inside the jvm, rabbit if you want all kinds of crazy knobs
20:10SegFaultAXtechnomancy: I'm thinking of a specific one. It was actually a job queue. The jobs were just clojure forms.
20:11metellusagents?
20:11SegFaultAXBasically Resque for clojure.
20:11technomancydie roboter is built on top of rabbit
20:11dnolenohpauleez: so what's pushing you to leverage Node.js in this case?
20:11SegFaultAXtechnomancy: That's the one.
20:12ohpauleezdnolen: I'm trying to build up ClojureScript's scripting story
20:12ohpauleezI have a git-backed text-based ticket tracker - only requirement is node, written in CLJS
20:13ohpauleezand supports a datalog-like search query
20:13dnolenohpauleez: nice, so just trying to see what does and doesn't work from Node.js point of view?
20:13ohpauleezusing githooks, all your ticket operations are automated - everything happens in-band
20:13dnolenohpauleez: sounds cool
20:14ohpauleezdnolen: Exactly - just want to get it to a place that I can confidently pick it up and write a quick scripted app
20:15ohpauleezI'm also trying to unify core.contracts, test.generative and Alloy - but we'll see how far I get ;)
20:15ohpauleez(alloy is - http://alloy.mit.edu/alloy/index.html)
20:17dnolenohpauleez: I encountered Alloy a while back - seems interesting though I never dug enough to really understand what it was about.
20:17SegFaultAXRegarding nginx -> tomcat, why does this example use a location for different filetypes instead of just routing all requests via `location /`?
20:17dnolenohpauleez: I recall some folks mentioning KodKod on the Clojure ML 2-3 years ago?
20:17SegFaultAXhttp://serverfault.com/questions/293348/configure-nginx-for-jboss-tomcat
20:18ohpauleezEiffel uses its contracts to perform "auto test" - I want to use the specs to drive test.generative automatically. I want to then enhance the contracts to support more relational assertions, and make use of Alloy to say, "No, there's a flaw or hole in the collections of 'specs' "
20:19ohpauleezSo if you use core.contracts you get test.generative for free; You get system/spec checking for free
20:19ohpauleezdnolen: Ah, thanks for the hint, I'll go digging around for it
20:19tomojwhoa, I hadn't heard of core.contracts
20:20dnolenohpauleez: interesting seems related to some of the abstract interpretation of contracts work that people are working oe?
20:20dnolenon
20:20ohpauleezdefinitely
20:21tomojwonder why not "with-contracts"
20:22gfrederickstomoj: it has some sort of (apply-contracts! ...) function?
20:22tomojI mean why "with-constraints"
20:22gfredericksoh nm
20:23gfredericksyeah that's pretty weird
20:24tomojit makes me think contracts are a subset of constraints
20:24tomojwhich may be true?
20:24dnolenohpauleez: AutoTest literature looks pretty interesting
20:25ohpauleezdnolen: For sure, I've been spending a couple of weeks now with Alloy, DynAlloy, Behavioral Programming, and Eiffel literature - AutoTest is a cool piece I'd love to steal ideas from
20:26SgeoOh cool there's a contracts system for Clojure?
20:26ohpauleezSgeo: Clojure functions be default support pre and post conditions
20:26dnolenohpauleez: CiaoProlog literature is pretty relevant - perhaps not the Prolog aspect, but how much power they get of abstract interpretation of assertions
20:26ohpauleezbut Fogus' Trammel contracts system, moved to core.contracts a little while ago (and merged in some updates from a smaller contracts lib)
20:27Sgeo,((fn [] {:pre false} 5) nil)
20:27clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval27$fn>
20:27ohpauleezdnolen: Thanks for the tip, I'm looking now
20:27Sgeo,((fn [] {:pre false} 5))
20:27clojurebot5
20:27Sgeo:(
20:27Sgeo,((fn [] {:pre false :post false} 5))
20:27clojurebot5
20:27Sgeo:(
20:28dnolenohpauleez: there's a lot to wade through, lemme see if I can find the interesting slide set
20:30dnolenohpauleez: http://clip.dia.fi.upm.es/papers/RuleML11_slides.pdf, the dynamic vs. static slides are relevant
20:30ohpauleezSgeo:
20:30ohpauleez,((fn [] {:pre [false]} 5))
20:30clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.AssertionError: Assert failed: false>
20:30Sgeoaha
20:30ohpauleezdnolen: Awesome! thanks!
20:31ohpauleezSgeo: Needs to be a vector of assertions
20:32dnolenohpauleez: yeah cool stuff, rich assertion language - assertion based verification & automatic testing
20:32dnolenohpauleez: the kind of thing that I would love to have in Clojure
20:33ohpauleezthat's exactly what I'm going for
20:33ohpauleezme too
20:34ohpauleezI would love to bundle my assertions into contracts, and then just say, "go" - getting test.generative and an Alloy verification for free (or some form of verification)
20:34ohpauleezAnd it certainly seems possible, but I'm still surveying the literature
20:35SgeoOh great, now I have a new programming language to be interested in
20:37SgeoThen again, having a community is important to me..
20:40doomlordjoin #lisp
20:42Sgeodoomlord, uh... oh, you intended to /join #lisp I guess?
20:42gfredericksI read it that he was recommending the #lisp community
20:42Sgeogfredericks, me too at first
20:42doomlordhah both
20:43doomlordclojure is my favourite lisp so far
20:43doomlordi just tried writing some schme (gimp plugins) and sorely missed [..]
20:44SgeoCiao doesn't look like a lisp
20:44SgeoIt looks like a variant on Prolog, I think
20:44doomlordi can head over to #lisp to troll them about how good { } and [ ] are
20:44Sgeoheh
20:44doomlordthe reaction is quite severe:)
20:44Sgeo"This produces an executable called hello in Un*x-like systems and hello.cpx under Win32 systems."
20:44Sgeo...I .... wat.
20:45doomlordi was just trying to write some gimp plugins.. i think the world needs an embedded superset of scheme with [] and {} and clojures' other sugars
20:45doomlordto drop into that project
20:46SgeoHow about Scheme with Clojure data structures and functions?
20:46SgeoNice functional-style programming
20:46SgeoI think I can live without the sugar, but nice functions are nice
20:46doomlordfunctional programming for image manipulation , it would suit gimp
20:47dnolenSgeo: Ciao is not a Lisp. It's kind of a PL laboratory created by some Prolog people.
20:47doomlordi find clojures' fun-callable objects and [],{} and destructuring make it a lot more tolerable than other lisps
20:48Sgeodnolen, how usable is it for .. real world stuff
20:48dnolenSgeo: what does "real world" stuff mean? web apps?
20:48Sgeodnolen, hmm, I guess. Also RIC bots
20:48SgeoIRC
20:49SrPxIs clojurescript compiled to readable js? Like coffeescript?
20:49dnolenSrPx: no
20:49SrPxdnolen: thanks. It is interpreted?
20:49dnolenSrPx: no
20:50SrPxdnolen: hmm how then? Is it fast?
20:50dnolenSgeo: it's an academic project so I'm sure you'll run into more issues than a more mainstream language for that kind of thing. But I don't really think that's the point anyhow.
20:50dnolenSrPx: it provides facilities to achieve the performance of the host yes.
20:50emezeskeSrPx: It's compiled to JS, but the readability of that JS is not optimized for
20:51SrPxdnolen: I see, so it's better not to trust in clojurescript for production yet?
20:51dnolenSrPx: if you compare a computationally intensive JS code w/ idiomatic ClojureScript code - ClojureScript will be considerably slower. But if you're touching the DOM - doesn't matter much. That's slow anyhow.
20:52emezeskeSrPx: I run a production website built in ClojureScript, FWIW
20:52dnolenSrPx: plenty of people using it production. But yes it still has lots of rough edges. But everday we get more and more patches from more and more people.
20:53SrPxI see. Is it much different from Clojure? Can I build up a personal library of utilities that will work in both the browser/clojurescript and on clojure itself? At the same time
20:53dnolenSrPx: people have various hacks / workaround for that. I'm hopeful for a move on Feature Expressions (Clojure 1.6?)
20:54SrPxFeature Expressions?
20:54dnolenSrPx: conditional compilation based on whether you're targeting CLJS or CLJ
20:55dnolenSrPx: http://dev.clojure.org/display/design/Feature+Expressions
20:56SrPxHmm I'm not sure I like that. Is not it simpler just to implement every function working the same way on both sides?
20:56dnolenSrPx: most functions will be the same yes
20:57dnolenSrPx: you don't need Feature Expressions for that
20:57Sgeodnolen, I was recently interested in Prolog, so this might interest me
20:57SrPxdnolen: where exactly does the code have to change, then?
20:58emezeskeSrPx: For instance, the (ns) form supports different features between CLJ and CLJS
20:58dnolenSrPx: it just depends, host-y interop, macros - difference in namespace format
20:59dnolenSrPx: the point of Feature Expressions to account for the minor annoying differences.
20:59dnolenis to account
21:01wingywhy isn't this true
21:01wingy,(every? #(= % " ") " ")
21:01clojurebotfalse
21:01pandeirothere is no html->hiccup tool is there?
21:01dnolen,(seq " ")
21:01clojurebot(\space)
21:01dnolen,(every? #(= % \space) " ")
21:01clojurebottrue
21:02dnolen,(seq " a ")
21:02clojurebot(\space \a \space)
21:02wingywas an error on a presentation then
21:02wingythx
21:02unnaliwingy: not really; " " is a sequence consisting of one space, \space is just the space
21:03unnaliwingy: it's like asking if every element of the list [3] is the list [3]; not quite
21:03dnolenwingy: that's actually true in CLJS since there's no real Character type there.
21:04wingygot it
21:04dnolenSrPx: annoying differences like what I just said
21:05wingyunnali: i meant there was a slideshare presentation that used my original one
21:05unnaliwingy: oh! I see. mea culpa; misunderstood "presentation"
21:06Sgeodnolen, the Ciao docs are only going to go over stuff in Ciao and not Prolog, I assume?
21:06SrPxdnolen: hmm
21:06dnolengotta run
21:15hyPiRionHeh.
21:15hyPiRion,(= \ \space)
21:15clojurebottrue
21:17jcromartieis there any way to recover from (read-line) in SLIME?
21:18jcromartieoh I see
21:18jcromartieswank.core/with-read-line-support
21:19ivanhttp://www.advogato.org/article/1067.html RedHat is doing an ARM64 OpenJDK port
21:21Sgeo,\0
21:21clojurebot\0
21:21Sgeo,\)
21:21clojurebot\)
21:22Urthwhytepandeiro: I believe I saw one over on r/clojure last weekend, but I may be misremembering
21:24amalloypandeiro, Urthwhyte: the H2H library that was on /r/clojure is the worst project i've ever seen. strongly recommend not using it
21:24Urthwhytepandeiro: https://github.com/runexec/H2H
21:25Urthwhyteamalloy: I wouldn't touch it, just mentioning it's out there
21:25amalloyalso, hiccup forms aren't actually easy to work with except for emitting html directly. parsing html to hiccup won't make you happy
21:25UrthwhyteIt didn't seem very robust. Too close to the code I understand ;)
21:26UrthwhyteI don't really understand the appeal of it for exactly that reason
21:26jcromartieis there a way to read a single character from stdin in the REPL?
21:26jcromartiein "lein repl"
21:29jcromartiejava -jar $(lein classpath) clojure.main
21:29jcromartieyay
21:29jcromartieno BS
21:30Girls_EscortPorn SEx Girls http://fredfilms.blogspot.com
21:30jcromartienot that I don't appreciate the stuff lein does for the REPL
21:30jcromartiebut lein repl tends to make for some odd behavior around stdin/stdout
21:31jcromarties/-jar/-cp/
21:34amalloyjcromartie: lein trampoline repl
21:37jcromartieamalloy: thanks
21:45TimMchyPiRion: All the long-name characters: ##(filter #(< 2 (->> % pr-str count)) (map char (range 0 256)))
21:45lazybot⇒ (\backspace \tab \newline \formfeed \return \space)
21:48gfredericks,(->> 256 range (map char) (filter #(->> % pr-str count (< 2)))) ;; all threading all the time
21:48clojurebot(\backspace \tab \newline \formfeed \return ...)
21:51gfredericks&(map char (range 8))
21:51lazybot⇒ (\
21:51gfredericksha
21:52gfredericks,(map char (range 8))
21:52clojurebot(\
21:52gfredericksfascinating; my repl prints (\ \ \ \ \ \ \ \)
21:54hyPiRionTimMc: heh, fascinating.
22:03amalloygfredericks: when something funky display-wise comes up like that, i'm always tempted to say "gosh, what do you mean, what you just pasted looks the same as what clojurebot said a minute ago on MY terminal"
22:06gfrederickshunter2
22:11jcromartie:)
22:11Urthwhytels
22:11lazybotbin boot data lib lost+found media proc sbin selinux src sys tmp
22:12TimMchaha
22:12Urthwhytehah
22:12UrthwhyteI think that's a bug ;)
22:12amalloyfeature!
22:13amalloylazybot likes to make fun of you for thinking #clojure is your repl
22:13amalloyer, your shell
22:14UrthwhyteI seem to be making a habit of gaffs like that today in #clojure
22:14xeqipwd
22:14lazybot#clojure
22:14gfrederickssudo su
22:14gfrederickshostname
22:14unnaligfredericks: `sudo su' considered broken; consider `sudo -i' or `sudo -s'
22:15unnaliconsidered harmful*, damnit. i can't even troll properly.
22:15jcromartielazy-seq is guaranteed to only evaluate the body once when it is needed, right?
22:15jcromartienot ahead of time
22:15gfredericksyeps
22:15jcromartieand not more than once
22:15unnalijcromartie: correct?
22:15gfredericksjcromartie: probably almost certainly
22:15jcromartie:)
22:16jcromartiecombining blocking I/O with lazy-seq
22:16gfredericksI don't think that's too radical
22:18Urthwhyteoh, I had a laziness question - is slurp?
22:18gfredericksslurp returns a string
22:18UrthwhyteI assume it's a wrapper around reader and the answer is no
22:18gfredericksstrings can't be lazy
22:19Urthwhyteah, that would make sense
22:19gfredericks~haskell
22:19clojurebot"you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu
22:20UrthwhyteAlso makes me realise a few other misconceptions, on further reflection
22:20Urthwhyte(inc reasons-to-love-irc)
22:20lazybot⇒ 1
22:21gfredericks~haskell
22:21clojurebot"you have to see features like that in the context of Haskell's community, which is something like Perl's community in the garden of Eden: detached from all shame or need to do any work." -- ayrnieu
22:21gfredericks:(
22:21gfredericksclojurebot: you need more variety
22:21clojurebotExcuse me?
22:21Urthwhyteclojurebot: He said you need more variety
22:21clojurebotNo entiendo
22:22gfredericks~botsmack
22:22clojurebotbotsmack is headdesk
22:27amalloy~monads
22:27clojurebotmonads are http://okmij.org/ftp/Scheme/monad-in-Scheme.html
22:27amalloyaw, i was hoping for a shrimp- or endoburrito-themed joke
22:27shachafmonads moproblems
22:30technomancyjcromartie: latest lein master should fix most issues around stdin
22:56TimMcclojurebot is the destroyer of hope
22:57gfredericksTimMc: don't tell him that
23:07jcromartieI'm trying to figure out how to separate a state machine output on transition from actual i/o
23:08jcromartieit's not really a FSM
23:08jcromartiebut FSM+metadata, I guess not really finite then
23:08vilonisclojurebot destoys hope?
23:14SgeoHmm.
23:14SgeoWork on some bindings to a Java library in Clojure that in all liklihood, I will be the only use of?
23:14SgeoOr work on code for my Senior Project?
23:16jcromartieSgeo: I have a hard time doing anything but writing Clojure :|
23:16jcromartieeven when it's completely pointless
23:16jcromartiemaybe it's a sign
23:16jcromartieI need to do "real work" in Clojure now
23:16jcromartieor else I'll never get anything done again