#clojure log - Jan 27 2013

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

0:53 cakehero: Hi team

0:53 is this answer correct: http://cl.ly/image/0H0T3P320G1o

0:54 Raynes: lol

0:54 amalloy: ^

0:54 Pretty good one, I'd say.

0:54 cakehero: thanks

0:54 I'm super good at algorithms

0:54 for finding maximums

0:55 Raynes I wonder if I could have it randomly pick from the three numbers, and just re-run it until it gets the right answer

0:55 I'm going to try that

0:59 Raynes http://cl.ly/image/2m1R0P0z3H2e getting there

1:01 http://cl.ly/image/0Q1D1j3T0u1y <--- random

2:31 danbell: Anyone know how to stop a call to reduce in the middle? Say I've got an infinite sequence, and I want to process members of it until $arbitrary-truthy-thing. Anyone know how to do this?

2:31 Raynes: You can't do that.

2:32 amalloy: well. in 1.5 you can do that

2:32 Raynes: What?

2:32 clojurebot: what is exceptions

2:32 amalloy: previous to 1.5, the best you can do is loop/recur, or use reductions and take-while

2:32 Raynes: Reducers crap?

2:32 amalloy: nah, not really related

2:32 Raynes: Then explain, man!

2:32 amalloy: (reduced 10) ;; the answer is 10, stop reducing

2:32 danbell: thanks Raynes; I noticed M. Fogus alluding to "how to short-circuit reduce"

2:33 oh, reductions might be what I'm looking for

2:34 Raynes: amalloy: What do you mean it isn't related to reducers? I can't find any instance of 'reduced' outside of reducers.

2:34 amalloy: i find reductions often sounds pretty cool, but most of the time using it leads to less readable code

2:35 Raynes: Oh

2:35 I'm dumb.

2:35 amalloy: Raynes: support for reduced could have come without all the big reducers changes

2:35 Raynes: I see the reduced function in core.clj now.

2:35 danbell: are reducers considered to be...off?

2:35 amalloy: does that mean something, or is it just...drama?

2:36 Raynes: I called it 'crap' because I haven't bothered learning what it is yet and I hate things I don't understand.

2:36 danbell: ha

2:36 yeah, was keying off of raynes' crap comment

2:36 amalloy: no, Raynes is just a twit

2:36 reducers are pretty cool

2:37 danbell: reading about them now...

2:40 Raynes: I wish somebody other than Rich would write about reducers. He is great and all, but these weird bullet points with questions peppering his blog post confuse me more than they help me.

2:41 And he is all "I'll give you the end first <bullet points>. Story starts best at the bottom."

2:41 OKAY, MAN, CAN YOU TELL ME ABOUT REDUCERS NOW!?!?!

2:47 tomoj: do you know Foldable?

3:16 yedi: anyone have guidelines or best practices for writing wrappers of java libraries

3:19 AtKaaZ: hey guys, how would you do this: #{"yes" or "make it settable" or "something [1]"} and have the `or` be ignored or be `,` ?

