#clojure logs

2014-05-19

00:26cespare|home,(#(%-1))
00:26clojurebot#<NullPointerException java.lang.NullPointerException>
00:27cespare|homewriting a clojure parser; discovering fun edge cases.
00:28numbertenis that treating the %-1 as the -1 indexed argument to the function?
00:29cespare|homemaybe?
00:29cespare|home,#(%0)
00:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: p0__52# in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:29numbertenseems like it
00:29cespare|homedon't understand that one either.
00:29numbertenthe first is 1
00:30numbertenargument indexing for #() sugar begins at 1 iirc
00:30cespare|homeright
00:30cespare|homei'm seeing how bad code is parsed
00:30numbertenyeah it's interesting
02:11amalloyamusingly, the reader will let you use funny numbers for #() args, iirc
02:11amalloy,'#(foo %1.3)
02:11clojurebot(fn* [p1__25#] (foo p1__25#))
02:11amalloy,'#(foo %3N)
02:11clojurebot(fn* [p1__51# p2__52# p3__50#] (foo p3__50#))
02:25numbertenwhen running tests
02:25numbertenis there a way to automatically run the tests x number of times
02:41amalloyif your tests fail one time out of n, they're not very good tests, are they?
02:44mercwithamouthi'm trying to test my compojure routes from the repl. shouldn't this be sufficient? https://gist.github.com/anonymous/0b72f45a3a1ca4376ee7
02:45mercwithamouthi'm used to calling (start-server) but apparently for what i want to do run-server is what i'm supposed to use?
02:46beamsowhat do you want to test about your routes?
02:46mercwithamouthbeamso i'd just like the data that it would post to show up via repl
02:47mercwithamouthi suppose i COULD just use curl...but i'm being..difficult
02:47mercwithamouthahh i believe i misunderstood the conversation i'm reading now in the google group
02:48beamsoyou could test the method that the route is calling for the data
02:49beamsoi imagine, but have no idea, that you're also able to test that url go to your intended function
02:49beamsoi should have said function and not method for the first line, too.
02:51mercwithamouthok so lets say i have a route that leads to a page with three fields how could i work with that strictly server side(not building a page for it) to see if it works
02:51mercwithamouthi'm focusing on writing my api and i want to do client side work later
02:53whodidthismaybe something like https://github.com/xeqi/peridot
03:01SegFaultAX /join #python
03:01SegFaultAXWhoops, sorry.
03:01mercwithamouthhehheh
03:01mercwithamouthtraitor!
03:01mercwithamouth=P
03:02SegFaultAXmercwithamouth: I've been doing Python a /lot/ longer than I've been doing Clojure. Maybe 5x or so. ;)
03:04mercwithamouthSegFaultAX: fair enouugh, lol
03:44ddellacostais there a way to run a function via lein before whatever you're executing gets run? I want to do something like: lein <plugin> -x (my-namespace/my-fn)
04:13mercwithamouthare there any lists or articles on the most useful clojure functions to get started with?
04:14dbaschprobably everything in core is important and that’s why it’s there, but here’s the first google result http://stackoverflow.com/questions/12011821/in-clojure-what-are-the-other-most-important-functions-in-clojure-core-one-must
04:15mercwithamouthdbasch: *thumbs up*
04:16mercwithamouthhmmm 4clojure should be my friend
05:34mercwithamouthunimportant question...i know but can someone tell me what color theme this is? https://github.com/clojure-emacs/company-cider
05:36ddellacostamercwithamouth: you mean the screenshot on that github page? Dunno but I bet the emacs folks would know...although it may just be the wrong time of day to find someone in here who can nail an emacs color scheme from memory like that.
05:38mercwithamouthddellacosta: agreed...
05:41ddellacostaheh
05:41ddellacostamercwithamouth: where are you, btw?
05:41mercwithamoutheast coast/us
05:41ddellacostaI don't see a lot of folks around this time of day
05:41ddellacostawat
05:41ddellacostamercwithamouth: do you like getting up early or not going to bed?
05:41mercwithamouthi don't go to sleep =)
05:42ddellacostamercwithamouth: well, I'm not one to judge, don't get me wrong
05:42mercwithamouthactually i work nights and this is considered my weekend. crazy sleep schedule
05:42ddellacostajust surprised
05:42ddellacostaah
05:42ddellacostaare you doing development at nights?
05:42ddellacostaor sysadmin kind of stuff?
05:42mercwithamouthnope..hobbyist
05:42ddellacostaoh, cool
05:42mercwithamouthnon computer related
05:43ddellacostawow, don't meet a ton of folks in here that aren't doing it professionally. Although that may just be because I never asked
05:43mercwithamouthlol i may be a special case
05:43ddellacostaheh
05:43ddellacostayeah, also, most hobbyists aren't jumping into clojure...is my impression.
05:43ddellacostaagain, could be wrong about that
05:44ddellacostaon the flip side, I think there are a *ton* of developers who use some other language professionally but use Clojure for side projects, so it kind of makes sense that it would be appealing to hobbyists in general
05:45magopiani've been (organizing) a conference last week in south of france, on an island, for Django (python web framework)
05:45magopianand we've had one of the guys talk about "taming the complexity"
05:46magopiantaking advice from Rich Hickey's talk on "simple made easy"
05:46magopianand applying some of it to using react.js and stuff
05:46mercwithamouthddellacosta: yeah, i'm just seeing what fits. i've 'played' with everything from ruby to scala...now lisp. Lisp has been interesting...though very hard.
05:46lockserr'body talking about react
05:46magopianthen during the meal we had a talk, and we both want to switch to clojure, but there's this kind of invisible glass wall that we can't put a name on
05:46ddellacostamercwithamouth: yeah, it gets a lot easier I think
05:47ddellacostamagopian: what do you mean, like cultural, or just something individually stopping you guys?
05:47magopianddellacosta: mercwithamouth: talking about that, yeah, we felt it was hard... harder than learning OOP for beginners
05:47magopianddellacosta: dunno, it's very difficult to articulate and explain, some kind of feeling that it is the way to go (FP), but at the end of the day
05:48magopianeven though I could really get used to read FP, and understand it (which is not the case: it takes a lot of thought/concentration to understand some code, but then, i'm just a beginner)
05:48magopianand I could imagine _understanding_ code becomming easy with practice
05:48magopianit feels like _writing_ code in FP is just plain hard
05:49magopianlike, you have to think a lot about it, and in a way that is not "normal" (simple? easy?) for a human brain
05:49locksimmutability is tricky :P
05:49ddellacostamagopian: I think it's just a learning curve, and I think it may be harder for "old" developers because they've had so much practice with the C-family of languages, that learning new ones within that realm is just not a huge deal
05:49xsyn1and rewarding
05:49magopianwe do think in terms of objects in our everyday life, everything is objects
05:49magopiannot everything is data, and reasoning/thinking about data doesn't feel like easy to my brain
05:49xsyn1is time an object?
05:50ddellacostamagopian: but I think it just takes time
05:50locksmagopian: I've been an "oop programmer" for all my life but functional programming actually makes more sense to me
05:50locksso I guess it also depends on the person
05:50magopianddellacosta: i have no problem with learning and learning curve (i'm a late vim adopter after all ;)
05:50mercwithamouthhmm do i want to stick with light table or go back to emacs...decisions
05:50xsyn1:)
05:50locksmercwithamouth: LT <3
05:51mercwithamouthlocks: decision made. =)
05:51ddellacostamagopian: but I really don't think there is anything inherent in FP that is difficult. In fact, it is easier in many ways, I believe
05:51magopiani'm not in a hurry, I have a highly rewardning job (i'm a django freelancer, i contract for mozilla and a french christian association)
05:51magopianso i have no problem with "it takes time"
05:51Glenjamini'm a tad concerned that chris and co are shifting focus away from LT
05:51xsyn1magopian: I've been dealing with the Clojure learning curve for about 2 years, and I still feel like a white belt
05:51xsyn1bet there's a lot of beauty underneath
05:51Glenjaminbut the latest reelease is pretty damn good
05:51magopiani'm just feeling like "it's gonna need more than time... maybe some kind of declic"
05:51xsyn1that's changed the way I see the universe
05:51ddellacostaxsyn1: ditto
05:51ddellacostamagopian: what's declic mean
05:51ddellacosta?
05:51xsyn1nick xsyn
05:52magopianddellacosta: sorry, french word
05:52magopiansome kind of... sudden change of viewpoint
05:52magopianwhen it 'tics'
05:52lockswhen it clicks
05:52locksor an epiphany
05:52locks:)
05:52magopianlocks: that's the one
05:52magopianthanks
05:52ddellacostamagopian: no worries, I figured--I have a French friend who does that all the time, he'll use a French word 'cause he's gambling it means the same thing in English. ;-)
05:52magopianwhen it clicks
05:52magopianand it hasn't for me (yet)
05:52ddellacostalocks, magopian: ah, gotcha
05:52magopianddellacosta: yeah ;)
05:52xsynit's probably a pretty good gamble ;)
05:53ddellacostaxsyn: yeah, exactly
05:53mercwithamouthi need to do a lot more coding...i'm pretending to toy with compojure...though only 1-2x a week and the decision to completely separate my view code from the server side code(unlike what most compojure tutorials teach) has added more complexity to my plate
05:53magopiananyway: i've worked through most of the 4clojure exercices
05:53mercwithamouth...which is fine. i'm in no rush nor do i have any...immediate goals
05:53magopianand I do get some pretty good answers on my own much more than I thought beforehand
05:53xsynI honestly believe you need to make something though
05:54xsynexcercises are cool
05:54magopianxsyn: yeah, that's the thing: i need to do some kind of real project
05:54xsynbut they're like drill work
05:54ddellacostamagopian: for me the big one was understanding time and immutability, at least in context with Clojure. But I still struggle with some concepts...I think one thing is that I used to think OO solved a lot of problems, and now I look at it as being imprecise and hard to reason about.
05:54mercwithamouthxsyn: i agree. my project ideas are usually too big....though i'd be fine with breaking it up into components and stages
05:54xsynyou need to get into the cage to really get to grips with it
05:54locks+1 on the project
05:54locksthe only problem is finding a suitable one xD
05:54ddellacostabut its' made me realize how little I do know
05:54ddellacosta*it's
05:54xsynman, me too
05:55mercwithamouthlike right now i'm still hung up on testing routes... i create problems that really aren't there...procrastination most likely
05:55mercwithamouthnot 'testing' routes but i'd like to write my api without even opening a browser...
05:56ddellacostamercwithamouth: it's totally possible, I've done that.
05:56mercwithamouthddellacosta: do tell...
05:56thegeezmercwithamouth, the emacs theme looks like this one: https://github.com/steckerhalter/grandshell-theme
05:57mercwithamouththegeez: i believe you're right! =)
05:57ddellacostamercwithamouth: I've gotta go soon but if you have a specific gist/refheap or something I'm happy to look at it. But I've definitely written and tested routes via clojure.test and through the repl without opening a browser. ring mock (https://github.com/weavejester/ring-mock) helps.
05:58mercwithamouthddellacosta: hmm i'm going to start something from scratch and i'll set up a repository...going to be on...tonight/tomorrow morning?
05:59ddellacostamercwithamouth: er, your late night/early morning definitely--I'm 13 hours ahead of you I think
06:00thegeezmercwithamouth, and kerodon for testing ring routes/api: https://github.com/xeqi/kerodon (or peridot for more low level https://github.com/xeqi/peridot )
06:00xsynwhere are you?
06:00mercwithamouthok...i'll be on
06:00ddellacostathegeez: have you used that much? Looks super handy
06:00ddellacostaxsyn: assuming you were asking me, I'm in Japan. mercwithamouth is on the East Coast of the U.S. I believe?
06:01mercwithamouththegeez: well...by testing i mean calling a given method/route from either the repl or curl <-- i really need to get comfortable with using curl
06:01mercwithamouthddellacosta: yup
06:01xsynGot to love IRC!
06:01ddellacostaxsyn: :-)
06:02ddellacostagotta go folks, take care
06:02magopianlocks: yeah, need to find a suitable toy project to work on
06:02mercwithamouthttyl
06:03magopiani've known for a very long time now that writing _simple_ code is very difficult
06:03thegeezddellacosta, kerodon is indeed super handy. I've used it here: https://github.com/thegeez/clj-crud/blob/master/test/clj_crud/accounts_test.clj
06:03lockswriting simple anything is pretty hard
06:03magopianlocks: exactly
06:03locksor there'd be more hemingways out there ;P
06:04mercwithamouthahhh and i see...kerodon WOULD be very helpful
06:04locksI started an engine for a card game that's played in portugal
06:05mercwithamouthmost of my experience comes from rails so...i'm familiar with capybara =P
06:06mercwithamouthnow how awesome is working through SICP going to make me?
06:08xsyn(if (= 'confused' 'awesome) (inc mercwithamouth))
06:09xsynpretty awesome though
06:09xsynI still haven't gotten through chapter 2
06:09xsynbut that's my bad ahbits
06:09xsynhabits*
06:09magopianxsyn: you reckon it's really worth the read?
06:10mercwithamouthhehheh...i think it's going to be my 'summer read'. though i have all of the clojure books as well
06:11locksI have joy of clojure
06:12xsynmagopian: I'm only two chapters in, and it's been hard work because I don't have a maths background
06:12xsynbut it helped me understand functional programming
06:12xsynand composition
06:12xsynlike, I 'got it'
06:13mercwithamouthxsyn: hmm that much within jus two chapters?
06:13mercwithamouth<- no math background either...which i'm hoping this books helps give me a guideline for what to learn as far as thats concerned as well
06:13xsyndude, it goes at a pretty fast pace
06:13locksthere's always the videos
06:14magopianvideos?
06:14lockshttp://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/
06:15magopianthere's worth the view?
06:15magopian(it's so "fun" to see that they still apply even though they're so old)
06:16locksyes
06:16locksthey're really good
06:16locksand frightening
06:17lockshe teaches lisp in about 5mins and then trudges on
06:17magopianOo
06:17xsynwizards...heh
06:18magopiando you know if it's possible to download those videos? I hate the flash player
06:18magopianah, there's a "download this video" link ;)
06:19mercwithamouthhttps://www.youtube.com/results?search_query=structure+and+interpretation+of+computer+programs
06:19mercwithamouthor that...
07:22mpenetgfredericks: ping
07:35ssiderisme tis ekloges ti egine?
07:36mpenet(inc gfredericks)
07:36lazybot⇒ 57
07:44gfredericksamalloy_: aw man sorries
07:49szymanowskihi, how can i rename a file from clojure?
07:52mpenet2 horrible ways: 1 use java File, 2 use clojure.java.shell/sh
07:53szymanowskiyou mean that I should not use clojure for that?
07:53mpenetit's clojure
07:53mpenetuse java File, it's the clean way to do it I guess
07:54szymanowskiok I will look at this
07:54szymanowskia snippet maybe? ;)
07:54broquaintszymanowski: Alternatively use fs - http://raynes.github.io/fs/me.raynes.fs.html#var-rename
07:55broquaintWhich provides some simple abstractions on top of the java APIs.
07:55clgvsynfinatic: http://stackoverflow.com/questions/1158777/renaming-a-file-using-java => (doto (File. "old.txt") (.renameTo (File. "new.txt")))
07:55szymanowskiyes looks great
07:56clgvszymanowski: ^^
07:57clgvhmm maybe you want to return the new file, though
07:57szymanowski:) thank you mpenet, broquaint and clgv
08:02magopianjust started watching the very first video on SICP and in the very first few minutes it's already mind blowing;)
08:19scape_video?
08:19scape_only known of the book
08:19beamsohttp://www.youtube.com/watch?v=2Op3QLzMgSY
08:20scape_wow, nice
08:20scape_thanks
08:20scape_old school :)
08:20beamsonot a problem
08:20beamsoi liked it being old skool, actually.
08:20scape_yea, i think i will too
08:20beamsodude with boards and chalk
08:44scape_\away idle
10:15szymanowskiwhat is the simplest way to get a seq of File given a directory path?
10:15szymanowskiplease :)
10:16ohpauleezfile-seq
10:17ohpauleezOr of the lines, with line-seq
10:18ohpauleezszymanowski: ^
10:18zerokarmalefta seq of files? like a directory listing?
10:18szymanowskiyes a seq of all files within a dir
10:18ohpauleezYeah, if you File object is a directory, file-seq will give you the files
10:19ohpauleezhttp://clojuredocs.org/clojure_core/clojure.core/file-seq
10:19szymanowskiho great
10:19szymanowskidoesn't know that File obj can represent a dir
10:19szymanowskithank you
10:19ohpauleezYou're very welcome - happy to help
10:21arrdemhappy gsoc day 0....
10:22TimMc_zero-day?
10:23hyPiRionoh wat, gsoc already started today?
10:23hyPiRionThat's early. Or perhaps uni is ending late over here.
10:24arrdemI've had a week and a bit off from uni, but I have friends who are still in
10:24zerokarmalefty
10:32Bronsahere in Italy uni ends in a month
10:34hyPiRion3 weeks here
10:34hyPiRionroughly
11:22berdarioHi, I don't know if it's foolish... but I'm trying to parse a clojure file (which is hopefully valid edn, but I'll make sure about it later) with clojure.edn
11:22berdariosince "There is no enclosing element at the top level. Thus edn is suitable for streaming and interactive applications." I expected to get back a seq of clojure forms
11:22berdarioinstead, I just get back the first form (ns ...)
11:25cbpwrap your file in a vector
11:25gfredericksor call read repeatedly
11:25arrdemcalling read until it returns nil is better
11:25arrdemimo
11:25berdarioI agree
11:25berdariothis works inside clojure
11:25berdariobut apparently I don't have a read fn in the edn implementation I was planning to use :/
11:26cbpberdario: what do you mean? clojure.edn/read
11:26gfredericks,(doc read)
11:26clojurebot"([] [stream] [stream eof-error? eof-value] [stream eof-error? eof-value recursive?]); Reads the next object from stream, which must be an instance of java.io.PushbackReader or some derivee. stream defaults to the current value of *in*. Note that read can execute code (controlled by *read-eval*), and as such should be used only with trusted sources. For data structure interop use clojure.edn/read"
11:26gfredericksarrdem: nil might be one of the things read :)
11:26arrdemgfredericks: that's core/read
11:26gfredericksyeah but edn/read is just copypasta
11:26arrdemgfredericks: har har. end of file error then.
11:27gfredericks(let [sentinel (Object.)] (loop ... using sentinel as eof-value ...))
11:27arrdemthat edn doesn't have a *read-eval* free reader is silly.
11:27berdariocbp: I'm trying to read clojure code from python :)
11:27arrdemberdario: clojure code != edn
11:28arrdemberdario: some important grammar and token differences.
11:28berdarioarrdem: I know, but if the clojure code will turn out not to be edn I will just split out the part that is valid edn
11:28gfredericksI want to make an edn writer
11:28cbpedn/read is copy pasta? i thought it had
11:28arrdemgfredericks: please do...
11:28cbp*puts on sunglasses* security
11:29Bronsaarrdem: what do you mean with "no *read-eval* free reader" ?
11:29gfredericksarrdem: I wonder how tricky it would be to write a generic version that can do both edn and json
11:30arrdemBronsa: your reader :P
11:31arrdemgfredericks: build a what? a multireader?
11:31Bronsaarrdem: I still don't understand :/ clojure.edn doesn't need/use *read-eval*
11:32gfredericksarrdem: no a multiwriter
11:32arrdemgfredericks: an EDN writer would be nice but we already have plenty of good json writers so... why?
11:32gfredericksarrdem: afaik none of these are locally extensible
11:33gfrederickswhich has caused me pain at least twice
11:33arrdemBronsa: right. but if you call clojure.core/read-string on some nominally edn string and forget to falsify read-eval then you're enabling malicious EDN to run code through read-eval on your machine.
11:33gfredericksarrdem: why would you call clojure.core/read-string instead of clojure.edn/read-string?
11:34arrdem,(require '[clojure.edn :as edn])
11:34clojurebotnil
11:34arrdem,(source edn/read-string)
11:34clojurebotSource not found\n
11:34arrdemYOU LIE
11:35cbp$source clojure.edn/read-string
11:35lazybotSource not found.
11:35cbpwelp
11:35arrdemoh good we have clojure.lang.EdnReader.java which isn't silly.
11:37gfredericksthat was the main outcome of the reader-security brouhaha
11:38gfredericks"the reader is not a serialization tool, here use this instead"
11:38arrdemI'm totally cool with that.
11:38gfredericks^ paraphrasing three days' worth of people yelling at each other
11:39brunovHey guys. I'm struggling with passing around "opts map" between functions with signatures like: (defn foo [& {:as opts}]). If I have two of these with identical signatures, foo and bar, and foo calls bar, is there an easy(™) way to do the call to bar?
11:40gfredericksmapply
11:40arrdembrunov: the easy way is to rework your functions to take a leading single configuration map argument that you can just pass through.
11:41gfrederickshttps://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.clj#L345
11:41gfredericks^ where I use mapply from
11:41arrdemgfredericks: nice one!
11:41gfredericksI'm not sure they released that yet but I pushed up a "fork" that has it
11:42brunovgfredericks: this looks promising, thanks!
11:43gfredericksnp
11:43brunovhow do you karmabump someone around here?
11:43gfredericks(inc someone)
11:43lazybot⇒ 1
11:43arrdem(inc <username>)
11:43lazybot⇒ 1
11:43brunov(inc gfrederick)
11:43lazybot⇒ 1
11:43gfredericksmy first karma!
11:43brunovcool. I thought you needed some funky prefix
11:43brunovhaha
11:43arrdem(inc gfredericks)
11:43lazybot⇒ 58
11:43arrdem(dec gfrederick)
11:43lazybot⇒ 0
11:43bbloom$karma <username>
11:43lazybot<username> has karma 1.
11:43brunovoops
11:43TimMcgfredericks: Not yours, that's your evil twin gfrederick.
11:43cbp$karma so
11:43lazybotso has karma -9.
11:44brunov(inc arrdem)
11:44lazybot⇒ 27
11:44arrdem(dec so)
11:44lazybot⇒ -10
11:45ohpauleezI think we did that one day way back in the early days of two bots
11:45arrdemI may yet add my own bot to the mix just so that I can build a state machine out of bot replies...
11:46cbponly if it has a tip function
11:46arrdemcbp: it'll come with dogetip :P
11:46arrdemtechnomancy: your css is horked
11:47hyPiRionarrdem: he knows
11:47arrdemhyPiRion: I don't blame him for not fixing it, just thought I'd make sure
11:48arrdem,`(~@nil)
11:48clojurebotnil
11:49arrdem,`[:foo :bar ~@(:foo nil)]
11:49clojurebot[:foo :bar]
11:51TimMcarrdem: hyPiRion got them to do a cycle-2 quine, and that's why lazybot now ignores clojurebot.
11:52hyPiRionarrdem: http://clojure-log.n01se.net/date/2012-12-17.html#22:30
11:53arrdemhyPiRion: haha nicely done
11:55hyPiRionty
11:56hyPiRionTimMc: Did I tell you about my new, probably impossible, challenge? Making a Piet quine.
11:56hyPiRionI wonder how you go forward with that.
11:56TimMcPrinting out some encoding of a Piet program?
11:57hyPiRionyeah, you can simplify it to some extent
11:57hyPiRionsay, print ints representing the colours
11:57TimMcBonus points to print out in GIF format.
11:57hyPiRionyeah
11:58hyPiRionor compressed png. Just need to encode zlib in the picture somehow
11:58TimMcThere *is* a Piet compiler now, you know.
11:59hyPiRionyeah, some guy made an LLVM-based optimiser for it
11:59hyPiRionhttp://allanwirth.com/piet/llvm-piet.html - there we go
12:01TimMchyPiRion: No, I mean the other direction: Piet as target.
12:03hyPiRionTimMc: oh what, link please
12:03TimMcI'm still waiting on self-modifying Piet (using Logo commands, obviously.)
12:03arrdemturtle graphics fwt
12:03TimMcAn assembler: http://www.toothycat.net/wiki/wiki.pl?MoonShadow/Piet
12:04hyPiRionI'll just wait on webyrd to make a quine generator for it
12:04TimMc:-)
12:04ystaelTimMc: for a better challenge: The only available self modification is to place a colored cel filter over part of the code or shine a colored light onto it. The minimum filter radius is 4px. The minimum spotlight radius is 8px.
12:05TimMc:-D
12:06hyPiRionhah
12:06hyPiRionThis is quickly getting out of hand
12:07TimMcI eagerly await the first self-modifying LogoPiet virus.
12:08TimMc(Those malware analysis folks need something fun to do, right?)
12:09TimMc"And in recent news, Brian Krebs has quit the security field and taken up carpentry."
12:09hyPiRionheh
12:25mr-foobarcopyright help, I am lifting example code from eplv1 codebase. what is the best way to refer to it in my repo ?
12:27adsiscohttps://www.irccloud.com/pastebin/WsnKQpFk
12:27adsiscohow to get the function to resolve i and j?
12:30gfredericksadsisco: i and j should work fine there
12:30gfrederickswhat's the exact error msg?
12:31hyPiRionyeah, would be surprised if that doesn't work.
12:33adsiscojust figured it out, the parse-float function ain't working
12:33adsiscohttps://www.irccloud.com/pastebin/Nuvr3msy
12:33adsiscowhats the equivalent of Integer. for float?
12:34adsiscoparse-int works perfectly for me
12:34adsiscobut not the other
12:34arrdemDouble/parseDouble?
12:34gfrederickscheck what re-find returns when you call it with your arg
12:34arrdemfloats are a sad datatype
12:34hyPiRionadsisco: Double. or Double/parseDouble
12:34adsiscolol, double is an overkill for something with 2 decimal place max
12:35gfredericksit's standard
12:35hyPiRionPrefer parseDouble for performance
12:35adsiscoalright letme switch
12:35gfredericksclojure will prollably turn your float into a double anyhow
12:35arrdemyeah. clojure defaults to using doubles, ratios and longs.
12:35gfredericks,(def f (float 3.14))
12:35clojurebot#'sandbox/f
12:35gfredericks,(type f)
12:35clojurebotjava.lang.Float
12:35gfredericks,(type (* 2 f))
12:35clojurebotjava.lang.Double
12:36arrdemgfredericks: some of that is the clojure.lang.Number.multiply() signature tho..
12:36gfredericksarrdem: okay?
12:36gfredericks,(type (* f f))
12:36clojurebotjava.lang.Double
12:37arrdemnevermind, I thought that java.lang.Number.multiply was λ Number → Number → Double for some reason not \
12:37kzargfredericks: I got the heap space to increase in the end by setting an environment variable. No idea why profiles.clj stuff wasn't working
12:37arrdembut it's λ Number → Number → Number
12:38gfrederickskzar: a leiningen variable?
12:38kzarI think _JAVA_OPTIONS did it in the end
12:38kzarthe lein ones didn't work
12:39gfredericksyeah I think they apply to leiningen's jvm rather than the project jvm
12:40kzarDoes anyone know how you do a bredth first tree traversal (I'm recording the path to a solution) when you have an infinite tree and therefore can't put successive child nodes into a queue? (I've tried just allocating a heap space of like 14 gig but still no dice)
12:42hyPiRionkzar: you can use iterative deepening DFS instead
12:42hyPiRionhttp://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search
12:42kzaroo thanks
12:43arrdemBronsa: have you tried replacing clojure.core/load with t.[ae].jvm?
12:44Bronsaarrdem: yep
12:45arrdemBronsa: how'd it go? I haven't tried myself yet, just finished digging through lein and clojure core to verify that changing load is all that needs to happen to switch compilers.
12:46Bronsaarrdem: i loaded clojure.core with that, and I believe I tried it on core.match and core.rrb-vector aswell
12:47mr-foobarabout to push to npm, basically runs lein commands from npm .. https://github.com/harsha-mudi/lein-node is the Copyright Notices sufficient ?
12:48Bronsaarrdem: right now te only issue I'm aware of with t.e.j is the one related to TANAL-24
12:50mdrogalisbbloom: Learned a new phrase from you. Second system effect. I didn't know there was a term for that :)
12:51bbloommdrogalis: i'm sure you've experienced though, right? :-)
12:51mdrogalisbbloom: Yes :)
12:54arrdemah The Mythical Man Month...
12:55arrdemBronsa: sweet! next on the list is reading in to t.e.jvm, I'll let you know if I find anything.
13:34ambrosebsbbloom: sheesh, any other haskellers on twitter that I should pre-emptively block?
13:36arrdem+1 "angry haskellers list"
13:36cbpthe whole bytemyapp following list :-P
13:36arrdemcbp: hehe
13:37technomancycbp: except bitemyapi
13:38arrdemtechnomancy: I still owe you a bot for that..
13:42sdegutisIs there a cleaner way to say "give me the value of the first argument" than this? (fn [% & _] %)
13:42technomancy(comp first list) maybe
13:43technomancymore chars, fewer tokens
13:43sdegutisHmm for some reason I thought that wouldn't work as a variadic function, but sure enough it does.
13:44forzajuve!LIST
13:44forzajuveCIAO
13:44forzajuve!LIST
13:44forzajuve!list
13:45sdegutisI should probably be using polymorphism a little more fully.
13:52sdegutisOr maybe I should ditch defmulti and just use case statements.
13:57bbloomambrosebs: that guy was crazy, right?
13:58bbloomi should publish my block list somewhere :-P
13:58bbloomat one point i had considered a "startup" that was just a crowd sourced block list
13:58bbloomso i could autoblock people across all services, even those i hadn't signed up for yet... forever
13:59ambrosebsbbloom: really strange way to wake up reading that thread
13:59ambrosebsnot sure what happened
13:59ambrosebs:)
13:59bbloom:shrug:
14:01adsiscohow do i turn "hi there test" to "hi+there+test"? i would first (split string #"\s+"), how do i concat them neatly? i think i can do something like a fold?
14:02brunovadsisco: string/join may be helpful
14:02brunovor just replace on the string
14:02adsiscooh yea, replace would be easy!
14:02adsiscothanks
14:03brunovnp
14:22Guest33471im currently going through the amazonica docs and trying to generate a key-pair for client side s3 encryption, i can't seem to find KeyPairGenerator
14:22daniel___is this a java class that should be generally available?
14:22daniel___or am i missing an import?
14:24dbaschit’s java.security.KeyPairGenerator
14:24amalloydaniel___: http://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html
14:24amalloyspecifically, you probably want http://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html#getInstance(java.lang.String) or something
14:25daniel___amalloy, yes i do
14:25dbasch,(java.security.KeyPairGenerator/getInstance "RSA")
14:25clojurebot#<ExceptionInInitializerError java.lang.ExceptionInInitializerError>
14:25amalloy&(java.security.KeyPairGenerator/getInstance "RSA")
14:25lazybotjava.lang.SecurityException: You tripped the alarm! clojail.testers.ClojailWrapper@17b15f3 is bad!
14:26amalloyhuh
14:27amalloyah. lazybot won't let you touch java.security.*
14:27dbaschreasonable
14:27amalloyyeah, indeed so; i just don't remember doing that
14:28daniel___anyway, thanks for the pointers
14:40devnCan you do this in a for? (for [x xs :let [[ys _] x] y ys :let [[q r] y] ...)?
14:42arrdemdevn: yup
14:42devnyeah i just tested it
14:42devncolor me surprised
14:43arrdemwell you're erc-color'd orange for what it's worth
14:44devnyou're yellow in my irssi
14:44llasramarrdem: and you're bluuuue
14:44amalloydevn: why would you not be able to?
14:44devn...coward
14:44devnamalloy: i just haven't ever done it.
14:44devnhaven't seen it done
14:50martinklepschI found it delightfully simple when deploying my first uberjar. now I want to store it in S3 but putting the uberjar there is not something that seems very common. how do other people hand that scenario? should deploy the regular jar instead and do some stuff in the server?
14:52hiredmanuberjar and then use s3cmd to upload it to s3
14:52llasrammartinklepsch: Are you trying to deploy the uberjar just for arbitrary retrieval, or as in an S3-hosted Maven artifact repository?
14:53martinklepscharbitrary retrieval
14:53martinklepschhiredman, thought that maybe something outside of leiningen might be the easiest way
14:53llasramYeah, then ditto hiredman
14:58someben42Hi Clojure peeps. Is there are verbose mode for lein to debug how it is failing to find tests when I do "$ lein clean; lein test"?
14:59hiredmansomeben42: are your tests in test/ ?
14:59someben42Yup, in test/project-name/core_test.clj
14:59llasramsomeben42: And if the are, do their namespaces match their file paths?
15:00llasrame.g. project-name.core-test <-> test/project_name/core_test.clj
15:01someben42Yup, "(ns skream.core-test [:require..." is at the top of "test/skream/core_test.clj"
15:01someben42(Project is called "skream", abbreviation for "sketching & streaming lib")
15:02llasramsomeben42: And you don't have any files which accidentally duplicate the test namespace?
15:02someben42Hmm.
15:02llasramsomeben42: Oh, neat -- like HLL, count-min, etc?
15:05someben42Yup, exactly like HLL, count-min, etc. :)
15:05someben42https://github.com/someben/skream
15:06someben42Project hierarchy is a mess for now, that is why I am trying to get "lein test" to play nice.
15:07radixcan anyone point me at some clojure code that talks to e.g. an HTTP REST API but still maintains a largely pure-FP design?
15:07someben42radix -- talks TO a REST, or IS a REST?
15:08radixsomeben42: client, talking TO a REST
15:08someben42I'm no help. The other side I do FPishly.
15:08radixI am trying to figure out a good way to separate my IO from everything else in a nice way, to help with testing, or to allow users to replace the IO with their own strategies
15:09arrdemis it ring with the request standard format?
15:09radixand so I'm thinking of stuff like (get-twitter-followers "radix") should return an introspectable value that describes the HTTP request to be performed, but doesn't perform it itself
15:09arrdemradix: right. there are existing clients that allow for this. I think.
15:09radixbut then I need to figure out how to do *post*-request processing, and how/if to bind the description of what to do with a response to the request
15:10radixlike, say you want to parse the JSON response and convert it to something a bit more nice
15:10radixI could just do (process-twitter-followers-response (do-io (get-twitter-followers "radix"))), but that's a bit verbose
15:11radix"do-io!", of course ;-)
15:11radixso maybe get-twitter-followers could encode the work to be done with the response in its return value, and do-io! could invoke that for you automatically to make it a bit nicer
15:12radixjust some thoughts I'm juggling
15:12radixarrdem: do you have an idea of which?
15:14arrdemradix: I think that http-kit and clj-http both have internal request formats that are well structured and documented, but neither allows you to say anything about how to process the results of a query.
15:14someben42llasram -- just grep for the word "test" in the whole hierarchy, and no surprises. So I do not think the namespace is getting stomped.
15:16radixarrdem: ok. something I'll continue to consider.
15:16lemonodorradix: i would write get-twitter-followers so that it calls build-http-request, do-io and process-twitter-folllowers-response. then it’s a convenient function for users, and most of the utility functions can be tested in isolation, but if someone really wants to do something different, they can write their own code that calls build-http-request, do-my-weird-io, process-twitter-followers-response.
15:17radixhmm.
15:17radixyeah, could be
15:17lemonodorthat is, i think there’s a point of diminishing returns in accepting higher order functions and achieving pure FP.
15:17lemonodori mean, we all use defn.
15:17radixlemonodor: well, I agree
15:18someben42My entire app is just lambdas. A stack of lambdas all the way down.
15:18radixlemonodor: but I will point out the qualitative difference with defn is that it basically builds "startup" state, instead of runtime state
15:18lemonodorradix: true
15:18arrdemI'm with lemonodor here. I've got a couple libraries that just wrap REST interfaces and I don't (as a user) really care about what requests have to happen, I just want to be able to pull data out which is best served by doing the requests and processing in the API.
15:19radixso, yeah, my most immediate concern is one of internal factoring to enable ease of unit testing
15:19radixI do have kind of an eye on a larger ecosystem concern, though
15:20radixright now the vast majority of clojure libraries that do this kind of stuff are inflexible about replacing the way IO is done
15:22arrdemI mean... you could write a request generator API, it's just not useful without some way to nicely wrap in doing requests however the user wants to do them. we don't really have a parametric module/instance system so this is an open problem.
15:22arrdemjust don't "solve" it with a dynamic var please :D
15:22radixheh heh
15:22sdegutisI just made two.
15:23radixarrdem: so, yeah, I don't think just parameterizing the do-io is even good enough
15:23radixif you want to either use synchronous or asynchronous IO, you can't just call (do-io) and expect a meaningful result, for example
15:23radixand yes you will never find me using dynamic vars ;P
15:25arrdemmy gut says that what this really comes down to is that we don't have a way to express monad-bind :P 'cause all this processing is really just composing (binding) functions over an input which happens to be a request and executing/resolving code.
15:34radixyeah, haskell is really tickling the back of my brain while I think of this stuff, but I don't really know much about it
15:35cbpradix: maybe get-twitter-followers can attach a queue of operations to do next as metadata?
15:36arrdemyeah having a way to bind "callbacks" on the request before it's sent to a request resolver is probably the only way to pull this off.
15:41radixyeah, kinda like Deferreds
15:41radixbut a little bit inside-out
15:42stuartsierracore.async channels?
15:42radixanyway, this has been quite helpful, thanks for the ping-pong :)
15:42ohpauleezYeah, why not just put a channel on a channel?
15:43ohpauleezand then your "bind" is just putting a value on the inner value channel
15:43radixI should learn more about those :)
15:43kzarAnother dumb question, how could I do something like this except with a dynamic number of ranges instead of just two?
15:44kzar,(for [a (range 3) b (range 3)] [a b])
15:44clojurebot([0 0] [0 1] [0 2] [1 0] [1 1] ...)
15:44ohpauleezOr, better yet, just write all your ops as functions, and in a small and tight go-block, do your interactions, where the last statement is the value you want
15:44ohpauleezthe go will return a channel, and you can optionally block on it
15:45joegallokzar: you could (apply map vector ...) i think
15:45joegallo,(apply map vector [(range 1 3) (range 3 5) (range 5 7)])
15:45clojurebot([1 3 5] [2 4 6])
15:46ohpauleezthat will only give him the first of all, the second of all, the third of all
15:46ohpauleeznot the iterations
15:46ohpauleezI thought the same thing initially
15:46joegalloah yes, quite right!
15:49kzarhmm
15:50kzarOH and another thing, I need it to be a lazy sequence
15:51amalloykzar: i mean, that's in clojure.math.combinatorics, probably called cartesian-product
15:52amalloyyou can also write it yourself; it's not too bad as a recursive function
15:52{blake}Running "lein midje :autotest", midje notices when I change my source file, but then says "No facts were checked. Is that what you wanted?" (a seriously irritating error message). How fix?
15:52kzaramalloy: Oh looks like you wrote about it on stack overflow http://stackoverflow.com/questions/18246549/cartesian-product-in-clojure
15:53amalloyoh, that's good. i was just about to rewrite it
15:53amalloybut my answer there is more thorough
16:04ff0066any users of schema here?
16:05kenrestivo{blake}: um, add some facts? (i'm guessing you're using midje)
16:07rasmustoI remember writing a macro that expanded to (for [a__blah a, b__blah b ...] [a b]), I think combinatorics is better though
16:07{blake}kenrestivo: Yep. I'm trying think of some relevant facts. I've forked the iloveponies project but haven't touched the code yet...well, that's probably the clue right there. Something in the configuration.
16:08someben42Fixed my "lein test" problem. Some combination of idiomatic test/ hierarchy naming and "lein clean" did it, wish I knew what it was but hey.
16:08sdegutisHo there!
16:08sdegutisI have a curious finding.
16:10sdegutisObserve:
16:10sdegutis,(do (def ^:dynamic lang) (let [f (constantly lang)] (binding [lang :english] (f))))
16:10clojurebot#<Unbound Unbound: #'sandbox/lang>
16:11sdegutisIs this because (constantly) captures the current value of lang, as opposed to the var itself, though it be unbound?
16:12magopianustunozgur: hey ;) I'm Mathieu, we talked about clojure (and are supposed to switch to clojure right?) at djangocon, during an evening meal ;)
16:12magopianustunozgur: not sure how/when to switch for the moment though ;) (I'm going through the SICP videos, they rock)
16:17amalloysdegutis: constantly necessarily does evaluate its input right away, and save that
16:17amalloyie, (constantly x) is different from (fn [] x) if x is something that can be mutated
16:17sdegutisIn which case, if I want it to evaluate a re-bound dynamic var, must I capture it via (fn [] x)?
16:18sdegutisI like the property of (constantly) where it takes any number of args. This cannot be emulated as cleanly with a plain closure.
16:19amalloywell, of course it can
16:19amalloy(fn [& args] x)
16:19amalloy#(do %& x)
16:20sdegutisThe second one "evaluates" the items though.
16:20sdegutisAnyway thanks. I'll do that.
16:24amalloysdegutis: huh? what about evaluating?
16:24amalloy(fn [& args] x) and #(do %& x) are identical in every way
16:24sdegutisamalloy: #(do %& x) expands to (fn [& args] (do args x))
16:25amalloyyes, which is identical to (fn [& args] x)
16:25amalloy"evaluating" a seq for side effects doesn't do anything
16:25amalloyit was already evaluated when you passed it to the function
16:26sdegutisOkay.
16:28hyPiRion,(apply (fn [& args] 10) (map #(println %) (range 5)))
16:28clojurebot0\n1\n2\n3\n4\n10
16:28hyPiRionIn that case though, apply does the evaluation, not the function
16:32amalloygtrak: you around? no.disassemble just started failing for me, after working for many months and no change i'm aware of making. i have [lein-nodisassemble "0.1.3"], and typing (use 'no-disassemble) produced https://www.refheap.com/40adc6d31fdaf6d1e6ea62a9c
16:32gtrakhrm...
16:32gtrakwhoa..
16:32gtrakI'm suspecting some maven artifact shenanigans.
16:34amalloyseems plausible. should i nuke (some part of) my .m2 or something?
16:34gtrakI think so. I downloaded clean artifacts just now, and it worked fine.
16:34gtrakjust kill org/eclipse
16:35gtrakthey've done this before and ztellman patched it.
16:35gtrakdifferent error, though.
16:36gtrakif that doesn't work, I might have to update to a newer version of eclipse-jdt
16:37kzarIs there a way to check if a number is divisible by another number and get the result at the same time?
16:38amalloykzar: use / and check if the result is an integer or a ratio?
16:39gtrak0.00000000000004
16:39sdegutisI am seriously running into dependency circles right now.
16:40kzaramalloy: Would it be better to map (mod % X) on a bunch of numbers, then for the one that's zero divide the number by X or would it be better to map (\ % X) on them all and filter by integer type?
16:40dbaschyou could also do (juxt quot rem)
16:40kzar(By better I mean faster / idiomatic I guess)
16:40gtraksdegutis=[r*cos(theta) rsin(theta)]
16:40gtrakerr wait, that's a line.
16:40amalloykzar: as so often is the case, faster/idiomatic are opposing forces. you can't ask for both of them
16:41gtraktry that
16:41gtraktake the cosine.. :-)
16:41sdegutisgtrak: doesn't work
16:41kzaramalloy: Heh shucks. Well how do I check if something's an integer / ratio?
16:42amalloy&(doc integer?)
16:42lazybot⇒ "([n]); Returns true if n is an integer"
16:42amalloy&(doc ratio?)
16:42lazybot⇒ "([n]); Returns true if n is a Ratio"
16:42kzarlol whoops
16:42gtrakkzar: well, that will tell you the type, that won't tell you if 0.0 is an integer.
16:42hyPiRion,(ratio? 1/1)
16:42clojurebotfalse
16:42hyPiRion=(
16:42amalloyit's okay, i was just guessing
16:42gtrak,(integer? 1.)
16:42clojurebotfalse
16:42amalloyhyPiRion: well, 1/1 reads as 1, i think
16:43gtrakyou said 'number' before, so you need to be more specific.
16:43kzarI think just filtering by integer? is going to be fine in my case
16:43kzarsorry for ambiguous question
16:43amalloygtrak: floats are never divisible by anything. they're awful
16:43hyPiRionamalloy: all ratios are reduced, yes.
16:44amalloygtrak: after destroying .m2/org/eclipse, and running `lein clean` on my AOTed project, i still have the same issue
16:44amalloylet me try it in some other project
16:44hyPiRionoh nevermind, we have `rational?`.
16:44sdegutisgtrak: https://www.dropbox.com/s/w4307mnwzgxpwmg/Screen%20Shot%202014-05-19%20at%203.36.36%20PM.png
16:44gtraksdegutis: what is that?
16:44amalloyoh interesting. it works in another project. i wonder what's wrong with this one
16:44sdegutisgtrak: your equation
16:44sdegutisit dosn't work
16:45hyPiRionalthough I really really hate that denominator and numerator doesn't work on integers/longs
16:45gtrakamalloy: perhaps you have multiple classes with the same name in your classpath.
16:45gtrakat least, that's greppable.
16:45amalloyhow would i find that out?
16:46gtrakif lein-pprint won't tell you enough, you could use uberjar.
16:47technomancythere's a getResources or something method you can call on classloaders for that
16:49pbostromis there any consensus on top-level def vs. a top-level let? i.e. 1 vs 2 here: https://gist.github.com/pbostrom/3dec3394add6b3500e47 or should I just strive for case 3, even for small stuff
16:50amalloyi think strive for 3, and if it's so trivial that it's not worth doing that then the difference between 1 and 2 doesn't matter
16:50gtraktechnomancy: yea, that's how data_readers works.
16:50amalloyi guess i'd pick 2 so that it's easier to inspect the state at the repl
16:51hyPiRionpbostrom: If state really is needed, I'd do (def ^:private state (atom 0))
16:51hyPiRionstill available at repl
16:51arrdempbostrom: 1 is usually considered an antipattern, 2 and 3 are both ok, but I'd propose a 4 where the atom is an optional argument defaulting to your (def state .. )
16:52amalloyarrdem: i disagree re: (1). it's just as fine as (2)
16:52arrdemamalloy: I'd disagree with that because the atom is stowed away somewhere that isn't transparent, you've just bought yourself state that can't be introspected reasonably.
16:52hiredman1 is terrible
16:53arrdemamalloy: at least with 2 you can recover that state explicitly.
16:53FrozenlockI'd like to keep sensitive data out of my code. Is there a way to access it and use it in a 'safe' manner at runtime?
16:53arrdemFrozenlock: (read-string (slurp "seekret.edn"))
16:54pbostromthanks for the feedback, for some reason "1" has gotten a lot of traction on a project I'm working on
16:54hiredman1 makes it difficult to inspect and manipulate the atom from the repl, why do that to your self?
16:54amalloygtrak: when i uberjar it up, i don't even see one class named org.eclipse.jdt.core.util.IStackMapTableAttribute, let alone two with the same name
16:54arrdemFrozenlock: I actually have several projects where I do that :P
16:54Frozenlockarrdem: that seems too simple :-p
16:54amalloyokay, i'll back-pedal on (1). closing over an atom is a lot less pleasant than closing over something pure
16:55gtrakamalloy: very odd. Do you use a private maven-repo?
16:56amalloywell, there's a thought. yes, factual has a private repo for hosting our own stuff, which i believe also proxies to the usual suspects like clojars and central
16:56gtrakseems like that wouldn't explain why it works in the other project.
16:57pbostromI think the motivation for "1" is that it prevents you from trying to get at it from another namespace
16:58gtrakunless that project uses central, and broken doesn't.
16:58lemonodoramalloy: oh, you’re at factual? are you in LA?
17:00sdegutisWhat is the best practice to avoid this error? No method in multimethod 'foobar' for dispatch value: "test"
17:00sdegutisMust I manually specify an empty require for every file which uses defmethod?
17:00sdegutisIf so, where is generally the acceptable place to do so?
17:01sdegutisIs it common to have a "load" namespace whose purpose is to just load other namespaces?
17:01sdegutisThese are my questions. Thank you.
17:03amalloylemonodor: yes i am
17:03arrdemBronsa: Digging into your emitter at present. How do you think I/we should structure the optimized JVM emitter I'm signed on to build? part of me thinks that it belongs as part of t.e.jvm but I'm loath to build a separate emitter when really what I'm building should ultimately be visible to a user only as an emitter tuning rather than an emitter selection which would complect emission and optimization. may be worth asking tb & the dev list.
17:03lemonodorah, cool. me too. i used to work with myron ahn, though now i see he doesn’t seem to be at factual anymore.
17:03amalloyyeah, he and i did not overlap
17:04amalloyi have found and cursed some of his code, though
17:05sdegutisI am starting to remember why I tore every defmethod and defmulti out of the codebase a year ago.
17:05amalloygtrak: i think debugging this is beyond me. i don't really need no.disassemble in this project anyway, it just happened to be the one i was in when i wanted to disassemble #(do %& 1)
17:05gtrakoh, ok :-)
17:06gtrakhopefully it's just an isolated thing.
17:06bbloomsdegutis: use (:require [whatever :refer (themultimethod)])
17:06bbloomrather then (defmethod whatever/themultimethod ...)
17:06arrdembbloom: I believe that sdegutis is referring to loading namespaces defining multimethod implementations, not the multimethod itself.
17:07bbloomarrdem: oh
17:07arrdembut I may be misreading.
17:07bbloomyeah, that's a bit of a pain
17:07bbloomnamespaces != modules and the mutability of namespaces is a mixed blessing
17:08arrdemsdegutis: I think that the real answer is that to the greatest extent that you can you want to centralize your defmethods
17:08bbloomsdegutis: arrdem: i've considered what a better approach would be... whatever it is, you could probably build it with my dispatch-map library
17:08bbloomdispatch-maps are mergable
17:09sdegutisAh, now I understand why this is so hard.
17:09sdegutisI'm using multi-methods all wrong.
17:10sdegutisdefmulti and defmethod were never meant to be used in different files. Every defmethod for a given defmulti should always be in the same file as the defmulti. This is how Clojure intended it.
17:10arrdemI wouldn't go that far... see clojure.algo.generic
17:11arrdemmeajure is based entirely on extending algo.generic multimethods.
17:11technomancysdegutis: lein tasks aren't exactly like defmethods, but the idea of keeping extensible functionality under a certain namespace prefix and loading whatever nses are on the classpath has worked well for us
17:11sdegutisarrdem: That looks unrelated.
17:11technomancyyou could use bultitude to scan for everything under my.multimethod.* and require it
17:12sdegutisOkay I may do this.
17:12arrdemsdegutis: how so? the point is that meajure is a user supplied extension to a multimethod and thus a counterexample to your claim that multimethods were somehow meant to be sealed and fixed dispatch rather than user extended.
17:13sdegutisBut it sounds so hacky for just wanting to have a switch-case split out into two different files.
17:13arrdem(dec so)
17:13lazybot⇒ -11
17:13technomancy(dec so)
17:13lazybot⇒ -12
17:13sdegutisarrdem: I have no idea what you're talking about.
17:13arrdemtechnomancy: I'm just downvoting him whenever I use his name
17:13arrdems/him/*indeterminate-gender*/g
17:14sdegutisI basically just have two implementations (live.clj and test.clj) and an interface (api.clj), and I want everyone to be able to invoke the interface, but have the implementations do the work.
17:14sdegutisSurely it can't be this difficult or involved of a task?
17:14technomancysdegutis: just use a function
17:14arrdemsdegutis: go look at the jvm code backing a multimethod and then say that again.
17:14technomancyif the dispatch doesn't actually change at runtime then multimethods make no sense
17:15sdegutisOkay. I'll investigation pure functions then.
17:15arrdemwhich means you have to load _all the code_ defining dispatch values.
17:15technomancysdegutis: with-redefs in a fixture
17:15technomancyis the way to go
17:16sdegutisYeah, I've been trying to avoid that because it'll have a lot of boilerplate.
17:16sdegutisWhen the server starts up, it has to initialize them all to the "live" functions, since they default to test (so that the test suite never accidentally invokes the live version).
17:17technomancythat doesn't sound like use-fixtures
17:17technomancyoh, you're doing the opposite
17:17gtraksdegutis: defmulti and defmethod probably shouldn't be used in different files *in the same project*
17:17technomancyyeah, that sounds tedious. just replace the production version with the test version in a fixture.
17:18sdegutisAnd leave the production version "default"?
17:18gtrakunless just for normal code organization reasons. It needs to work for 'open extension' to be a thing.
17:18technomancysdegutis: yeah, the tests shouldn't have enough config to do anything "dangerous" anyway
17:18sdegutisThat's true.
17:19sdegutisThe only difficulty now will be adding global around-each functionality to Speclj, so I don't have to modify every single test file.
17:25arrdem,(doc box)
17:25clojurebotexcusez-moi
17:26arrdem,(doc condp)
17:26clojurebot"([pred expr & clauses]); Takes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, i...
17:27blrdoes anyone use clojuredocs.org? find the documentation versions capped at 1.3 a little disconcerting
17:27bbloom~clojuredocs
17:27clojurebotExcuse me?
17:28bbloomclojurebot: clojuredocs is out of date & seems to be abandoned by the maintainer
17:28clojurebot'Sea, mhuise.
17:28bbloomblr: ^^
17:28blrbbloom: ah thank you, that's a pity, looked promising
17:28technomancyblr: it's not as useful as it is in most languages since all the docs are available at any time in the repl
17:29blrtechnomancy: I continuouly forget this, need to make more use of (doc)
17:29Bronsaarrdem: re: tej, I don't have a good answer for that, I consider tej's internal interface still experimental & I'm certainly open to changing how it works if you need it
17:29noonianwhat sort of forms are readable by clojure.core/read-string but not clojure.edn/read-string (trying to understand the differences between clojail's safe-read and just using the edn reader)
17:29arrdemblr: just tweak your lein profile to inject a (use 'clojure.repl) into user on boot
17:30arrdemblr: it's been life changing :P
17:30Bronsaarrdem: right now I guess you could use the frame that's passed to every -emit call to store emit options and use that, but it's not a very open approach
17:30blrarrdem: cool thank you, I'll give that a go :)
17:31arrdemBronsa: agreed. I'll ponder and do a straw poll on clj-dev.
17:45sdegutisAll I need to do is write a bouncing function that creates a function which bounces to another function.
17:45sdegutisI'll call it "pogo-stick".
17:45gfrederickssdegutis: that's different from trampoline?
17:45arrdem(inc gfredericks)
17:45lazybot⇒ 59
17:45sdegutisgfredericks: what's trampoline?
17:45gfredericksit's pogo-stick
17:46bbloom(doc trampoline)
17:46clojurebot"([f] [f & args]); trampoline can be used to convert algorithms requiring mutual recursion without stack consumption. Calls f with supplied args, if any. If f returns a fn, calls that fn with no arguments, and continues to repeat, until the return value is not a fn, then returns that non-fn value. Note that if you want to return a fn as a final value, you must wrap it in some data structure and unpack it after trampol
17:46sdegutisAfter reading those docs, I have absolutely no idea how to use that.
17:46gfredericksI did something trampoline-like in a patch for an issue with reduce; no idea if it'll get accepted
17:46gfredericksor even recognized as a problem
17:47sdegutisNo, trampoline is completely unrelated.
17:47sdegutisSo completely unrelated.
17:47sdegutisThis is the worst suggestion ever.
17:47amalloygfredericks: eh?
17:48gfredericksamalloy: I'll dig it up
17:48gfredericksamalloy: http://dev.clojure.org/jira/browse/CLJ-1237
17:48amalloyoh yeah, that's a fun one
17:49amalloypretty cool that you found a fix
17:49Bronsa(inc gfredericks)
17:49lazybot⇒ 60
17:49bbloom,(letfn [(even? [x] (or (zero? x) (odd? (dec x)))) (odd? [x] (not (even? x)))] (even? 12))
17:49clojurebottrue
17:49bbloom,(letfn [(even? [x] (or (zero? x) (odd? (dec x)))) (odd? [x] (not (even? x)))] (even? 12000000))
17:49clojurebot#<StackOverflowError java.lang.StackOverflowError>
17:49bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 12)))
17:49clojurebotfalse
17:49bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 1200000)))
17:49clojurebotfalse
17:49bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 120000000)))
17:50clojurebotfalse
17:50gfredericksbbloom: that's a cool example
17:50amalloybbloom: (trampoline (even? x)) is a bit weird. it's fine, but i'd have written (trampoline even? x)
17:50bbloomgfredericks: it's the quintessential mutual recursion example
17:50amalloyactually, it's not fine, since then it fails for 0
17:50bbloomamalloy: ah, i forgot that trampoline does that
17:50gfredericksbbloom: I must not be up on the mutual recursion examples
17:51amalloy,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 0)))
17:51clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn>
17:51bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline even? 120000000))
17:51clojurebotfalse
17:51bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline even? 0))
17:51clojurebottrue
17:51bbloomamalloy: fixed. thanks for bug report / code golf
17:51sdegutisThis is what I'm trying to avoid:
17:51sdegutishttps://gist.github.com/sdegutis/b33022da80005fbe7914
17:52amalloybbloom: why is (trampoline even? 1200000000) false?
17:52bbloomhaha no idea
17:52bbloomwhoops
17:52gfrederickssdegutis: I think you want component & protocols
17:52bbloomamalloy: the not
17:52bbloomamalloy: duh.
17:52bbloomeh, don't really need that # anyway:
17:52bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (not (even? x)))] (trampoline even? 0))
17:52clojurebottrue
17:53bbloombetter
17:53bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (not (even? x)))] (trampoline even? 12000000))
17:53clojurebotfalse
17:53bbloomor not
17:53bbloomwow. trampoline is hard
17:53zerokarmaleftheh
17:53bbloomi hand rolled a trampoline for a variety of reasons when doing eclj & it was the source of many headaches... when you *need* TCO, there really is no substitute
17:53amalloybbloom: ah. because (even? x) returns a function, and (not (even? x)) is always false
17:54bbloomamalloy: yeah, that's the annoying bit. i had to create a propegate helper function
17:54bbloomsomething like:
17:54bbloom(propegate (event? x) not)
17:55bbloom(defn propegate [x f & args] (if (fn? x) #(apply f (x) args) (apply f x args)))
17:55bbloom,(defn propegate [x f & args] (if (fn? x) #(apply f (x) args) (apply f x args)))
17:55clojurebot#'sandbox/propegate
17:55bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (propegate (even? x) not))] (trampoline even? 12000000))
17:55clojurebotfalse
17:55bbloomsheesh, i give up at programming
17:56amalloybbloom: i let it go the first three times, but seeing propagate persistently spelled wrong is killing me
17:56bbloomhahaha you corrected me on this one other time
17:56bbloomi suck at that word
17:56bbloomapparently i also suck at programming
17:56bbloomanyway, *this* is the sort of case where i actually want a type system
17:56amalloyoh my gosh. now you've got me grepping the irc logs for propegate
17:57bbloomwhen i have some stupid type error b/c i need to jump hoops to please the solution domain
17:57bbloomamalloy: it's just me sucking at this word, nobody else
17:58amalloyoh yeah, https://gist.github.com/brandonbloom/6416765 - didn't even show up in the logs
17:59amalloygood times
18:00bbloomhaha
18:00bbloomthat's exactly the example i was talking about
18:00bbloomamalloy: oh now i remmeber the issue
18:00bbloom(x) may itself return an fn
18:00bbloomso you need like a subtrampoline
18:00bbloombut you don't want that b/c that can grow stack too
18:01bbloomeh, trampolines are shit to work with
18:01fortruceis it possible to ask lein if any of your dependencies have a newer version?
18:01amalloybbloom: trampoline is a clean solution only if your original mutually-recursive solution is tail-recursive
18:01blrfortruce: yeah, there's lein-ancient
18:01amalloyfortruce: i think uh...lein-ancient?
18:01arrdemfortruce: there's lein-ancient, but you have to install it
18:01fortrucethanks
18:04blranyone aware of a good alternative to ac-nrepl? would like autocomplete for doc, but ac-nrepl seem very slow on reasonably good hardware for some reason
18:05technomancycompany is supposed to be better than auto-complete but I haven't used it
18:05blrok, I'll give that a shot thanks technomancy
18:06blrautocomplete is just handy for api discovery.. keep me out of the evil browser :)
18:06technomancyregular completion should work without auto-complete.el
18:09blrtechnomancy: on a totally unrelated note, have you seen this? http://webcache.googleusercontent.com/search?q=cache:http://littlebits.cc/kits/synth-kit (site is down or my dns is playing up, hence the cache)
18:10blrI've ordered one for my son
18:10bbloomamalloy: even / odd can be made tail recursive... shoulda done that :-P
18:10amalloybbloom: yes, but if you do that it's not the classic example of mutual recursion
18:11amalloywhich i presumed was the point
18:12cbpblr: company works well with cider but afaik doesnt fetch docstrings
18:13blrcbp: ok, I'll have a play at any rate
18:13technomancyblr: cool. the early littlebits stuff was crazy expensive for what you got so I hadn't been paying much attention, but that looks more fun.
18:14cbpcompany also works with clojurescript if you use austin while ac doesn't
18:14blryeah, my son (9 yrs) is into electronics and music so it seemed like a no-brainer. Considerably cheaper than a real modular synth heh :)
18:14bbloomamalloy: sure i can still can be... you just need to encode the base case in to both functions
18:15blrhaven't got around to setting up austin yet, but brehaut was telling me it's rather good
18:15bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (if (zero? x) false #(even? (dec x))))] (trampoline odd? 3000000))
18:15clojurebotfalse
18:16bbloom,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (if (zero? x) false #(even? (dec x))))] (trampoline odd? 3000001))
18:16clojurebottrue
18:16bbloomamalloy: ^^
18:16fortruceanyone know of a resource that might help me understand dependencies and the use of :exclusions, I had a dependency problem bite me and I'm trying to understand :pedantic? and using :exclusions correctly
18:16amalloyindeed, that works fine
18:16amalloyalthough (if (zero? x) false foo) is (and (pos? x) foo)
18:17bbloomamalloy: sure, i was just looking at https://en.wikipedia.org/wiki/Mutual_recursion
18:17bbloomto make sure i was staying true to the quintessential-ness of my example
18:18bbloomanyway we all failed to help sdegutis
18:18sdegutisNo no, it's fine, I'm concocting some function to do this trampolining for me.
18:18bbloomsdegutis: with redefs works, but there's also the OOP-approach w/ a protocol
18:19blrfortruce: did you find the usage example in https://github.com/technomancy/leiningen/blob/master/sample.project.clj?
18:19bbloomor the less OO-ish-OO approach: an explicit map of functions
18:19bbloomsdegutis: i've felt the need for modules like this several times, tho
18:20bbloombut honestly, OOP techniques are probably most clojure-ish, despite being unclojurey :-P
18:20sdegutisI started with a map of functions actually.
18:20sdegutisAnd I'll probably end there.
18:20bbloomlots of boiler plate tho to create the interface namespace with a dynamic var & that has shortcomings too
18:21sdegutisYeah, there's just no real good solution to this.
18:21sdegutisIn another language maybe, but not Clojure.
18:21bbloomi mean... ML Modules are pretty good :-P
18:21fortruceblr: yes, I am mostly confused about which dependency collisions reported by lein deps :tree I can ignore, adding exclusions for org.clojure/clojure seems weird
18:21bbloombut yeah, this is a major short coming of clojure IMO
18:22bbloom9 times out of 10, i do the very java-y thing and make a service protocol
18:22sdegutisClojure just assumes you'll be using the simplistic defmulti, or Java polymorphism.
18:22technomancybbloom: really? replacing a function for testing is a major shortcoming?
18:23fortruceas well as: (compojure -> org.clojre/tools.macro "0.1.0") overrides (midge -> org.clojure/tools.macro "0.1.5")...doesn't this say that a lower version of tools.macro is overriding a newer one? midje might depend on newer functionality right?
18:23bbloomtechnomancy: no, the issue is that there is no mechanism for stable/lexical implicit passing mechanism
18:24bbloomwith-redefs works fine for a few functions for testing or whatever
18:25bbloomi've mentioned this several times: dynamic vs lexical and explicit vs implicit are orthogonal... luckily, extensible maps covers most of the use important cases
18:26bbloomyou can just do explicit map, which is as good as implicit after you've gotten over that first explicit map :-)
18:39arrdemclojurebot: 1d6
18:43arrdemBronsa: something tells me this shouldn't NPE... https://www.refheap.com/85650
18:52Bronsaarrdem: check https://github.com/clojure/tools.emitter.jvm/blob/master/src/main/clojure/clojure/tools/emitter/jvm.clj#L33-L35
18:53arrdemBronsa: I see it, can I trouble you for an explanation of the ^:once fn*?
18:53Bronsaarrdem: also you're not gonna get much out of that unfortunately
18:54arrdemBronsa: it's a wrapper around inc. how much do you think I wanted? :P
18:56Bronsaarrdem: no I mean, you're not gonna get the bytecode that you want, you're only gonna get the bytecode to return the fn object
18:59Bronsaarrdem: wrt the ^:once fn*: the way tej works, it needs a wrapping fn to compile things, since other than deftype/reify it's the only special form that produces a class
18:59Bronsaarrdem: that justifies, the wrapping fn*, ^:once is there for locals clearing purposes
19:00arrdemBronsa: Ah. Okay. Yeah I tweaked that so it worked and the bytecode I got was indeed fn as a value code.
19:00gfrederickscore.logic has an inc doesn't it? I feel like I remember that standing for something unexpected
19:01arrdemgfredericks: I think there's an inc⁰ definition in the Reasoned Schemer...
19:01gfredericksI had to stare at that code for a long time once upon a time
19:03gfredericksevery time I see it I think of 'increment' but I swear it meant something different
19:03amalloyinconclusive-o
19:03gfredericksman there's a lot of words that start with inc
19:03gfredericksincognito
19:04gfredericksjust glanced at all of them and I give up.
19:06amalloyyou just have to go through them incrementally
19:07amalloyyou don't want to be regarded as an incorrigible quitter, do you?
19:07Bronsa(inc amalloy)
19:07lazybot⇒ 109
19:07amalloylazybot: ?????
19:07Bronsawow.
19:07amalloyah, there he is
19:07rasmusto(inc redible)
19:07lazybot⇒ 1
19:08amalloyBronsa: best not to encourage me. if i think i can get karma from wordplay #clojure will never hear anything else from me
19:08rasmustoamalloy: 1 pun per day is fine
19:10amalloyi don't think that counts as a pun, though
19:10rasmustoI guess that's true
19:11rasmusto(run* [q] (puno q))
19:11amalloythough wikipedia seems to claim it isn't wordplay either. just a weird fixation with the prefix "inc"
19:11amalloys/weird/incomprehensible
19:12rasmustoamalloy: :)
19:12rasmustoon a more serious note, what's the quick answer as to why kanren things end with e/o ?
19:12amalloyoh my god. the wikipedia aarticle on wordplay: "We'll have to rehearse that," said the undertaker as the coffin fell out of the car.
19:12locksyou lot are incorrigible
19:13arrdemlocks: on the contrary, they are very encourageable.
19:13amalloylocks: i already did that one. you'll have to find a new word
19:13rasmustoamalloy: "Let's see" said the blind carpenter, as he picked up his ax and saw.
19:13locksoh :( I'm inconsolable now
19:13amalloynice
19:13arrdemI refuse to upvote any of this on principle, funny as it is.
19:13rasmustopr inc iple
19:14pcnWhere's the up arrow?
19:14amalloygood on you. don't inculcate a habit like this, arrdem
19:14lockssomething something nil punning
19:17amalloyrasmusto: i forget what e and o come from. i recall that -o is supposed to mean "relational"
19:18TravisDThis is off topic, but why is sdegutis booting everyone from #clojure-social?
19:18amalloymaybe they're being antisocial
19:18locksrasmusto: they explain it at the start of one of the videos
19:18gtrakhuh, turns out #clojure-offtopic was registered in 2010 by Raynes.
19:18arrdemTravisD: he's on a mood today and isn't taking it well
19:19gtrakTravisD: I suggest we stop depending on him.
19:19arrdemgtrak: good, lets take the party over there
19:19gtrakbut I liked the idea of the channel at any rate.
19:19TravisDYeah, it should exist.
19:19arrdemRaynes: pls can have ops?
19:19TravisDanyways, I was just wondering if there was some administrative reason. I'll check back on it tomorrow
19:19TravisDthanks
19:21turbofailperhaps he's feeling incontinent
19:22locksinconspicuous to say the least
19:22amalloythis whole discussion is getting incoherent
19:23locksdoes anyone know what happened to pedestal's site?
19:24ohpauleezlocks: There was a message on the mailing list
19:24ohpauleezthe docs are now being maintained in the repo
19:24ohpauleezalongside the code, to keep them more in sync
19:24TravisDFor anyone wondering, #clojure-offtopic has a few of us in it
19:24locksohpauleez: oh
19:24locksohpauleez: do you happen to know of any video/tutorial thingies?
19:24ohpauleezat a later release (like 0.3.2 maybe), we'll restore the site with some new stuff
19:25ohpauleezlocks: I do, You should see Ryan's screencast, let me fetch you a link
19:25{blake}TravisD: Is it inclusive?
19:25sdegutisSolved the multi-method problem. All I had to do was create a "load" namespace that required all the implementations. Now I can keep them separate.
19:25arrdem{blake}: even of those with irritating characters in their names!
19:25TravisD{blake}: Seems pretty inclusive
19:26sdegutisI liked the idea of with-redefs or alter-var-root, but it would be more boilerplate that way.
19:26ohpauleezlocks: Try this - http://www.oreilly.com/pub/e/3039
19:26arrdem\nick λ
19:26{blake}arrdem, TravisD: Seems sorta inchoate...
19:26locksohpauleez: much obliged :)
19:26ohpauleezhappy to help!
19:27ohpauleezPedestal has gotten some pretty exciting changes recently, with some interesting ones in the pipeline
19:28TravisD{blake}: Pfft, it's 4 years old. Registered in 2010
19:28locksthe ideas seem pretty exciting, but as a noobie it's hard to wrap my head around them
19:29sdegutisTravisD: #clojure-social is closed for repairs
19:29locksohpauleez: the webcast covers said changes?
19:29cmwelshis lein-figwheel a good plugin for interactive clojurescript development?
19:29sdegutisalso the residents of #clojure-social can't afford the repairs, so it will never be repaired
19:29TravisDsdegutis: Ah, so it's gone forever? :(
19:30sdegutissure why not
19:30ohpauleezHere's the short list: You write your functions that handle request (just like you would with Ring). You write literal data for routes (or generate it, or read it in from a file). If your endpoint is a core async.channel, you get Server Sent Events for free
19:30gtrakTravisD: isn't offtopic social enough for you?
19:30ohpauleezPedestal also ships with some serious performance improvements in the Clojure web stack (and in general, like printing)
19:30TravisDgtrak: I just don't like change!
19:31ohpauleezand the ability to drop in pieces of the Java web space - for example, You can drop ServletFilters right into your Pedestal App. Gzip, DDoS protection, QoS, SpringSecurity, any of it
19:31gtrakyea, it's ok, I think we had enough intertia at any rate. I was off IRC for like 2 days and I come back on and this happens..
19:31ohpauleezlocks: Some of it - it certainly take the approach that Pedestal is FAR simpler than people think
19:33locksohpauleez: I remember a while back I was thinking about an architecture for a web service I had to develop
19:33locksand some of the pedestral copy registered with my brain
19:33locksfelt validated :P
19:33ohpauleeztotally :)
19:34gtrakRaynes: you're op in #clojure-offtopic :-)
19:34locksreading the "So what's happening with Pedestal 0.3.0?" blog post
19:35locksman, react took the web by storm
19:35amalloygtrak: he's in mexico today, getting smashed on some kind of company outing
19:35amalloyi don't think he'll be giving anyone ops
19:36gtrakhaha, good for him.
19:36gtrakunderage drinking for the win
19:36technomancyprotip: it's not underage if you're in a country that doesn't have insane age limits
19:36amalloyi don't think it's underage in mexico?
19:37arrdemtechnomancy: glad I'm not the only person who thinks it's silly that I can enlist and serve a tour before I can drink..
19:37gtraklocks: everyone's been doing it wrong for a really long time.
19:37ohpauleezPedestal 0.3.0 - core.async at the core, and Channels drive SSE now. Better SSE heartbeating. Performance tweaks. Updated deps and optimizations for platforms including Jetty 9, Tomcat 8, and (in-progress) Immutant2. Some interesting new handler and param pattern matching. The abiility to drop ServeltFilters in and configure them right in Pedestal.
19:37amalloyarrdem: i'm amazed you thought that was the case before hearing from technomancy
19:37ohpauleezCSRF protection bundled, secure headers bundled
19:37locksgtrak: haha :P
19:38ohpauleezSome small tweaks to make the logging even faster
19:38arrdemamalloy: I realized that some time back in high school long before I started lurking here :P
19:38ohpauleezand some improvements on the async handling core
19:38ohpauleezThat's the Paul deGrandis unofficial changelog so far
19:39locksohpauleez: I remember seeing a talk about web security in clojure
19:39locksand it painted a dark picture
19:39technomancyohpauleez: hey, are you still interested in my touchstream?
19:39ohpauleeztechnomancy: Hey man, not at the moment, my keyboard budget is all dried up
19:39ohpauleezlocks: Not so for Pedestal
19:40technomancyohpauleez: no worries; I'll try ebay or something
19:40ohpauleezOut of the box, it fixes nearly all of those things by default (now, before, they were there - just like they were in Ring - you just had to turn them on)
19:40locksgood to know
19:40ohpauleezYou can use the built in stuff, or bring your own (ala SpringSecurity or anything else you want)
19:43ohpauleezEveryone should fee free to ping me here (when I'm in here) or on Twitter with Pedestal questions :)
19:43blrohpauleez: boring I know, but have there been any changes to accomodate typical line of business crud style apps? (would love to give django the boot)
19:44ohpauleezblr: Interestingly enough, we have a prototype of a system for that use case, but it's unclear if we're going to clean it up and release it
19:44ohpauleezSince routes are just data in Pedestal, it's easy to generate them. We just made some reader literals and generated the entire application
19:45blryeah I think ryan mentioned last year that something was in the works, but haven't been tracking the project's progress
19:45ohpauleezblr: I'd give Ryan's presentation (linked above) a quick watch, I think you might find what you're looking for
19:45blrgreat, will check it out
19:48Frozenlockohpauleez: IRC and twitter. What? No email? :-p
19:49lockspeople should stop inventing stuff for me to learn
19:50locksugh, so inconsiderate
19:57Frozenlocklocks: There's worse: inventing stuff that requires you to know the underlying stuff. (Like cljs and JS)
19:57locksFrozenlock: I was trying to learn Om
19:58lockstalk about towers of abstraction
19:58Frozenlockoh, so you need to know JS, cljs, react and om. No big deal :-p
19:58gfredericksand html and css?
19:58FrozenlockAh right, you can hardly use Om with only JS
19:58lockscljs also include google closure don't forget
19:59blrunfortunately that's just the nature of programming for the web
19:59FrozenlockAnd clojure, of course
19:59lockswhich means the jvm
19:59locksand leiningen
19:59lockswhich…
19:59FrozenlockOh wow. I forget how much stuff I needed to learn just to make a hello world in cljs
20:00FrozenlockIt's so sad.
20:00gfrederickslein & lein-cljsbuild
20:00gfredericks& maven
20:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: maven in this context
20:00Frozenlockgfredericks: Actually I still don't know anything about maven.
20:00locksit's literally scary if you stop to find about it
20:00locks*think
20:00gfredericksFrozenlock: the coordinate system at least
20:01technomancyit gets worse
20:01FrozenlockNo, stooooop
20:01locksI actually my saturday messing with react
20:01technomancythe jvm runs on this thing called "x86_64"
20:01locksported some widgets I had
20:01technomancywhich is pretty bonkers
20:01gfrederickstechnomancy can't get anything done without learning about ocaml
20:01technomancyand that's all made out of these things called logic gates, which let me tell you; they are pretty nuts
20:01locksso that bit is shallowly gone over
20:02Frozenlockeh, you're pushing it a little too much. You CAN make a cljs app without knowing about x86_64
20:02blrturtles all the way down
20:02lockscan you though
20:02lockscan you?
20:02technomancydon't get me started on the whole "electrons flowing through a conductor" thing
20:03locksbut seriously
20:03locksat least as far down as java it's pretty leaky
20:05blrlocks: the alternative sadly is to capitulate to world of walled gardens, which is easier as a developer, but worse for everyone ultimately
20:06Frozenlocklocks: I was so excited when I learned about cljs. "Yay, no need to learn JS!"
20:06FrozenlockHow wrong I was.
20:06technomancyit's weird considering how easy it is to not learn java
20:06blrhave you read fogus's book Frozenlock? That's a nice perspective on javascript
20:07locksfunctional javascript?
20:07locksit's pretty neat
20:07Frozenlockblr: I dont' think so. Any one-liner summary? I don't really have time these days :-p
20:07amalloyreally, technomancy? i haven't written any real cljs, but i would expect the amount of js needed to be about the same as the amount of java needed
20:07Frozenlockcljs is more leaky than clj in this regard
20:07blrFunctional JavaScript yeah
20:07technomancyamalloy: I haven't written any either, but just gathering from ambient chatter that's the impression I get.
20:08beamsojavascript allongé is another good javascript book
20:08beamsois it best to separate my namespaces between clj and cljs in the same project?
20:09locksFrozenlock: tl;dr: use underscore.js and underscore-contrib.js, program JS like it were cljs
20:09nullptrusually you have src/clj and src/cljs separated entirely, no harm in duplicating the namespaces
20:10Frozenlockbeamso: You might want to use cljx for some namespaces too.
20:10thearthuris anyone else having trouble installing paredit package from marmalade today?
20:10thearthuri'm getting: Wrong type argument: listp, No commentary.
20:11locksI guess cljs is more leaky because DOM
20:12locksif you write GUI apps, clj will probably start leaking like a sieve
20:14cmwelshdoes that mean clojure is a bad first programming language?
20:15FrozenlockIt prepares you for the real world I guess. :-p
20:15locksthat's a loaded question
20:15blrcmwelsh: scheme is probably a better language for education, given all the resources around it, particularly racket
20:16epicherothe tooling for clojure is more complicated and the documentation is poor. I like clojure more, but i agree scheme would be much better
20:16blrthere are some good learning resources for kids in particular in scheme
20:16cmwelshwhat about something like codecademy that runs in a browser, will clojurescript ever have something like that?
20:16gtrakcmwelsh: how far down the rabbit hole are you willing to go?
20:16lockscmwelsh: it _has_ stuff like that
20:16lockscmwelsh: 4clojure, clojure koans
20:17gtrakcmwelsh: IE, do you want kids reading java stacktraces?
20:17technomancycmwelsh: it wouldn't be my first choice
20:17Frozenlockhttp://clojurescript.net/
20:17lockshttp://clojurescriptkoans.com/
20:17tuftunderscorejs with knockout is pretty tolerable
20:17gtrakand having to learn the compiler to explain why they messed up?
20:17lockshttps://www.4clojure.com/
20:17cmwelshI'll check those out. I want to make a site like codecademy but JavaScript can be such a difficult first language as well
20:18cmwelshI don't know clojure very well but I like what I have seen
20:18epicheroi'm still lost with java stacktraces… i can handle GDB
20:18gtrakI think javascript's a good choice, because browsers are everywhere. In 1995 it was qbasic.
20:18locksI like JavaScript actually
20:18technomancy"your first language can be anything, as long as your second language makes you wonder what the hell was wrong with your first"
20:18locksfor all it's faults
20:19lockswhat was the saying
20:19lockscan be anything except X because it'll rot your brain forever?
20:19martinklepschI'm trying to start an uberjar in docker with java -verbose -jar xy-standalone.jar
20:19epicheroif you want to ease yourself in slowly i think python is the simplest to teach someone
20:19martinklepschand the only line that comes out of it is: [Opened /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]
20:19Frozenlocktechnomancy: I like that. Who said it?
20:20technomancyFrozenlock: I wish I could remember
20:21martinklepschanyone an idea what could be going on there?
20:23FrozenlockI like elisp, because you are inside your evaluating environment. Also, single threaded and no namespaces. Less stuff to learn before doing actual work.
20:24locksfactor's environment is so cool
20:24martinklepschFrozenlock, if you just jump straight into lighttable you can also do clojure w/o namespaces...
20:25gtrakProcessing.
20:25technomancyprocessing has good learning material, but the language itself is meh
20:26Frozenlockmartinklepsch: Can you? Can you uberjar it, or do you need to always run into LT?
20:26blrfor kids, Scratch has an immediacy that seems to really work for kids, for adults it doesn't matter so much
20:26locksI saw a
20:27lockssmalltalk presentation the other day, I kinda wish I could work like that
20:27martinklepschtechnomancy, I've recently seen people get quite far with quil on their first tries
20:27locksI wonder what LT has up its sleeve
20:27FrozenlockTeach them math with parens... (1 + 2), (1 + (3 - 2))... and then slowly swap the position of the functions. :-p
20:27martinklepschFrozenlock, you'd always need to run it in LT
20:27blrlocks: have you tried pharo? I think it has an active, if small community
20:27locksblr: downloaded the other day
20:30locksblr: I'll give "deep into pharo" another go
20:30locksand try to find videos, since that seems what my brain prefers
20:30blrI don't know anything about it personally, just hear people speak favourably about it
20:31martinklepschanyone an idea why java -verbose -jar xy-standalone.jar could print nothing but "[Opened /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]" once?
20:31locksblr: problem with image-based envs is interop
20:31locksbut, one problem at a time
20:31technomancymartinklepsch: sometimes the oracle jdk makes you click yes in the licensing agreement
20:32technomancymaybe it can't display the window or something
20:32blrI remember looking at Seaside a few years back and thinking it had some novel ideas, for a web framework
20:32technomancyusually that happens at install time though
20:32martinklepschtechnomancy, I'm starting in a docker container so most likely that could be an issue
20:32technomancybut oracle is gross anyway; i recommend getting rid of it
20:33blropenjdk has near parity with oraclejdk now from what I understand.. potentially minor performance differences?
20:33dbaschwhat happened to clojure-social btw?
20:33gtrakdbasch: me moved to clojure-offtopic
20:33blrcertainly easier to apt-get the openjdk :)
20:33gtrakwe*
20:34arrdemtechnomancy: you're invited to the new clubhouse ofc..
20:34technomancyoh yeah
20:41locksdoes anyone have some destructuring katas/exercises other than the koans?
20:41locksbecause they really stump me
20:42martinklepschlocks, good q
20:42bbloom~destructuring
20:42clojurebotdestructuring is http://clojure.org/special_forms#binding-forms
20:43bbloomlocks: reading the "spec" / docs may give you enough of a hint to solve the koans
20:43locksbbloom: but I want more "homework"
20:43martinklepschI'm getting the very same: "[Opened /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar]" line when using openjdk
20:43bbloomlocks: oh, you finished the koans & need MORE koans? :-)
20:44locksyeah :P
20:44locksor a set of kata style exercises to keep me sharp
20:44beamsomartinklepsch: i thought there was a means of specifing that you'd accepted the jdk licence as part of the install of the deb or somewhere in /etc
20:44bbloomlocks: http://www.4clojure.com/problems use search filter in top right corner
20:45bbloomthere are 3 destructuring problem groups
20:45locksoh nice
20:46locksI solved some problems already, but hadn't come across the destructuring ones yet
20:46beamsohttps://wiki.debian.org/JavaFAQ mentions some things about accepting the licence programmatically
20:47amalloyhttp://www.4clojure.com/problem/173 is so weird
20:48blrmartinklepsch: have you checked the process list? are you sure it isn't running?
20:49martinklepschblr, the uberjar works fine locally
20:49mercwithamoutho_O;
20:49martinklepschjust in a docker container it hangs
20:50blrmartinklepsch: are you using openjdk-7-jre-headless?
20:51blrmight be worth giving that a go
20:51martinklepschyeah, just trying with default-jre-headless
20:51martinklepschblr, if that works I'll swith to 7.
20:55martinklepschblr, no luck... -.-
20:56blrbugger
20:57blrI'm afraid we're still using kvm, but someone on here must have experience deploying to lxc/docker
20:57beamsoi have no concept of what can or can't be done with docker, but can you ssh into the instance and run java from the command line?
20:59martinklepschbeamso I don't think so
21:00martinklepschriemann works just fine on docker
21:00martinklepschand uses default-jre-headless
21:00martinklepschhttps://github.com/patrickod/riemann-docker/blob/master/Dockerfile
21:03blrmartinklepsch: apparently the command 'attach' will give you a shell on the container, similar to a kvm console http://docs.docker.io.s3-website-us-west-2.amazonaws.com/reference/commandline/cli/#attach
21:04martinklepschblr, not really. it just foregrounds it, which will show me the aforementioned line
21:04martinklepschI'll talk to some more ppl in the #docker channel
21:04blryou probably want the -i flag for interactive
21:04blrmight help clarify what's going on
21:05blrok, gl :)
21:07beamsoi don't see anything with accepting the java licence, so it wasn't that
21:14amalloyguys, the internet is amazing. anytime you want, you can wander into a room where dozens or hundreds of experts in any topic you like are hanging out, and ask them your dumb newbie question. imagine how incredible that would have seemed, say, thirty years ago
21:15dbaschamalloy: I don’t need to imagine, I was there :P
21:15Frozenlockamalloy: I have the opportunity of feeling like a noob 24h/24h. :-p
21:15dbaschI learned to code in 1983 with a shitty TI99 and a photocopied BASIC manual
21:16sjyirc is coming up on 30 years old though!
21:16amalloydbasch: i think it's still "imagine..." rather than "remember...", because you probably weren't thinking back then about how nice it would be to have all this stuff at your fingertips all the time
21:17locksI still haven't learnt to code
21:17locks#hipster
21:17locksI apologize for my use of hashtags
21:18dbaschamalloy: modems and BBSs already existed, they just were not available to most of us
21:18dbaschI wanted to buy a 300 baud modem but it was too expensive
21:18kenrestivowe had usenet back then, which was pretty cool, but nothing like the sheer volume of people on the internet today
21:18amalloyyes, i know. i just mean like, having it all commonplace
21:18amalloyand instantaneous
21:18amalloylocks: you can justify it by saying you were /join'ing #hipster
21:18amalloyhashtags work almost as well in irc
21:19kenrestivoi was remarking with some old-timers how bar arguments just can't happen anymore. anytime someone says "that movie was 1989, it had willem defoe..." someone can bust out their phone and end the debate in like 5 seconds
21:19lockskenrestivo: that's a bit of a strawman
21:19lockssomeone can
21:19locksdoesn't mean they will
21:19kenrestivoit's a total strawman :-)
21:20locksthen light it on fi'a
21:20locksthat STRAWMAN'S ON FI~RE~
21:21kenrestivooh, people can always find something to argue about. it's just that having the sum total of the human race's knowledge within several seconds of search during every waking hour has qualitatively changed things.
21:22locksyou're american, aren't you
21:22kenrestivoyou can tell by the misplaced adverb, no doubt
21:23locksI can tell by implicitly saying everyone has the sum total etc within several seconds of search
21:23lockson their phone
21:23locks;P
21:25dbaschI like living in a world in which I can carry money in my brain
21:25Frozenlockdbasch: bitcoin?
21:25kenrestivocorrect horse battery staple + bitcoin
21:25dbaschFrozenlock: diegobasch.com/brainwallet
21:25dbaschhttp://diegobasch.com/brainwallet
21:26kenrestivoyay bip32
21:26dbaschI tried writing that in cljs but it was really annoying using all the bitcoin / crypto libraries
21:26kenrestivoas for internet connectivity, i'm told that the usa lags behind many other countries
21:27kenrestivodbasch: there are a few javascript wallets last i checked.
21:27FrozenlockWhile I've always been a strong bitcoin advocate, the "we don't need to care about the blockchain's size" behavior is scaring me.
21:27amalloykenrestivo: i'm not sure about connectivity, but certainly connection quality
21:27dbaschkenrestivo: yes, but the original brainwallet lets you choose your passphase (which is really terrible)
21:28dbaschpassphrase
21:28amalloythe other day i was chatting with someone from the netherlands who has 93Mbps up
21:28amalloyand i'm sure it's much cheaper than the crummy 1Mbps i pay for at home
21:28blrwe have full duplex fibre in NZ now amalloy, but we're connected to the rest of the world by a bit of string, which makes the fibre somewhat less exciting
21:30kenrestivoFrozenlock: the two biggest problems i've had with BTC is that one (it can't scale to visa-level volumes), and that it's deflationary.
21:30kenrestivothere were some people working on that first problem. the second problem is just a problem, and people have hacked around it by for example forking (dogecoin), but i think it's deeper and may not ever get fixed
21:31dbaschkenrestivo: #1 is not a problem, it’s like saying computers will never take off because 16k of ram won’t be enough
21:31beamsoblr: you have fttp?
21:31FrozenlockWell, there's weirdos like me that don't think deflation is a problem.
21:31blrbeamso: a lot of NZ does, I missed out this year by one block, we get it next year
21:31beamsoouch at missing out, but lucky you in general
21:32dbaschto me the main problem with bitcoin is that most development is in C++, Rails and js :P
21:32blrwell yeah, it's good to see, but as I said offset by our problems with international bandwidth, we only have 1 trunk out of new zealand
21:32Frozenlockdbasch: we need clojurecoin
21:32kenrestivoi played aroudn with bitcoinj and went "bleah", and stopped
21:32kenrestivothere's a clojure wrapper around it now that looks pretty solid
21:32arrdemkenrestivo: I will happily debate #1 with you all night long, and #2 is arbitrary and patched in dogecoin. may the best alt win.
21:33dbaschFrozenlock: let’s be more inclusive, e.g. lispcoin or functionalcoin
21:33dbaschkenrestivo: I didn’t think bitcoinj was that bad
21:33kenrestivoarrdem: i have no interest in debating it because my issue with #2 is not technical, it's philosophical/moral and i expect not many people to agree with me
21:33arrdemdbasch: just hack clj-doge
21:33danielcomptonCan you compare two byte-buffers based on their hashcode?
21:33arrdemkenrestivo: I happen to agree with you on #2, but not for the reasons you hold that view.
21:34arrdemdbasch: I was looking at the json-rpc APIs for the coins... a good clj-btc will port trivially to almost any alt.
21:34blrI'm just enjoying the absurdity of it all, the doge nascar thing is hilarious.
21:34kenrestivoit'd be fun to have dogecoin tips in lazybot
21:34arrdemblr: I KNOW RIGHT
21:34dbascharrdem: there is a clj-btc but it’s not great
21:35dbascharrdem: I actually use it for cointipping
21:35arrdemdbasch: eh I/we could fix that.
21:35blrarrdem: the world is getting exponentially weirder, and I'm ok with that
21:35arrdemblr: I ordered my doge shirt, did you?
21:35dbascharrdem: it’s pretty trivial actually
21:35blrhahah no
21:35arrdems/doge/dogecar/g
21:35blrI should do
21:35arrdemhttp://dogecrew.com/
21:36arrdemdbasch: I'm sure. the clojure APIs for exchanges I was working on for a while were the same, trivially fixable but blegh
21:36arrdem624 DOGE shirts to go!
21:38fooozbazzis there a balanced binary tree implementation available as a clojure library, or do people just implement their own all the time for fun..
21:38fooozbazzgoogle is giving me nothing but tutorials and half baked examples..
21:38fooozbazz"don't reinvent the wheel"
21:39locksif anyone knows about trees is bbloom
21:39fooozbazz:(
21:39dbaschdanielcompton: I don’t think so, but why would you want to?
21:39Frozenlock"or do people just implement their own all the time for fun.." pfff, that's not fun.
21:39danielcomptondbasch I want to compare a blob from cassandra with a blob from a java file
21:40fooozbazzFrozenlock: that' why i'm asking..
21:40arrdemwell there's a red-black tree implementation I'm finding in some blog posts..
21:40danielcomptondbasch it seems like Clojure's = compares equality even for java mutable objects. Or am I way off base on that?
21:40arrdemsomeone so inclined could probably pull it out and librarify it...
21:40arrdem(dec so)
21:40lazybot⇒ -13
21:40danielcompton(dec so)
21:40lazybot⇒ -14
21:40dbasch,(= (byte-array (map byte (range 9))) (byte-array (map byte (range 9))))
21:40clojurebotfalse
21:41arrdemfooozbazz: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/02_composite-data/2-27_and_2-28_custom-data-structures/rbt.clj
21:41dbaschdanielcompton: they are different objects
21:42FrozenlockDo I need a licence to prevent people from distributing code, or can I just write: "Licence: Do not distribute" ? (I've only ever dealt with open source or in-house stuff)
21:43dbaschFrozenlock: it’s best to use a proper license http://choosealicense.com/
21:43arrdemFrozenlock: just sole copyright it to $COMPANY
21:43arrdemor get a real license...
21:44FrozenlockLooking now, thanks
21:44dbaschFrozenlock: if you put it on github, copyright alone doesn’t stop people from forking the code
21:45fooozbazzarrdem: thanks. i guess it's just not been done yet.
21:45devnanyone seen this? http://crossclj.info/
21:45arrdemdevn: that's slick
21:45devnarrdem: yeah, i feel like all of this stuff is slowly coming together
21:46devnimagine clojuresphere + clojars + crossclj + getclojure + clojuredocs
21:46devn+ clojureatlas
21:47devnim guessing that crossclj is a giant datomic db of codeq-parsed repos
21:48arrdemthe volume of clj- prefixed libraries is irritating.
21:48arrdem-jure is only marginally better.
21:49dbaschI crtl-F’ed for bitcoin and found only one thing
21:49dbaschand it was mine :(
21:49danielcomptondbasch how can you compare two different mutable java objects? What's the fastest way?
21:49arrdemthere is a search...
21:49arrdemalso it looks like this DB is old. I have other projects that don't show up when I search my handle.
21:49dbaschdanielcompton: for byte arrays you have to go byte for byte
21:50danielcomptonthat would still be faster than converting to a vector?
21:50arrdemoh damn. I should port imprecise to algo.generic....
21:50arrdemforgot about that project.
21:50dbaschdanielcompton: if you want speed, do a plain old comparison by array index, or lazy
21:50danielcomptondbasch got it
23:10fortrucedoes binding not actually take place until after the let form?, want to use one binding in the next binding
23:11fortruce,(binding [x 1, y (+ 1 x)] (+ x y))
23:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:0:0)>
23:11fortruce,(def ^:dynamic x)
23:11clojurebot#'sandbox/x
23:11fortruce,(def ^:dynamic y)
23:11clojurebot#'sandbox/y
23:12fortruce,(binding [x 1, y (+ 1 x)] (+ x y))
23:12clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Number>
23:12dbasch,(let [a 1 b (+ 2 a) c (* 4 b)] c) ;; you mean this?
23:12clojurebot12
23:12fortruceyea, but in binding, not let
23:12dbaschthere is no guarantee of order in binding
23:13fortruceahh, alright, is there in with-redefs?
23:13dbaschThe new bindings
23:13dbaschare made in parallel (unlike let); all init-exprs are evaluated
23:13dbaschbefore the vars are bound to their new values.
23:13dbasch(doc binding)
23:13clojurebot"([bindings & body]); binding => var-symbol init-expr Creates new bindings for the (already-existing) vars, with the supplied initial values, executes the exprs in an implicit do, then re-establishes the bindings that existed before. The new bindings are made in parallel (unlike let); all init-exprs are evaluated before the vars are bound to their new values."
23:13fortruceahh, somehow missed the last sentence :/
23:14fortrucenested bindings seems weird, i think i'm doing something wrong
23:15blrdanielcompton: in Dunedin today?
23:15danielcomptonblr still in Auckland, working out of Otago Uni's Auckland office
23:15danielcomptonblr does my channel join show up in IRC?
23:16blroh right, I forget we have offices in other cities sometimes
23:16danielcomptonblr haha, I don't think you're the only one
23:17danielcomptonblr does my channel joining show up in IRC?
23:18blryeah, that's normal, what irc client do you use?
23:18danielcomptonblr textual, I just wasn't sure if that was spamming everyone
23:18blrI wouldn't worry about it, think people on irc are used to join/part spam :)
23:27yeoj___hi, i'm writting a korma app, and I am repeating some basic crud operations and struggling with a macro... can someone help me with the correct way to thing about this: https://www.refheap.com/85669
23:27yeoj___*think
23:56munderwoHi all. im using compojure and want to basically pass the whole request map through to a handler. Im making a really basic proxy. How in the routing would I just pass the whole request through?
23:56munderwoi've tried this (ANY "/*" [] (proxy-handler request)) ..
23:57tolstoy(AND "/*" [:as req] (proxy-handler req))?
23:57tolstoyEr, ANY.
23:57munderwojust trying now.
23:57tolstoyOr even (routes/not-found (fn [r] (proxy r))). Something like that?
23:57munderwoI can see how that would work.
23:58munderwoThe first that is. The second I dont think I quite want to do that. As I would like eventually for the routes to be configurable
23:59tolstoyHeh. I was going to suggest not even bothering with compojure if that wasn't the case. ;)
23:59munderwoyeah. Thanks that worked!