#clojure log - May 19 2014

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:26 cespare|home: ,(#(%-1))

0:26 clojurebot: #<NullPointerException java.lang.NullPointerException>

0:27 cespare|home: writing a clojure parser; discovering fun edge cases.

0:28 numberten: is that treating the %-1 as the -1 indexed argument to the function?

0:29 cespare|home: maybe?

0:29 ,#(%0)

0:29 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: p0__52# in this context, compiling:(NO_SOURCE_PATH:0:0)>

0:29 numberten: seems like it

0:29 cespare|home: don't understand that one either.

0:29 numberten: the first is 1

0:30 argument indexing for #() sugar begins at 1 iirc

0:30 cespare|home: right

0:30 i'm seeing how bad code is parsed

0:30 numberten: yeah it's interesting

2:11 amalloy: amusingly, the reader will let you use funny numbers for #() args, iirc

2:11 ,'#(foo %1.3)

2:11 clojurebot: (fn* [p1__25#] (foo p1__25#))

2:11 amalloy: ,'#(foo %3N)

2:11 clojurebot: (fn* [p1__51# p2__52# p3__50#] (foo p3__50#))

2:25 numberten: when running tests

2:25 is there a way to automatically run the tests x number of times

2:41 amalloy: if your tests fail one time out of n, they're not very good tests, are they?

2:44 mercwithamouth: i'm trying to test my compojure routes from the repl. shouldn't this be sufficient? https://gist.github.com/anonymous/0b72f45a3a1ca4376ee7

2:45 i'm used to calling (start-server) but apparently for what i want to do run-server is what i'm supposed to use?

2:46 beamso: what do you want to test about your routes?

2:46 mercwithamouth: beamso i'd just like the data that it would post to show up via repl

2:47 i suppose i COULD just use curl...but i'm being..difficult

2:47 ahh i believe i misunderstood the conversation i'm reading now in the google group

2:48 beamso: you could test the method that the route is calling for the data

2:49 i imagine, but have no idea, that you're also able to test that url go to your intended function

2:49 i should have said function and not method for the first line, too.

2:51 mercwithamouth: ok 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

2:51 i'm focusing on writing my api and i want to do client side work later

2:53 whodidthis: maybe something like https://github.com/xeqi/peridot

3:01 SegFaultAX: /join #python

3:01 Whoops, sorry.

3:01 mercwithamouth: hehheh

3:01 traitor!

3:01 =P

3:02 SegFaultAX: mercwithamouth: I've been doing Python a /lot/ longer than I've been doing Clojure. Maybe 5x or so. ;)

3:04 mercwithamouth: SegFaultAX: fair enouugh, lol

3:44 ddellacosta: is 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)

4:13 mercwithamouth: are there any lists or articles on the most useful clojure functions to get started with?

4:14 dbasch: probably 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

4:15 mercwithamouth: dbasch: *thumbs up*

4:16 hmmm 4clojure should be my friend

5:34 unimportant question...i know but can someone tell me what color theme this is? https://github.com/clojure-emacs/company-cider

5:36 ddellacosta: mercwithamouth: 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.

5:38 mercwithamouth: ddellacosta: agreed...

5:38 * mercwithamouth is doing his best to procrastinate

5:41 ddellacosta: heh

5:41 mercwithamouth: where are you, btw?

5:41 mercwithamouth: east coast/us

5:41 ddellacosta: I don't see a lot of folks around this time of day

5:41 wat

5:41 mercwithamouth: do you like getting up early or not going to bed?

5:41 mercwithamouth: i don't go to sleep =)

5:42 ddellacosta: mercwithamouth: well, I'm not one to judge, don't get me wrong

5:42 mercwithamouth: actually i work nights and this is considered my weekend. crazy sleep schedule

5:42 ddellacosta: just surprised

5:42 ah

5:42 are you doing development at nights?

5:42 or sysadmin kind of stuff?

5:42 mercwithamouth: nope..hobbyist

5:42 ddellacosta: oh, cool

5:42 mercwithamouth: non computer related

5:43 ddellacosta: wow, don't meet a ton of folks in here that aren't doing it professionally. Although that may just be because I never asked

5:43 mercwithamouth: lol i may be a special case

5:43 ddellacosta: heh

5:43 yeah, also, most hobbyists aren't jumping into clojure...is my impression.

5:43 again, could be wrong about that

5:44 on 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

5:45 magopian: i've been (organizing) a conference last week in south of france, on an island, for Django (python web framework)

5:45 and we've had one of the guys talk about "taming the complexity"

5:46 taking advice from Rich Hickey's talk on "simple made easy"

5:46 and applying some of it to using react.js and stuff

5:46 mercwithamouth: ddellacosta: 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.

5:46 locks: err'body talking about react

5:46 magopian: then 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

5:46 ddellacosta: mercwithamouth: yeah, it gets a lot easier I think

5:47 magopian: what do you mean, like cultural, or just something individually stopping you guys?

5:47 magopian: ddellacosta: mercwithamouth: talking about that, yeah, we felt it was hard... harder than learning OOP for beginners

5:47 ddellacosta: 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

5:48 even 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)

5:48 and I could imagine _understanding_ code becomming easy with practice

5:48 it feels like _writing_ code in FP is just plain hard

5:49 like, you have to think a lot about it, and in a way that is not "normal" (simple? easy?) for a human brain

5:49 locks: immutability is tricky :P

5:49 ddellacosta: magopian: 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

5:49 xsyn1: and rewarding

5:49 magopian: we do think in terms of objects in our everyday life, everything is objects

5:49 not everything is data, and reasoning/thinking about data doesn't feel like easy to my brain

5:49 xsyn1: is time an object?

5:50 ddellacosta: magopian: but I think it just takes time

5:50 locks: magopian: I've been an "oop programmer" for all my life but functional programming actually makes more sense to me

5:50 so I guess it also depends on the person

5:50 magopian: ddellacosta: i have no problem with learning and learning curve (i'm a late vim adopter after all ;)

5:50 mercwithamouth: hmm do i want to stick with light table or go back to emacs...decisions

5:50 xsyn1: :)

5:50 locks: mercwithamouth: LT <3

5:51 mercwithamouth: locks: decision made. =)

5:51 ddellacosta: magopian: 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

5:51 magopian: i'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)

5:51 so i have no problem with "it takes time"

5:51 Glenjamin: i'm a tad concerned that chris and co are shifting focus away from LT

5:51 xsyn1: magopian: I've been dealing with the Clojure learning curve for about 2 years, and I still feel like a white belt

5:51 bet there's a lot of beauty underneath

5:51 Glenjamin: but the latest reelease is pretty damn good

5:51 magopian: i'm just feeling like "it's gonna need more than time... maybe some kind of declic"

5:51 xsyn1: that's changed the way I see the universe

5:51 ddellacosta: xsyn1: ditto

5:51 magopian: what's declic mean

5:51 ?

5:51 xsyn1: nick xsyn

5:52 magopian: ddellacosta: sorry, french word

5:52 some kind of... sudden change of viewpoint

5:52 when it 'tics'

5:52 locks: when it clicks

5:52 or an epiphany

5:52 :)

5:52 magopian: locks: that's the one

5:52 thanks

5:52 ddellacosta: magopian: 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. ;-)

5:52 magopian: when it clicks

5:52 and it hasn't for me (yet)

5:52 ddellacosta: locks, magopian: ah, gotcha

5:52 magopian: ddellacosta: yeah ;)

5:52 xsyn: it's probably a pretty good gamble ;)

5:53 ddellacosta: xsyn: yeah, exactly

5:53 mercwithamouth: i 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

5:53 magopian: anyway: i've worked through most of the 4clojure exercices

5:53 mercwithamouth: ...which is fine. i'm in no rush nor do i have any...immediate goals

5:53 magopian: and I do get some pretty good answers on my own much more than I thought beforehand

5:53 xsyn: I honestly believe you need to make something though

5:54 excercises are cool

5:54 magopian: xsyn: yeah, that's the thing: i need to do some kind of real project

5:54 xsyn: but they're like drill work

5:54 ddellacosta: magopian: 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.

5:54 mercwithamouth: xsyn: i agree. my project ideas are usually too big....though i'd be fine with breaking it up into components and stages

5:54 xsyn: you need to get into the cage to really get to grips with it

5:54 locks: +1 on the project

5:54 the only problem is finding a suitable one xD

5:54 ddellacosta: but its' made me realize how little I do know

5:54 *it's

5:54 xsyn: man, me too

5:55 mercwithamouth: like right now i'm still hung up on testing routes... i create problems that really aren't there...procrastination most likely

5:55 not 'testing' routes but i'd like to write my api without even opening a browser...

5:56 ddellacosta: mercwithamouth: it's totally possible, I've done that.

5:56 mercwithamouth: ddellacosta: do tell...

5:56 thegeez: mercwithamouth, the emacs theme looks like this one: https://github.com/steckerhalter/grandshell-theme

5:57 mercwithamouth: thegeez: i believe you're right! =)

5:57 ddellacosta: mercwithamouth: 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.

5:58 mercwithamouth: ddellacosta: hmm i'm going to start something from scratch and i'll set up a repository...going to be on...tonight/tomorrow morning?

5:59 ddellacosta: mercwithamouth: er, your late night/early morning definitely--I'm 13 hours ahead of you I think

6:00 thegeez: mercwithamouth, and kerodon for testing ring routes/api: https://github.com/xeqi/kerodon (or peridot for more low level https://github.com/xeqi/peridot )

6:00 xsyn: where are you?

6:00 mercwithamouth: ok...i'll be on

6:00 ddellacosta: thegeez: have you used that much? Looks super handy

6:00 xsyn: assuming you were asking me, I'm in Japan. mercwithamouth is on the East Coast of the U.S. I believe?

6:01 mercwithamouth: thegeez: 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

6:01 ddellacosta: yup

6:01 xsyn: Got to love IRC!

6:01 ddellacosta: xsyn: :-)

6:02 gotta go folks, take care

6:02 magopian: locks: yeah, need to find a suitable toy project to work on

6:02 mercwithamouth: ttyl

6:03 magopian: i've known for a very long time now that writing _simple_ code is very difficult

6:03 thegeez: ddellacosta, kerodon is indeed super handy. I've used it here: https://github.com/thegeez/clj-crud/blob/master/test/clj_crud/accounts_test.clj

6:03 locks: writing simple anything is pretty hard

6:03 magopian: locks: exactly

6:03 locks: or there'd be more hemingways out there ;P

6:04 mercwithamouth: ahhh and i see...kerodon WOULD be very helpful

6:04 locks: I started an engine for a card game that's played in portugal

6:05 mercwithamouth: most of my experience comes from rails so...i'm familiar with capybara =P

6:06 now how awesome is working through SICP going to make me?

