#clojure log - Dec 14 2013

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

0:05 akhudek: wow, gloss is much slower at reading than writing

0:13 cljr: ,(-> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char) (apply str))

0:13 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn>

0:14 cljr: ,(->> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char)

0:14 (apply str))

0:14 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

0:18 cljr: ,(->> (concat (repeat 10 0x00) (repeat 2 0xff) [127 0 0 1]) (map char) (apply str))

0:18 clojurebot: "

0:20 cljr: speaking of gloss, ive got a frame defined as an ascii string, and when i write out the above data using that frame, the hex output ends up like 00 .. 00 3f 3f 7f 00 00 01, when im expecting 00 .. 00 ff ff 7f 00 00 01, im a newbie at this, am i doing something wrong encoding-wise?

0:23 akhudek: https://www.refheap.com/21752

0:23 ouch

0:24 cljr: I'm not sure. Are you sure the string encoding is right? Maybe it's utf-16 or something?

0:25 cljr: well, when i use (str ..) that is a utf-16utf-16 string, rights?

0:25 But even if i change the frame to use that, i get even weirder hex output than i would expect

0:27 akhudek: cljr: looks like you can specify the encoding in your frame definition

0:28 https://github.com/ztellman/gloss/wiki/Introduction

0:29 cljr: akhudek: yeah, that is what i mean, when i change it to :utf-16, output is even more off

0:33 akhudek: cljr: ah, I don't know then

0:42 yikes, a custom reader takes only 7.7msec vs 4428msecs using gloss.

0:43 deadghost: is there a sleep function to delay running code?

0:43 or do I need to roll my own/pull from java

0:43 akhudek: deadghost: Thread/sleep

0:44 deadghost: if you need to schedule code to run later and continue, then you can start a thread where the first call is Thread/sleep

0:44 deadghost: there are also scheduling libraries if you want more sophisticated functionality

0:46 TEttinger: deadghost, overtone's at-at is very good.

0:56 cljr: well, maybe i know what my issues is, is a char[] in C/C++ the same as a String in Java?

0:59 dsrx: no

1:02 a String in java is more like a std::string in C++

1:06 amalloy: cljr: ascii is a 7-bit encoding, right? so i'm not sure it's well-defined what gloss "should" do if you ask it to encode (char 0xff)

1:14 akhudek: cljr: unicode-8 is not a simple char[]

1:14 cljr: however, you should only encounter a difference if you have data that is outside the standard ascii set

1:18 marcopolo2: anyone use clj-webdriver? It crashes my nrepl server whenever I spawn a new browser, anyone experience that?

2:29 ddellacosta: what do I use to get cider to recognize functions declared in the namespace I'm working in?

2:29 C-c M-n doesn't seem to do it

2:51 divyansr__: , (list 1 1 )

2:51 ddellacosta: nevermind, needed to use C-c C-n.

2:51 clojurebot: (1 1)

2:54 alfred: help

3:22 TEttinger: Alfred, do go on

3:53 bitemyapp: Alfred: refheap.com

4:11 Pupeno: Is there a html template for Clojure that automatically escapes strings unless they been marked as safe, like Rails?

4:12 justin_smith: I think any of the moustache-derived ones should do that

4:15 Pupeno: justin_smith: it seem so, from mustache's docs: "All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache: {{{name}}}."

4:15 Is Hiccups the only structure-based template?

4:15 justin_smith: the one I use is the one we developed for caribou, antlers

4:15 what do you mean by structure-based - like the input is edn?

4:16 if so laser and enlive both can use edn data structures in templating

4:17 Pupeno: justin_smith: not sure what edn is, but what I mean is that you build a tree so you cannot accidentally open a tag without closing it, like hiccups or in rails, haml.

4:17 justin_smith: edn is the clojure equivalent of json

4:17 the basic data literals

4:17 Pupeno: enlive reminds me too much of the zope/plone template engine. It seemed like a good idea in paper but in the day to day it was a nightmare.

4:18 * Pupeno goes on to check laser.

4:19 Pupeno: laser seems of the same kind as enlive and zope's

4:19 TAL, that was the name of Zope's.

4:20 justin_smith: I can say those are the ones I can think of off the top of my head, but usually it is the front end guy doing the template stuff, so we use something based on moustache because it is a syntax they are familiar with

4:21 so I don't have much experience with clojure-centric templating

4:21 (though antlers is done in clojure and uses clojure in the helpers)

4:22 Pupeno: In all the teams I been, frontend was done by the same people as everything else, so I stopped choosing template engines based on how easy it would be for someone used to HTML.

4:22 I'm not saying that this is the only way, just what tends to be true for me.

4:23 justin_smith: yeah, we clearly have different environments

4:24 sveri: hi, anyone here using cursive? whichupdate channel do i have to use for the intellij 13 release?

4:24 Pupeno: sveri: I am.

4:25 sveri: I used this one: http://cursiveclojure.com/plugins-13.xml

4:25 if that's what you are asking.

4:25 sveri: yea

4:25 thank you, i was not sure cause the doc said that this is for the EAP release

4:26 Pupeno: Yeah, intellij was just released and the docs are out of date.

4:26 sveri: ok

4:26 awesome, thank you very much

4:26 Pupeno: AFAIK

4:26 sveri: just getting started with it?

4:27 sveri: Pupeno: i tried it some time ago, but got not rly warm with it

4:27 however, emacs lacks some things for me too and as awesome as lighttable is, there are a lot of features missing too (regarding general editing capabilities)

4:27 Pupeno: The fact that by default it's in structural mode was confusing (http://cursiveclojure.com/userguide/paredit.html).

4:27 brb

4:35 I used to play with La Clojure back in the day, before Cursive.

4:53 pepijnd: is there a way to use neo4j via clojurescript

4:55 TEttinger: pepijnd, like via node.js?

4:55 you mean clojurescript not clojure?

4:56 pepijnd: TEttinger, no from the browser. neo4j has a rest api

4:57 TEttinger: http://clojureneo4j.info/

4:57 first result for: clojure neo4j rest api

4:58 pepijnd: TEttinger, thats

4:58 not cljs

4:58 TEttinger: right forgot

5:10 pepijnd: wow https://github.com/zubairq/coils#client-side-neo4j-cypher

5:11 is Clojure on Coils any good?

5:13 guns: gfredericks joked once about "Clojure on Clails"; funniest damn thing I've heard on IRC.

5:16 pepijnd: ?

5:17 guns: sorry; just thinking about unfortunately named clojure libraries

5:17 pepijnd: I dont know what clails are

5:17 guns: it's a joke. Unlike Clojure on Coils apparently

5:21 pepijnd: yea. point is that the name doesnt sound very solid/professional. ao given that anyone can put up some code and pretend it's the next RoR, i'm hesitant to start using it

5:22 guns: "secure client side SQL" sounds crazy

5:24 pepijnd: I think it's a macro that does some public key crypto, but it does soud weird

5:29 guns: it sounds like a poorly thought out hack; even if it is secure, a web client should never need direct access to the database

5:29 pepijnd: phpmyadmin?

5:30 guns: I'm not sure if you're trying to illustrate my point :)

5:30 pepijnd: but in that case, you would want "sql injection"

5:31 Y NO LIKE phpmyadmin?

5:31 guns: if he wanted to use macro magic, he could use macros to have code in a template actually execute on the server without piping SQL over the network

5:32 pepijnd: maybe they does that

5:33 guns: then he shouldn't call it "client side"; I'm going to look for the source

5:37 pepijnd: No, it looks like he's throwing _symmetrically_ encrypted SQL over the network

5:37 pepijnd: oh...

5:40 guns: plus, the cipher is PBEWithMD5AndDES, which you could crack with your kid's ps3