4:55 grc: Trying to get my head around why ('foo 1 2) => 2. Any explanations?

4:55 tomoj: ah, I understand why there is no INamed in cljs :(

4:55 grc: ##('foo {'foo 3})

4:55 lazybot: ⇒ 3

4:56 tomoj: &('foo {'bar 3} 2)

4:56 lazybot: ⇒ 2

4:56 tomoj: &({'bar 3} 'foo 2)

4:56 lazybot: ⇒ 2

4:56 tomoj: make sense now?

4:57 (doc get)

4:57 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

4:57 grc: tomoj: Thanks.

4:57 tomoj: symbols, keywords, and maps all act as functions with get-like signatures

4:59 I wonder why not (= :foo (0 [:foo])) in cljs

5:25 &(mapcat inc)

5:25 lazybot: clojure.lang.ArityException: Wrong number of args (1) passed to: core$map

6:00 tomoj: I was thinking you could do "extend AProtocol to any type which implements BProtocol but doesn't already have an AProtocol impl" inside a default AProtocol impl

6:00 ..but then everything satisfies AProtocol

6:01 I guess you could put it in a helper function instead of a default

6:39 z3phyr: what do you say about joxa?

6:40 It looks much like clojure.

6:44 tgoossens: Anyone knows a library for working with graphs. Preferably includes loop detection .

6:44 I'm looking at clojure contrib now. But

6:45 maybe some of you know some other interesting stuff

6:49 hcumberd`: :)

6:55 z3phyr: joxa is a mixture of clojure and scheme and targets BEAM

6:56 really, a must try language for clojure fans

7:05 joxa is a language I look to

7:09 saint_cypher: is clojurescript one still a good starting place or is it old and busted?

7:11 z3phyr: saint_cypher : It was a good starting place when I last checked

7:13 and if anybody wants to experiment, try joxa. Its too good IMHO

7:14 saint_cypher: z3phyr: thanks, I just noticed that it hadn't been committed to in a year and still had lein bootstrap in the docs so I had some hesitation.

7:17 hcumberd`: Is there a better / shorter way to write (DataInputStream. (FileInputStream. file)) ?

7:50 rl: hm is there any built-in symbol for current directory when compiling a faile?

7:50 *file

7:50 or do i have to do some processing againast *file* ?

8:12 nvm, found a solution at http://www.learningclojure.com/2010/03/conditioning-repl.html

8:12 hcumberd`: ;)

8:30 tomoj: saint_cypher: there's an M003 branch with somewhat more recent commits

9:45 pepijndevos: dnolen: core.logic/ping

9:48 I'm staring at dcg.clj. I'm interested in playing with it. But I remember you said somewhere it's slow. It's also littered with todo statements, and quite big for the cosmetic transformation wikipedia makes it out out be.

9:58 ChongLi: are these differences up to date?

9:58 https://github.com/clojure/core.logic/wiki/Using-core.logic-with-ClojureScript

9:58 gfredericks: ,(take 10 (reify clojure.lang.ISeq (first [this] 42) (more [this] this) (seq [this] this)))

9:58 clojurebot: (42 42 42 42 42 ...)

10:00 maxalwings: Is there any Lobos related tutorial out there?

10:01 pepijndevos: ChongLi: I was wondering the same. Especially FD stuff.

10:15 svjson: I'm running JDK7 on my machine - is there any way to tell leiningen/lein-ring to compile to JRE6-compatible bytecode?

10:20 there is :javac-options ["-target" "1.6" "-source" "1.6"], but I read that as affecting .java-files included in the leiningen project, not that it will apply to the compiled clojure files. True?

10:24 hyPiRion: svjson: true

10:26 I'll have a peek

10:26 svjson: hyPiRion: thanks

10:28 There's the option of downgrading to JDK6, of course. But that would be to take the long way around, to say the least

10:33 hyPiRion: So we're using clojure.core/compile to compile down to bytecode, but I'm not sure how to pass options to that one

10:33 Currently there's no way of specifying so.

10:34 svjson: Right. So downgrading to JDK6 might be my best bet, anyway then.

10:35 Seems pacman would have me remove all dependent packages first, and re-install them once JDK6 is in place. Quite a headache :/

10:35 hyPiRion: Thanks for looking into it, in any case

10:36 hyPiRion: svjson: Sounds messy, couldn't you just install JDK6 and keep JDK7?

10:36 If I were you, I'd use JDK7 and set LEIN_JAVA_CMD to point to JDK6

10:37 svjson: pacman won't let me. It mentions unresolvable conflicts when trying to install them side by side.

10:38 hyPiRion: huh, strange

10:38 svjson: Probably has to do with how they are packaged. Both 6 & 7 come from the Arch Linux User Repository, so they are not official packages

10:38 I've had different JDK versions set up side by side on machines in the past, but never on Arch

10:39 hyPiRion: Sounds messy, it's rather simple to set up on Debian (and prolly Ubuntu too)

10:40 svjson: Yeah, agreed

10:40 * josteink has his mind bent by enlive

10:42 hyPiRion: There is no spoon.

10:44 svjson: enlive sure is mind-bending. But in a good way :)

10:46 Iceland_jack: As opposed to mind-bending in a bad way ;)

10:47 josteink: svjson: absolutely

10:47 svjson: Iceland_jack: point :)

10:48 josteink: After years and years of template-placeholder oriented web design and OO/control-oriented web design

10:48 it feels like something new, something -interesting- for once

10:53 svjson: josteink: Exactly what I felt when I ventured down that rabbit hole

10:58 Turns out that culprit in all this might be clj-json - the project wont compile at all under JDK6.

10:58 Is there any way to tell which Java version libs are compiled for? I

11:02 So, moving from clj-json 0.5.3 to 0.5.0 builds on JDK6. What would life be without excitement?

11:03 pepijndevos: Does core.logic have difference lists? and…. is it relevant?

11:03 http://homepage.cs.uiowa.edu/~fleck/dcgTrans.htm

11:17 What is the correct check if something is an expression in a macro? list? seq?

11:19 cemerick: it looks like browser-REPL is busted in ClojureScript builds >= 1535 (NPE attempting to compile any namespace that requires clojure.browser.repl). Can anyone confirm this, or call me crazy?

11:20 hyPiRion: ,(map (juxt list? seq?) ['(a b c) (list 1 2 3) [1 2 3]])

11:20 clojurebot: ([true true] [true true] [false false])

11:20 Bronsa: ,((juxt list? seq?) (cons 1 '(2)))

11:20 ChongLi: cemerick: how do I check which cljs version I have? I'm using cljsbuild

11:20 clojurebot: [false true]

11:21 Bronsa: ,((juxt list? seq?) (map identity '(2)))

11:21 clojurebot: [false true]

11:21 Bronsa: use seq?

11:26 cemerick: ChongLi: it looks like cljsbuild uses 0.0-1552, which means I must be crazy :-/

11:26 ChongLi: ahhh

11:26 the browser repl is pretty hard to use anyway

11:26 I have no idea how to get it working with my page being served by ring

11:27 seems like it'd be a lot of work

11:27 cemerick: Working on making it easier :-)

11:27 ChongLi: the same origin policy really kills us here

11:27 cemerick: it's just another port number, so same origin doesn't matter

11:27 ChongLi: hmm

11:27 cemerick: though you can't just load the HTML file from disk

11:28 ChongLi: yeah that's what I mean

11:28 the hard part is you need to use a web server

11:29 seems like the cleaner way to go would be to have an in-browser terminal connected to a repl running on cljs-on-cljs

11:29 avoid the web server, avoid the jvm compilation step

11:29 can you run a server in javascript with websockets?

11:30 yeah looks like it

11:30 so you could have an nrepl server running in the browser

11:33 the other idea I like is to run a browser inside light table

11:35 Arxontas_tou_Sko: hello :))

11:36 ChongLi: hi

11:36 Arxontas_tou_Sko: i have a dynamic var,represent a list

11:36 i want to copy it to an immutable list

11:36 how can i do it?

11:37 ChongLi: the list is immutable

11:37 only the var is mutable

11:37 Arxontas_tou_Sko: the first list is local binding

11:38 i want to copy it to a normal immutable list

11:38 ChongLi: I still don't quite understand

11:38 Arxontas_tou_Sko: how to copy a thread local list,to a normal immutable list

11:39 ChongLi: you mean you def'd it with ^:dynamic

11:39 ?

11:40 Arxontas_tou_Sko: yes,its dynamic and thread local

11:40 i want to copy it

11:40 ChongLi: where?

11:40 clojurebot: where is log

11:41 ChongLi: clojure is a functional programming language, you don't copy things around

11:41 that's an imperative concept

11:41 just return the list from a function

11:42 Arxontas_tou_Sko: 1 minute sorry

11:46 pepijndevos: why is there now llast :

11:51 Arxontas_tou_Sko: ChongLi: i want to save a thread local var,to a normal var

11:52 ChongLi: &(def ^:dynamic x '(1 2 3))

11:52 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

11:52 ChongLi: ahh

11:52 damn it

11:52 yeah, what you're saying doesn't make sense

11:53 Arxontas_tou_Sko: :)

11:53 i am newbie

11:53 ChongLi: my advice is not to use thread local vars right now

11:53 they are an advanced feature

11:54 Arxontas_tou_Sko: (def ^:dynamic x '(1 2) ) -->i want to copy the value to an immutable name

11:54 ChongLi: (def y x)

11:54 there you go

11:54 Arxontas_tou_Sko: its causes problems i think

11:54 ChongLi: why?

11:54 clojurebot: why not?

11:55 Arxontas_tou_Sko: i tried it,if you change y ,x also changes!

11:55 ChongLi: yeah, of course

11:55 you're not supposed to change defs

11:55 Bronsa: Arxontas_tou_Sko: #'x is mutable, x returns the immutable value

11:56 Arxontas_tou_Sko: ok guys thx for trying to help me i will read more :)

11:56 ChongLi: Arxontas_tou_Sko: in functional programming you want to think about "what is"

11:56 Bronsa: Arxontas_tou_Sko: http://sprunge.us/dTNG

11:56 ChongLi: not "how to do it"

11:56 you're telling the computer what you think the values of different things are

11:57 you're not telling it how to do its job

12:00 pepijndevos: I forgot how refreshing works...

12:00 (minikanren)

12:03 gfredericks: pepijndevos: refreshing?

12:03 pepijndevos: gfredericks: when you call fresh on a variable that is already bound

12:04 I think it's just like le. I the stoce it's just a fresh thing

12:04 gfredericks: you don't call fresh on variables; fresh always gives you new variables

12:04 pepijndevos: *let

12:04 but i mean, call on a symbol that is already defined

12:04 (run [q] (fresh q))

12:04 gfredericks: you're shadowing it the same way you might do with let

12:04 pepijndevos: right

12:04 Arxontas_tou_Sko: gfredericks do you know how to get the value of a thread local var,and copy it in a normal var?

12:05 gfredericks: Arxontas_tou_Sko: getting the value of thread-local vars is done by implicitely dereferencing them, the same as a normal var

12:05 (defn thread-local-value-of-x [] x)

12:05 ChongLi: gfredericks: Arxontas_tou_Sko is new

12:06 and seems to be doing something wrong :)

12:06 gfredericks: Arxontas_tou_Sko: you can do (def a-normal-var some-thread-local-var), but this would be highly unidiomatic, as I expect people have said before

12:06 ChongLi: I don't think he's quite understood functional programming

12:07 and seems to be trying to write an imperative program with mutation

12:07 Arxontas_tou_Sko: i will try again thx anyway guys :)

12:07 gfredericks: pepijndevos: (run* [q] (fresh [q] (== q 42))) returns (_0), since the two q's are different variables

12:07 ChongLi: Arxontas_tou_Sko: read SICP

12:07 pepijndevos: yea, makes sense.

12:07 ChongLi: http://mitpress.mit.edu/sicp/full-text/book/book.html

12:08 pepijndevos: gfredericks: I'm doing my own cfg implementation

12:08 Arxontas_tou_Sko: ChongLi functional programming runs in my veins but the flow just started :)

12:08 ok i will read more :)

12:24 i want to get the value of a dynamic(thread local var),and make it immutable stored in a normal var

12:24 one last try

12:24 gfredericks: Arxontas_tou_Sko: what happened when you used the def approach I suggested?

12:24 Arxontas_tou_Sko: the new var shares the mutable value

12:25 not a copy of it i think...

12:25 gfredericks: what kind of object is this "mutable value"?

12:25 Arxontas_tou_Sko: a list

12:25 gfredericks: a clojure list?

12:25 Arxontas_tou_Sko: yes

12:25 gfredericks: clojure lists are immutable so there is no need to explicitely copy them

12:26 ChongLi: I tried explaining that earlier

12:26 gfredericks: if you (def a-normal-var a-dynamic-var-holding-a-list) then the list is not copied, because there's no need as it's immutable

12:26 but a-normal-var is updated to point to the same list that the dynamic var does

12:27 ChongLi: I think Arxontas_tou_Sko misunderstands the purpose of ^:dynamic

12:27 Arxontas_tou_Sko: ^:dynamic mean mutable right?

12:27 gfredericks: no

12:27 normal vars are mutable

12:27 ChongLi: that's technically true but not really helpful at this stage :)

12:28 Arxontas_tou_Sko: think of everything in Clojure as being immutable for now

12:28 write a program without trying to mutate anything

12:28 Arxontas_tou_Sko: ok i so newbie i dont know how to even ask:)

12:28 bye guys thx for trying

12:28 ChongLi: Arxontas_tou_Sko: wait!

12:29 don't leave

12:29 Arxontas_tou_Sko: ok

12:29 ChongLi: tell me what kind of program you want to write

12:31 Arxontas_tou_Sko: i will try something and maybe come back,thx chongli

12:31 ChongLi: ok

12:31 gfredericks: somebody should change the topic of #clojure to be "Tell us what you're _actually_ trying to do."

12:31 hyPiRion: ~anybody

12:31 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

12:32 hyPiRion: gfredericks: ^ that's sufficient

12:32 ChongLi: gfredericks: yeah everybody falls into that trap

12:32 gfredericks: hyPiRion: that's kind of a different purpose

12:32 ChongLi: they ask a question about some very specific implementation detail

12:32 when it may be that their entire approach is wrong

12:32 and so answering the specific question doesn't really help

12:33 weavejester: Has anyone heard of a function for core.logic that chooses a random solution?

12:33 ChongLi: by the way, why is def turned off on lazybot? I thought it'd work to have like 5 defs as a limit before undefing

12:33 hyPiRion: weavejester: isn't rand-nth sufficient?

12:33 gfredericks: weavejester: I've tried to write condr a few times

12:34 weavejester: I mean obviously you can get a seq of all solutions and then randomly choose, but if the number of solutions is very large, it becomes infeasible.

12:34 gfredericks: weavejester: https://gist.github.com/4334295

12:34 hyPiRion: Not that I'm a core.logic guy though.

12:34 weavejester: gfredericks: You said "tried". Does that mean it doesn't work?

12:35 gfredericks: weavejester: I think a good impl of condr would let you customize the distribution based on how deep you want it to search for your random solution

12:35 hyPiRion: weavejester: Do you need the pick to be uniformly distributed over the possibilities?

12:35 gfredericks: weavejester: it works, it's just basic

12:35 when there are an infinite number of solutions you can't pick uniformly of course

12:35 so lots of subtleties around that

12:35 ChongLi: gfredericks: why not?!!

12:35 haha

12:35 weavejester: hyPiRion: As uniformly as possible.

12:35 hyPiRion: weavejester: meh. Otherwise `first` would've been sufficient.

12:36 gfredericks: ChongLi: I'll assume based on 'haha' that the question wasn't serious

12:36 weavejester: Yeah, "first" isn't going to do it :)

12:36 ChongLi: gfredericks: there's gotta be some way to pick a random number which is unbounded

12:36 gfredericks: weavejester: I think a good impl would have to be lower-level too

12:36 ChongLi: there is but not uniformly

12:36 weavejester: But condr looks interesting, and I have a finite solution space.

12:37 ChongLi: what does it even mean to have a uniform distribution in an unbounded space?

12:37 gfredericks: ChongLi: short proof: if the distribution is uniform, then for any X the selection is virtually guaranteed to take more than X bytes to contain

12:37 ChongLi: I guess it means having no samples at all

12:38 gfredericks: so maybe it makes theoretical sense, but there's nothing practical you can do with it

12:38 ChongLi: yeah, not without some magical machine beyond the capabilities of a turing machine

12:38 with infinite speed and infinite storage

12:39 gfredericks: yeah that'd probably make it doable

12:39 weavejester: Turing machines do have infinite storage.

12:39 gfredericks: but you need the infinite speed to get at it :)

12:39 hyPiRion: No need for infinite speed.

12:39 ChongLi: yeah, just infinite time

12:40 hyPiRion: Exactly. As long you can prove it terminates, it's okay.

12:40 weavejester: Well, the "speed" of a Turing Machine is kinda academic, because time doesn't factor into the model.

12:41 gfredericks: come to think of it even with an infinite amount of time I'm not sure what algorithm would uniformly sample the integers

12:41 that's a tricky thing to reason about

12:41 ChongLi: yeah it seems to be a non-computable function

12:41 though I have no proof

12:41 gfredericks: you probably just have to take that as a primitive

12:42 well wait

12:42 ChongLi: uniform sampling just seems to be meaningless when the space is infinite

12:43 gfredericks: if you can generate an infinite list of random bits, you can probably do it that way

12:43 yeah

12:43 ChongLi: it's like asking whether or not you're moving if you're the only particle in an empty universe

12:44 gfredericks: so if you represent the number five as (list* 1 0 1 (repeat 0))

12:44 cemerick: what could make the url of a cljs.closure.JavaScriptFile nil? Based on the provides, the lib in question looks to be part of the third party bits in goog.async (http://closure-library.googlecode.com/svn/docs/closure_third_party_closure_goog_mochikit_async_deferred.js.source.html)

12:45 gfredericks: then (defn rand-non-negative-int [] (repeatedly (rand-int 2)))

12:45 pepijndevos: I keep thinking dcg should be implemented with defrel, but I can't see how to actually do it.

12:45 HolyJak: Emacs question: How do I jump to a particular namespace such as clojure.core (to browse it)? M-. can jump to a var in a ns but not to a ns itself. I'm using nRepl in Emacs. Thanks!

12:46 ChongLi: jeez what is up with that page?

12:46 dark gray on light gray?

12:47 pepijndevos: wait…. multimethod + conde… would that work. need more tea

12:58 seangrove: Hrm, this reminds me of ohpauleez's leap motion hacking http://www.forbes.com/sites/parmyolson/2012/07/16/the-amazing-digital-gloves-that-give-voice-to-the-voiceless/

13:08 TheComrade: Howdy. Is it appropriate to ask IDE/plugin-specific workflow questions in here?

13:09 gfredericks: probably; though IDE users are a minority I think

13:10 bawr: It's an Emacs land. :<

13:10 ChongLi: some people use eclipse

13:10 I think cemerick does

13:10 TheComrade: Yeahhhhh so I read. I am starting to see why.

13:10 ChongLi: starting to see why? how so?

13:11 TheComrade: So I'm running IntelliJ + La Clojure + Leiningen? various tutorials all are pretty simple, there are shortcuts to run selected text or load a file into a REPL, no problem. But...

13:13 I can't figure out simple stuff like, switch the focus to the REPL without clicking on it. :(. Or like, why the Run menu has four Run / Debug options (run core, debug core, run, debug). Like, it feels like the expected dev process is to load a file with a shortcut, then click on the REPL, then do something like (ns leintest.core) and then type (foo)? This seems extremely cumbersome.

13:14 ChongLi: ah

13:14 are you a long-time intellij user?

13:14 TheComrade: Nope, just grabbed it.

13:14 ChongLi: ah, you may want to try some other stuff then

13:14 pietu: TheComrade: alt + 4 toggles the repl

13:15 TheComrade: pietu, thanks. How would I have learned that? :)

13:16 (osx)

13:17 pietu: TheComrade: well there aren't so much to do with idea than load file to repl (cmd + sift F10) and toggle repl

13:18 but if you go to setting -> keybindings (or similar) you can find the shortcuts

13:18 TheComrade: so alt+4 must be an IDEA shortcut, it's not listed in La Clojure shortcuts

13:18 pietu: there's also a plugin that alerts key shortcut when you use your mouse

13:18 yeah, idea shortcut

13:19 and sorry, cmd + sift F10 opens the repl

13:19 cmd + sift + l loads file in it

13:20 but as said, if possible, try emacs :)

13:20 ChongLi: yeah try emacs

13:20 emacs is fantastic

13:20 if you're going to learn something new, might as well

13:20 pietu: LaClojure plugin is quite good, but doesn't play with same league with emacs

13:21 /s/with/in

13:21 arrdem: I too will vote for emacs.. I made the vimclojure -> emacs+nrepl switch about a month back and I'm loving it.

13:21 charliegriefer: TheComrade - I'm about to start week 3 of "force myself to use Emacs". It's been way less scary than I thought it was going to be.

13:21 TheComrade: Mk, I will try this out. I am by nature a CLI / Linux guy but everytime I've tried emacs I feel like I'm fighting horrible documentation and alpha-stage plugins.. but I'll give it another go

13:21 really worth spending weeks of learning curve? :)

13:22 charliegriefer: it's certainly not "foce myself" mode anymore. was over that within the first couple of days.

13:22 ChongLi: TheComrade: the key to learning emacs is C-h f along with ido mode

13:22 charliegriefer: I had a cheat sheet up on the laptop while i worked on the desktop

13:22 helped out quite a bit

13:22 seangrove: Who is this mike anderson from nuroko, and is he in here?

13:22 charliegriefer: i knew what I needed to do, just didn't know the command. so, glanced over at the cheat sheet.

13:22 ChongLi: makes it very easy to find functions thanks to fuzzy completion

13:23 arrdem: charliegriefer: from heroku I think you meant...

13:23 TheComrade: Cool. Thanks, I will give emacs a go for this.

13:23 arrdem: yeah A-tab fuzzy complete is epic

13:23 Okay. Meta-Tab

13:23 seangrove: Will the real Mike Anderson please stand up?

13:23 * arrdem dons sunglasses

13:23 cemerick: damn, here's the reason why I've been struggling with cljs and browser-repl all day: http://dev.clojure.org/jira/browse/CLJS-418

13:23 arrdem: Mr. Anderson....

13:23 cemerick: :-(

13:24 ChongLi: fuzzy completion is the greatest thing ever

13:25 seangrove: cemerick: Yeah, that one sucks

13:25 TheComrade: You guys using this? http://emacsformacosx.com/

13:25 ChongLi: TheComrade: I'm using linux

13:25 seangrove: Took a month for domina to pull in a pr for the README to tell users to add it to their deps :P

13:25 ChongLi: I've heard aquamacs is the most recommended osx version

13:27 TheComrade: Do you use 23 or 24?

13:27 ChongLi: latest version

13:28 TheComrade: Well the latest aquamacs is 23.3 ? I seem to recall the last time I looked at emacs there was some debate about whether to stay with 23 or switch to 24

13:28 cemerick: seangrove: what I don't grok is why the dep wasn't just added straight off...

13:28 ChongLi: oh, huh

13:28 yeah use 24 then

13:28 seangrove: cemerick: Yeah, I could have put that in the pr, I suppose. But didn't know if there was a reason it wasn't there

13:29 Or do you mean just to the clojurescript distro?

13:29 ChongLi: cemerick: you still use eclipse + CCW?

13:29 cemerick: seangrove: yeah, in the cljs release pom

13:29 ChongLi: yes

13:29 ChongLi: TheComrade here is wondering about what IDE to use

13:29 we suggested emacs

13:29 seangrove: That'd be nice i suppose. Was definitelyt confused by the split - I understand the licensing, but the outcome was a bit painful

13:30 ChongLi: perhaps you can make a case for eclipse + CCW

13:30 cemerick: too busy for tool advocacy at the moment :-)

13:30 ChongLi: I'm guessing eclipse will have a shallower learning curve

13:30 haha

13:30 TheComrade: lol

13:30 cemerick: TheComrade: use what you know; don't take on a new tool and a new language at the same time.

13:31 ChongLi: TheComrade: hmm, I guess aquamacs isn't recommended anymore

13:31 cemerick: I think I may just make that my default response on all tooling questions from here on out.

13:31 ChongLi: cemerick: haha

13:31 TheComrade: It's very concise advice.

13:32 ChongLi: TheComrade: what do you traditionally use?

13:32 gfredericks: the notepad plugin for clojure is not very advanced

13:32 ChongLi: at the very least you need something to help you match parens

13:32 seangrove: Meh, I learned ruby, rails, and emacs at the same time

13:32 But that was pretty painful, in hindsight

13:33 ChongLi: writing in any lisp has got to be a nightmare without that

13:33 cemerick: gfredericks: yes, there are some reasonable expectations

13:33 callenbot: is anyone here using CLJS with Node.js?

13:34 ChongLi: callenbot: running clojurescript on the server?

13:34 TheComrade: ChongLi, Mostly Jetbrains stuff for php, flash builder for AS3 (worked three years on FB games for take-a-guess). Used Netbeans to write a Java/ANTLR utility

13:34 cemerick: ,(rand-nth #{:ccw :intellij :emacs :textmate :sublime :vim})

13:34 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentHashSet>

13:34 cemerick: oh brother

13:34 callenbot: other than ibdknox.

13:34 ChongLi: yes

13:34 ChongLi: TheComrade: zynga?

13:34 cemerick: ,(rand-nth [:ccw :intellij :emacs :textmate :sublime :vim])

13:34 clojurebot: :ccw

13:34 TheComrade: ayup

13:34 cemerick: proof that the universe is aligned ^^

13:34 gfredericks: cemerick: you rigged it!

13:35 cemerick: ,(rand-nth [:ccw :intellij :emacs :textmate :sublime :vim])

13:35 clojurebot: :sublime

13:35 cemerick: oh, that would've been too good

13:35 gfredericks: somebody submit a jira ticket to amend the rand-nth docstring to say "chosen by cemerick"

13:35 ChongLi: callenbot: I asked about this the other day

13:35 and it was recommended against

13:35 cemerick: rand-nth-as-a-service

13:35 callenbot: ChongLi: Prismatic does it...

13:36 ChongLi: why was it recommended against?

13:36 ChongLi: I was told that clojure + ring etc. on the jvm is better on a server

13:36 callenbot: ChongLi: yeah but Node.js has way better libraries.

13:36 weavejester: callenbot: Out of interest, what libraries in particular were you thinking about?

13:36 ChongLi: I don't know anything about node.js libs

13:37 TheComrade: so is clojure your first functional programming language?

13:37 err, I guess that'd probably be AS3

13:38 though you might not have used a functional style

13:39 pietu: TheComrade: I hava now been using idea for a year and a half with clojure and clojurescript, about to change to emacs + evil mode

13:39 ChongLi: TheComrade: not recommended btw!

13:39 TheComrade: ChongLi, I've been reading up 'pure functional' for years, but haven't dug in. I discovered along the way that I was sort of unconsciously using functional ideas in AS3, like computing return values whenever possible instead of manipulating state

13:40 ChongLi: if you think learning emacs is hard, learning it with evil mode is just insane

13:40 TheComrade: ChongLi, Hah

13:40 pietu: anyways, idea works. no doubt about it and if you are familiar with it, i suggest you to go with idea

13:40 ChongLi: TheComrade: yeah, you've got an intuitive grasp on the concepts demonstrated in "out of the tarpit"

13:41 callenbot: weavejester: Swig, SocketIO, Jade, Mongoose, node-flask-router, Express, Everyauth, scss-js, emailjs.

13:41 ChongLi: http://shaffner.us/cs/papers/tarpit.pdf

13:41 I'm actually reading this right now, I just keep getting interrupted :)

13:42 TheComrade: ChongLi, I'll check out that link. Yeah, intuitive is a good word for it. I know what feels clean but I'd be hard pressed to spit out a formal definition

13:43 weavejester: callenbot: Could you give an example of how they're better than the equivalent Clojure libraries?

13:43 callenbot: I'm writing that out right now.

13:44 weavejester: callenbot: Everyauth looks more mature than any Clojure equivalent

13:44 callenbot: weavejester: can't get anything like Jade or Swig in Clojure, SocketIO integration story sucks on Clojure compared to Node.js, Mongoose is a nice interface to MongoDB although I don't doubt the werkz guys have something there, node-flask-router and Express could be mimicked by a Ring app but it's a pale comparison. The excessive minimalism hurts the Clojure community here. Everyauth is a joy and things like friend and sandbar really d

13:44 maio: pietu: I switched to Emacs+Evil from Vim ~ year ago

13:44 pietu: maio: how does it feel?

13:44 callenbot: the templating Jade/Swig/Django/Jinja templates issue is a drum I've been beating for a very long time in here. that shouldn't surprise anybody.

13:45 weavejester: callenbot: What about Clabango?

13:45 callenbot: the websockets story for Clojure doesn't seem to be well integrated into the Ring/Jetty stack so you have to run two servers.

13:45 which sucks, you can use one code-base in Node.js

13:46 maio: pietu: well it feels good, but I'm editor/configuration freak .) I switched because I wanted to do some Clojure development but since I switched I have been playing with Emacs-Lisp and not with Clojure... :)

13:46 callenbot: weavejester: I had the impression it wasn't usable yet. I'd been eyeballing another equivalent. I'll take a look.

13:46 ChongLi: how the heck did such an ecosystem spring up in node?

13:46 weavejester: callenbot: You can run it in the same code base using Aleph, but websockets and HTTP are fundementally two different protocols.

13:46 callenbot: ChongLi: they give a shit about webapps.

13:46 weavejester: callenbot: My preference for templating is Hiccup, so I haven't really looked at the alternatives closely.

13:46 callenbot: weavejester: another irritation is that there's nothing like Flask's g object in Ring. I have to explicitly kick around every single little variable and the keyword argument syntax in Clojure is a travesty.

13:46 pietu: maio: sounds like my colleague

13:47 arrdem: So what makes Clojure feel so much less crufty than common lisp?

13:47 callenbot: weavejester: I "settled" on Hiccup but as it stands I'm less productive in Clojure than Python or Node.js atm.

13:47 weavejester: being able to invoke {% if g.user %} in any given template thanks to the RequestContext lifecycle in Flask is *amazing*

13:47 and saves a lot of goddamn time

13:47 ChongLi: Clojure's built on standard abstractions and uses very nice, clean syntax for literals

13:47 maio: pietu: but now I'm ready for some Clojure finally :) I started to write 2 toy projects in it few days ago

13:48 callenbot: arrdem: I used to do CL before Python, trust me, Clojure is way less crufty.

13:48 weavejester: callenbot: Is there a reason you can't use a dynamic binding to achieve the same result?

13:48 pietu: maio: main thing to move from idea is to get more lightweight dev env, idea works just fine with Repl and everything, but it's just too much

13:48 callenbot: weavejester: it needs to reset with the request lifecycle ala Kiln.

13:48 arrdem: callenbot: I know it is. I just spent a week and a half hacking CL and I'm trying to put my finger on why I don't like it besides lack of internet docs

13:48 ChongLi: the focus on immutability, the standard persistent data structures

13:49 callenbot: arrdem: I mean I could explain the culture if you want, but you seem to know what's up already.

13:49 ChongLi: also the LISP-2 thing is just... I'm sorry

13:49 weavejester: callenbot: In general, my preference is toward tight lexical scoping over more global variables. The latter make things easier, but more complex, because they tie each part of your application to a huge mass of data.

13:49 ChongLi: funcall everywhere

13:49 callenbot: weavejester: I need arbitrary access to a request context scoped user object

13:50 weavejester: callenbot: Why doesn't a dynamic binding do that?

13:50 ChongLi: hashquoting everything

13:50 arrdem: ChongLi: could you elaborate on that? of all the lisp lore I've consumed L1 vs L2 is the thing I get the least

13:50 callenbot: weavejester: I don't know how I would make it scoped to the serving of each request individually.

13:50 ChongLi: arrdem: in clojure if you say (def a 32)

13:50 callenbot: weavejester: because I don't know enough about the semantics of RIng.

13:50 Ring*

13:50 ChongLi: and (def b (fn [x] (+ x x))

13:50 a and b occupy the same namespace

13:51 Bronsa: (map inc [1 2 3 4]) vs (mapcar #'1+ '(1 2 3 4))

13:51 callenbot: weavejester: are just talking an init and kill middleware here or what?

13:51 arrdem: right... :cl-user by default or user/

13:51 ChongLi: I don't mean that sort of namespace

13:51 weavejester: callenbot: No, middleware that adds a binding form around your handler

13:51 maio: pietu: do you use Vim a lot?

13:51 arrdem: ChongLi: oh name binding scope

13:51 callenbot: weavejester: it's not just the handler, the template has to be able to access the user too.

13:52 and any other code I invoke

13:52 like a utility function

13:52 ChongLi: arrdem: here's a clearer example

13:52 pietu: maio: not a lot, mut yeah, i use it quite a lot

13:52 weavejester: callenbot: It would, because the template would be called by the handler.

13:53 callenbot: you have to explicitly pass all bindings to clabango AFAIK

13:53 ChongLi: say you call (defn foo [] #(+ % %))

13:53 weavejester: callenbot: https://gist.github.com/4649745

13:53 ChongLi: now foo is a function that returns a function

13:53 in clojure you can do this ((foo) 3 4)

13:54 callenbot: weavejester: I still have to manually pass every binding. I don't have globals unless I write a macro. (render-file "example/templates/index.html" {:greeting "Hey!"}))

13:54 maio: pietu: if I could I would skip Evil part of my switch to Emacs as it would save me a lot of time. But I have been using Vim for a loong time so that was no option for me

13:54 ChongLi: inbut in a lisp-2 you have to use funcall

13:54 callenbot: actually that's a really good idea.

13:54 I'll just write a macro.

13:54 arrdem: ChongLi: ah that's irritating

13:54 weavejester: I mentally wince every time "global state" is mentioned :)

13:55 callenbot: weavejester: I don't care about aesthetics, I just need to be building things efficiently.

13:55 ChongLi: stuff like (funcall #'+ 3 4)

13:55 pietu: maio: yeah, that's kind of boost for me too, besides my colleague sitting next to me has just got everything working so

13:55 callenbot: weavejester: I am homo economicus, if there's something that'll help me build faster, I'm gonna use that. if Clojure can't be on top of that pile because the community is too fussy then I can't use it.

13:55 ChongLi: arrdem: actually the best example is in a function like map

13:56 weavejester: callenbot: It's not about aesthetics. You're essentially trading short term speed for long term complexity.

13:56 ChongLi: in CL it's called mapcar

13:56 weavejester: Which in some cases is a good trade-off

13:56 ChongLi: and it is called like this

13:56 callenbot: weavejester: that's a consciously made decision

13:56 ChongLi: (mapcar #'not '(t nil t nil t nil))

13:56 callenbot: weavejester: I build things to test hypotheses. Refactors can happen later, I need to shotgun out as many projects as quickly as possible to determine what's worthwhile

13:56 ChongLi: which returns (NIL T NIL T NIL T)

13:56 maio: pietu: then go for it. I'm pretty sure you wouldn't regret it :)

13:57 ChongLi: mapcar's implementation almost certainly uses funcall

13:57 pietu: maio: yep, I might bug you in future though :)

13:57 weavejester: That's reasonable, so long as your applications have nothing in common.

13:58 Or are different enough that there are no common pieces of functionality that could be shared.

13:58 callenbot: weavejester: they have basic CRUD on the backend in common, it's mostly frontend variation.

13:58 weavejester: I find that web applications tend to have a lot of things in common

13:58 callenbot: uhm, sure? but the Clojure community seems to hate web frameworks that eliminate a lot of that duplicated work so I'm left managing it myself.

13:58 yedi: anyone have guidelines or best practices for writing wrappers of java libraries

13:58 callenbot: modulo yogthos|away 's efforts anyway.

13:59 maio: pietu: ok! good luck :)

13:59 ChongLi: yedi: why write a wrapper?

13:59 weavejester: callenbot: Frameworks tackle duplication effectively through copy-and-paste.

13:59 arcatan: hmm, i've been heavy Vim user and now I'm using Emacs for Clojure work. tried out Evil, but it was just in the way.

13:59 ChongLi: arcatan: evil just bends my brain

14:00 I was a heavy vim user and now an emacs user

14:00 arrdem: arcatan: TBH I'm liking not <esc> mashing in emacs

14:00 callenbot: weavejester: see, aesthetics again.

14:00 ChongLi: arrdem: why are you mashing <esc>?

14:00 callenbot: weavejester: I don't care. I don't care if it's built from the bone and sinew of babies. I want *more productivity*, period, end of story.

14:01 yedi: ChongLi: figured it was the best way to go. Writing a clojrue wrapper to help access the library to a more clojurish api and to try and hide state in the java lib

14:01 arrdem: ChongLi: jumping command mode to insert mode and back

14:01 ChongLi: arrdem: ahh, why not use C-[

14:01 ?

14:01 arrdem: ChongLi: didn't know it existed XP

14:02 weavejester: callenbot: I'm not sure that prefering functions over copy-and-paste is necessarily all "aesthetics"

14:02 ChongLi: yedi: ah, yeah as long as you aren't wrapping to try and build some portable library across clojure and clojurescript

14:02 hyPiRion: Oh wow, so using Emacs, Vim or Emacs+Evil is based on subjectivity and not objective explanations?

14:02 maio: (key-chord-define evil-insert-state-map (kbd "jk") 'evil-normal-state) :)[C[C[C[C[C[C[C[C

14:02 ChongLi: that would just be silly

14:02 arrdem: hyPiRion: Yep! welcome to the editor war..

14:02 weavejester: If we accept that code reuse through functions is a better idea than code reuse through code generation

14:02 hyPiRion: arrdem: http://www.gnu.org/fun/jokes/ed-msg.html

14:02 arrdem: maio: STHAP WUTRUDOING

14:03 hyPiRion: 404 there

14:03 callenbot: weavejester: fine, then link these functions you're using to be so productive.

14:03 hyPiRion: arrdem: Works fine here, strange.

14:03 yedi: ChongLi: any advice?

14:04 weavejester: callenbot: Admittedly all the functions I want don't yet exist :)

14:04 ChongLi: yedi: general advice? hmmm, it's tough to say

14:04 arrdem: hyPiRion: dropped the trailing L

14:04 weavejester: callenbot: But neither do all the frameworks

14:04 callenbot: And if we have a choice in direction - whether to go framework heavy or function heavy

14:04 ChongLi: it depends on what library I guess

14:04 hyPiRion: http://www.gnu.org/fun/jokes/ed-msg.txt should work too.

14:04 callenbot: weavejester: well, people are out there *making things* with these web frameworks

14:04 weavejester: callenbot: Then the latter is what we should be developing.

14:05 callenbot: weavejester: you're complaining about something real that is helping people make things and suggesting an alternative you admit hasn't really developed into something that really exists at the moment.

14:05 weavejester: callenbot: Something real? What do you mean?

14:06 callenbot: show me what to use to be as productive as using a web framework would be, without using the framework.

14:06 weavejester: callenbot: Are you talking about web frameworks that exist for other languages, or web frameworks that exist for Clojure?

14:06 ChongLi: yedi: I guess the best advice I can give is to go about building a mini-DSL

14:06 callenbot: weavejester: Clojure is fine, I just want to know how to eliminate all that CRUD work.

14:07 arrdem: callenbot: .... what crud work?

14:07 ChongLi: try to focus on dealing with clojure data structures like maps, vectors and sets

14:08 hyPiRion: callenbot: It's not the crud work, it's the web interface you talk about I suppose

14:08 CRUD in Clojure is just map manipulations.

14:08 callenbot: I don't really care what you call it, I just want to factor out the duplication and focus on the differentiated bits.

14:09 hyPiRion: It helps if everyone has the same idea of what the problem is, isn't it?

14:09 weavejester: What duplication?

14:09 hyPiRion: /s/isn't/doesn't/

14:09 yedi: ChongLi: thanks

14:10 ChongLi: yedi: yeah, generally follow the guiding Clojure philosophy

14:10 stick to mostly pure functions on Clojure data structures

14:10 callenbot: weavejester: okay here's a specific one for you, how do I do websockets in Clojure with my webapp without running two different leiningen projects?

14:11 weavejester: callenbot: Have you tried using Aleph?

14:11 callenbot: weavejester: this is, mind you, a single git clone away in Node.js land, they have Express+SocketIO templates with best practices exemplified built right now.

14:11 weavejester: can I do my whole webapp with Ring+Aleph? I was under the impression you couldn't push to the browser client like that.

14:11 which destroys the whole purpose of websockets.

14:11 so we've already failed the comparison with Node.js by it not being a single git clone away to being a template, but lets see how deep this rabbit-hole goes

14:11 weavejester: callenbot: What gave you that impression?

14:12 callenbot: what does it take to write a unified webapp that can do the normal HTTP as well as websockets in Clojure?

14:12 if it exists, where's the leiningen template?

14:13 weavejester: http://stackoverflow.com/questions/10967426/clojure-webbit-ring "Ring defines only request-response cycle, there’s no push in Ring SPEC. You can write webbit ring adapter, but it will only allow you to react to the events happening in browser, without the ability to notify browser from server side."

14:13 weavejester: callenbot: I don't believe there is a template, but it would only save you writing a few lines of code.

14:13 ChongLi: callenbot: I guess node.js is basically state of the art for working with websockets?

14:13 callenbot: nota bene there is no Ring/Webbit adapter AFAICT

14:13 ChongLi: and writing web apps in general

14:14 ChongLi: callenbot: you probably want to use node.js then

14:14 callenbot: god fucking dammit I really don't.

14:14 the callback spaghetti is horrendous.

14:14 weavejester: callenbot: Because Ring abstracts HTTP, not web sockets. Aleph sits on top and handles both protocols.

14:14 ChongLi: callenbot: http://brianmckenna.org/blog/cps_transform_js

14:14 callenbot: weavejester: is there an example of doing this I can learn from that will work with a simple client-side websockets demo?

14:15 weavejester: callenbot: There's a wiki page on using Aleph with HTTP here: https://github.com/ztellman/aleph/wiki/HTTP

14:16 callenbot: I don't believe anyone's created a full application yet, but I could whip something up.

14:18 callenbot: weavejester: http://stackoverflow.com/questions/6411070/nodejs-socket-io-simple-client-server-example-not-working how long would it take you to make a working demo app like that?

14:18 which had a working bidirectional websocket on the frontend

14:19 weavejester: callenbot: Let me put something together for you now

14:29 ChongLi: I wonder what it'll look like when cljs is fully fleshed out

14:29 yedi: weavejester going above and beyond

14:29 it's not fully fleshed out?

14:29 ChongLi: in terms of ecosystem

14:29 and tooling

14:29 yedi: i c

14:30 ChongLi: I can imagine writing a single codebase that encompasses client and server in a very natural and idiomatic fashion

14:30 technomancy: callen: your bot is saying some strange things about node.js having a more mature library ecosystem than the JVM; you might want to check its logic circuits.

14:30 ChongLi: hahaha

14:30 technomancy: possibly some kind of positronic interference

14:30 arrdem: (inc technomancy)

14:30 lazybot: ⇒ 45

14:31 ChongLi: we'll have to do a tachyon sweep

14:31 callen: technomancy: you raaaaang?

14:31 * arrdem starts searching for his spare tricorder

14:31 yedi: ChongLi: you think cljs will eventually replace clojure in doing the back end of web applications

14:31 ChongLi: yedi: no, it'll supplement it

14:32 I don't think you'll ever be able to replace JVM's library ecosystem

14:32 technomancy: where'd I put my voight-kampf unit again?

14:33 arrdem: technomancy: other jumpsuit

14:33 left pocket

14:33 callen: technomancy: Choice. No but seriously the whole obsession with frontend web Node.js has combined with the raw numbers of people banging away has led to an impressive ecosystem.

14:35 gfredericks: the primary effect from my perspective is the greater frequency of tweets about node.js programmers reinventing things

14:36 callen: gfredericks: nevertheless, if I need to setup a websocket + messaging server I can do so in node.js trivially. If they're so silly and pointless, why not provide a superset of what they offer?

14:37 ChongLi: "Given that we are considering the ideal world, it is not unreasonable to assume that the next step is to simple execute these formal requirements directly on our underlying general purpose infrastructure."

14:37 I love that

14:38 callen: https://github.com/jaymedavis/hubble case in point, really.

14:53 ChongLi: ohhh

14:54 google image search has a nice new lightbox-style feature

14:59 fakedrake: hello

14:59 ChongLi: hi

15:00 fakedrake: what is the correct way to define html snippets in hiccup (like noir's defpartial)?

15:00 ChongLi: I think it's defhtml

15:01 there's also defelem

15:01 http://weavejester.github.com/hiccup/hiccup.def.html

15:02 weavejester: callenbot: Take a look at https://github.com/weavejester/websocket-example

15:02 It mimics the node.js example you supplied earlier.

15:03 fakedrake: hmm, I am currently to just substitute defpartial with defmacro

15:03 i will try defelem

15:03 ChongLi: weavejester: am I right? fakedrake wants help with hiccup here

15:03 weavejester: fakedrake: You can just use a function

15:03 arrdem: weavejester: is :require :all the new :use?

15:04 weavejester: defelem defines a function with some additional code to accept an optional attribute list.

15:04 So if I wrote: (defelem link-to [url text] [:a {:href url} text])

15:04 Then I could write: (link-to {:class "foo"} "/blog.html" "Blog")

15:04 fakedrake: weavejester: is that preferable to defelem?

15:05 ah

15:05 weavejester: defelem is only if you want that extra attribute map.

15:05 Otherwise you can use defn

15:05 fakedrake: weavejester: thank you!

15:05 weavejester: There's also a defhtml for performance, which serializes directly into strings, but prefer defn unless you find things running slowly.

15:05 arrdem: Basically, yes. :)

15:06 fakedrake: weavejester: why is defn not good with attributes?

15:06 ChongLi: it's nice to be able to come in here and get support from the library author

15:06 technomancy: arrdem: :require/:refer/:all, yes, but don't use it except for a very small number of cases

15:07 fakedrake: like so: (defn link-to [url text] [:a {:href url} text])

15:07 weavejester: fakedrake: defn is just the normal Clojure function. It doesn't automatically add an optional attributes arguement.

15:07 technomancy: pretty much just in test cases and live-coding

15:07 arrdem: technomancy: I figured.

15:07 weavejester: Er, normal Clojure macro

15:07 fakedrake: aha now i get it

15:07 nice

15:07 weavejester: technomancy: I use it sometimes for things like core.logic

15:07 Or if I have a namespace dedicated to a single library

15:08 Like Compojure routes, or core.logic, or a Hiccup template.

15:09 But in the example I posted, maybe it would be better to be explicit, so that it's obvious where the functions come from.

15:10 arrdem: Understood that it's unhygenic to just :refer :all, but is there anything strictly wrong with it besides that you drag in refs to stuff you may not be using?

15:11 weavejester: arrdem: Nope

15:11 ChongLi: if you qualify it

15:12 it makes it easier to see where all the functions come from

15:12 which can be helpful sometimes

15:12 just imagine bringing in 10 namespaces at once

15:13 besides the possibility of collisions, you're likely to forget where functions are from

15:13 callenbot: weavejester: danke

15:19 mae: how do I quote a symbol in a macro? like I really need to give it a symbol but it keeps qualifying it to user/

15:19 arrdem: mae: ~'foo if I remember..

15:19 ,(macroexpand `(~'foo))

15:19 clojurebot: (foo)

15:20 mae: dude, amazing, thank you so much

15:20 arrdem: mae: no problem

15:20 ChongLi: mae: writing an anaphoric macro?

15:21 TimMc: ChongLi: Or a reify-producing macro -- you need it there as well.

15:21 mae: i have no idea what that means, hehe

15:22 i am just hacky hacking, i'm an inductive/kinesthetic learner, I learn from the bottom up

15:22 arrdem: http://en.wikipedia.org/wiki/Anaphoric_macro

15:22 ChongLi: mae: an anaphoric macro is one that captures a symbol deliberately

15:22 mae: gotcha

15:22 ChongLi: allowing you to refer to things with words like "it"

15:22 leading to more natural english-like expressions

15:23 ahhhh

15:24 TimMc: ...but potentially hella confusing.

15:24 ChongLi: why does chrome tab-complete to a domain name before tab-completing to a search engine I've specified?

15:25 now I have to clear my whole browsing history to fix this

15:25 fakedrake: how do i tell ring to publish my .js and .css files?

15:26 ChongLi: fakedrake: you want a wrap-resource middleware

15:26 http://ring-clojure.github.com/ring/ring.middleware.resource.html

15:27 fakedrake: thnx! ill take a look

15:30 http://clojurewise.blogspot.gr/2011/03/static-resources-in-compojure-uberjar.html

15:30 this one is more like what i needed, i should have asked for a compojure way to do it

15:30 ChongLi: fakedrake: ah, I used wrap-resource myself

15:31 it's still pretty straightforward

15:53 seangrove: It'd be very cool if you could trace the file-size of my cljs file down to the namespaces

15:54 My advanced-optimized cljs file is ~400kb, would be nice to know where it comes from

16:01 Arxontas_tou_Sko: anyone using counterclockwise? how to stop auto-close parenthensis?

16:01 i type ( and it closes automatically

16:01 ChongLi: Arxontas_tou_Sko: that's a feature :)

16:02 in Clojure you almost never want unbalanced parentheses

16:03 Arxontas_tou_Sko: i know can i cancel it?

16:03 it make me dizzy

16:03 hyPiRion: ave a look at preferences, and you would most likely find

16:03 something.

16:03 Arxontas_tou_Sko: i tried preferences

16:03 Schaefer: you are in strict/paredit mode

16:04 Arxontas_tou_Sko: if i uncheck that it will go away??

16:04 lazybot: Arxontas_tou_Sko: What are you, crazy? Of course not!

16:04 Schaefer: you can toggle off by Alt-D in windows. check the clojure popup menu in the editor

16:06 Arxontas_tou_Sko: you are in strict/paredit mode?? i uncheked that but it still auto close them

16:07 Schaefer: i think that's a new default behavior in the non-strict mode. laurent is going to change that in the next release, i think

16:07 Arxontas_tou_Sko: its default

16:07 i update it today

16:07 i am stuck in hell

16:08 Schaefer: i can't imagine not using non-strict anyway

16:08 Arxontas_tou_Sko: i cant stop it right?

16:09 Schaefer: i don't think so

16:09 Arxontas_tou_Sko: ok thx :)

16:09 Schaefer: not sure how the non-strict behavior works

16:09 Arxontas_tou_Sko: maybe its better but it make me dizzy

16:10 Schaefer: i used to have the same problem. clarity came to me when i stopped thinking of CCW as a text editor but rather a data structure editor

16:10 ChongLi: yeah

16:11 that's what you do when you write lisp code

16:11 you're building data structures

16:11 not really writing text

16:11 Schaefer: exactly. that new way of thinking really changed my approach to programming

16:13 inavat: hello

16:13 ChongLi: hi

16:13 Schaefer: hi

16:16 inavat: I want to use Clojure for a program I want to write, but the program is a command-line utility that should be responsive, so I'm worried about the startup time. Does anyone know, is this a problem that people are working on fixing, or has it been decided that Clojure isn't really the right language for that kind of thing?

16:16 ChongLi: inavat: you could use clojurescript on node.js

16:16 Schaefer: you might consider using ClojureScript and Google's V8 engine. i understand that has good startup time

16:17 infiniteone: hello, I'm using nrepl in emacs and can't get the inline documentation working I, can use tab to get a completion list but no doc anyone else have this problem

16:18 inavat: I was considering that.. I was considering embedding V8 in c++ to create a standalone app. I guess I'd be a little sad to lose some of the stuff from Clojure.. I was particularly excited to learn to use STM

16:19 ChongLi: inavat: ah, STM is not available in clojurescript (javascript doesn't have threads)

16:19 inavat: right

16:19 rclarkson: i have a sequence and wanna loop the elements in it .. i want to output "Hello", "Goodbye", "Hello", "Goodbye", that is the loop will switch for every other element .. how do i do this?

16:19 inavat: guess I can't have my cake and eat it too

16:19 ChongLi: if you want to write a nice command line app that makes use of STM and concurrency, perhaps haskell is a better fit

16:20 haskell compiles to native code so it starts up fast

16:21 &(take 5 (cycle '("hello" "goodbye")))

16:21 lazybot: ⇒ ("hello" "goodbye" "hello" "goodbye" "hello")

16:23 amalloy: inavat: you could try using drip, as well

16:24 rclarkson: ChongLi: good example .. i wasn't being specific .. it's more that I already have a list with elements eg. '("Foo", "Bar", "Baz", "Bam") and want it to print out "Hello Foo", "Goodbye Bar", "Hello Baz", "Goodbye Bam"

16:24 ChongLi: rclarkson: oh

16:25 amalloy: &(map list (cycle '[hello goodbye]) '[foo bar baz bam])

16:25 lazybot: ⇒ ((hello foo) (goodbye bar) (hello baz) (goodbye bam))

16:25 clojurebot: bam is BAM!

16:26 inavat: amalloy, I've heard people talk about drip, and it's been dismissed as not idea. What would be the down sides to using drip?

16:26 ChongLi: amalloy: that's not quite it

16:26 amalloy: well, it might not work

16:26 inavat: as I understand it, it keeps running VMs ready to go

16:26 ChongLi: he wants hello and goodbye for each name

16:26 amalloy: mostly it works, but it's not super well tested

16:27 ChongLi: i produced the exact output he wanted. i don't know why you think he wants something else

16:27 ChongLi: amalloy: oh you are right, I misread it

16:28 metellus: ,(map str [

16:28 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

16:28 rclarkson: amalloy: thx

16:28 metellus: oops

16:28 inavat: ChongLi, thanks for the Haskell recommendation. I'm interested in Haskell as well, though not as much as I am in Clojure.

16:29 ChongLi: inavat: yeah I used Haskell a bunch before discovering Clojure

16:29 I really love a lot of what's in Haskell

16:29 but I also love Clojure

16:29 it's another "can't have cake and eat it too" things

16:30 inavat: the program I want to write will make use of lots of web services, have plugins, etc.. it feels like Clojure, with its rich library ecosystem, is a better fit

16:30 Arxontas_tou_Sko: i think imperative languanges model the way you act,lisp models the way you reason,prolog models the way you know

16:30 Schaefer: if you're embedded a JVM into C++, you can use JNI's invocation API to maintain an internal JVM in your C++ process. you may not need to shut the JVM down

16:31 fakedrake: I am using friend for authentication and I would like it to query a database for users, not use a map. Is there an easy way to do that?

16:31 Schaefer: thus, you would only pay the cost of starting a JVM once

16:31 inavat: So is the slow startup thing considered a problem by the Clojure community? Is it something you'd bet will get better in the future? Or is it something you just take with Clojure and it'll probably always be the case?

16:31 Schaefer: inavat: is your C++ process long-lived?

16:31 ChongLi: inavat: it's a problem with the JVM in general

16:31 inavat: Schaefer, no it's not.. it will be used like a command line utility.

16:32 amalloy: ChongLi: jvm startup time is minimal compared to clojure's startup time

16:32 Schaefer: inavat: ah. forget the JNI approach then:)

16:32 ChongLi: amalloy: but that's only because the JVM doesn't include everything Clojure needs!

16:32 inavat: Maybe embedding V8 in C++ and using ClojureScript is the best approach. Even then, I'd miss out on lots of clojure and java libs that won't be available in ClojureScript, right?

16:33 ChongLi: inavat: don't you need STM?

16:34 Schaefer: i'd be really surprised if you'd want the STM in something short-lived like a utility

16:34 ChongLi: yeah I was wondering about that as well

16:34 seems odd

16:34 Schaefer: if you need mutable state, you can still use atoms in clojurescript

16:34 inavat: I was excited about STM. I wouldn't say I *need* it. I'm really a beginner at Clojure, and haven't learned STM yet, so I can't say for sure I won't need it..

16:34 yeah, I guess I see this being single-threaded

16:34 Schaefer: ah, so a solution in search of a problem :)

16:35 ChongLi: yeah we want everything, don't we

16:35 inavat: okay, you've convinced me ClojureScript in embedded V8 might be a good option. But what about the library ecosystem, is it as rich in CLojureScript as it is in Clojure?

16:35 ChongLi: high level language with beautiful libraries, instant start-up time, interpreted language that's as fast as hand-rolled C

16:36 inavat: according to callenbot the node.js ecosystem is richer even than the JVM!

16:36 Schaefer: inavat: true, the ecosystem isn't as rich as clojure's. i'm not as familiar with clojurescript but i think many libraries would work. what does this utility do? what sort of utilities do you think you'll need?

16:37 inavat: I see. Well I'll try it out.. wont' hurt to get familiar with the ClojureScript ecosystem at least

16:37 ChongLi: inavat: be forewarned

16:37 clojurescript is a lot newer than clojure

16:37 and can be tricky to get into

16:37 due to having less documentation/tooling

16:38 you'll want to use cljsbuild

16:39 inavat: Do people commonly write programs and libraries in the language that's the intersection of Clojure and ClojureScript?

16:39 ChongLi: inavat: there are a few, yes

16:40 work on this is ongoing

16:40 yedi: callen: http://shenfeng.me/add-async-to-ring.html

16:41 ChongLi: yedi: weavejester already wrote an example for him

16:41 yedi: oh

16:41 ChongLi: https://github.com/weavejester/websocket-example

16:45 edtsech: ChongLi: I think, it's for aleph not for http-kit.

16:45 ChongLi: oh good point

16:45 I didn't read yedi's link

16:47 cemerick: what might cause browser-REPL to work in Chrome+Safari, but not Firefox?

16:48 ivan: cemerick: did you look in Firefox's Error Console? (now hidden, has to be enabled in about:config)

16:48 rclarkson: is this a good way to put something into a vector as last element? (into [:one :two] '(:three))

16:49 ChongLi: &(conj [:one :two] :three)

16:49 lazybot: ⇒ [:one :two :three]

16:50 ChongLi: unless you actually have a list

16:50 devn: What companies are doing Clojure in SF?

16:50 ChongLi: then you want concat

16:50 &(concat [:one :two] '(:three))

16:50 lazybot: ⇒ (:one :two :three)

16:51 ChongLi: but that gives you back a LazySeq

16:56 gfredericks: &(into [:one :two] '(:three))

16:56 lazybot: ⇒ [:one :two :three]

16:59 yedi: http://shenfeng.me/600k-concurrent-connection-http-kit.html

17:04 dabd_: I am having problems with floating point numbers. This won't work ,(filter #(== % 8.3) (range 0 25.1 0.1))

17:04 ,(filter #(== % 8.3) (range 0 25.1 0.1))

17:04 clojurebot: ()

17:04 hyPiRion: ,(abs -1)

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

17:05 hyPiRion: Blu. ##(filter #(< (Math/abs (- % 8.3)) 0.001) (range 0 25.1 0.1))

17:05 lazybot: ⇒ (8.299999999999986)

17:06 hyPiRion: Comparing exactly isn't smart, check if the difference of the values are less than some low value epsilon.

17:07 e.g. wouldn't even ##(== 0.0M 0M) give the expected result.

17:07 lazybot: ⇒ false

17:07 gfredericks: or use ratios!

17:07 ratios are the best except when they're bad.

17:07 dabd_: yeah maybe i should read "what every computer scientist should know about floating-point arithmetic" :-)

17:08 gfredericks: ,(filter #(= 83/10) (range 0 251/10 1/10))

17:08 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval133$fn>

17:08 hyPiRion: dabd_: there's valuable information there :)

17:08 gfredericks: ,(filter #(= 83/10 %) (range 0 251/10 1/10))

17:08 clojurebot: (83/10)

17:09 dabd_: thanks guys ratios seems good for me

17:09 * gfredericks cheers

17:10 hyPiRion: gfredericks: In 10 minutes someone will come here and ask why their program is so slow.

17:10 gfredericks: better than asking why their program is so wrong :P

17:14 hyPiRion: true enough

17:19 tomoj: huh, datomic has bigdec

17:19 gfredericks: that's curious

17:20 SegFaultAX: Why did Prismatic close up all their libs?

17:20 tomoj: but they use a different equality :/

17:21 I guess that's good

17:21 gfredericks: SegFaultAX: there was a conversation about that a while ago wherein it was suggested they were trying to get bought or something I think

17:22 SegFaultAX: Does their sutff being OSS impact that?

17:22 gfredericks: apparently

17:22 SegFaultAX: :(

17:22 cemerick: ivan: yeah, nothing there

17:22 SegFaultAX: They had some really neat stuff (at least from the talks I've seen)

17:22 gfredericks: ibdknox seemed to know the reasoning behind that

17:22 I've never bought or sold a company before so it's all foreign to me

17:23 p_l: SegFaultAX: OSS tends to impact some buyers

17:24 especially when you try to get bought based on your IP

17:24 it pays off to have the "core, money-bringing" stuff private

17:24 SegFaultAX: Well it's not like their core product was OSS. Just some pretty nifty libs.

17:25 I'm mostly interested in their Store library.

17:25 yedi: what's Store

17:25 SegFaultAX: yedi: A clojure abstraction over a bunch of different datastores.

17:26 yedi: Check it http://www.infoq.com/presentations/Why-Prismatic-Goes-Faster-With-Clojure

17:26 yedi: ah, i remember now

17:27 it sucks that theyre tryna get bought tho

17:28 SegFaultAX: yedi: Meh. I'm only sad that the clojure community can't benefit from their work (anymore/yet).

17:29 yedi: exactly

17:29 gfredericks: fork all the things

17:30 SegFaultAX: gfredericks: Don't be that guy. ;)

17:41 inavat: what's the downside of using drip to work around the slow startup?

17:42 hyPiRion: I suppose there's some JVM running in the background

17:43 TheComrade: can anyone suggest why (going through emacs / clojure tutorial) that compiling test file gives me "unable to resolve symbol", but running lein test on CLI generates correct output?

17:43 on core_test.clj

17:48 inavat: I can't see why that's a down-side hyPiRion. I'm here considering whether to use ClojureScript and V8... or Haskell or Ruby or some other language.. but I think I should just use Drip

18:02 juliend_: Hi all, I need some help wrapping my head around some of the concepts of clojure dev

18:02 ChongLi: juliend_: hi

18:03 juliend_: I use ccw as a dev env

18:03 ChongLi: ok

18:03 juliend_: question 1) Does that make a big difference in terms of dealing with the REPL ?

18:03 ChongLi: in terms of features... or?

18:03 juliend_: the specific problem I'm having is that my application state seems to get corrupted

18:03 ecmendenhall: Hi everyone!

18:03 I have a flat list of vectors generated by zipping through a hiccup page.

18:04 Here's a paste: https://www.refheap.com/paste/9012

18:04 I'm trying to walk over it and generate nested :ul hiccup elements to create a table of contents.

18:04 juliend_: ChongLi: I get a error like: java.lang.StackOverflowError at clojure.lang.PersistentHashMap.seq(PersistentHashMap.java:194) at clojure.lang.RT.seqFrom(RT.java:480) at clojure.lang.RT.seq(RT.java:475)

18:04 ecmendenhall: There must be a way to do this with walk or reduce, but I'm stuck. Any suggestions?

18:04 hyPiRion: inavat: Uses more memory, bad for portable things like phones and Nexus 7

18:04 ChongLi: juliend_: are you using explicit recursion?

18:05 juliend_: after entering some bad code, which is fine, but when I remove that bad line of code. the exception remains

18:05 the only thing I can do is restart the java process and repl completely

18:05 then it works fine, with the same code

18:05 so I am confused with how exactly the REPL works and how it ties in to the runtime

18:06 ChongLi: there should be a hotkey to reload your code in the repl

18:06 juliend_: no explicit reccusion, but it might be in there I'm a big nood

18:06 noob

18:06 the code that caused it was: (println (alength statuses))

18:07 amalloy: it should be possible as reduce, ecmendenhall, but it doesn't look easy. hiccup is great for generating html, but working with already-hiccuped data structures is no fun; perhaps you already have it in some nicer form?

18:07 ChongLi: juliend_: is statuses a java array?

18:07 juliend_: no, statuses is just a reg clojure array

18:07 ChongLi: you mean a vector?

18:08 juliend_: (def statues [])

18:08 *statuses

18:08 arrdem: vector.

18:09 juliend_: my main question is not why this code failed on me, but rather why it seems that my application runtime was corrupted afterwards

18:09 removing the bad line doesn't seem to help, it keeps throwing the same runtime exception

18:09 am I missing something ??

18:09 lazybot: juliend_: Definitely not.

18:10 juliend_: lazybot: def not what ?

18:10 ecmendenhall: amalloy, Yeah, I have it as html and markdown. I'll think about trying to parse the markdown. All the header elements are at the same level of the DOM, though.

18:10 ChongLi: juliend_: that's a bot

18:10 haha

18:10 ecmendenhall: I'll chew on it for a while...

18:10 juliend_: ok lol

18:11 ChongLi: juliend_: I wish I could be of more help, I don't use eclipse or ccw

18:11 juliend_: ChongLi: what do you use? anything you'd recommend ?

18:11 arrdem: ChongLi: on three?

18:11 juliend_: ChongLi: I've also tried light table but it's far from being operational

18:12 arrdem: juliend_: yeah Light Table has a long way to go.

18:12 juliend_: emacs + nrep.el seems to be the favorite around here.

18:13 inavat: juliend_, you need to get the REPL to reload your newly updated code

18:13 it's got the old definition in there

18:13 I don't know anything about CCw

18:14 so I don't know how you'd do it

18:14 ChongLi: I use emacs + nrepl.el

18:14 ecmendenhall: I've also been having trouble connecting to the ClojureScript browser REPL. I'm pretty sure I've just made a dumb configuration mistake...

18:14 This one has a long explanation, so I'll just share my SO question here: http://stackoverflow.com/questions/14552026/connecting-to-clojurescript-brepl-clojure-browser-repl-connect-throws-typeerror

18:15 DigitalJack: Can someone tell me how to get emacs to quit highlighting the "current" word/name?

18:17 ChongLi: ecmendenhall: there's nothing dumb about it, the browser REPL is currently nontrivial to get running

18:17 dnolen: ChongLi: CLJS support only basic core.logic - no support for constraint or FD stuff. Probably won't see anything like that until feature expressions or something like it gets sorted out.

18:18 ivaraasen: hyPiRion: this in-place amap is really swell. less taxing for the heap.

18:18 dnolen: pepijndevos: yeah DCG is slow, a lot of optimization work is required for that stuff to work reasonably.

18:18 mmarczyk: pong

18:19 ecmendenhall: ChongLi, haha, thanks. It sure is. I saw the same problem in the irc logs from earlier this year, but I couldn't find a solution.

18:20 ChongLi: dnolen: is that in reference to my question about this?:

18:20 https://github.com/clojure/core.logic/wiki/Using-core.logic-with-ClojureScript

18:20 dnolen: so that is up to date?

18:20 juliend_: inavat: thanks, i'm pretty sure im reloading right because I see some debug lines that are at the top level being reprinted in the REPL. However, when I request a specific route, the whole thing crashes. If I restart the REPL & process with the exact same code, it works fine

18:20 Bodil: dnolen: Oh, that reminds me, is core.logic for Cljs mature enough for a potential Kibit port? That'd be awesome for Catnip.

18:21 dnolen: ChongLi: yes in ref to that question. It is up to date as far as how to use the CLJS version of core.logic.

18:22 ChongLi: dnolen: ok cool

18:22 dnolen: ChongLi: CLJS version of core.logic is very minimal - hardly any of the fancier stuff available - tabling, constraints (so no FD or nominal), no disequality

18:22 ChongLi: I was just wondering based on the "last edited 10 months ago"

18:22 dnolen: ChongLi: it's basically just miniKanren more or less

18:23 bosie_: is there a function for maps that insert a new key but won't override the key if it already exists?

18:23 dnolen: Bodil: but doesn't Catnip require the JVM anyway? So couldn't you just run kibit against the CLJS?

18:24 Bodil: dnolen: I'd like to ditch the JVM at some point. Also, hack value. :)

18:24 bosie_: merge i guess is what i am looking for

18:25 dnolen: Bodil: heh, well soon as I can easily maintain a single codebase I will.

18:25 Bodil: so yeah, something like that should be possible in the future.

18:26 cemerick: ChongLi: only a matter of time at this point :-)

18:26 Bodil: dnolen: I'll be looking forward to the future, then. :)

18:33 dnolen: ecmendenhall: I believe when using the latest CLJS you need the third party Closure jar as well

18:33 cemerick: Yeah, I hit that hard today

18:34 that's http://dev.clojure.org/jira/browse/CLJS-418 if people want to watch/vote

18:34 dnolen: feel free to comment / upvote if you want to see CLJS require it as a dependency (which I think it should)

18:34 http://dev.clojure.org/jira/browse/CLJS-418

18:35 inavat: what's the best twitter library for clojure?

18:35 twitter-api?

18:36 ecmendenhall: dnolen: aha, thanks. I'll try that out.

18:37 dnolen: cemerick: oops heh, you beat me to it.

18:37 arrdem: lol

18:37 why does clojurebot not do libraries too?

18:38 cemerick: dnolen: yeah. Brutal earlier. Send whiskey. :-P

18:48 ivaraasen: dnolen: what's the current status of core.logic and fork/join?

18:48 dnolen: ivaraasen: no status

18:49 ivaraasen: jamie brandon has done some work, but I'd like to approach the problem in a more general way.

18:49 ivaraasen: http://github.com/clojure/core.logic/wiki/Search-customization-%26-instrumentation

18:50 ivaraasen: jim duey also did some experimental work - but it was done in such a way that it's not mergeable at all

18:50 ivaraasen: dnolen: looks interesting. lots of cool stuff happening at the moment.

18:50 dnolen: ivaraasen: yes!

18:51 ivaraasen: dnolen: implemented a prototype based on the Prismatic Flop slides the other day

18:53 juliend_: I need help on something simple: I am doing a compojure/ring web app. I have a vector, statuses, that contains messages I want to display on a route. In the fn that fires for that route, how do I iterate on my vector to output a sequence of [:li that-status]

18:53 ?

18:54 weavejester: juliend_: Are you using Hiccup?

18:54 dnolen: ivaraasen: neat, I haven't looked at the flop stuff

18:54 juliend_: weavejester: Yes!

18:55 ivaraasen: dnolen: it's only like three macros. pretty darn fast too. in-place amap! is pretty appealing as well for large arrays

18:55 weavejester: juliend_: You could just do [:ul (for [status statuses] [:li status])]

19:03 juliend_: weavejester: For some reason, I get: java.lang.StackOverflowError

19:04 weavejester: Here's my code: http://pastebin.com/TS1Me3CC

19:06 weavejester: juliend_: There's nothing obvious there that would cause a stack overflow unless there was something strange in layout-narrow.

19:12 juliend_: weavejester: Thanks... Here's layout-narrow: http://pastebin.com/nGrk3QNk if you could have a look :)

19:12 it relies only on hiccup APIs

19:13 weavejester: Nothing hugely odd there, either. A stack overflow usually comes from runaway recursion. As far as I can see, all the code you have is bounded.

19:13 What's the stack trace like? It should tell you what part is repeating.

19:14 juliend_: at clojure.lang.Util.classOf(Util.java:94) at clojure.core.protocols$fn__5828$G__5823__5841.invoke(protocols.clj:13) at clojure.core$reduce.invoke(core.clj:6030) at ns_tracker.dependency$transitive.invoke(dependency.clj:15) at ns_tracker.dependency$transitive$fn__3120.invoke(dependency.clj:14) at clojure.core.protocols$fn__5871.invoke(protocols.clj:76) at clojure.core.protocols$fn__5828$G__5823__5841.invoke(protocols.clj:13) a

19:14 ....

19:14 and on and on and on

19:15 weavejester: juliend_: That looks like a circular dependency.

19:15 ns-tracker creates a graph of dependencies, but it assumes there are no circular dependencies.

19:16 juliend_: weavejester: the weird part is.. I've been getting this error a lot. And reverting the code that simingly caused it and reloading the file in the REPL doesn't help

19:16 weavejester: For example, if file A requires file B, but file B requires file A, that's a circular dependency.

19:17 francis: Anyone, is this a good representation of the difference between a lisp-1 and a lisp-2? https://gist.github.com/4651584

19:17 juliend_: weavejester: if I shut down the repo and the java process, and start it from scratch, then it works. with the same code!

19:19 weavejester: juliend_: It's likely a problem with wrap-reload. You technically shouldn't have any circular deps in your source code, but it might be possible to have them without generating an error in Clojure itself.

19:20 juliend_: I think you're right, because it only starts to happen when I reload a file for the first time

19:20 so it's not a problem starting from scratch, but it is when a file is live reloaded

19:20 and I did find a self reference in a :require, that should be it

19:21 weavejester: juliend_: Yes. ns-tracker should really have better error reporting for self references and circular dependencies.

19:21 juliend_: weavejester: it should. at least I found it with your help. there's a lot of traps for noobs out there!

19:24 beffbernard: Hi, is there a way to pass in parameters to a route without going about it with middleware or a global state?

19:48 weavejester: I'm having a bit of difficulty with recursion in core.logic

19:49 technomancy: francis: that's not really right

19:49 weavejester: I've set up a base case, and a recursive case, but I can't stop it from iterating forever

19:49 Unless… the results from run* are not lazy...

19:49 technomancy: francis: lines 5 and 12 would show the lambda; you'd use (funcall x) in line 12 to get that value

19:49 and (x) in line 5

19:50 hiredman: weavejester: you may want to look in to tabling, or restructure your cases, because conde does each clause, it doesn't stop at the first clause that matches like cond

19:50 weavejester: https://github.com/clojure/core.logic/wiki/Features mentions tabling

19:51 tabling is, as far as I can tell, memoization for logic programs

19:51 weavejester: hiredman: I think it this case it was because I assumed that (take n (run* …)) was the same as (run n …)

19:51 (defn repeato [q qs]

19:51 (conde

19:51 [(conso q [] qs)]

19:51 [(fresh [rs]

19:51 (repeato q rs)

19:51 (conso q rs qs))]))

19:52 hiredman: :/ yeah that is very similar looking to the tabling example

19:53 weavejester: I think the difference is that I don't expect the results to terminate without setting an explicit limit.

19:55 hiredman: I've been writing core.logic programs that query jira's rest interface, tabling cuts down on the number of rest calls that happen

19:56 weavejester: I'll optimize it later :)

19:57 hiredman: https://gist.github.com/4651836

19:59 francis: technomancy: Thanks.

20:02 weavejester: Hum, maybe I'll need tabling after all.

20:04 brehaut: is there a good low complexity sql db migratiion lib around?

20:05 im fine with typing in all the sql statements manually, i just want something that will manage running them when needed

20:05 TimMc: brehaut: You only want up-migrations, yeah?

20:05 weavejester: I hesitate to nominate one of my own projects, but Ragtime perhaps?

20:05 brehaut: TimMc: i think so yeah

20:05 weavejester: irc is exactly for that sort of recommendation

20:06 TimMc: yeah up only

20:06 because i am a DB heathen

20:07 weavejester: ragtime does look like it covers all my needs and more

20:08 weavejester: any downsides to ragtime?

20:13 weavejester: brehaut: It's not as mature as, say, Ring. But I have used it in production without problems.

20:13 brehaut: weavejester: ok thanks.

20:14 rationalrevolt: Hi room, i'm just starting out with ring and was trying out session middleware. I tried making a session counter, but its always incrementing twice - am I doing something wrong? https://gist.github.com/4651916

20:14 weavejester: rationalrevolt: Probably because the browser is looking for a favicon

20:15 rationalrevolt: So when you go to "/", the browser makes 2 requests, one to "/" and one to "/favicon.ico".

20:16 rationalrevolt: ook - so, this should work right if map my handler to a path other than "/"

20:17 brehaut: weavejester: the docs for ragtime suggest putting ragtime "0.3.2" into dependancies; is it safe to use def dependancies?

20:17 rationalrevolt: thank you weavejester

20:17 weavejester: brehaut: def dependencies?

20:17 brehaut: weavejester: sorry, dev. dependancies

20:18 (dependancies only defined for the development profile)

20:18 weavejester: brehaut: I don't see why not

20:18 brehaut: cool

20:19 weavejester: I mean it's all the same thing by the time it gets to the app.

20:29 Frozenlock: I just stumbled uppon a goog.events which is in the closure library, but not accessible with cljs. Is cljs only using a subset of the closure library?

20:30 dnolen: Frozenlock: what do you mean "in", if it's in the jar you can use it.

20:31 ChongLi: Frozenlock: you can use it

20:31 you just need to fully qualify when you construct one of the objects

20:32 say you want a KeyHandler

20:32 Frozenlock: Well, if I type "goog.events.MouseWheelHandler" in my js console: On the goog. demo page, it will return the definition. However on my cljs page, it's undefined. https://closure-library.googlecode.com/svn/trunk/closure/goog/demos/mousewheelhandler.html

20:33 ChongLi: first you need to (:require [goog.events.KeyHanlder :as key-handler]) in your ns declaration

20:33 then you create one with (def kh (goog.events.KeyHandler.))

20:34 works exactly the same way with MouseWheelHandler

20:35 Frozenlock: Oh right. I suppose what I was comparing it with was already required elsewhere

20:35 Works now, thank you very much :)

20:35 fakedrake: hello, i want to keep a stack of errors so i came up with this, but it seems a bit ugly, is there a better way? https://gist.github.com/4652070

20:35 ChongLi: no prob

20:36 S11001001: fakedrake: that's unsafe too

20:36 ChongLi: fakedrake: put it in an atom

20:36 fakedrake: could you show me?

20:36 ChongLi: (def errors (atom '()))

20:36 S11001001: fakedrake: or carry the error vec around with you

20:37 ChongLi: (defn push-error [error] (swap! errors conj error))

20:38 fakedrake: ChongLi: Thank you

20:39 ChongLi: to get at the value in the atom you deref it with @

20:39 @errors

20:39 swap! is used to update it

20:40 TimMc: fakedrake: Vars are not meant to be used that way, and thus do not have the behavior you need.

20:40 Particularly, var mutation is not thread-safe.

20:41 ChongLi: overriding with def is basically meant only for use in a repl

20:46 fakedrake: are atoms thread safe?

20:47 TimMc: Yep, that's what they're there for.

20:48 fakedrake: how about this: (defn pop-all-errors [] (let [tmp-errors errors] (reset! errors '()) tmp-errors))

20:48 ?

20:49 amalloy: no

20:49 fakedrake: :S

20:49 amalloy: mutation is hard, man. write code without it

20:50 fakedrake: :S I kind of want to retrieve errors asynchronously so they will show up during rendering...

20:50 I will look for another way

20:52 ChongLi: fakedrake: read out of the tarpit

20:53 xumingmingv: given a fn, is there a programmatical way to determine it is an anonymous function or not?

20:53 TimMc: ChongLi: All I got out of OotTP was a sense of frustration at all current programming systems. :-P

20:54 xumingmingv: In a realiable way, or in a hack-assed way?

20:54 xumingmingv: I'd like hear both, if possible ;)

20:55 TimMc: I'm not guaranteeing that either exists, mind you.

20:55 ChongLi: TimMc: it's really been enlightening to me

20:55 I can practically trace the philosophy of Clojure through it

20:55 TimMc: ChongLi: Enlightening, yes, but I haven't been able to apply anything I've learned from it.

20:56 n_b: OotTP?

20:56 ChongLi: TimMc: that depends on how literally you take it

20:56 pppaul: anyone here worked with clojurescript and angularjs? i would like to know if clojurescript would be easier to work with than that?

20:56 TimMc: I'm not finished. Just getting into the FRP stuff.

20:56 gfredericks: clojurebot: OotTP is Out of the Tarpit

20:56 ChongLi: when they talk about using "separate languages"

20:56 clojurebot: c'est bon!

20:56 ChongLi: you don't literally have to use completely separate programming languages

20:56 you can use DSLs

20:56 TimMc: sure

20:57 rplaca: xumingmingv: how badly do you want to know? You can enumerate all the vars in all the namespaces and see if any of them point to it

20:57 ChongLi: and if you look at clojure, you can see that atoms, refs, agents etc. form a DSL for handling state

20:57 rplaca: that shouldn't be too hard, but it's not very efficient

20:57 ChongLi: with their own special operator

20:58 xumingmingv: rplaca: sounds like a solution

20:58 ChongLi: another thing to look at is macros in clojure

20:58 you could consider them a DSL for implementing control (though they can do much more than that, obviously)

20:59 rplaca: xumingmingv: an anonymous function is just a function that hasn't been assigned to a var

20:59 TimMc: xumingmingv: Which of these is "anonymous"? #(), (fn [] ()), (fn foo [] ())

20:59 gfredericks: ,#()

20:59 clojurebot: #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@2d14a694>

20:59 xumingmingv: rplaca: actually it is enough for my purpose, thanks

20:59 gfredericks: ,(#())

20:59 clojurebot: ()

20:59 gfredericks: weeeeeird

20:59 TimMc: heh

20:59 ChongLi: xumingmingv: keep in mind that defn is a macro in clojure

20:59 it expands to def

21:00 with a regular (fn [] ...) in there

21:00 xumingmingv: TimMc: I think I mean the first two

21:00 ChongLi: as well as handling some other stuff for you

21:00 (through optional params)

21:00 xumingmingv: TimMc: The third one does have a name, right?

21:00 TimMc: Sort of.

21:01 Clojure functions don

21:01 xeqi: pppaul: have you had any luck figuring out how to make peridot send the files you want?

21:01 rplaca: (defn f [x y z] ...) == (def f (fn f [x y z] ... )), roughly

21:01 TimMc: Clojure functions don't carry names beyond compile time.

21:01 ChongLi: a clojure function is a value that can be bound to a var; like any other value

21:01 TimMc: (Unlike JS fns, for instance.)

21:01 ned: is test.generative like haskell's QuickCheck?

21:01 pppaul: xeqi, i am doing lots of file testing with is, however i haven't got a chance to refactor my tests to make them look the way i want

21:02 ChongLi: unlike other languages which use special statements to define functions

21:02 a clojure function is defined by an expression

21:02 TimMc: &(class (fn CHECK [] ()))

21:02 lazybot: ⇒ sandbox8276$eval77672$CHECK__77673

21:03 gfredericks: ChongLi: well it is a special form

21:03 also JS is roughly the same

21:03 ChongLi: gfredericks: no

21:03 JS has function expressions and function statements

21:03 with different syntactical rules

21:03 gfredericks: do they have different semantics?

21:03 ChongLi: yeah

21:04 TimMc: Sort of...

21:04 ChongLi: a function statement can't be called immediately with ()

21:04 TimMc: ChongLi: A JS function statement is basically a JS var assignment + a function expression.

21:04 Not so different from Clojure.

21:04 gfredericks: ChongLi: worked for me

21:04 TimMc: Now, there may be some differences between browsers re: scope, instanceof, etc.

21:04 ChongLi: it wasn't a function statement then

21:05 function statements are denoted by the f in the word function being in the first column of a line

21:05 gfredericks: well you can't call anon functions like that either

21:05 function(){return 5}() fails

21:05 TimMc: That's a statement.

21:06 gfredericks: Try (function(){return 5})()

21:06 gfredericks: sure

21:06 "anonymous" normally means nameless to me

21:06 TimMc: Well, that's nameless, and it works.

21:06 gfredericks: sure but so is mine

21:06 but I can't call it

21:06 ChongLi: because it's a statement

21:06 not an expression

21:07 TimMc: gfredericks: With yours, "SyntaxError: function statement requires a name"

21:07 gfredericks: TimMc: chrome gives me unexpected token (

21:07 TimMc: Ooh, does it let the fn statement through?

21:07 gfredericks: I guess it's an error without the () too though

21:08 same error though

21:08 (about the paren)

21:08 TimMc: Ah, it's the *first* paren.

21:08 gfredericks: which I guess means the same thing as requiring a name

21:08 ChongLi: yeah the unexpected token is where the name should be

21:09 but anyway, my point is that statements are generally bad

21:09 because they enforce silly arbitrary syntactic ordering/rules

21:10 expressions (particularly S-expressions) are a lot simpler to deal with

21:10 gfredericks: http://this-plt-life.tumblr.com/post/36425234294/when-i-see-that-a-new-language-makes-a-difference

21:11 ChongLi: haha there you go

21:15 what does Rich Hickey think of feature expressions?

21:23 xeqi: is there some middleware that can be added to make (compojure.routes/resources ..) have etags or last-modified headers for caching?

21:27 technomancy: gfredericks: if you meet someone who has invented a language with statements, is it more polite to try to comfort them ("everyone makes mistakes", etc) or to pretend you don't know?

21:27 * arrdem attempts to pretend not knowing himself

21:28 arrdem: nope, not working for me.

21:38 TimMc: technomancy: The one place it would be useful to have statements in Clojure: println at the REPL.

21:39 and even then it's just that I'd rather not see "nil" at the end of a printout.

21:45 yazirian: #fossworldproblems

21:46 TimMc: (inc yazirian)

21:46 lazybot: ⇒ 1

21:46 yazirian: :)

21:46 arrdem: TimMc: if we had reader macros that'd be easy....

21:47 TimMc: &(do (println "Look Ma, no nil!") (symbol ""))

21:47 lazybot: ⇒ Look Ma, no nil!

21:47 TimMc: ...but that's sort of cheating.

21:47 arrdem: haha

21:48 hadronzoo: I've created a custom record in ClojureScript that I'm serializing with pr-str. When I use read-str to reload that record, I get a Javascript error that it could not find tag parser. Is it possible to read records in Clojurescript?

21:48 TimMc: adiii: I've done that for REPL util fns before.

21:48 bah

21:48 arrdem: ^ not adiii

21:49 hadronzoo: Do I need to register a custom tag parser for each record type I create?

22:00 I answered my own question. Currently, you do have to register a tag parser, as shown here: https://coderwall.com/p/3xqr7q

22:10 rl: hmm, i'm trying to figure out symbol scope in eval, ex

22:10 ( (fn [x] (eval 'x)) 56)

22:10 compalsin about symbol x not existing

22:12 what am i not getting?

22:13 rationalrevolt: &((fn [x] (eval x)) 56)

22:13 lazybot: java.lang.SecurityException: You tripped the alarm! eval is bad!

22:13 rl: lol

22:13 rationalrevolt: lol

22:14 arrdem: meh... anyone know a really ultralight html templating engine?

22:14 rl: arrdem: i'm actually working on one right now

22:14 arrdem: I need to bang out some page mock-ups and I don't want to set up a full blown ring/compojure instance...

22:15 rl: do tell

22:15 gfredericks: technomancy: are you suggesting I start a "Dear PLT Abby" column?

22:15 rl: it's now done yet, but look at fleet. it might meet your needs

22:16 https://github.com/Flamefork/fleet (this is someone elses project)

22:16 arrdem: not sure if beautiful or repulsive..

22:17 cute either way

22:17 rl: arrdem: what does "&" stand for? hard to use search engine with that symbol

22:18 callenbot: yedi: I'm not going to use long polling.

22:18 arrdem: rl: up in rationalrevolt's example?

22:18 rl: whoops, yes haha

22:19 arrdem: it's just syntax so that the channel clojure evaling bot(s) would pick it up.

22:19 ,(println "hellp rl!")

22:19 clojurebot: hellp rl!\n

22:19 arrdem: &(println "hello rl!")

22:19 lazybot: ⇒ hello rl! nil

22:19 rl: ah cool

22:20 arrdem: clojurebot does most of the talking, but lazy bot deals with karma

22:20 ~cons

22:20 clojurebot: (def ^:const x 42) will cause any compiled reference to x to be as if you wrote 42 instead

22:20 arrdem: ~guards

22:20 clojurebot: SEIZE HIM!

22:20 arrdem: ~gourds

22:20 clojurebot: SQUEEZE HIM!

22:20 arrdem: you get the idea

22:20 rl: hm, mabey i should re-work my system

22:21 bascially im slurping in a html file, splitting up "<html>HI !%%some_clojusre_stuff%% </html>" into multiple vectors, string ont he left and clojure data/code on the right

22:22 then using eval on the index that contains the code/data

22:22 gfredericks: is there a special function for getting a range of keys from a sorted-map?

22:23 arrdem: gfredericks: wouldn't you just (filter) it?

22:24 gfredericks: that would presumably not take advantage of the underlying data structure for efficiency

22:24 arrdem: correct

22:24 gfredericks: these sorted-maps must be good for something besides printing maps with their keys sorted

22:25 arrdem: gfredericks: one would hope...

22:26 dcb: I'm frustrated that I can't attach metadata to datomic entities. Is there a technical reason entities can't have metadata?

22:26 gfredericks: dcb: you want to store the metadata in the db?

22:27 dcb: gfredericks: no. Just on the entity I pull back from the database. Not meant to persist at all.

22:27 gfredericks: then I have no idea; I wouldn't think it's a technical limitation

22:28 amalloy: gfredericks: subseq

22:29 dcb: gfredericks: Yah it seems obvious that they should be able to, as they are in a lot of ways just a fancy collection type. I haven't been able to find anyone discussing it though. I guess metadata is not that widely used?

22:30 gfredericks: amalloy: and that's why (apropos "key") didn't find it :) thanks

22:30 dcb: I have no hunches; I haven't used datomic either.

22:32 rationalrevolt: Is _method in a form parameter used to indicate the form submission method, i.e. GET/POST? Is this in any standard?

22:32 gfredericks: rationalrevolt: I don't think it's standard but pretty common

22:32 rationalrevolt: gfredericks: alright

22:32 gfredericks: usually to fake a PUT or DELETE

22:33 for people who like HTTP verb variety more than web browsers do

22:34 rl: ah, here is the issue

22:34 (let [data "test"] (eval (read-string "data")))

22:34 &(let [data "test"] (eval (read-string "data")))

22:34 lazybot: java.lang.SecurityException: You tripped the alarm! eval is bad!

22:35 rl: ,(let [data "test"] (eval (read-string "data")))

22:35 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

22:35 gfredericks: rl: eval doesn't see locals

22:35 rl: hmmm

22:36 gfredericks: if you want to set up some particular locals for some code you're going to eval, you can wrap the code in a let and eval that

22:36 rationalrevolt: gfredericks: is this commonly used in client side js for REST or something? Like if i needed to do a PUT call from the browser?

22:36 gfredericks: rationalrevolt: exactly

22:36 arrdem: herm, so nrepl can't seem to find lein when it's clearly installed and on my path.

22:36 gfredericks: I can't say for sure I've seen it outside of rails but I always had the impression it was in the pile of quasi-standard web programming hacks

22:37 arrdem: does it use a different search path than the launching user?

22:41 rationalrevolt: Like &(...) to evaluate an sexp here in this chat room - are there other hooks?

22:41 brehaut: reasons i should be moving my site of couchdb: i have entire types of document i no longer recognise at all

22:41 gfredericks: rationalrevolt: & triggers lazybot

22:42 &(#(% %) #(% %))

22:42 lazybot: java.lang.StackOverflowError

22:42 rationalrevolt: someone here also did a ,(..) which gave some sandbox message - are there other hooks like that?

22:42 gfredericks: , is for clojurebot, also for eval

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

22:43 gfredericks: ,(#(% %) #(% %))

22:43 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.StackOverflowError>

22:43 gfredericks: clojurebot: lazybot?

22:43 clojurebot: lazybot is echo ~lazybot

22:43 xeqi: rationalrevolt: , and & trigger the two bots. lazybot also listens to $ for commands, ~ triggers clojurebot to talk

22:43 $findfn 1 2 3

22:43 ~gourds

22:43 clojurebot: SQUEEZE HIM!

22:43 hiredman: clojurebot: what is good in life?

22:43 clojurebot: meaning of life is to become one with Lisp

22:43 lazybot: [clojure.core/bit-or clojure.core/bit-xor clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int]

22:43 gfredericks: ~botstack

22:43 clojurebot: /me puts lazybot on his head and gropes blindly for a third bot to complete the stack.

22:44 arrdem: (inc clojurebot)

22:44 lazybot: ⇒ 16

22:44 gfredericks: callenbot is here...

22:44 arrdem: is there a limit on how many lines clojurebot'll print?

22:45 gfredericks: ,(dotimes [n 10] (println n))

22:45 clojurebot: 0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n

22:45 gfredericks: that I hadn't seen.

22:45 ,(println "foo\nbar")

22:45 clojurebot: foo\nbar\n

22:46 arrdem: that's new...

22:46 gfredericks: ,(println (apply str (repeat 200 \x)))

22:46 clojurebot: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n

22:47 arrdem: ~setf

22:47 clojurebot: I don't understand.

22:47 arrdem: ~setq

22:47 clojurebot: It's greek to me.

22:47 arrdem: ~set

22:47 clojurebot: It's greek to me.

22:59 xeqi: recently got a screencast about friend and creating a login form polished enough, would appreciate any feedback; http://www.clojurewebdevelopment.com/videos/friend-interactive-form

23:02 francis: xeqi: Nice tutorial.

23:03 arrdem: herm... can I get someone else's `which lein`?

23:03 xeqi: what line highligher are you running here?

23:03 francis: arrdem: ~/bin/lein

23:03 arrdem: francis: weird... thanks.

23:04 francis: can you M-x nrepl-jack-in ?

23:05 francis: arrdem: No, I end up starting a REPL on the terminal and connecting to that.

23:06 xeqi: More specifically, I like that you included creating tests as part of the process. It sets a good example.

23:06 arrdem: xeqi: yaaay bcrypt

23:06 ppppaul: anyone have experience working with clojure.data.xml?

23:07 arrdem: solved my nrepl issue by sudo ln -s ~/bin/lein /usr/local/bin/lein X-P

23:09 francis: ppppaul: I have some experience, why?

23:09 callenbot: xeqi: thanks for sharing this!

23:10 xeqi: arrdem: I'm using the monokai theme

23:10 though I remember changing that color due to some interaction wieh emacs and urxvt

23:12 callenbot: xeqi: what bit is highlighting the failed step of the test?

23:12 xeqi: callenbot: thats clojure-test-mode using C-c C-, in the test file

23:13 callenbot: xeqi: thanks

23:14 ppppaul: francis, i'm doing a test. i have an input xml and some output xml (both are zipped and go through xml->).... i want to compare a single branch of their tags, but my data structure from xml-> is huge and contains way more stuff than i expected it to contain... how would i trim it down so i can compare my xml objs?

23:15 xeqi: francis: thanks, I come from a tdd-ish background and love having tests that make sure I'm doing what I think I am

23:15 ppppaul: https://gist.github.com/4652966

23:16 cshell: ppppaul: DOM Manipulation/XPath query?

23:17 ppppaul: hmm

23:19 callenbot: xeqi: how do you like living in Texas?

23:19 ppppaul: it comparing pieces of xml not a use-case in xml manipulation/creation libs?

23:19 callenbot: xeqi: I'm in the bay area and considering going back to contracting and leaving Cali.

23:21 xeqi: callenbot: I see the benefits of being in the bay area career wise, I'm here cause its better for wife's career

23:22 cheap houses with lots of room, but that causes the sprawl

23:22 though parts of austin are bikable

23:22 callenbot: xeqi: I'm just miserable here and would rather go back to contracting. I preferred living in the country.

23:24 xeqi: ah, plenty of that here, and lots of suburbs for the have some room but not be alone feeling

23:24 cshell: callenbot: What is bringing you misery in the bay area?

23:25 xeqi: though you give up the tech meetups; we've got ~5 regulars for the houston clojure meetups

23:25 callenbot: cshell: quite a lot. I'm culturally alienated. I find most of the startups I've run into or worked for to be disingenuous.

23:25 xeqi: there's nothing at all impressive about the bay area programming meetups here. They're mostly a travesty. The Clojure ones are slightly better.

23:26 xeqi: one Clojure meetup group is used as a guy's personal profiteering opportunity, the other is populated mostly with curious tourists.

23:26 cshell: callenbot: I'm interested because I'm considering moving from CO to the bay area, solely for the career opportunities. Have you been mostly working at startups rather than the established/larger companies?

23:26 Schaefer: callenbot: if you prefer the counry, you might consider alameda. it's the midwest of the bay area

23:26 callenbot: Schaefer: uh no, I want out of Cali.

23:27 Schaefer: I was thinking Washington, Texas, NM, AZ, OR.

23:27 xeqi: haha, I got a couple of contracting oppertunities out of the local ruby group when I was doing that, so I figured they had to be more valuable out there

23:27 callenbot: cshell: all startups, yes.

23:27 ppppaul: come to canada

23:27 cshell: callenbot: I've heard great things about Austin for developers - they say the demand down there is incredibly high

23:27 Schaefer: alright then :) i've been here for 20 years and it's definitely not everyone's cup o' tea

23:27 callenbot: ppppaul: I don't want to live in Canada.

23:27 cshell: Austin is on my hot list.

23:27 xeqi: +1 austin

23:28 callenbot: xeqi: I don't mean sometihng like that, I mean he's literally using the meetup group to advertise expensive classes

23:28 and he had a funded startup on top of that. This isn't something relatively innocuous like picking up contracting work

23:28 which I'm considering doing with an old friend so we can both leave Cali.

23:29 I'm to the point where I'm convinced I'll do my own startup, but it'll be bootstrapped and that I wouldn't want anything to do with the bay area ecosystem.

23:29 cshell: callenbot: Where are you thinking of picking up contracting work outside of Cali? It's hard in CO to find contracting work that doesn't want you onsite or through an agency

23:29 callenbot: cshell: Cali is pretty hostile to contracting in general and just wants to hire, in my experience.

23:30 cshell: I was thinking of seeking remote projects and individual work.

23:30 * arrdem is in ATX and loves it

23:30 cshell: callenbot: That's similar to CO as well - where will you look for the remote projects/ind. work? When I've looked, the market seems to be dominated by people in India bidding super cheap for large projects

23:31 francis: ppppaul: I started looking at your issue, but then was forced to close my emacs, could you tell me again exactly what your issue is?

23:31 cshell: callenbot: just interested cause I've been thinking of the same things

23:31 callenbot: cshell: I've got a long history, broad range of experience, and some particularly expensive specialties. I'm hoping that and a good sense of taste will help me get back in the game.

23:31 ppppaul: i want to compare a branch of 2 similar xml docs francis

23:31 callenbot: cshell: I've been a 100% remote consultant before. This is nothing new for me.

23:31 ppppaul: the branch in the 2 docs should be the same, the rest of the tree could differ

23:32 callenbot: cshell: what's new is wanting to do it as a small concern with my friend.

23:32 * Apage43 has been in Cali for ~7mos, nothing i'm really liking about it =/

23:32 francis: ppppaul: I'm not sure what you mean by 'docs'

23:32 ppppaul: xml documents (files)

23:33 one is a file, one is generated from my db

23:33 callenbot: Apage43: I'm from Ohio and have been miserable here for ~2 years. I'm almost itchy with desire to leave. What about you?

23:33 Apage43: I lived in NYC for 2 years prior to this.

23:33 Apage43: callenbot: From Arkansas. Previously working remote, still working for the same company here.

23:34 callenbot: I have thoroughly established that I hate city life.

23:34 Apage43: It seemed like a better idea then than it does now =P

23:34 xeqi: callenbot: oh, if you're considering tx I hope you like it hot; and humid if your near the coast

23:34 callenbot: xeqi: that could be a blocker. I'm a winter creature.

23:34 Apage43: callenbot: I kind of knew I didn't like urbanness before moving, I just underestimated that since I'd only experienced it in bursts

23:34 callenbot: xeqi: I'll give it thought. I'm hoping Austin is a best-of-all-worlds situation for wanting to live in the country but having access to a city.

23:35 arrdem: xeqi: not really... mod our sweltering summer the winter here is equivalent to east-coast spring

23:35 Apage43: I grew up in East TX though (also known as Patent Litigation Country)

23:35 callenbot: Apage43: I figured it out quickly in NYC, was hoping CA wouldn't be the worst of all worlds in urban-ness and suburban-ness.

23:35 francis: ppppaul: Personally I would turn them into clojure data structures, then grab the parts/branches I want and compare those. Is your question how would one go about that?

23:36 ppppaul: well, they are clojure data structures....

23:36 but they are zipped and unmanageable for me

23:37 Apage43: anyway i'm about to commit to an apartment for a while, so no escaping in the near term

23:37 ppppaul: Apage43, sublet

23:38 callenbot: Apage43: I'm not in a lease, and even if I was, I'd burn the fucking apartment to the ground before staying here any longer than I have to.

23:38 the moment I figure out an income not connected to my physical location, I'm goooooooone

23:38 ppppaul: doesn't subletting exist in america?

23:38 callenbot: ppppaul: I'm subletting right now, technically.

23:38 arrdem: ppppaul: it does, but many contracts prohibit it.

23:38 callenbot: ppppaul: we're generally less apt to make formalisms out of casual arrangements.

23:38 ppppaul: no need to burn things

23:38 arrdem: ppppaul: doesn't mean that ppl don't do it

23:39 callenbot: yeah I'd say most leases don't allow it

23:39 Apage43: callenbot: mine kind of *wasn't* and then it let it become that way :/

23:39 callenbot: we got away with it by aggressively ignoring the whiny landlord.

23:39 ppppaul: cal = anti tenant

23:39 francis: ppppaul: I've never used private messages before on IRC, did that reach you?

23:40 Apage43: *then I

23:40 arrdem: ppppaul: bullshit SF is pro-tennant as hell

23:41 callenbot: SF isn't the entirety of California

23:41 how pro-tenant the law is depends on the municipality.

23:41 In general, SF's pro-tenant laws are part of what makes it so expensive to live there

23:41 arrdem: yeah... 'cause once you're in your landlord basically can't remove you.

23:41 callenbot: there's a bimodal distribution of incomes in SF, wealthy and very poor, because of the high costs, high regulation, subsidization, etc.

23:42 so if you're not a post-IPO founder or unemployed, you can't live in SF.

23:43 ppppaul: arrdem, then why no subletting?

23:46 arrdem: ppppaul: not sure about SF, I'm only aware of the state there second hand. here in ATX subletting is largely against contract tho.

23:47 ppppaul: against contract != against law

23:47 in ontario i think that a contract is void if it states any crazy crap against subletting

23:48 arrdem: true... but that's really just semantics. either way the landlord has the consequent power to evict you.

23:48 callenbot: I really liked the tenant law in Ohio

23:48 it was a good balance

23:51 * Apage43 never has wound up understanding any of this stuff, which has not been helpful since being here

Logging service provided by n01se.net