6:08 xsyn: (if (= 'confused' 'awesome) (inc mercwithamouth))

6:09 pretty awesome though

6:09 I still haven't gotten through chapter 2

6:09 but that's my bad ahbits

6:09 habits*

6:09 magopian: xsyn: you reckon it's really worth the read?

6:10 mercwithamouth: hehheh...i think it's going to be my 'summer read'. though i have all of the clojure books as well

6:11 locks: I have joy of clojure

6:12 xsyn: magopian: I'm only two chapters in, and it's been hard work because I don't have a maths background

6:12 but it helped me understand functional programming

6:12 and composition

6:12 like, I 'got it'

6:13 mercwithamouth: xsyn: hmm that much within jus two chapters?

6:13 <- 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

6:13 xsyn: dude, it goes at a pretty fast pace

6:13 locks: there's always the videos

6:14 magopian: videos?

6:14 locks: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

6:15 magopian: there's worth the view?

6:15 (it's so "fun" to see that they still apply even though they're so old)

6:16 locks: yes

6:16 they're really good

6:16 and frightening

6:17 he teaches lisp in about 5mins and then trudges on

6:17 magopian: Oo

6:17 xsyn: wizards...heh

6:18 magopian: do you know if it's possible to download those videos? I hate the flash player

6:18 ah, there's a "download this video" link ;)

6:19 mercwithamouth: https://www.youtube.com/results?search_query=structure+and+interpretation+of+computer+programs

6:19 or that...

7:22 mpenet: gfredericks: ping

7:35 ssideris: me tis ekloges ti egine?

7:36 mpenet: (inc gfredericks)

7:36 lazybot: ⇒ 57

7:44 gfredericks: amalloy_: aw man sorries

7:49 szymanowski: hi, how can i rename a file from clojure?

7:52 mpenet: 2 horrible ways: 1 use java File, 2 use clojure.java.shell/sh

7:53 szymanowski: you mean that I should not use clojure for that?

7:53 mpenet: it's clojure

7:53 use java File, it's the clean way to do it I guess

7:54 szymanowski: ok I will look at this

7:54 a snippet maybe? ;)

7:54 broquaint: szymanowski: Alternatively use fs - http://raynes.github.io/fs/me.raynes.fs.html#var-rename

7:55 Which provides some simple abstractions on top of the java APIs.

7:55 clgv: synfinatic: http://stackoverflow.com/questions/1158777/renaming-a-file-using-java => (doto (File. "old.txt") (.renameTo (File. "new.txt")))

7:55 szymanowski: yes looks great

7:56 clgv: szymanowski: ^^

7:57 hmm maybe you want to return the new file, though

7:57 szymanowski: :) thank you mpenet, broquaint and clgv

8:02 magopian: just started watching the very first video on SICP and in the very first few minutes it's already mind blowing;)

8:19 scape_: video?

8:19 only known of the book

8:19 beamso: http://www.youtube.com/watch?v=2Op3QLzMgSY

8:20 scape_: wow, nice

8:20 thanks

8:20 old school :)

8:20 beamso: not a problem

8:20 i liked it being old skool, actually.

8:20 scape_: yea, i think i will too

8:20 beamso: dude with boards and chalk

8:44 scape_: \away idle

10:15 szymanowski: what is the simplest way to get a seq of File given a directory path?

10:15 please :)

10:16 ohpauleez: file-seq

10:17 Or of the lines, with line-seq

10:18 szymanowski: ^

10:18 zerokarmaleft: a seq of files? like a directory listing?

10:18 szymanowski: yes a seq of all files within a dir

10:18 ohpauleez: Yeah, if you File object is a directory, file-seq will give you the files

10:19 http://clojuredocs.org/clojure_core/clojure.core/file-seq

10:19 szymanowski: ho great

10:19 doesn't know that File obj can represent a dir

10:19 thank you

10:19 ohpauleez: You're very welcome - happy to help

10:21 arrdem: happy gsoc day 0....

10:22 TimMc_: zero-day?

10:23 hyPiRion: oh wat, gsoc already started today?

10:23 That's early. Or perhaps uni is ending late over here.

10:24 arrdem: I've had a week and a bit off from uni, but I have friends who are still in

10:24 zerokarmaleft: y

10:32 Bronsa: here in Italy uni ends in a month

10:34 hyPiRion: 3 weeks here

10:34 roughly

11:22 berdario: Hi, 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:22 since "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:22 instead, I just get back the first form (ns ...)

11:25 cbp: wrap your file in a vector

11:25 gfredericks: or call read repeatedly

11:25 arrdem: calling read until it returns nil is better

11:25 imo

11:25 berdario: I agree

11:25 this works inside clojure

11:25 but apparently I don't have a read fn in the edn implementation I was planning to use :/

11:26 cbp: berdario: what do you mean? clojure.edn/read

11:26 gfredericks: ,(doc read)

11:26 clojurebot: "([] [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:26 gfredericks: arrdem: nil might be one of the things read :)

11:26 arrdem: gfredericks: that's core/read

11:26 gfredericks: yeah but edn/read is just copypasta

11:26 arrdem: gfredericks: har har. end of file error then.

11:27 gfredericks: (let [sentinel (Object.)] (loop ... using sentinel as eof-value ...))

11:27 arrdem: that edn doesn't have a *read-eval* free reader is silly.

11:27 berdario: cbp: I'm trying to read clojure code from python :)

11:27 arrdem: berdario: clojure code != edn

11:28 berdario: some important grammar and token differences.

11:28 berdario: arrdem: 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:28 gfredericks: I want to make an edn writer

11:28 cbp: edn/read is copy pasta? i thought it had

11:28 arrdem: gfredericks: please do...

11:28 cbp: *puts on sunglasses* security

11:29 Bronsa: arrdem: what do you mean with "no *read-eval* free reader" ?

11:29 gfredericks: arrdem: I wonder how tricky it would be to write a generic version that can do both edn and json

11:30 arrdem: Bronsa: your reader :P

11:31 gfredericks: build a what? a multireader?

11:31 Bronsa: arrdem: I still don't understand :/ clojure.edn doesn't need/use *read-eval*

11:32 gfredericks: arrdem: no a multiwriter

11:32 arrdem: gfredericks: an EDN writer would be nice but we already have plenty of good json writers so... why?

11:32 gfredericks: arrdem: afaik none of these are locally extensible

11:33 which has caused me pain at least twice

11:33 arrdem: Bronsa: 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:33 gfredericks: arrdem: why would you call clojure.core/read-string instead of clojure.edn/read-string?

11:34 * arrdem consults the source

11:34 arrdem: ,(require '[clojure.edn :as edn])

11:34 clojurebot: nil

11:34 arrdem: ,(source edn/read-string)

11:34 clojurebot: Source not found\n

11:34 arrdem: YOU LIE

11:35 cbp: $source clojure.edn/read-string

11:35 lazybot: Source not found.

11:35 cbp: welp

11:35 arrdem: oh good we have clojure.lang.EdnReader.java which isn't silly.

11:37 gfredericks: that was the main outcome of the reader-security brouhaha

11:38 "the reader is not a serialization tool, here use this instead"

11:38 arrdem: I'm totally cool with that.

11:38 gfredericks: ^ paraphrasing three days' worth of people yelling at each other

11:39 brunov: Hey 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:40 gfredericks: mapply

11:40 arrdem: brunov: the easy way is to rework your functions to take a leading single configuration map argument that you can just pass through.

11:41 gfredericks: https://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.clj#L345

11:41 ^ where I use mapply from

11:41 arrdem: gfredericks: nice one!

11:41 gfredericks: I'm not sure they released that yet but I pushed up a "fork" that has it

11:42 brunov: gfredericks: this looks promising, thanks!

11:43 gfredericks: np

11:43 brunov: how do you karmabump someone around here?

11:43 gfredericks: (inc someone)

11:43 lazybot: ⇒ 1

11:43 arrdem: (inc <username>)

11:43 lazybot: ⇒ 1

11:43 brunov: (inc gfrederick)

11:43 lazybot: ⇒ 1

11:43 gfredericks: my first karma!

11:43 brunov: cool. I thought you needed some funky prefix

11:43 haha

11:43 arrdem: (inc gfredericks)

11:43 lazybot: ⇒ 58

11:43 arrdem: (dec gfrederick)

11:43 lazybot: ⇒ 0

11:43 bbloom: $karma <username>

11:43 lazybot: <username> has karma 1.

11:43 brunov: oops

11:43 TimMc: gfredericks: Not yours, that's your evil twin gfrederick.

11:43 cbp: $karma so

11:43 lazybot: so has karma -9.

11:44 brunov: (inc arrdem)

11:44 lazybot: ⇒ 27

11:44 arrdem: (dec so)

11:44 lazybot: ⇒ -10

11:44 * arrdem wishes the bots could mutually recur

11:45 ohpauleez: I think we did that one day way back in the early days of two bots

11:45 arrdem: I may yet add my own bot to the mix just so that I can build a state machine out of bot replies...

11:46 cbp: only if it has a tip function

11:46 arrdem: cbp: it'll come with dogetip :P

11:46 technomancy: your css is horked

11:47 hyPiRion: arrdem: he knows

11:47 arrdem: hyPiRion: I don't blame him for not fixing it, just thought I'd make sure

11:48 ,`(~@nil)

11:48 clojurebot: nil

11:49 arrdem: ,`[:foo :bar ~@(:foo nil)]

11:49 clojurebot: [:foo :bar]

11:51 TimMc: arrdem: hyPiRion got them to do a cycle-2 quine, and that's why lazybot now ignores clojurebot.

11:52 hyPiRion: arrdem: http://clojure-log.n01se.net/date/2012-12-17.html#22:30

11:53 arrdem: hyPiRion: haha nicely done

11:55 hyPiRion: ty

11:56 TimMc: Did I tell you about my new, probably impossible, challenge? Making a Piet quine.

11:56 I wonder how you go forward with that.

11:56 TimMc: Printing out some encoding of a Piet program?

11:57 hyPiRion: yeah, you can simplify it to some extent

11:57 say, print ints representing the colours

11:57 TimMc: Bonus points to print out in GIF format.

11:57 hyPiRion: yeah

11:58 or compressed png. Just need to encode zlib in the picture somehow

11:58 TimMc: There *is* a Piet compiler now, you know.

11:59 hyPiRion: yeah, some guy made an LLVM-based optimiser for it

11:59 http://allanwirth.com/piet/llvm-piet.html - there we go

12:01 TimMc: hyPiRion: No, I mean the other direction: Piet as target.

12:03 hyPiRion: TimMc: oh what, link please

12:03 TimMc: I'm still waiting on self-modifying Piet (using Logo commands, obviously.)

12:03 arrdem: turtle graphics fwt

12:03 TimMc: An assembler: http://www.toothycat.net/wiki/wiki.pl?MoonShadow/Piet

12:04 hyPiRion: I'll just wait on webyrd to make a quine generator for it

12:04 TimMc: :-)