5:42 pepijnd: https://github.com/zubairq/coils/blob/coilsdemo/src/webapp/framework/server/encrypt.clj#L9-L17

5:42 and he uses UUID/randomUUID as a test password in development!

5:43 pepijnd: ...

5:43 guns: I hope nobody finds this chat, or somebody's client sites are going to get hacked

5:44 pepijnd: thats better than "password" I guess.

5:48 guns: Well, I see that java's randomUUID is actually random (I thought it was one of the less random variants), so I guess I'll back off on that one

5:50 pepijnd: i feel tempted to try cracking http://www.nemcv.com ... for educational value, but probably still a bad idea.

5:50 guns: you've already blown it by mentioning it here :)

5:52 pepijnd: lol, now it's all my fault if they get hacked

6:05 so what is the preferred micro framework these days?

6:07 i like moustache...

6:10 wat.. weavejester wrote clout AND compojure...

6:11 Raynes: pepijnd: And everything else.

6:11 Srsly

6:12 pepijnd: haha

6:12 but who needs more than one router? :P

6:12 Raynes: He's basically like people perceive me (lein release clojars new libraries so often that it automatically writes them now).

6:14 pepijnd: Also, Compojure uses clout for routing.

6:14 For matching routes, I mean.

6:15 pepijnd: ahhh. so compojure is more than routing? never knew

6:15 S3thc0n: Is it practical to use monads instead of accessing values (as an atom for example) globally from within functions?

6:15 Raynes: Well, it's much higher level, pepijnd.

6:16 pepijnd: ok

6:16 Raynes: With a few macros to make things super pretty.

6:16 An amazingly well designed API.

6:16 pepijnd: will try

6:16 Raynes: And goodies like some middleware sets pre-made for common use-cases.

6:16 pepijnd: You're only just seeing the world!

6:17 * Raynes hugs pepijnd enthusiastically.

6:17 Raynes: I'm so happy. ;')

6:17 pepijnd: haha, its been way to long since I did clojure webdev

6:18 Raynes: Me too, man.

6:18 I need to give refheap some lovin'.

6:18 And stop writing Go.

6:18 pepijnd: haha

6:19 Raynes: There is a possibility I might take some Go work soon, so I've been playing with Go for the last week. Been hacking http://github.com/Raynes/goheap like mad.

6:19 It's fun, but I need either better static type systems or dynamic type systems in my life. :p

6:20 pepijnd: you could port all the good things from go to clojure... oh wait, core.async.

6:20 Raynes: But Go has...

6:20 What about...

6:20 Yeah, no clue.

6:21 pepijnd: I'm doing my first clojure job now, hence the webdev

6:21 Raynes: I mean, as far as C-like syntaxes go, I'm quite fond of it. Tabs turned me off big time, but it really makes no difference when you're writing code and you're expected to run 'go fmt' to computer-format your code anyways.

6:22 Nice, congrats on it.

6:22 I'm currently coming off my first Clojure job. :p

6:22 pepijnd: go is C like?

6:22 Raynes: Aye.

6:23 I mean, it's in the C family of languages

6:23 Beyond syntax it doesn't resmble a whole lot.

6:23 clojurebot: It's greek to me.

6:23 pepijnd: oh, ya

6:23 you quit the family tree thing?

6:24 Raynes: Hah, well, I didn't quit it.

6:24 Unfortunately the company had to lay some folks off.

6:24 pepijnd: oh...

6:25 that sucks

6:25 Raynes: Well, that's how it always feels at first.

6:25 :p

6:26 AeroNotix: So you got fired?

6:26 pepijnd: hah, enjoying some freedom?

6:26 Raynes: But I've got some pretty cool opportunities to pursue. I'm trying to remain in LA because I quite fancy it.

6:26 AeroNotix: Nope.

6:27 AeroNotix: Raynes: what's goheap for? play.golang.org

6:27 Done.

6:27 Raynes: hrm

6:27 AeroNotix: What do you mean?

6:28 AeroNotix: Raynes: play.golang.org is the 'pastebin' service which is more pervasive for Go.

6:28 emil0r: hi. does anyone know what to put in leiningen in order to get clojure 1.6.0-master-SNAPSHOT as a dependancy?

6:28 Raynes: AeroNotix: Oh, goheap is an API client for refheap.com

6:28 pepijnd: magic

6:28 Raynes: It's a Clojure pastebin I wrote that the Clojure community uses.

6:29 Or, tends to use in any case.

6:29 AeroNotix: Raynes: so you upload Clojure code from Go? I don't get it

6:31 Raynes: AeroNotix: refheap.com is a pastebin that supports tons of languages and has an API. goheap is a library wrapper around it's API (like gist's API and the various clients for it).

6:31 AeroNotix: I se..

6:31 see

6:31 Raynes: Now if someone perhaps wanted to write a program that pasted something to refheap for some reason and they wanted to write it in Go, they could use goheap to easily do that.

6:32 pepijnd: but gist is not invented here

6:32 Raynes: It was more of a learning project than anything.

6:32 The first thing I do in languages usually is write a refheap API client.

6:32 AeroNotix: I see

6:33 pepijnd: Raynes next time try google safe browsing, for a challenge...

6:34 Raynes: pepijnd: ?

6:34 pepijnd: complicated api

6:34 Raynes: Oh!

6:34 Hah.

6:35 AeroNotix: http://jobsearch.about.com/od/firedtermination/qt/fired-laid-off.htm for an explanation of the difference between laying off and firing. I'm not sure if it's just a USA thing or not.

6:37 AeroNotix: I see

6:44 Raynes: pepijnd: Or! The WolframAlpha API.

6:44 Go look at it. I dare you.

6:44 pepijnd: ok, not now, but i will

6:47 progo: enlive with XPath support would be great

7:34 piranha: anybody using cljs repl in browser here? If I did 'defn' of a function, it gets defined nicely. But when I change it and try to execute it (I have my emacs connected to a browser) it's not redefined

7:34 any pointers what should I do?

8:44 poppingtonic: hi people

9:41 cYmen: hm...

9:42 When I do (apply max-key #(...) (filter ...somestuff...)) it is an error when the filter returns an empty list. How do I fix that?

9:49 pdk: make the #(...) function check its argument is nil?

9:50 hyPiRion: find some minimal value

9:50 (apply max-key fn min-value (filter ...))

9:54 cYmen: hm...yeah I did approximately that but I simply added a value that will not be filtered away

10:06 mi6x3m: hey, beginner clojure here, but computer scientist. I am just looking at do's details

10:06 am I right that it's "do" which allows the non-strict binary tree syntax?

10:06 like

10:06 (a b c)

10:06 (a b c d) etc.

10:12 long story, short: can someone explain "do" :)

10:14 jonasen: mi6x3m: http://clojure.org/special_forms (search for "do")

10:14 mi6x3m: jonasen: was reading that

10:14 I can't understand something

10:15 why is it the case that program forms aren't always binary trees?

10:15 jonasen: mi6x3m: not sure I understand what you mean. But why should each form be _binary_?

10:16 Bronsa: mi6x3m: 'do is usually used when you need side-effects

10:16 mi6x3m: jonasen: (+ 1 (/ 4 2)) is in fact a binary tree

10:16 Bronsa: e.g (do (println "foo" 1)

10:16 e.g (do (println "foo") 1)

10:17 jonasen: mi6x3m: there are three elements in each of those lists

10:17 mi6x3m: ok, here is a better example

10:17 (+ 1 2 3) should technically be (+ 1 (+ 2 3)), without do?

10:17 justin_smith: mi6x3m: not at all

10:18 jonasen: no. + can accept any number of arguments

10:18 justin_smith: variable arity is deep in the language

10:18 jonasen: not all operators are binary

10:18 mi6x3m: justin_smith: ah, okay, I see. so do is really just about evaluating a number of expressions and returning the result?

10:18 no other purpose

10:19 Bronsa: yes.

10:19 justin_smith: mi6x3m: the point of do is to ignore some of the expressions in between

10:19 assumed for side effects

10:19 Bronsa: justin_smith: ignore is probably a bad choice of word there :)

