#clojure logs

2014-12-22

00:00andyfarrdem: pong
00:02kenrestivoit isn't my opinion that the people are intending.
00:02arrdemandyf: refactoring the cheatsheet structure to play with a flowing box layout. interested?
00:03andyfI don't know what a flowing box layout means, but if you think it will enhance usability without making it take way more vertical space, I'm curious.
00:03andyfby flowing box, you mean something where it will take more horizontal space if the window has it available?
00:03arrdemyep.
00:04andyfdefinitely interested.
00:04arrdemkk. I'm starting to work on Grimoire's small screen rendering, and the cheatsheet could use some work so I'm starting there.
00:21tenchiCan anyone help explain what's happening here?
00:21tenchihttps://www.refheap.com/95287
00:26fairuztenchi: nothing?
00:27fairuz(/ 2_000 2) somehow returns 2
00:28tenchifairuz: Ah, and I guess it's not flushed until I hit enter (with or without another command).
00:29tenchiIt's the second 2, in particular.
01:15tolstoyTrying out sente, and right away: Exception in thread "main" java.lang.IllegalAccessError: have? does not exist, compiling:(taoensso/sente.clj:1:1)
01:15tolstoyEek! ;)
01:19arrdemandyf: was the cheat sheet pdf first and then html?
01:20tolstoyWow. Can't even get the lib itself to compile.
01:20andyfSteve Tayon created it, which I wasn't involved in at first. When I came to it, I believe the more up-to-date version was LaTeX (used to generate PDF), and an HTML version was created from that by hand.
01:21andyfMy first step being involved in it was to create the Clojure program that generates both LaTeX and HTML from a common data structure, and I tried fairly hard to keep the initial LaTeX version nearly identical to what I started with.
01:21arrdemgotcha.
01:21andyfIf there is some baggage in the code left over from that, I don't mind ejecting it now.
01:22arrdemwhat I'm working on now basically demands a single column layout rather than the baked in two column assuption so... it's an adventure
01:22arrdemmore funny to see what I consider 2014 clojure style vs 2011 clojure style
01:22andyfI wouldn't necessarily say my style in writing that Clojure code was typical of everyone's.
01:22arrdem:P
01:23arrdemif you want me to not go crazy with style changes I won't
01:23arrdembut right now I'm going a little nuts
01:23andyfI don't mind if it changes in significant ways, if I can still understand it and figure out how to make further changes to it when needed.
01:24arrdemok. I'll let you know when I finish something useful or get really stuck :P
01:24arrdemthanks andy
01:24andyfnp
01:27sdegutisFor example I'm really liking Swift's syntax right now.
01:28sdegutisIt admittedly doesn't allow macros, but so far that hasn't bothered me.
01:43kenrestivomein gott. i think i finally have this core.async thing wrestled to the ground.
01:44kenrestivonow all we need is someone to whack that pioneering modernist painter from the pm's.
01:45kenrestivobut... 5 separate restartable "daemon" components, all communicating via an async message bus, topics and pub/sub, massive crazy state management all done inside an atom in one of the components, all other components getting their state updates from that and feeding input into it.
01:48arrdemsounds like one hella complex state machine...
01:58kenrestivoit's more update functions than state machine. the network stuff is a proper statemachine, using multimethods
01:59kenrestivoanyways, finally can see the horizon and sharing a happy moment.
01:59kenrestivointerested to see what your mobile grimoire ends up lookign like. are you using bootstrap?
02:06arrdemnot yet. a rework atop bootstrap is more or less imminent
02:06arrdemredoing the cheatsheet atop bootstrap first :P
02:07arrdemhttps://github.com/poole/lanyon is what it's built atop now which leads to some... issues.
02:09kenrestivoah, css. i'll be back in browser-and-css-land by end of week i expect.
02:10arrdemyeah. I need to really get my hands dirty in that land :c
02:11arrdemprogrammer art will only take you so far
02:11kenrestivoif you want to sell stuff, yeah, ui is a must.
02:12kenrestivoi'm just a bootstrap jockey at this point when it comes to ui. but it works.
02:15kenrestivoactually looking at grimoire, a bootstrap grid would probably work perfectly. 2 col on wide screens, automatically responsive's to 1 col on phones
02:16arrdemyeah I just need to bludgeon the cheatsheet into supporting that :P
02:16kenrestivoand that menu/sliding-drawer thing, i think it supports that too.
02:16arrdemsince it looks like I'd need to totally rewrite the cheatsheet's internals to support this I may just hand edit it..
02:17kenrestivowhere's the source of it?
02:18arrdemhttps://github.com/arrdem/clojure-cheatsheets
02:19andyfyou can't just make the existing 2-column stuff in there a no-op?
02:19kenrestivooh wow, that goes back a ways
02:19kenrestivofogus, that was a while ago.
02:19arrdemandyf: I mean yeah I could hack it to get the build I want, but that doesn't count :P
02:20arrdemwhy would I pass up on a perfectly good yack
02:20arrdem /s
02:20kenrestivoi'd be inclined to start over, and just take the database of content forward.
02:20andyfnot when those shears are right there
02:21arrdemthe spirit is willing but the body is tired and low on caffeene
02:22kenrestivoyeah i gotta burn an image with this finally-working thing before i pass out.
02:22arrdemI'm just gonna hack it. I'd wind up with two (structurally shared) templates anyway if I really shaved this right.
02:22arrdemanother day.
02:22arrdemdang it's late. forget this.
02:22arrdem'night
02:23andyfg'night
02:33rritochCan someone explain to me how to send an IRC mail via one of the bots? I am having a problem accessing the development wiki and need to advise an official developer of some issues.
02:35andyfrritoch: The Clojure dev wiki? I may be able to help
02:35andyfWhat are you trying to do, and what result are you getting?
02:35TEttinger$mail rritoch this is a message.
02:35lazybotMessage saved.
02:36rritochandyf: I have tried to login but it isn't accepting my password. When I attempt to retrieve my password it says I have no account, and when I attempt to create an account I get a validation error and stack trace saying the account already exists.
02:36TEttingercheck it by privmsging lazybot with $mail
02:37rritochTEttinger: Thanks
02:37TEttingernp
02:37TEttingerit's a very useful feature in geographically diverse IRC
02:37andyfI see an account called rritoch, last logged on in Dec 5
02:38andyfIt looks like I have permission to set the password. You want me to set it to something random-ish and email it to rritoch@gmail.com ?
02:39rritochandyf: Thanks, that would work. I'm unable to reset it.
02:39wildnuxhi, https://www.refheap.com/95290
02:40wildnuxthat function is supposed to do concat on (take-last 2 theseq) and (drop-last 2 theseq)
02:40rritochandyf: I suppose the problem is with the password recovery system then. When I enter either my username or email address it says I don't have an account.
02:40wildnuxand return (4 5 1 2 3)
02:40andyfOn what page are you trying to log in?
02:40rritochandyf: http://dev.clojure.org/dologin.action
02:40wildnuxbut, it is returning (3 4 5 1 2), what am i doing wrong?
02:41TEttingermod is never negative on the jvm, wildnux
02:41rritochandyf: At http://dev.clojure.org/forgotuserpassword.action if you enter my username or email it says the account doesn't exist.
02:42andyfout of curiosity, try going here and look for a Log in link near upper right: http://dev.clojure.org/jira/browse/CLJ
02:42TEttinger,(mod -2 5)
02:42clojurebot3
02:42rritochandyf: I am already logged in there
02:42wildnuxTEttinger: yes, but f should be bound to take-last, and s should be bound to drop-last and thus result should be (concat (take-last 2 [1 2 3 4 5]) (drop-last 2 [1 2 3 4 5])), which but is not ding it
02:42TEttinger,(rem -2 5)
02:42clojurebot-2
02:42rritochandyf: I'm trying to access the developer wiki
02:43TEttingerno, you're take-last ing by n, which is 3
02:43wildnuxTEttinger: aaah.. ok
02:44TEttingerwhat is the correct behavior for the args: -2 [1 2 3 4 5 6 7]
02:44TEttingerloop two from the end back to the front, right?
02:44andyfIf you go to this page, do you see a Log in link near top right? http://dev.clojure.org
02:45andyfSorry I'm asking so many questions -- login problems aren't exactly frequent.
02:46wildnuxTEttinger: it is supposed to rotate the sequence in negative order
02:46rritochandyf: No matter what I enter it's now saying you are required to validate your login by entering the word below
02:46wildnuxso, 6 7 1 2 3 4 i
02:46rritochandyf: I'll retry with chrome.
02:46wildnuxTEttinger: [6 7 1 2 3 4]
02:47TEttingerno 5?
02:47wildnuxTEttinger: 5 as well ;)
02:47wildnuxTEttinger: typo
02:47rritochandyf: I'm having the same problem in chrome
02:48rritochandyf: If I change my password on JIRA will that change my password on the wiki? Maybe that will solve this issue.
02:49TEttinger,(#(take (count %2) (drop (mod %1 (count %2)) (cycle %2))) -2 [1 2 3 4 5 6 7])
02:49clojurebot(6 7 1 2 3 ...)
02:49wildnuxTEttinger: so changing the binding of n to: n (mod (Math/abs %) (count %2) fixed it
02:49TEttingerit's a one-liner though!
02:49rritochandyf: Changing my password on JIRA had no effect, it is just the wiki that I can't access.
02:50TEttinger,(#(take (count %2) (drop (mod %1 (count %2)) (cycle %2))) -10 [1 2 3 4 5 6 7])
02:50clojurebot(5 6 7 1 2 ...)
02:50andyfI just changed the password on your JIRA account, and sent it to you in email.
02:50andyfYeah, that may not help at all in getting wiki access.
02:51TEttingerwildnux, b-b-but one-liners are awesome
02:51andyfSending email to alex.miller@cognitect.com might be a good idea. I have dealt with Clojure JIRA accounts, and I know there is something kinda parallel but not exactly identical on the wiki side that I'm not as familiar with.
02:53wildnuxTEttinger: I know, i wanted one-liner as well,
02:53rritochandyf: Ok thanks, alex is who I'm trying to reach anyhow but I didn't know his email address.
02:54wildnuxTEttinger: but totally forgot about cycle, this is the best i could get :P now looking back the solutions is very helpful
03:28rritochI'm not sure how relevant this is, but I've made additional changes to the namespace isolation feature (in the andylisp fork) to more easily manage isolation switches, and reparenting for use with thread pools. The feature is now fully functional as intended so I hope to post it to the design wiki since the problems with this feature, at least those using my implementation method, have solutions.
03:40kenrestivonow that's one of the most interesting core.async deaths i've yet seen: https://www.refheap.com/95293
03:40kenrestivowhat. in. the.
03:47rhg135This is a bit dafuq, kenrestivo
04:27borkdudeif I'm using lib-noir, what's the way to add a resource directory to the app handler? In ring I would do a wrap-resource
04:27borkdudewith :ring-defaults maybe
04:30borkdudeit worked
05:05trissmath expressions can be pretty illegible in clojure.....
05:05trissis there a way to write them in BODMAS style?
05:05SagiCZ1triss: i have found that out too
05:06SagiCZ1on the other hand, you can have any number of operands which makes some expressions nicer
05:06SagiCZ1if you want, you can write a macro that manipulates your code in such a way, taht you can write something like (5 + (2 * 3)), but you would limit yourself to two operands
05:07trisstrue indeed... it's just I'm often converting formula's off of papers or from ohers code.
05:07SagiCZ1just wrap them in a function, make sure they are correct, and dont worry about it anymore.. its not something you need to be able to read quickly i think
05:07trisscheers SqgiCZ1. I tink i spotted that somewhere. Nobodies been as far as to do the whole bodmas thing yet then?
05:08SagiCZ1not that i know of
05:08trisswith operator precedence and all that shiz
05:08SagiCZ1i think ive seen a simple example in a book about clojure but it was just a toy
05:09SagiCZ1triss: actually, check this out https://github.com/tristan/clojure-infix
05:09SagiCZ1seems like someone bothered to write an infix notation reader
05:10SagiCZ1also appereantly Incanter has it as a module http://data-sorcery.org/2010/05/14/infix-math/
05:10trissthanks man I'll take peek.
05:10SagiCZ1note that incanter is a pretty huge dependency though
05:12trissnot heard of that incanter.... might come in handy at some
05:12trisspoint
05:13SagiCZ1it wraps some nice stuff from jfreechart for plotting
05:17trisswrite then next Q. what's the diffreence between doto and -> ?
05:18SagiCZ1doto is for interop
05:20SagiCZ1doto basically "mutates" the object that comes first using the functions provided... -> threads the expressions and uses output of one function as input for the next
05:20SagiCZ1see this:
05:20SagiCZ1,(doto (new java.util.HashMap) (.put "a" 1) (.put "b" 2))
05:20clojurebot{"a" 1, "b" 2}
05:20SagiCZ1works fine right?
05:20SagiCZ1,(-> (new java.util.HashMap) (.put "a" 1) (.put "b" 2))
05:20clojurebot#<NullPointerException java.lang.NullPointerException>
05:20SagiCZ1but this failes, because (.put "a" 1) returns nil
05:20SagiCZ1which is used as a first parametr for the next .put
05:21BronsaSagiCZ1: doto is not only for interop
05:21SagiCZ1in doto, the parameter is always the first form, not the outputs of previous functions
05:21SagiCZ1Bronsa: well.. it is for objects that are mutable.. thats not a common object in pure clojure
05:22trissah of course. cheers guys
05:22BronsaSagiCZ1: I've used it a bunch of times on ref types e.g. (doto (intern ..) (reset-meta! {..}))
05:23SagiCZ1Bronsa: i see, well my ignorance stems from the fact that i havent used ref types yet :)
05:23BronsaSagiCZ1: sure you have :) you most definitely use Vars all the time
05:23BronsaSagiCZ1: I was not talking about clojure.core/ref, I was talking about clojure reference types, vars/refs/atoms/agents etc
05:23SagiCZ1i use atoms sometimes.. dont know what intern does
05:24SagiCZ1and dont know what var is.. do i use it?
05:24BronsaSagiCZ1: definitely :)
05:24BronsaSagiCZ1: everything you def is a var
05:24SagiCZ1oh....... so it seems i already understand half of clojures reference types.. hooray
05:46borkdudeHmm, adding :ring-defaults {:static {:resources "/META-INF/resources"}} to my lib-noir app-handler results in form posts with empty parameters in compojure :-S
05:52borkdudehttp://stackoverflow.com/questions/27601178/how-do-i-add-webjars-resources-to-lib-noirs-app-handler
06:09kenrestivothe awesome thing about schema is that if you have invalid input you get informative error messages like https://www.refheap.com/95297
06:35hellofunkcan update-in work on vectors? (update-in {:a [[1 2] [3 4]]} [:a 1] 5) I would expect the [3 4] to replaced by the value of 5
06:35hellofunknevermind, i forgot to wrap the value in a fn
06:35hellofunk(update-in {:a [[1 2] [3 4]]} [:a 1] 5) works as expected
06:36hellofunksorry, (update-in {:a [[1 2] [3 4]]} [:a 1] (fn [_] 5))
06:36hyPiRionprobably better to use assoc-in then
06:37hyPiRion,(assoc-in {:a [[1 2] [3 4]]} [:a 1] 5)
06:37clojurebot{:a [[1 2] 5]}
06:38hellofunktrue dat, thanks
06:56mnngfltgI always mix up update-in and assoc-in as well
06:57mnngfltgand then I get confused as to why somebody is trying to call my values as a functio
06:57mnngfltgn
07:18expezI'm trying to determine if a macro is in use. If I search for the #"<name>(\b|\B)" am I missing any occurrences of <name>?
07:19expezs/the/the regexp/
08:06hyPiRionexpez: what is the goal of (\b|\B)? Wouldn't that just ensure there's a character after the name itself?
08:06expezit's to eliminate matching 'foo' with 'foobar'
08:07expez\b is word-boundary and \B is non-word-boundary
08:07hyPiRionexactly
08:07hyPiRion,(re-find #"foo(\b|\B)" "foobar")
08:07clojurebot["foo" ""]
08:08hyPiRion,(re-find #"foo\b" "foobar")
08:08clojurebotnil
08:08expezhmm I misread the docs, then
08:08expezI thought a non-word-boundary would be if 'foo' was followed by say ')' or ']' which are non-word characters
08:09hyPiRionexpez: oh, I see. I just think \B is the complement of \b
08:09hyPiRion,(re-find #"foo\b" "(foo)")
08:09clojurebot"foo"
08:10hyPiRionexpez: I think #"<name>\b" shouldn't missing any occurrences, but you'd obviously end up with false positives
08:10hyPiRionshouldn't miss*
08:10expezI'm OK with false positives, false negatives would be terrible
08:12expezthanks hyPiRion :)
08:14hyPiRionno problem
08:22grumpybathi guys, how do I *emit* tagged literals?
08:24joegallo,(pr (java.util.Date.))
08:24clojurebot#inst "2014-12-22T13:21:13.221-00:00"
08:24grumpybatjoegallo: yep, and what about custom ones?
08:24grumpybatone has to define a writer function or something?
08:24joegalloi was just gonna say something like "i dunno, it just magically works for date and stuff..."
08:25joegallobut yeah, it's possible there's something you need to do, and that it's already been done for you in the case of dates
08:26machty,(class `(1 2 3))
08:26clojurebotclojure.lang.Cons
08:26grumpybatwell, I didn't find anything about emitting tagged literals, there are only some docs and tutorials on how to parse them
08:26machty,(class '(1 2 3))
08:26clojurebotclojure.lang.PersistentList
08:27machty^ why is one Cons and one persistent list? Also, i thought the job of backtick was to fully qualify symbols, but apparently it also does some implicit `cons` ?
08:36TEttinger,(str `(1 2 3))
08:36clojurebot"(1 2 3)"
08:37TEttinger,(str '(1 2 3))
08:37clojurebot"(1 2 3)"
08:37TEttingerhm
08:38TEttingerjoegallo, there's a way to overwrite the normal print behavior, that I can't remember
08:39TEttingerI made 1d arrays printable with: (defmethod print-dup (Class/forName "[D") [a out] (.write ^java.io.FileWriter out (str "#=" `(double-array ~(vec a)))))
08:40TEttinger,(defmethod print-dup (Class/forName "[D") [a out] (.write ^java.io.FileWriter out (str "#=" `(double-array ~(vec a)))))
08:40clojurebot#<MultiFn clojure.lang.MultiFn@56a2ed9e>
08:40TEttinger,(pr (double-array [1.2 3.4]))
08:40clojurebot#<double[] [D@293eaf69>
08:40TEttingerhm
08:41joegalloTEttinger: grumpybat: doesn't look like there's anything magical. it's just print-method https://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj#L169-L184
08:42grumpybatjoegallo: rats... looks like kludge
08:44TEttingeryou could wrap it of course
08:53expezBronsa: why does (analyzer.jvm/analyze '(+ 1 unbound)) error? What can I use instead to build an AST that lets me know that 'unbound is in fact an unbound var in this env?
08:54Bronsaexpez: https://github.com/clojure/tools.analyzer.jvm/blob/master/src/main/clojure/clojure/tools/analyzer/passes/jvm/validate.clj#L255-L262
08:55Bronsaexpez: you can provide custom pass opts to analyze, https://github.com/clojure/tools.analyzer.jvm/blob/master/src/main/clojure/clojure/tools/analyzer/jvm.clj#L435-L437
08:55Bronsaexpez: by default t.a.jvm is a *clojure* analyzer, in clojure an unbound symbol throws an exception
08:56Bronsaexpez: if you want to change that behaviour, you'll have to hook in via pass opts, like :validate/unresolvable-symbol-handler
08:57expezBronsa: Aha. Thanks. So if I want to build an 'extract function' I should use validate with an unresolvable-symbol-handler?
09:00Bronsaexpez: yeah. just FYI it might be a bit unpleasant to succesfully use t.a.jvm to analyze expressions that clojure would not be able to evaluate, simply because it wasn't designed with that use-case in mind
09:00expezBut is there an alternative?
09:01Bronsaexpez: but I know the guys that work on cider have succesfully used t.a.jvm for exactly this use case so it can definitely be done
09:01Bronsaexpez: not that I'm aware of
09:01expezcider doesn't use t.a.jvm
09:02Bronsaexpez: sorry, refactor-nrepl does
09:03expezmm, which is the project I want to extend with 'extract function' :)
09:04expezhttps://gist.github.com/74bd3b42968df75f9f24 will I have your attention, what would be the correct way to do this?
09:05expezI ended up just giving up after a while, but it seems to work
09:05Bronsaexpez: what should (:type :class) do?
09:05expezI'm trying to find the names of classes that are in use so usage of constructors, methods and static variables
09:07expez(:type :class) is a typo no-op heh
09:08Bronsaexpez: I am terribly sorry I have to run away now, if you send me an email with exactly what you're trying to do I'll make sure to reply as soon as I can
09:08expezaight, thanks
10:12picassosdegutis, arrdem, it is not picasso doing the spamming. there is a spambot named picassoo (two o's). different host. and you'll see that picasso is registered with freenode
10:13sdegutisha
10:13sdegutisclever bots
10:13picassoanyway, i'll leave to make things easier for ya ;)
10:16SagiCZ1does anyone feel like this channel is growing quieter last couple weeks?
10:16agarmanholidays
10:16agarmanit happens
10:17SagiCZ1i hope that's the reason
10:19agarmanWhere I am, there are 3 developers in the office, 8 on vacation. This month is so close to zero productivity in the US South that some companies just tell everyone to take the last two weeks off.
10:21SagiCZ1agarman: where do you live in the south? Texas?
10:24justin_smithSagiCZ1: agarman: similar situation even in the comparatively heathen Pacific Northwest - offices shutting down for two or three weeks around now is not unusual
10:24SagiCZ1some people were at work today.. but just for 3 hours.. otherwise until last week we worked normally here
10:25justin_smithpartially I think it is because it's normal to move so far away from family and still expect to see them regularly
10:25SagiCZ1justin_smith: is it? why people move so far away? just because they can or because job opportunities?
10:25justin_smithSagiCZ1: it's easy to move between states in the US, and the US is very large
10:26SagiCZ1it is huge
10:26justin_smithprobably work / money related stuff is part of it, yeah. Also the regions are very different, and people find they "fit" better in a different part of the country
10:27SagiCZ1it's so cool how much diversity you can try out without issues
10:27llasramI think part of it is vacation policies where people lose accumulated unused time off at the end of the year
10:27SagiCZ1California, Alaska, Texas, New York.. so different
10:28justin_smithSagiCZ1: well "without issues" may be a bit much... the diversity isn't without conflicts
10:28SagiCZ1no legal issues though.. for us it's very hard to move outside of EU
10:29justin_smithfor example, a majority of people are liberal, but because of how pop. density works, a majority of states are conservative, and part of national lawmaking is per-state not per-capita representation
10:29SagiCZ1that is very interesting.. how come majority of people are liberal and in the elections it is still very equal
10:30justin_smithbecause electoral votes are not per capita
10:30SagiCZ1don't you get state representatives according to population count?
10:31justin_smithit is influenced by population, but not strictly representative of population
10:31_2_winterhi
10:31justin_smithotherwise california and new york would control every national election
10:32justin_smithbut this is way off topic...
10:32SagiCZ1yeah sorry, i started the off topic since it was quiet here anyways, thanks for the info though
10:32justin_smith_2_winter: hello
10:38justin_smithSagiCZ1: "For instance, each individual vote in Wyoming counts nearly four times as much in the Electoral College as each individual vote in Texas." http://www.fairvote.org/reforms/national-popular-vote/the-electoral-college/problems-with-the-electoral-college/
10:38SagiCZ1how is that fair then?
10:39justin_smithSagiCZ1: arguably it isn't - it was a compromise made for smaller population states when they were convinced to form a national government
10:39agarmanit's not fair. it's not supposed to be fair. it's a compromise made to make a federation of states acceptable to states with less population.
10:41SagiCZ1then again.. does it matter? i feel like americans consider two-party system normal.. but in the democracies in the rest of the world it is common to choose from 4, 5 or even 10 parties.. seems to me that two parties can be very close in their goals, so its not much to choose from.. for example they would be both considered right-wing in traditional EU politics
10:41agarmanThere are more than two parties in US. It's just that the many smaller parties caucus together under the two party system.
10:44SagiCZ1i see.. i have never heard of a third party in the US
10:46agarmanIt's because the two primary parties do what they can to absorb 3rd parties. For a 3rd party to get traction, its goals would have to be so antithetical to the existing two parties that neither could absorb it while still being relevant to a substantial percentage of the electorate.
10:46justin_smithSagiCZ1: bringing this full circle, the project I am working on today is a datomic db of campaign contributions, based on raw data from the Oregon Secretary of State
10:47agarmannice
10:47SagiCZ1justin_smith: great! so you must undestand the system perfectly
10:47justin_smithcurrently struggling with normalizing the data and merging duplicate entities
10:47justin_smithSagiCZ1: "understand perfectly" would be a huge overstatement
10:47SagiCZ1good ol' distinct will solve that i am sure
10:48agarman@SagiCZ1 https://en.wikipedia.org/wiki/Factions_in_the_Republican_Party_(United_States) is a nice article on the factions that make the Republican party.
10:48justin_smithSagiCZ1: campaign a is funded by "Joe Bloggs" campaign b is by "Joe R. Bloggs" - distinct won't help there sadly, sometimes people use variant names...
10:48agarman@SagiCZ1 I don't think anyone has a perfect understanding of US politics because it's truly chaotic.
10:49agarman@justin_smith is this for fun or a work project?
10:49justin_smithwork
10:50SagiCZ1agarman: well i guess that's typical for systems that are brand new.. like java has some things we dont like about it and C# could learn from those mistakes.. people forget that us democracy worked in the same time europe was still in the dark ages almost :)
11:24justin_smithhttp://i.imgur.com/TChcAwn.jpg
11:49hellofunkSagiCZ1 actually one of America’s most revered presidents also had the largest third-party majority of any election in U.S. history
11:49hellofunkactually, “majority” isn’t the right word, but third party presence
12:24EvanR,(clojure.string/replace "a \\ b" #"\\" "3")
12:24clojurebot"a 3 b"
12:24EvanR,(clojure.string/replace "a \\w b" #"\\w" "3")
12:24clojurebot"a 3 b"
12:27EvanR,(clojure.string/replace "a \\w b" #"\\w" "\\")
12:27clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: character to be escaped is missing>
12:27EvanR^
12:28EvanR,(clojure.string/replace "a \\w b" #"\\w" "\\\\")
12:28clojurebot"a \\ b"
12:28EvanRffs
12:29alejandrozfHi!, I want to start making mobile apps but don't like java, do you think clojure would be an option to replace it and could you pointed some links? thanks.
12:35xemdetiaalejandrozf, I don't think so. Android is kind of a weird platform to develop for and while eventually you may be able to bring clojure in I would not recommend starting there.
12:38justin_smithEvanR: what are you trying to do?
12:38alejandrozfxemdetia: well, thanks for your reply but how I can avoid Java then?
12:38xemdetiaalejandrozf, are you trying to develop for android?
12:38justin_smithalejandrozf: I have heard of good results targetting clojurescript to rhino on android though
12:39justin_smithbut cljs is a bit more complex to get set up
12:39alejandrozfxemdetia: yes, but TOTAL newbie in mobile...
12:39EvanRjustin_smith: replace backslash K with backslash, for some letter K
12:40alejandrozfthanks justin_smith
12:41xemdetiaalejandrozf, I would definitely just suck it up and start with java. The core of the system is built on java and you need to know how that works to be successful. It's not like developing on a normal PC by any stretch as many of the rules are different. Get your sea legs first because you may end up having to write a lot of interface code even if you do use another language
12:42xemdetiaThere's also the cljs route, or you can try xamarin or phonegap or one of the other things that attempt to target mobile as a universal platform
12:42justin_smithEvanR: backslash prints as \\ in strings
12:42EvanRyes
12:42justin_smith,(println "hello\\")
12:42clojurebothello\\n
12:42justin_smith,"hello\\"
12:42clojurebot"hello\\"
12:42EvanRthats fine, though im not printing anything
12:42EvanRim trying to replace
12:43justin_smithEvanR: point is, the string will look like \ is doubled - that's just the escaping
12:43justin_smithsorry, the println obscured what I meant
12:43justin_smith,(println "hello \\ backslash")
12:43clojurebothello \ backslash\n
12:43EvanRcorrect, my problem was not interpreting the rendering of the result
12:43justin_smithso you got the right result with "a \\ b" that is a single backslash
12:43justin_smithgotcha, so we both understand now :)
12:44EvanR,(clojure.string/replace "a \\w b" #"\\w" "\\\\") ; this is the final version
12:44clojurebot"a \\ b"
12:44EvanRthe set of four backslashes was what was throwing me off
12:45alejandrozfthanks xemdetia, l like a lot Lisp dialects so I imagined clojure, abcl, kawa or something else would be an option :(
12:45justin_smithyeah, because the replacement string is interpreted specially (so you can use \1 etc. for match interpolation)
12:45EvanRone more gotcha like this and backslash will have to be specified by typing eight backslashes
12:45justin_smithhaha
12:45TimMcleaning toothpicks
12:45EvanRwhen all i want is to replace one string with another
12:45zB0hsis there any different between (-> q -.target -.previousSibling -.value) and (.-value (.-previousSibling (.-target q)))
12:45TimMcI've had to do eight before.
12:46EvanRfor a generic code that replaces one string with another, you have to run the replacement through an escape?
12:47justin_smithEvanR: then why not ##(.replace "a \\w b" "\\w" "\\") no regexes
12:47lazybot⇒ "a \\ b"
12:47justin_smithif all you want is exact matches, I suggest just using .replace
12:47EvanRgood
12:49xemdetiaalejandrozf, eventually maybe but Java is basically the C of what you are normally allowed to touch on Android. If you are just getting started I would work with that because even in my idle experimentation you can and will run into a lot of silly edge cases. Once you know? sure do it in a different language, but there is a lot of tribal knowledge you kind of need for Android.
12:49EvanRim surprised #"\\w" isnt the regex for any word character
12:51justin_smithalso, android is not quite complient java implementation - or is at least a weird one
12:51TimMc&(re-seq #"\w" "a1_- ^")
12:51lazybot⇒ ("a" "1" "_")
12:51TimMcEvanR: Depends how you define "word character".
12:51EvanRoh
12:51TimMcand it's \\w
12:51TimMcugh
12:51EvanRinside # one \
12:52TimMcYeah, #"" takes care of one level of backslashes for you.
12:52justin_smithscsh style sexp regex syntax anyone?
12:52TimMcjustin_smith: Yes please.
12:52EvanRconfucius
12:53TimMcjustin_smith: At least as an option to turn to for uglier ones.
12:53alejandrozfxemdetia, justin_smith and Java is "almost The C" for other mobile platforms too?
12:53justin_smithhttp://srfi.schemers.org/srfi-115/srfi-115.html
12:53justin_smithalejandrozf: not really - each has its own favored native layer, with very little compatibility
12:54justin_smithTimMc: yeah, I also think regex sexps would be worth implementing
12:54justin_smithmaybe when I free up some time in my "cool project" roster...
12:56justin_smithgoogle says "sre scheme regex +clojure"
12:56justin_smitherr, no results for that is
13:05justin_smithgfredericks: do you think any of your work with regexes would be helpful in implementing this regex construction syntax in clojure? http://srfi.schemers.org/srfi-115/srfi-115.html
13:07andyfEvanR: Regarding your difficulties with replacements involving backslashes, I?ve tried to make the doc string for clojure.string/replace as explicit as I can for these cases, but it does require careful reading.
13:07andyfThe simplest thing for constant strings to replace is not to use regex?s.
13:08EvanRi knew that, but im not at the point where i think to use anything in java for anything
13:08EvanRsome basic operations seem to be provided by the "host" system
13:09EvanRand youre expected to use them directly rather than through a standard interface
13:09justin_smithEvanR: yeah, seeing interop as "idiomatic" was a big jump for me, but it can really help with getting things done cleanly, funny enough
13:10justin_smithactually, it was amalloy that finally convinced me of that
13:10andyfEvanR: I don't understand why you say that. How does having clojure.string/replace available mean that Clojure is expecting you to use Java APIs?
13:10justin_smith(inc amalloy)
13:10lazybot⇒ 208
13:11EvanRandyf: as you said, i shouldnt be trying to use regex at all so its moot that its available
13:12justin_smithactually yeah, if you don't feed it regex, things do just work ##(clojure.string/replace "a \\w b" "\\w" "\\")
13:12lazybot⇒ "a \\ b"
13:12EvanRa doc that said "use .replace, not replace and not clojure.string/replace for what you want" somehow...
13:12justin_smithEvanR: see above - just not using a regex is also an option (I had forgotten)
13:12EvanRok, more magic
13:12EvanRwell .replace is shorter
13:13justin_smithEvanR: not magic, type dispatch. Regex and String are not the same type
13:13andyfThe doc for clojure.string/replace pretty clearly says that a pattern of a string and replacement of a string is supported, and in that case both are treated literally
13:13EvanRits never magic, im just lashing out at the overloading
13:13EvanRits a huge doc string with poor formating i didnt even really read it
13:14andyfFunny. That is the opposite complaint of most people about Clojure doc strings (i.e. "too long")
13:14EvanRthe name of the the function, clojure.string/replace (which i used a total of 6 times in a row, then required me to fidding with the namespacing which i failed to do, because of "replace" already existing, so .replace is a great way out of this
13:16EvanRactually its not that long, thought it was at least a page
13:17andyf20 lines is a page?
13:17EvanRthe thing before or after this i was looking at was the height of my monitor
13:19andyfAnyway, carry on. The overloading of replace and replace-first behaviors depending upon argument types can be confusing. Just avoid regex if you don't need them. And if you do, consider using re-quote-replacement on the replacement string to avoid the first issue you brought up.
13:20EvanRyes, avoiding regex
13:25alejandrozfxemdetia: xamarin is opensource?
13:29xemdetiaalejandrozf, I do not think so. I just mention it because it is the top of my mind and it uses C# instead
13:30alejandrozfxemdetia: ok, thanks again :)
13:34EvanRis there an nth which gives nil instead of an exception
13:34justin_smithin order to target all those platforms, I assume it must be using the open source mono stack though (who knows how this turns out now that the clr is open sourcing though)
13:34EvanR,(nth [1 2 3] 3 nil)
13:34clojurebotnil
13:34EvanRnvm
13:37xemdetiajustin_smith, yes I know they are using mono but I don't know how open source it is as an overall whole. I haven't used it- I just have the t-shirt and it was in my laundry this morning
13:39Glenjaminis there a good way to "bail out" of a threading macro?
13:40Glenjamineg, I want to put an error check halfway down, and not perform the other operations if that's the case
13:42Glenjaminhrm, actually in this case it makes more sense to throw an exception anyway
13:42TimMcJust use goto.
13:44Glenjaminthe proper fix is really to separate the "did this work?" part from the "grab an ID out of the response" part
13:45Glenjaminhaven't touched this code for a year, so will probably do that after i've warmed up a bit
13:45TimMcGlenjamin: If you don't need extra info, you can yield nil and use some->
13:45EvanRthere can be many levels of correctness the data can be at
13:45Glenjamini wanted to capture the error message
13:50gfredericksjustin_smith: so that's an sexp-based regex thing? is that the main point?
14:04justin_smithgfredericks: yeah, so that you can use macros and standard collection functions etc. to construct and compose regexes
14:04justin_smithgfredericks: may be totally unrelated to what you were doing though
14:05daniel_im sending a delete request to a liberator resource, :delete! is never called only :handle-ok
14:05justin_smithgfredericks: or maybe after going so deep into regex stuff you would either say "that would be some much better" or "that would be a pointless waste of time"
14:06justin_smithgfredericks simulator: ##(rand-nth ["greate idea" "pointless waste of time"])
14:06lazybot⇒ "greate idea"
14:06justin_smithhaha, the typo makes it better
14:07xemdetiaThis should be the standard of all new feature libs
14:07joobususing xamarin requires a license to be able to compile builds, fyi
14:08joobusi currently use xamarin, if there are questions about it
14:09xemdetiasdegutis, somebody asked about starting android development with clojure as a complete novice to avoid using Java
14:09sdegutisok
14:10sdegutisWe really are fortunate. So many people are being killed and abused and starving, and we're faced with the task of choosing which language we prefer to use to write a mobile app.
14:10EvanRso what interface does empty? require, ISeq? how do i test if something can be empty?ed
14:11EvanRsequential and seq both seem to give false negatives
14:13justin_smith(source empty?)
14:13sdegutis(doc empty?)
14:13clojurebot"([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
14:13alejandrozfyes, was me :), I was reading a lot about xamarin, think I don't like it, looking now for Phonegap
14:14justin_smithanyway, it comes out to "(fn [coll] (not (seq coll)))"
14:14EvanRwhat can be seqed
14:14justin_smiththat's tricky actually - all the collections, plus string and maybe something else I am forgetting
14:15EvanR,(seq? {})
14:15clojurebotfalse
14:15joobusif you are not intending to compile code to multiple platforms, don't use xamarin.
14:15EvanR,(instance? ISeq {})
14:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ISeq in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:15justin_smithhttp://stackoverflow.com/questions/4019249/clojure-finding-out-if-a-collection-is-seq-able
14:15justin_smithEvanR: it's not a question of being seq, but being seqable
14:15justin_smith,(seq "hello")
14:15EvanR,(seqable? {})
14:15clojurebot(\h \e \l \l \o)
14:15clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: seqable? in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:16justin_smithEvanR: see my SO link above regarding seqable
14:16EvanRclojure.contrib.core
14:16justin_smithright, don't use contrib, but the info there should let you know what can be seqed
14:16justin_smithor you can just steal that one function
14:17EvanRfor my case i know a subset of these is all ill encounter, so i can or it
14:26alejandrozfjoobus: HTML5 solutions aren't enougth for "multiplatform" mobile devices?
14:30justin_smithalejandrozf: well, that's what phonegap is about, right?
14:30daniel_im sending a delete request to a liberator resource, :delete! is never called only :handle-ok
14:31alejandrozfjustin_smith, yes I'm walking this way :) , what do you think?
14:38justin_smithalejandrozf: I have not tried it, but have strongly considered it (and have worked with frontend people who did similar stuff with things in the site / app uncanny valley)
14:38justin_smithit seems like cljs/om would be an awesome way to make an html5 app (depending on what kind of UI / UE you need of course)
14:40alejandrozfjustin_smith: thanks! cljs == clojurescript, but om == ?
14:41justin_smithalejandrozf: om is dnolen_ 's cljs lib wrapping react (which offers cool things leveraging react that react can't do on its own)
14:41justin_smithand react is a facebook UI lib for js
14:42alejandrozfjustin_smith: ahh! seems nice!
14:44quizdryeah
14:44atyzDoes anyone have an opinion on this library? https://github.com/ptaoussanis/timbre
14:46arrdemtimbre is ok
14:46tcrayford____atyz: I've used it in the past. These days I just lean for println (with a wrapper to prevent the race conditions in clojure's println)
14:46justin_smithatyz: it works, sometimes I wish it did not have a global config
14:46atyzarrdem: have you used it in production?
14:47atyzjustin_smith: they way it does configs is weird. Are you expected to initialize your config on app startup?
14:47justin_smithatyz: you can modify the config at any time, it's just that there is only one global config
14:48arrdematyz: yeah it's running on http://conj.io right now.
14:49atyzjustin_smith: Im confused as to how you set your global config? It doesn't seem like it reads from a file. Which means I'll be setting it in a function on app startup
14:50atyzThe profiling part of this library also seems rather foreign? It seems like something that could be a separate library
14:50dnolen_hrm how do you get lein to print the jvm command it will run with the classpath, options etc.?
14:50arrdematyz: it has a single var.. I forget whether it's an atom or a dynamic var, that's used to store a single logging configuration for your entire application.
14:50justin_smithdnolen_: :eval-in pprint
14:50arrdematyz: this means you can't have "logging contexts" that behave differently nicely.
14:51atyzarrdem: in teh docs it just looks like a regular var
14:51atyzBut I'm unsure of how I'm supposed to globally set this
14:52atyzI would have probably had it read from a file and allowed the overwrites of the config when needed
14:52atyzBut maybe I'm thinking about this wrong
14:53justin_smithdnolen_: that is, just adding :eval-in pprint at the top level, outputs all that stuff instead of running your app with lein run
15:02beppuIs http://tryclj.com/ working for everyone else? I'm trying to defn a function, but I can't seem to call it.
15:05justin_smithbeppu: http://i.imgur.com/hlXIv8T.png
15:07justin_smithbeppu: "The interpreter deletes the data that you enter if you define too many things, or after 15 minutes"
15:08beppujustin_smith: Yeah, it was working for me earlier today and then it stopped. Do I have to clear my session cookies?
15:09beppujustin_smith: clearing my cookies for tryclj.com made it work again.
15:10dnolen_justin_smith: thanks
15:16daniel_im sending a delete request to a liberator resource, :delete! is never called only :handle-ok, anyone have any idea why that would be?
15:25mgaaredaniel_: if you turn debugging on, you can see the decision tree in the headers of the response
15:25daniel_magnars: interesting, thanks
15:25daniel_forgot about that
15:29daniel_weird, no headers for the delete request
15:29borkdudeI need to save a hashmap with one of the values being a byte array into a file for export and importing, any best practices here?
15:29daniel_but for get i see them
15:29mgaareborkdude: could look at Fressian
15:29borkdudeI could maybe base64 encode the bytes and save it just as a string
15:31justin_smithborkdude: yeah, round tripping via base64 is how I would do it
15:31mgaaredaniel_: none at all? perhaps it's not hitting liberator?
15:32daniel_mgaare: i think its with my route definitions
15:32daniel_i have /api/files defined but not /api/files/:id for delete
15:32mgaareah
15:33daniel_im used to having a resource define all the different http methods and know what the singular routes should be
15:34daniel_i guess this isnt the liberator way, most example i see define separate list and detail resources
15:35daniel_indeed mgaare, it was missing the route
15:35daniel_it kind of pains me to have to write all the routes explicitely for CRUD endpoints
15:37justin_smithdaniel_: can you sub in a data driven function instead of defresource? I guess at worst you could write a macro that ingests a big data structure describing endpoints and calls defresource on them
15:48daniel_justin_smith: indeed i could, i will try and do something along those lines
15:51bacon198`so what's this talk about clojure 1.7 having seamless files between clojure, clojurescript, and clojureclr?
15:51justin_smithdaniel_: this was a big motivator in our design of caribou - we ended up replacing compojure so that it would be easier to define routes programmatically based on data in the CMS
15:53badylhi, can someone tell me how I could integrate an app written with Stuart Sierra's component and compojure to be run as a war/servlet app?
15:53bacon198`*feature expressions*
15:53badylI was searching the internet but couldn't find any examples. The name of the framework/library don't help with googling :)
15:59borkdudenice, fressian works well
16:04mgaaredaniel_: with liberator, I think it's idiomatic to define routes with ALL and let liberator handle the logic for the different verbs
16:06mgaarebadyl: do you have a hook to run a main function in your container?
16:06mgaareI only know how to do this in immutant
16:08badylmgaare: I think it would try to start another web server in the war container
16:09badylI was thinking about having compojure routes a reference to a "business" or "logic" component from the system object and calling fuctions with that component
16:09badylso basically the "web" part wouldn't be part of my "componentized" system
16:14phood
16:14mgaarebadyl: I think the idiomatic way to this is define a 'web app' component that has the web handler, and has dependencies on whatever other components you need. on startup, it wraps the handler in some middlewares that add the other components to the request map, and the resulting handler is what you'd pass to the container as the web handler
16:16mgaarestuart talked about this in one of the presentations he did on it
16:18badylmgaare: thanks for the pointers
16:18badylI will take a look
16:20danielszmulewiczbadyl: Have a look at the example directory in https://github.com/danielsz/system
16:24badyldanielszmulewicz: thanks, I will check it out
16:25badyldanielszmulewicz: can the example project produce a war that can be deployed in servlet container?
16:28badyldanielszmulewicz: I would like to build with lein-ring and its uberwar task
16:28danielszmulewiczbadyl: Yes, no reason it wouldn't. It's a standard ring handler. So standard leiningen practices apply.
16:30badyldanielszmulewicz: thanks again, I will try it
18:05EvanRcan i get a [a & b] binding to set b to () when binding a singleton list
18:05amalloyEvanR: no, you get nil
18:05EvanRi see that
18:05amalloythat is what you are stuck with. why do you need an empty list instead?
18:06EvanRif i change my check from empty? to nil? i will silently accept bugs that produce nils
18:06EvanRim less likely (maybe?) to get accidental ()
18:07amalloyEvanR: so don't destructure it before testing it
18:07EvanRyeah i was just wondering if there was a less verbose way
18:08EvanRseems natural to me, but obviously nil is more natural to some people
18:09EvanRi.e. "in & a, a contains the list of remaining elements", well its not so simple
18:10amalloyEvanR: personally, i would rather that &a were set to () instead of nil, for different reasons
18:10amalloybut it doesn't, and it's way too late to change
18:11m1dnight_is there a particular reason there is no set! in clojure?
18:11m1dnight_I was just wondering :)
18:11m1dnight_like in scheme you can set let bindings and stuff
18:11EvanRthere is set!
18:11EvanRbut not for let bindings
18:11amalloym1dnight_: because immutability is a big deal
18:11m1dnight_i understand yes
18:12m1dnight_so its more of a way to force functional style?
18:12EvanRnot being able to mutate lexical bindings makes me feel better
18:12EvanRyou can still do it by using a mutable variable explicitly, like a ref or atom
18:13EvanRor the java array trick
18:14amalloyor also ztellman/proteus, for the real bad boys of clojure
18:17m1dnight_yeah or you could do a deftype of a node for a list and stuff
18:17m1dnight_i tried it once but it's just nasty
18:19gfredericksjustin_smith: yeah, probably unrelated; most of what I've been doing has been parsing string representations, and learning jvm quirks and unicode stuff
18:34justin_smithgfredericks: if I can pull myself away from my awesome new microphones, I may just try implementing something like resexps
18:35m1dnight_guys, what happens if an expression throws an error in a binding (threadlocal var), does the binding remain in the handling of the catch?
18:35m1dnight_I can't think of a quick and easy test scenario :p so perhaps somebody could tell me
18:36m1dnight_otherwise ill mock something up
18:36m1dnight_wait, nvm
18:36EvanRx=crash, catch print x ?
18:36gfredericksjustin_smith: it'd be fun I'm sure, and you could even generalize it to sequences of arbitrary things
18:36EvanRtwilight zone
18:37gfredericksjustin_smith: and if you do that, make sure to compile to test.check generators too
18:37justin_smithohhh yeahhh....
18:38EvanRin prismatic schema, is it possible to specify a non-empty list
18:38gfrederickswith pred at least
18:38gfredericksEvanR: ^
18:38EvanRok
18:39m1dnight_damnit, the binding is lost
18:39m1dnight_to the thinkmobile then :(
18:40amalloym1dnight_: it sounds like the things you are trying to figure out how to do might be evil and misguided
18:40amalloyinstead of focusing on this one particular approach to solving your problem, perhaps think more about what your problem actually is, so you can find an approach that's less awful
18:41m1dnight_amalloy: well, it's for my thesis and im guessing that if somebody read my code a few people would be turning in their graves, i admit that :p
18:41m1dnight_I'm trying to implement something like transactors in clojure
18:41{blake}Satanic doctorates.
18:42m1dnight_the gist of it is that I have macro receive and I can nest them (like erlang) like (receive [:message] (something) (receive [:inner] (code)))
18:43m1dnight_and when the sending actor fails it propagates to all receiving actors
18:43SagiCZ1how could i use clojure to create simple webpages for my own blogging purposes? i am new to this
18:43m1dnight_but when :message is received from actor A, and :inner from B, suppose that A fails. then I have to throw the "ParentFail" exception. However, this happens in the inner receive. so I have to propagate the error through to the outer receive
18:44hellofunkSagiCZ1: you could play with Ring and host some static pages somewhere, or you could write a postgres app on heroku which would get you in deeper to backend clojure work
18:44m1dnight_so if I could handle the error inside the (binding [*sending-context*]..) then I would be out of the woods
18:44SagiCZ1hellofunk: and what about clojurescript? can i throw that in too?
18:44{blake}SagiCZ1: There are some tutorials online that show blogging as an example.
18:45hellofunkSagiCZ1: blogging usually refers to a server-side setup that is separate from the front end, but of course cljs is great for front end work too
18:45{blake}SagiCZ1: I wouldn't throw in ClojureScript at first. It's a fair-sized chunk just for the server-sde stuff.
18:45hellofunkor you could broaden you pool of web hosts and forget about a clojure server end and just use cljs to host the entire blog in the browser.
18:45SagiCZ1what database would i use for storing the stuff?
18:46hellofunkSagiCZ1: depends on the server you use. Heroku uses postgres
18:46arrdemWith Ring, is there a good hack for updating a parameter in a request and then retrying the request?
18:47arrdemit seems like (handler (update-in req ..)) should work.
18:47{blake}arrdem: That would've been my guess =P
18:48arrdem:c well that's what I've got going on right now in my REPL and it's not behaving as expected so..
18:49{blake}arrdem: Huh. How is it different from, say, logging in? Like, I use "(assoc (resp/redirect "/") :session {:user username})" to do that.
18:49m1dnight_I just found a tutorial on a blog in clojure on a website on christianity and clojure. That's a combo you don't see every day.
18:49{blake}Rich Hickey died for your stateful sins.
18:50arrdem{blake}: I suspect there are some headers I'm not reseting or something.
18:51TimMc{blake}: Heart attack before I finished reading your msg, man.
18:52{blake}arrdem: Well, I'm just getting the hang of it myself. :-/
18:52{blake}TimMc: lol...sorry...it was in poor taste.
18:52EvanRthe best kind of taste
18:53{blake}If it wasn't for bad taste, I'd have no taste at all.
18:53TimMc{blake}: I think it was fine in context, I was just reading scrollback backwards. :-P
18:53{blake}heheh the hazards of time travel
18:53TimMcRich Hickey fell out of a hammock several times for your sins.
18:54{blake}Doesn't sound like much but it's a lot of bruising when you consider how many of us there are.
18:57arrdemHah gotit!
18:57{blake}And?
18:58arrdemthere was some routing stuff you had to dissoc out of the map
18:59arrdembut we were basically there
18:59{blake}Cool. Interesting.
19:15arrdemGrimoire 0.4.5 up, now with an official API driver: https://github.com/clojure-grimoire/lib-grimoire
19:27dbasch{blake}: Rich Hickey is immortal. Dying would require changing state.
19:28{blake}dbasch: I assume he's declared as an atom.
19:29EvanRhes in a singleton java array
19:29amalloymaybe that's why he's always telling us not to use too many atoms? highlander-style, there can be only one
19:33gfredericks,(nth (iterate atom 42) 7)
19:33clojurebot#<Atom@51158898: #<Atom@4c76ae6e: #<Atom@6923e1ad: #<Atom@5def363a: #<Atom@20c33457: #<Atom@59bffbff: #<Atom@2fe747ec: 42>>>>>>>
19:34amalloyoh interesting, that's not impacted by *print-level*
19:34EvanR nooo youll run out
19:34amalloyer, *print-depth*?
19:34amalloywhatever it is
19:34gfredericksclojurebot: swap-in! is like update-in but for nested atoms
19:34clojurebotAck. Ack.
19:36arrdemgfredericks: |is|
19:39gfredericks~swap-in!
19:39clojurebotswap-in! is like update-in but for nested atoms
19:39gfredericksarrdem: what would that accomplish?
19:40amalloygfredericks: it's voodoo for wimps who don't know how clojurebot works as well as you do
19:50gfredericksclojurebot: foo? is an experiment
19:50clojurebotA nod, you know, is as good as a wink to a blind horse.
19:51gfredericks~foo??
19:51lazybotgfredericks: What are you, crazy? Of course not!
19:51clojurebotfoo? is an experiment
19:51gfredericksthis is the weirdest AOL chat room I've ever been in
19:58amalloygfredericks: i'd be surprised if there weren't
20:00amalloygfredericks: i'm trying to find this interesting article i read a few months ago about how AOL didn't want AIM to succeed
20:00gfredericksdo they still have a web browser that I can download from my physical mailbox?
20:02amalloygfredericks: found it! http://mashable.com/2014/04/15/aim-history/
20:04gfredericksamalloy: cool, thanks
20:13gfredericksI'm having a hard time not seeing this regex-feature-nobody-uses as super buggy
20:14gfredericks,(re-matches #"[x&&[x]]" "x")
20:14clojurebot"x"
20:14gfredericks,(re-matches #"[x&&[x]y]" "x")
20:14clojurebotnil
20:14gfredericks^ there's just no excuse for that
20:14gfredericksand nothing in the spec that suggests you can't do it
20:15amalloygfredericks: is there anything in the spec at all?
20:15gfredericksthe Pattern.java docs I mean
20:16gfrederickstheir only example for using intersection is: [a-z&&[aeiou]]
20:16amalloywell maybe that's the only way you're supposed to use it
20:16amalloyruby is the only other engine that supports this feature, right? is theirs documented?
20:17gfredericksthey talk about them as "operators" with "precedence"
20:17amalloy...
20:17gfrederickslooks like it
20:17amalloygfredericks: i know you've read http://www.regular-expressions.info/charclassintersect.html, but have you read it recently?
20:17gfredericksruby's example in fact is /[a-w&&[^c-g]z]/ # ([a-w] AND ([^c-g] OR z))
20:18amalloyspecifically, "Intersection of Multiple Classes"
20:18gfrederickswhich they claim is equivalent to /[abh-w]/
20:18gfredericks"Java has bugs" is what that link says :)
20:19gfredericksso...right then.
20:20amalloyis your goal with this still to produce a test.check generator from an arbitrary regex?
20:21gfredericksyes
20:21gfrederickswell
20:21gfredericksor to tell you if I can't/won't
20:21gfrederickswhich applies here
20:22gfredericksbut I gotta determine the scope of the bug so I can recognize it
20:22amalloy(regex-gen #"[x&&[x]y]") ;=> "c'mon man, y u do dis"
20:23gfrederickse.g. (regex-gen #"[a&&b]") throws an exception since it's unmatcheable
20:25TEttingerI would just not implement that particular regex feature
20:25TEttingerif it has && or ||, it fails the test
20:25TEttingerbecause it will in practice
20:26gfredericksbut it's so easy to implement the non buggy cases :P
20:26amalloyi don't think || exists, TEttinger
20:26gfredericks|| is implicit
20:26TEttingergood
20:26gfredericksoh man http://stackoverflow.com/questions/21934168/bug-in-double-negation-of-regex-character-classes
20:26gfredericksTEttinger: I'd consider that but there's actually a few things that are difficult to express without &&
20:27gfredericksI think.
20:27gfredericksdon't ask me for an example.
20:29amalloygfredericks: i dunno, isn't #"[a&&b]" equivalent to like #"(?=[a])(?=[b])." for any a/b?
20:30gfrederickshuhwhat?
20:30gfredericksI'm saying it's an empty character class, I can't tell if you're contradicting that or not
20:31gfredericksor you're arguing that it's expressable with lookahead
20:31amalloygfredericks: i'm using a and b as variables here, not literal characters a and b
20:31gfredericksok
20:31gfrederickswell I don't support lookahead anyhow so :P
20:31amalloy!!!!!!
20:31gfrederickspatches welcome
20:31amalloythat feature is way more important than this intersection bullshit
20:31TEttingerlookahead sounds much more important than intersection agreed
20:31TEttinger(inc amalloy)
20:31lazybot⇒ 209
20:32TEttingerit's probably used at least two orders of magnitude more frequently
20:32amalloylike, i can get behind skipping lookahead because it's hard
20:32gfredericksI don't doubt that
20:32amalloyit doesn't need to be perfect to be useful
20:32gfredericksbut implementing it is harder
20:32gfredericksat least in a solid way
20:32amalloybut supporting intersected character classes is something i would drop way before that
20:32amalloybecause nobody in the world will ever use that feature, and if they do you should shoot them
20:33gfredericksbut I've spent so much time on them so far, so the sunk cost falacy says I have to press on
20:33amalloywell, no arguing with that
20:33amalloyif only you could lookahead in your own life, and see the further sunk costs coming
20:33gfredericksalright fine you've convinced me
20:33TEttingerclojurebot: character class intersection |is| <amalloy> because nobody in the world will ever use that feature, and if they do you should shoot them
20:33clojurebotAlles klar
20:33gfredericksnow how do I do lookahead
20:34TEttingercheck java's impl first?
20:34gfredericksfor what?
20:34TEttingerlookahead
20:34gfredericksand do what with that?
20:34amalloyTEttinger: remember he's doing it in reverse
20:34TEttingereh? amalloy?
20:34amalloygfredericks: man, i dunno. i'd support it by not supporting it, but i don't know anything about your implementation
20:35amalloyi'm just saying if you are willing to drop features at all (and like i said, dropping support for lookaround seems fine), you might as well drop intersection
20:36amalloyTEttinger: he is not writing a regex matcher, but a regex generator: given a regex, produce strings that it matches
20:36TEttingerok
20:36gfredericksit's actually probably easy
20:37gfredericksto do rudimentary lookahead
20:37gfrederickswell no wait positive is hard
20:37gfredericksnegative is easy, just filter
20:37gfrederickswhich has its own thorns but is good enough to start with
20:37gfredericksbut positive lookahead sounds sooper hard
20:37amalloygfredericks: well, both sorts of lookahead have the problem that the most obvious way to solve them involves a lot of luck
20:38amalloylike, #"(?=a)(?=b)."
20:38gfredericksamalloy: yeah I guess they are the same, negative just seemed like it required less luck in common cases
20:38amalloyit's pretty hard to see that this will never match
20:38gfredericksbut I don't actually know much about common cases
20:38gfredericksheck I'd have to implement a generic matcher :P or just compile a subset of the regex via the jvm
20:39gfredericksyep I give up
20:44numbertenis there a 'preduce'-esque function?
20:44numbertenfor when your function is associative?
20:45TEttingernumberten, pmap is rarely the answer
20:46TEttingernot sure how preduce would be any better
20:46numberteni've used pmap for a lot of things :/
20:46numbertenrough and dirty parallelism at the drop of a keystroke is really nice sometimes :)
20:46TEttingerclojure's other concurrency primitives are generally a lot better though
20:47numbertenis there a primitive for parallel reductions?
20:48amalloyguys i finally reached my limit: found a scenario where i can't bear to use -> and doto instead of just naming a local. https://www.refheap.com/592e994b1727f4c72de79ddc7
20:48gfrederickswtf amalloy
20:49TEttingerone line difference, amalloy
20:49amalloyTEttinger: well, the one line is just because emacs indents doto inside of a -> a little weirdly
20:50amalloyreally the problem is that the soup of ->/doto is completely illegible
20:50TEttingeryes
20:50amalloyeven though i love ->/doto soups usually
20:51amalloy,(-> (java.util.ArrayList.) (doto (doto (doto (doto (.add 1))))))
20:51clojurebot[1]
20:51amalloy<3
20:51aduit sounds like you love doto almost as much as haskellers love monads
20:52gfredericksa doto is like a burrito
20:52amalloyi have feelings about -> and doto that are inappropriate to discuss in public
20:57gfrederickspop quiz: what does #"\v" match
20:57kenrestivoi'm a linux shell guy so i love -> (and not so much doto). if i were a haskell guy i suppose i'd have monadic religion
20:57amalloygfredericks: same as #"v" i'd guess
20:58gfredericksnopes
20:58amalloyoh
20:58amalloyvertical line feed?
20:58amalloyvertical tab or something
20:58amalloyyeah
20:58gfredericksyeah
20:59kenrestivothose java interop boluses with all the dotos, lets, and ->'s are ugly, but consider the alternative: writing actual java
21:02ottihm did someone experience that, when creating a uberjar, that leiningen just hangs at some point
21:03ottiwithout any errors or anything it just sits there and does nothing, thus it never finishes compiling the uberjar
21:03amalloyotti: your namespace does side effects at the top level instead of inside -main, eg starting up a webserver
21:04amalloythose are happening at compile time, so the jar can't be made until the webserver is done
21:04ottiamalloy: thanks
21:06amalloythat's not the only possible issue, but it is by far the most common
21:06adukenrestivo: in Haskell the monads that appear in do-notation usually only have one argument, so it's equivalent to doto and -> at the same time
21:12tomjackone argument?
21:23adutomjack: well, the functions must have one remaining argument by the time the Monad sees it, it could be a 10-argument function that has 9 arguments given
21:25adubut that's just because Haskell functions are always in curried form
22:00amalloyyeah, i'm not sure what this one-argument thing is about either. do x <- f a b; g x c d desugars to: f a b >>= (\x -> g x c d); obviously that lambda has one arg, but it's not clear how that means "the monads have one argument"
23:44tomjackinstead of "doto and ->" I think I'd say "generalized let"