12:04 ystael: TimMc: 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:05 TimMc: :-D

12:06 hyPiRion: hah

12:06 This is quickly getting out of hand

12:07 TimMc: I eagerly await the first self-modifying LogoPiet virus.

12:08 (Those malware analysis folks need something fun to do, right?)

12:09 "And in recent news, Brian Krebs has quit the security field and taken up carpentry."

12:09 hyPiRion: heh

12:25 mr-foobar: copyright help, I am lifting example code from eplv1 codebase. what is the best way to refer to it in my repo ?

12:27 adsisco: https://www.irccloud.com/pastebin/WsnKQpFk

12:27 how to get the function to resolve i and j?

12:30 gfredericks: adsisco: i and j should work fine there

12:30 what's the exact error msg?

12:31 hyPiRion: yeah, would be surprised if that doesn't work.

12:33 adsisco: just figured it out, the parse-float function ain't working

12:33 https://www.irccloud.com/pastebin/Nuvr3msy

12:33 whats the equivalent of Integer. for float?

12:34 parse-int works perfectly for me

12:34 but not the other

12:34 arrdem: Double/parseDouble?

12:34 gfredericks: check what re-find returns when you call it with your arg

12:34 arrdem: floats are a sad datatype

12:34 hyPiRion: adsisco: Double. or Double/parseDouble

12:34 adsisco: lol, double is an overkill for something with 2 decimal place max

12:35 gfredericks: it's standard

12:35 hyPiRion: Prefer parseDouble for performance

12:35 adsisco: alright letme switch

12:35 gfredericks: clojure will prollably turn your float into a double anyhow

12:35 arrdem: yeah. clojure defaults to using doubles, ratios and longs.

12:35 gfredericks: ,(def f (float 3.14))

12:35 clojurebot: #'sandbox/f

12:35 gfredericks: ,(type f)

12:35 clojurebot: java.lang.Float

12:35 gfredericks: ,(type (* 2 f))

12:35 clojurebot: java.lang.Double

12:36 arrdem: gfredericks: some of that is the clojure.lang.Number.multiply() signature tho..

12:36 gfredericks: arrdem: okay?

12:36 ,(type (* f f))

12:36 clojurebot: java.lang.Double

12:37 arrdem: nevermind, I thought that java.lang.Number.multiply was λ Number → Number → Double for some reason not \

12:37 kzar: gfredericks: 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:37 arrdem: but it's λ Number → Number → Number

12:38 gfredericks: kzar: a leiningen variable?

12:38 kzar: I think _JAVA_OPTIONS did it in the end

12:38 the lein ones didn't work

12:39 gfredericks: yeah I think they apply to leiningen's jvm rather than the project jvm

12:40 kzar: Does 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:42 hyPiRion: kzar: you can use iterative deepening DFS instead

12:42 http://en.wikipedia.org/wiki/Iterative_deepening_depth-first_search

12:42 kzar: oo thanks

12:43 arrdem: Bronsa: have you tried replacing clojure.core/load with t.[ae].jvm?

12:44 Bronsa: arrdem: yep

12:45 arrdem: Bronsa: 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:46 Bronsa: arrdem: i loaded clojure.core with that, and I believe I tried it on core.match and core.rrb-vector aswell

12:47 mr-foobar: about to push to npm, basically runs lein commands from npm .. https://github.com/harsha-mudi/lein-node is the Copyright Notices sufficient ?

12:48 Bronsa: arrdem: right now te only issue I'm aware of with t.e.j is the one related to TANAL-24

12:50 mdrogalis: bbloom: Learned a new phrase from you. Second system effect. I didn't know there was a term for that :)

12:51 bbloom: mdrogalis: i'm sure you've experienced though, right? :-)

12:51 mdrogalis: bbloom: Yes :)

12:54 arrdem: ah The Mythical Man Month...

12:55 Bronsa: sweet! next on the list is reading in to t.e.jvm, I'll let you know if I find anything.

13:34 ambrosebs: bbloom: sheesh, any other haskellers on twitter that I should pre-emptively block?

13:36 arrdem: +1 "angry haskellers list"

13:36 cbp: the whole bytemyapp following list :-P

13:36 arrdem: cbp: hehe

13:37 technomancy: cbp: except bitemyapi

13:38 arrdem: technomancy: I still owe you a bot for that..

13:42 sdegutis: Is there a cleaner way to say "give me the value of the first argument" than this? (fn [% & _] %)

13:42 technomancy: (comp first list) maybe

13:43 more chars, fewer tokens

13:43 sdegutis: Hmm for some reason I thought that wouldn't work as a variadic function, but sure enough it does.

13:44 forzajuve: !LIST

13:44 CIAO

13:44 !LIST

13:44 !list

13:45 sdegutis: I should probably be using polymorphism a little more fully.

13:52 Or maybe I should ditch defmulti and just use case statements.

13:57 bbloom: ambrosebs: that guy was crazy, right?

13:58 i should publish my block list somewhere :-P

13:58 at one point i had considered a "startup" that was just a crowd sourced block list

13:58 so i could autoblock people across all services, even those i hadn't signed up for yet... forever

13:59 ambrosebs: bbloom: really strange way to wake up reading that thread

13:59 not sure what happened

13:59 :)

13:59 bbloom: :shrug:

13:59 * bbloom goes back to enjoying his filter bubble

14:01 adsisco: how 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:02 brunov: adsisco: string/join may be helpful

14:02 or just replace on the string

14:02 adsisco: oh yea, replace would be easy!

14:02 thanks

14:03 brunov: np

14:22 Guest33471: im 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:22 daniel___: is this a java class that should be generally available?

14:22 or am i missing an import?

14:24 dbasch: it’s java.security.KeyPairGenerator

14:24 amalloy: daniel___: http://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html

14:24 specifically, you probably want http://docs.oracle.com/javase/7/docs/api/java/security/KeyPairGenerator.html#getInstance(java.lang.String) or something

14:25 daniel___: amalloy, yes i do

14:25 dbasch: ,(java.security.KeyPairGenerator/getInstance "RSA")

14:25 clojurebot: #<ExceptionInInitializerError java.lang.ExceptionInInitializerError>

14:25 amalloy: &(java.security.KeyPairGenerator/getInstance "RSA")

14:25 lazybot: java.lang.SecurityException: You tripped the alarm! clojail.testers.ClojailWrapper@17b15f3 is bad!

14:26 amalloy: huh

14:27 ah. lazybot won't let you touch java.security.*

14:27 dbasch: reasonable

14:27 amalloy: yeah, indeed so; i just don't remember doing that

14:28 daniel___: anyway, thanks for the pointers

14:40 devn: Can you do this in a for? (for [x xs :let [[ys _] x] y ys :let [[q r] y] ...)?

14:42 arrdem: devn: yup

14:42 devn: yeah i just tested it

14:42 color me surprised

14:43 arrdem: well you're erc-color'd orange for what it's worth

14:44 devn: you're yellow in my irssi

14:44 llasram: arrdem: and you're bluuuue

14:44 amalloy: devn: why would you not be able to?

14:44 devn: ...coward

14:44 amalloy: i just haven't ever done it.

14:44 haven't seen it done

14:50 martinklepsch: I 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:52 hiredman: uberjar and then use s3cmd to upload it to s3

14:52 llasram: martinklepsch: Are you trying to deploy the uberjar just for arbitrary retrieval, or as in an S3-hosted Maven artifact repository?

14:53 martinklepsch: arbitrary retrieval

14:53 hiredman, thought that maybe something outside of leiningen might be the easiest way

14:53 llasram: Yeah, then ditto hiredman

14:58 someben42: Hi 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:59 hiredman: someben42: are your tests in test/ ?

14:59 someben42: Yup, in test/project-name/core_test.clj

14:59 llasram: someben42: And if the are, do their namespaces match their file paths?

15:00 e.g. project-name.core-test <-> test/project_name/core_test.clj

15:01 someben42: Yup, "(ns skream.core-test [:require..." is at the top of "test/skream/core_test.clj"

15:01 (Project is called "skream", abbreviation for "sketching & streaming lib")

15:02 llasram: someben42: And you don't have any files which accidentally duplicate the test namespace?

15:02 someben42: Hmm.

15:02 llasram: someben42: Oh, neat -- like HLL, count-min, etc?

15:05 someben42: Yup, exactly like HLL, count-min, etc. :)

15:05 https://github.com/someben/skream

15:06 Project hierarchy is a mess for now, that is why I am trying to get "lein test" to play nice.

15:07 radix: can 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:07 someben42: radix -- talks TO a REST, or IS a REST?

15:08 radix: someben42: client, talking TO a REST

15:08 someben42: I'm no help. The other side I do FPishly.

15:08 radix: I 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:09 arrdem: is it ring with the request standard format?

15:09 radix: and 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:09 arrdem: radix: right. there are existing clients that allow for this. I think.

15:09 radix: but 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:10 like, say you want to parse the JSON response and convert it to something a bit more nice

15:10 I could just do (process-twitter-followers-response (do-io (get-twitter-followers "radix"))), but that's a bit verbose

15:11 "do-io!", of course ;-)

15:11 so 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:12 just some thoughts I'm juggling

15:12 arrdem: do you have an idea of which?

15:14 arrdem: radix: 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:14 someben42: llasram -- just grep for the word "test" in the whole hierarchy, and no surprises. So I do not think the namespace is getting stomped.

15:16 radix: arrdem: ok. something I'll continue to consider.

15:16 lemonodor: radix: 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:17 radix: hmm.

15:17 yeah, could be

15:17 lemonodor: that is, i think there’s a point of diminishing returns in accepting higher order functions and achieving pure FP.

15:17 i mean, we all use defn.

15:17 radix: lemonodor: well, I agree

15:18 someben42: My entire app is just lambdas. A stack of lambdas all the way down.

15:18 radix: lemonodor: but I will point out the qualitative difference with defn is that it basically builds "startup" state, instead of runtime state

15:18 lemonodor: radix: true

15:18 arrdem: I'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:19 radix: so, yeah, my most immediate concern is one of internal factoring to enable ease of unit testing

15:19 I do have kind of an eye on a larger ecosystem concern, though

15:20 right now the vast majority of clojure libraries that do this kind of stuff are inflexible about replacing the way IO is done

15:22 arrdem: I 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:22 just don't "solve" it with a dynamic var please :D

15:22 radix: heh heh

15:22 sdegutis: I just made two.

15:23 radix: arrdem: so, yeah, I don't think just parameterizing the do-io is even good enough

15:23 if you want to either use synchronous or asynchronous IO, you can't just call (do-io) and expect a meaningful result, for example

15:23 and yes you will never find me using dynamic vars ;P