10:19 mi6x3m: oh, okay, this clarifies it

10:19 thanks

10:19 justin_smith: let, fn, catch, etc. have implicit do blocks

10:20 Bronsa: yeah, good call

10:20 ignore the return value

10:20 while evaluating the expression

10:20 mi6x3m: yes, this is what was confusing me

10:26 `cbp: does anyone have a merge fn for vectors handy? or a fill fn?

10:27 like (f [1 2 3] [1 1 1 1 1]) -> [1 2 3 1 1]

10:29 mi6x3m: another question

10:29 can I only use symbols for let bindings?

10:30 `cbp: symbols or destructuring

10:31 opqdonut: ,(into [1 2 3] [1 1 1 1 1]) -- `cbp

10:31 clojurebot: [1 2 3 1 1 ...]

10:31 opqdonut: oh, merge, bah

10:31 `cbp: i did (concat a (drop (count a) b))

10:31 opqdonut: I thought concat :)

10:31 `cbp: stupid stress doesnt let me think

10:31 opqdonut: yeah that should do it

10:31 into is slightly nicer than concat because you get a vector out

10:32 `cbp: youre right

10:38 andyf: Bronsa: jonasen: Up early, or up all night? :-)

10:38 Now that Bronsa is the master of Clojure contrib libs, I am going to throw some 3rd party libs into the Eastwood crucible for additional testing.

10:50 Bronsa: andyf: I sleep 5am/2pm :P

10:51 andyf: excellent. Exactly what my schedule was in grad school :)

11:01 mi6x3m: are let bindings always proceeded (evaluated) in order?

11:01 is this guranteed?

11:01 Bronsa: yes

11:02 opqdonut: hes

11:02 *yes

11:03 the documentation that tells you that: http://clojure.org/special_forms

11:04 mi6x3m: and their evaluation will be immediately before the evaluation of the rest of the do expressions?

11:04 opqdonut: not everything is there :)

11:08 andyf: mi6x3m: If an expression bound by let is lazy (e.g. the results of map, filter, and many other Clojure functions that their docs say are lazy), then they will not be fully evaluated, only a bit.

11:09 michaelr526: hello

11:09 andyf: That statement is independent of whether the lazy expression occurs in a let, or anywhere else

11:10 jonasen: andyf: early? It's 6PM here :)

11:10 andyf: jonasen: Sorry, I should better remember your time zone. Finland, yes?

11:10 jonasen: yes

11:12 andyf: Holy cow, the days must be getting short there now

11:12 hyPiRion: Sun sets at 2:30 pm over here, so I guess it's the same over there

11:12 jonasen: andyf: yep.. only a few hour days here... It gets dark at 4pm

11:13 hyPiRion: probably

11:14 andyf: If it weren't terribly expensive or dangerous, I would once like to see the sun go around above the horizon in 24 hours at one of the poles.

11:15 hyPiRion: Hurray for Fennoscandians and their crazy longitude.

11:15 andyf: I would guess it would be possible in Alaska during summer?

11:16 Well, that's not a pole, but you'll see the sun following a sine wave

11:17 andyf: Looks like it. I hadn't checked how much land is actually in the Arctic circle.

11:17 jonasen: andyf: hyPiRion: Alaska might be expensive but I don't think its dangerous :)

11:18 andyf: jonasen: Cool. I'll have to see if there are any decent hotels in northern Alaska, for a mid-summer visit.

11:25 Google is wonderful "arctic circle hotel" finds 3 in Finland :-)

11:29 jonasen: andyf: http://www.icehotel.com/ seems cool!

11:32 bbloom: dnolen: ping

11:39 logic_prog: how does one develop a sense of absolute control over one's emotions, to be not rattled by anything?

11:39 poppingtonic: pracice mindfulness.

11:40 *practice

11:40 mi6x3m: hey, what is the difference between (nth [1 2] 1) and ([1 2] 1) ?

11:41 poppingtonic: logic_prog: When you're present to your every emotion, you can choose which to express. But it takes quite a long time to master.

11:41 ,(nth [1 2] 1)

11:41 clojurebot: 2

11:41 poppingtonic: ([1 2] 1)

11:41 ,([1 2] 1)

11:41 clojurebot: 2

11:42 justin_smith: mi6x3m: nth works on anything sequential, [] as an IFn invokes the get method

11:42 logic_prog: poppingtonic: is there a way to practice this?

11:43 andyf: jonasen: :deprecated linter throws exception when trying to find protected methods, because of its use of Class/getMethod. Worth changing?

11:43 justin_smith: mi6x3m: get is always O(7) at worst, nth has O(n) complexity for seq

11:44 mi6x3m: justin_smith: how come?

11:44 wouth nth just iterate?

11:44 justin_smith: for a seq, yes

11:44 mi6x3m: okay

11:44 justin_smith: for [] it calls get ([] is actually a special hash for fast lookup / tail insertion)

11:44 jonasen: andyf: yes, I think we should use getDeclaredMethod instead

11:45 poppingtonic: logic_prog: why do you want so much control?

11:45 andyf: jonasen: I'll test with that local change for a while and see how things go.

11:46 logic_prog: poppingtonic: it's a matter of self control

11:46 to avoid being emotionally manipulated by others

11:46 it's impossible to lead if one can not even control one's own emotions

11:46 poppingtonic: Then write. About what makes you feel whatever emotions you notice. When you do this, you'll realize what your triggers are. The things that make you happy, for instance, are the triggers you should be keeping track of, so you know when it's appropriate to express the emotion.

11:47 logic_prog: so it's like a tracing debugger

11:47 you add "println" 's all over your life

11:47 then when you feel a certain emotion,you look at th elog file and be like "what happened before this emotion"

11:48 poppingtonic: Remember the dictum "whatever is measured gets improved"? Consider writing about your emotions a somewhat-contrived instance of that.

11:48 logic_prog: sort-of like that.

11:48 justin_smith: there are also some heuristics

11:49 urgency - someone telling you you don't have a choice

11:49 poppingtonic: hmmm

11:49 O

11:49 sorry

11:50 logic_prog: lol

11:50 so basically ignore everyone!

11:50 mi6x3m: is the gathering "operator" & a macro?

11:50 poppingtonic: What's the simplest way to lazily write data to a file?

11:50 mi6x3m: or just sugar

11:50 logic_prog: isn't that a bad idea?

11:51 when I write ot a file, I want persistence

11:51 justin_smith: mi6x3m: a part of the destructuring special form

11:51 logic_prog: I'd be rather unhappy if clojure is like "yeah, I'm going to pretend to write to the file, but not actually write to it"

11:51 andyf: logic_prog: Learn to rationally evaluate whether someone else's opinion of you matters. In most cases, it is their problem if they are trying to get to you, not yours. I'd say it is OK to be rattled by someone important in your life.

11:51 justin_smith: mi6x3m: http://clojure.org/special_forms#Special Forms--Binding Forms (Destructuring)

11:53 that link pasted weird

11:53 poppingtonic: logic_prog: I mean in the sense that I'm programmatically creating files according to some specification. I don't want them to exist before they're absolutely needed. Like a fog of war. I'm making a randomly-generated text-adventure game.

11:58 A file describes a particular location as a map. When a player is (= n 2) hops away from that location, the file describing it is created. My specification is in development, and very incomplete.

