#clojure log - Apr 03 2013

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

0:02 muhoo: yacin: ya

0:03 Raynes: I simply recommend you ignore anything I've ever written regarding it.

0:04 muhoo: the name says it all

0:05 yacin: haha

0:14 rationalrevolt: is there a function that converts a map with string keys to a map with keyword keys in core?

0:14 capcrunch: have anyone tested clojure on zos ?

0:14 it just core dumps the jvm

0:15 `arrdem: rationalrevolt: no, but there's always (keyword)

0:16 ,(reduce (fn [m [skey v]] (assoc m (keyword skey) v)) {} {"foo" 1})

0:16 clojurebot: {:foo 1}

0:16 `arrdem: rationalrevolt: ^^

0:16 rationalrevolt: alright :)

0:16 `arrdem: can haz karma? XD

0:17 ah nvm.

0:21 rationalrevolt: i was looking for something ready made, that will do this recursively

0:21 `arrdem: I mean...

0:21 implementing the recursion case for that isn't hard.

0:21 amalloy: clojure.walk/keywordize-keys, but i recommend re-evaluating why you need it

0:23 rationalrevolt: i'm trying to build on cheshire json/decode to give me keyword maps , since i don't like big destructuring forms

0:23 amalloy: so ask cheshire to give you back keywords

0:24 asking for strings back and then converting them yourself is such a pain

0:24 dakrone: ,(cheshire.core/decode "{\"foo\": \"bar\"}" true)

0:24 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: cheshire.core>

0:24 dakrone: drat

0:24 anyway, that's how you do it

0:24 ,(require 'cheshire.core)

0:24 clojurebot: #<FileNotFoundException java.io.FileNotFoundException: Could not locate cheshire/core__init.class or cheshire/core.clj on classpath: >

0:25 amalloy: dakrone: i get that true is available, but why? it's not nearly as readable as (decode s keyword), and no faster

0:26 dakrone: amalloy: because it was there before custom keyword functions, so cheshire supports either 'true' or a function

0:26 backwards-compatibility

0:28 rationalrevolt: got it, thanks amalloy

0:30 dakrone: one day I'll be able to drop 1.2 support from my libraries, and I will be very happy on that day

0:32 amalloy: i'm curious if you have any plan in place for when that day is, dakrone

0:34 dakrone: no plan yet, just looking forward

0:35 amalloy: i think we've dropped 1.2 support from the flatland projects by now

0:36 of course yours get used more; i'm just providing a data point, not suggesting you do the same

0:37 samedhi: What is best practice for automatic testing with lein? Is it still lein-lazytest?

0:43 tieTYT2: why doesn't the getProperties in this example need a period in front of it? http://clojure.org/java_interop#Java%20Interop-The%20Dot%20special%20form-%28..%20instance-expr%20member+%29

0:43 same with the .get

0:50 yacin: any recommendations for a cassandra client library? there are quite a few floating around out there

0:51 tieTYT2: ohh, so (.foo) is different from (. foo) in clojure?

0:51 ah nm

0:52 the former is expanded to the latter

1:08 SegFaultAX: ,('foo {'foo 1})

1:08 clojurebot: 1

1:08 `arrdem: ok good I'm still alive.

1:09 SegFaultAX: Interesting. I didn't realize symbols, like keywords, were similar to keywords when called (eg they'll `get` themselves)

1:10 Heh, that was strangely phrased. Anyway.

1:21 mjc: lazybot: coin

1:21 lazybot: mjc: Heads.

1:27 arrdem: lazybot: d20

1:41 akhudek: technomancy: your post on parentheses was amazing, just saw it now

1:45 SegFaultAX: I hadn't seen it yet either. Well done. :)

1:49 borkdude: I think the cornery style of XML fits Clochure nice: a match made in heaven

2:22 pdmct: ,((list :a) 0)

2:22 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>

2:24 pdmct: ,((list :a) 0)

2:24 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>

2:35 SegFaultAX: pdmct: That doesn't make any sense, in case you're wondering.

2:36 pdmct: yes I know, I was seeing what the exception that was thrown by it ... found it in a JoC - which said it was wrong

2:36 s/a//

3:52 dbushenko: hi all!

3:53 what do you guys use to manage sessions in a compojure application?

4:09 asteve: do you recommend ring + compojure?

4:53 mpenet: yacin: I would advise to use Alia, but I am biaised :)

4:54 yacin: it just works and wraps a solid/recent library so it's a good choice

4:58 dribnet: a little out of my element trying to get a tagged literal to work in the cljs compiler

4:59 i have it working in the cljs reader, but can't for the life of me hoist it out to the compiler

4:59 tomoj: you can't

4:59 dribnet: you kind of can https://groups.google.com/forum/?fromgroups=#!topic/clojurescript/iFCDCZBPHSA

4:59 tomoj: I mean, you can't just hoist it

4:59 you have to write a different one

5:00 dribnet: aha, yes.

5:00 in some clj code.

5:00 tomoj: oh, but your problem is about how to modify *cljs-data-readers*?

5:00 dribnet: here's my clj test code

5:00 (alter-var-root #'t/*cljs-data-readers* assoc "js" identity)

5:02 the cljs seems to compile with that, but using the tag in the src doesn't work

5:02 ("java.lang.RuntimeException: No reader function for tag...")

5:03 perhaps as a warmup I should just edit the compiler code directly without trying all this slight of hand stuff in my project...

5:03 tomoj: you also did the :require-macros that herwig suggested?

5:04 dribnet: youbetcha

5:04 i even have an empty macro in my file to make sure its being read in

5:05 at that point it wasn't clear to me what voodoo i could do to further debug what's happening.

5:12 hi chas

5:13 i was just whining to tomoj about not being able to get my tagged literal to work in the cljs compiler

5:14 tomoj: I can't get it to work either

5:14 dribnet: thx. i thought i was going crazy. :)

5:27 bulters: anyone here any experience with setting up a server for clojure apps?

5:27 I have a clean vps which I would like to use to experiment with clojure webapps

5:28 but - coming from ruby-land - it's a bit unclear whether to use an app server like immutant or jetty...

5:32 ebaxt: bulters: Are you thinking about a simple webapp, or do you need infrastructure like message brokers etc?

5:49 tomoj: it would be cool if let supported for's :when

5:49 I have (if .. (let .. (if .. (let .. (if ...)))))

5:49 bulters: ebaxt: simple webapp, nothing fancy yet... currently working on some toy projects

5:51 by the time I need the fancy stuff I'll be a java app deployment expert ;-)

5:52 arcatan: tomoj: maybe you could simplify it with if-let?

5:52 tomoj: in this case, no

5:53 :when would also fix the problem with multiple bindings in if-let

5:53 you just say what you mean

5:53 mpenet: it's possible with the new -> macros isn't it?

5:53 as-> and cond->

5:53 tomoj: ah, hmm

5:53 didn't think to try them

5:54 https://www.refheap.com/paste/3b42d3250c566c3224300fa06

5:54 already wrote it the ugly way, maybe I'll try them later

5:56 dribnet: could you have twisted for to accomplish the same thing?

5:57 tomoj: interesting idea

5:58 I was thinking for-bindings like `x [y]` could implement let+-bindings like `x y`

5:58 (but seems problematic, even ignoring the performance implications..)

5:59 actually, no, not problematic?

5:59 dribnet: agreed. and equally ugly.

6:00 tomoj: that's really interesting though

6:00 I've imagined a for macro for reducers

6:01 dribnet: then again, your logic seems to depend on the :when coming before the let

6:01 tomoj: like (let [:when .. ...] ..) ?

6:02 in the r/for case, I think that corresponds to r/filter'ing, but you have nothing to filter

6:02 dribnet: i mean that even if you could join all your lets together

6:02 and then convert your if's to :whens

6:03 the whens would be after the let, which i don't think is what you want

6:04 tomoj: (if (= (count args) 2) (let [[target val] args :when (symbol? target) targetexpr (analyze-symbol ...) :when (:dynamic (:info target))] `(do ...)))

6:05 or I guess (let [[target val] args :when (= (count args) 2) ...])

6:06 dribnet: ah, ok.

6:07 tomoj: seems like my imagined let is `for` 'inside' (r/take 1)

6:07 not sure what I mean by "'inside'"

6:10 but there is probably a lens involving Maybe for the heads of lists

7:15 invis_: Hi everyone, guys could you help me a bit please

7:15 (doto (xy-plot Pow (first x))

7:15 (for [X x]

7:15 (add-lines Pow X)

7:15 )

7:15 view)

7:16 Why I have "Wrong number of args (5) passed to: core$for" here ?