15:25 arrdem: my 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:34 radix: yeah, 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:35 cbp: radix: maybe get-twitter-followers can attach a queue of operations to do next as metadata?

15:36 arrdem: yeah 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:41 radix: yeah, kinda like Deferreds

15:41 but a little bit inside-out

15:42 stuartsierra: core.async channels?

15:42 radix: anyway, this has been quite helpful, thanks for the ping-pong :)

15:42 ohpauleez: Yeah, why not just put a channel on a channel?

15:43 and then your "bind" is just putting a value on the inner value channel

15:43 radix: I should learn more about those :)

15:43 kzar: Another dumb question, how could I do something like this except with a dynamic number of ranges instead of just two?

15:44 ,(for [a (range 3) b (range 3)] [a b])

15:44 clojurebot: ([0 0] [0 1] [0 2] [1 0] [1 1] ...)

15:44 ohpauleez: Or, 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:44 the go will return a channel, and you can optionally block on it

15:45 joegallo: kzar: you could (apply map vector ...) i think

15:45 ,(apply map vector [(range 1 3) (range 3 5) (range 5 7)])

15:45 clojurebot: ([1 3 5] [2 4 6])

15:46 ohpauleez: that will only give him the first of all, the second of all, the third of all

15:46 not the iterations

15:46 I thought the same thing initially

15:46 joegallo: ah yes, quite right!

15:49 kzar: hmm

15:50 OH and another thing, I need it to be a lazy sequence

15:51 amalloy: kzar: i mean, that's in clojure.math.combinatorics, probably called cartesian-product

15:52 you 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:52 kzar: amalloy: Oh looks like you wrote about it on stack overflow http://stackoverflow.com/questions/18246549/cartesian-product-in-clojure

15:53 amalloy: oh, that's good. i was just about to rewrite it

15:53 but my answer there is more thorough

16:04 ff0066: any users of schema here?

16:05 kenrestivo: {blake}: um, add some facts? (i'm guessing you're using midje)

16:07 rasmusto: I 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:08 someben42: Fixed 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:08 sdegutis: Ho there!

16:08 I have a curious finding.

16:10 Observe:

16:10 ,(do (def ^:dynamic lang) (let [f (constantly lang)] (binding [lang :english] (f))))

16:10 clojurebot: #<Unbound Unbound: #'sandbox/lang>

16:11 sdegutis: Is this because (constantly) captures the current value of lang, as opposed to the var itself, though it be unbound?

16:12 magopian: ustunozgur: hey ;) I'm Mathieu, we talked about clojure (and are supposed to switch to clojure right?) at djangocon, during an evening meal ;)

16:12 ustunozgur: not sure how/when to switch for the moment though ;) (I'm going through the SICP videos, they rock)

16:17 amalloy: sdegutis: constantly necessarily does evaluate its input right away, and save that

16:17 ie, (constantly x) is different from (fn [] x) if x is something that can be mutated

16:17 sdegutis: In which case, if I want it to evaluate a re-bound dynamic var, must I capture it via (fn [] x)?

16:18 I like the property of (constantly) where it takes any number of args. This cannot be emulated as cleanly with a plain closure.

16:19 amalloy: well, of course it can

16:19 (fn [& args] x)

16:19 #(do %& x)

16:20 sdegutis: The second one "evaluates" the items though.

16:20 Anyway thanks. I'll do that.

16:24 amalloy: sdegutis: huh? what about evaluating?

16:24 (fn [& args] x) and #(do %& x) are identical in every way

16:24 sdegutis: amalloy: #(do %& x) expands to (fn [& args] (do args x))

16:25 amalloy: yes, which is identical to (fn [& args] x)

16:25 "evaluating" a seq for side effects doesn't do anything

16:25 it was already evaluated when you passed it to the function

16:26 sdegutis: Okay.

16:28 hyPiRion: ,(apply (fn [& args] 10) (map #(println %) (range 5)))

16:28 clojurebot: 0\n1\n2\n3\n4\n10

16:28 hyPiRion: In that case though, apply does the evaluation, not the function

16:32 amalloy: gtrak: 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:32 gtrak: hrm...

16:32 whoa..

16:32 I'm suspecting some maven artifact shenanigans.

16:34 amalloy: seems plausible. should i nuke (some part of) my .m2 or something?

16:34 gtrak: I think so. I downloaded clean artifacts just now, and it worked fine.

16:34 just kill org/eclipse

16:35 they've done this before and ztellman patched it.

16:35 different error, though.

16:36 if that doesn't work, I might have to update to a newer version of eclipse-jdt

16:37 kzar: Is there a way to check if a number is divisible by another number and get the result at the same time?

16:38 amalloy: kzar: use / and check if the result is an integer or a ratio?

16:39 gtrak: 0.00000000000004

16:39 sdegutis: I am seriously running into dependency circles right now.

16:40 kzar: amalloy: 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:40 dbasch: you could also do (juxt quot rem)

16:40 kzar: (By better I mean faster / idiomatic I guess)

16:40 gtrak: sdegutis=[r*cos(theta) rsin(theta)]

16:40 err wait, that's a line.

16:40 amalloy: kzar: as so often is the case, faster/idiomatic are opposing forces. you can't ask for both of them

16:41 gtrak: try that

16:41 take the cosine.. :-)

16:41 sdegutis: gtrak: doesn't work

16:41 kzar: amalloy: Heh shucks. Well how do I check if something's an integer / ratio?

16:42 amalloy: &(doc integer?)

16:42 lazybot: ⇒ "([n]); Returns true if n is an integer"

16:42 amalloy: &(doc ratio?)

16:42 lazybot: ⇒ "([n]); Returns true if n is a Ratio"

16:42 kzar: lol whoops

16:42 * kzar goes to the naughty corner

16:42 gtrak: kzar: well, that will tell you the type, that won't tell you if 0.0 is an integer.

16:42 hyPiRion: ,(ratio? 1/1)

16:42 clojurebot: false

16:42 hyPiRion: =(

16:42 amalloy: it's okay, i was just guessing

16:42 gtrak: ,(integer? 1.)

16:42 clojurebot: false

16:42 amalloy: hyPiRion: well, 1/1 reads as 1, i think

16:43 gtrak: you said 'number' before, so you need to be more specific.

16:43 kzar: I think just filtering by integer? is going to be fine in my case

16:43 sorry for ambiguous question

16:43 amalloy: gtrak: floats are never divisible by anything. they're awful

16:43 hyPiRion: amalloy: all ratios are reduced, yes.

16:44 amalloy: gtrak: after destroying .m2/org/eclipse, and running `lein clean` on my AOTed project, i still have the same issue

16:44 let me try it in some other project

16:44 hyPiRion: oh nevermind, we have `rational?`.

16:44 sdegutis: gtrak: https://www.dropbox.com/s/w4307mnwzgxpwmg/Screen%20Shot%202014-05-19%20at%203.36.36%20PM.png

16:44 gtrak: sdegutis: what is that?

16:44 amalloy: oh interesting. it works in another project. i wonder what's wrong with this one

16:44 sdegutis: gtrak: your equation

16:44 it dosn't work

16:45 hyPiRion: although I really really hate that denominator and numerator doesn't work on integers/longs

16:45 gtrak: amalloy: perhaps you have multiple classes with the same name in your classpath.

16:45 at least, that's greppable.

16:45 amalloy: how would i find that out?

16:46 gtrak: if lein-pprint won't tell you enough, you could use uberjar.

16:47 technomancy: there's a getResources or something method you can call on classloaders for that

16:49 pbostrom: is 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:50 amalloy: i 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:50 gtrak: technomancy: yea, that's how data_readers works.

16:50 amalloy: i guess i'd pick 2 so that it's easier to inspect the state at the repl

16:51 hyPiRion: pbostrom: If state really is needed, I'd do (def ^:private state (atom 0))

16:51 still available at repl

16:51 arrdem: pbostrom: 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:52 amalloy: arrdem: i disagree re: (1). it's just as fine as (2)

16:52 arrdem: amalloy: 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:52 hiredman: 1 is terrible

16:53 arrdem: amalloy: at least with 2 you can recover that state explicitly.

16:53 Frozenlock: I'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:53 arrdem: Frozenlock: (read-string (slurp "seekret.edn"))

16:54 pbostrom: thanks for the feedback, for some reason "1" has gotten a lot of traction on a project I'm working on

16:54 hiredman: 1 makes it difficult to inspect and manipulate the atom from the repl, why do that to your self?

16:54 amalloy: gtrak: 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:54 arrdem: Frozenlock: I actually have several projects where I do that :P

16:54 Frozenlock: arrdem: that seems too simple :-p

16:54 amalloy: okay, i'll back-pedal on (1). closing over an atom is a lot less pleasant than closing over something pure

16:55 gtrak: amalloy: very odd. Do you use a private maven-repo?

16:56 amalloy: well, 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:56 gtrak: seems like that wouldn't explain why it works in the other project.

16:57 pbostrom: I think the motivation for "1" is that it prevents you from trying to get at it from another namespace

16:58 gtrak: unless that project uses central, and broken doesn't.

16:58 lemonodor: amalloy: oh, you’re at factual? are you in LA?

17:00 sdegutis: What is the best practice to avoid this error? No method in multimethod 'foobar' for dispatch value: "test"

17:00 Must I manually specify an empty require for every file which uses defmethod?

17:00 If so, where is generally the acceptable place to do so?

17:01 Is it common to have a "load" namespace whose purpose is to just load other namespaces?

17:01 These are my questions. Thank you.

17:03 amalloy: lemonodor: yes i am

17:03 arrdem: Bronsa: 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:03 lemonodor: ah, cool. me too. i used to work with myron ahn, though now i see he doesn’t seem to be at factual anymore.

17:03 amalloy: yeah, he and i did not overlap

17:04 i have found and cursed some of his code, though

17:05 sdegutis: I am starting to remember why I tore every defmethod and defmulti out of the codebase a year ago.

17:05 amalloy: gtrak: 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:05 gtrak: oh, ok :-)

17:06 hopefully it's just an isolated thing.

17:06 bbloom: sdegutis: use (:require [whatever :refer (themultimethod)])

17:06 rather then (defmethod whatever/themultimethod ...)

17:06 arrdem: bbloom: I believe that sdegutis is referring to loading namespaces defining multimethod implementations, not the multimethod itself.

17:07 bbloom: arrdem: oh

17:07 arrdem: but I may be misreading.

17:07 bbloom: yeah, that's a bit of a pain

17:07 namespaces != modules and the mutability of namespaces is a mixed blessing

17:08 arrdem: sdegutis: I think that the real answer is that to the greatest extent that you can you want to centralize your defmethods

17:08 bbloom: sdegutis: arrdem: i've considered what a better approach would be... whatever it is, you could probably build it with my dispatch-map library

17:08 dispatch-maps are mergable

17:09 sdegutis: Ah, now I understand why this is so hard.

17:09 I'm using multi-methods all wrong.

17:10 defmulti 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:10 arrdem: I wouldn't go that far... see clojure.algo.generic

17:11 meajure is based entirely on extending algo.generic multimethods.

17:11 technomancy: sdegutis: 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:11 sdegutis: arrdem: That looks unrelated.

17:11 technomancy: you could use bultitude to scan for everything under my.multimethod.* and require it

17:12 sdegutis: Okay I may do this.

17:12 arrdem: sdegutis: 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:13 sdegutis: But it sounds so hacky for just wanting to have a switch-case split out into two different files.

17:13 arrdem: (dec so)

17:13 lazybot: ⇒ -11

17:13 technomancy: (dec so)

17:13 lazybot: ⇒ -12

17:13 sdegutis: arrdem: I have no idea what you're talking about.

17:13 arrdem: technomancy: I'm just downvoting him whenever I use his name

17:13 s/him/*indeterminate-gender*/g

17:14 sdegutis: I 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:14 Surely it can't be this difficult or involved of a task?

17:14 technomancy: sdegutis: just use a function

17:14 arrdem: sdegutis: go look at the jvm code backing a multimethod and then say that again.

17:14 technomancy: if the dispatch doesn't actually change at runtime then multimethods make no sense

17:15 sdegutis: Okay. I'll investigation pure functions then.

17:15 arrdem: which means you have to load _all the code_ defining dispatch values.

17:15 technomancy: sdegutis: with-redefs in a fixture

17:15 is the way to go

17:16 sdegutis: Yeah, I've been trying to avoid that because it'll have a lot of boilerplate.

17:16 When 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:17 technomancy: that doesn't sound like use-fixtures

17:17 oh, you're doing the opposite

17:17 gtrak: sdegutis: defmulti and defmethod probably shouldn't be used in different files *in the same project*

17:17 technomancy: yeah, that sounds tedious. just replace the production version with the test version in a fixture.

17:18 sdegutis: And leave the production version "default"?

17:18 gtrak: unless just for normal code organization reasons. It needs to work for 'open extension' to be a thing.

17:18 technomancy: sdegutis: yeah, the tests shouldn't have enough config to do anything "dangerous" anyway

17:18 sdegutis: That's true.

17:19 The only difficulty now will be adding global around-each functionality to Speclj, so I don't have to modify every single test file.

17:25 arrdem: ,(doc box)

17:25 clojurebot: excusez-moi

17:26 arrdem: ,(doc condp)

17:26 clojurebot: "([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:26 * arrdem gets a repl

17:27 blr: does anyone use clojuredocs.org? find the documentation versions capped at 1.3 a little disconcerting

17:27 bbloom: ~clojuredocs

17:27 clojurebot: Excuse me?

17:28 bbloom: clojurebot: clojuredocs is out of date & seems to be abandoned by the maintainer

17:28 clojurebot: 'Sea, mhuise.

17:28 bbloom: blr: ^^

17:28 blr: bbloom: ah thank you, that's a pity, looked promising

17:28 technomancy: blr: it's not as useful as it is in most languages since all the docs are available at any time in the repl

17:29 blr: technomancy: I continuouly forget this, need to make more use of (doc)

17:29 Bronsa: arrdem: 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:29 noonian: what 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:29 arrdem: blr: just tweak your lein profile to inject a (use 'clojure.repl) into user on boot

17:30 blr: it's been life changing :P

17:30 Bronsa: arrdem: 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:30 blr: arrdem: cool thank you, I'll give that a go :)

17:31 arrdem: Bronsa: agreed. I'll ponder and do a straw poll on clj-dev.

17:45 sdegutis: All I need to do is write a bouncing function that creates a function which bounces to another function.

17:45 I'll call it "pogo-stick".

17:45 gfredericks: sdegutis: that's different from trampoline?

17:45 arrdem: (inc gfredericks)

17:45 lazybot: ⇒ 59

17:45 sdegutis: gfredericks: what's trampoline?

17:45 gfredericks: it's pogo-stick

17:46 bbloom: (doc trampoline)

17:46 clojurebot: "([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:46 sdegutis: After reading those docs, I have absolutely no idea how to use that.

17:46 gfredericks: I did something trampoline-like in a patch for an issue with reduce; no idea if it'll get accepted

17:46 or even recognized as a problem

17:47 sdegutis: No, trampoline is completely unrelated.

17:47 So completely unrelated.

17:47 This is the worst suggestion ever.

17:47 amalloy: gfredericks: eh?

17:48 gfredericks: amalloy: I'll dig it up

17:48 amalloy: http://dev.clojure.org/jira/browse/CLJ-1237

17:48 amalloy: oh yeah, that's a fun one

17:49 pretty cool that you found a fix

17:49 Bronsa: (inc gfredericks)

17:49 lazybot: ⇒ 60

17:49 bbloom: ,(letfn [(even? [x] (or (zero? x) (odd? (dec x)))) (odd? [x] (not (even? x)))] (even? 12))

17:49 clojurebot: true

17:49 bbloom: ,(letfn [(even? [x] (or (zero? x) (odd? (dec x)))) (odd? [x] (not (even? x)))] (even? 12000000))

17:49 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

17:49 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 12)))