12:07 andyf: jonasen: Looks like getMethod searches superclasses and other implemented interfaces for a method name, but getDeclaredMethod does not. Ugh. Maybe I'll try doing both, only using getDeclaredMethod if getMethod throws a NoSuchMethodException

12:12 Bronsa: andyf: FWIW clojure.reflect recursively uses getDeclaredMethod on the Class ancestors

12:13 andyf: Bronsa: Thanks for the pointer. I'll try that out.

12:32 ghadishayban: Bronsa: I updated the tail clearing patch to clear interop invocations as well

12:33 Bronsa: ghadishayban: saw that thanks, I'm going to push the update soon

12:35 ghadishayban: Bronsa: I'm not sure it's the ideal approach right now, Christophe has some interesting ideas about emission. But it works right now, and makes straight reducers super fast.

12:39 Bronsa: ghadishayban: sure -- I'll try to experiment a bit with alternative solutions too but in the meantime yours works. No big deal to revert a couple of line changes if a better solution comes up

12:42 ghadishayban: Bronsa: heh nice! I am really super excited to start experimenting with t.emitter.jvm over the next few weeks

12:43 Bronsa: ghadishayban: I see t.a.jvm/t.e.jvm as a good way to experiment with those compiler changes, it's so much faster/easier to change things and immediately see the result compared to hacking on Compiler.java

12:43 ghadishayban: Bronsa: tell me about it. I have been working on and off on that patch for a month

12:47 Bronsa: ghadishayban: just wondering, shouldn't your patch handle keyword invokes/new calls too?

12:51 ghadishayban: Bronsa: I think that the patch should only handle the minimum amount - jumping from one frame of execution to the next. keyword invoke (even in tail position) just grabs a val and dumps it on the stack - not really long lived.

12:51 Bronsa: as for new -- I haven't explored that too much but I'd love to be proven lazy by a good test case

12:55 Bronsa: ghadishayban: you're probably right regarding the kw-invoke case, I'll try and see if I can find a case where not clearing this before new causes the issue

12:56 ghadishayban: Bronsa: sorry for the shit ton of jira notifications, I thought edited notifications would be somehow debounced =/

13:15 logic_prog: does anyone fucking unerstand how deletinos in red black trees work? I'm trying to understand Clojure's persistent data structures; and I get rb-tree insertion, but rb-tree deletion is fucking confusing with red, black, double black, and negative black nodes

13:17 dnolen: core.async + om is solid gold

13:22 logic_prog: what is om?

13:24 kmicu: https://github.com/swannodette/om

13:25 dnolen: om + core.async https://gist.github.com/swannodette/7915826

13:26 logic_prog: it's a bridge to Facebook's React optimized for ClojureScript

13:32 xeqi: dnolen: is om 0.1.0 published or do I need clone/install

13:35 meoblast001: as far as web frameworks in Clojure, is Luminus a pretty popular one? if not, what good alternatives are there?

13:36 dnolen: xeqi: clone/install, want to play with this a bit more before pushing it out - it's getting close!

13:37 SegFaultAX: meoblast001: Luminus isn't really a web framework so much as a set of default libraries with some obligatory boilerplate taken care of.

13:38 meoblast001: That's a feature by the way, not a drawback.

13:38 Pedestal and Caribou are also worth looking into, though.

13:38 meoblast001: okay. i'm looking over it and it passes my test as something i want to look into more

13:39 but if it's something that is a dead project or something the entire clojure community hates, i don't even want to start looking

13:39 so it should be fine to carry forward?

13:40 SegFaultAX: meoblast001: To reiterate, Luminus is just a set of sane defaults.

13:40 And those defaults are the de facto libraries in the Clojure web community.

13:40 meoblast001: okay. thanks

13:41 SegFaultAX: meoblast001: Try this `lein new luminus test-app && tree test-app`

13:41 meoblast001: You'll see there isn't very much to it at all.

13:41 meoblast001: yeah

13:41 SegFaultAX: I'd also strongly recommend you take a look at Liberator.

13:43 meoblast001: SegFaultAX: on the topic of sane. is clojurescript something sane or just a toy project?

13:46 SegFaultAX: meoblast001: I can't really speak to that from personal experience, but it appears to be stable enough to do real work with.

13:47 meoblast001: All of the cljs core team idles in this channel though. so you might direct your questions at them.

13:47 dnolen: *poke* ^

13:48 dnolen: meoblast001: not a even remotely close to a toy

13:48 meoblast001: ah, cool

13:54 ouch

13:54 when i do lein new luminus guestbook, it creates a project named luminus in a directory named guestbook

14:01 munderwo: Hi all. Im doing some dev in the repl, and want to reload the code from a namespace. at the moment I'm doing (use 'bob.core) at the start. But how to I get it to reload so I can run my changes?

