#clojure logs

2013-04-03

00:02muhooyacin: ya
00:03RaynesI simply recommend you ignore anything I've ever written regarding it.
00:04muhoothe name says it all
00:05yacinhaha
00:14rationalrevoltis there a function that converts a map with string keys to a map with keyword keys in core?
00:14capcrunchhave anyone tested clojure on zos ?
00:14capcrunchit just core dumps the jvm
00:15`arrdemrationalrevolt: no, but there's always (keyword)
00:16`arrdem,(reduce (fn [m [skey v]] (assoc m (keyword skey) v)) {} {"foo" 1})
00:16clojurebot{:foo 1}
00:16`arrdemrationalrevolt: ^^
00:16rationalrevoltalright :)
00:16`arrdemcan haz karma? XD
00:17`arrdemah nvm.
00:21rationalrevolti was looking for something ready made, that will do this recursively
00:21`arrdemI mean...
00:21`arrdemimplementing the recursion case for that isn't hard.
00:21amalloyclojure.walk/keywordize-keys, but i recommend re-evaluating why you need it
00:23rationalrevolti'm trying to build on cheshire json/decode to give me keyword maps , since i don't like big destructuring forms
00:23amalloyso ask cheshire to give you back keywords
00:24amalloyasking for strings back and then converting them yourself is such a pain
00:24dakrone,(cheshire.core/decode "{\"foo\": \"bar\"}" true)
00:24clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: cheshire.core>
00:24dakronedrat
00:24dakroneanyway, that's how you do it
00:24dakrone,(require 'cheshire.core)
00:24clojurebot#<FileNotFoundException java.io.FileNotFoundException: Could not locate cheshire/core__init.class or cheshire/core.clj on classpath: >
00:25amalloydakrone: i get that true is available, but why? it's not nearly as readable as (decode s keyword), and no faster
00:26dakroneamalloy: because it was there before custom keyword functions, so cheshire supports either 'true' or a function
00:26dakronebackwards-compatibility
00:28rationalrevoltgot it, thanks amalloy
00:30dakroneone day I'll be able to drop 1.2 support from my libraries, and I will be very happy on that day
00:32amalloyi'm curious if you have any plan in place for when that day is, dakrone
00:34dakroneno plan yet, just looking forward
00:35amalloyi think we've dropped 1.2 support from the flatland projects by now
00:36amalloyof course yours get used more; i'm just providing a data point, not suggesting you do the same
00:37samedhiWhat is best practice for automatic testing with lein? Is it still lein-lazytest?
00:43tieTYT2why 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
00:43tieTYT2same with the .get
00:50yacinany recommendations for a cassandra client library? there are quite a few floating around out there
00:51tieTYT2ohh, so (.foo) is different from (. foo) in clojure?
00:51tieTYT2ah nm
00:52tieTYT2the former is expanded to the latter
01:08SegFaultAX,('foo {'foo 1})
01:08clojurebot1
01:08`arrdemok good I'm still alive.
01:09SegFaultAXInteresting. I didn't realize symbols, like keywords, were similar to keywords when called (eg they'll `get` themselves)
01:10SegFaultAXHeh, that was strangely phrased. Anyway.
01:21mjclazybot: coin
01:21lazybotmjc: Heads.
01:27arrdemlazybot: d20
01:41akhudektechnomancy: your post on parentheses was amazing, just saw it now
01:45SegFaultAXI hadn't seen it yet either. Well done. :)
01:49borkdudeI think the cornery style of XML fits Clochure nice: a match made in heaven
02:22pdmct,((list :a) 0)
02:22clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>
02:24pdmct,((list :a) 0)
02:24clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn>
02:35SegFaultAXpdmct: That doesn't make any sense, in case you're wondering.
02:36pdmctyes I know, I was seeing what the exception that was thrown by it ... found it in a JoC - which said it was wrong
02:36pdmcts/a//
03:52dbushenkohi all!
03:53dbushenkowhat do you guys use to manage sessions in a compojure application?
04:09astevedo you recommend ring + compojure?
04:53mpenetyacin: I would advise to use Alia, but I am biaised :)
04:54mpenetyacin: it just works and wraps a solid/recent library so it's a good choice
04:58dribneta little out of my element trying to get a tagged literal to work in the cljs compiler
04:59dribneti have it working in the cljs reader, but can't for the life of me hoist it out to the compiler
04:59tomojyou can't
04:59dribnetyou kind of can https://groups.google.com/forum/?fromgroups=#!topic/clojurescript/iFCDCZBPHSA
04:59tomojI mean, you can't just hoist it
04:59tomojyou have to write a different one
05:00dribnetaha, yes.
05:00dribnetin some clj code.
05:00tomojoh, but your problem is about how to modify *cljs-data-readers*?
05:00dribnethere's my clj test code
05:00dribnet(alter-var-root #'t/*cljs-data-readers* assoc "js" identity)
05:02dribnetthe cljs seems to compile with that, but using the tag in the src doesn't work
05:02dribnet("java.lang.RuntimeException: No reader function for tag...")
05:03dribnetperhaps as a warmup I should just edit the compiler code directly without trying all this slight of hand stuff in my project...
05:03tomojyou also did the :require-macros that herwig suggested?
05:04dribnetyoubetcha
05:04dribneti even have an empty macro in my file to make sure its being read in
05:05dribnetat that point it wasn't clear to me what voodoo i could do to further debug what's happening.
05:12dribnethi chas
05:13dribneti was just whining to tomoj about not being able to get my tagged literal to work in the cljs compiler
05:14tomojI can't get it to work either
05:14dribnetthx. i thought i was going crazy. :)
05:27bultersanyone here any experience with setting up a server for clojure apps?
05:27bultersI have a clean vps which I would like to use to experiment with clojure webapps
05:28bultersbut - coming from ruby-land - it's a bit unclear whether to use an app server like immutant or jetty...
05:32ebaxtbulters: Are you thinking about a simple webapp, or do you need infrastructure like message brokers etc?
05:49tomojit would be cool if let supported for's :when
05:49tomojI have (if .. (let .. (if .. (let .. (if ...)))))
05:49bultersebaxt: simple webapp, nothing fancy yet... currently working on some toy projects
05:51bultersby the time I need the fancy stuff I'll be a java app deployment expert ;-)
05:52arcatantomoj: maybe you could simplify it with if-let?
05:52tomojin this case, no
05:53tomoj:when would also fix the problem with multiple bindings in if-let
05:53tomojyou just say what you mean
05:53mpenetit's possible with the new -> macros isn't it?
05:53mpenetas-> and cond->
05:53tomojah, hmm
05:53tomojdidn't think to try them
05:54tomojhttps://www.refheap.com/paste/3b42d3250c566c3224300fa06
05:54tomojalready wrote it the ugly way, maybe I'll try them later
05:56dribnetcould you have twisted for to accomplish the same thing?
05:57tomojinteresting idea
05:58tomojI was thinking for-bindings like `x [y]` could implement let+-bindings like `x y`
05:58tomoj(but seems problematic, even ignoring the performance implications..)
05:59tomojactually, no, not problematic?
05:59dribnetagreed. and equally ugly.
06:00tomojthat's really interesting though
06:00tomojI've imagined a for macro for reducers
06:01dribnetthen again, your logic seems to depend on the :when coming before the let
06:01tomojlike (let [:when .. ...] ..) ?
06:02tomojin the r/for case, I think that corresponds to r/filter'ing, but you have nothing to filter
06:02dribneti mean that even if you could join all your lets together
06:02dribnetand then convert your if's to :whens
06:03dribnetthe whens would be after the let, which i don't think is what you want
06:04tomoj(if (= (count args) 2) (let [[target val] args :when (symbol? target) targetexpr (analyze-symbol ...) :when (:dynamic (:info target))] `(do ...)))
06:05tomojor I guess (let [[target val] args :when (= (count args) 2) ...])
06:06dribnetah, ok.
06:07tomojseems like my imagined let is `for` 'inside' (r/take 1)
06:07tomojnot sure what I mean by "'inside'"
06:10tomojbut there is probably a lens involving Maybe for the heads of lists
07:15invis_Hi everyone, guys could you help me a bit please
07:15invis_(doto (xy-plot Pow (first x))
07:15invis_ (for [X x]
07:15invis_ (add-lines Pow X)
07:15invis_ )
07:15invis_view)
07:16invis_Why I have "Wrong number of args (5) passed to: core$for" here ?
07:17tomoj,(macroexpand-1 '(doto x (for [y z] w)))
07:17clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$for>
07:18tomojwell, (doto x (for [y z] w)) is trying to do (for x [y z] w) which doesn't make sense
07:18invis_ohh
07:19delihiro_,(doc doto)
07:19clojurebot"([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))"
07:19invis_So how I can add lines to incanter xy-plot in loop ?
07:19tomojthe most straightforward way is (let [plot (xy-plot ...)] (doseq [X x] ...) plot)
07:20invis_thank you, will try
07:20tomojfor?
07:20clojurebotfor is not used often enough.
07:21tomoj(doc clojurebot)
07:21clojurebotNo entiendo
07:21tomoj(dec clojurebot)
07:21lazybot⇒ 19
07:22tomojI was hoping he'd say "for is not a loop"
07:24tomojbit strange what (def foo) complies to in cljs
07:24tomojcompiles
07:24tomojseems just e.g. "cljs.user.foo;"
07:25tomojoh, I see, that makes sense
07:27invis_still cant :(
07:27invis_(doto (xy-plot Pow (first x))
07:27invis_ (doseq [X (rest x)]
07:27invis_ (add-lines Pow X))
07:27invis_view)
07:27invis_java.lang.IllegalArgumentException: doseq requires a vector for its binding
07:27invis_but alone (doseq [X (rest x)] (println X) works
07:38invis_ok, I did that :)
08:10invis_guys How I can return same result, that will print this expression ?
08:10invis_(doseq [P X A Avalue B Bvalue] (println (+ (* A (- 1 P) (* B P)))) )
08:10algernon(let [result (+ (* A (- 1 P) (* B P))))] (println result) result) inside the doseq
08:10invis_there redundant X in square brekets
08:11invis_thank you ! will try
08:13logancampbelldoes 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
08:14__zeroI'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?
08:14invis_to algernon: But doseq always return nil, so it doesnt depends what inside ;(
08:15__zeroI don't know if what I said makes sense
08:20michaelr525hello
08:21algernoninvis_: 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)
08:25invis_algernon: thanks, I already use map there
08:52invis_hmm, clojure process using 100% after my computation :(
08:52invis_can you tell me where I wrong please
08:52invis_(def Pmix
08:52invis_ (map (fn [a b]
08:52invis_ (for [X x]
08:52invis_ (map (fn [P]
08:52invis_ (+ (* a (- 1 P)) (* b P)))
08:52invis_ X)))
08:52invis_ Avalue Bvalue)
08:53invis_)
09:02invis_Guys can you help me with computing array size of 13*100, from another 3 arrays.
09:02invis_X is a array with size of 13*100, Avalue and Bvalue array too, but with size of 1*13
09:02invis_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 ?
09:03invis_This is my Fn, but it eat 100% proc:
09:03invis_(def Pmix
09:03invis_ (map (fn [a b]
09:03invis_ (for [X x]
09:03invis_ (map (fn [P]
09:03invis_ (+ (* a (- 1 P)) (* b P)))
09:03invis_ X)
09:03invis_ )
09:03invis_ )
09:03invis_ Avalue Bvalue)
09:03invis_)
09:27corecodeinvis_: what's x?
09:28pl6306What clojure http library supports windows authentication? I know the java one does but I wanted to ask before I start digging.
09:30invis_corecode: X is array size 13*100
09:34TimMcinvis_: Please use a pastebin, such as refheap.com, instead of pasting multiple lines into the channel.
09:43astevedo you recommend ring + compojure?
09:43asteveI want a very lightweight http service
10:15TimMcasteve: That's the most common service.
10:16TimMcWow, midje does *way* more "around" background nesting than I'd expect: https://gist.github.com/timmc/5301534
10:23dobladez$latest awtbot
10:23lazybot[awtbot "1.0.0"] -- https://clojars.org/awtbot
10:25ejacksonRaynes: is there a to-xml equivalent of to-html for laser ?
10:26ejacksonhickory is obviously not thrilled about my xml tags on output :(
10:49llambdamorning 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:52hyPiRionllambda: So you use the metadata to find the functions and execute them?
10:53llambdahyPiRion: yeah that's what i was thinking
10:54llambdai'm not really sure if that's a good way of doing things tho :)
10:54gfrederickshow do you find functions based on the metadata of the functions you want to find?
10:54hyPiRionllambda: That's how `lein test` works: It looks for tags like ^:benchmark in the metadata of tests within test files.
10:54llambdalooking in ns-publics
10:54llambdaah okay, cool
10:55hyPiRionBut I'm not sure it's a good way to go in general though
10:55llambdaprobably isn't a completely horrible idea i guess then?
10:55hyPiRionYou've got to think it through
10:55hyPiRionWell, it depends on what you're trying to create obviously.
10:56llambdai'm registering route handlers for a ring app
10:56llambdai generalized the "route" logic into a macro and now have that macro tagging the "routes" with metadata
10:58Sonderbladewhere is the new location for indexed that previously existed in clojure.contrib.seq?
11:02jweissis 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:30gfredericksjweiss: symbol-macrolet is probably the cleanest thing for that
11:36lynaghk`Is there a nice strategy for implementing method-missing-like resolution on a per-eval basis?
11:37lynaghk`I.e., providing a root-value for a given var, if it is unbound or undefined in the current namespace
11:38cemericklynaghk`: if it's a per-eval basis, then why do you need to touch the root value?
11:38cemerickhave any long-time Clojure devs recorded any screencasts while using vim-fireplace?
11:38lynaghk`cemerick: most of the time there won't be corresponding vars in the Clojure namespace system whatsoever
11:39cemerickah
11:39lynaghk`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:39cemerickenvironments, in other words
11:39cemerickno, no easy way
11:39lynaghk`yeah
11:39lynaghk`nooooooooo
11:39cemerickThat bridge was crossed a looong time ago
11:39lynaghk`that means I'll have to do it the hard way!
11:40cemerickyup
11:41muhooprotocols?
11:41clojurebotprotocols is http://clojure.org/protocols
11:41lynaghk`cemerick: I've already tried doing a postwalk-replace to substitute in fn values, but I can't eval the resulting form
11:42lynaghk`cemerick: e.g., (eval (list + 1 (constantly 2))) throws a "no ctor found"
11:44cemerickwell, yeah
11:44cemericklynaghk`: I thought you were trying to wildcard vars?
11:45cemericki.e. if you had a var that contained the function (constantly 2), (eval (list '+ 1 that-var)) wouldn't work either
11:45lynaghk`cemerick: yeah, the eval list thing is my first failed implementation at wildcarding "vars" via a postwalk-replace
11:46cemerickif the var in question has a value of 2, then shouldn't that be the value put into the list being eval'ed?
11:47lynaghk`cemerick: in that case, yeah. I'd like to resolve functions, though.
11:48cemericklynaghk`: 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:49dsopis there some kind of short for mfor (assoc map :k (f (:k map))?
11:50hyPiRiondsop: update-in
11:50dsophyPiRion: ah thx
11:50raek(update-in map [:k] f)
11:50hyPiRion,(update-in {:k :ten} [:k] name)
11:50clojurebot{:k "ten"}
12:06no7hinganybody using environ?
12:06no7hinghttps://github.com/weavejester/environ
12:06no7hingit doesn't pick up my project local .lein-env file
12:12mpenetI do. It's a file generated by lein-env isn't it?
12:12mpenetby environ I mean
12:12mpenetI bet you can just delete it, and it will be regenerated if it's corrupted somehow
12:14lazybotAll hail our overlord rhickey.
12:15no7hing@mpenet i'am just using environ itself, not the lein plugin
12:16no7hingenviron doesn't create the .lein-env, and as far as i've understood it it's the project local file?
12:17mpenetno7hing: I think it does: https://github.com/weavejester/environ/blob/master/lein-environ/src/lein_environ/plugin.clj#L10
12:17hyPiRionthat's the plugin though
12:17mpenetbut I never had to dig into how it work
12:17mpenetit just did work flawlessly
12:17mpenetright
12:18no7hingmaybe then i'll have to use the plugin and add the config to the project.clj
12:25mpenetdoes elastish uses the native transport by default now?
12:25mpenetit's not mentionned in the docs
12:27mpenetnevermind, I got my answer
12:29no7hing@mpenet are you using keys in your profiles.clj to override/mock env vars during development?
12:29mpenetno7hing: yes
12:30mpenetno7hing: under {:user {:env ...}}
12:30no7hingi wanted to avoid that and have them in the project.clj but that didn't work
12:30mpenetI don't do that
12:31mpenetI don't think I ever tried it either
12:31no7hingthanks either way
12:32mpenetdid you add the plugin in your profile?
12:33mpenetwell I bet you did, it's stated on the readme
12:36no7hingi did in a second step but i added the values to {:user {:env ..}}
12:38no7hingwell, once you do it right, it works
12:39mpenet:)
12:43corecodehyPiRion: you were part of igor?
12:53tieTYTis this a hack or idiomatic: (let [x (or a b)] ...
12:53amalloytieTYT: is it a hack to use the or macro?
12:53hyPiRioncorecode: oh, no, I was part of a newer project
12:54hyPiRionI'm not that old (unfortunately)
12:54tieTYTno, but with that logic, if it can be used, it's not a hack
12:55duncanmtieTYT: it means what you say it means, right? how else would you express that?
12:56tieTYTif's
12:56hyPiRionI was part of 256 Shades of Gray (http://www.256shadesofgray.com), multi-core image processor
12:56duncanmtieTYT: in that case, i'd say using 'or' is more idiomatic
12:57tieTYTk thanks
12:57corecodehyPiRion: are these full time projects?
12:58duncanm(let [x (if a a (if b b false))] ...) ;; i guess that's the equivalent when not using 'or'
12:58duncanmthat's gross
12:58tieTYTok
12:58hyPiRioncorecode: Essentially yes. They are full-time from middle of August to middle of November
12:58tieTYTmore like (if (not (nil? a)) a b)
12:59corecodehyPiRion: aaah
12:59corecodehyPiRion: nice.
12:59corecodehyPiRion: very nice.
13:00tomoj,(macroexpand-1 '(or a b))
13:00clojurebot(clojure.core/let [or__3967__auto__ a] (if or__3967__auto__ or__3967__auto__ (clojure.core/or b)))
13:01tomoj&(clojure.walk/macroexpand-all '(or a b))
13:01lazybot⇒ (let* [or__3824__auto__ a] (if or__3824__auto__ or__3824__auto__ b))
13:01tomoj(if a a b) ?
13:01hyPiRioncorecode: It's absolutely worth it if you have interest in such a thing at your university.
13:02corecodehyPiRion: hahah
13:02hyPiRioner, 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:02corecodehyPiRion: yea, no.
13:02hyPiRionhehe
13:02corecodepeople here don't do that
13:02corecodenobody is interested in doing interesting/new stuff
13:02tomojif 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:03hyPiRioncorecode: that's a shame.
13:04corecodehyPiRion: it is.
13:04hyPiRionI'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:05hyPiRionIt's fun, but it eats time
13:07tomojhttps://www.refheap.com/paste/cb63f74e897dadbcd9d68b51d
13:07tomojinteresting
13:07tomojdef metadata is evaluated twice?
13:08tomojah, http://dev.clojure.org/jira/browse/CLJ-1137
13:09corecodehyPiRion: PhDs are not more intelligent, do they know more about all subjects.
13:09corecodenor*
13:09corecodethey know more about one subject.
13:09corecodein the end.
13:09tomojhyPiRion: very cool
13:10corecodei have the feeling clj might be too big to be implemented in a 4KB virtual machine
13:10corecodewhich is sad.
13:10tomojso you could use that to implement a convolutional neural network I presume?
13:11hyPiRioncorecode: yeah, it's hard in the sense that it requires a lot of understanding and a lot of research on optimal parameters
13:14hyPiRiontomoj: actually, we designed an evolving CTRNN last exercise, so yeah, that should be doable
13:15hyPiRionAnd that was not just feed-forward, it was cyclic.
13:16tomojis that something more than what the 'R' means?
13:18hyPiRionno
13:18hyPiRionheh, redundant is redundant
13:19tomojbut yeah, very cool
13:19tomojI worry soon the state of the art will be out of my reach since it will require crazy custom hardware :(
13:19muhooDepartment of Redundancy Department
13:22tomojI don't think I ever noticed you could set a validator on a var
13:23tomojkind of cool
13:25tyler_https://github.com/bbatsov/clojure-style-guide seems to conflict
13:25tyler_says 2 spaces per indentation level
13:25tyler_then says vertically align function arguments
13:25tyler_isn't everythign a functio agument in lisp?
13:25tyler_function*
13:26tomojno
13:26tomojthere are also macros
13:26tomojand special forms
13:27tyler_but i mean from the editor perspective macros are the same as functions for all intents and purposes
13:27tyler_visualy
13:27tomojnot if you follow that style guide
13:27tyler_which is what the style guide is for
13:27tyler_ah
13:27tyler_ok
13:27tomojbut it can't really explain what it means
13:28technomancytyler_: typically the editor hard-codes built-in macros into a list
13:28tomojsince the rules about whether to use first-arg indentation or 2-spaces are.. problematic
13:28tyler_yeah i kinda arbitrarially pick which one im gonna use
13:29tyler_whatever looks best to my eye is how i usually roll heh
13:29tomojat least (exactly??) one person says we should just always use two spaces
13:30tomoj..I probably shouldn't have said that :(
13:30tyler_who is that one person?
13:31tomojchas
13:34tyler_i was making it so everything was veritcally aligned, but that looked odd heh
13:49technomancytyler_: at least with emacs naming your macro "with-*" will make it indent correctly =)
13:49technomancyslime 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:49technomancykinda sketchy
13:50borkdudetoday I spend two hours with a student configuring his emacs, recommend him technomancy starter-kit ;)
13:51borkdudehmm, my spelling is horrible today
13:53tyler_emacs is cool...
13:54tyler_i don't use it though
13:54tyler_heh
13:54technomancyemacs isn't really omkase
13:54technomancyit's just an illusion
13:54lynaghkcemerick: did you see this? http://source.mozillaopennews.org/en-US/articles/introducing-tabula/
13:57tomojhmm, rather than try to base indentation on runtime var inspection, maybe we just define a standard indent.clj data format?
13:57tomojthen maybe provide a tool for generating it from runtime var meta
13:58cemericklynaghk: yup
13:58lynaghkcemerick: just checking, I know how you love the pdfs = )
13:58cemericklynaghk: they make me all warm and fuzzy.
13:58cemerickMy life's work, etc. :-|
13:59pepijndevoscemerick: but they also opensourced your income, right?
13:59cemerickpepijndevos: who, the tabula people? Nah.
14:00lynaghkI'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:01pepijndevoscemerick: I thought you sold this textpdfstream thing
14:01cemerickpepijndevos: still do. http://snowtide.com
14:02bbloomlynaghk: what are you trying to do?
14:02Raynesejackson: There is not, I'm afraid.
14:02Raynesejackson: 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:02lynaghkbbloom: provide my own var-resolution system, orthogonal to Clojure's namespace system.
14:02S11001001lynaghk: a proper namespace may be enumerated.
14:02lynaghkS11001001: there's nothing proper about what I want to do =)
14:02bbloomlynaghk: have you looked at my backtick library?
14:03technomancyRaynes: good job overcoming the temptation to call your lib "rich hickory".
14:03Raynestechnomancy: It isn't my lib. Just a fork.
14:03technomancyyou are to be commended
14:03bbloomlynaghk: https://github.com/brandonbloom/backtick can do quasiquote with custom symbol resolution
14:03technomancyRaynes: no, I mean laser
14:03devinusanybody know if there's any chance in hell datomic would ever be open sourced?
14:03Rayneslol
14:03bbloomlynaghk: i think eval is the wrong layer to do this at. you want to do it at macroexpand probably
14:03bbloomdepends on your use case tho
14:03lynaghkbbloom: ah, yeah! I totally forgot about that lib, it looks promising. thanks.
14:04bbloomlynaghk: if it doesn't do exactly what you want, let me know & we'll see if we can work out a better solution
14:04lynaghkbbloom: thanks!
14:04bbloomlynaghk: 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:05lynaghkbbloom: I'm basically looking for something like :method_missing
14:05bbloomlynaghk: dynamically at runtime?
14:05lynaghkbbloom: except on namespaces with vars rather than methods on object hierarchies
14:05lynaghkbbloom: yeah
14:05Raynesdevinus: Very unlikely.
14:05nDuffdevinus: No inside track -- but personally, I don't expect that to happen until it's lost its commercial value.
14:05bbloomlynaghk: hmm well i guess you can do it at macro expand, right?
14:05lynaghkbbloom: but Clojure's Compiler.java resolve is a static method, so I can't override without forking
14:05lynaghkbbloom: (as far as I'm aware)
14:06nDuffdevinus: ...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:06lynaghkbbloom: 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:06squidzWhat would be the most interesting video to impress my java friend
14:06squidz who only wants to programm java because of its job opportunities
14:07nDuffsquidz: I'm not sure anyone who doesn't program for the love of it is salvageable.
14:07bbloomlynaghk: 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:07nDuffsquidz: ...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:07bbloomlynaghk: this is a full syntax quote replacement here: https://github.com/brandonbloom/backtick/blob/master/src/backtick.clj#L85-L101
14:08Raynessquidz: Anything with me in it, essentially.
14:08squidznDuff: do you have a video? I think asking him to read will scare him off
14:08RaynesI'm pretty great.
14:08bbloomlynaghk: notice line 98, which is the part that gets you `foo converted to `user/foo if there is no foo
14:08bbloomlynaghk: that's essentially "var-missing"
14:08RaynesAsking me to watch a video is likely to scare me off.
14:08amalloysquidz: an illiterate developer? probably best to just point him off a cliff and tell him there's a video on the other end
14:09supersymbbloom: I love reading his stuff :P
14:09bbloomsupersym: ?
14:09supersymnever heard of the man but I like his style of writing
14:09supersymPaul Graham?
14:10bbloomsupersym: oh, i wasn't reading that part of the conversation & didn't know why you had addressed me
14:10squidzso what would be essentially the same as pointing off a cliff and letting him 'land in clojure'
14:10supersymsorry I was interfering + slow
14:10n_bPoint 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:12squidzso no video recommendations
14:13bbloomlynaghk: if that works for you, we can make a higher-order version of resolve-symbol that provides a var-missing callback
14:14amalloysquidz: maybe he'd like spongebob squarepants
14:14tomojthe way that would work is you do your own manual recursive macroexpansion, then run backtick on the result?
14:14n_btechnomancy: What time do the Seajure meetings typically end at?
14:14lynaghkbbloom: 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:15technomancyn_b: between 9 and 9:30 usually
14:15lynaghkbbloom: a macro that checks for unbound vars and provides locals would be preferrable
14:15squidzokay but seriously guys, I know its not the easiest convert, but I want to try to impress.
14:16squidzeven if the wrong motives are there to begin with
14:16bbloomlynaghk: in theory, the resolve fn that you provide doesn't need to return a symbol. you could return a (fn ...) form
14:16lynaghkbbloom: yes, exactly.
14:16bbloomlynaghk: give it a try, let me know how it goes :-)
14:17trptcolinsquidz: search youtube for Clojure for Java Programmers Rich Hickey - 2 good videos there
14:17lynaghkbbloom: that was what I originally tried, actually---a postwalk that tried replacing things in the function position of lists with actual function values
14:17bbloomlynaghk: that's basically what my code does, but it's a direct port of the quasi quote code
14:17lynaghkbbloom: my macro-foo is weak, though.
14:18tomojIf I release a fork of clojure, am I allowed to use a *jure name? :)
14:18technomancyonly if it's a joke =)
14:20tomojah, I was thinking that "clojurescript" or "pyclojure" would be disallowed
14:21tomojbut it's just (?<!clo)jure
14:21trptcolinjurekidding
14:33ravster1in a post-walk, what do they mean by "post-order traversal of form"?
14:34TimMcravster1: https://en.wikipedia.org/wiki/Tree_traversal
14:35tomoj&(let [a (atom [])] (clojure.walk/postwalk #(swap! a conj %) '(+ a (- b c))) @a)
14:35lazybot⇒ [+ a - b c ([+ a -] [+ a - b] [+ a - b c]) ([+] [+ a] [+ a - b c ([+ a -] [+ a - b] [+ a - b c])])]
14:35tomojheh
14:35tomoj&(let [a (atom [])] (clojure.walk/postwalk #(do (swap! a conj %) %) '(+ a (- b c))) @a)
14:35lazybot⇒ [+ a - b c (- b c) (+ a (- b c))]
14:36tomoj&(let [a (atom [])] (clojure.walk/prewalk #(do (swap! a conj %) %) '(+ a (- b c))) @a)
14:36lazybot⇒ [(+ a (- b c)) + a (- b c) - b c]
14:39ppppaulcan someone point me to examples of testing datomic queries without a db/mem:db. thank you
14:40ravster1TimMc: thanks for the link, that explained it.
14:40tomoj$google datomic collections
14:40lazybot[Datomic queries against Clojure collections] https://gist.github.com/2645453
14:49tomojshould we define a special case of equality for reducers, like for IPersistentCollection?
14:49tomojwould be a weird thing for an IO reducer
14:49tomojI guess you just into [] if you want to check equality
14:55cemerickOT any vim+iterm users want to help me out with a probably-trivial problem?
14:56trptcolincemerick: sure
14:56cemerickthanks, will msg
14:59Raynescemerick: First step is to use macvim.
14:59RaynesI'm a heretic.
15:01bbloommmm macvim
15:01bbloom(booo new coretext renderer, btw)
15:02dbushenkowhy does leiningen not include resources into the uberwar when I issue 'lein ring uberwar' command?
15:06technomancybug in lein-ring maybe?
15:07dbushenkotrying older version...
15:08cemerickRaynes: The problem with that is that vim-dispatch (or anything like it) wants e.g. tmux
15:08ravster1hey 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:09cemerick(macvim also seems to not play well with saving session files reliably)
15:09ravster1the entity->map function in the gist just returns a regular map.
15:13tomojyou need to convert nested entities to maps as well
15:13n_bcemerick: doesn't vim-dispatch have an iterm adaptor?
15:14tomojI suspect the problem is that it's trying to walk ref'd entities, and entities can't be walked
15:14cemerickn_b: yup, thus my attempting to use vim in iterm, though it's making my eyes bleed with a colorscheme problem atm
15:14tomojoh
15:14n_bohh. I think I had the same problem. Let me see if I recorded what I did to fix it
15:15n_bq
15:15tomojwell the db/id should be a long, not a DbId (tempid), so no problem there I'd think
15:15ravster1tomoj, yeah, right? I'm not going crazy.
15:15ravster1right ..... ? :o
15:16tomoj(if (instance? datomic.Entity form) (entity->map form) ...) ?
15:17ravster1hmm, instance? didn't think of that one
15:18ravster1oh wow, I think that might just have worked. Will do a nrepl-restart to be sure.
15:18SegFaultAXcemerick: Did you set t_Co?
15:19SegFaultAXcemerick: :help terminal-options for details
15:19cemerickSegFaultAX: 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:21SegFaultAXcemerick: Ah, t_Co is set in that answer. Maybe pop over to #vim for more help?
15:21cemerickSegFaultAX: already did :-(
15:22tomoj&(keyword (Object.))
15:22lazybot⇒ nil
15:23SegFaultAXcemerick: I've had lots of colorscheme issues in the past as well. I use different schemes now in term vs. mvim/gvim.
15:23hyPiRion,(keyword nil)
15:23clojurebotnil
15:24n_bColorschemes are actually preferable to trying to get vi properly setting the window title :P
15:24n_bq
15:27tyler_where can i read more docs on how (defn foo [:keys sasdasdad]) works
15:28tomojholy crap
15:28SegFaultAXtyler_: What do you want to know about?
15:28tomoj&(map realized? [(lazy-seq) (doto (lazy-seq) seq)])
15:28lazybot⇒ (false true)
15:28SegFaultAXtyler_: The destructuring part or the defining functions part?
15:28tyler_SegFaultAX: what the :keys keyword does to the destructuring
15:28SegFaultAXtomoj: Why is that surprising?
15:28tyler_and how the mechanics of that works
15:28SegFaultAXtomoj: The very first thing seq does is realize the head of the seq.
15:28tomojI didn't know there were IPending values
15:29tomojthe surprising thing is that realized? works, I know how seqs work
15:31SegFaultAXhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazySeq.java#L253
15:32cemerickSegFaultAX, n_b: Looks like I needed https://github.com/vim-scripts/CSApprox, thanks to trptcolin for the save :-)
15:33n_bahh. Never would've occurred to me that someone would use GVim primarily and not have a term colorscheme
15:33SegFaultAXcemerick: I haven't seen that before. That's quite nifty.
15:33SegFaultAXI just resolved myself to using desert256 in term and molokai in gvim/mvim.
15:33n_bbut (inc SegFaultAX) on the niftiness
15:34SegFaultAXn_b: Gotta do ##(inc n_b) for inline code.
15:34lazybotjava.lang.RuntimeException: Unable to resolve symbol: n_b in this context
15:34SegFaultAXOh wait, lazybot derps.
15:34lynaghkbbloom: if you want a mystery: https://gist.github.com/lynaghk/0a8a3dd71cc3c830f507
15:34cemerickn_b: the bizarre thing is that I'm not trying to use desert256, just desert
15:34cemerickanyway...
15:34SegFaultAXcemerick: Really? Odd. Did you set it to dark?
15:36bbloomlynaghk: sorry, busy at the moment. can't dig into your mystery
15:37lynaghkbbloom: no worries.
15:38cemericklynaghk: I see what's happening
15:38cemericksomeone else hit this a little while back, too
15:38cemerickjonasen, actually, IIRC
15:39lynaghkcemerick: some kind of laziness issue?
15:39cemerickthe compiler is producing a string to be read-evaled containing call to a nonexistent arity of the fn value
15:39cemerickfn ctor, that is
15:40cemericklynaghk: https://github.com/jonase/kibit/issues/53
15:40cemerickheh, I guess I hit it :-P
15:41lynaghkcemerick: ah. so my problem is that I used (fn [x] ...) rather than an anon function
15:41cemericklynaghk: eliminate the doseq
15:41cemerickno
15:41Raynesdbushenko: 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:42lynaghkcemerick: using #(* % %) fixes the issue.
15:42cemerickit's that the anon fn's ctor is expecting an argument containing the value of the lexical closure of idx
15:42dbushenkoRaynes, oh well, I'm just looking for a convinient way to manage sessions
15:42dbushenkoand lib-noir is perfect in that
15:42cemericklynaghk: right; don't close over anything, and the fn's ctor is nullary
15:42RaynesSure thing
15:42dbushenkoso I wanted to ask for how long possible lib-noir will be supported :-)
15:42Raynesdbushenko: Oh yes, it isn't going anywhere.
15:43dbushenkoI mean the compatibility with new versions of Clojure and other libs
15:43RaynesIt's got both me and yogthos|away behind it. If he abandoned it I'd keep maintaining it myself.
15:43RaynesI'll personally keep it up-to-date with other libraries.
15:43lynaghkcemerick: hmm. so the ((resolve db :square) 2) works because it's going through a different mechanism than evalin' the list?
15:43RaynesYou don't have to worry about that.
15:43cemericklynaghk: definitely a compiler bug
15:43dbushenkogreat! this is just great! thanks!
15:44lynaghkcemerick: okay. subtle as hell. thanks for figuring this out!
15:45cemericklynaghk: quite. np, I'm just stacking chips for when I ship you my diagrams ;-P
15:45lynaghk= )
15:47ispolinfor 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:49hiredmanispolin: 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:51hiredmanispolin: https://groups.google.com/forum/?fromgroups=#!searchin/datomic/hornetq/datomic/FT94dk6YEGk/x7bfqI-bqlwJ
15:54ispolinhiredman: 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:06jweissif 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:12RaynesHow 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:17callenRaynes: I have it starred, but I don't watch repos often anymore.
16:17callenit leads to compulsive "mark read"s
16:18RaynesI meant starred.
16:18RaynesWatching sucks.
16:18callenRaynes: yes it does.
16:19tyler_whats SNAPSHOT mean in clojure parlance?
16:19tyler_is that a java carryover?
16:20nDufftyler_: It's carryover from Maven, which is a Java thing, yes.
16:21tyler_whats the difference between a snapshot and a not-snapshot
16:21nDufftyler_: basically, a SNAPSHOT is a build on a tree which hasn't been released yet.
16:21tyler_ah
16:21tyler_so like pre-release release
16:21nDuffYup.
16:23joegallotyler_: 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:23tyler_ah
16:24tyler_releases are immutable, snapshots are mutable
16:24tyler_gotcha
16:24joegalloi'm sure i'm technically wrong in 19 ways on that, but it's a nice way to think of things.
16:24tyler_at least in a philosophical sense
16:37technomancyRaynes: I did my part
16:38technomancyactually I only watch repos
16:38technomancyI don't think I've ever starred anything on purpose
16:39callentechnomancy: so you just ignore the blue dot?
16:40technomancythere's a blue dot?
16:40technomancyoh geez; that thing?
16:40technomancyyeah, of course; it's useless. I only pay attention to email, which I can actually filter properly.
16:41technomancyit's like a crappy version of an inbox, isn't it?
16:42callentechnomancy: I hates it :(
16:42callenIt's useful but it makes me OCD about keeping it cleared.
16:47technomancyuser css
16:51Rich_Morinhttps://github.com/swannodette/textmate-clojure seems pretty inactive. Which fork (if any) is current, stable, etc?
16:51RaynesNone.
16:51RaynesAll of them are terrible.
16:52RaynesUnless something has changed in the past 2 months or so.
16:52Rich_MorinI was afraid of that.
16:52RaynesTextmate 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:03vickaitaIn 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:04lynaghkvickaita: you can use (clj->js (range 10))
17:04technomancyRaynes: I prefer to think of it as the biggest gap in programmer skills
17:05vickaitalynaghk: thank you
17:07callentechnomancy: I should reskin Emacs and charge $99 for it. Maybe then programmers will think it's good.
17:08n_bvickaita: into would be more idiomatic, I think.
17:11technomancycallen: looks like the emacs redirect of http://textmate2.com expired =(
17:11borkdudeintroduction into clojure for those who speak Dutch or want to learn Dutch: http://michielborkent.nl/courses/ap/clojure/dictaat.html
17:14n_bAs did people's interest in TM2, it seems
17:15n_bseems the bulk switched to ST(2|3)
17:24vickaitan_b: into doesnt seem to work. I see that there is an into-array function, is that what you meant?
17:30callentechnomancy: hahahaha :)
17:31callensuch a pity.
17:33yediis it a code smell when you see aggregate data structures (lists, maps) being used as keys to maps
17:35callenyedi: yikes
17:35AimHereI can think of cases where that's appropriate
17:35S11001001sounds fine
17:36ToBeReplacedi do that plenty with records (ie anything where there's a composite primary key)
17:37AimHereSo the answer is: It might be, but we're all doing it
17:37tbaldrid_why would it be a code smell?
17:40AimHereWell 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:41yediyea guys i have no idea either way, just wondering what the pros/cons were
17:41tomojoutside of a functional language, it's a lot harder to do
17:41tomoje.g. javascript >:[
17:41tomojI think the fact that it's basically impossible contributes to the fact that you hardly ever see it
17:42AimHereI wouldn't be surprised if it's easy to do in Javascript
17:42tomojit's basically impossible
17:42tomoj:P
17:42technomancyyedi: the only downside I can think of is that keywords are more convenient since they are functions
17:43tomojI guess in java you could do it OK with immutable collections as the keys?
17:43AimHereThe one loose worry I'd have is if your collections had the same elements, but that map figured they were different
17:44AimHereMultiple versions of equality tend to give me the heebie jeebies
17:44tomojs/one loose worry/huge gaping hole/
17:44tomojL
17:44tomoj?
17:44technomancyAimHere: clojure *generally* gets hashing right
17:44technomancyexcept for numerics sometimes
17:44technomancybut for something that's completely under Clojure's control like collections you shouldn't have any crazy behaviour
17:45AimHere 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:45technomancyno, that's impossible
17:45technomancyactually I take that back
17:45technomancyit could be possible if 2 were an Integer and foo were a Long
17:45technomancyI'm a bit fuzzy on that; I feel like it keeps changing
17:46amalloytechnomancy: it does keep changing. but in 1.4 it stopped being stupid, more or less
17:46technomancyamalloy: meaning RT/equiv does the right thing and calling the java methods directly exposes the required brokenness?
17:46amalloyint 2 and long 2 behave the same in every way i can think of (aside from the obvious ones)
17:46amalloyyeah
17:46hyPiRionIt's much better than e.g. in 1.2
17:46technomancysweet
17:46callenwhy are numbers in Clojure defaulted to longs?
17:47amalloyhyPiRion: it was okay in 1.2, though not perfect; 1.3 is the only version where it was really atrocious
17:47technomancyyeah, one more reason to drop support for 1.3
17:47callenwhat happened in 1.3?
17:48technomancybad things. best not to talk about it.
17:48RaynesNuclear war.
17:48technomancypretend it never happened, like Leisure Suit Larry 4
17:48Raynestechnomancy: Or any of those, for that matter.
17:48hyPiRionamalloy: well, I had the issue where e.g. (contains? #{2} (denominator 1/2)) failed me
17:48callenI'm legitimately trying to learn here
17:48callenplease humor me.
17:49hyPiRionSince both longs and bigints were printed in the same way, you had no idea why that failed
17:49Dirklectischn_b: I'm actually still interested
17:49technomancycallen: integers and longs hashed differently, so you could have two equal map keys
17:49technomancyI think there was more to it than that, but that's the bit that I recall best.
17:50technomancycallen: note that the java.util.Map interface *requires* said broken behaviour
17:50callenow.
17:50Dirklectischn_b: in TM2 that is. I'm working on an update for the bundle so that it works with nrepl etc.
17:50technomancybut 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:50hyPiRioncallen: look at this beauty: user=> (conj #{2} (denominator 1/2) (long 2)) -> #{2 2 2}
17:51brehaut◎_◎
17:52Dirklectischn_b: It might not get much attention, but TM2 is still in very active development.
17:52callenhyPiRion: aaaaaaaaaaaaaaaaaaagh
17:52callenthat is *hilarious*
17:53technomancyit was also the same release where contrib got asploded
17:53hyPiRionI wouldn't call it hilarious, more like infurating :p
17:53tyler_how do i import classes that have the same name from java but are from different libraries?
17:54callencontrib was turning into a pretty egregious "misc" bucket.
17:54tyler_without them conflicting
17:54technomancycallen: yeah it was terrible, but it was EOL'd without much warning
17:54callenI remember the gnashing of teeth
17:55technomancyand no technical reason why a liferaft 1.3-compatible release couldn't have been made
17:57tyler_does import have an :as directive?
17:59aaelonyin 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:00brehautq ?
18:00blrmaaelony: clojure-jack-in should be using nrepl. I can usually just q out of popups
18:01aaelonyhitting q colorizes the stack trace...
18:01aaelonyI can go to the window then kill it, but there's likely a better way
18:02aaelonyI'm looking at https://github.com/clojure/tools.nrepl for info on shortcut keys, but not seeing it yet
18:02dnolentyler_: don't think so
18:04blrmaaelony: 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:06aaelonyblrm: 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:06WillyfrogC-x k?
18:07Willyfrognot sure if it's quick enough for you :S
18:07hyPiRionC-x 0 is possibly better
18:07aaelonynope, have to C-x o then X-x k
18:07aaelonyC-x o then C-x k
18:07hyPiRionoh
18:08hyPiRionC-x 1 then?
18:08blrmyeah
18:08aaelonybefore, I could just type 0 and be done
18:08aaelonyC-x 1 works
18:08aaelonythanks… I liked 0 better though
18:10hyPiRionaaelony: There's probably a better way, but I haven't played that much around with it
18:10hyPiRion(I never get exceptions, I always do thing correct at first attempt you see)
18:11blrmaaelony: what nrepl command are you using to eval the form? that can determine what kind of window the output is in
18:11aaelonyhyPirRion: I've googled, looked at the link, where to look for more info?
18:11blrmaaelony: https://github.com/kingtim/nrepl.el
18:11hyPiRion(inc blrm)
18:11lazybot⇒ 1
18:12aaelonyok, I need to learn to read *.el files then ;)
18:13aaelonyblrm: I'm just going to the end of the form and executing, i.e. C-x C-e
18:14aaelonyblrm: nrepl.el is what I needed, thanks.
18:15blrmaaelony: 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:15blrmaaelony: np!
18:15aaelonycool
18:16aaelonyC-c Cp-p is quite nice
18:16aaelonyC-c C-p is quite nice
18:20no7hingany idea what i'm doing wrong if i get "No such var: sql/execute!" on using the fun in clojure.java.jdbc?
18:21no7hingother functions work just fine
18:22seancorfieldare you pulling in the snapshot or version 0.2.3?
18:22no7hing0.2.3
18:23seancorfieldexecute! is part of the new API coming in what will be 0.3.0 (currently 0.2.4-SNAPSHOT)
18:23technomancyseancorfield: how's that coming along?
18:23seancorfieldso for now you need (with-connection ... (with-query-results ... )) if memory serves
18:23technomancylooking forward to being able to escape the shackles of dynamic scope
18:24no7hingtoday is not my day; was pulling in the correct version but looking into the master code
18:24seancorfieldtechnomancy: i've been swamped at work so c.j.j has taken a back seat temporarily
18:24no7hingthanks
18:24cemericktpope: 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:24pbostromspeaking 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:24seancorfieldi really hoped to get an alpha out by clojure/west :(
18:24technomancyseancorfield: it happens
18:26seancorfieldi ran across the google chrome plugin for Edit with Emacs today... that's still making me smile... writing facebook status updates in emacs... :)
18:28technomancypbostrom: switch to xmonad =)
18:28technomancyseriously though, you can do something like this: (eval-after-load 'nrepl '(define-key (kbd "C-TAB") 'nrepl-complete))
18:28technomancyalthough C-TAB won't work in a terminal since tab is technically control-i
18:31pbostromtechnomancy: thanks, I have considered xmonad, maybe some day
18:32Bronsaor stumpwm :)
18:34hyPiRionxmonad is the thing
18:35technomancyxmonad is the first exception I've found to my "if it doesn't have a repl I will completely hate using it" rule
18:35technomancyalso the only software I use written in Haskell; probably not a coincidence
18:39squidzxmonad is awesome - no pun intended
18:39brehauttechnomancy: any yet, it'd probably be even cooler if it had a ghci repl
18:39hyPiRiontechnomancy: as in, "Haskell is the only thing without a repl I'd use"?
18:39tomojfunny how M-q seems so amazing when I'm used to a repl
18:39tomojMod-q I mean
18:40hyPiRionMod? You mean super?
18:40technomancybrehaut: this way I have an excuse to put off learning haskell though
18:40brehautlol
18:40brehauttechnomancy: its just ocaml but not
18:40SegFaultAXn_b: Ping.
18:40technomancybrehaut: but but whitespace augh
18:40brehauttechnomancy: optional
18:41brehauttechnomancy: and layout is way way cooler than python or coffeescript whitespace
18:41technomancyhyPiRion: "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:41SegFaultAXAlso, typeclasses!
18:41hyPiRiontechnomancy: right, gotcha
18:42technomancybrehaut: 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:42technomancygenuine question
18:42hyPiRionbrehaut: cooler? "Oh, it has 2 spaces less here, and 2 spaces more here"
18:42hyPiRionOr is it more than it than that
18:42SegFaultAXtechnomancy: No, not really.
18:42technomancywhitespace sensitivity could only only sane if it's a syntax error to mix spaces and tabs
18:43technomancyseems obvious to me, but people still screw it up =\
18:43brehauttechnomancy: in anycase, you can just use braces and semis anywhere you would use layout
18:43technomancybrehaut: and you can write lisp code with parens on their own line too, technically =)
18:43brehauttechnomancy: yes, but its not a sin in haskell
18:43brehautits a feature
18:44technomancyok, cool
18:44hyPiRionWell, 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:44technomancybut you still have to read other peoples' code where invisible differences are possible
18:44hyPiRionSo whitespaces doesn't matter really
18:44SegFaultAXhyPiRion: It's only proven to not have type errors. There could still be logical errors.
18:44hyPiRionSegFaultAX: psh ;(
18:45hyPiRionYou're killing my joke
18:46SegFaultAXhyPiRion: Is that a frowny winky face?
18:46tomojmaybe the user error is picking types that don't prove correctness, not writing a buggy program
18:46SegFaultAXHow does that even work?
18:47hyPiRionSegFaultAX: @:{D>
18:47hyPiRionSmiling guy with turban, moustache and beard
18:47SegFaultAXThat's what I got from that.
18:50SegFaultAXtechnomancy: Are you using xmonad full time?
18:51technomancySegFaultAX: ayup
18:51SegFaultAXtechnomancy: Have you used any other tiling window managers before that or is it your first?
18:51technomancyI played around with cljs-in-gnome3 which I would probably be using if xmonad were not already perfect.
18:51tyler_xmonad is made by the enemy
18:51tyler_heh
18:52technomancySegFaultAX: I used to use devilspie with metacity to get tiling and used wmii years ago
18:52brehautdons is not the enemy
18:52brehautnot leveraging the work dons has done is the enemy
18:52tyler_i was speaking tongue-in-cheek about haskell
18:52technomancybriefly played with stump, but couldn't get it stable
18:52SegFaultAXtechnomancy: Awesome!
18:53technomancySegFaultAX: no, haven't tried that one. =)
18:53technomancyxmonad basically cured me of futzing around with my setup.
18:53brehauttyler_: that hits a nerve; functional languages are all so niche that interlanguage conflict (even in jest) is a waste of effort
18:53technomancywhich really just leaves me more time to futz around with emacs I guess
18:54SegFaultAXtechnomancy: Hah, yup. (vim in my case)
18:54technomancyheh; yeah good luck writing a WM on the JVM =)
18:54tyler_brehaut: it wasn't a personal attack, sorry
18:54SegFaultAXtechnomancy: Are you using xmonad proper or osxmonad or one of the other various ports?
18:54brehauttyler_: i realise that
18:54technomancySegFaultAX: whatever ships with debian
18:54tyler_it doesn't seem like it
18:54technomancywheezy
18:54technomancymy config file is like five lines
18:54n_bSegFaultAX: OSXmonad is so slow to respond it's unusable
18:55SegFaultAXn_b: That vim scheme you sent me earlier, do you know what font those screenshots were using?
18:56n_bLooks like Inconsalata_DZ to me
18:56n_bor some Consolas-lookalike
18:56SegFaultAXIs that different from stock inconsolata becuase that's what I use and it doesn't look exactly right.
18:56SegFaultAXI like it a lot, though. :)
18:57seancorfieldI have an Emacs / Mac OS X / Python integration question - any Pythonistas here who use Emacs?
18:57seancorfield(I asked on #python but no one answered... I have not uyet joined #emacs to ask there...)
18:57technomancythe #emacs channel is pretty great
18:57brehautseancorfield: i'm almost certain i cant help you, but yes
18:58seancorfieldlol brehaut ... ok technomancy i can go join #emacs and ask there i guess
18:58WillyfrogI do use both, although I'm learning emacs, but ask, just in case
18:58seancorfieldon mac os x, python 3 installs alongside the default python (2.7.1 on lion i believe)
18:58n_bohh, the = is different. It's Envy Code SegFaultAX
18:59seancorfieldand the default python mode in emacs starts py 2.7.1 when you do M-x run-python
18:59n_ball that caring about typography finally paying off~
18:59seancorfieldi was hoping someone could tell me the magic sauce to invoke py 3 instead
18:59SegFaultAXn_b: Is that the name of the font or the editor?
19:00S11001001seancorfield: C-u M-x run-python
19:00n_bSegFaultAX: 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:00S11001001seancorfield: note that a recent emacs has changes of the default python script run-python injects for py3 compatibility
19:00SegFaultAXn_b: Thanks! Also, thanks for the tip on the term-ready molokai!
19:00n_bcheers
19:01seancorfieldS11001001: ah... ok... so if i have python3 on the path that emacs checks, it'll find it that way... nice
19:01S11001001seancorfield: more like when you use C-u you get to type the python command
19:01S11001001seancorfield: 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:02seancorfieldnice S11001001 you rock! thank you!
19:02S11001001(this C-u convention applies to all REPLs based on comint I can think of, just for your future replin needs)
19:03seancorfieldta muchly!
19:05tieTYTanybody 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:05brehautits presumably not importing clojure.repl
19:05SegFaultAXtieTYT: Because clojure.repl hasn't been referred in that namespace probably.
19:05brehauts/importing/referred/
19:06tieTYTi thought it gets that by defualt
19:06tieTYTlet me see
19:06brehauttieTYT: you can probably do some eclipse/ccw specific thing to get doc strings
19:06Willyfroghow do you go through a string character by character?
19:06brehauttieTYT: no. lein repl gets it by default, and maybe the clojure basic repl too
19:07tieTYTi don't even see that. I see clojure.tools.nrepl
19:07brehaut,(set "abc")
19:07clojurebot#{\a \b \c}
19:07S11001001Willyfrog: strings are seqable, so do like ordinary lists
19:07brehauterr seq not set
19:07tieTYTanother thing I notice is that when I use lein, it seems to "disconnect" the CCW repl
19:07brehaut,(do (require 'clojure.repl) (dir clojure.repl))
19:07clojurebotapropos\ndemunge\ndir\ndir-fn\ndoc\nfind-doc\npst\nroot-cause\nset-break-handler!\nsource\nsource-fn\nstack-element-str\nthread-stopper\n
19:07WillyfrogS11001001, if I try to use a filter on it, the whole string goes in
19:08brehaut,(filter #{\a \b \c} "abcdef")
19:08clojurebot(\a \b \c)
19:08antares_tieTYT: it probably overwrites the file where lein repl stores nREPL server's port
19:08tieTYTah
19:09S11001001Willyfrog: see brehaut's example
19:09antares_tieTYT: although that's just a guess, I am not a CCW user
19:09Willyfrogbrehaut, hum, then I must be doing something else wrong, thanks!
19:09Willyfrog:)
19:09tieTYTbrehaut: that seems to be hanging for me
19:09tieTYTnm: CompilerException java.lang.RuntimeException: Unable to resolve symbol: dir in this context, compiling:(NO_SOURCE_PATH:1:29)
19:09antares_tieTYT: Emacs' nrepl.el can start multiple REPLs now, so there should be a way to avoid conflicts for CCW
19:09tieTYTi guess I don't need doc because I can just type in code and it tells me
19:10brehauttieTYT: well dir is in clojure.repl as well i suspect
19:10brehaut,#'dir
19:10clojurebot#'clojure.repl/dir
19:10SegFaultAXbrehaut: Yea you would need to clojure.repl/dir in your example
19:10brehaut,#' is quite a fun incantation
19:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: is in this context, compiling:(NO_SOURCE_PATH:0:0)>
19:10SegFaultAXbrehaut: Since you only required but did not refer.
19:10ravsterhow do I get a map nested in maps according to a what key-val it has?
19:11brehautSegFaultAX: sure. i was mostly just showing that doc existed in clojure.repl and that it was a real namespace
19:11ravsterI'm trying prewalk but its failing and returning nil
19:11tieTYTthis worked: (do (require '[clojure.repl :refer :all]) (dir clojure.repl))
19:11tieTYTi'm kind of disappointed "use" is being deprecated because it's easy to use
19:11SegFaultAXtieTYT: You can use `use` instead of require, it will do both for you
19:11tieTYTi thought use was going away
19:11SegFaultAXIt is?
19:12tyler_?
19:12brehautreally? its super handy for repling about; its just not preferred for persistant code files
19:12hyPiRionYou know, I have no idea how the reader works sometimes
19:12hyPiRion,^+'# #'+^
19:12clojurebot#'clojure.core/+
19:12hyPiRionCan someone, like explain that one.
19:13brehaut,^+'#
19:13clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
19:13brehautthats an impressive one hyPiRion
19:13amalloy,#
19:13clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading character>
19:13tieTYTmaybe i'm wrong
19:13amalloy,# #'+
19:13clojurebot#<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>
19:13SegFaultAXI think the problem with that brehaut is that you're giving a hint but didn't tell it what you're hinting for.
19:14brehautsure
19:14SegFaultAXtieTYT: Where did you hear that? I can't find anything in the changelog.
19:14tieTYThttp://blog.8thlight.com/colin-jones/2010/12/05/clojure-libs-and-namespaces-require-use-import-and-ns.html
19:14tieTYTupdate (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:14brehauttieTYT: no longer a reason to use use is not use is deprecated
19:14SegFaultAXtieTYT: Does that imply deprecation?
19:15tieTYTto me it did
19:15tieTYTsince it's sticking around, I disagree with him. Use is more consise
19:15tieTYTconcise
19:15brehauttieTYT: his suggestion applies to in a source file
19:16SegFaultAXtieTYT: In the REPL it's still fine.
19:16tieTYTdo you agree with that suggestion?
19:16brehautyes
19:16tieTYTwhy?
19:16clojurebotWhy is startup slow is busy compiling the `for` macroexpansion
19:16brehautuse require and refer for source code
19:16Bronsa,(meta (read-string "^+'# #'+"))
19:16clojurebot{:tag +'#}
19:16BronsahyPiRion: ^
19:16tieTYTbecause it's like star imports in java to use use?
19:16brehauttieTYT: because then theres only one form you have to use, not two kinda the same but different ones
19:17SegFaultAXBronsa: There you have it.
19:17brehautand bare use is a bad idea
19:17brehaut:refer :all is also nasty
19:17hyPiRionBronsa: Yeah, I figured the last hat was ignored by clojurebot for some reasong
19:17SegFaultAXtieTYT: In general you probably don't /really/ want to refer a whole other namespace.
19:17SegFaultAX(Except clojure.core probably)
19:18tieTYTok
19:18ravsterif I have (def foo {:a {:b 'c :d {:e 'f} :g {:e 'h}}) , how would I get out {:e 'f} only?
19:18BronsahyPiRion: yeah well, ##(read-string "^+'# #'+^")
19:18lazybot⇒ (var +)
19:18SegFaultAXravster: get-in
19:18Bronsa^ belongs to the second thing to be read
19:18Bronsaread-string reads only an element
19:18Bronsaso the reader actually never sees ^ anyway
19:18hyPiRionBronsa: Yeah, I figured as much. My repl broke down when I tried it there
19:19SegFaultAX,(get-in {:a {:b 'c :d {:e 'f} :g {: 'h}} [:a :d])
19:19clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
19:19hyPiRionI hoped I had found an anagram
19:19SegFaultAX,(get-in {:a {:b 'c :d {:e 'f} :g {: 'h}}} [:a :d])
19:19clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
19:19ravsteroops (def foo {:a {:b 'c :d {:e 'f} :g {:e 'h}}})
19:19ravsterSegFaultAX: oh, but I don't know where in the nest {:e 'f} is going to be.
19:20ravsterIt might be at that level or a level below
19:20SegFaultAXravster: Ah. clojure.walk probably.
19:20ravster(prewalk #(if (= 'f (:e %)) % ) foo) -> nil
19:21ravsterI think its failing because I don't have anything happening in the 'else' part
19:22ravsterpostwalk returns the same
19:26BronsahyPiRion: '+'#@#'+^+'# #'+^+'#@#'+'
19:29tomojI don't think you want clojure.walk
19:29tomojseems you could do it with a stoppable walk, but clojure.walk doesn't have one handy..
19:29tomojthough it lets you write one without much trouble
19:30tomojif there could be multiple nested maps you want, then it wouldn't be a stoppable walk either, what would it be?
19:30hyPiRionBronsa: oh, palindrome
19:30Bronsayeah
19:30hyPiRionI wanted something like an emoticon or something, but that seems hard
19:31tomojyou could filter a tree-seq?
19:31hyPiRion`[~,^]' looks like a good start, but it doesn't work :(
19:31ravstertomoj: heh, a stoppable walk would be great.
19:31ravstertree-seq?
19:32tomojhttps://gist.github.com/tomjack/9f89e03eb42bef6ddeab
19:32tomojlooks like I used reduced which is weird..
19:32Bronsayou can cheat and ##(let [◔ (fn [& _]) ◡ 1] (◔ ◡ ◔ ) )
19:32lazybot⇒ nil
19:32hyPiRionBronsa: yeah
19:33ravstertomoj: cool. thanks,
19:33hyPiRion,(let [  + _  ]  )
19:33clojurebot#<core$_PLUS_ clojure.core$_PLUS_@74fae4>
19:33Bronsaheh
19:34hyPiRionhmm, actually, that one may help
19:34hyPiRionno wait-
19:34Bronsawell
19:35Bronsa, /(`_`/)
19:35clojurebot#<core$_SLASH_ clojure.core$_SLASH_@9b328a>
19:35tomojhmm
19:35tomoj&(->> {:a {:b 'c :d {:e 'f} :g {:e 'h}}} (tree-seq map? vals) (filter #(and (map? %) (some '#{f} (vals %)))))
19:35lazybot⇒ ({:e f})
19:35hyPiRionhah
19:35tomojseems like it should be easier
19:35ravsterhuh, whats reduced? I don't see it in clojure.coore
19:36ravster*core
19:36tomoj&(:added (meta #'reduced))
19:36lazybotjava.lang.RuntimeException: Unable to resolve var: reduced in this context
19:36hyPiRionravster: it's a special word
19:36tomoj1.5
19:36ravsteroh, okay
19:36hyPiRionlike try/catch
19:36tomojreduced? no
19:36tomojit's just a function
19:37tomoj..and so is reduced?
19:37hiredmancemerick: 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:37antares_ravster: parts of clojure.core are not in clojure/core.clj, there are subdirectories and other files (e.g. protocols implementation lives there)
19:38hyPiRiontomoj: you're right, I stand corrected
19:43hyPiRionhmm, there must be some palindrome programs out there
19:43hyPiRion,(#(identity %) #(% identity))
19:43clojurebot#<sandbox$eval37$fn__40 sandbox$eval37$fn__40@23eebe>
19:44hyPiRionThat's almost a palindrome program
19:45hyPiRion,((identity identity) (identity identity))
19:45clojurebot#<core$identity clojure.core$identity@15eb79c>
19:45hyPiRionIt's a bit boring though.
19:46Bronsa,('+' (fn [nf] ' [fn] nf) '+')
19:46clojurebot+'
19:46hyPiRionhurray
19:47Bronsaor this ##('+' (fn [nf]' '[fn] nf) '+')
19:47lazybot⇒ +'
19:47TimMc,((comp comp) (comp comp))
19:47clojurebot#<core$comp clojure.core$comp@803ee7>
19:47TimMc,(comp ((comp comp) (comp comp)) ((comp) comp comp))
19:47clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>
19:47hyPiRionI wonder if there's a palindrome program with a computed result
19:47TimMc,((comp ((comp comp) (comp comp))) ((comp) comp comp))
19:47clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>
19:48Bronsa,(((comp comp) ('+' (fn [nf]' '[fn] nf) '+') (comp comp)))
19:48clojurebotnil
19:49TimMc,+,
19:49clojurebot#<core$_PLUS_ clojure.core$_PLUS_@136a302>
19:49TimMcbooyah
19:49Bronsathat's cheating.
19:49TimMc:-P
19:50Bronsaoh wait
19:50Bronsa,(((comp comp) ('+' (fn [nf]' '[fn] nf) '+') (comp comp)))
19:50clojurebotnil
19:50Bronsafail paste
19:50Bronsa, (('+'# (fn [nf]' '[fn] nf) #'+'))
19:50clojurebot0
19:51hyPiRion,((apply set {inc 1}) ({inc 1} set apply))
19:51clojurebotnil
19:51TimMc,((((comp comp) ((comp ((comp comp) (comp comp))) (((comp) comp) comp))))())
19:51clojurebot()
19:51hyPiRionwhoops, {1 inc} i meant
19:51BronsaTimMc: nice try
19:52TimMcBronsa: Oh, I'm just seeing if I can make "comp" lose all meaning. I think it has worked already.
19:52Bronsahah
19:52SegFaultAXTimMc: You succeeded. That makes my brain hurt. :)
19:52amalloyTimMc: that reads like pacman sounds
19:57hyPiRionoh, sweet
19:57hyPiRion,(apply apply hash-map {1 2})
19:57clojurebot{1 2}
19:59TimMc(def identity (partial apply apply hash-map))
19:59hyPiRion,((apply apply hash-map {reduce hash-map}) ({hash-map reduce} hash-map reduce))
19:59clojurebot#<core$hash_map clojure.core$hash_map@9759b6>
19:59TimMc* Nota Bene: Only works on hash-maps.
19:59hyPiRionheheh
19:59corecodewhat is going on?
20:00TimMccorecode: You don't want to know.
20:00corecodedrunk functional programming?
20:00technomancyswearjure target practice
20:00Deranderthe best kind of functional programming
20:00brehautworse: its completely lucid
20:00hyPiRioncorecode: This is Swearjure's little baby brother, palindromejure
20:01corecodewhat are the rulses for palindromes?
20:01corecoderules*
20:01corecodesame result backwards and forwards?
20:02brehautnext challenge: write a program that runs as clojure of factjor
20:02brehauts/of/or/
20:03hyPiRioncorecode: Well, it's not exactly the same as palindromes, but trying to make it have the same components forwards as backwards
20:03hyPiRione.g. (foo bar bar foo)
20:03corecodeand still work
20:04corecodeor do something specific?
20:04hyPiRionyeah, still work
20:04corecodei see.
20:04hyPiRionwell, it'd be neat if it did something fancy
20:04corecodeoh :/
20:04corecodelongest wins, i guess
20:04corecode,(comment comment)
20:04clojurebotnil
20:05corecodeexpand at will.
20:05corecodei guess that's not quite the goal? :)
20:05jballanc,((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:05clojurebot((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:05jballancdaaaw...why are results elided?
20:05jballancboo
20:06hyPiRionjballanc: palindrome and quine?
20:06jballancyup-ish
20:06corecodehaha
20:06corecodenice.
20:06hyPiRionjballanc: that's amazing. Did you use some tricks by webyrd, or was it experimentation?
20:08corecodenot quite a palindrome, is it?
20:08amalloyjballanc: use & instead of , to talk to lazybot; he doesn't truncate results
20:08brehautits not a pallindrome if you want a symetrical sexp tree, but it is if you just go for symbols in the form
20:09hyPiRionoh, I was hoping for the same tree structure too
20:09hyPiRionoh well
20:09brehauti think
20:09hyPiRionmaybe someday I'll learn the art of logic programming and create a palindrome quine
20:10corecodemaybe frame it above your bed?
20:10hyPiRionEngrave on my toilet seat.
20:10hyPiRionengraved*
20:15Bronsa,(('*'# {'*'# (fn [nf & _]' '[_ & nf] nf) (fn [nf & _]' '[_ & fn] nf) #'*'} #'*') 2 ('*'# {'*'# (fn [nf & _]' '[_ & nf] nf) (fn [nf & _]' '[_ & fn] nf) #'*'} #'*'))
20:15clojurebot2
20:26Rich_MorinRaynes: I'm having a problem loading the laser library. help? (http://pastie.org/7307269)
20:38Rich_MorinRayne: It appears that hickory may have changed in an untoward manner.
20:40jballancthere's a simpler form of lisp/scheme quine that I just remember, and then you can work from that
20:40jballanc,((fn [x] (println (list x (list (quote quote) x)))) (quote (fn [x] (println (list x (list (quote quote) x))))))
20:40clojurebot((fn [x] (println (list x (list (quote quote) x)))) (quote (fn [x] (println (list x (list (quote quote) x))))))\n
20:41SegFaultAXjballanc: That's a fairly well known quine, although it usually doesn't use println.
20:41SegFaultAX,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
20:41clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
20:42jballancah, right
20:44jballanclazybot is triggered off with "&" right?
20:44jballanc&(println "Hello, world")
20:44lazybot⇒ Hello, world nil
20:45jballancso can clojurebot trigger lazybot?
20:45RaynesRich_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:45RaynesRich_Morin: It looks to me like you should probably run `lein clean` in your project and then restart whatever repls you have open.
20:46jballanc,(println "&(println \"The robot apocalypse is nigh\")")
20:46clojurebot&(println "The robot apocalypse is nigh")\n
20:46jballancdaw :(
20:46amalloyMAYHEM DENIED
20:46RaynesApparently the North Korean apocalypse is nigh.
20:46amalloyRaynes: you must be lost. #politics is over there
20:47dpathakj,(print "&(println \"The robot apocalypse is nigh\")")
20:47clojurebot&(println "The robot apocalypse is nigh")
20:47Rich_MorinRaynes: I'm afraid that didn't help. Any other things to try?
20:47dpathakjWorth a try.
20:48RaynesCan you paste the output of `lein deps :tree`
20:49Rich_MorinRaynes: sure - http://pastie.org/7307454
20:50RaynesRich_Morin: I see the problem.
20:50jballancIIRC, clojurebot uses notices or some such...
20:51RaynesBecause 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:51jballancor maybe it was privmsg
20:52dakroneRaynes: didn't realize that meant I sucked
20:52Raynesdakrone: You don't. You're awesome. <3
20:53Rich_MorinRaynes: Can you give me the syntax for that?
20:53dakroneand crouton uses the same jsoup version (1.7.1) that hickory does
20:53Rich_Morin(Google isn't helping)
20:53Raynesdakrone: Wrong hickory.
20:54Raynesdakrone: My fork.
20:54dakroneahh
20:54Raynes$google leiningen exclusions
20:54lazybot[leiningen/sample.project.clj at master · technomancy ... - GitHub] https://github.com/technomancy/leiningen/blob/master/sample.project.clj
20:54RaynesRich_Morin: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L42
20:55RaynesRich_Morin: It looks like :dependencies [[clj-http :exclusions [org.jsoup/jsoup]]]
20:56Rich_MorinRaynes: tnx!
20:58Raynesdakrone: You don't have to change anything. This is what exclusions are for.
21:11callenyogthos: comrade! hello.
21:12astevewhy would I use com. in clojure ns?
21:13SegFaultAXasteve: You mean like (ns com.foo.bar ...)?
21:13asteveyes
21:13tyler_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:13tyler_im trying reify but not sure if the right route
21:14SegFaultAXasteve: Presumably because that's the style used in Javaland for creating packages.
21:16ToxicFrogasteve: Java convention is to use your hostname, reversed, as a fully qualified package name.
21:16ToxicFrogSo e.g. Java libraries released by Google are all in the com.google.* namespace, and my stuff is all in ca.ancilla.*
21:17asteveah!
21:17astevethanks
21:19tieTYT2is there a way to write this more concisely? (if (= "" (str (class cookie-spec-factory))) nil (class cookie-spec-factory))
21:20SegFaultAXtyler_: Probably as you would any other interface.
21:20SegFaultAXtyler_: Because of type erasure I'm not sure it matters that the interface is generic. I could be dead wrong about that though.
21:22ToxicFrogtieTYT: it seems like there should be something you can do with if-let but I can't think of what.
21:24metellustieTYT2: (when-let [foo (not-empty (class cookie-spec-factor))] foo)
21:24metellusor actually just (not-empty (class cookie-spec-factor))
21:24ToxicFrogI mean, there's (let [csf (class cookie-spec-factory)] (if (= "" (str csf)) nil csf))
21:24ToxicFrogoo
21:26SegFaultAXtieTYT2: Probably want (not-empty (str (class cookie-spec-factory)))
21:26metellus,(class (class 2))
21:26clojurebotjava.lang.Class
21:27metellusoh, yeah.
21:27tieTYT2ok but that still needs to be in an if right?
21:28tieTYT2oh nm
21:28tieTYT2awesome
21:28tieTYT2thanks
21:28SegFaultAXtieTYT2: In what case would that thingy not have a class, though?
21:28SegFaultAXDoes anything other than nil not have a class?
21:29tieTYT2your suggestion works for me
21:59gfrederickshyPiRion: I just thought of an elegant way to make a lazy seq of the natural numbers with their factorizations
22:00gfredericksmaybe.
22:18yeditomoj: "I think the fact that it's basically impossible contributes to the fact that you hardly ever see it"
22:18yedigood point
22:19SegFaultAXyedi: What was that in reference to? Because that's a pretty good quote.
22:20supersymthe 'basically' really does it
22:25yedii had asked: is it a code smell when you see aggregate data structures (lists, maps) being used as keys to maps
22:25yediSegFaultAX: ^
22:26gfredericksyedi: sweet, I was just doing that
22:26gfrederickssets of primes as keys
22:26gfredericksI should just multiply them together :D
22:26brehautbbloom: how often do you claim credit for bloom filters?
22:27yediyea the more #clojurians talked about it, the more it just seems like it's because other languages don't offer such things natively
22:28gfredericksruby and erlang do I think?
22:29SegFaultAXyedi: Why would that be a code smell?
22:29yediyedi: yea guys i have no idea either way, just wondering what the pros/cons were
22:29SegFaultAXgfredericks: Sure. Ruby in particular doesn't enforce the hashability constraint for keys like Python does.
22:30SegFaultAXRuby is happy to use strings, arrays, and hashes as keys.
22:30gfredericksRuby is happy.
22:31gfredericksin the oblivious sort of way.
22:31yediiin ruby, are the keywords functions?
22:31gfredericksnothing is a function
22:31SegFaultAXyedi: Naw, but it'd be easy to patch in.
22:31yedithat's that i guess
22:32bbloombrehaut: i basically invented those when i was negative 10 years old
22:32brehauthigh five
22:32brehautthats good work
22:32brehauti dont think i achieved anything positive until i was at least +10
22:33SegFaultAXbbloom: Did you make sure to check when they were invented to accurately reflect your relative age? :)
22:33bbloomSegFaultAX: no
22:33bbloomSegFaultAX: i made a number up
22:34SegFaultAXHah, damn.
22:37rationalrevoltfor 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:37brehautrationalrevolt: you know about the session middlewares?
22:38SegFaultAXrationalrevolt: There are multiple session backends. In memory is one, cookies are another.
22:38brehauthttps://github.com/ring-clojure/ring/tree/master/ring-core/src/ring/middleware/session
22:38brehautrationalrevolt: in memory session storage probably shouldnt be used outside of dev time
22:38brehauthttps://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj thats the top level api
22:40rationalrevolti 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:42xeqirationalrevolt: lib-noir has an implementation of stateful sessions https://github.com/noir-clojure/lib-noir/blob/master/src/noir/session.clj
22:43xeqiI prefer the normal ring sessions, but some people like them
22:58rationalrevoltnoir seems to use a dynamic var, are there other ways to approach this?
22:59rebcabin_re
23:02brehautrationalrevolt: use a middleware that closes over an atom or ref
23:03rationalrevoltyup, thanks
23:18ToxicFrogHow do I use map literals in a macro?
23:19ToxicFrogI mean, as I understand it, something like this should work: (defmacro foo [name contents] `(def ~name { ~@a }))
23:19ToxicFrogAnd then you can (foo bar [:a 1 :b 2]) to get (def bar { :a 1 :b 2 })
23:20ToxicFrogBut it fails at the (defmacro) itself with "map literal must contain an even number of forms"
23:23amalloyToxicFrog: (hash-map ~@a)
23:23amalloyor, rather, i suppose, (apply hash-map a)
23:24amalloyi guess ~(apply hash-map a) comes closest to the intended meaning
23:24DeranderHey, 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:24ToxicFrogAha. Thanks.
23:25ToxicFrogDerander: this is what I used last time I had to depend directly on git: https://github.com/tobyhede/lein-git-deps
23:26xeqiDerander: nothing built in. The recommended way to work on two projects in parallel is checkouts
23:26DeranderToxicFrog: I will explore this
23:26ToxicFrogIt'll take any git URL so you can :git-dependencies [[file://path/to/my/library/.git]]
23:26Deranderxeqi: "checkouts" in the git sense? or something else?
23:26ToxicFrogThere might be something better by now, though, that was ages ago
23:27xeqiDerander: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#checkout-dependencies
23:27xeqihad to go find it
23:28Deranderxeqi: ToxicFrog: lein checkouts seems like the way to go
23:28Deranderthanks all!
23:36devnAnyone have a good resource that discusses Clojure's data structures compared to doing copy-on-write?
23:36devnI found this: http://www.lispcast.com/3-things-java-can-steal-from-clojure
23:36devnbut I suspect there's something better out there.
23:49xeqidevn: 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:49xeqialso 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:49xeqi* applicable
23:58devni forgot about daniel's talk xeqi -- he's a great speaker
23:58devnand i got a lot out of that talk
23:58devnxeqi: thanks for the both of them