17:49 clojurebot: false

17:49 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 1200000)))

17:49 clojurebot: false

17:49 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 120000000)))

17:50 clojurebot: false

17:50 gfredericks: bbloom: that's a cool example

17:50 amalloy: bbloom: (trampoline (even? x)) is a bit weird. it's fine, but i'd have written (trampoline even? x)

17:50 bbloom: gfredericks: it's the quintessential mutual recursion example

17:50 amalloy: actually, it's not fine, since then it fails for 0

17:50 bbloom: amalloy: ah, i forgot that trampoline does that

17:50 gfredericks: bbloom: I must not be up on the mutual recursion examples

17:51 amalloy: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline (even? 0)))

17:51 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn>

17:51 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline even? 120000000))

17:51 clojurebot: false

17:51 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] #(not (even? x)))] (trampoline even? 0))

17:51 clojurebot: true

17:51 bbloom: amalloy: fixed. thanks for bug report / code golf

17:51 sdegutis: This is what I'm trying to avoid:

17:51 https://gist.github.com/sdegutis/b33022da80005fbe7914

17:52 amalloy: bbloom: why is (trampoline even? 1200000000) false?

17:52 bbloom: haha no idea

17:52 whoops

17:52 gfredericks: sdegutis: I think you want component & protocols

17:52 bbloom: amalloy: the not

17:52 amalloy: duh.

17:52 * bbloom sucks

17:52 bbloom: eh, don't really need that # anyway:

17:52 ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (not (even? x)))] (trampoline even? 0))

17:52 clojurebot: true

17:53 bbloom: better

17:53 ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (not (even? x)))] (trampoline even? 12000000))

17:53 clojurebot: false

17:53 bbloom: or not

17:53 wow. trampoline is hard

17:53 zerokarmaleft: heh

17:53 bbloom: i 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:53 amalloy: bbloom: ah. because (even? x) returns a function, and (not (even? x)) is always false

17:54 bbloom: amalloy: yeah, that's the annoying bit. i had to create a propegate helper function

17:54 something like:

17:54 (propegate (event? x) not)

17:55 (defn propegate [x f & args] (if (fn? x) #(apply f (x) args) (apply f x args)))

17:55 ,(defn propegate [x f & args] (if (fn? x) #(apply f (x) args) (apply f x args)))

17:55 clojurebot: #'sandbox/propegate

17:55 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (propegate (even? x) not))] (trampoline even? 12000000))

17:55 clojurebot: false

17:55 bbloom: sheesh, i give up at programming

17:56 amalloy: bbloom: i let it go the first three times, but seeing propagate persistently spelled wrong is killing me

17:56 bbloom: hahaha you corrected me on this one other time

17:56 i suck at that word

17:56 apparently i also suck at programming

17:56 * bbloom quits

17:56 bbloom: anyway, *this* is the sort of case where i actually want a type system

17:56 amalloy: oh my gosh. now you've got me grepping the irc logs for propegate

17:57 bbloom: when i have some stupid type error b/c i need to jump hoops to please the solution domain

17:57 amalloy: it's just me sucking at this word, nobody else

17:58 amalloy: oh yeah, https://gist.github.com/brandonbloom/6416765 - didn't even show up in the logs

17:59 good times

18:00 bbloom: haha

18:00 that's exactly the example i was talking about

18:00 amalloy: oh now i remmeber the issue

18:00 (x) may itself return an fn

18:00 so you need like a subtrampoline

18:00 but you don't want that b/c that can grow stack too

18:01 eh, trampolines are shit to work with

18:01 fortruce: is it possible to ask lein if any of your dependencies have a newer version?

18:01 amalloy: bbloom: trampoline is a clean solution only if your original mutually-recursive solution is tail-recursive

18:01 blr: fortruce: yeah, there's lein-ancient

18:01 amalloy: fortruce: i think uh...lein-ancient?

18:01 arrdem: fortruce: there's lein-ancient, but you have to install it

18:01 fortruce: thanks

18:04 blr: anyone 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:05 technomancy: company is supposed to be better than auto-complete but I haven't used it

18:05 blr: ok, I'll give that a shot thanks technomancy

18:06 autocomplete is just handy for api discovery.. keep me out of the evil browser :)

18:06 technomancy: regular completion should work without auto-complete.el

18:09 blr: technomancy: 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:10 I've ordered one for my son

18:10 bbloom: amalloy: even / odd can be made tail recursive... shoulda done that :-P

18:10 amalloy: bbloom: yes, but if you do that it's not the classic example of mutual recursion

18:11 which i presumed was the point

18:12 cbp: blr: company works well with cider but afaik doesnt fetch docstrings

18:13 blr: cbp: ok, I'll have a play at any rate

18:13 technomancy: blr: 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:14 cbp: company also works with clojurescript if you use austin while ac doesn't

18:14 blr: yeah, 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:14 bbloom: amalloy: sure i can still can be... you just need to encode the base case in to both functions

18:15 blr: haven't got around to setting up austin yet, but brehaut was telling me it's rather good