7:17 tomoj: ,(macroexpand-1 '(doto x (for [y z] w)))

7:17 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$for>

7:18 tomoj: well, (doto x (for [y z] w)) is trying to do (for x [y z] w) which doesn't make sense

7:18 invis_: ohh

7:19 delihiro_: ,(doc doto)

7:19 clojurebot: "([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"

7:19 invis_: So how I can add lines to incanter xy-plot in loop ?

7:19 tomoj: the most straightforward way is (let [plot (xy-plot ...)] (doseq [X x] ...) plot)

7:20 invis_: thank you, will try

7:20 tomoj: for?

7:20 clojurebot: for is not used often enough.

7:21 tomoj: (doc clojurebot)

7:21 clojurebot: No entiendo

7:21 tomoj: (dec clojurebot)

7:21 lazybot: ⇒ 19

7:22 tomoj: I was hoping he'd say "for is not a loop"

7:24 bit strange what (def foo) complies to in cljs

7:24 compiles

7:24 seems just e.g. "cljs.user.foo;"

7:25 oh, I see, that makes sense

7:27 invis_: still cant :(

7:27 (doto (xy-plot Pow (first x))

7:27 (doseq [X (rest x)]

7:27 (add-lines Pow X))

7:27 view)

7:27 java.lang.IllegalArgumentException: doseq requires a vector for its binding

7:27 but alone (doseq [X (rest x)] (println X) works

7:38 ok, I did that :)

8:10 guys How I can return same result, that will print this expression ?

8:10 (doseq [P X A Avalue B Bvalue] (println (+ (* A (- 1 P) (* B P)))) )

8:10 algernon: (let [result (+ (* A (- 1 P) (* B P))))] (println result) result) inside the doseq

8:10 invis_: there redundant X in square brekets

8:11 thank you ! will try

8:13 logancampbell: does anyone know of an introduction to pedestal that I can get excited about? I've been reading their example code and listening to the announcement podcast and I'm not yet getting the point

8:14 __zero: I'm new to clojure, I'm going to explore a graph but I want to be able to explore each connecting node concurrently and for every child node for each node. I don't need to collect info from each node since every exploration will update an atom. Would futures be a correct approach to launch each thread?

8:14 invis_: to algernon: But doseq always return nil, so it doesnt depends what inside ;(

8:15 __zero: I don't know if what I said makes sense

8:20 michaelr525: hello

8:21 algernon: invis_: ah, right. perhaps a (doall (for [P X ...] (let ....))) -like thing then? for to construct a sequence, and doall to force realizing it (and still return it)

8:25 invis_: algernon: thanks, I already use map there

8:52 hmm, clojure process using 100% after my computation :(

8:52 can you tell me where I wrong please

8:52 (def Pmix

8:52 (map (fn [a b]

8:52 (for [X x]

8:52 (map (fn [P]

8:52 (+ (* a (- 1 P)) (* b P)))

8:52 X)))

8:52 Avalue Bvalue)

8:53 )

9:02 Guys can you help me with computing array size of 13*100, from another 3 arrays.

9:02 X is a array with size of 13*100, Avalue and Bvalue array too, but with size of 1*13

9:02 So all I need is array 13*100. For every Avalue and Bvalue compute 100 times (+ (* A[i] (- 1 X[i,j])) (* B[i] X[i, j]))). Can you help me to improve my looping ?

9:03 This is my Fn, but it eat 100% proc:

9:03 (def Pmix

9:03 (map (fn [a b]

9:03 (for [X x]

9:03 (map (fn [P]

9:03 (+ (* a (- 1 P)) (* b P)))

9:03 X)

9:03 )

9:03 )

9:03 Avalue Bvalue)

9:03 )

9:27 corecode: invis_: what's x?

9:28 pl6306: What clojure http library supports windows authentication? I know the java one does but I wanted to ask before I start digging.

9:30 invis_: corecode: X is array size 13*100

9:34 TimMc: invis_: Please use a pastebin, such as refheap.com, instead of pasting multiple lines into the channel.

9:43 asteve: do you recommend ring + compojure?

9:43 I want a very lightweight http service

10:15 TimMc: asteve: That's the most common service.

10:16 Wow, midje does *way* more "around" background nesting than I'd expect: https://gist.github.com/timmc/5301534

10:23 dobladez: $latest awtbot

10:23 lazybot: [awtbot "1.0.0"] -- https://clojars.org/awtbot

10:25 ejackson: Raynes: is there a to-xml equivalent of to-html for laser ?

10:26 hickory is obviously not thrilled about my xml tags on output :(

10:49 llambda: morning all. i have a question about functions and metadata: is it a bad/dangerous idea to create an api where a user might define functions and attach metadata to it (e.g. this could be done via a macro) which is later used to find and execute said functions?

10:52 hyPiRion: llambda: So you use the metadata to find the functions and execute them?

10:53 llambda: hyPiRion: yeah that's what i was thinking

10:54 i'm not really sure if that's a good way of doing things tho :)

10:54 gfredericks: how do you find functions based on the metadata of the functions you want to find?

10:54 hyPiRion: llambda: That's how `lein test` works: It looks for tags like ^:benchmark in the metadata of tests within test files.

10:54 llambda: looking in ns-publics

10:54 ah okay, cool

10:55 hyPiRion: But I'm not sure it's a good way to go in general though

10:55 llambda: probably isn't a completely horrible idea i guess then?

10:55 hyPiRion: You've got to think it through

10:55 Well, it depends on what you're trying to create obviously.

10:56 llambda: i'm registering route handlers for a ring app

10:56 i generalized the "route" logic into a macro and now have that macro tagging the "routes" with metadata

10:58 Sonderblade: where is the new location for indexed that previously existed in clojure.contrib.seq?

11:02 jweiss: is there some type i could use that is like a var, but anytime i refer to its symbol, i get the value, not the var itself (eg, a var but i have no access to the var itself, just its value). i could use a macro instead i suppose

11:30 gfredericks: jweiss: symbol-macrolet is probably the cleanest thing for that

11:36 lynaghk`: Is there a nice strategy for implementing method-missing-like resolution on a per-eval basis?

11:37 I.e., providing a root-value for a given var, if it is unbound or undefined in the current namespace

11:38 cemerick: lynaghk`: if it's a per-eval basis, then why do you need to touch the root value?

11:38 have any long-time Clojure devs recorded any screencasts while using vim-fireplace?

11:38 lynaghk`: cemerick: most of the time there won't be corresponding vars in the Clojure namespace system whatsoever

11:39 cemerick: ah

11:39 lynaghk`: Basically, I want to be able to run (my-fn 1 2 3) where the definition of my-fn is looked up via a system I provide.

11:39 cemerick: environments, in other words

11:39 no, no easy way

11:39 lynaghk`: yeah

11:39 nooooooooo

11:39 cemerick: That bridge was crossed a looong time ago

11:39 lynaghk`: that means I'll have to do it the hard way!

11:40 cemerick: yup

11:40 * cemerick waits for it ;-)

11:41 muhoo: protocols?

11:41 clojurebot: protocols is http://clojure.org/protocols

11:41 lynaghk`: cemerick: I've already tried doing a postwalk-replace to substitute in fn values, but I can't eval the resulting form

11:42 cemerick: e.g., (eval (list + 1 (constantly 2))) throws a "no ctor found"

11:44 cemerick: well, yeah

11:44 lynaghk`: I thought you were trying to wildcard vars?

11:45 i.e. if you had a var that contained the function (constantly 2), (eval (list '+ 1 that-var)) wouldn't work either

11:45 lynaghk`: cemerick: yeah, the eval list thing is my first failed implementation at wildcarding "vars" via a postwalk-replace

11:46 cemerick: if the var in question has a value of 2, then shouldn't that be the value put into the list being eval'ed?

11:47 lynaghk`: cemerick: in that case, yeah. I'd like to resolve functions, though.

11:48 cemerick: lynaghk`: I don't think code-munging is a particularly viable approach to method-missing sorts of functionality, but if that's what you're doing, the expression that uses the missing var still needs to be correct. e.g. it'd be (+ 1 (the-var-name))

11:49 dsop: is there some kind of short for mfor (assoc map :k (f (:k map))?

11:50 hyPiRion: dsop: update-in

11:50 dsop: hyPiRion: ah thx

11:50 raek: (update-in map [:k] f)

11:50 hyPiRion: ,(update-in {:k :ten} [:k] name)

11:50 clojurebot: {:k "ten"}

12:06 no7hing: anybody using environ?

12:06 https://github.com/weavejester/environ

12:06 it doesn't pick up my project local .lein-env file

12:12 mpenet: I do. It's a file generated by lein-env isn't it?

12:12 by environ I mean

12:12 I bet you can just delete it, and it will be regenerated if it's corrupted somehow

12:14 lazybot: All hail our overlord rhickey.

12:15 no7hing: @mpenet i'am just using environ itself, not the lein plugin

12:16 environ doesn't create the .lein-env, and as far as i've understood it it's the project local file?

12:17 mpenet: no7hing: I think it does: https://github.com/weavejester/environ/blob/master/lein-environ/src/lein_environ/plugin.clj#L10

12:17 hyPiRion: that's the plugin though

12:17 mpenet: but I never had to dig into how it work

12:17 it just did work flawlessly

12:17 right

12:18 no7hing: maybe then i'll have to use the plugin and add the config to the project.clj

12:25 mpenet: does elastish uses the native transport by default now?

12:25 it's not mentionned in the docs

12:27 nevermind, I got my answer

12:29 no7hing: @mpenet are you using keys in your profiles.clj to override/mock env vars during development?

12:29 mpenet: no7hing: yes

12:30 no7hing: under {:user {:env ...}}

12:30 no7hing: i wanted to avoid that and have them in the project.clj but that didn't work

12:30 mpenet: I don't do that

12:31 I don't think I ever tried it either

12:31 no7hing: thanks either way

12:32 mpenet: did you add the plugin in your profile?

12:33 well I bet you did, it's stated on the readme

12:36 no7hing: i did in a second step but i added the values to {:user {:env ..}}

12:38 well, once you do it right, it works

12:39 mpenet: :)

12:43 corecode: hyPiRion: you were part of igor?

12:53 tieTYT: is this a hack or idiomatic: (let [x (or a b)] ...

12:53 amalloy: tieTYT: is it a hack to use the or macro?

12:53 hyPiRion: corecode: oh, no, I was part of a newer project

12:54 I'm not that old (unfortunately)

12:54 tieTYT: no, but with that logic, if it can be used, it's not a hack

12:55 duncanm: tieTYT: it means what you say it means, right? how else would you express that?

12:56 tieTYT: if's

12:56 hyPiRion: I was part of 256 Shades of Gray (http://www.256shadesofgray.com), multi-core image processor

12:56 duncanm: tieTYT: in that case, i'd say using 'or' is more idiomatic

12:57 tieTYT: k thanks

12:57 corecode: hyPiRion: are these full time projects?

12:58 duncanm: (let [x (if a a (if b b false))] ...) ;; i guess that's the equivalent when not using 'or'

12:58 that's gross

12:58 tieTYT: ok

12:58 hyPiRion: corecode: Essentially yes. They are full-time from middle of August to middle of November

12:58 tieTYT: more like (if (not (nil? a)) a b)

12:59 corecode: hyPiRion: aaah

12:59 hyPiRion: nice.

12:59 hyPiRion: very nice.

13:00 tomoj: ,(macroexpand-1 '(or a b))

13:00 clojurebot: (clojure.core/let [or__3967__auto__ a] (if or__3967__auto__ or__3967__auto__ (clojure.core/or b)))

13:01 tomoj: &(clojure.walk/macroexpand-all '(or a b))

13:01 lazybot: ⇒ (let* [or__3824__auto__ a] (if or__3824__auto__ or__3824__auto__ b))

13:01 tomoj: (if a a b) ?

13:01 hyPiRion: corecode: It's absolutely worth it if you have interest in such a thing at your university.

13:02 corecode: hyPiRion: hahah

13:02 hyPiRion: er, if you have such a thing at your university and you're interested in those kind of things, it's absolutely worth it. That's what I meant

13:02 corecode: hyPiRion: yea, no.

13:02 hyPiRion: hehe

13:02 corecode: people here don't do that

13:02 nobody is interested in doing interesting/new stuff

13:02 tomoj: if you wanted to explicate truthiness, you'd need (if (not (or (nil? a) (false? a))) a b), which would be a problem for an implementation of or :)

13:03 hyPiRion: corecode: that's a shame.

13:04 corecode: hyPiRion: it is.

13:04 hyPiRion: I'm doing this subsymbolic AI course which is so hard that we're sure that they forgot to mention that the course was designed for PhDs or something

13:05 It's fun, but it eats time

13:07 tomoj: https://www.refheap.com/paste/cb63f74e897dadbcd9d68b51d

13:07 interesting

13:07 def metadata is evaluated twice?

13:08 ah, http://dev.clojure.org/jira/browse/CLJ-1137

13:09 corecode: hyPiRion: PhDs are not more intelligent, do they know more about all subjects.

13:09 nor*

13:09 they know more about one subject.

13:09 in the end.

13:09 tomoj: hyPiRion: very cool

13:10 corecode: i have the feeling clj might be too big to be implemented in a 4KB virtual machine

13:10 which is sad.

13:10 tomoj: so you could use that to implement a convolutional neural network I presume?

13:11 hyPiRion: corecode: yeah, it's hard in the sense that it requires a lot of understanding and a lot of research on optimal parameters

13:14 tomoj: actually, we designed an evolving CTRNN last exercise, so yeah, that should be doable

13:15 And that was not just feed-forward, it was cyclic.

13:16 tomoj: is that something more than what the 'R' means?

13:18 hyPiRion: no

13:18 heh, redundant is redundant

13:19 tomoj: but yeah, very cool

13:19 I worry soon the state of the art will be out of my reach since it will require crazy custom hardware :(

13:19 muhoo: Department of Redundancy Department

13:22 tomoj: I don't think I ever noticed you could set a validator on a var

13:23 kind of cool

13:25 tyler_: https://github.com/bbatsov/clojure-style-guide seems to conflict

13:25 says 2 spaces per indentation level

13:25 then says vertically align function arguments

13:25 isn't everythign a functio agument in lisp?

13:25 function*

13:25 * tyler_ can't type today

13:26 tomoj: no

13:26 there are also macros

13:26 and special forms

13:27 tyler_: but i mean from the editor perspective macros are the same as functions for all intents and purposes

13:27 visualy

13:27 tomoj: not if you follow that style guide

13:27 tyler_: which is what the style guide is for

13:27 ah

13:27 ok

13:27 tomoj: but it can't really explain what it means

13:28 technomancy: tyler_: typically the editor hard-codes built-in macros into a list

13:28 tomoj: since the rules about whether to use first-arg indentation or 2-spaces are.. problematic

13:28 tyler_: yeah i kinda arbitrarially pick which one im gonna use

13:29 whatever looks best to my eye is how i usually roll heh

13:29 tomoj: at least (exactly??) one person says we should just always use two spaces

13:30 ..I probably shouldn't have said that :(

13:30 tyler_: who is that one person?

13:31 tomoj: chas

13:34 tyler_: i was making it so everything was veritcally aligned, but that looked odd heh

13:49 technomancy: tyler_: at least with emacs naming your macro "with-*" will make it indent correctly =)

13:49 slime has ways to be clever beyond that, but code that indents differently depending on whether your slime connection is active or not is kind asketchy

13:49 kinda sketchy

13:50 borkdude: today I spend two hours with a student configuring his emacs, recommend him technomancy starter-kit ;)

13:51 hmm, my spelling is horrible today

13:53 tyler_: emacs is cool...

13:54 i don't use it though

13:54 heh

13:54 technomancy: emacs isn't really omkase

13:54 it's just an illusion

13:54 * tyler_ googles omkase

13:54 lynaghk: cemerick: did you see this? http://source.mozillaopennews.org/en-US/articles/introducing-tabula/

13:57 tomoj: hmm, rather than try to base indentation on runtime var inspection, maybe we just define a standard indent.clj data format?

13:57 then maybe provide a tool for generating it from runtime var meta

13:58 cemerick: lynaghk: yup

13:58 lynaghk: cemerick: just checking, I know how you love the pdfs = )

13:58 cemerick: lynaghk: they make me all warm and fuzzy.

13:58 My life's work, etc. :-|

13:59 pepijndevos: cemerick: but they also opensourced your income, right?

13:59 cemerick: pepijndevos: who, the tabula people? Nah.

14:00 lynaghk: I'm still shopping around for a way to jack into Clojure's var resolution system. Is there an eval-defined-in-Clojure floating around anywhere?

14:01 pepijndevos: cemerick: I thought you sold this textpdfstream thing

14:01 cemerick: pepijndevos: still do. http://snowtide.com

14:02 bbloom: lynaghk: what are you trying to do?

14:02 Raynes: ejackson: There is not, I'm afraid.

14:02 ejackson: If you're up to the task, you could add a to-xml version of to-html in my hickory fork https://github.com/Raynes/hickory

14:02 lynaghk: bbloom: provide my own var-resolution system, orthogonal to Clojure's namespace system.

14:02 S11001001: lynaghk: a proper namespace may be enumerated.

14:02 lynaghk: S11001001: there's nothing proper about what I want to do =)

14:02 bbloom: lynaghk: have you looked at my backtick library?

14:03 technomancy: Raynes: good job overcoming the temptation to call your lib "rich hickory".

14:03 Raynes: technomancy: It isn't my lib. Just a fork.

14:03 technomancy: you are to be commended

14:03 bbloom: lynaghk: https://github.com/brandonbloom/backtick can do quasiquote with custom symbol resolution

14:03 technomancy: Raynes: no, I mean laser

14:03 devinus: anybody know if there's any chance in hell datomic would ever be open sourced?

14:03 Raynes: lol

14:03 bbloom: lynaghk: i think eval is the wrong layer to do this at. you want to do it at macroexpand probably

14:03 depends on your use case tho

14:03 lynaghk: bbloom: ah, yeah! I totally forgot about that lib, it looks promising. thanks.

14:04 bbloom: lynaghk: if it doesn't do exactly what you want, let me know & we'll see if we can work out a better solution

14:04 lynaghk: bbloom: thanks!

14:04 bbloom: lynaghk: it also implements clojure's var resolution manually, so you can get an idea for what's involved by looking at the source. it's pretty easy overall

14:05 lynaghk: bbloom: I'm basically looking for something like :method_missing

14:05 bbloom: lynaghk: dynamically at runtime?

14:05 lynaghk: bbloom: except on namespaces with vars rather than methods on object hierarchies

14:05 bbloom: yeah

14:05 Raynes: devinus: Very unlikely.

14:05 nDuff: devinus: No inside track -- but personally, I don't expect that to happen until it's lost its commercial value.

14:05 bbloom: lynaghk: hmm well i guess you can do it at macro expand, right?

14:05 lynaghk: bbloom: but Clojure's Compiler.java resolve is a static method, so I can't override without forking

14:05 bbloom: (as far as I'm aware)

14:06 nDuff: devinus: ...so, "ever" is a long time, but "within a time period that matters for making decisions today"? I'd be surprised. Very, very happily, but surprised.

14:06 lynaghk: bbloom: doing it at macroexpand time would be more restrictive, but that might not actually be a problem for what I'm trying to do.

14:06 squidz: What would be the most interesting video to impress my java friend

14:06 who only wants to programm java because of its job opportunities

14:07 nDuff: squidz: I'm not sure anyone who doesn't program for the love of it is salvageable.

14:07 bbloom: lynaghk: yeah, so you can likely use defquote and call resolve-symbol & double check the result. if that var doesn't exist, then you can generate it

14:07 nDuff: squidz: ...that said, for people who go for the big, mainstream thing on account of job opportunities, I'd point them at Phil Graham's essays.

14:07 bbloom: lynaghk: this is a full syntax quote replacement here: https://github.com/brandonbloom/backtick/blob/master/src/backtick.clj#L85-L101

14:08 Raynes: squidz: Anything with me in it, essentially.

14:08 squidz: nDuff: do you have a video? I think asking him to read will scare him off

14:08 Raynes: I'm pretty great.

14:08 bbloom: lynaghk: notice line 98, which is the part that gets you `foo converted to `user/foo if there is no foo

14:08 lynaghk: that's essentially "var-missing"

14:08 Raynes: Asking me to watch a video is likely to scare me off.

14:08 amalloy: squidz: an illiterate developer? probably best to just point him off a cliff and tell him there's a video on the other end

14:09 supersym: bbloom: I love reading his stuff :P

14:09 bbloom: supersym: ?

14:09 supersym: never heard of the man but I like his style of writing

14:09 Paul Graham?

14:10 bbloom: supersym: oh, i wasn't reading that part of the conversation & didn't know why you had addressed me

14:10 squidz: so what would be essentially the same as pointing off a cliff and letting him 'land in clojure'

14:10 supersym: sorry I was interfering + slow

14:10 n_b: Point him at the Enterprise FizzBuzz repo and let him know that's the type of environment he's likely to end up in by pigeonholing himself as a Java developer

14:12 squidz: so no video recommendations

14:13 bbloom: lynaghk: if that works for you, we can make a higher-order version of resolve-symbol that provides a var-missing callback

14:14 amalloy: squidz: maybe he'd like spongebob squarepants

14:14 tomoj: the way that would work is you do your own manual recursive macroexpansion, then run backtick on the result?

14:14 n_b: technomancy: What time do the Seajure meetings typically end at?

14:14 lynaghk: bbloom: yeah. I need to think a bit more about the exact problem I want to solve. I have one gnarly solution that walks forms and then defs gensym'd vars with the appropriate values, but I really don't like it.

14:15 technomancy: n_b: between 9 and 9:30 usually

14:15 lynaghk: bbloom: a macro that checks for unbound vars and provides locals would be preferrable

14:15 squidz: okay but seriously guys, I know its not the easiest convert, but I want to try to impress.

14:16 even if the wrong motives are there to begin with

14:16 bbloom: lynaghk: in theory, the resolve fn that you provide doesn't need to return a symbol. you could return a (fn ...) form

14:16 * technomancy has no idea how java developers think

14:16 lynaghk: bbloom: yes, exactly.

14:16 bbloom: lynaghk: give it a try, let me know how it goes :-)

14:17 trptcolin: squidz: search youtube for Clojure for Java Programmers Rich Hickey - 2 good videos there

14:17 lynaghk: bbloom: that was what I originally tried, actually---a postwalk that tried replacing things in the function position of lists with actual function values

14:17 bbloom: lynaghk: that's basically what my code does, but it's a direct port of the quasi quote code

14:17 lynaghk: bbloom: my macro-foo is weak, though.

14:18 tomoj: If I release a fork of clojure, am I allowed to use a *jure name? :)

14:18 technomancy: only if it's a joke =)

14:20 tomoj: ah, I was thinking that "clojurescript" or "pyclojure" would be disallowed

14:21 but it's just (?<!clo)jure

14:21 trptcolin: jurekidding

14:33 ravster1: in a post-walk, what do they mean by "post-order traversal of form"?

14:34 TimMc: ravster1: https://en.wikipedia.org/wiki/Tree_traversal

14:35 tomoj: &(let [a (atom [])] (clojure.walk/postwalk #(swap! a conj %) '(+ a (- b c))) @a)

14:35 lazybot: ⇒ [+ a - b c ([+ a -] [+ a - b] [+ a - b c]) ([+] [+ a] [+ a - b c ([+ a -] [+ a - b] [+ a - b c])])]

14:35 tomoj: heh

14:35 &(let [a (atom [])] (clojure.walk/postwalk #(do (swap! a conj %) %) '(+ a (- b c))) @a)

14:35 lazybot: ⇒ [+ a - b c (- b c) (+ a (- b c))]

14:36 tomoj: &(let [a (atom [])] (clojure.walk/prewalk #(do (swap! a conj %) %) '(+ a (- b c))) @a)

14:36 lazybot: ⇒ [(+ a (- b c)) + a (- b c) - b c]

14:39 ppppaul: can someone point me to examples of testing datomic queries without a db/mem:db. thank you

14:40 ravster1: TimMc: thanks for the link, that explained it.

14:40 tomoj: $google datomic collections

14:40 lazybot: [Datomic queries against Clojure collections] https://gist.github.com/2645453

14:49 tomoj: should we define a special case of equality for reducers, like for IPersistentCollection?

14:49 would be a weird thing for an IO reducer

14:49 I guess you just into [] if you want to check equality

14:55 cemerick: OT any vim+iterm users want to help me out with a probably-trivial problem?

14:56 trptcolin: cemerick: sure

14:56 cemerick: thanks, will msg

14:59 Raynes: cemerick: First step is to use macvim.

14:59 I'm a heretic.

15:01 bbloom: mmm macvim

15:01 (booo new coretext renderer, btw)

15:02 dbushenko: why does leiningen not include resources into the uberwar when I issue 'lein ring uberwar' command?

15:06 technomancy: bug in lein-ring maybe?

15:07 dbushenko: trying older version...

15:08 cemerick: Raynes: The problem with that is that vim-dispatch (or anything like it) wants e.g. tmux

15:08 ravster1: hey all, I'm having trouble making a walk that expands a datomic entity, I think its failing on the :db/id key, but can't figure out why. https://gist.github.com/ravster/5304309

15:09 cemerick: (macvim also seems to not play well with saving session files reliably)

15:09 ravster1: the entity->map function in the gist just returns a regular map.

15:13 tomoj: you need to convert nested entities to maps as well

15:13 n_b: cemerick: doesn't vim-dispatch have an iterm adaptor?

15:14 tomoj: I suspect the problem is that it's trying to walk ref'd entities, and entities can't be walked

15:14 cemerick: n_b: yup, thus my attempting to use vim in iterm, though it's making my eyes bleed with a colorscheme problem atm

15:14 tomoj: oh

15:14 n_b: ohh. I think I had the same problem. Let me see if I recorded what I did to fix it

15:15 q

15:15 tomoj: well the db/id should be a long, not a DbId (tempid), so no problem there I'd think

15:15 ravster1: tomoj, yeah, right? I'm not going crazy.

15:15 right ..... ? :o

15:16 tomoj: (if (instance? datomic.Entity form) (entity->map form) ...) ?

15:17 ravster1: hmm, instance? didn't think of that one

15:18 oh wow, I think that might just have worked. Will do a nrepl-restart to be sure.

15:18 SegFaultAX: cemerick: Did you set t_Co?

15:19 cemerick: :help terminal-options for details

15:19 cemerick: SegFaultAX: yes, though it's set properly already. The issue isn't that I have no colors, it's that I'm getting the wrong colors (e.g. http://superuser.com/questions/545167/vim-iterm2-color-issues)

15:21 SegFaultAX: cemerick: Ah, t_Co is set in that answer. Maybe pop over to #vim for more help?

15:21 cemerick: SegFaultAX: already did :-(

15:22 tomoj: &(keyword (Object.))

15:22 lazybot: ⇒ nil

15:23 SegFaultAX: cemerick: I've had lots of colorscheme issues in the past as well. I use different schemes now in term vs. mvim/gvim.

15:23 hyPiRion: ,(keyword nil)

15:23 clojurebot: nil

15:24 n_b: Colorschemes are actually preferable to trying to get vi properly setting the window title :P

15:24 q

15:27 tyler_: where can i read more docs on how (defn foo [:keys sasdasdad]) works

15:28 tomoj: holy crap

15:28 SegFaultAX: tyler_: What do you want to know about?

15:28 tomoj: &(map realized? [(lazy-seq) (doto (lazy-seq) seq)])

15:28 lazybot: ⇒ (false true)

15:28 SegFaultAX: tyler_: The destructuring part or the defining functions part?

15:28 tyler_: SegFaultAX: what the :keys keyword does to the destructuring

15:28 SegFaultAX: tomoj: Why is that surprising?

15:28 tyler_: and how the mechanics of that works

15:28 SegFaultAX: tomoj: The very first thing seq does is realize the head of the seq.

15:28 tomoj: I didn't know there were IPending values

15:29 the surprising thing is that realized? works, I know how seqs work

15:31 SegFaultAX: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazySeq.java#L253

15:32 cemerick: SegFaultAX, n_b: Looks like I needed https://github.com/vim-scripts/CSApprox, thanks to trptcolin for the save :-)

15:33 n_b: ahh. Never would've occurred to me that someone would use GVim primarily and not have a term colorscheme

15:33 SegFaultAX: cemerick: I haven't seen that before. That's quite nifty.

15:33 I just resolved myself to using desert256 in term and molokai in gvim/mvim.

15:33 n_b: but (inc SegFaultAX) on the niftiness

15:34 SegFaultAX: n_b: Gotta do ##(inc n_b) for inline code.

15:34 lazybot: java.lang.RuntimeException: Unable to resolve symbol: n_b in this context

15:34 SegFaultAX: Oh wait, lazybot derps.

15:34 lynaghk: bbloom: if you want a mystery: https://gist.github.com/lynaghk/0a8a3dd71cc3c830f507

15:34 cemerick: n_b: the bizarre thing is that I'm not trying to use desert256, just desert

15:34 anyway...

15:34 SegFaultAX: cemerick: Really? Odd. Did you set it to dark?

15:36 bbloom: lynaghk: sorry, busy at the moment. can't dig into your mystery

15:37 lynaghk: bbloom: no worries.

15:38 cemerick: lynaghk: I see what's happening

15:38 someone else hit this a little while back, too

15:38 jonasen, actually, IIRC

15:39 lynaghk: cemerick: some kind of laziness issue?

15:39 cemerick: the compiler is producing a string to be read-evaled containing call to a nonexistent arity of the fn value

15:39 fn ctor, that is

15:40 lynaghk: https://github.com/jonase/kibit/issues/53

15:40 heh, I guess I hit it :-P

15:41 lynaghk: cemerick: ah. so my problem is that I used (fn [x] ...) rather than an anon function

15:41 cemerick: lynaghk: eliminate the doseq

15:41 no

15:41 Raynes: dbushenko: You asked about lib-noir last night. I do kinda sorta maintain it, but you're more likely to get a decent answer to your questions if you direct them at yogthos|away (when he isn't away :p).

15:42 lynaghk: cemerick: using #(* % %) fixes the issue.

15:42 cemerick: it's that the anon fn's ctor is expecting an argument containing the value of the lexical closure of idx

15:42 dbushenko: Raynes, oh well, I'm just looking for a convinient way to manage sessions

15:42 and lib-noir is perfect in that

15:42 cemerick: lynaghk: right; don't close over anything, and the fn's ctor is nullary

15:42 Raynes: Sure thing

15:42 dbushenko: so I wanted to ask for how long possible lib-noir will be supported :-)

15:42 Raynes: dbushenko: Oh yes, it isn't going anywhere.

15:43 dbushenko: I mean the compatibility with new versions of Clojure and other libs

15:43 Raynes: It's got both me and yogthos|away behind it. If he abandoned it I'd keep maintaining it myself.

15:43 I'll personally keep it up-to-date with other libraries.

15:43 lynaghk: cemerick: hmm. so the ((resolve db :square) 2) works because it's going through a different mechanism than evalin' the list?

15:43 Raynes: You don't have to worry about that.

15:43 cemerick: lynaghk: definitely a compiler bug

15:43 dbushenko: great! this is just great! thanks!

15:44 lynaghk: cemerick: okay. subtle as hell. thanks for figuring this out!

15:45 cemerick: lynaghk: quite. np, I'm just stacking chips for when I ship you my diagrams ;-P

15:45 lynaghk: = )

15:47 ispolin: for datomic, is there a good way to check if datomic transactor is responsive and restart the process if it's not? (in my particular case it's because hornetq is dying)

15:49 hiredman: ispolin: have you mentioned that on the datomic group? I seem to recall some people having problems with hornetq a few releases back, are you on a recent release?

15:51 ispolin: https://groups.google.com/forum/?fromgroups=#!searchin/datomic/hornetq/datomic/FT94dk6YEGk/x7bfqI-bqlwJ

15:54 ispolin: hiredman: thanks, this may be similar to my issue. I'll try the new version. I actually did post mine to datomic group a while ago: https://groups.google.com/forum/?fromgroups=#!topic/datomic/J2bt9hP5h64

16:06 jweiss: if my program reads in some data from config files at startup, and i want to access some of that data directly using a symbol, is there a good technique for this? (i could declare a symbol and then def it inside my initialization function). I also looked at tools.macro but seems a little heavyweight for something that will be nil at startup and then change once.

16:12 Raynes: How is laser not my most watched project yet? It has a bloody picture of a pew pew pew on the front. technomancy your picture isn't working.

16:17 callen: Raynes: I have it starred, but I don't watch repos often anymore.

16:17 it leads to compulsive "mark read"s

16:18 Raynes: I meant starred.

16:18 Watching sucks.

16:18 callen: Raynes: yes it does.

16:19 tyler_: whats SNAPSHOT mean in clojure parlance?

16:19 is that a java carryover?

16:20 nDuff: tyler_: It's carryover from Maven, which is a Java thing, yes.

16:21 tyler_: whats the difference between a snapshot and a not-snapshot

16:21 nDuff: tyler_: basically, a SNAPSHOT is a build on a tree which hasn't been released yet.

16:21 tyler_: ah

16:21 so like pre-release release

16:21 nDuff: Yup.

16:23 joegallo: tyler_: generally, a non-snapshot release is an exact thing, and it doesn't change over time. a snapshot could be different stuff from day to day, like a nightly build, for instance.

16:23 tyler_: ah

16:24 releases are immutable, snapshots are mutable

16:24 gotcha

16:24 joegallo: i'm sure i'm technically wrong in 19 ways on that, but it's a nice way to think of things.

16:24 tyler_: at least in a philosophical sense

16:37 technomancy: Raynes: I did my part

16:38 actually I only watch repos

16:38 I don't think I've ever starred anything on purpose

16:39 callen: technomancy: so you just ignore the blue dot?

16:40 technomancy: there's a blue dot?

16:40 oh geez; that thing?

16:40 yeah, of course; it's useless. I only pay attention to email, which I can actually filter properly.

16:41 it's like a crappy version of an inbox, isn't it?

16:42 callen: technomancy: I hates it :(

16:42 It's useful but it makes me OCD about keeping it cleared.

16:47 technomancy: user css

16:51 Rich_Morin: https://github.com/swannodette/textmate-clojure seems pretty inactive. Which fork (if any) is current, stable, etc?

16:51 Raynes: None.

16:51 All of them are terrible.

16:52 Unless something has changed in the past 2 months or so.

16:52 Rich_Morin: I was afraid of that.

16:52 Raynes: Textmate and editors that use their bundles just don't have very good support for Clojure. It's probably the biggest gap in the Clojure ecosystem as far as editors go right now.

17:03 vickaita: In ClojureScript, what is the best way to convert a LazySeq to a JavaScript Array? I have been using (apply array (range 10)), but was wondering if there is a better method.

17:04 lynaghk: vickaita: you can use (clj->js (range 10))

17:04 technomancy: Raynes: I prefer to think of it as the biggest gap in programmer skills

17:05 vickaita: lynaghk: thank you

17:07 callen: technomancy: I should reskin Emacs and charge $99 for it. Maybe then programmers will think it's good.

17:08 n_b: vickaita: into would be more idiomatic, I think.

17:11 technomancy: callen: looks like the emacs redirect of http://textmate2.com expired =(

17:11 borkdude: introduction into clojure for those who speak Dutch or want to learn Dutch: http://michielborkent.nl/courses/ap/clojure/dictaat.html

17:14 n_b: As did people's interest in TM2, it seems

17:15 seems the bulk switched to ST(2|3)

17:15 * n_b still needs to swap from vimclojure to vim-fireplace

17:24 vickaita: n_b: into doesnt seem to work. I see that there is an into-array function, is that what you meant?

17:30 callen: technomancy: hahahaha :)

17:31 such a pity.

17:33 yedi: is it a code smell when you see aggregate data structures (lists, maps) being used as keys to maps

17:35 callen: yedi: yikes

17:35 AimHere: I can think of cases where that's appropriate

17:35 S11001001: sounds fine

17:36 ToBeReplaced: i do that plenty with records (ie anything where there's a composite primary key)

17:37 AimHere: So the answer is: It might be, but we're all doing it

17:37 tbaldrid_: why would it be a code smell?

17:40 AimHere: Well it is the sort of perverse, insane thing you'd hardly ever see a C or Java or PHP programmer use. Perhaps yedi figures there's a good reason why he's not seen it before.

17:41 yedi: yea guys i have no idea either way, just wondering what the pros/cons were

17:41 tomoj: outside of a functional language, it's a lot harder to do

17:41 e.g. javascript >:[

17:41 I think the fact that it's basically impossible contributes to the fact that you hardly ever see it

17:42 AimHere: I wouldn't be surprised if it's easy to do in Javascript

17:42 tomoj: it's basically impossible

17:42 :P

17:42 technomancy: yedi: the only downside I can think of is that keywords are more convenient since they are functions

17:43 tomoj: I guess in java you could do it OK with immutable collections as the keys?

17:43 AimHere: The one loose worry I'd have is if your collections had the same elements, but that map figured they were different

17:44 Multiple versions of equality tend to give me the heebie jeebies

17:44 tomoj: s/one loose worry/huge gaping hole/

17:44 L

17:44 ?

17:44 technomancy: AimHere: clojure *generally* gets hashing right

17:44 except for numerics sometimes

17:44 but for something that's completely under Clojure's control like collections you shouldn't have any crazy behaviour

17:45 AimHere: It's not so much the hashing as if your list of [1,2,3] and [1,foo,3] were considered different, even when foo=2

17:45 technomancy: no, that's impossible

17:45 actually I take that back

17:45 it could be possible if 2 were an Integer and foo were a Long

17:45 I'm a bit fuzzy on that; I feel like it keeps changing

17:46 amalloy: technomancy: it does keep changing. but in 1.4 it stopped being stupid, more or less

17:46 technomancy: amalloy: meaning RT/equiv does the right thing and calling the java methods directly exposes the required brokenness?

17:46 amalloy: int 2 and long 2 behave the same in every way i can think of (aside from the obvious ones)

17:46 yeah

17:46 hyPiRion: It's much better than e.g. in 1.2

17:46 technomancy: sweet

17:46 callen: why are numbers in Clojure defaulted to longs?

17:47 amalloy: hyPiRion: it was okay in 1.2, though not perfect; 1.3 is the only version where it was really atrocious

17:47 technomancy: yeah, one more reason to drop support for 1.3

17:47 callen: what happened in 1.3?

17:48 technomancy: bad things. best not to talk about it.

17:48 Raynes: Nuclear war.

17:48 technomancy: pretend it never happened, like Leisure Suit Larry 4

17:48 Raynes: technomancy: Or any of those, for that matter.

17:48 hyPiRion: amalloy: well, I had the issue where e.g. (contains? #{2} (denominator 1/2)) failed me

17:48 callen: I'm legitimately trying to learn here

17:48 please humor me.

17:49 hyPiRion: Since both longs and bigints were printed in the same way, you had no idea why that failed

17:49 Dirklectisch: n_b: I'm actually still interested

17:49 technomancy: callen: integers and longs hashed differently, so you could have two equal map keys

17:49 I think there was more to it than that, but that's the bit that I recall best.

17:50 callen: note that the java.util.Map interface *requires* said broken behaviour

17:50 callen: ow.

17:50 Dirklectisch: n_b: in TM2 that is. I'm working on an update for the bundle so that it works with nrepl etc.

17:50 technomancy: but I think in 1.4 the broken behaviour is only exposed if you go through java methods; using clojure functions gives you the right answer

17:50 hyPiRion: callen: look at this beauty: user=> (conj #{2} (denominator 1/2) (long 2)) -> #{2 2 2}

17:51 brehaut: ◎_◎

17:52 Dirklectisch: n_b: It might not get much attention, but TM2 is still in very active development.

17:52 callen: hyPiRion: aaaaaaaaaaaaaaaaaaagh

17:52 that is *hilarious*

17:53 technomancy: it was also the same release where contrib got asploded

17:53 hyPiRion: I wouldn't call it hilarious, more like infurating :p

17:53 tyler_: how do i import classes that have the same name from java but are from different libraries?

17:54 callen: contrib was turning into a pretty egregious "misc" bucket.

17:54 tyler_: without them conflicting

17:54 technomancy: callen: yeah it was terrible, but it was EOL'd without much warning

17:54 callen: I remember the gnashing of teeth

17:55 technomancy: and no technical reason why a liferaft 1.3-compatible release couldn't have been made

17:57 tyler_: does import have an :as directive?

17:59 aaelony: in emacs with clojure-jack-in, I used to be able to get rid of the debug window by pressing 0. What is the analog to that in nrepl ?

18:00 brehaut: q ?

18:00 blrm: aaelony: clojure-jack-in should be using nrepl. I can usually just q out of popups

18:01 aaelony: hitting q colorizes the stack trace...

18:01 I can go to the window then kill it, but there's likely a better way

18:02 I'm looking at https://github.com/clojure/tools.nrepl for info on shortcut keys, but not seeing it yet

18:02 dnolen: tyler_: don't think so

18:04 blrm: aaelony: i might be misunderstanding. is this a debug window that popped up from evaluating a form/buffer/something? or are you actually in a buffer with the nrepl prompt?

18:06 aaelony: blrm: after evaluating a form that leads to a stacktrace, I just want to quickly close the stack trace window (once I've seen it)

18:06 Willyfrog: C-x k?

18:07 not sure if it's quick enough for you :S

18:07 hyPiRion: C-x 0 is possibly better

18:07 aaelony: nope, have to C-x o then X-x k

18:07 C-x o then C-x k

18:07 hyPiRion: oh

18:08 C-x 1 then?

18:08 blrm: yeah

18:08 aaelony: before, I could just type 0 and be done

18:08 C-x 1 works

18:08 thanks… I liked 0 better though

18:10 hyPiRion: aaelony: There's probably a better way, but I haven't played that much around with it

18:10 (I never get exceptions, I always do thing correct at first attempt you see)

18:11 blrm: aaelony: what nrepl command are you using to eval the form? that can determine what kind of window the output is in

18:11 aaelony: hyPirRion: I've googled, looked at the link, where to look for more info?

18:11 blrm: aaelony: https://github.com/kingtim/nrepl.el

18:11 hyPiRion: (inc blrm)

18:11 lazybot: ⇒ 1

18:12 aaelony: ok, I need to learn to read *.el files then ;)

18:13 blrm: I'm just going to the end of the form and executing, i.e. C-x C-e

18:14 blrm: nrepl.el is what I needed, thanks.

18:15 blrm: aaelony: C-c C-p at beginning of the form might be more like what you want. you can 'q' out of its output window

18:15 aaelony: np!

18:15 aaelony: cool

18:16 C-c Cp-p is quite nice

18:16 C-c C-p is quite nice

18:20 no7hing: any idea what i'm doing wrong if i get "No such var: sql/execute!" on using the fun in clojure.java.jdbc?

18:21 other functions work just fine

18:22 seancorfield: are you pulling in the snapshot or version 0.2.3?

18:22 no7hing: 0.2.3

18:23 seancorfield: execute! is part of the new API coming in what will be 0.3.0 (currently 0.2.4-SNAPSHOT)

18:23 technomancy: seancorfield: how's that coming along?

18:23 seancorfield: so for now you need (with-connection ... (with-query-results ... )) if memory serves

18:23 technomancy: looking forward to being able to escape the shackles of dynamic scope

18:24 no7hing: today is not my day; was pulling in the correct version but looking into the master code

18:24 seancorfield: technomancy: i've been swamped at work so c.j.j has taken a back seat temporarily

18:24 no7hing: thanks

18:24 cemerick: tpope: I'd love to get in on the synergize-ing business you mention in the vim-foreplay readme. Do you want email, irc chat, other?

18:24 pbostrom: speaking of nrepl.el, how do most people fix M-TAB (symbol completion) bringing up your window manager's task switcher (i.e. Alt-Tab)? I edited nrepl.el to map it to C-tab, which works for me, but I figure there's a way to do this in my init.el file, or perhaps there's a better workaround

18:24 seancorfield: i really hoped to get an alpha out by clojure/west :(

18:24 technomancy: seancorfield: it happens

18:26 seancorfield: i ran across the google chrome plugin for Edit with Emacs today... that's still making me smile... writing facebook status updates in emacs... :)

18:28 technomancy: pbostrom: switch to xmonad =)

18:28 seriously though, you can do something like this: (eval-after-load 'nrepl '(define-key (kbd "C-TAB") 'nrepl-complete))

18:28 although C-TAB won't work in a terminal since tab is technically control-i

18:31 pbostrom: technomancy: thanks, I have considered xmonad, maybe some day

18:32 Bronsa: or stumpwm :)

18:34 hyPiRion: xmonad is the thing

18:35 technomancy: xmonad is the first exception I've found to my "if it doesn't have a repl I will completely hate using it" rule

18:35 also the only software I use written in Haskell; probably not a coincidence

18:39 squidz: xmonad is awesome - no pun intended

18:39 brehaut: technomancy: any yet, it'd probably be even cooler if it had a ghci repl

18:39 hyPiRion: technomancy: as in, "Haskell is the only thing without a repl I'd use"?

18:39 tomoj: funny how M-q seems so amazing when I'm used to a repl

18:39 Mod-q I mean

18:40 hyPiRion: Mod? You mean super?

18:40 technomancy: brehaut: this way I have an excuse to put off learning haskell though

18:40 brehaut: lol

18:40 technomancy: its just ocaml but not

18:40 SegFaultAX: n_b: Ping.

18:40 technomancy: brehaut: but but whitespace augh

18:40 brehaut: technomancy: optional

18:41 technomancy: and layout is way way cooler than python or coffeescript whitespace

18:41 technomancy: hyPiRion: "haskell is the only way to write programs that are good enough to avoid filling people with rage despite their lack of a repl" maybe?

18:41 SegFaultAX: Also, typeclasses!

18:41 hyPiRion: technomancy: right, gotcha

18:42 technomancy: brehaut: does it fall into the trap of "these two pieces of code look the same but since one of them uses spaces and one uses tabs they are secretly different"?

18:42 genuine question

18:42 hyPiRion: brehaut: cooler? "Oh, it has 2 spaces less here, and 2 spaces more here"

18:42 Or is it more than it than that

18:42 SegFaultAX: technomancy: No, not really.

18:42 technomancy: whitespace sensitivity could only only sane if it's a syntax error to mix spaces and tabs

18:43 seems obvious to me, but people still screw it up =\

18:43 brehaut: technomancy: in anycase, you can just use braces and semis anywhere you would use layout

18:43 technomancy: brehaut: and you can write lisp code with parens on their own line too, technically =)

18:43 brehaut: technomancy: yes, but its not a sin in haskell

18:43 its a feature

18:44 technomancy: ok, cool

18:44 hyPiRion: Well, I'd guess if you get through the typechecker and the other goodies within Haskell, then if it compiles it's proven to be working

18:44 technomancy: but you still have to read other peoples' code where invisible differences are possible

18:44 hyPiRion: So whitespaces doesn't matter really

18:44 SegFaultAX: hyPiRion: It's only proven to not have type errors. There could still be logical errors.

18:44 hyPiRion: SegFaultAX: psh ;(

18:45 You're killing my joke

18:46 SegFaultAX: hyPiRion: Is that a frowny winky face?

18:46 tomoj: maybe the user error is picking types that don't prove correctness, not writing a buggy program

18:46 SegFaultAX: How does that even work?

18:46 * SegFaultAX tries to frown and wink simultaneously.

18:47 hyPiRion: SegFaultAX: @:{D>

18:47 Smiling guy with turban, moustache and beard

18:47 SegFaultAX: That's what I got from that.

18:50 technomancy: Are you using xmonad full time?

18:51 technomancy: SegFaultAX: ayup

18:51 SegFaultAX: technomancy: Have you used any other tiling window managers before that or is it your first?

18:51 technomancy: I played around with cljs-in-gnome3 which I would probably be using if xmonad were not already perfect.

18:51 tyler_: xmonad is made by the enemy

18:51 heh

18:52 technomancy: SegFaultAX: I used to use devilspie with metacity to get tiling and used wmii years ago

18:52 brehaut: dons is not the enemy

18:52 not leveraging the work dons has done is the enemy

18:52 tyler_: i was speaking tongue-in-cheek about haskell

18:52 technomancy: briefly played with stump, but couldn't get it stable

18:52 SegFaultAX: technomancy: Awesome!

18:53 technomancy: SegFaultAX: no, haven't tried that one. =)

18:53 xmonad basically cured me of futzing around with my setup.

18:53 brehaut: tyler_: that hits a nerve; functional languages are all so niche that interlanguage conflict (even in jest) is a waste of effort

18:53 technomancy: which really just leaves me more time to futz around with emacs I guess

18:54 SegFaultAX: technomancy: Hah, yup. (vim in my case)

18:54 technomancy: heh; yeah good luck writing a WM on the JVM =)

18:54 tyler_: brehaut: it wasn't a personal attack, sorry

18:54 SegFaultAX: technomancy: Are you using xmonad proper or osxmonad or one of the other various ports?

18:54 brehaut: tyler_: i realise that

18:54 technomancy: SegFaultAX: whatever ships with debian

18:54 tyler_: it doesn't seem like it

18:54 technomancy: wheezy

18:54 my config file is like five lines

18:54 n_b: SegFaultAX: OSXmonad is so slow to respond it's unusable

18:55 SegFaultAX: n_b: That vim scheme you sent me earlier, do you know what font those screenshots were using?

18:56 n_b: Looks like Inconsalata_DZ to me

18:56 or some Consolas-lookalike

18:56 SegFaultAX: Is that different from stock inconsolata becuase that's what I use and it doesn't look exactly right.

18:56 I like it a lot, though. :)

18:57 seancorfield: I have an Emacs / Mac OS X / Python integration question - any Pythonistas here who use Emacs?

18:57 (I asked on #python but no one answered... I have not uyet joined #emacs to ask there...)

18:57 technomancy: the #emacs channel is pretty great

18:57 brehaut: seancorfield: i'm almost certain i cant help you, but yes

18:58 seancorfield: lol brehaut ... ok technomancy i can go join #emacs and ask there i guess

18:58 Willyfrog: I do use both, although I'm learning emacs, but ask, just in case

18:58 seancorfield: on mac os x, python 3 installs alongside the default python (2.7.1 on lion i believe)

18:58 n_b: ohh, the = is different. It's Envy Code SegFaultAX

18:59 seancorfield: and the default python mode in emacs starts py 2.7.1 when you do M-x run-python

18:59 n_b: all that caring about typography finally paying off~

18:59 seancorfield: i was hoping someone could tell me the magic sauce to invoke py 3 instead

18:59 SegFaultAX: n_b: Is that the name of the font or the editor?

19:00 S11001001: seancorfield: C-u M-x run-python

19:00 n_b: SegFaultAX: the font. IIRC there are a few variants, but I think it's this: http://damieng.com/blog/2008/05/26/envy-code-r-preview-7-coding-font-released

19:00 S11001001: seancorfield: note that a recent emacs has changes of the default python script run-python injects for py3 compatibility

19:00 SegFaultAX: n_b: Thanks! Also, thanks for the tip on the term-ready molokai!

19:00 n_b: cheers

19:01 seancorfield: S11001001: ah... ok... so if i have python3 on the path that emacs checks, it'll find it that way... nice

19:01 S11001001: seancorfield: more like when you use C-u you get to type the python command

19:01 seancorfield: the version when they fixed the magic script might have been 24.3 but not sure. Regardless you can remove the script by tickling the right elisp bits

19:02 seancorfield: nice S11001001 you rock! thank you!

19:02 S11001001: (this C-u convention applies to all REPLs based on comint I can think of, just for your future replin needs)

19:03 seancorfield: ta muchly!

19:05 tieTYT: anybody know why I get this error in counter clockwise when I use doc? CompilerException java.lang.RuntimeException: Unable to resolve symbol: doc in this context, compiling:(NO_SOURCE_PATH:1:1)

19:05 brehaut: its presumably not importing clojure.repl

19:05 SegFaultAX: tieTYT: Because clojure.repl hasn't been referred in that namespace probably.

19:05 brehaut: s/importing/referred/

19:06 tieTYT: i thought it gets that by defualt

19:06 let me see

19:06 brehaut: tieTYT: you can probably do some eclipse/ccw specific thing to get doc strings

19:06 Willyfrog: how do you go through a string character by character?

19:06 brehaut: tieTYT: no. lein repl gets it by default, and maybe the clojure basic repl too

19:07 tieTYT: i don't even see that. I see clojure.tools.nrepl

19:07 brehaut: ,(set "abc")

19:07 clojurebot: #{\a \b \c}

19:07 S11001001: Willyfrog: strings are seqable, so do like ordinary lists

19:07 brehaut: err seq not set

19:07 tieTYT: another thing I notice is that when I use lein, it seems to "disconnect" the CCW repl

19:07 brehaut: ,(do (require 'clojure.repl) (dir clojure.repl))

19:07 clojurebot: apropos\ndemunge\ndir\ndir-fn\ndoc\nfind-doc\npst\nroot-cause\nset-break-handler!\nsource\nsource-fn\nstack-element-str\nthread-stopper\n

19:07 Willyfrog: S11001001, if I try to use a filter on it, the whole string goes in

19:08 brehaut: ,(filter #{\a \b \c} "abcdef")

19:08 clojurebot: (\a \b \c)

19:08 antares_: tieTYT: it probably overwrites the file where lein repl stores nREPL server's port

19:08 tieTYT: ah

19:09 S11001001: Willyfrog: see brehaut's example

19:09 antares_: tieTYT: although that's just a guess, I am not a CCW user

19:09 Willyfrog: brehaut, hum, then I must be doing something else wrong, thanks!

19:09 :)

19:09 tieTYT: brehaut: that seems to be hanging for me

19:09 nm: CompilerException java.lang.RuntimeException: Unable to resolve symbol: dir in this context, compiling:(NO_SOURCE_PATH:1:29)

19:09 antares_: tieTYT: Emacs' nrepl.el can start multiple REPLs now, so there should be a way to avoid conflicts for CCW

19:09 tieTYT: i guess I don't need doc because I can just type in code and it tells me

19:10 brehaut: tieTYT: well dir is in clojure.repl as well i suspect

19:10 ,#'dir

19:10 clojurebot: #'clojure.repl/dir

19:10 SegFaultAX: brehaut: Yea you would need to clojure.repl/dir in your example

19:10 brehaut: ,#' is quite a fun incantation

19:10 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve var: is in this context, compiling:(NO_SOURCE_PATH:0:0)>

19:10 SegFaultAX: brehaut: Since you only required but did not refer.

19:10 ravster: how do I get a map nested in maps according to a what key-val it has?

19:11 brehaut: SegFaultAX: sure. i was mostly just showing that doc existed in clojure.repl and that it was a real namespace

19:11 ravster: I'm trying prewalk but its failing and returning nil

19:11 tieTYT: this worked: (do (require '[clojure.repl :refer :all]) (dir clojure.repl))

19:11 i'm kind of disappointed "use" is being deprecated because it's easy to use

19:11 SegFaultAX: tieTYT: You can use `use` instead of require, it will do both for you

19:11 tieTYT: i thought use was going away

19:11 SegFaultAX: It is?

19:12 tyler_: ?

19:12 brehaut: really? its super handy for repling about; its just not preferred for persistant code files

19:12 hyPiRion: You know, I have no idea how the reader works sometimes

19:12 ,^+'# #'+^

19:12 clojurebot: #'clojure.core/+

19:12 hyPiRion: Can someone, like explain that one.

19:13 brehaut: ,^+'#

19:13 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

19:13 brehaut: thats an impressive one hyPiRion

19:13 amalloy: ,#

19:13 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading character>

19:13 tieTYT: maybe i'm wrong

19:13 amalloy: ,# #'+

19:13 clojurebot: #<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>

19:13 SegFaultAX: I think the problem with that brehaut is that you're giving a hint but didn't tell it what you're hinting for.

19:14 brehaut: sure

19:14 SegFaultAX: tieTYT: Where did you hear that? I can't find anything in the changelog.

19:14 tieTYT: http://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html

19:14 update (4/18/2012): As of the 1.4.0 release, there's no longer a good reason to use use. Use require :refer instead. From the Clojure 1.4.0 changelog: "require can now take a :refer option. :refer takes a list of symbols to refer from the namespace or :all to bring in all public vars."

19:14 brehaut: tieTYT: no longer a reason to use use is not use is deprecated

19:14 SegFaultAX: tieTYT: Does that imply deprecation?

19:15 tieTYT: to me it did

19:15 since it's sticking around, I disagree with him. Use is more consise

19:15 concise

19:15 brehaut: tieTYT: his suggestion applies to in a source file

19:16 SegFaultAX: tieTYT: In the REPL it's still fine.

19:16 tieTYT: do you agree with that suggestion?

19:16 brehaut: yes

19:16 tieTYT: why?

19:16 clojurebot: Why is startup slow is busy compiling the `for` macroexpansion

19:16 brehaut: use require and refer for source code

19:16 Bronsa: ,(meta (read-string "^+'# #'+"))

19:16 clojurebot: {:tag +'#}

19:16 Bronsa: hyPiRion: ^

19:16 tieTYT: because it's like star imports in java to use use?

19:16 brehaut: tieTYT: because then theres only one form you have to use, not two kinda the same but different ones

19:17 SegFaultAX: Bronsa: There you have it.

19:17 brehaut: and bare use is a bad idea

19:17 :refer :all is also nasty

19:17 hyPiRion: Bronsa: Yeah, I figured the last hat was ignored by clojurebot for some reasong

19:17 SegFaultAX: tieTYT: In general you probably don't /really/ want to refer a whole other namespace.

19:17 (Except clojure.core probably)

19:18 tieTYT: ok

19:18 ravster: if I have (def foo {:a {:b 'c :d {:e 'f} :g {:e 'h}}) , how would I get out {:e 'f} only?

19:18 Bronsa: hyPiRion: yeah well, ##(read-string "^+'# #'+^")

19:18 lazybot: ⇒ (var +)

19:18 SegFaultAX: ravster: get-in

19:18 Bronsa: ^ belongs to the second thing to be read

19:18 read-string reads only an element

19:18 so the reader actually never sees ^ anyway

19:18 hyPiRion: Bronsa: Yeah, I figured as much. My repl broke down when I tried it there

19:19 SegFaultAX: ,(get-in {:a {:b 'c :d {:e 'f} :g {: 'h}} [:a :d])

19:19 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: :>

19:19 hyPiRion: I hoped I had found an anagram

19:19 SegFaultAX: ,(get-in {:a {:b 'c :d {:e 'f} :g {: 'h}}} [:a :d])

19:19 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: :>

19:19 ravster: oops (def foo {:a {:b 'c :d {:e 'f} :g {:e 'h}}})

19:19 SegFaultAX: oh, but I don't know where in the nest {:e 'f} is going to be.

19:20 It might be at that level or a level below

19:20 SegFaultAX: ravster: Ah. clojure.walk probably.

19:20 ravster: (prewalk #(if (= 'f (:e %)) % ) foo) -> nil

19:21 I think its failing because I don't have anything happening in the 'else' part

19:22 postwalk returns the same

19:26 Bronsa: hyPiRion: '+'#@#'+^+'# #'+^+'#@#'+'

19:29 tomoj: I don't think you want clojure.walk

19:29 seems you could do it with a stoppable walk, but clojure.walk doesn't have one handy..

19:29 though it lets you write one without much trouble

19:30 if there could be multiple nested maps you want, then it wouldn't be a stoppable walk either, what would it be?

19:30 hyPiRion: Bronsa: oh, palindrome

19:30 Bronsa: yeah

19:30 hyPiRion: I wanted something like an emoticon or something, but that seems hard

19:31 tomoj: you could filter a tree-seq?

19:31 hyPiRion: `[~,^]' looks like a good start, but it doesn't work :(

19:31 ravster: tomoj: heh, a stoppable walk would be great.

19:31 tree-seq?

19:32 tomoj: https://gist.github.com/tomjack/9f89e03eb42bef6ddeab

19:32 looks like I used reduced which is weird..

19:32 Bronsa: you can cheat and ##(let [◔ (fn [& _]) ◡ 1] (◔ ◡ ◔ ) )

19:32 lazybot: ⇒ nil

19:32 hyPiRion: Bronsa: yeah

19:33 ravster: tomoj: cool. thanks,

19:33 hyPiRion: ,(let [  + _  ]  )

19:33 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@74fae4>

19:33 Bronsa: heh

19:34 hyPiRion: hmm, actually, that one may help

19:34 no wait-

19:34 Bronsa: well

19:35 , /(`_`/)

19:35 clojurebot: #<core$_SLASH_ clojure.core$_SLASH_@9b328a>

19:35 tomoj: hmm

19:35 &(->> {:a {:b 'c :d {:e 'f} :g {:e 'h}}} (tree-seq map? vals) (filter #(and (map? %) (some '#{f} (vals %)))))

19:35 lazybot: ⇒ ({:e f})

19:35 hyPiRion: hah

19:35 tomoj: seems like it should be easier

19:35 ravster: huh, whats reduced? I don't see it in clojure.coore

19:36 *core

19:36 tomoj: &(:added (meta #'reduced))

19:36 lazybot: java.lang.RuntimeException: Unable to resolve var: reduced in this context

19:36 hyPiRion: ravster: it's a special word

19:36 tomoj: 1.5

19:36 ravster: oh, okay

19:36 hyPiRion: like try/catch

19:36 tomoj: reduced? no

19:36 it's just a function

19:37 ..and so is reduced?

19:37 hiredman: cemerick: I see interruptable eval requires #'clojure.tools.nrepl.middleware.pr-values/pr-values https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/middleware/interruptible_eval.clj#L199, is there no fancy nrepl dependency thing where I can kick pr-values out of the stack and use my own?

19:37 antares_: ravster: parts of clojure.core are not in clojure/core.clj, there are subdirectories and other files (e.g. protocols implementation lives there)

19:38 hyPiRion: tomoj: you're right, I stand corrected

19:43 hmm, there must be some palindrome programs out there

19:43 ,(#(identity %) #(% identity))

19:43 clojurebot: #<sandbox$eval37$fn__40 sandbox$eval37$fn__40@23eebe>

19:44 hyPiRion: That's almost a palindrome program

19:45 ,((identity identity) (identity identity))

19:45 clojurebot: #<core$identity clojure.core$identity@15eb79c>

19:45 hyPiRion: It's a bit boring though.

19:46 Bronsa: ,('+' (fn [nf] ' [fn] nf) '+')

19:46 clojurebot: +'

19:46 hyPiRion: hurray

19:47 Bronsa: or this ##('+' (fn [nf]' '[fn] nf) '+')

19:47 lazybot: ⇒ +'

19:47 TimMc: ,((comp comp) (comp comp))

19:47 clojurebot: #<core$comp clojure.core$comp@803ee7>

19:47 TimMc: ,(comp ((comp comp) (comp comp)) ((comp) comp comp))

19:47 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>

19:47 hyPiRion: I wonder if there's a palindrome program with a computed result

19:47 TimMc: ,((comp ((comp comp) (comp comp))) ((comp) comp comp))

19:47 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>

19:48 Bronsa: ,(((comp comp) ('+' (fn [nf]' '[fn] nf) '+') (comp comp)))

19:48 clojurebot: nil

19:49 TimMc: ,+,

19:49 clojurebot: #<core$_PLUS_ clojure.core$_PLUS_@136a302>

19:49 TimMc: booyah

19:49 Bronsa: that's cheating.

19:49 TimMc: :-P

19:50 Bronsa: oh wait

19:50 ,(((comp comp) ('+' (fn [nf]' '[fn] nf) '+') (comp comp)))

19:50 clojurebot: nil

19:50 Bronsa: fail paste

19:50 , (('+'# (fn [nf]' '[fn] nf) #'+'))

19:50 clojurebot: 0

19:51 hyPiRion: ,((apply set {inc 1}) ({inc 1} set apply))

19:51 clojurebot: nil

19:51 TimMc: ,((((comp comp) ((comp ((comp comp) (comp comp))) (((comp) comp) comp))))())

19:51 clojurebot: ()

19:51 hyPiRion: whoops, {1 inc} i meant

19:51 Bronsa: TimMc: nice try

19:52 TimMc: Bronsa: Oh, I'm just seeing if I can make "comp" lose all meaning. I think it has worked already.

19:52 Bronsa: hah

19:52 SegFaultAX: TimMc: You succeeded. That makes my brain hurt. :)

19:52 amalloy: TimMc: that reads like pacman sounds

19:57 hyPiRion: oh, sweet

19:57 ,(apply apply hash-map {1 2})

19:57 clojurebot: {1 2}

19:59 TimMc: (def identity (partial apply apply hash-map))

19:59 hyPiRion: ,((apply apply hash-map {reduce hash-map}) ({hash-map reduce} hash-map reduce))

19:59 clojurebot: #<core$hash_map clojure.core$hash_map@9759b6>

19:59 TimMc: * Nota Bene: Only works on hash-maps.

19:59 hyPiRion: heheh

19:59 corecode: what is going on?

20:00 TimMc: corecode: You don't want to know.

20:00 corecode: drunk functional programming?

20:00 technomancy: swearjure target practice

20:00 Derander: the best kind of functional programming

20:00 brehaut: worse: its completely lucid

20:00 hyPiRion: corecode: This is Swearjure's little baby brother, palindromejure

20:01 corecode: what are the rulses for palindromes?

20:01 rules*

20:01 same result backwards and forwards?

20:02 brehaut: next challenge: write a program that runs as clojure of factjor

20:02 s/of/or/

20:03 hyPiRion: corecode: Well, it's not exactly the same as palindromes, but trying to make it have the same components forwards as backwards

20:03 e.g. (foo bar bar foo)

20:03 corecode: and still work

20:04 or do something specific?

20:04 hyPiRion: yeah, still work

20:04 corecode: i see.

20:04 hyPiRion: well, it'd be neat if it did something fancy

20:04 corecode: oh :/

20:04 longest wins, i guess

20:04 ,(comment comment)

20:04 clojurebot: nil

20:05 corecode: expand at will.

20:05 i guess that's not quite the goal? :)

20:05 jballanc: ,((fn [x] (clojure.core/seq (clojure.core/concat (clojure.core/list (reverse x)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list x))))))) (quote ((clojure.core/seq (clojure.core/concat (clojure.core/list (reverse x)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list x)))))) [x] fn)))

20:05 clojurebot: ((fn [x] (clojure.core/seq (clojure.core/concat (clojure.core/list (reverse x)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list x))))))) (quote ((clojure.core/seq (clojure.core/concat (clojure.core/list (reverse x)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list x)))))) [x...

20:05 jballanc: daaaw...why are results elided?

20:05 boo

20:06 hyPiRion: jballanc: palindrome and quine?

20:06 jballanc: yup-ish

20:06 corecode: haha

20:06 nice.

20:06 hyPiRion: jballanc: that's amazing. Did you use some tricks by webyrd, or was it experimentation?

20:08 corecode: not quite a palindrome, is it?

20:08 amalloy: jballanc: use & instead of , to talk to lazybot; he doesn't truncate results

20:08 brehaut: its not a pallindrome if you want a symetrical sexp tree, but it is if you just go for symbols in the form

20:09 hyPiRion: oh, I was hoping for the same tree structure too

20:09 oh well

20:09 brehaut: i think

20:09 hyPiRion: maybe someday I'll learn the art of logic programming and create a palindrome quine

20:10 corecode: maybe frame it above your bed?

20:10 hyPiRion: Engrave on my toilet seat.

20:10 engraved*

20:15 Bronsa: ,(('*'# {'*'# (fn [nf & _]' '[_ & nf] nf) (fn [nf & _]' '[_ & fn] nf) #'*'} #'*') 2 ('*'# {'*'# (fn [nf & _]' '[_ & nf] nf) (fn [nf & _]' '[_ & fn] nf) #'*'} #'*'))

20:15 clojurebot: 2

20:26 Rich_Morin: Raynes: I'm having a problem loading the laser library. help? (http://pastie.org/7307269)

20:38 Rayne: It appears that hickory may have changed in an untoward manner.

20:40 jballanc: there's a simpler form of lisp/scheme quine that I just remember, and then you can work from that

20:40 ,((fn [x] (println (list x (list (quote quote) x)))) (quote (fn [x] (println (list x (list (quote quote) x))))))

20:40 clojurebot: ((fn [x] (println (list x (list (quote quote) x)))) (quote (fn [x] (println (list x (list (quote quote) x))))))\n

20:41 SegFaultAX: jballanc: That's a fairly well known quine, although it usually doesn't use println.

20:41 ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

20:41 clojurebot: ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))

20:42 jballanc: ah, right

20:44 lazybot is triggered off with "&" right?

20:44 &(println "Hello, world")

20:44 lazybot: ⇒ Hello, world nil

20:45 jballanc: so can clojurebot trigger lazybot?

20:45 Raynes: Rich_Morin: Hickory can't just 'change'. Laser uses my own fork and you don't have a top-level hickory dependency that would change my own.

20:45 Rich_Morin: It looks to me like you should probably run `lein clean` in your project and then restart whatever repls you have open.

20:46 jballanc: ,(println "&(println \"The robot apocalypse is nigh\")")

20:46 clojurebot: &(println "The robot apocalypse is nigh")\n

20:46 jballanc: daw :(

20:46 amalloy: MAYHEM DENIED

20:46 Raynes: Apparently the North Korean apocalypse is nigh.

20:46 amalloy: Raynes: you must be lost. #politics is over there

20:47 dpathakj: ,(print "&(println \"The robot apocalypse is nigh\")")

20:47 clojurebot: &(println "The robot apocalypse is nigh")

20:47 Rich_Morin: Raynes: I'm afraid that didn't help. Any other things to try?

20:47 dpathakj: Worth a try.

20:48 Raynes: Can you paste the output of `lein deps :tree`

20:49 Rich_Morin: Raynes: sure - http://pastie.org/7307454

20:50 Raynes: Rich_Morin: I see the problem.

20:50 jballanc: IIRC, clojurebot uses notices or some such...

20:51 Raynes: Because clj-http uses crouton instead of hickory because dakrone sucks, it has an older version of jsoup. Add an exclusion for jsoup on clj-http.

20:51 jballanc: or maybe it was privmsg

20:52 dakrone: Raynes: didn't realize that meant I sucked

20:52 Raynes: dakrone: You don't. You're awesome. <3

20:53 Rich_Morin: Raynes: Can you give me the syntax for that?

20:53 dakrone: and crouton uses the same jsoup version (1.7.1) that hickory does

20:53 Rich_Morin: (Google isn't helping)

20:53 Raynes: dakrone: Wrong hickory.

20:54 dakrone: My fork.

20:54 dakrone: ahh

20:54 Raynes: $google leiningen exclusions

20:54 lazybot: [leiningen/sample.project.clj at master · technomancy ... - GitHub] https://github.com/technomancy/leiningen/blob/master/sample.project.clj

20:54 Raynes: Rich_Morin: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L42

20:55 Rich_Morin: It looks like :dependencies [[clj-http :exclusions [org.jsoup/jsoup]]]

20:56 Rich_Morin: Raynes: tnx!

20:58 Raynes: dakrone: You don't have to change anything. This is what exclusions are for.

21:11 callen: yogthos: comrade! hello.

21:12 asteve: why would I use com. in clojure ns?

21:13 SegFaultAX: asteve: You mean like (ns com.foo.bar ...)?

21:13 asteve: yes

21:13 tyler_: anyone have an idea on how i can implement this interface? http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/handlers/AsyncHandler.html

21:13 im trying reify but not sure if the right route

21:14 SegFaultAX: asteve: Presumably because that's the style used in Javaland for creating packages.

21:16 ToxicFrog: asteve: Java convention is to use your hostname, reversed, as a fully qualified package name.

21:16 So e.g. Java libraries released by Google are all in the com.google.* namespace, and my stuff is all in ca.ancilla.*

21:17 asteve: ah!

21:17 thanks

21:19 tieTYT2: is there a way to write this more concisely? (if (= "" (str (class cookie-spec-factory))) nil (class cookie-spec-factory))

21:20 SegFaultAX: tyler_: Probably as you would any other interface.

21:20 tyler_: Because of type erasure I'm not sure it matters that the interface is generic. I could be dead wrong about that though.

21:22 ToxicFrog: tieTYT: it seems like there should be something you can do with if-let but I can't think of what.

21:24 metellus: tieTYT2: (when-let [foo (not-empty (class cookie-spec-factor))] foo)

21:24 or actually just (not-empty (class cookie-spec-factor))

21:24 ToxicFrog: I mean, there's (let [csf (class cookie-spec-factory)] (if (= "" (str csf)) nil csf))

21:24 oo

21:26 SegFaultAX: tieTYT2: Probably want (not-empty (str (class cookie-spec-factory)))

21:26 metellus: ,(class (class 2))

21:26 clojurebot: java.lang.Class

21:27 metellus: oh, yeah.

21:27 tieTYT2: ok but that still needs to be in an if right?

21:28 oh nm

21:28 awesome

21:28 thanks

21:28 SegFaultAX: tieTYT2: In what case would that thingy not have a class, though?

21:28 Does anything other than nil not have a class?

21:29 tieTYT2: your suggestion works for me

21:59 gfredericks: hyPiRion: I just thought of an elegant way to make a lazy seq of the natural numbers with their factorizations

22:00 maybe.

22:18 yedi: tomoj: "I think the fact that it's basically impossible contributes to the fact that you hardly ever see it"

22:18 good point

22:19 SegFaultAX: yedi: What was that in reference to? Because that's a pretty good quote.

22:20 supersym: the 'basically' really does it

22:25 yedi: i had asked: is it a code smell when you see aggregate data structures (lists, maps) being used as keys to maps

22:25 SegFaultAX: ^

22:26 gfredericks: yedi: sweet, I was just doing that

22:26 sets of primes as keys

22:26 I should just multiply them together :D

22:26 brehaut: bbloom: how often do you claim credit for bloom filters?

22:27 yedi: yea the more #clojurians talked about it, the more it just seems like it's because other languages don't offer such things natively

22:28 gfredericks: ruby and erlang do I think?

22:29 SegFaultAX: yedi: Why would that be a code smell?

22:29 yedi: yedi: yea guys i have no idea either way, just wondering what the pros/cons were

22:29 SegFaultAX: gfredericks: Sure. Ruby in particular doesn't enforce the hashability constraint for keys like Python does.

22:30 Ruby is happy to use strings, arrays, and hashes as keys.

22:30 gfredericks: Ruby is happy.

22:31 in the oblivious sort of way.

22:31 yedi: iin ruby, are the keywords functions?

22:31 gfredericks: nothing is a function

22:31 SegFaultAX: yedi: Naw, but it'd be easy to patch in.

22:31 yedi: that's that i guess

22:32 bbloom: brehaut: i basically invented those when i was negative 10 years old

22:32 brehaut: high five

22:32 thats good work

22:32 i dont think i achieved anything positive until i was at least +10

22:33 SegFaultAX: bbloom: Did you make sure to check when they were invented to accurately reflect your relative age? :)

22:33 bbloom: SegFaultAX: no

22:33 SegFaultAX: i made a number up

22:34 SegFaultAX: Hah, damn.

22:37 rationalrevolt: for a ring app that needs state maintained in the session - what is the recommended way to go about it? would it be to have a dynamic var and bing the session to it as some sort of ring handler?

22:37 brehaut: rationalrevolt: you know about the session middlewares?

22:38 SegFaultAX: rationalrevolt: There are multiple session backends. In memory is one, cookies are another.

22:38 brehaut: https://github.com/ring-clojure/ring/tree/master/ring-core/src/ring/middleware/session

22:38 rationalrevolt: in memory session storage probably shouldnt be used outside of dev time

22:38 https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj thats the top level api

22:40 rationalrevolt: i guess my question is if I wanted to update the session - then my response needs to include the :session key. But, if I want to incrementally update it in different places in my code - i wanted to avoid carrying around the state in every function call

22:42 xeqi: rationalrevolt: lib-noir has an implementation of stateful sessions https://github.com/noir-clojure/lib-noir/blob/master/src/noir/session.clj

22:43 I prefer the normal ring sessions, but some people like them

22:58 rationalrevolt: noir seems to use a dynamic var, are there other ways to approach this?

22:59 rebcabin_: re

23:02 brehaut: rationalrevolt: use a middleware that closes over an atom or ref

23:03 rationalrevolt: yup, thanks

23:18 ToxicFrog: How do I use map literals in a macro?

23:19 I mean, as I understand it, something like this should work: (defmacro foo [name contents] `(def ~name { ~@a }))

23:19 And then you can (foo bar [:a 1 :b 2]) to get (def bar { :a 1 :b 2 })

23:20 But it fails at the (defmacro) itself with "map literal must contain an even number of forms"

23:23 amalloy: ToxicFrog: (hash-map ~@a)

23:23 or, rather, i suppose, (apply hash-map a)

23:24 i guess ~(apply hash-map a) comes closest to the intended meaning

23:24 Derander: Hey, I'm trying to modify a clojure project that is on github locally. I have installed it with lein right now. I am not terribly familiar with the java/clojure build environment. Is there a standard way to reference a local git repo as a lein dependency?

23:24 ToxicFrog: Aha. Thanks.

23:25 Derander: this is what I used last time I had to depend directly on git: https://github.com/tobyhede/lein-git-deps

23:26 xeqi: Derander: nothing built in. The recommended way to work on two projects in parallel is checkouts

23:26 Derander: ToxicFrog: I will explore this

23:26 ToxicFrog: It'll take any git URL so you can :git-dependencies [[file://path/to/my/library/.git]]

23:26 Derander: xeqi: "checkouts" in the git sense? or something else?

23:26 ToxicFrog: There might be something better by now, though, that was ages ago

23:27 xeqi: Derander: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#checkout-dependencies

23:27 had to go find it

23:28 Derander: xeqi: ToxicFrog: lein checkouts seems like the way to go

23:28 thanks all!

23:36 devn: Anyone have a good resource that discusses Clojure's data structures compared to doing copy-on-write?

23:36 I found this: http://www.lispcast.com/3-things-java-can-steal-from-clojure

23:36 but I suspect there's something better out there.

23:49 xeqi: devn: http://blog.higher-order.net/2009/09/08/understanding-clojures-persistenthashmap-deftwice/ looks decent, but I don't know there is a direct comparison to cow

23:49 also http://www.youtube.com/watch?v=pNhBQJN44YQ from the conj 2012, which covers scala, but I think derives from the same initial papers as clojure's data structures and seem spplicable

23:49 * applicable

23:58 devn: i forgot about daniel's talk xeqi -- he's a great speaker

23:58 and i got a lot out of that talk

23:58 xeqi: thanks for the both of them

Logging service provided by n01se.net