2013-04-03
| 00:02 | muhoo | yacin: ya |
| 00:03 | Raynes | I simply recommend you ignore anything I've ever written regarding it. |
| 00:04 | muhoo | the name says it all |
| 00:05 | yacin | haha |
| 00:14 | rationalrevolt | is there a function that converts a map with string keys to a map with keyword keys in core? |
| 00:14 | capcrunch | have anyone tested clojure on zos ? |
| 00:14 | capcrunch | it just core dumps the jvm |
| 00:15 | `arrdem | rationalrevolt: no, but there's always (keyword) |
| 00:16 | `arrdem | ,(reduce (fn [m [skey v]] (assoc m (keyword skey) v)) {} {"foo" 1}) |
| 00:16 | clojurebot | {:foo 1} |
| 00:16 | `arrdem | rationalrevolt: ^^ |
| 00:16 | rationalrevolt | alright :) |
| 00:16 | `arrdem | can haz karma? XD |
| 00:17 | `arrdem | ah nvm. |
| 00:21 | rationalrevolt | i was looking for something ready made, that will do this recursively |
| 00:21 | `arrdem | I mean... |
| 00:21 | `arrdem | implementing the recursion case for that isn't hard. |
| 00:21 | amalloy | clojure.walk/keywordize-keys, but i recommend re-evaluating why you need it |
| 00:23 | rationalrevolt | i'm trying to build on cheshire json/decode to give me keyword maps , since i don't like big destructuring forms |
| 00:23 | amalloy | so ask cheshire to give you back keywords |
| 00:24 | amalloy | asking for strings back and then converting them yourself is such a pain |
| 00:24 | dakrone | ,(cheshire.core/decode "{\"foo\": \"bar\"}" true) |
| 00:24 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: cheshire.core> |
| 00:24 | dakrone | drat |
| 00:24 | dakrone | anyway, that's how you do it |
| 00:24 | dakrone | ,(require 'cheshire.core) |
| 00:24 | clojurebot | #<FileNotFoundException java.io.FileNotFoundException: Could not locate cheshire/core__init.class or cheshire/core.clj on classpath: > |
| 00:25 | amalloy | dakrone: i get that true is available, but why? it's not nearly as readable as (decode s keyword), and no faster |
| 00:26 | dakrone | amalloy: because it was there before custom keyword functions, so cheshire supports either 'true' or a function |
| 00:26 | dakrone | backwards-compatibility |
| 00:28 | rationalrevolt | got it, thanks amalloy |
| 00: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 |
| 00:32 | amalloy | i'm curious if you have any plan in place for when that day is, dakrone |
| 00:34 | dakrone | no plan yet, just looking forward |
| 00:35 | amalloy | i think we've dropped 1.2 support from the flatland projects by now |
| 00:36 | amalloy | of course yours get used more; i'm just providing a data point, not suggesting you do the same |
| 00:37 | samedhi | What is best practice for automatic testing with lein? Is it still lein-lazytest? |
| 00: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 |
| 00:43 | tieTYT2 | same with the .get |
| 00:50 | yacin | any recommendations for a cassandra client library? there are quite a few floating around out there |
| 00:51 | tieTYT2 | ohh, so (.foo) is different from (. foo) in clojure? |
| 00:51 | tieTYT2 | ah nm |
| 00:52 | tieTYT2 | the former is expanded to the latter |
| 01:08 | SegFaultAX | ,('foo {'foo 1}) |
| 01:08 | clojurebot | 1 |
| 01:08 | `arrdem | ok good I'm still alive. |
| 01:09 | SegFaultAX | Interesting. I didn't realize symbols, like keywords, were similar to keywords when called (eg they'll `get` themselves) |
| 01:10 | SegFaultAX | Heh, that was strangely phrased. Anyway. |
| 01:21 | mjc | lazybot: coin |
| 01:21 | lazybot | mjc: Heads. |
| 01:27 | arrdem | lazybot: d20 |
| 01:41 | akhudek | technomancy: your post on parentheses was amazing, just saw it now |
| 01:45 | SegFaultAX | I hadn't seen it yet either. Well done. :) |
| 01:49 | borkdude | I think the cornery style of XML fits Clochure nice: a match made in heaven |
| 02:22 | pdmct | ,((list :a) 0) |
| 02:22 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn> |
| 02:24 | pdmct | ,((list :a) 0) |
| 02:24 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn> |
| 02:35 | SegFaultAX | pdmct: That doesn't make any sense, in case you're wondering. |
| 02: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 |
| 02:36 | pdmct | s/a// |
| 03:52 | dbushenko | hi all! |
| 03:53 | dbushenko | what do you guys use to manage sessions in a compojure application? |
| 04:09 | asteve | do you recommend ring + compojure? |
| 04:53 | mpenet | yacin: I would advise to use Alia, but I am biaised :) |
| 04:54 | mpenet | yacin: it just works and wraps a solid/recent library so it's a good choice |
| 04:58 | dribnet | a little out of my element trying to get a tagged literal to work in the cljs compiler |
| 04:59 | dribnet | i have it working in the cljs reader, but can't for the life of me hoist it out to the compiler |
| 04:59 | tomoj | you can't |
| 04:59 | dribnet | you kind of can https://groups.google.com/forum/?fromgroups=#!topic/clojurescript/iFCDCZBPHSA |
| 04:59 | tomoj | I mean, you can't just hoist it |
| 04:59 | tomoj | you have to write a different one |
| 05:00 | dribnet | aha, yes. |
| 05:00 | dribnet | in some clj code. |
| 05:00 | tomoj | oh, but your problem is about how to modify *cljs-data-readers*? |
| 05:00 | dribnet | here's my clj test code |
| 05:00 | dribnet | (alter-var-root #'t/*cljs-data-readers* assoc "js" identity) |
| 05:02 | dribnet | the cljs seems to compile with that, but using the tag in the src doesn't work |
| 05:02 | dribnet | ("java.lang.RuntimeException: No reader function for tag...") |
| 05:03 | dribnet | perhaps as a warmup I should just edit the compiler code directly without trying all this slight of hand stuff in my project... |
| 05:03 | tomoj | you also did the :require-macros that herwig suggested? |
| 05:04 | dribnet | youbetcha |
| 05:04 | dribnet | i even have an empty macro in my file to make sure its being read in |
| 05:05 | dribnet | at that point it wasn't clear to me what voodoo i could do to further debug what's happening. |
| 05:12 | dribnet | hi chas |
| 05:13 | dribnet | i was just whining to tomoj about not being able to get my tagged literal to work in the cljs compiler |
| 05:14 | tomoj | I can't get it to work either |
| 05:14 | dribnet | thx. i thought i was going crazy. :) |
| 05:27 | bulters | anyone here any experience with setting up a server for clojure apps? |
| 05:27 | bulters | I have a clean vps which I would like to use to experiment with clojure webapps |
| 05:28 | bulters | but - coming from ruby-land - it's a bit unclear whether to use an app server like immutant or jetty... |
| 05:32 | ebaxt | bulters: Are you thinking about a simple webapp, or do you need infrastructure like message brokers etc? |
| 05:49 | tomoj | it would be cool if let supported for's :when |
| 05:49 | tomoj | I have (if .. (let .. (if .. (let .. (if ...))))) |
| 05:49 | bulters | ebaxt: simple webapp, nothing fancy yet... currently working on some toy projects |
| 05:51 | bulters | by the time I need the fancy stuff I'll be a java app deployment expert ;-) |
| 05:52 | arcatan | tomoj: maybe you could simplify it with if-let? |
| 05:52 | tomoj | in this case, no |
| 05:53 | tomoj | :when would also fix the problem with multiple bindings in if-let |
| 05:53 | tomoj | you just say what you mean |
| 05:53 | mpenet | it's possible with the new -> macros isn't it? |
| 05:53 | mpenet | as-> and cond-> |
| 05:53 | tomoj | ah, hmm |
| 05:53 | tomoj | didn't think to try them |
| 05:54 | tomoj | https://www.refheap.com/paste/3b42d3250c566c3224300fa06 |
| 05:54 | tomoj | already wrote it the ugly way, maybe I'll try them later |
| 05:56 | dribnet | could you have twisted for to accomplish the same thing? |
| 05:57 | tomoj | interesting idea |
| 05:58 | tomoj | I was thinking for-bindings like `x [y]` could implement let+-bindings like `x y` |
| 05:58 | tomoj | (but seems problematic, even ignoring the performance implications..) |
| 05:59 | tomoj | actually, no, not problematic? |
| 05:59 | dribnet | agreed. and equally ugly. |
| 06:00 | tomoj | that's really interesting though |
| 06:00 | tomoj | I've imagined a for macro for reducers |
| 06:01 | dribnet | then again, your logic seems to depend on the :when coming before the let |
| 06:01 | tomoj | like (let [:when .. ...] ..) ? |
| 06:02 | tomoj | in the r/for case, I think that corresponds to r/filter'ing, but you have nothing to filter |
| 06:02 | dribnet | i mean that even if you could join all your lets together |
| 06:02 | dribnet | and then convert your if's to :whens |
| 06:03 | dribnet | the whens would be after the let, which i don't think is what you want |
| 06:04 | tomoj | (if (= (count args) 2) (let [[target val] args :when (symbol? target) targetexpr (analyze-symbol ...) :when (:dynamic (:info target))] `(do ...))) |
| 06:05 | tomoj | or I guess (let [[target val] args :when (= (count args) 2) ...]) |
| 06:06 | dribnet | ah, ok. |
| 06:07 | tomoj | seems like my imagined let is `for` 'inside' (r/take 1) |
| 06:07 | tomoj | not sure what I mean by "'inside'" |
| 06:10 | tomoj | but there is probably a lens involving Maybe for the heads of lists |
| 07:15 | invis_ | Hi everyone, guys could you help me a bit please |
| 07:15 | invis_ | (doto (xy-plot Pow (first x)) |
| 07:15 | invis_ | (for [X x] |
| 07:15 | invis_ | (add-lines Pow X) |
| 07:15 | invis_ | ) |
| 07:15 | invis_ | view) |
| 07:16 | invis_ | Why I have "Wrong number of args (5) passed to: core$for" here ? |
| 07:17 | tomoj | ,(macroexpand-1 '(doto x (for [y z] w))) |
| 07:17 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: core$for> |
| 07:18 | tomoj | well, (doto x (for [y z] w)) is trying to do (for x [y z] w) which doesn't make sense |
| 07:18 | invis_ | ohh |
| 07:19 | delihiro_ | ,(doc doto) |
| 07: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))" |
| 07:19 | invis_ | So how I can add lines to incanter xy-plot in loop ? |
| 07:19 | tomoj | the most straightforward way is (let [plot (xy-plot ...)] (doseq [X x] ...) plot) |
| 07:20 | invis_ | thank you, will try |
| 07:20 | tomoj | for? |
| 07:20 | clojurebot | for is not used often enough. |
| 07:21 | tomoj | (doc clojurebot) |
| 07:21 | clojurebot | No entiendo |
| 07:21 | tomoj | (dec clojurebot) |
| 07:21 | lazybot | ⇒ 19 |
| 07:22 | tomoj | I was hoping he'd say "for is not a loop" |
| 07:24 | tomoj | bit strange what (def foo) complies to in cljs |
| 07:24 | tomoj | compiles |
| 07:24 | tomoj | seems just e.g. "cljs.user.foo;" |
| 07:25 | tomoj | oh, I see, that makes sense |
| 07:27 | invis_ | still cant :( |
| 07:27 | invis_ | (doto (xy-plot Pow (first x)) |
| 07:27 | invis_ | (doseq [X (rest x)] |
| 07:27 | invis_ | (add-lines Pow X)) |
| 07:27 | invis_ | view) |
| 07:27 | invis_ | java.lang.IllegalArgumentException: doseq requires a vector for its binding |
| 07:27 | invis_ | but alone (doseq [X (rest x)] (println X) works |
| 07:38 | invis_ | ok, I did that :) |
| 08:10 | invis_ | guys How I can return same result, that will print this expression ? |
| 08:10 | invis_ | (doseq [P X A Avalue B Bvalue] (println (+ (* A (- 1 P) (* B P)))) ) |
| 08:10 | algernon | (let [result (+ (* A (- 1 P) (* B P))))] (println result) result) inside the doseq |
| 08:10 | invis_ | there redundant X in square brekets |
| 08:11 | invis_ | thank you ! will try |
| 08: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 |
| 08: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? |
| 08:14 | invis_ | to algernon: But doseq always return nil, so it doesnt depends what inside ;( |
| 08:15 | __zero | I don't know if what I said makes sense |
| 08:20 | michaelr525 | hello |
| 08: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) |
| 08:25 | invis_ | algernon: thanks, I already use map there |
| 08:52 | invis_ | hmm, clojure process using 100% after my computation :( |
| 08:52 | invis_ | can you tell me where I wrong please |
| 08:52 | invis_ | (def Pmix |
| 08:52 | invis_ | (map (fn [a b] |
| 08:52 | invis_ | (for [X x] |
| 08:52 | invis_ | (map (fn [P] |
| 08:52 | invis_ | (+ (* a (- 1 P)) (* b P))) |
| 08:52 | invis_ | X))) |
| 08:52 | invis_ | Avalue Bvalue) |
| 08:53 | invis_ | ) |
| 09:02 | invis_ | Guys can you help me with computing array size of 13*100, from another 3 arrays. |
| 09:02 | invis_ | X is a array with size of 13*100, Avalue and Bvalue array too, but with size of 1*13 |
| 09:02 | invis_ | 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:03 | invis_ | This is my Fn, but it eat 100% proc: |
| 09:03 | invis_ | (def Pmix |
| 09:03 | invis_ | (map (fn [a b] |
| 09:03 | invis_ | (for [X x] |
| 09:03 | invis_ | (map (fn [P] |
| 09:03 | invis_ | (+ (* a (- 1 P)) (* b P))) |
| 09:03 | invis_ | X) |
| 09:03 | invis_ | ) |
| 09:03 | invis_ | ) |
| 09:03 | invis_ | Avalue Bvalue) |
| 09:03 | invis_ | ) |
| 09:27 | corecode | invis_: what's x? |
| 09:28 | pl6306 | What clojure http library supports windows authentication? I know the java one does but I wanted to ask before I start digging. |
| 09:30 | invis_ | corecode: X is array size 13*100 |
| 09:34 | TimMc | invis_: Please use a pastebin, such as refheap.com, instead of pasting multiple lines into the channel. |
| 09:43 | asteve | do you recommend ring + compojure? |
| 09:43 | asteve | I want a very lightweight http service |
| 10:15 | TimMc | asteve: That's the most common service. |
| 10:16 | TimMc | 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 | ejackson | 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 | llambda | 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 | llambda | 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 | hyPiRion | 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 | llambda | 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 | lynaghk` | 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 | cemerick | 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 | cemerick | no, no easy way |
| 11:39 | lynaghk` | yeah |
| 11:39 | lynaghk` | 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: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 | lynaghk` | cemerick: e.g., (eval (list + 1 (constantly 2))) throws a "no ctor found" |
| 11:44 | cemerick | well, yeah |
| 11:44 | cemerick | lynaghk`: I thought you were trying to wildcard vars? |
| 11:45 | cemerick | 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 | no7hing | https://github.com/weavejester/environ |
| 12:06 | no7hing | 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 | mpenet | by environ I mean |
| 12:12 | mpenet | 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 | no7hing | 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 | mpenet | it just did work flawlessly |
| 12:17 | mpenet | 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 | mpenet | it's not mentionned in the docs |
| 12:27 | mpenet | 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 | mpenet | 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 | mpenet | 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 | mpenet | 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 | no7hing | 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 | hyPiRion | 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 | duncanm | 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 | corecode | hyPiRion: nice. |
| 12:59 | corecode | 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 | corecode | 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 | hyPiRion | It's fun, but it eats time |
| 13:07 | tomoj | https://www.refheap.com/paste/cb63f74e897dadbcd9d68b51d |
| 13:07 | tomoj | interesting |
| 13:07 | tomoj | def metadata is evaluated twice? |
| 13:08 | tomoj | 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 | corecode | nor* |
| 13:09 | corecode | they know more about one subject. |
| 13:09 | corecode | 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 | corecode | 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 | hyPiRion | tomoj: actually, we designed an evolving CTRNN last exercise, so yeah, that should be doable |
| 13:15 | hyPiRion | 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 | hyPiRion | heh, redundant is redundant |
| 13:19 | tomoj | but yeah, very cool |
| 13:19 | tomoj | 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 | tomoj | kind of cool |
| 13:25 | tyler_ | https://github.com/bbatsov/clojure-style-guide seems to conflict |
| 13:25 | tyler_ | says 2 spaces per indentation level |
| 13:25 | tyler_ | then says vertically align function arguments |
| 13:25 | tyler_ | isn't everythign a functio agument in lisp? |
| 13:25 | tyler_ | function* |
| 13:26 | tomoj | no |
| 13:26 | tomoj | there are also macros |
| 13:26 | tomoj | 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 | tyler_ | visualy |
| 13:27 | tomoj | not if you follow that style guide |
| 13:27 | tyler_ | which is what the style guide is for |
| 13:27 | tyler_ | ah |
| 13:27 | tyler_ | 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 | tyler_ | 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 | tomoj | ..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 | technomancy | 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 | technomancy | kinda sketchy |
| 13:50 | borkdude | today I spend two hours with a student configuring his emacs, recommend him technomancy starter-kit ;) |
| 13:51 | borkdude | hmm, my spelling is horrible today |
| 13:53 | tyler_ | emacs is cool... |
| 13:54 | tyler_ | i don't use it though |
| 13:54 | tyler_ | heh |
| 13:54 | technomancy | emacs isn't really omkase |
| 13:54 | technomancy | it's just an illusion |
| 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 | tomoj | 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 | cemerick | 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 | Raynes | 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 | bbloom | 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 | lynaghk | 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 | lynaghk | 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 | squidz | 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 | bbloom | 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 | supersym | 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 | squidz | 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 | 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 | tomoj | 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 | tomoj | &(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 | tomoj | would be a weird thing for an IO reducer |
| 14:49 | tomoj | 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 | Raynes | I'm a heretic. |
| 15:01 | bbloom | mmm macvim |
| 15:01 | bbloom | (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 | n_b | 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 | ravster1 | 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 | ravster1 | 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 | SegFaultAX | 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 | n_b | 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 | tomoj | 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 | SegFaultAX | 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 | cemerick | 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 | cemerick | someone else hit this a little while back, too |
| 15:38 | cemerick | 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 | cemerick | fn ctor, that is |
| 15:40 | cemerick | lynaghk: https://github.com/jonase/kibit/issues/53 |
| 15:40 | cemerick | 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 | cemerick | 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 | dbushenko | 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 | Raynes | 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 | hiredman | 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 | callen | it leads to compulsive "mark read"s |
| 16:18 | Raynes | I meant starred. |
| 16:18 | Raynes | Watching sucks. |
| 16:18 | callen | Raynes: yes it does. |
| 16:19 | tyler_ | whats SNAPSHOT mean in clojure parlance? |
| 16:19 | tyler_ | 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 | tyler_ | 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 | tyler_ | releases are immutable, snapshots are mutable |
| 16:24 | tyler_ | 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 | technomancy | actually I only watch repos |
| 16:38 | technomancy | 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 | technomancy | oh geez; that thing? |
| 16:40 | technomancy | yeah, of course; it's useless. I only pay attention to email, which I can actually filter properly. |
| 16:41 | technomancy | it's like a crappy version of an inbox, isn't it? |
| 16:42 | callen | technomancy: I hates it :( |
| 16:42 | callen | 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 | Raynes | All of them are terrible. |
| 16:52 | Raynes | 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 | n_b | seems the bulk switched to ST(2|3) |
| 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 | callen | 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 | tomoj | e.g. javascript >:[ |
| 17:41 | tomoj | 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 | tomoj | :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 | AimHere | Multiple versions of equality tend to give me the heebie jeebies |
| 17:44 | tomoj | s/one loose worry/huge gaping hole/ |
| 17:44 | tomoj | L |
| 17:44 | tomoj | ? |
| 17:44 | technomancy | AimHere: clojure *generally* gets hashing right |
| 17:44 | technomancy | except for numerics sometimes |
| 17:44 | technomancy | 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 | technomancy | actually I take that back |
| 17:45 | technomancy | it could be possible if 2 were an Integer and foo were a Long |
| 17:45 | technomancy | 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 | amalloy | 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 | callen | 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 | technomancy | I think there was more to it than that, but that's the bit that I recall best. |
| 17:50 | technomancy | 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 | callen | 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 | aaelony | I can go to the window then kill it, but there's likely a better way |
| 18:02 | aaelony | 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 | Willyfrog | 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 | aaelony | C-x o then C-x k |
| 18:07 | hyPiRion | oh |
| 18:08 | hyPiRion | C-x 1 then? |
| 18:08 | blrm | yeah |
| 18:08 | aaelony | before, I could just type 0 and be done |
| 18:08 | aaelony | C-x 1 works |
| 18:08 | aaelony | 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 | hyPiRion | (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 | aaelony | blrm: I'm just going to the end of the form and executing, i.e. C-x C-e |
| 18:14 | aaelony | 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 | blrm | aaelony: np! |
| 18:15 | aaelony | cool |
| 18:16 | aaelony | C-c Cp-p is quite nice |
| 18:16 | aaelony | 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 | no7hing | 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 | technomancy | seriously though, you can do something like this: (eval-after-load 'nrepl '(define-key (kbd "C-TAB") 'nrepl-complete)) |
| 18:28 | technomancy | 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 | technomancy | 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 | tomoj | 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 | brehaut | 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 | brehaut | 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 | technomancy | genuine question |
| 18:42 | hyPiRion | brehaut: cooler? "Oh, it has 2 spaces less here, and 2 spaces more here" |
| 18:42 | hyPiRion | 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 | technomancy | 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 | brehaut | 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 | hyPiRion | 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:47 | hyPiRion | SegFaultAX: @:{D> |
| 18:47 | hyPiRion | Smiling guy with turban, moustache and beard |
| 18:47 | SegFaultAX | That's what I got from that. |
| 18:50 | SegFaultAX | 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 | tyler_ | 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 | brehaut | 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 | technomancy | 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 | technomancy | 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 | n_b | 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 | SegFaultAX | 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 | seancorfield | (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 | S11001001 | 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 | tieTYT | 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 | Willyfrog | :) |
| 19:09 | tieTYT | brehaut: that seems to be hanging for me |
| 19:09 | tieTYT | 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 | brehaut | ,#'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 | tieTYT | 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 | hyPiRion | ,^+'# #'+^ |
| 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 | tieTYT | 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 | tieTYT | since it's sticking around, I disagree with him. Use is more consise |
| 19:15 | tieTYT | 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 | brehaut | :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 | SegFaultAX | (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 | Bronsa | read-string reads only an element |
| 19:18 | Bronsa | 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 | ravster | SegFaultAX: oh, but I don't know where in the nest {:e 'f} is going to be. |
| 19:20 | ravster | 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 | ravster | I think its failing because I don't have anything happening in the 'else' part |
| 19:22 | ravster | postwalk returns the same |
| 19:26 | Bronsa | hyPiRion: '+'#@#'+^+'# #'+^+'#@#'+' |
| 19:29 | tomoj | I don't think you want clojure.walk |
| 19:29 | tomoj | seems you could do it with a stoppable walk, but clojure.walk doesn't have one handy.. |
| 19:29 | tomoj | though it lets you write one without much trouble |
| 19:30 | tomoj | 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 | ravster | tree-seq? |
| 19:32 | tomoj | https://gist.github.com/tomjack/9f89e03eb42bef6ddeab |
| 19:32 | tomoj | 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 | hyPiRion | no wait- |
| 19:34 | Bronsa | well |
| 19:35 | Bronsa | , /(`_`/) |
| 19:35 | clojurebot | #<core$_SLASH_ clojure.core$_SLASH_@9b328a> |
| 19:35 | tomoj | hmm |
| 19:35 | tomoj | &(->> {: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 | ravster | *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 | tomoj | it's just a function |
| 19:37 | tomoj | ..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 | hyPiRion | hmm, there must be some palindrome programs out there |
| 19:43 | hyPiRion | ,(#(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 | hyPiRion | ,((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 | Bronsa | ,(((comp comp) ('+' (fn [nf]' '[fn] nf) '+') (comp comp))) |
| 19:50 | clojurebot | nil |
| 19:50 | Bronsa | fail paste |
| 19:50 | Bronsa | , (('+'# (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 | hyPiRion | ,(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 | corecode | rules* |
| 20:01 | corecode | same result backwards and forwards? |
| 20:02 | brehaut | next challenge: write a program that runs as clojure of factjor |
| 20:02 | brehaut | 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 | hyPiRion | e.g. (foo bar bar foo) |
| 20:03 | corecode | and still work |
| 20:04 | corecode | 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 | corecode | longest wins, i guess |
| 20:04 | corecode | ,(comment comment) |
| 20:04 | clojurebot | nil |
| 20:05 | corecode | expand at will. |
| 20:05 | corecode | 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 | jballanc | boo |
| 20:06 | hyPiRion | jballanc: palindrome and quine? |
| 20:06 | jballanc | yup-ish |
| 20:06 | corecode | haha |
| 20:06 | corecode | 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 | hyPiRion | 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 | hyPiRion | 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 | Rich_Morin | 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 | jballanc | ,((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 | SegFaultAX | ,((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 | jballanc | lazybot is triggered off with "&" right? |
| 20:44 | jballanc | &(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 | Raynes | 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 | Raynes | 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 | Raynes | 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 | tyler_ | 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 | ToxicFrog | 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 | asteve | 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 | SegFaultAX | 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 | metellus | 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 | ToxicFrog | 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 | tieTYT2 | oh nm |
| 21:28 | tieTYT2 | awesome |
| 21:28 | tieTYT2 | thanks |
| 21:28 | SegFaultAX | tieTYT2: In what case would that thingy not have a class, though? |
| 21:28 | SegFaultAX | 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 | gfredericks | 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 | yedi | 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 | yedi | SegFaultAX: ^ |
| 22:26 | gfredericks | yedi: sweet, I was just doing that |
| 22:26 | gfredericks | sets of primes as keys |
| 22:26 | gfredericks | 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 | SegFaultAX | Ruby is happy to use strings, arrays, and hashes as keys. |
| 22:30 | gfredericks | Ruby is happy. |
| 22:31 | gfredericks | 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 | brehaut | thats good work |
| 22:32 | brehaut | 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 | bbloom | 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 | brehaut | rationalrevolt: in memory session storage probably shouldnt be used outside of dev time |
| 22:38 | brehaut | 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 | xeqi | 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 | ToxicFrog | I mean, as I understand it, something like this should work: (defmacro foo [name contents] `(def ~name { ~@a })) |
| 23:19 | ToxicFrog | And then you can (foo bar [:a 1 :b 2]) to get (def bar { :a 1 :b 2 }) |
| 23:20 | ToxicFrog | 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 | amalloy | or, rather, i suppose, (apply hash-map a) |
| 23:24 | amalloy | 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 | ToxicFrog | 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 | xeqi | had to go find it |
| 23:28 | Derander | xeqi: ToxicFrog: lein checkouts seems like the way to go |
| 23:28 | Derander | thanks all! |
| 23:36 | devn | Anyone have a good resource that discusses Clojure's data structures compared to doing copy-on-write? |
| 23:36 | devn | I found this: http://www.lispcast.com/3-things-java-can-steal-from-clojure |
| 23:36 | devn | 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 | xeqi | 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 | xeqi | * applicable |
| 23:58 | devn | i forgot about daniel's talk xeqi -- he's a great speaker |
| 23:58 | devn | and i got a lot out of that talk |
| 23:58 | devn | xeqi: thanks for the both of them |