18:15 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (if (zero? x) false #(even? (dec x))))] (trampoline odd? 3000000))

18:15 clojurebot: false

18:16 bbloom: ,(letfn [(even? [x] (or (zero? x) #(odd? (dec x)))) (odd? [x] (if (zero? x) false #(even? (dec x))))] (trampoline odd? 3000001))

18:16 clojurebot: true

18:16 bbloom: amalloy: ^^

18:16 fortruce: anyone 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:16 amalloy: indeed, that works fine

18:16 although (if (zero? x) false foo) is (and (pos? x) foo)

18:17 bbloom: amalloy: sure, i was just looking at https://en.wikipedia.org/wiki/Mutual_recursion

18:17 to make sure i was staying true to the quintessential-ness of my example

18:18 anyway we all failed to help sdegutis

18:18 sdegutis: No no, it's fine, I'm concocting some function to do this trampolining for me.

18:18 bbloom: sdegutis: with redefs works, but there's also the OOP-approach w/ a protocol

18:19 blr: fortruce: did you find the usage example in https://github.com/technomancy/leiningen/blob/master/sample.project.clj?

18:19 bbloom: or the less OO-ish-OO approach: an explicit map of functions

18:19 sdegutis: i've felt the need for modules like this several times, tho

18:20 but honestly, OOP techniques are probably most clojure-ish, despite being unclojurey :-P

18:20 sdegutis: I started with a map of functions actually.

18:20 And I'll probably end there.

18:20 bbloom: lots of boiler plate tho to create the interface namespace with a dynamic var & that has shortcomings too

18:21 sdegutis: Yeah, there's just no real good solution to this.

18:21 In another language maybe, but not Clojure.

18:21 bbloom: i mean... ML Modules are pretty good :-P

18:21 fortruce: blr: 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:21 bbloom: but yeah, this is a major short coming of clojure IMO

18:22 9 times out of 10, i do the very java-y thing and make a service protocol

18:22 sdegutis: Clojure just assumes you'll be using the simplistic defmulti, or Java polymorphism.

18:22 technomancy: bbloom: really? replacing a function for testing is a major shortcoming?

18:23 fortruce: as 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:23 bbloom: technomancy: no, the issue is that there is no mechanism for stable/lexical implicit passing mechanism

18:24 with-redefs works fine for a few functions for testing or whatever

18:25 i'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:26 you can just do explicit map, which is as good as implicit after you've gotten over that first explicit map :-)

18:39 arrdem: clojurebot: 1d6

18:43 Bronsa: something tells me this shouldn't NPE... https://www.refheap.com/85650

18:52 Bronsa: arrdem: check https://github.com/clojure/tools.emitter.jvm/blob/master/src/main/clojure/clojure/tools/emitter/jvm.clj#L33-L35

18:53 arrdem: Bronsa: I see it, can I trouble you for an explanation of the ^:once fn*?

18:53 Bronsa: arrdem: also you're not gonna get much out of that unfortunately

18:54 arrdem: Bronsa: it's a wrapper around inc. how much do you think I wanted? :P

18:56 Bronsa: arrdem: 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:59 arrdem: 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:59 arrdem: that justifies, the wrapping fn*, ^:once is there for locals clearing purposes

19:00 arrdem: Bronsa: Ah. Okay. Yeah I tweaked that so it worked and the bytecode I got was indeed fn as a value code.

19:00 gfredericks: core.logic has an inc doesn't it? I feel like I remember that standing for something unexpected

19:01 arrdem: gfredericks: I think there's an inc⁰ definition in the Reasoned Schemer...

19:01 gfredericks: I had to stare at that code for a long time once upon a time

19:03 every time I see it I think of 'increment' but I swear it meant something different

19:03 amalloy: inconclusive-o

19:03 gfredericks: man there's a lot of words that start with inc

19:03 incognito

19:04 just glanced at all of them and I give up.

19:06 amalloy: you just have to go through them incrementally

19:07 you don't want to be regarded as an incorrigible quitter, do you?

19:07 Bronsa: (inc amalloy)

19:07 lazybot: ⇒ 109

19:07 amalloy: lazybot: ?????

19:07 Bronsa: wow.

19:07 amalloy: ah, there he is

19:07 rasmusto: (inc redible)

19:07 lazybot: ⇒ 1

19:08 amalloy: Bronsa: best not to encourage me. if i think i can get karma from wordplay #clojure will never hear anything else from me

19:08 rasmusto: amalloy: 1 pun per day is fine

19:10 amalloy: i don't think that counts as a pun, though

19:10 rasmusto: I guess that's true

19:11 (run* [q] (puno q))

19:11 amalloy: though wikipedia seems to claim it isn't wordplay either. just a weird fixation with the prefix "inc"

19:11 s/weird/incomprehensible

19:12 rasmusto: amalloy: :)

19:12 on a more serious note, what's the quick answer as to why kanren things end with e/o ?

19:12 amalloy: oh 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:12 locks: you lot are incorrigible

19:13 arrdem: locks: on the contrary, they are very encourageable.

19:13 amalloy: locks: i already did that one. you'll have to find a new word

19:13 rasmusto: amalloy: "Let's see" said the blind carpenter, as he picked up his ax and saw.

19:13 locks: oh :( I'm inconsolable now

19:13 amalloy: nice

19:13 arrdem: I refuse to upvote any of this on principle, funny as it is.

19:13 rasmusto: pr inc iple

19:14 pcn: Where's the up arrow?

19:14 amalloy: good on you. don't inculcate a habit like this, arrdem

19:14 locks: something something nil punning

19:17 amalloy: rasmusto: i forget what e and o come from. i recall that -o is supposed to mean "relational"

19:18 TravisD: This is off topic, but why is sdegutis booting everyone from #clojure-social?

19:18 amalloy: maybe they're being antisocial

19:18 locks: rasmusto: they explain it at the start of one of the videos

19:18 gtrak: huh, turns out #clojure-offtopic was registered in 2010 by Raynes.

19:18 arrdem: TravisD: he's on a mood today and isn't taking it well

19:19 gtrak: TravisD: I suggest we stop depending on him.

19:19 arrdem: gtrak: good, lets take the party over there

19:19 gtrak: but I liked the idea of the channel at any rate.

19:19 TravisD: Yeah, it should exist.

19:19 arrdem: Raynes: pls can have ops?

19:19 TravisD: anyways, I was just wondering if there was some administrative reason. I'll check back on it tomorrow

19:19 thanks

19:21 turbofail: perhaps he's feeling incontinent

19:22 locks: inconspicuous to say the least

19:22 amalloy: this whole discussion is getting incoherent

19:22 * cbp is one step from incinerating himself

19:23 locks: does anyone know what happened to pedestal's site?

19:24 ohpauleez: locks: There was a message on the mailing list

19:24 the docs are now being maintained in the repo

19:24 alongside the code, to keep them more in sync

19:24 TravisD: For anyone wondering, #clojure-offtopic has a few of us in it

19:24 locks: ohpauleez: oh

19:24 ohpauleez: do you happen to know of any video/tutorial thingies?

19:24 ohpauleez: at a later release (like 0.3.2 maybe), we'll restore the site with some new stuff

19:25 locks: I do, You should see Ryan's screencast, let me fetch you a link

19:25 {blake}: TravisD: Is it inclusive?

19:25 sdegutis: Solved 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:25 arrdem: {blake}: even of those with irritating characters in their names!

19:25 TravisD: {blake}: Seems pretty inclusive

19:26 sdegutis: I liked the idea of with-redefs or alter-var-root, but it would be more boilerplate that way.

19:26 ohpauleez: locks: Try this - http://www.oreilly.com/pub/e/3039

19:26 arrdem: \nick λ

19:26 {blake}: arrdem, TravisD: Seems sorta inchoate...

19:26 locks: ohpauleez: much obliged :)

19:26 ohpauleez: happy to help!

19:27 Pedestal has gotten some pretty exciting changes recently, with some interesting ones in the pipeline

19:28 TravisD: {blake}: Pfft, it's 4 years old. Registered in 2010

19:28 locks: the ideas seem pretty exciting, but as a noobie it's hard to wrap my head around them

19:29 sdegutis: TravisD: #clojure-social is closed for repairs

19:29 locks: ohpauleez: the webcast covers said changes?

19:29 cmwelsh: is lein-figwheel a good plugin for interactive clojurescript development?

19:29 sdegutis: also the residents of #clojure-social can't afford the repairs, so it will never be repaired

19:29 TravisD: sdegutis: Ah, so it's gone forever? :(

19:30 sdegutis: sure why not

19:30 ohpauleez: Here'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:30 gtrak: TravisD: isn't offtopic social enough for you?

19:30 ohpauleez: Pedestal also ships with some serious performance improvements in the Clojure web stack (and in general, like printing)

19:30 TravisD: gtrak: I just don't like change!

19:31 ohpauleez: and 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:31 gtrak: yea, 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:31 ohpauleez: locks: Some of it - it certainly take the approach that Pedestal is FAR simpler than people think

19:33 locks: ohpauleez: I remember a while back I was thinking about an architecture for a web service I had to develop

19:33 and some of the pedestral copy registered with my brain

19:33 felt validated :P

19:33 ohpauleez: totally :)

19:34 gtrak: Raynes: you're op in #clojure-offtopic :-)

19:34 locks: reading the "So what's happening with Pedestal 0.3.0?" blog post

19:35 man, react took the web by storm

19:35 amalloy: gtrak: he's in mexico today, getting smashed on some kind of company outing

19:35 i don't think he'll be giving anyone ops

19:36 gtrak: haha, good for him.

19:36 underage drinking for the win

19:36 technomancy: protip: it's not underage if you're in a country that doesn't have insane age limits

19:36 amalloy: i don't think it's underage in mexico?

19:37 arrdem: technomancy: 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:37 gtrak: locks: everyone's been doing it wrong for a really long time.

19:37 ohpauleez: Pedestal 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:37 amalloy: arrdem: i'm amazed you thought that was the case before hearing from technomancy

19:37 ohpauleez: CSRF protection bundled, secure headers bundled

19:37 locks: gtrak: haha :P

19:38 ohpauleez: Some small tweaks to make the logging even faster

19:38 arrdem: amalloy: I realized that some time back in high school long before I started lurking here :P

19:38 ohpauleez: and some improvements on the async handling core

19:38 That's the Paul deGrandis unofficial changelog so far

19:39 locks: ohpauleez: I remember seeing a talk about web security in clojure

19:39 and it painted a dark picture

19:39 technomancy: ohpauleez: hey, are you still interested in my touchstream?

19:39 ohpauleez: technomancy: Hey man, not at the moment, my keyboard budget is all dried up

19:39 locks: Not so for Pedestal

19:40 technomancy: ohpauleez: no worries; I'll try ebay or something

19:40 ohpauleez: Out 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:40 locks: good to know

19:40 ohpauleez: You can use the built in stuff, or bring your own (ala SpringSecurity or anything else you want)

19:43 Everyone should fee free to ping me here (when I'm in here) or on Twitter with Pedestal questions :)

19:43 blr: ohpauleez: 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:44 ohpauleez: blr: 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:44 Since routes are just data in Pedestal, it's easy to generate them. We just made some reader literals and generated the entire application

19:45 blr: yeah I think ryan mentioned last year that something was in the works, but haven't been tracking the project's progress

19:45 ohpauleez: blr: I'd give Ryan's presentation (linked above) a quick watch, I think you might find what you're looking for

19:45 blr: great, will check it out

19:48 Frozenlock: ohpauleez: IRC and twitter. What? No email? :-p

19:49 locks: people should stop inventing stuff for me to learn

19:50 ugh, so inconsiderate

19:57 Frozenlock: locks: There's worse: inventing stuff that requires you to know the underlying stuff. (Like cljs and JS)

19:57 locks: Frozenlock: I was trying to learn Om

19:58 talk about towers of abstraction

19:58 Frozenlock: oh, so you need to know JS, cljs, react and om. No big deal :-p

19:58 gfredericks: and html and css?

19:58 Frozenlock: Ah right, you can hardly use Om with only JS

19:58 locks: cljs also include google closure don't forget

19:59 blr: unfortunately that's just the nature of programming for the web

19:59 Frozenlock: And clojure, of course

19:59 locks: which means the jvm

19:59 and leiningen

19:59 which…

19:59 Frozenlock: Oh wow. I forget how much stuff I needed to learn just to make a hello world in cljs

20:00 It's so sad.

20:00 gfredericks: lein & lein-cljsbuild

20:00 & maven

20:00 lazybot: java.lang.RuntimeException: Unable to resolve symbol: maven in this context

20:00 Frozenlock: gfredericks: Actually I still don't know anything about maven.

20:00 locks: it's literally scary if you stop to find about it

20:00 *think

20:00 gfredericks: Frozenlock: the coordinate system at least

20:01 technomancy: it gets worse

20:01 Frozenlock: No, stooooop

20:01 locks: I actually my saturday messing with react

20:01 technomancy: the jvm runs on this thing called "x86_64"

20:01 locks: ported some widgets I had

20:01 technomancy: which is pretty bonkers

20:01 gfredericks: technomancy can't get anything done without learning about ocaml

20:01 technomancy: and that's all made out of these things called logic gates, which let me tell you; they are pretty nuts

20:01 locks: so that bit is shallowly gone over

20:02 Frozenlock: eh, you're pushing it a little too much. You CAN make a cljs app without knowing about x86_64

20:02 blr: turtles all the way down

20:02 locks: can you though

20:02 can you?

20:02 technomancy: don't get me started on the whole "electrons flowing through a conductor" thing

20:03 locks: but seriously

20:03 at least as far down as java it's pretty leaky

20:05 blr: locks: the alternative sadly is to capitulate to world of walled gardens, which is easier as a developer, but worse for everyone ultimately

20:06 Frozenlock: locks: I was so excited when I learned about cljs. "Yay, no need to learn JS!"

20:06 How wrong I was.

20:06 technomancy: it's weird considering how easy it is to not learn java

20:06 blr: have you read fogus's book Frozenlock? That's a nice perspective on javascript

20:07 locks: functional javascript?

20:07 it's pretty neat

20:07 Frozenlock: blr: I dont' think so. Any one-liner summary? I don't really have time these days :-p

20:07 amalloy: really, 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:07 Frozenlock: cljs is more leaky than clj in this regard

20:07 blr: Functional JavaScript yeah

20:07 technomancy: amalloy: I haven't written any either, but just gathering from ambient chatter that's the impression I get.

20:08 beamso: javascript allongé is another good javascript book

20:08 is it best to separate my namespaces between clj and cljs in the same project?

20:09 locks: Frozenlock: tl;dr: use underscore.js and underscore-contrib.js, program JS like it were cljs

20:09 nullptr: usually you have src/clj and src/cljs separated entirely, no harm in duplicating the namespaces

20:10 Frozenlock: beamso: You might want to use cljx for some namespaces too.

20:10 thearthur: is anyone else having trouble installing paredit package from marmalade today?

20:10 i'm getting: Wrong type argument: listp, No commentary.

20:11 locks: I guess cljs is more leaky because DOM

20:12 if you write GUI apps, clj will probably start leaking like a sieve

20:14 cmwelsh: does that mean clojure is a bad first programming language?

20:15 Frozenlock: It prepares you for the real world I guess. :-p

20:15 locks: that's a loaded question

20:15 blr: cmwelsh: scheme is probably a better language for education, given all the resources around it, particularly racket

20:16 epichero: the tooling for clojure is more complicated and the documentation is poor. I like clojure more, but i agree scheme would be much better

20:16 blr: there are some good learning resources for kids in particular in scheme

20:16 cmwelsh: what about something like codecademy that runs in a browser, will clojurescript ever have something like that?

20:16 gtrak: cmwelsh: how far down the rabbit hole are you willing to go?

20:16 locks: cmwelsh: it _has_ stuff like that

20:16 cmwelsh: 4clojure, clojure koans

20:17 gtrak: cmwelsh: IE, do you want kids reading java stacktraces?

20:17 technomancy: cmwelsh: it wouldn't be my first choice

20:17 Frozenlock: http://clojurescript.net/

20:17 locks: http://clojurescriptkoans.com/

20:17 tuft: underscorejs with knockout is pretty tolerable

20:17 gtrak: and having to learn the compiler to explain why they messed up?

20:17 locks: https://www.4clojure.com/

20:17 cmwelsh: I'll check those out. I want to make a site like codecademy but JavaScript can be such a difficult first language as well

20:18 I don't know clojure very well but I like what I have seen

20:18 epichero: i'm still lost with java stacktraces… i can handle GDB

20:18 gtrak: I think javascript's a good choice, because browsers are everywhere. In 1995 it was qbasic.

20:18 locks: I like JavaScript actually

20:18 technomancy: "your first language can be anything, as long as your second language makes you wonder what the hell was wrong with your first"

20:18 locks: for all it's faults

20:19 what was the saying

20:19 can be anything except X because it'll rot your brain forever?

20:19 martinklepsch: I'm trying to start an uberjar in docker with java -verbose -jar xy-standalone.jar

20:19 epichero: if you want to ease yourself in slowly i think python is the simplest to teach someone

20:19 martinklepsch: and the only line that comes out of it is: [Opened /usr/lib/jvm/java-7-oracle/jre/lib/rt.jar]

20:19 Frozenlock: technomancy: I like that. Who said it?

20:20 technomancy: Frozenlock: I wish I could remember

20:21 martinklepsch: anyone an idea what could be going on there?

20:23 Frozenlock: I like elisp, because you are inside your evaluating environment. Also, single threaded and no namespaces. Less stuff to learn before doing actual work.

20:24 locks: factor's environment is so cool

20:24 martinklepsch: Frozenlock, if you just jump straight into lighttable you can also do clojure w/o namespaces...

20:25 gtrak: Processing.

20:25 technomancy: processing has good learning material, but the language itself is meh

20:26 Frozenlock: martinklepsch: Can you? Can you uberjar it, or do you need to always run into LT?

20:26 blr: for kids, Scratch has an immediacy that seems to really work for kids, for adults it doesn't matter so much

20:26 locks: I saw a

20:27 smalltalk presentation the other day, I kinda wish I could work like that

20:27 martinklepsch: technomancy, I've recently seen people get quite far with quil on their first tries

20:27 locks: I wonder what LT has up its sleeve

20:27 Frozenlock: Teach them math with parens... (1 + 2), (1 + (3 - 2))... and then slowly swap the position of the functions. :-p

20:27 martinklepsch: Frozenlock, you'd always need to run it in LT

20:27 blr: locks: have you tried pharo? I think it has an active, if small community

20:27 locks: blr: downloaded the other day

20:30 blr: I'll give "deep into pharo" another go

20:30 and try to find videos, since that seems what my brain prefers

20:30 blr: I don't know anything about it personally, just hear people speak favourably about it

20:31 martinklepsch: anyone 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:31 locks: blr: problem with image-based envs is interop

20:31 but, one problem at a time

20:31 technomancy: martinklepsch: sometimes the oracle jdk makes you click yes in the licensing agreement

20:32 maybe it can't display the window or something

20:32 blr: I remember looking at Seaside a few years back and thinking it had some novel ideas, for a web framework

20:32 technomancy: usually that happens at install time though

20:32 martinklepsch: technomancy, I'm starting in a docker container so most likely that could be an issue

20:32 technomancy: but oracle is gross anyway; i recommend getting rid of it

20:33 blr: openjdk has near parity with oraclejdk now from what I understand.. potentially minor performance differences?

20:33 dbasch: what happened to clojure-social btw?

20:33 gtrak: dbasch: me moved to clojure-offtopic

20:33 blr: certainly easier to apt-get the openjdk :)

20:33 gtrak: we*

20:34 arrdem: technomancy: you're invited to the new clubhouse ofc..

20:34 technomancy: oh yeah

20:41 locks: does anyone have some destructuring katas/exercises other than the koans?

20:41 because they really stump me

20:42 martinklepsch: locks, good q

20:42 bbloom: ~destructuring

20:42 clojurebot: destructuring is http://clojure.org/special_forms#binding-forms

20:43 bbloom: locks: reading the "spec" / docs may give you enough of a hint to solve the koans

20:43 locks: bbloom: but I want more "homework"

20:43 martinklepsch: I'm getting the very same: "[Opened /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar]" line when using openjdk

20:43 bbloom: locks: oh, you finished the koans & need MORE koans? :-)

20:44 locks: yeah :P

20:44 or a set of kata style exercises to keep me sharp

20:44 beamso: martinklepsch: 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:44 bbloom: locks: http://www.4clojure.com/problems use search filter in top right corner

20:45 there are 3 destructuring problem groups

20:45 locks: oh nice

20:46 I solved some problems already, but hadn't come across the destructuring ones yet

20:46 beamso: https://wiki.debian.org/JavaFAQ mentions some things about accepting the licence programmatically

20:47 amalloy: http://www.4clojure.com/problem/173 is so weird

20:48 blr: martinklepsch: have you checked the process list? are you sure it isn't running?

20:49 martinklepsch: blr, the uberjar works fine locally

20:49 mercwithamouth: o_O;

20:49 martinklepsch: just in a docker container it hangs

20:50 blr: martinklepsch: are you using openjdk-7-jre-headless?

20:51 might be worth giving that a go

20:51 martinklepsch: yeah, just trying with default-jre-headless

20:51 blr, if that works I'll swith to 7.

20:55 blr, no luck... -.-

20:56 blr: bugger

20:57 I'm afraid we're still using kvm, but someone on here must have experience deploying to lxc/docker

20:57 beamso: i 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:59 martinklepsch: beamso I don't think so

21:00 riemann works just fine on docker

21:00 and uses default-jre-headless

21:00 https://github.com/patrickod/riemann-docker/blob/master/Dockerfile

21:03 blr: martinklepsch: 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:04 martinklepsch: blr, not really. it just foregrounds it, which will show me the aforementioned line

21:04 I'll talk to some more ppl in the #docker channel

21:04 blr: you probably want the -i flag for interactive

21:04 might help clarify what's going on

21:05 ok, gl :)