14:06 matthavener: munderwo: i think you can do (use 'bob.core :reload)

14:07 munderwo: ahh cool.. thanks matthavener

14:07 matthavener: munderwo: you also might check out tools.namespace https://github.com/clojure/tools.namespace

14:07 (refresh) will then reload all your namespaces nicely

14:44 noprompt: dnolen: is om cool to "beta" test?

14:44 dnolen: noprompt: getting really close, working on TodoMVC right now and it seems pretty rocking so far

14:45 noprompt: dnolen: nice. looking forward to it. hopefully a version on clojars soon?

14:45 dnolen: noprompt: yep

14:46 noprompt: such good news

14:55 rovar: how do I get frodo in my classpath so that I can load it?

14:55 I'm trying to follow the instructions at https://github.com/james-henderson/lein-frodo

14:55 frodo seems to work as a plugin, but it is not present when I run lein repl

15:20 poppingt`: Do watches keep track of metadata in refs?

15:21 rovar: is it in clojars?

15:21 rovar: poppingt`, it is: jarohen/lein-frodo

15:21 however, I have it included in my project as a plugin

15:21 because it is..

15:22 however.. some instructions also mention (requiring) it

15:22 which fails.

15:26 poppingt`: do you have Nomad installed?

15:28 rovar: i unno, I assume it would pull in nomad when I referenced frodo

15:41 gfredericks: dnolen: the docstrings for fd/+ and fd/* don't specify the arg order; is that worth a jira ticket?

15:41 dnolen: gfredericks: hrm, what do you mean?

15:41 gfredericks: I still don't know how core lib maintainers prefer to handle tiny doc changes

15:42 dnolen: every time I go to use it I can't remember if the sum is first or last

15:42 andrei: Should there be a huge performance difference between starting a repl with 'lein repl' vs just running 'clojure-1.5'?

15:43 gfredericks: andrei: what does running clojure-1.5 do?

15:43 andrei: gfredericks: that's just the clojure binary that my distribution installed

15:43 coventry: andrei: Do you mean in startup time? lein repl starts two jvms by default.

15:43 andrei: gjl_package=clojure-1.5

15:43 gjl_main="clojure.main"

15:43 source /usr/share/java-config-2/launcher/launcher.bash

15:43 coventry I mean runtime

15:44 dnolen: gfredericks: fixing

15:44 andrei: http://0xab.com/pi-clojure.clj

15:44 Takes 4.7 seconds in the repl that 'lein repl' sets up

15:45 gfredericks: dnolen: cool, thanks!

15:45 andrei: 1.6 seconds in the repl that 'clojure-1.5' sets up

15:45 dnolen: gfredericks: https://github.com/clojure/core.logic/commit/9b9b3a8bb87ab5ccac2491fb5fdd80af18c47847

15:46 andrei: My profiles.clj file is empty ( {} ) and I'm strating running 'lein repl' in a directy that is not a clojure project

15:46 gfredericks: dnolen: perfect

15:46 hyPiRion: andrei: yes, should be faster to run clojure-1.5. `lein repl` starts up two JVMs, whereas clojure-1.5 starts up just one

15:46 coventry: andrei: Might be a tiered compilation issue. Try 'LEIN_JVM_OPTS= lein repl'

15:46 https://github.com/technomancy/leiningen/wiki/Faster#tiered-compilation

15:47 andrei: hyPiRion: That's startup time, I mean runtime of an algorithm

15:47 justin_smith: andrei: that's where tiered compilation comes in

15:47 andrei: coventry: That did it

15:47 justin_smith: there are different optimization settings

15:47 andrei: Oh, ok. Is there some doc that I should have read that would have pointed me in this direction?

15:48 hyPiRion: andrei: ah. Well, if you're on the newest leiningen version, add in :jvm-opts [] in your project.clj or do as coventry proposed

15:48 justin_smith: andrei: if you use criterium it gripes if you don't have optimizations on

15:48 hyPiRion: (for older version, you'd have to do :jvm-opts ^:replace [])

15:49 gfredericks: (inc dnolen)

15:49 lazybot: ⇒ 13

15:49 andrei: Thanks for the help everyone!

15:49 Does this mean that there exist options which will produce even faster code?

15:50 coventry: andrei: Check out the leiningen wiki page I linked above. Don't know whether any of the other suggestions will help, though.

15:50 andrei: coventry: Will do. Thanks!

15:51 hyPiRion: faster is relative. You could check out tiered compilation or tweak the garbage collector settings

15:51 andrei: Generally http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html is a nice webpage for performance

15:52 andrei: hyPiRion: Awesome, thanks!

15:52 hyPiRion: it doesn't tell you how to tune them properly, but at least it tells you what's available

15:54 andrei: If I wanted to extend basic numeric operations in clojure, but the multimethod way is far too slow

15:54 Where would I look?

15:54 I'm willing to spend time learning and implementing whichever approach will produce the fastest code

15:54 However low-level or involved it is in any language

15:54 amalloy: andrei: you can't really do it. just define a new function with a name that's different from +, which is what you use for adding your quasi-numbers

15:55 andrei: amalloy: Sadly that won't be sufficient in my case, the name has to be the same

15:55 TEttinger: you can redefine + can't you?

15:56 amalloy: TEttinger: you can't make the + that some other namespace uses behave like you redefined +

15:56 andrei: TEttinger: If I redefine it in one file in a project, how does that carry over to all of the other files in the project?

15:56 amalloy: Oh, I see what you mean. That's fine.

15:57 amalloy: I'm willing to put some use line at the top of each file which needs this feature

15:57 TEttinger: what is the extension for?

15:57 andrei: amalloy: So if I redefine + I can get the same performance that clojure's implementation of + gets?

15:58 TEttinger: probably not? I haven't tried, but it might be helpful to read the clojure source

15:58 andrei: TEttinger: I do research in AI/ML and I regularly perform nonstandard interpretation of numeric programs

15:58 amalloy: no, you can't, because clojure.core/+ can emit a single bytecode operation when it's working with primitives

15:58 TEttinger: neat, andrei

15:58 andrei: amalloy: And there's no way to get a user function to do the same?

15:58 amalloy: obviously you won't have primitives, you'll have these weird made-up numbers you want to invent

15:58 no jvm bytecode knows how to add them

15:59 andrei: amalloy: Sure, but I'm willing to pay the cost for 1 branch

15:59 amalloy: For every math operation

15:59 amalloy: i don't see what you're getting at

16:00 you'll have some Object which represents a number in your program, and some function named + that you want to use to add it

16:00 TEttinger: https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L936

16:00 andrei: amalloy: I want to mix my numbers and standard numbers

16:00 amalloy: an Object, no matter what it contains or how you work with it, will be much more heavy-weight than a primitive

16:00 andrei: amalloy: When both operands to + are primitives I want the old behaviour + speed with the cost of 1 branch

16:00 amalloy: Like so: https://github.com/abarbu/AD/blob/master/AD.scm

16:01 amalloy: mmmmmm, you can probably do that

16:01 andrei: TEttinger: Thanks!

16:01 TEttinger: andrei, you will notice some fun stuff right away

16:02 like the more-than-two-args version being much heavier

16:02 andrei: TEttinger: Yeah.. that's pretty common. I'll do the standard trick of writing a macro to expand them out

16:03 amalloy: it's going to be pretty tricky to *tell* whether the operands are primitives, though

16:03 andrei: amalloy: Oh?

16:04 TEttinger: because of auto-boxing?

16:04 amalloy: you can't introspect that at runtime, because it's a decision made at compile time; and i don't know of a way for a macro to ask a question like "given the current &env, what is the type of expression e?"

16:05 andrei: amalloy: There's no runtime 'primitive?' function?

16:05 amalloy: no

16:05 coventry: typed clojure gives you no leverage there?

16:05 amalloy: all functions receive Object args

16:05 the way clojure.core/+ works is it unconditionally expands to (RT/add x y), and later a special compiler pass replaces that with a single bytecode op iff x and y are both primitives of the same type

16:05 andyf: amalloy: Some Clojure fns receive primitive args, if they have <= 4 and are type-hinted, yes?

16:06 amalloy: Not that that invalidates any of your previous statements on the difficulty of mixing boxed and unboxed at run-time.

16:06 amalloy: andyf: sure

16:06 but i don't think you can use that to implement "primitive?"

16:07 because (defn primitive? ([^long x] true) ([^double x] true) ([x] false)) will call the long version if x is statically known to be a boxed Long, i think

16:07 i'm not sure about that though

16:07 clojurebot: Excuse me?

16:08 justin_smith: https://github.com/ztellman/primitive-math what about the checks primitive-math does?

16:08 it gives reflection warnings if boxing of numbers happens

16:10 TEttinger: justin_smith, that might be key.

16:10 https://github.com/ztellman/primitive-math/blob/master/src/primitive_math/Primitives.java he uses java to implement that part

16:10 justin_smith: oh, interesting

16:11 andrei: Ah, that looks like a good way to go

16:11 TEttinger: and then he wraps it in clojure

16:12 Bronsa: https://github.com/ztellman/primitive-math/blob/master/src/primitive_math/Primitives.java#L212 how is this valid in Java?

16:12 TEttinger: https://github.com/ztellman/primitive-math/blob/master/src/primitive_math.clj looks pretty simple, but the README shows the limitations

16:12 justin_smith: I learned about primitive-math in the "Clojure High Performance Programming" book. Good, dense with info, though pricy for the short page count.

16:12 andrei: justin_smith: Awesome. Thanks! I'll check it out

16:12 amalloy: Bronsa: empty statements are allowed

16:12 Bronsa: amalloy: didn't know that, thanks

16:13 amalloy: although i'm a little surprised to see that statements are allowed at the top level of a class declaration

16:13 like, ;;;; would be valid a lot of places, i just didn't realize this was one of them

16:14 Bronsa: isn't int foo; a statement too?

16:14 dsrx: ,;;;;

16:14 amalloy: certainly

16:14 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

16:14 amalloy: oh, i see

16:14 Bronsa: :)

16:16 andrei: In https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L936, why are there two versions of every math operator?

16:17 A quoted one and an unquoted one

16:17 amalloy: Bronsa: in a class declaration those actually aren't statements, exactly

16:17 check out http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.6, where ; is explicitly allowed

16:17 TEttinger: one auto-promotes ints to bigInts

16:17 andrei ^

16:17 ,(+ 1111111111111111111111111111111111 11111)

16:17 clojurebot: 1111111111111111111111111111122222N

16:17 TEttinger: wat

16:18 Bronsa: amalloy: I see

16:18 amalloy: TEttinger: 1111111111111111111111111111111111 is already a bigint

16:18 TEttinger: ##(+ 1111111111111111111111111111111111 11111)

16:18 lazybot: ⇒ 1111111111111111111111111111122222N

16:18 TEttinger: oh

16:18 herp

16:19 ##(reduce + (repeat 100 16rfffffff))

16:19 lazybot: ⇒ 26843545500

16:19 TEttinger: gah

16:19 amalloy: &(reduce * (repeat 100 16rfffffff))

16:19 lazybot: java.lang.ArithmeticException: integer overflow

16:19 amalloy: ez

16:19 TEttinger: ##(reduce +' (repeat 100 16rfffffffffffffff))

16:19 lazybot: ⇒ 115292150460684697500N

16:20 dav: What is the purpose of 'do' given that if you just put the forms one after the other it seems to work just as well as without the do-statement?

16:20 TEttinger: I just woke up haha

16:20 amalloy: dav: (if x (do y z) n)

16:20 andrei: TEttinger: Thanks!

16:20 TEttinger: dav, it's very useful when you have stuff like if, things that only allow one form... also when you want to return something after calculating something else

16:21 amalloy: imagine (if x y z n). how do those group?

16:21 dav: amalloy: so you would never do (let [..] (do ...)) ?

16:21 amalloy: dav: well, "never" is a strong word. i could imagine doing it on occasion

16:21 to emphasize side effects or something

16:21 but you never *need* to

16:22 TEttinger: ,(do (print "whee ") 0)

16:22 clojurebot: whee 0

16:22 TEttinger: ,(do (print "whee "))

16:22 clojurebot: whee

16:22 TEttinger: oh that's interesting, clojurebot doesn't show the nil?

16:22 amalloy: ,(do (do (do (do 'whop))))

16:22 clojurebot: whop

16:22 dav: TEttinger / amalloy - thx. is there a reason to use when rather than if other than for clarity ?

16:23 TEttinger: when allows multiple forms

16:23 other than that, not really? it is clearer

16:24 Bronsa: dav: some (myself included) use when instead of if when there's no else branch, others only use when for side-effects

16:24 also: ,(macroexpand '(when x a b c))

16:24 clojurebot: (if x (do a b c))

16:24 TEttinger: when returns nil if the condition is false, so it can be handy when passed to some fns that expect nil rather than false

16:24 dav: amalloy / TEttinger / Bronsa - ok i think I have the clear picture. thanks!

16:25 amalloy: TEttinger: wat

16:25 that last one makes little sense

16:25 Bronsa: TEttinger ##(if false 1)

16:25 lazybot: ⇒ nil

16:25 TEttinger: I am fairly certain I encountered one in the std lib...

16:26 amalloy: obviously there are functions that care about nil vs false, but that doesn't distinguish if from when at all

16:26 TEttinger: http://clojuredocs.org/clojure_core/clojure.core/keep

16:27 sure, it just saves typing nil as an else statement

16:27 amalloy: did you...read what Bronsa just sent you?

16:27 TEttinger: oh herp

16:27 that won't work for multiple forms though, you need.... do !

16:34 technomancy: clojurebot: when?

16:34 clojurebot: when is for side effects

16:34 * technomancy nods sagely

16:34 Bronsa: >:(

16:36 amalloy: if technomancy *and* clojurebot both think this independently and without any collusion it must be true!

16:38 hyPiRion: clojurebot: technomancy?

16:38 clojurebot: technomancy codes while wearing gravity boots to increase the blood flow to the face transplant he got after discovering the world does not treat build tool creators kindly

16:39 hyPiRion: oh, I've not seen that before

16:46 also: clojurebot: clojurebot?

16:46 clojurebot: "More human than human" is our motto.

16:47 bitemyapp: LOL

16:47 hyPiRion: I hadn't seen that one before.

16:48 also: clojurebot: lazybot?

16:48 clojurebot: lazybot is echo ~lazybot

16:48 bitemyapp: I happen to agree with clojurebot and technomancy. when is for side-effects.

16:48 also: why is that?

16:49 tim__: , (when (:a {:a 42}) "we have a")

16:49 clojurebot: "we have a"

16:49 tim__: no side effects needed.

16:51 SegFaultAX: It's a matter of convention.

16:52 It's not like you /have/ to use it for side effecting code, obviously.

16:53 But since if and if-not don't require an alternative branch, when and when-not are used for side-effecting code by convention.

16:53 tbaldridge: ah, good point. Forgot about the optional branch

17:12 cYmen: Since when does if not require an alternative branch?

17:12 Bronsa: since always?

17:13 cYmen: huh

17:13 odd...wonder where I got that idea, then

17:14 also: cYmen: i was confused by the first example for kibit: https://github.com/jonase/kibit

17:17 cYmen: hm...can't remember...maybe :)

17:22 Well, I checked out the 4clojure source and now have a local copy running.

17:22 Now, what to do. :p

17:28 Fuck...

17:45 logic_prog: how do I get format in clojurescript?

17:45 what library/namespace is it part of?

17:46 rovar: java string?

17:46 ,(find-doc format)

17:46 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.core$format cannot be cast to java.lang.String>

17:46 rovar: ,'(find-doc format)

17:46 clojurebot: (find-doc format)

17:46 also: logic_prog: i don't think it exists. javascript doesn't provide format

17:47 rovar: oh.. I didn't read the word clojurescript

17:47 yea.. it's a native

17:47 justin_smith: (doc format)

17:47 clojurebot: "([fmt & args]); Formats a string using java.lang.String.format, see java.util.Formatter for format string syntax"

17:48 logic_prog: non-existence is useful

17:48 thanks!

17:49 rovar: so how do people work with local-repo?

17:50 I find it odd how poor the support in lein is for compiling dependencies for other projects

17:54 dnolen: ok the fact that every node in the om tree has its path is pretty awesome

17:54 justin_smith: rovar: I usually just run lein install in each project, without using local-repo

17:55 cYmen: hm...can't seem to install cider

17:55 fails to download :/

17:55 justin_smith: yeah, known issue with the emacs archive

17:55 cYmen: but fairly recent, I take it?

17:55 justin_smith: not a cider bug, a bug in the archive server

17:57 cYmen: but the issue is new?

17:57 because I think it installed just fine on three machines a couple of weeks ago

17:58 rovar: justin_smith, when you use that approach, how do you reference one project from the other?

17:58 justin_smith: in project.clj

17:59 as I would any other dependency

17:59 rovar: does install put it into the ~/.m2?

17:59 justin_smith: yeah

18:36 sorenmacbeth: is there already a fn that does (interleave (keys m) (vals m))?

18:36 justin_smith: (mapcat m) ?

18:37 ,(mapcat {:a 0 :b 1})

18:37 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/map>

18:37 justin_smith: err

18:37 ,(mapcat identity {:a 0 :b 1})

18:37 clojurebot: (:a 0 :b 1)

18:38 rukor: (flatten (seq m))

18:38 justin_smith: ~flatten

18:38 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

18:39 sorenmacbeth: flatten doesn't do what I want

18:39 justin_smith: ,(flatten {:a 0 :b [1 2] :c 3})

18:39 sorenmacbeth: yes, like clojurebot says

18:39 clojurebot: ()

18:39 rukor: right

18:40 sorenmacbeth: ,(mapcat identity {"foo" [:bar]})

18:40 clojurebot: ("foo" [:bar])

18:40 sorenmacbeth: yeah, that's what I need

18:40 cheers

18:40 coventry: ,(apply concat {1 2 3 4})

18:40 clojurebot: (1 2 3 4)

18:40 sorenmacbeth: ,(apply concat {"foo" [:bar]})

18:40 clojurebot: ("foo" [:bar])

18:40 justin_smith: I wonder what the mapcat identity / apply concat tradeoff comes down to

18:41 coventry: Probably the mapcat version is faster.

18:41 hyPiRion: it's the other way around

18:41 mapcat is just (apply concat (apply map f coll))

18:42 coventry: Huh.

18:42 justin_smith: cool, thanks hyPiRion

18:42 seangrove: ,(reduce concat (seq {"foo" [:bar]})) ; just for fun

18:42 clojurebot: ["foo" [:bar]]

18:42 hyPiRion: (apply concat coll) would be faster, if performance was an issue

18:43 ,(reduce into [] {1 2 3 4}) ; could probably be a competitor

18:43 clojurebot: [1 2 3 4]

18:46 justin_smith: (persistent! (reduce (fn [vc [k v]] (-> vc (conj! k) (conj! v))) (transient []) {1 2 3 4}))

18:46 likely the big winner

18:49 sorenmacbeth: thanks pals

18:49 gonna go with (apply concat amap) for now

18:49 justin_smith: good call

18:49 hyPiRion: would be surprising if that's your bottleneck anyway

18:50 justin_smith: yeah, most likely not a bottleneck

18:50 but it is fun to bytecode-cycle-golf

19:03 nkozo: somebody knows how to make a _bidirectional_ binding in seesaw?

19:21 gfredericks: justin_smith: man it'd be fun if there were a expr->bytecode-cycles

19:22 what's the easiest way to get such a thing?

19:22 probably optimizing jvms would make the results irrelevant anyhow :/

19:23 andyf_: gfredericks: What is this bytecode-cycles you refer to?

19:24 gfredericks: welp

19:24 yunno.

19:24 number of bytecode instructions executed during the evaluation of an expression?

19:26 andyf_: gfredericks: Yeah, I'm pretty sure most of the code that you care how fast it runs does get optimized by the JIT.

19:27 dsrx: ,(apply concat [[1 2] [3 4] [5 6]])

19:27 clojurebot: (1 2 3 4 5 ...)

19:28 dsrx: ,(doc mapcat)

19:28 clojurebot: "([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."

19:32 hyPiRion: Hrm

19:32 ,(coll? "hey")

19:32 clojurebot: false

19:33 TEttinger: hyPiRion, that's interesting

19:33 hyPiRion: I guess it should return a seqable item instead

19:33 ,(mapcat identity ["foo" "bar"])

19:33 clojurebot: (\f \o \o \b \a ...)

19:51 lalala: is there anyone who has used Pedestal on a project who would be willing to tell me about their experience using it?

19:52 dnolen: TodoMVC in progress - https://github.com/swannodette/todomvc/tree/om/labs/architecture-examples/om

19:55 also: dnolen: awesome!

19:58 dnolen: representing your UI as EDN rocks so hard

20:01 also: i've been avoiding all the javascript template libraries...they all feel wrong

20:01 rovar: I rather like dommy

20:02 and I'm generally picky about that sort of thing

20:02 dnolen: I do not believe in templates anymore

20:02 or string based ones anyway

20:06 bitemyapp: god I am exhausted.

20:07 andyf_: god already knew that

20:07 bitemyapp: andyf_: teaching people is tiring.

20:07 talking is tiring

20:07 thinking is tiring

20:08 andyf_: Teaching people who aren't learning very well? I find teaching people who are paying attention and interested in learning invigorating.

20:08 bitemyapp: andyf_: well it's fun, but you still have to repeat yourself some.

20:08 andyf_: but I've noticed a difference in how draining it is depending on speed of uptake.

20:09 andyf_: What are you teaching?

20:09 bitemyapp: andyf_: Haskell!

20:10 andyf_: Ah, came to the #clojure channel to relax your mind, eh? :-)

20:11 bitemyapp: andyf_: I just have a lot of people I really like here.

20:11 pdk: #clojure

20:11 a place for friends

20:11 bitemyapp: andyf_: there are really nice people in #haskell too, I just don't know as many of them

20:11 pdk: lol!

20:25 rovar: does #clojure have a history somewhere?

20:25 I need to rediscover a url that someone gave me

20:25 coventry: http://clojure-log.n01se.net/ http://logs.lazybot.org/

20:25 Bronsa: rovar: http://clojure-log.n01se.net/

20:25 clojurebot: Excuse me?

20:26 Bronsa: mph.

20:26 (inc coventry)

20:26 lazybot: ⇒ 5

20:26 coventry: The n01se.net has gone down at times, so I think it may be incomplete, but it has the better interface.

20:26 *.net one

20:28 rovar: this was it : https://github.com/halgari/clojure-conj-2013-core.async-examples/blob/master/src/clojure_conj_talk/core.clj

20:28 andyf_: Bronsa: I am running into some cases where Eastwood analyzing multiple namespaces in a single run causes exceptions with some namespaces, but when I do those namespaces by themselves, there is no exception. Have you seen such things before? Would you be interested in looking at an example of this?

20:28 rovar: I need to tell google to increase the pagerank of that page

20:29 Bronsa: andyf_: I've seen such things before and am horrified at the thought of debugging that again.

20:29 but please, let me know what's failing

20:30 andyf_: Bronsa: I'll file one as an Eastwood issue, since it might be specific to how Eastwood is using tools.analyzer. Should I try to minimize the source code size first?

20:31 Bronsa: andyf_: but first, make sure you are using the last snapshot of tools.analyzer.jvm && have lein install'ed the master version of eastwood, I really thought i had that fixed

20:32 andyf_: file the issue for now, so I can look into that. If you want you can try to minimize the failing source code later :P

20:33 andyf_: OK, wiping my .m2 out first, git pull'ing, making sure everything up to date before filing the issue.

20:35 bitemyapp: andyf_: kind of you :)

20:37 Bronsa: I just went in a hurry to the kitchen with a feeling I had something really urgent to do there.

20:37 But then I didn't.

20:37 andyf_: Dinnertime? :-)

20:37 Bronsa: It's 2.35AM here

20:37 bitemyapp: Bronsa: 1737

20:38 andyf_: Bronsa: You are going to hate this one even more, because it requires 3 namespaces to give the exception on the 3rd one. Any 2 of them gives no exception :-(

20:39 Bronsa: duh.

20:39 bitemyapp: andyf_: admittedly, you could prove that conclusively with a generative test.

20:41 seangrove: technomancy: Is this kind of 503 error on an initial clojure push sermi-normal for Heroku? https://www.refheap.com/c654aa6acc97e8f9fbe270e78

20:41 Bronsa: andyf_: does it involve a defprotocol?

20:42 andyf_: I think the crux of the issue is a Java import in an earlier namespace, with a type-hint on a function return value for a Java class, and then the function is called in a later namespace that doesn't have the import. But that is a guess at this point.

20:42 Bronsa: mh.

20:42 seangrove: technomancy: It gets a little bit further along each time I push it though

20:42 andyf_: The exception is that the Java class is not found during the :deprecations linter.

20:44 Sorry, the exception is during the analyzer, not the linter.

20:44 Almost done reproducing with fresh checkouts.

20:44 Bronsa: yeah, doesn't sound like what I thought it would be.

20:44 damn.

20:46 andyf_: Oh, I also saw a line of code in the Seesaw lib today where it does (extend (fn-call-that-returns-class) ...)

20:46 Or a fn call that returned something, maybe it wasn't a class. Anyway, it wasn't just a symbol.

20:47 I'll file a TANAL ticket for that one for consideration.

20:47 Bronsa: ok

20:49 dnolen: so om pretty must leaves JS client side frameworks in completely dust as far as rendering performance

20:49 and instead of pointless models - just data

20:54 akhudek: dnolen: om looks really neat, looking forward to giving it a try

20:55 dnolen: akhudek: I'm pretty psyched about it

20:59 andyf_: Bronsa: The 3-namespace issue: https://github.com/jonase/eastwood/issues/28

21:00 Bronsa: ok, will look into that thanks

21:06 seangrove: Well, that only took ~15 `git push heroku master` attempts.

21:06 bitemyapp: good to see relying on magic is paying off for some people.

21:06 I bet you could script that.

21:07 I'm pretty sure that's how keynesianism works. When magic isn't working, layer on more magic.

21:07 TEttinger: magic/more magic switch

21:13 andyf_: you have to get it working correctly once before you can automate.

21:24 bitemyapp: andyf_: false.

21:26 SegFaultAX: bitemyapp: (iterate magic (magic))

21:26 (drop-while not-working? (iterate magic (magic))) to be precise.

22:02 logic_prog_: is there anything like slingshot (try+, catch+) for clojurescript ?

22:12 rukor: how do you represent this.props.children from react.js in om?

22:17 solussd: om?

22:18 bitemyapp: solussd: it's a library.

22:19 solussd: ah

22:19 rukor: https://github.com/swannodette/om

22:20 solussd: oh neat, fancy new :include-macros option in require

22:20 seangrove: Actually what caused the new :include-macros in cljs in the first place, heh

22:22 bitemyapp: seangrove: what?

22:22 seangrove: bitemyapp: om is what pushed dnolen over the line to add the :include-macros option to cljs, I believe

22:23 bitemyapp: seangrove: that validates my suspicion that increasing his pain is the way to force a painkiller.

22:23 rukor: haha

22:24 * bitemyapp rubs hands together and plots evil ideas

22:24 seangrove: bitemyapp: Any easy way to get korma to play nice with dev and heroku?

22:24 I struggle with this every time I push a new app

22:24 bitemyapp: seangrove: I can think of several.

22:25 most of them involve an environment variable and weavejester's library.

22:27 dsrx: logic_prog_: (try* (throw "world") (catch e (js/alert (str "hello " e))))

22:27 bitemyapp: seangrove: if you get specific (you need to configure a database URI that needs to vary between dev and heroku? simultaneously?) I can be more helpful.

22:27 seangrove: bitemyapp: Well, I always struggle to get korma to connect to Heroku's pg. Seems like there's some incantation that gets the ssl stuff to work properly

22:28 bbloom: dnolen: have you succeeded in reproducing the (goofy) todo mvc toy yet? curious to see how your wrapper scales to there & beyond

22:28 dsrx: logic_prog_: try in cljs is just a macro for try* that does type dispatching, try* maps pretty directly to try/catch in JS

22:28 logic_prog_: dsrx: noted, thanks

22:29 bitemyapp: seangrove: http://stackoverflow.com/questions/13175655/trouble-connecting-to-postgresql-db-on-heroku-with-korma-clojure this looks promising.

22:29 seangrove: bitemyapp: Heh, if browser history were like ant trails, that'd be a very thick line

22:30 If you haven't heard of the challenges, don't worry about it, I'll try to narrow it down more

22:31 Bronsa: yet another bug fixed. I can now go to sleep satisfied.

22:31 bbloom: dsrx: try* is an implementation detail

22:31 use (catch :default ...)

22:32 Bronsa: bbloom: an implementation detail.. that doesn't even exist anymore :P

22:32 bbloom: Bronsa: oh right, i forgot. even better

22:32 logic_prog_: see https://github.com/clojure/clojurescript/blob/master/test/cljs/cljs/core_test.cljs#L480-L482

22:32 bitemyapp: seangrove: I understand the problem, you just need to default and vary some stuff between dev/prov in a config.clj from environment variables.

22:32 seangrove: I've solved this many times before, demonstrated ways to structure it, etc.

22:32 I'd do virtually the exact same thing in Haskell too.

22:36 xeqi: dnolen: do you have a gist of the om based todo?

22:37 coventry: xeqi: https://github.com/swannodette/todomvc/tree/om/labs/architecture-examples/om

22:37 xeqi: coventry: thanks

22:39 bbloom: nice

22:40 looks like it still has a long way to go though

23:08 logic_prog_: how do I write "document.documentElement.style.overflow = 'hidden'; " in cljs? I want to disable scrollbars

23:22 dsrx: I've got this project.clj, and leiningen wants to pull down clojure 1.2.1 https://gist.github.com/tomjakubowski/8ecc91adea9245c22d0a . Is there a way I can see which dependency has clojure 1.2.1 as a dep without waiting for all the dependencies to download (i'm on a slow connection at the moment)?

23:23 logic_prog_: http://stackoverflow.com/questions/7836204/chrome-fullscreen-api <-- how do I make this work with clojurescript

23:24 rukor: logic_prog_: (-> js/document (.-documentElement) (.-style) (.-overflow) (set! "hidden"))

23:24 logic_prog_: rukor: got that working already

23:25 rukor: logic_prog_: ok

23:25 logic_prog_: just changed the html :-)

23:25 rukor: :-)

23:25 logic_prog_: rukor: however, please help with the full screen api

23:25 SegFaultAX: Not sure why, but this problem took me an hour to solve: http://www.4clojure.com/problem/124

23:25 logic_prog_: (let [el (.-documentElement js/document) rfs (.-webkitRequestFullScreen el)] (. js/console log rfs) (. js/console log el) (.call rfs el))

23:25 somehow doesn't work

23:26 SegFaultAX: But my answer is among the shortest of those I'm following. So that's awesome :)

23:27 rukor: logic_prog_: is it not intended to be called from an event handler?

23:27 logic_prog_: why can't I call it out of an event handler,

23:27 i.e. in window.onload

23:28 http://stackoverflow.com/questions/9454125/javascript-request-fullscreen-is-unreliable on shit

23:28 I can only call it from an event handler?

23:29 rukor: logic_prog_: does it work when you do? from the SO page, it says it has to be within the context of a user interaction

23:29 logic_prog_: well, let me hook something up :-)

23:29 this is fucking annoying though

23:29 as I have events sent to core.async go channels

23:29 * logic_prog_ shakes hands at chrome developers

23:29 logic_prog_: s/hands/fists

23:29 rukor: logic_prog_: that would make sense though, as I have always clicked a button to go full screen :-)

23:30 logic_prog_: http://johndyer.name/lab/fullscreenapi/

23:30 dsrx: logic_prog_: specifically it can probably only be called from a user-initiated event callback, like for creating popup windows

23:31 logic_prog_: rukor, dsrx: this makes sense now, thanks for clarifying!

23:31 rukor: logic_prog_: np

23:36 andrei: How can one require multiple libraries and assign them to the same alias?

23:40 dsrx: nice, now for some reason it's also pulling in clojure 1.3.0-alpha6

23:43 logic_prog_: rukor, dsrx: it works now, bound ctrl-0 to full screen and it works

23:45 rukor: logic_prog_: nice

23:52 amalloy: andrei: you can't. a namespace's aliases are a map from alias-symbol to namespace

23:54 nathanielksmith: hiya. My tests (in test/<projname>/test/<testfile>.clj) are unable to require things in my actual code (src/<projname>/<file>.clj).

23:54 amalloy: SegFaultAX: an hour seems pretty reasonable for 4clojure 124. there's a lot to do

23:54 nathanielksmith: I'm running with lein test.

23:54 It's finding and running the tests fine

23:54 The tests just can't see the <projname> namespace

23:55 any suggestions?

23:55 rovar: what is the easiest way to map a function across the vals of a hashmap while leaving the keys in-tact?

23:56 andrei: amalloy: Ah, too bad. Thanks!

Logging service provided by n01se.net