21:07 beamso: i don't see anything with accepting the java licence, so it wasn't that

21:14 amalloy: guys, 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:15 dbasch: amalloy: I don’t need to imagine, I was there :P

21:15 Frozenlock: amalloy: I have the opportunity of feeling like a noob 24h/24h. :-p

21:15 dbasch: I learned to code in 1983 with a shitty TI99 and a photocopied BASIC manual

21:16 sjy: irc is coming up on 30 years old though!

21:16 amalloy: dbasch: 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:17 locks: I still haven't learnt to code

21:17 #hipster

21:17 I apologize for my use of hashtags

21:18 dbasch: amalloy: modems and BBSs already existed, they just were not available to most of us

21:18 I wanted to buy a 300 baud modem but it was too expensive

21:18 kenrestivo: we had usenet back then, which was pretty cool, but nothing like the sheer volume of people on the internet today

21:18 amalloy: yes, i know. i just mean like, having it all commonplace

21:18 and instantaneous

21:18 locks: you can justify it by saying you were /join'ing #hipster

21:18 hashtags work almost as well in irc

21:19 kenrestivo: i 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:19 locks: kenrestivo: that's a bit of a strawman

21:19 someone can

21:19 doesn't mean they will

21:19 kenrestivo: it's a total strawman :-)

21:20 locks: then light it on fi'a

21:20 that STRAWMAN'S ON FI~RE~

21:21 kenrestivo: oh, 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:22 locks: you're american, aren't you

21:22 kenrestivo: you can tell by the misplaced adverb, no doubt

21:23 locks: I can tell by implicitly saying everyone has the sum total etc within several seconds of search

21:23 on their phone

21:23 ;P

21:25 dbasch: I like living in a world in which I can carry money in my brain

21:25 Frozenlock: dbasch: bitcoin?

21:25 kenrestivo: correct horse battery staple + bitcoin

21:25 dbasch: Frozenlock: diegobasch.com/brainwallet

21:25 http://diegobasch.com/brainwallet

21:26 kenrestivo: yay bip32

21:26 dbasch: I tried writing that in cljs but it was really annoying using all the bitcoin / crypto libraries

21:26 kenrestivo: as for internet connectivity, i'm told that the usa lags behind many other countries

21:27 dbasch: there are a few javascript wallets last i checked.

21:27 Frozenlock: While 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:27 amalloy: kenrestivo: i'm not sure about connectivity, but certainly connection quality

21:27 dbasch: kenrestivo: yes, but the original brainwallet lets you choose your passphase (which is really terrible)

21:28 passphrase

21:28 amalloy: the other day i was chatting with someone from the netherlands who has 93Mbps up

21:28 and i'm sure it's much cheaper than the crummy 1Mbps i pay for at home

21:28 blr: we 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:30 kenrestivo: Frozenlock: 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:30 there 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:31 dbasch: kenrestivo: #1 is not a problem, it’s like saying computers will never take off because 16k of ram won’t be enough

21:31 beamso: blr: you have fttp?

21:31 Frozenlock: Well, there's weirdos like me that don't think deflation is a problem.

21:31 blr: beamso: a lot of NZ does, I missed out this year by one block, we get it next year

21:31 beamso: ouch at missing out, but lucky you in general

21:32 dbasch: to me the main problem with bitcoin is that most development is in C++, Rails and js :P

21:32 blr: well 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:32 Frozenlock: dbasch: we need clojurecoin

21:32 kenrestivo: i played aroudn with bitcoinj and went "bleah", and stopped

21:32 there's a clojure wrapper around it now that looks pretty solid

21:32 arrdem: kenrestivo: I will happily debate #1 with you all night long, and #2 is arbitrary and patched in dogecoin. may the best alt win.

21:33 dbasch: Frozenlock: let’s be more inclusive, e.g. lispcoin or functionalcoin

21:33 kenrestivo: I didn’t think bitcoinj was that bad

21:33 kenrestivo: arrdem: 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:33 arrdem: dbasch: just hack clj-doge

21:33 danielcompton: Can you compare two byte-buffers based on their hashcode?

21:33 arrdem: kenrestivo: I happen to agree with you on #2, but not for the reasons you hold that view.

21:34 dbasch: I was looking at the json-rpc APIs for the coins... a good clj-btc will port trivially to almost any alt.

21:34 blr: I'm just enjoying the absurdity of it all, the doge nascar thing is hilarious.

21:34 kenrestivo: it'd be fun to have dogecoin tips in lazybot

21:34 arrdem: blr: I KNOW RIGHT

21:34 dbasch: arrdem: there is a clj-btc but it’s not great

21:35 arrdem: I actually use it for cointipping

21:35 arrdem: dbasch: eh I/we could fix that.

21:35 blr: arrdem: the world is getting exponentially weirder, and I'm ok with that

21:35 arrdem: blr: I ordered my doge shirt, did you?

21:35 dbasch: arrdem: it’s pretty trivial actually

21:35 blr: hahah no

21:35 arrdem: s/doge/dogecar/g

21:35 blr: I should do

21:35 arrdem: http://dogecrew.com/

21:36 dbasch: I'm sure. the clojure APIs for exchanges I was working on for a while were the same, trivially fixable but blegh

21:36 624 DOGE shirts to go!

21:38 fooozbazz: is there a balanced binary tree implementation available as a clojure library, or do people just implement their own all the time for fun..

21:38 google is giving me nothing but tutorials and half baked examples..

21:38 "don't reinvent the wheel"

21:39 locks: if anyone knows about trees is bbloom

21:39 fooozbazz: :(

21:39 dbasch: danielcompton: I don’t think so, but why would you want to?

21:39 Frozenlock: "or do people just implement their own all the time for fun.." pfff, that's not fun.

21:39 danielcompton: dbasch I want to compare a blob from cassandra with a blob from a java file

21:40 fooozbazz: Frozenlock: that' why i'm asking..

21:40 arrdem: well there's a red-black tree implementation I'm finding in some blog posts..

21:40 danielcompton: dbasch it seems like Clojure's = compares equality even for java mutable objects. Or am I way off base on that?

21:40 arrdem: someone so inclined could probably pull it out and librarify it...

21:40 (dec so)

21:40 lazybot: ⇒ -13

21:40 danielcompton: (dec so)

21:40 lazybot: ⇒ -14

21:40 dbasch: ,(= (byte-array (map byte (range 9))) (byte-array (map byte (range 9))))

21:40 clojurebot: false

21:41 arrdem: fooozbazz: https://github.com/clojure-cookbook/clojure-cookbook/blob/master/02_composite-data/2-27_and_2-28_custom-data-structures/rbt.clj

21:41 dbasch: danielcompton: they are different objects

21:42 Frozenlock: Do 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:42 * devn finds it annoying that both data.csv and clojure-csv make their parse-csv-line/parse-record fns private

21:43 dbasch: Frozenlock: it’s best to use a proper license http://choosealicense.com/

21:43 arrdem: Frozenlock: just sole copyright it to $COMPANY

21:43 or get a real license...

21:44 Frozenlock: Looking now, thanks

21:44 dbasch: Frozenlock: if you put it on github, copyright alone doesn’t stop people from forking the code

21:45 fooozbazz: arrdem: thanks. i guess it's just not been done yet.

21:45 devn: anyone seen this? http://crossclj.info/

21:45 arrdem: devn: that's slick

21:45 devn: arrdem: yeah, i feel like all of this stuff is slowly coming together

21:46 imagine clojuresphere + clojars + crossclj + getclojure + clojuredocs

21:46 + clojureatlas

21:47 im guessing that crossclj is a giant datomic db of codeq-parsed repos

21:48 arrdem: the volume of clj- prefixed libraries is irritating.

21:48 -jure is only marginally better.

21:49 dbasch: I crtl-F’ed for bitcoin and found only one thing

21:49 and it was mine :(

21:49 danielcompton: dbasch how can you compare two different mutable java objects? What's the fastest way?

21:49 arrdem: there is a search...

21:49 also it looks like this DB is old. I have other projects that don't show up when I search my handle.

21:49 dbasch: danielcompton: for byte arrays you have to go byte for byte

21:50 danielcompton: that would still be faster than converting to a vector?

21:50 arrdem: oh damn. I should port imprecise to algo.generic....

21:50 forgot about that project.

21:50 dbasch: danielcompton: if you want speed, do a plain old comparison by array index, or lazy

21:50 danielcompton: dbasch got it

23:10 fortruce: does binding not actually take place until after the let form?, want to use one binding in the next binding

23:11 ,(binding [x 1, y (+ 1 x)] (+ x y))

23:11 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: x in this context, compiling:(NO_SOURCE_PATH:0:0)>

23:11 fortruce: ,(def ^:dynamic x)

23:11 clojurebot: #'sandbox/x

23:11 fortruce: ,(def ^:dynamic y)

23:11 clojurebot: #'sandbox/y

23:12 fortruce: ,(binding [x 1, y (+ 1 x)] (+ x y))

23:12 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to java.lang.Number>

23:12 dbasch: ,(let [a 1 b (+ 2 a) c (* 4 b)] c) ;; you mean this?

23:12 clojurebot: 12

23:12 fortruce: yea, but in binding, not let

23:12 dbasch: there is no guarantee of order in binding

23:13 fortruce: ahh, alright, is there in with-redefs?

23:13 dbasch: The new bindings

23:13 are made in parallel (unlike let); all init-exprs are evaluated

23:13 before the vars are bound to their new values.

23:13 (doc binding)

23:13 clojurebot: "([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:13 fortruce: ahh, somehow missed the last sentence :/

23:14 nested bindings seems weird, i think i'm doing something wrong

23:15 blr: danielcompton: in Dunedin today?

23:15 danielcompton: blr still in Auckland, working out of Otago Uni's Auckland office

23:15 blr does my channel join show up in IRC?

23:16 blr: oh right, I forget we have offices in other cities sometimes

23:16 danielcompton: blr haha, I don't think you're the only one

23:17 blr does my channel joining show up in IRC?

23:18 blr: yeah, that's normal, what irc client do you use?

23:18 danielcompton: blr textual, I just wasn't sure if that was spamming everyone

23:18 blr: I wouldn't worry about it, think people on irc are used to join/part spam :)

23:27 yeoj___: 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:27 *think

23:56 munderwo: Hi 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:56 i've tried this (ANY "/*" [] (proxy-handler request)) ..

23:57 tolstoy: (AND "/*" [:as req] (proxy-handler req))?

23:57 Er, ANY.

23:57 munderwo: just trying now.

23:57 tolstoy: Or even (routes/not-found (fn [r] (proxy r))). Something like that?

23:57 munderwo: I can see how that would work.

23:58 The 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:59 tolstoy: Heh. I was going to suggest not even bothering with compojure if that wasn't the case. ;)

23:59 munderwo: yeah. Thanks that worked!

Logging service provided by n01se.net