2012-10-25
| 00:01 | unnali | ambrosebs: looks fun! |
| 00:01 | ivan | ambrosebs: tell the mailing list |
| 00:03 | ambrosebs | ivan: ok |
| 00:04 | technomancy | ambrosebs: congratulations |
| 00:04 | ivan | very pleased to hear "We capture the Clojure idiom of using maps with known keyword fields by using heterogeneous map types." |
| 00:05 | technomancy | anyone care to fork the repo and add a .mobi? =) |
| 00:05 | ambrosebs | ivan: there's a wealth of research related to O'Caml records that take this even further. |
| 00:05 | ambrosebs | technomancy: cheers :) |
| 00:33 | georgek | hi, I'm trying to read a #inst date from a map which I've def'd as 'foo' in the repl, so the data looks like :date #inst "2012-10...", however when I try (read-string (:date foo)) I get the error 'NullPointerException java.io.StringReader.<init> (StringReader.java:50) |
| 00:34 | georgek | anyone know what the problem might be? I'm using Clojure 1.4 |
| 00:39 | muhoo | what is an #inst? |
| 00:39 | georgek | an instant literal |
| 00:42 | georgek | hmm, if I define a test #inst like (def test "#inst ....") it works fine |
| 00:43 | georgek | I guess the map is messed up somehow |
| 00:44 | unnali | hm |
| 00:44 | unnali | do you need to use READ-STRING if it's defined as #inst "2012-10…" in the map? |
| 00:44 | unnali | like, what do you get for just (:date foo)? |
| 00:44 | georgek | nil |
| 00:45 | georgek | and nil for the class and type as well |
| 00:45 | unnali | I guess it is a bit messed up then! |
| 00:45 | georgek | haha, yep |
| 00:46 | timewarrior | Hi Everyone. I was wondering if someone could help me with ring-sessions. I have a working implementation. But whenever I restart the server all the session data is lost. I am using a mongodb based session helper which works.. but am wondering if using a db backed data store is the best practise |
| 00:50 | muhoo | timewarrior: persist ring sessions, theere's a lib for that |
| 00:51 | timewarrior | something like this? https://github.com/timewarrior/mongodb-session |
| 00:51 | timewarrior | this is persisting sessions.. |
| 00:51 | muhoo | yep. there's one for couch too, probably others |
| 00:52 | timewarrior | yea.. but I am just wondering that for every app which needs persistent logins (i.e. no need to login if server restarts) - do they persist the session or do they use some other strategy |
| 00:52 | muhoo | probably persist the sessions to disk/db |
| 00:53 | muhoo | that's what i've done anyway |
| 00:53 | timewarrior | awesome.. appreciate your responses |
| 00:53 | timewarrior | did you build your own auth layer or did you use something like friend |
| 01:00 | timewarrior | I had another questions, is there any way to access request object at the route handling layer |
| 01:02 | Sgeo | I forget where exactly this syntax is used, but something like [a b :as r] |
| 01:02 | Sgeo | For Compojure and Noir (based on Compojure) I think |
| 01:02 | timewarrior | I am using compojure |
| 01:02 | Sgeo | Well, as in, for Compojure, and also for Noir (which uses Compojure) |
| 01:03 | timewarrior | great.. thanks.. |
| 01:03 | timewarrior | I am still trying to wrap my head around compojure |
| 01:04 | Raynes | Your head will be all bent like. |
| 01:05 | timewarrior | :) |
| 01:21 | zackzackzack | In something like (defn a [&b] b), what does the & do? I know that (defn a [& b] b) would collect all arguments into b, but what happens when the space is left out? |
| 01:22 | Raynes | &((fn [&b] &b) 1 2 3) |
| 01:22 | lazybot | clojure.lang.ArityException: Wrong number of args (3) passed to: sandbox7657$eval319527$fn |
| 01:22 | Raynes | &((fn [&b] &b) 1) |
| 01:22 | lazybot | ⇒ 1 |
| 01:22 | amalloy | gives you a variable named &b |
| 01:22 | Raynes | It becomes a symbol. |
| 01:24 | zackzackzack | So &b is the same as b effectively? |
| 01:24 | unnali | zackzackzack: nope, it's a different symbol entirely. |
| 01:24 | unnali | but it "acts" like b, there's nothing special about it per se. |
| 01:25 | zackzackzack | Right, sorry that is the idea I meant to express |
| 01:25 | zackzackzack | Thanks! |
| 01:25 | Sgeo | zackzackzack, note that in the body of a macro, &env and &form have special meaning. |
| 01:25 | amalloy | not a helpful thing to learn at this time, though |
| 01:25 | zackzackzack | Actually yes it is |
| 01:25 | zackzackzack | I'm messing around with defn |
| 01:26 | Sgeo | zackzackzack, amalloy may have been referring to my mention of &env and &form |
| 01:26 | zackzackzack | And seeing if I can't get it to print out the types of the arguments |
| 01:26 | zackzackzack | Whenever the function gets called |
| 01:27 | unnali | zackzackzack: e.g.? |
| 01:27 | zackzackzack | (defn-type-example typed [a b] [a b]) |
| 01:27 | zackzackzack | (typed 1 2) |
| 01:27 | zackzackzack | ; Integer Integer |
| 01:27 | zackzackzack | [1 2] |
| 01:28 | unnali | so how are you going about it? |
| 01:29 | zackzackzack | Not sure yet. I've been trying to understand how defn works as a macro |
| 01:29 | unnali | it's a lot more complicated than this, but a simplest definition for the simplest form of defn could be: (defmacro defn [name args & body] `(def ~name (fn ~args ~@body))) |
| 01:29 | Sgeo | ,(macroexpand-1 '(defn my-fn [arg1 arg2] some code here)) |
| 01:29 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 01:29 | unnali | grossly understated. |
| 01:30 | Sgeo | &(macroexpand-1 '(defn my-fn [arg1 arg2] some code here)) |
| 01:30 | lazybot | ⇒ (def my-fn (clojure.core/fn ([arg1 arg2] some code here))) |
| 01:30 | unnali | hmm. |
| 01:31 | zackzackzack | https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L266 |
| 01:31 | unnali | &(meta (first (next (macroexpand-1 '(defn my-fn [a1 a2] blah))))) |
| 01:31 | lazybot | ⇒ {:arglists (quote ([a1 a2]))} |
| 01:31 | unnali | huh! |
| 01:31 | unnali | zackzackzack: yeah, that's it. |
| 01:32 | unnali | "fdecl" is consumed throughout that LET starting line 280, and the meta hash "m" is builtup by pieces. |
| 01:32 | unnali | that's kinda the scariest bit. |
| 01:32 | Sgeo | I don't entirely understand the &form and &env actually being in the arglist |
| 01:32 | zackzackzack | Right, that's why I asked originally |
| 01:32 | zackzackzack | It isn't actually a macro at first |
| 01:32 | unnali | zackzackzack: try https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L422 defmacro. |
| 01:32 | zackzackzack | defn becomes a macro after it is defined |
| 01:33 | unnali | yeah, which is equivalent, more or less. |
| 01:33 | unnali | just 'cause defmacro has yet to be defined! |
| 01:33 | unnali | note that defmacro itself just calls defn (line 464), then calls setMacro on it and then returns the var. |
| 01:33 | zackzackzack | Which makes sense. |
| 01:33 | unnali | yup, so it's as much a macro as you're going to get. |
| 01:34 | unnali | so &form and &env are magic, anyway. |
| 01:34 | unnali | not that that showed that, sorry. |
| 01:35 | Sgeo | Where is the magic? |
| 01:35 | unnali | good question. |
| 01:35 | unnali | (searching) |
| 01:36 | AtKaaZ | is ideone down? I need this code: http://ideone.com/z6MTLx |
| 01:36 | Sgeo | AtKaaZ, is that my code by any chance? |
| 01:36 | Sgeo | http://webcache.googleusercontent.com/search?q=cache:http://ideone.com/z6MTLx |
| 01:36 | AtKaaZ | Sgeo it is |
| 01:36 | Sgeo | Oh hey it is :) |
| 01:37 | AtKaaZ | thanks |
| 01:37 | Sgeo | yw |
| 01:37 | Sgeo | I'm curious what you need it for |
| 01:38 | AtKaaZ | the same thing that I wanted to do, basically I want to be able to return the symbol(value) if the symbol exists, or throw otherwise, but not the CompilerException |
| 01:40 | Sgeo | Hmm. Symbol known at runtime or compiletime? |
| 01:40 | AtKaaZ | runtime |
| 01:40 | unnali | zackzackzack: getting closer I think. |
| 01:40 | unnali | zackzackzack: https://github.com/clojure/clojure/commit/277f023 |
| 01:41 | AtKaaZ | Sgeo, last time you said something about &env and resolve, I'm attempting that, as soon as I understand how to use &env xD |
| 01:41 | unnali | zackzackzack: https://github.com/clojure/clojure/commit/277f023#diff-1 I think this is the important bit. macroexpansion always calls with the form cons'd onto the LOCAL_ENV.get() cons'd onto the rest of the form proper. |
| 01:42 | unnali | so all macros get &form and &env whether they like it or not. this means any macro defined manually (not with defmacro) must have &form and &env specified; defmacro adds them in itself with "add-implicit-args" as seen here: https://github.com/clojure/clojure/commit/277f023#L0R342 |
| 01:42 | Sgeo | AtKaaZ, it's easy. In a macro, &env refers to the lexical environment map of where the call occurs. Remember, all macros are done long before runtime. |
| 01:42 | Sgeo | Almost wrote runetime |
| 01:43 | Sgeo | This map's keys are each symbol that exists lexically, that is, where the macro call is within some scope that defines some lexical variable |
| 01:43 | Sgeo | (let [a 1] ...) the ... is within a lexical scope of the a |
| 01:44 | AtKaaZ | yep I got that |
| 01:44 | AtKaaZ | so that is why I also need resolve to see others that are maybe def-ed |
| 01:44 | zackzackzack | AHHHH okay |
| 01:44 | zackzackzack | So setMacro is not exactlyyyy defmacro |
| 01:45 | unnali | zackzackzack: not close, it just tells the compiler to treat it as a macro |
| 01:45 | AtKaaZ | Sgeo, but that &env is not available at runtime right? something like ~&env |
| 01:45 | unnali | zackzackzack: e.g. |
| 01:45 | unnali | &(defn x [& args] `(print ~(count args))) |
| 01:45 | lazybot | java.lang.SecurityException: You tripped the alarm! def is bad! |
| 01:45 | unnali | bah. |
| 01:45 | unnali | this would be difficult to demonstrate. |
| 01:46 | zackzackzack | haha gist? |
| 01:46 | unnali | sure. |
| 01:46 | Sgeo | That ~&env tells a quasiquote to splice in the &env, the only being avaibale at macroexpand shouldn't matter |
| 01:46 | Sgeo | I'm not entirely sure why it breaks |
| 01:46 | Sgeo | But yeah, only macros have &env |
| 01:46 | unnali | zackzackzack: https://gist.github.com/3950619 |
| 01:47 | AtKaaZ | Sgeo, I just wanted to know how can I refer it inside a ` block hmm |
| 01:47 | unnali | note we get 3 as the result; &form and &env are always there in macroexpansion. |
| 01:47 | unnali | AtKaaZ: try `(... blah ... ~'&env ... bah ...) |
| 01:47 | Sgeo | You could do something like `(println ~(keys &env)) |
| 01:47 | zackzackzack | Hmmm |
| 01:48 | Sgeo | unnali, not sure how that's of use unless AtKaaZ is writing a macro that writes macros? |
| 01:48 | unnali | Sgeo: neither really. |
| 01:50 | AtKaaZ | hmm they both err |
| 01:51 | alex_baranosky | sounds like some exciting macro talk tonight |
| 01:52 | alex_baranosky | I've never seen .setMacro |
| 01:52 | Sgeo | ,(let [b 2] `(let [a 1] `(blah blah ~a blah ~~b blah))) |
| 01:52 | clojurebot | (clojure.core/let [sandbox/a 1] (clojure.core/seq (clojure.core/concat (clojure.core/list (quote sandbox/blah)) (clojure.core/list (quote sandbox/blah)) (clojure.core/list sandbox/a) (clojure.core/list (quote sandbox/blah)) ...))) |
| 01:52 | unnali | just an implementation detail, really |
| 01:52 | Sgeo | Oh come on |
| 01:53 | Sgeo | ,(let [b 2] `(let [a 1] `(~a ~~b))) |
| 01:53 | clojurebot | (clojure.core/let [sandbox/a 1] (clojure.core/seq (clojure.core/concat (clojure.core/list sandbox/a) (clojure.core/list 2)))) |
| 01:53 | alex_baranosky | Sgeo: what are you attempting to do there? |
| 01:53 | Sgeo | alex_baranosky, learn about nested quasiquoting |
| 01:53 | Sgeo | (is what I'm attempting to do) |
| 01:53 | Sgeo | That sandbox/a is a problem, but I know how to fix it |
| 01:53 | AtKaaZ | wow that ~~b 's return |
| 01:55 | Sgeo | Oh, I only know how to fix that first sandbox/a |
| 01:55 | unnali | Sgeo: if you use a# and ~a# it should do the trick? |
| 01:55 | AtKaaZ | Sgeo, i see I can't simply return &env -> Can't embed object in code, |
| 01:55 | unnali | ,(let [b 2] `(let [a# 1] `(~a# ~~b))) |
| 01:55 | clojurebot | (clojure.core/let [a__27__auto__ 1] (clojure.core/seq (clojure.core/concat (clojure.core/list a__27__auto__) (clojure.core/list 2)))) |
| 01:55 | Sgeo | unnali, ooh, right, I should do that |
| 01:56 | Sgeo | AtKaaZ, yeah, I don't know why that occurs |
| 01:56 | unnali | Sgeo: this is the "sensible" way to use lexicals in macros. you could just ~' everything, which leads you into the territory of non-hygenic macros |
| 01:56 | Sgeo | unnali, I guess I wasn't thinking in those terms |
| 01:57 | Sgeo | ,(let [b 2] `(let [a# 1] `(a# ~~b))) |
| 01:57 | clojurebot | (clojure.core/let [a__55__auto__ 1] (clojure.core/seq (clojure.core/concat (clojure.core/list (quote sandbox/a__54__auto__)) (clojure.core/list 2)))) |
| 01:57 | unnali | note that that's done something subtly different |
| 01:57 | Sgeo | I want to write a macro to write macros that write macros |
| 01:58 | Sgeo | No particular examples in mind, sadly |
| 01:58 | unnali | there's no problem with that. I'd start by working out what you want it to produce. |
| 01:59 | AtKaaZ | a macro that produces it's own source code |
| 02:10 | Sgeo | AtKaaZ, completely possible, I believe. |
| 02:10 | AtKaaZ | I don't doubt it, but too tough to compute |
| 02:11 | Sgeo | It's a quine |
| 02:11 | AtKaaZ | is there another way to find out if a symbol is defined lexically? |
| 02:11 | Sgeo | http://esolangs.org/wiki/Quine |
| 02:12 | AtKaaZ | I remember that for a pascal program |
| 02:12 | Sgeo | Should be able to modify this to make it macro-y |
| 02:13 | AtKaaZ | ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x))))) |
| 02:13 | clojurebot | ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x))))) |
| 02:13 | AtKaaZ | lol , amazing if you ask me |
| 02:14 | Sgeo | Hmm, why not ' like in the original |
| 02:14 | Sgeo | ,((fn (x) (list x (list 'quote x))) '(fn (x) (list x (list 'quote x)))) |
| 02:14 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol> |
| 02:15 | Sgeo | ,((fn [x] (list x (list 'quote x))) '(fn [x] (list x (list 'quote x)))) |
| 02:15 | clojurebot | ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x))))) |
| 02:15 | Sgeo | oh |
| 02:16 | zackzackzack | unnali: this is what I've had in mind |
| 02:16 | zackzackzack | https://github.com/zmaril/pssst/blob/master/src/psssst/core.clj |
| 02:16 | AtKaaZ | ,(let [b 1] (eval b)) |
| 02:16 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 02:17 | unnali | zackzackzack: I see! |
| 02:17 | zackzackzack | If you use defn-recorded, it captures the types of all your function calls and then spits them out to a file automatically |
| 02:17 | zackzackzack | So, it's a tool for type-hinting and also seeing what is going on with your functions |
| 02:18 | Sgeo | zackzackzack, want to make body a rest argument and use unquote-splice? |
| 02:18 | zackzackzack | Good idea, done. There is still a fair amount of work to be done |
| 02:18 | AtKaaZ | how can I cause (eval b) to complain that b doesn't exist only after calling eval (ie. inside eval) or something |
| 02:18 | unnali | AtKaaZ: (eval "b")? |
| 02:19 | zackzackzack | At this point, I am just hard coding all the different ways to use defn into there |
| 02:19 | AtKaaZ | that's a string? |
| 02:19 | unnali | no, that was dumb. |
| 02:19 | Sgeo | unnali, eval takes forms, not strings |
| 02:19 | unnali | AtKaaZ: so it is. |
| 02:19 | AtKaaZ | ok |
| 02:19 | unnali | Sgeo: my bad. |
| 02:19 | AtKaaZ | maybe something similar to eval? |
| 02:19 | unnali | AtKaaZ: how could something just come into existence if it didn't already exist? |
| 02:19 | unnali | AtKaaZ: (eval 'b) ? |
| 02:19 | zackzackzack | And then working through how to record types of destructured maps and seqs |
| 02:20 | AtKaaZ | oh yeah that might work also this (try (eval (symbol "b")) (catch Throwable t t)) |
| 02:20 | AtKaaZ | unnali, that works too thanks |
| 02:20 | AtKaaZ | unnali, like, it can encounter a def later on i guess |
| 02:21 | Sgeo | zackzackzack, https://github.com/Sgeo/pssst/commit/1eb029e3598dc5e13fe4a9a6221ab7dd05668af8 |
| 02:21 | unnali | I guess. |
| 02:21 | Sgeo | Also, why are you splicing in record, lemme look at that |
| 02:21 | Sgeo | Oh woah, I thought it was just a gist |
| 02:22 | zackzackzack | Nah, I see this being something that people import and then specifically state they want to record the parameters for a certain function |
| 02:23 | Sgeo | Hmm |
| 02:23 | Sgeo | ,`(~resolve 'blah) |
| 02:23 | clojurebot | (#<core$resolve clojure.core$resolve@601c9cb9> (quote sandbox/blah)) |
| 02:23 | Sgeo | huh. |
| 02:23 | Sgeo | So actually splicing in record would work |
| 02:24 | Sgeo | Well, maybe |
| 02:24 | Sgeo | I wouldn't rely on it though, doesn't seem good stylistically |
| 02:43 | zackzackzack | I'm still looking at splicing in record |
| 02:44 | zackzackzack | I'm not sure which way to do it such that it is stuff. I think splicing it in as the function will make sure it doesn't clober anything later on |
| 02:49 | AtKaaZ | can I have some sugestions on how to prevent a certain key to be read from a map? ie. I want it to throw ie. (:value {:a 1}) would throw |
| 02:51 | alex_baranosky | what are you favorite libraries for java object/class introspection? |
| 02:58 | Sgeo | AtKaaZ, more clarification on what exactly you're looking for? |
| 02:58 | Sgeo | Oh, removing a key? |
| 02:59 | Sgeo | ,(dissoc {:a 1 :b 2} :a) |
| 02:59 | clojurebot | {:b 2} |
| 03:01 | AtKaaZ | Sgeo, I was thinking to return the state of a symbol and its value in a map like {:state :bound :value 100} but in case of :state unbound I would want to catch attempts(calls) to get the :value so that I could track down possible bugs |
| 03:02 | Sgeo | Just don't make maps that look like {:state :unbound :value :blah} |
| 03:02 | _ulises | AtKaaZ: can you wrap :value using a function like (value ...); then you can log there |
| 03:02 | Sgeo | Can make a consistency checker that throws on an inconsistent map |
| 03:02 | Sgeo | In Haskell you'd use an or type |
| 03:03 | Sgeo | data Whatever = Unbound | Bound Int |
| 03:03 | Sgeo | Statically checked |
| 03:03 | Sgeo | That you don't have inconsistent whatever |
| 03:04 | AtKaaZ | _ulises: do you mean they should use (value map) to get (:value map) ? but can I prevent them from using the latter? or do you mean I should return the function inside the map {:value #fnwhichreturnsvalue} |
| 03:05 | _ulises | AtKaaZ: the latter is also possible. You can't really prevent them using :value, but then again, you can't stop a person if they have enough will to try and break your system :) |
| 03:07 | AtKaaZ | xD |
| 03:07 | _ulises | heh |
| 03:07 | AtKaaZ | ,(get {:a 1} :a) |
| 03:07 | clojurebot | 1 |
| 03:07 | AtKaaZ | you'd use that? |
| 03:07 | Sgeo | ,({:a 1 :b 2} :a) |
| 03:07 | clojurebot | 1 |
| 03:07 | AtKaaZ | ,(get nil :a) |
| 03:07 | clojurebot | nil |
| 03:07 | Sgeo | ,(find {:a 1 :b 2} :a) |
| 03:07 | clojurebot | [:a 1] |
| 03:07 | Sgeo | ,(find {:a 1 :b 2} :c) |
| 03:07 | clojurebot | nil |
| 03:08 | AtKaaZ | what's the diff ? |
| 03:08 | AtKaaZ | oh i see, i can provide default with get |
| 03:08 | Sgeo | find allows you to always determine whether the key is present along with getting the value |
| 03:08 | Sgeo | ,({:a 1} :b :nothere) |
| 03:08 | clojurebot | :nothere |
| 03:09 | AtKaaZ | (find [:a nil :b 1] :a) |
| 03:09 | AtKaaZ | ,(find [:a nil :b 1] :a) |
| 03:09 | clojurebot | nil |
| 03:09 | AtKaaZ | ,(find {:a nil :b 1} :a) |
| 03:09 | clojurebot | [:a nil] |
| 03:09 | AtKaaZ | oh that's good , now i notice |
| 03:16 | AtKaaZ | can I call a macro based on the type? ie. if param is a var or a symbol |
| 03:17 | AtKaaZ | I'd syphon it through a function except that the param could be undefined hmm |
| 03:17 | Sgeo | ,(if (== (+ 1 1) 2) (-> 5 inc) (->4 dec)) |
| 03:17 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ->4 in this context, compiling:(NO_SOURCE_PATH:0)> |
| 03:17 | Sgeo | ,(if (== (+ 1 1) 2) (-> 5 inc) (-> 4 dec)) |
| 03:17 | clojurebot | 6 |
| 03:18 | Sgeo | Not sure exactly what you want to do |
| 03:19 | AtKaaZ | I have a macro like (macro? sym) but I want it to also accept vars like #'defn but als o defn, so far I'm splitting it into two named macros |
| 03:20 | PuercoPop | hi, quick questión where can I find the postgres jdbc versión drivers (I'm looking for 9.2, 9.2-1000.jdbc4 is not found by leininggein |
| 03:24 | alex_baranosky | is .bindRoot thread-local? |
| 03:40 | john2x | how do I get the key/s of a map given a value? |
| 03:44 | alex_baranosky | Nice: "The ability to specify types that explicitly include or exclude |
| 03:44 | alex_baranosky | nil is one of the strengths of Typed Clojure, and an aspect where it is more |
| 03:44 | alex_baranosky | expressive than standard type systems like that for Java." |
| 03:44 | _ulises | john2x: there's a function to reverse a map which I don't remember now; I also seem to recall it being in clojure.set for some reason |
| 03:44 | _ulises | john2x: if you find that fn, then it's trivial |
| 03:45 | _ulises | ,(doc map-invert) |
| 03:45 | clojurebot | I don't understand. |
| 03:45 | john2x | _ulises: clojure.set/map-invert :) thanks! |
| 03:45 | _ulises | john2x: yay! |
| 03:46 | ro_st | anyone running in production on EC2 willing to answer some noob questions? |
| 03:48 | vijaykiran | ro_st: "don't ask to ask, just ask :P" |
| 03:51 | ro_st | when do you get billed for ec2; when you process request or from the time you spin a node up to the time you switch it off? |
| 03:51 | vijaykiran | based on time it is up |
| 03:52 | vijaykiran | bill is as long as you keep the node up |
| 03:52 | ro_st | thought so. how quickly do nodes come up? |
| 03:52 | vijaykiran | pretty quick in my experience - but depends on what you run on the node as well. |
| 03:52 | ro_st | could you spawn staging clouds on demand, for a couple hours here and a couple hours there? |
| 03:53 | ro_st | 1 datomic + 1 ring, basically |
| 03:54 | vijaykiran | should be pretty quick to boot up, I don't think I understood your "staging clouds" question |
| 03:54 | ro_st | well, we want a staging environment for our system. trying to determine the best way to have one without paying full production costs |
| 03:55 | vijaykiran | hmm - you can spin up as many instances as you want and as long as you want |
| 03:55 | ro_st | so we could stage inside production, through the use of feature flags to hide new code |
| 03:55 | ro_st | but that doesn't give us as much freedom as a completely separate stack |
| 03:56 | ro_st | yeah. it seems like starting up new nodes as we need them and switching them off again when we're done is the way |
| 03:56 | vijaykiran | yes |
| 03:57 | ro_st | are you using pallet, vijay? |
| 03:57 | vijaykiran | no, just raw git pull and shell scripts - not automated. |
| 03:58 | ro_st | brave man :-) |
| 03:58 | vijaykiran | and provisioning is manual :) |
| 03:59 | ro_st | how many nodes are you using? |
| 03:59 | vijaykiran | right now 2 for "failover" and 1 testing/staging/breaking stuff |
| 04:00 | vijaykiran | still undercover for a small app - so nothing "webscale" :) |
| 04:00 | ro_st | awesome, and you have your entire stack on each node? db/web/etc? |
| 04:00 | vijaykiran | no DB is on RDS |
| 04:01 | ro_st | ah of course |
| 04:01 | vijaykiran | I guess it depends on the app - how you want to distribute - there are high i/o instances and other choices |
| 04:03 | ro_st | yeah |
| 04:05 | ro_st | thanks vijay. i return you to your regularly scheduled coffee and parenthesis |
| 04:06 | vijaykiran | yw |
| 04:11 | AtKaaZ | in a test unit what's the way to test for an expected exception? |
| 04:12 | ro_st | in midje it's =throws=> |
| 04:12 | ro_st | not sure about clojure.test |
| 04:13 | AtKaaZ | thanks I'll check that too |
| 04:13 | ro_st | #not-so-subtle-hint-to-check-midje-out |
| 04:13 | AtKaaZ | lol |
| 04:14 | Fossi | what he said :) |
| 04:14 | ro_st | using lein2 AtKaaZ? |
| 04:15 | AtKaaZ | yes |
| 04:15 | ro_st | here's my profiles.clj |
| 04:15 | ro_st | https://www.refheap.com/paste/6128 |
| 04:16 | AtKaaZ | that means, in one of your projects? |
| 04:16 | AtKaaZ | ohh nvm i get it now |
| 04:16 | ro_st | :repositories, lazytest, midje lines are what you'll want to add to your own ~/.lein/profiles.clj |
| 04:16 | ro_st | then you can run lein midje —lazytest in any lein project and it'll run any clojure.test and/or midje facts you have |
| 04:17 | ro_st | and re-run affected namespaces whenever you update a file |
| 04:18 | ro_st | https://github.com/marick/Midje/wiki/Midje-mode is indispensible if you use emacs |
| 04:18 | AtKaaZ | i use eclipse/ccw/lein |
| 04:18 | ro_st | we use both lazytest and midje-mode extensively |
| 04:19 | ro_st | that's also fine. lazytest by itself is plenty |
| 04:24 | AtKaaZ | I will probably have to use the midje lein plugin inside project.clj just in case whoever's using the project doesn't have it |
| 04:39 | bbeans | vm2k3-cfm5.mgt.hosting.dc2.netsol.com (205.178.152.214) |
| 04:40 | bbeans | Wow, I was passed testing. |
| 04:58 | tomoj | I typed `pkill emacs`, hesitated a moment, then it woke up :) |
| 04:59 | AtKaaZ | what's the repl equivalent for lein midje? |
| 05:01 | ro_st | that's why midje-mode, AtKaaZ |
| 05:02 | ro_st | you can just evaluate a midje facts file into your repl, and re-evaluate individual facts as you need to |
| 05:03 | ro_st | midje-mode makes this simpler by providing keybinds for sending a fact and printing the result directly into the source file as comments |
| 05:03 | ro_st | but you could just as easily watch your repl for output |
| 05:34 | AtKaaZ | maybe I should switch to emacs |
| 05:35 | AtKaaZ | but I am afraid of new things :D so much to learn |
| 05:35 | AtKaaZ | fear of the unknown |
| 05:35 | AtKaaZ | can emacs find the definition of some function? |
| 05:35 | AtKaaZ | or can refactor? (not that you can in ccw) |
| 05:36 | ro_st | no refactoring. swank does support goto definition |
| 05:36 | ro_st | not sure about nrepl |
| 05:37 | ro_st | it's a massive learn curve. worth it, though. |
| 05:37 | ro_st | problem with emacs is it's *very* easy to burn time tinkering |
| 05:37 | AtKaaZ | tinkering within emacs or with clojure code? |
| 05:37 | mpenet | there is a project that allows refactoring, but sure how good it is though |
| 05:38 | AtKaaZ | mpenet, what's its name? |
| 05:38 | Raynes | nrepl does goto definition as well, IIRC. Better than SLIME if I remember right. |
| 05:38 | mpenet | AtKaaZ: clojure-refactoring, surprisingly |
| 05:38 | AtKaaZ | slime is swank? |
| 05:38 | mpenet | Raynes: better how? |
| 05:38 | Raynes | ido-mode integration. |
| 05:38 | mpenet | oh nice |
| 05:39 | AtKaaZ | what's that? ido-mode? |
| 05:39 | AtKaaZ | nvm I'll google it |
| 05:39 | AtKaaZ | oh yes “Interactively DO things” sounds good :D |
| 05:40 | ro_st | Raynes: what about breakpoint support? i lean quite heavily on (swank.core/break) |
| 05:40 | ro_st | i'm still using swank |
| 05:40 | ro_st | have't made the switch to nrepl.el yet |
| 05:40 | Raynes | ro_st: I don't think it has breakpoint support yet. |
| 05:41 | AtKaaZ | is nrepl.el supposed to be better? |
| 05:41 | ro_st | newer |
| 05:41 | ro_st | built on top of nrepl, which is quite awesome |
| 05:41 | Raynes | ro_st: https://github.com/pallet/ritz/tree/develop/nrepl |
| 05:42 | Raynes | AtKaaZ: It is the successor to SLIME for Clojure and it is generally recommended that you use it if you're using Emacs. swank-clojure (the server part written in Clojure) is no longer being maintained. |
| 05:42 | Raynes | nrepl.el misses a few things from SLIME, but it is evolving. |
| 05:42 | ro_st | ah, ritz. another tool i've not had time to muck with |
| 05:43 | ro_st | thanks for the link, Raynes |
| 05:44 | AtKaaZ | mpenet: this seems to be the most recent one https://github.com/joodie/clojure-refactoring |
| 05:45 | AtKaaZ | i'll try look into emacs even though I am on windows |
| 05:46 | AtKaaZ | this seems to be a good start: http://clojure-doc.org/articles/tutorials/emacs.html |
| 05:46 | ro_st | highly recommend the peepcode 'cast on emacs, too. |
| 05:47 | ro_st | but not the clojure one(s). they're quite out of date now |
| 05:47 | AtKaaZ | ro_st this one? https://peepcode.com/products/meet-emacs |
| 05:47 | ro_st | dats der bunny |
| 05:48 | AtKaaZ | must be good since it's $12 :) |
| 05:48 | mpenet | Would that make sense to allow every-pred and some-fn take 0 arguments? I find myself doing this a lot: ((apply some-fn coll) :something) |
| 05:49 | mpenet | well, wishing I could do this |
| 05:52 | mpenet | Probably not. |
| 05:54 | AtKaaZ | ro_st: are you using Magit? seen the preview for that cast it's very appealing so far |
| 05:55 | ro_st | yes |
| 05:55 | ro_st | love it |
| 05:55 | ro_st | i open emacs just to use magit, sometimes |
| 05:55 | AtKaaZ | awesome |
| 05:58 | alex_baranosky | That one last Clojure/Conj ticket on the site is eating at my soul |
| 06:02 | alex_baranosky | mpenet: in general I think most general purpose functions should work sensibly for no args… ilke you said it makes them easier/safer to use |
| 06:02 | mpenet | yep, or take collections |
| 06:05 | mpenet | I can't post on clj-dev, but I'll try to see what others think on the clojure ML. It is a trivial change, but maybe there is a good reason why it is like this. |
| 06:05 | mpenet | ,(comp) |
| 06:05 | clojurebot | #<core$identity clojure.core$identity@566f653b> |
| 06:06 | mpenet | (partial) |
| 06:06 | mpenet | ,(partial) |
| 06:06 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$partial> |
| 06:06 | mpenet | well for partial I can understand why, but if it works for comp, it should for others maybe |
| 06:08 | john2x | how do I declare bindings in fixtures (clojure.test)? the doc didn't have any examples.. |
| 06:20 | john2x | here's what I'm trying to do (but it's wrong) http://pastie.org/5113784 |
| 06:27 | mpenet | ,((every-pred (fn [_]))) |
| 06:27 | clojurebot | true |
| 06:30 | mpenet | ,((some-fn (fn [_]))) |
| 06:30 | clojurebot | nil |
| 06:54 | mpenet | ,(every? identity []) |
| 06:54 | clojurebot | true |
| 06:56 | Islaminati | ,(identity) |
| 06:56 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$identity> |
| 06:56 | Islaminati | Ohh |
| 06:56 | Islaminati | Yeah |
| 06:56 | Islaminati | ,(every? #(false) []) |
| 06:56 | clojurebot | true |
| 06:59 | black_joe | I'm trying to make a function that checks to see if a list and all of its nested lists is completely empty. |
| 07:00 | black_joe | How could I check that? Because a list like (()) is not equal to () or nil. |
| 07:00 | black_joe | Current source is on https://github.com/dymatic/spell-package-manager/blob/master/spell/src/lib/libClj.clj line 143, but not really relevant since this will probably have to be its own function. |
| 07:00 | shachaf | Do you mean "or"? |
| 07:00 | _ulises | black_joe: something like (apply and (map empty? your-lists-here)) |
| 07:01 | shachaf | I assume black_joe meant something recursive. |
| 07:01 | shachaf | I.e. a tree made of only conses and empty lists. |
| 07:01 | Islaminati | black_joe, so you basically want () to be true, (() () ()) to be true and (((() ()) ())) to be true etc. |
| 07:01 | _ulises | ah, gotcha |
| 07:01 | black_joe | Right. Just to check if they're empty. |
| 07:02 | black_joe | And I really haven't done enough work with trees to do this effectively with them. |
| 07:02 | shachaf | black_joe: That's a bit of a strange operation. |
| 07:02 | AtKaaZ | ,(empty? (flatten '(() ())) ) |
| 07:02 | clojurebot | true |
| 07:02 | Cheiron | Hi, what is the recommended way to define a const in Clojure ? yes def but what the naming convention? |
| 07:02 | AtKaaZ | ,(empty? (flatten '(() (()))) ) |
| 07:02 | clojurebot | true |
| 07:02 | AtKaaZ | ,(empty? (flatten '(() ((2)))) ) |
| 07:02 | clojurebot | false |
| 07:03 | shachaf | Hah, AtKaaZ++'s solution should work. |
| 07:03 | black_joe | Okay. Well, I didn't know about either function. Thanks. |
| 07:03 | Islaminati | Flatten flattens to infinite depth? |
| 07:04 | shachaf | black_joe: If you're learning, you should be able to write this function yourself. :-) |
| 07:04 | black_joe | I've spent too much time on the data types and other specifics of Clojure and not enough about the core libraries. |
| 07:04 | black_joe | I'll look into what's out there. |
| 07:04 | shachaf | You don't need to know about the libraries. |
| 07:04 | shachaf | Just write it using the primitives. |
| 07:05 | black_joe | Well, I tried to use recursion, but that didn't work. It would only go 2 levels deep. |
| 07:05 | shachaf | Sounds like you didn't use very much recursion. :-) |
| 07:05 | black_joe | Using a loop that checked to see if the (first) of the list was a list, and then checking that one. But if that contains a list it didn't work. |
| 07:06 | shachaf | It seems to me like you don't need to treat car any differently from cdr. |
| 07:07 | black_joe | You don't. The problem was getting to those cars and cdr's once they were nested and being able to return to the head position. |
| 07:07 | shachaf | You have a tree, and you want every node of it to be either the empty list or (cons x y), where x and y are trees satisfying this property. |
| 07:08 | shachaf | (defn foo? [a] (or (null? l) (and (cons? l) (foo? (car l)) (foo? (cdr l))))) |
| 07:08 | shachaf | Something like that, I don't know Clojure. |
| 07:08 | black_joe | Trees in general give me a pain. Our class starts covering them soon though, so that should clear a lot up. |
| 07:08 | Islaminati | shachaf, first and rest, clojure doesn't have car and cdr. |
| 07:08 | shachaf | Get a head start, write some recursive functions! |
| 07:08 | Islaminati | Or cons cells. |
| 07:08 | Islaminati | And list? |
| 07:09 | shachaf | Islaminati: Oh. I saw the word "car" in that link black_joe linked to. |
| 07:09 | black_joe | I still refer to first and rest as cars and cdrs in my documentation. |
| 07:09 | shachaf | Islaminati: It doesn't have cons cells? What are lists? |
| 07:09 | Islaminati | ,car |
| 07:09 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: car in this context, compiling:(NO_SOURCE_PATH:0)> |
| 07:09 | shachaf | ,(cons 1 2) |
| 07:09 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long> |
| 07:09 | shachaf | OK, Clojure /= Scheme. |
| 07:09 | Islaminati | ,(car '("Ahh", "girl" "look" "at" "that" "list")) |
| 07:09 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: car in this context, compiling:(NO_SOURCE_PATH:0)> |
| 07:09 | black_joe | It still has cons, but it's for sequences. |
| 07:09 | shachaf | So you can simplify what I said a bit. :-) |
| 07:10 | Islaminati | shachaf, yeah well, there are no true 'cons pairs', there are list nodes, whichbdemands its cdr are lists |
| 07:10 | black_joe | And usually recursion is achieved with the (recur) macro since the JVM has poor tail-call optimization. |
| 07:10 | shachaf | ,(null? '()) |
| 07:10 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: null? in this context, compiling:(NO_SOURCE_PATH:0)> |
| 07:10 | Islaminati | Which honestly is pretty sweet and solves a lot of issues, especially with mutable conses. |
| 07:10 | shachaf | ,(empty? '()) |
| 07:10 | clojurebot | true |
| 07:10 | Islaminati | that'd be empty? |
| 07:10 | Islaminati | empty? also works on vectors and hashes an dwhat not. |
| 07:10 | shachaf | ,(all? empty? '()) |
| 07:10 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: all? in this context, compiling:(NO_SOURCE_PATH:0)> |
| 07:10 | Islaminati | Also, it doesn't have TCO. |
| 07:10 | shachaf | ,(all empty? '()) |
| 07:10 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: all in this context, compiling:(NO_SOURCE_PATH:0)> |
| 07:11 | Islaminati | shachaf, every |
| 07:11 | Islaminati | (every? empty '()) |
| 07:11 | shachaf | ,(every? empty? '()) |
| 07:11 | clojurebot | true |
| 07:11 | Islaminati | (every? empty? '()) |
| 07:11 | Islaminati | Like that |
| 07:12 | shachaf | Anyway, you get the idea. |
| 07:13 | black_joe | It would just be nice is () was equal to nil. |
| 07:13 | black_joe | That was a convenience in Lisp. |
| 07:13 | shachaf | That seems un-nice to me. |
| 07:14 | ro_st | what's the best way to map over a seq, but stop early? like break; in js loops |
| 07:14 | shachaf | Why do you want to stop? |
| 07:14 | ro_st | list of regexen to attempt until one matches, then do some work and return the result |
| 07:14 | clojurebot | http://haacked.com/images/haacked_com/WindowsLiveWriter/IConfigMapPathIsInaccessibleDueToItsProt_1446B/works-on-my-machine-starburst.png |
| 07:15 | black_joe | Probably loop and recur with a collector and counter. |
| 07:15 | mpenet | ro_st: for with :while, or reduce |
| 07:16 | Islaminati | black_joe, it's good that it keeps them separate honestly. |
| 07:16 | mpenet | nm not reduce |
| 07:16 | Islaminati | CLojure actually has lists as a datatype |
| 07:16 | Islaminati | CL does not. |
| 07:16 | Islaminati | It has cons as a datatype and nill, which is basically null. |
| 07:16 | Islaminati | list? in clojure runs in constant tyime for instance. |
| 07:17 | Islaminati | You also can't have the awkward thing that astructure is a list in one instance and not any more in another where it has been mutated to not be so any more. |
| 07:17 | black_joe | I suppose that's good, but a lot of functions that operate on lists return nil if the list is empty. |
| 07:17 | black_joe | So checking for (or (= list nil) (= list ()) is required. |
| 07:17 | Islaminati | This is pretty much such a problem in scheme where the spec says that things like map don't even have to verify that the structures passed are lists, in which case they are not, anything can happen. |
| 07:18 | mpenet | black_joe: you can use seq for that |
| 07:18 | shachaf | Islaminati: In Haskell, you can run list? at compile time! :-) |
| 07:18 | mpenet | , (seq []) |
| 07:18 | clojurebot | nil |
| 07:18 | ro_st | with for, can you test something from :let in :while ? |
| 07:18 | ro_st | ah i see that you can |
| 07:18 | Islaminati | shachaf, so about unsafeCoerce :: a -> b again. |
| 07:19 | shachaf | Great function! |
| 07:19 | Islaminati | But nil in clojure is basically null, as in 'no meaningful value here' |
| 07:19 | shachaf | @let isJust :: Maybe a -> Bool; isJust = unsafeCoerce |
| 07:19 | Islaminati | best function ever, it can implement unsafeperformio which is also fabulous |
| 07:19 | shachaf | Islaminati: unsafePerformIO is part of the Haskell spec, unlike unsafeCoerce. |
| 07:20 | shachaf | And you can use unsafePerformIO to write unsafeCoerce, too. |
| 07:20 | Islaminati | I know, which is what makes both fabulous. |
| 07:20 | Islaminati | can types still be inferred by the way if you you replace every function x with unsavecoerce . x? |
| 07:21 | Islaminati | My intuition says me that type inference in that case would fail. |
| 07:21 | shachaf | Well, no it would be a huge crashing mess. |
| 07:21 | shachaf | Everything would have every type. |
| 07:21 | Islaminati | Yeah, but assume that you take a type checking progrmingt |
| 07:21 | Islaminati | and just do that. |
| 07:22 | Islaminati | After you already know it checks. |
| 07:22 | shachaf | Oh, you're wondering whether it'll always compile? |
| 07:22 | shachaf | Hmm, there'll be some ambiguities with type classes. |
| 07:22 | shachaf | Oh, you're Lajla. |
| 07:23 | Islaminati | Of course. |
| 07:23 | shachaf | You should just take one nick and stick with it. |
| 07:23 | Islaminati | I beg to differ, we should in fact all constantly change nicknames. |
| 07:25 | ro_st | that sounds like something a Culture Mind would say |
| 07:25 | Islaminati | What's a culture mind? |
| 07:26 | ro_st | http://en.wikipedia.org/wiki/Culture_series |
| 07:27 | Islaminati | Ah, and they are against established identity? |
| 07:29 | ro_st | i've no idea. i simply meant what i said :-) |
| 07:31 | Islaminati | Ah |
| 07:31 | Islaminati | you should be too though |
| 07:31 | Islaminati | established identity is a posion to thought. |
| 07:31 | Islaminati | It influences the way peolpe think and lets them make faulty decisions. |
| 07:32 | ro_st | it's also an incredibly handy tool. communication would be tedious beyond usefulness without established identity |
| 07:33 | Islaminati | No, it's only useful exactly because people use establish identity and think in it. |
| 07:33 | ro_st | pass me the salt. salt? i see no salt. could you describe what you seek without labelling it, please, so that i may know what you mean? |
| 07:33 | Islaminati | THey need to know who people 'are' to be comfortable. |
| 07:33 | Islaminati | EXACTLY, that is the point |
| 07:33 | Islaminati | you do not need salt, what you want is 'something that alters the taste of your food in that way' |
| 07:33 | Islaminati | This needn't be salt |
| 07:34 | Islaminati | it needn't be a specific identified object, it can be an indeterminate anything that achieves that goal. |
| 07:34 | ro_st | but, in this case, it is salt, because the requestor had already decided this |
| 07:34 | ro_st | hence using the word 'salt' in the request |
| 07:34 | Islaminati | What if language worked that you didn't ask for salt but asked for something that could do that? |
| 07:34 | Islaminati | But in a quicker way |
| 07:34 | Islaminati | Surely it would lead to more efficient communication and more utitlity since when salt is not available you would get something else that does the same rather than a 'no' |
| 07:34 | ro_st | i look forward to finding out how that would work |
| 07:35 | Cheiron | Hi, why the result of (concat [1 2] [3 4]) is (1 2 3 4) . isn't that the task of faltten? why the result isn't ((1 2) (3 4)) ? |
| 07:35 | Islaminati | You can more efficiently communicate your actual need, you don't want the thing identified as salt, you want anything that can fulfill that purpose. |
| 07:35 | mklappstuhl | hey |
| 07:36 | ro_st | what if my need is actually 'salt', and not your arbitrarily chosen assumption on my reason for needing it? |
| 07:36 | ro_st | i might want to put some in my ear |
| 07:36 | mklappstuhl | I'm looking for some library to work with historical stock data... The ones I was able to find where not on clojars... do you may have other places where I could look? |
| 07:37 | Islaminati | ro_st, that's the point, that can never happen and with this system you can communicate that in a superior way. |
| 07:37 | Islaminati | You always want to put it in your ear to achieve a particular reason. There tends to be another object which fulfills that purpose as well. |
| 07:37 | Islaminati | So you can communicate that easily and efficiently. |
| 07:38 | ro_st | except when the object i've asked for is the object that best fulfils that purpose, of course |
| 07:38 | Islaminati | Identities are basically a poison to thought and force people to think in such weird ways |
| 07:38 | Islaminati | perhaps there is another object which fulfills that purpose as well that you overlooked, which is exactly the flaw in human thought that keeps recurring? |
| 07:39 | ro_st | please tell me you don't work in medicine |
| 07:39 | ro_st | or child care |
| 07:39 | ro_st | or operate any heavy machinery |
| 07:39 | ro_st | -grin- |
| 07:40 | ro_st | "hand me the number 5 scalpel". "here's a screwdriver". |
| 07:40 | Islaminati | That doesn't fulfill that purpose |
| 07:40 | Islaminati | ... |
| 07:40 | mklappstuhl | anyone an idea regarding financial data stuff? |
| 07:40 | Islaminati | Clearly whjat you want is any intstrument that can savely cut to curgical praecision. |
| 07:40 | ro_st | who is best equipped to make the decision on need? |
| 07:40 | Islaminati | Clearly a screwdriver does not fulfill that. |
| 07:40 | ro_st | the requestor, or the requested-of? |
| 07:41 | Islaminati | One assumes a fellow surgeon in the room is well equipped. |
| 07:41 | Islaminati | Who is equipped to correctly 'identify' the object that you mean? |
| 07:41 | Islaminati | Same story that is just displaced. |
| 07:41 | ro_st | i should think the person asking the question |
| 07:41 | mklappstuhl | or whats a good place to look for libraries in the current clojure ecosystem |
| 07:41 | ro_st | you seem to posit the person being asked the question is better equipped |
| 07:42 | mklappstuhl | I know http://clojuresphere.herokuapp.com/ and clojure toolbox |
| 07:42 | ro_st | which can be the case, but most of the time, it isn't |
| 07:42 | ro_st | anyway. i have non-specific effort to perform. this was fun to think about |
| 08:25 | cmdrdats | for library projects, is there an implementation agnostic clojure logging library? |
| 08:26 | mklappstuhl | (use 'org.clojars.bmabey/csvlib) |
| 08:26 | mklappstuhl | I use this in the beginning of my file and it has been installed fine by leiningen... |
| 08:26 | mklappstuhl | no the less I get this |
| 08:26 | mklappstuhl | Exception namespace 'org.clojars.bmabey/csvlib' not found after loading '/csvlib' clojure.core/load-one (core.clj:5203) |
| 08:27 | mklappstuhl | message after (load-file)ling the file with the use statement from the repl |
| 08:32 | ro_st | cmdrdats: datomic uses logback, if that helps |
| 08:33 | cmdrdats | ro_st: cool, i'll look into it |
| 08:35 | ro_st | we're using it too, speak to V for code |
| 08:38 | clgv | mklappstuhl: a namespace must not contain "/" |
| 08:39 | clgv | mklappstuhl: you probably want to do (use 'csvlib) if that is a namespace in that lib |
| 08:39 | mklappstuhl | clgv, I just used require after reading that use is kind of outdated and that solved the problem... I guess use only takes namespaces and require also parts of namespaces |
| 08:39 | ro_st | i have a map as an argument, to which i expect several keys. i pass that map into internal fns which, based on which fn it is, will use some subset of those keys. how do i ensure the keys are there in the parent fn, without destructuring it? |
| 08:40 | clgv | mklappstuhl: that sounds wrong. before you mixed upp "group-id/artifact-id" with a namespace. leiningen needs the id format to get the lib. but in clojure you always use/require namespaces |
| 08:45 | clgv | mklappstuhl: but you seem to be right, that require worked. but only because it discards what you have written before "/" |
| 08:45 | clgv | mklappstuhl: fact is, you were using require/use wrongly |
| 08:46 | mklappstuhl | clgv, I'm using (require 'csvlib) now |
| 08:46 | clgv | mklappstuhl: good. :) |
| 08:47 | clgv | mklappstuhl: btw there is also a german irc channel #clojure.de ;) |
| 08:50 | mklappstuhl | clgv, oh cool |
| 08:50 | mklappstuhl | I actually prefer english when it gets technical but I'll stop by for sure :) |
| 08:51 | clgv | just mentioned it since it has not much advertisement elsewhere and you seemed to be in the target group ;) |
| 08:52 | edlich | Can someone help me |
| 08:52 | edlich | (filter #(re-find #"findstr" %) mystrcoll) |
| 08:52 | edlich | how to correctly replace #"pattern" by a val? |
| 08:53 | edlich | I want to filter every string in a string collection that matches the pattern |
| 08:53 | edlich | Is there an easier way to find if strings match in a string collection. |
| 08:54 | edlich | ? |
| 08:54 | zoldar | in case of a nested vector like [[1 2] [3 4]] , how to concisely conj element to the last vector in collection? something like (??? [[1 2] [3 4]] 5) => [[1 2] [3 4 5]] |
| 08:55 | ro_st | edlich: "a" in "a" "b" "c" ? |
| 08:56 | edlich | no, lets say we have a collection of sentences |
| 08:56 | edlich | I want to get a collection of every sentences that contain the word "beer". But beer is a var. |
| 08:56 | ro_st | ah |
| 08:56 | ro_st | re-pattern |
| 08:57 | mpenet | or (filter #(.contains % "thing") sentences) ? |
| 08:57 | ro_st | ,(re-pattern "beer") |
| 08:57 | clojurebot | #"beer" |
| 08:57 | edlich | aah Thanks! |
| 08:57 | clgv | zoldar: you can use update-in as in ##(let [v [[1 2] [3 4]]] (update-in v [(dec (count v))] conj 5)) |
| 08:57 | lazybot | ⇒ [[1 2] [3 4 5]] |
| 08:58 | ro_st | ah, didn't know update-in worked on vectors! |
| 08:58 | clgv | vectors are associative as well |
| 08:58 | ro_st | what about sets and lists and seqs? any of those, too? |
| 08:58 | clgv | ,(-> [] class ancestors) |
| 08:58 | clojurebot | #{java.lang.Runnable java.util.List clojure.lang.Associative clojure.lang.ILookup java.lang.Iterable ...} |
| 08:58 | clgv | ro_st: no |
| 08:59 | ro_st | ,(-> #{} class ancestors) |
| 08:59 | clojurebot | #{java.lang.Runnable java.lang.Iterable java.util.Collection clojure.lang.IObj java.util.concurrent.Callable ...} |
| 08:59 | ro_st | neat! |
| 08:59 | clgv | sets do only have values, no keys |
| 08:59 | zoldar | clgv: thanks |
| 09:00 | mklappstuhl | I want to write a file. everything I can find is the advice to use java io... is that still true? |
| 09:00 | mpenet | you can use spit |
| 09:00 | mklappstuhl | mpenet, It might be a long long file |
| 09:00 | mpenet | oh well better not then |
| 09:01 | mpenet | there is clojure.java.io |
| 09:02 | uvtc | mklappstuhl: some i/o examples at http://clojure-doc.org/articles/cookbooks/files_and_directories.html . |
| 09:03 | babilen | mklappstuhl: You can easily use a writer (http://clojuredocs.org/clojure_core/clojure.java.io/writer) but also take a look at https://github.com/Raynes/fs and the aforementioned page |
| 09:29 | mklappstuhl | is (doseq) the idiomatic way to iterate over lists? |
| 09:29 | joegallo | yes, quite so |
| 09:30 | joegallo | you might think of it as being the equivalent of java's for loop (but don't think of clojure's for in the same way!). |
| 09:30 | uvtc | mklappstuhl: `doseq` is for side-effects. |
| 09:34 | clgv | mklappstuhl: for side effects like printing something to stdout, yes. if you want to transform the list there is `map` or `for` |
| 09:38 | jcromartie | it's going to be OK |
| 09:38 | jcromartie | here, have a REPL |
| 09:40 | Hodapp | :) |
| 09:53 | mklappstuhl | having (:a :b) and (1 2) how would I get to {:a 1 :b 2} ? |
| 09:54 | dnolen | ,(zipmap '(:a :b) '(1 2)) |
| 09:54 | clojurebot | {:b 2, :a 1} |
| 09:54 | dnolen | mklappstuhl: ^ |
| 09:54 | mklappstuhl | dnolen, thanks |
| 09:54 | mklappstuhl | I knew it was something with zip :P |
| 09:56 | dnolen | if you've got some spare cycles upvote Ambrose's sweet Typed Clojure paper on HN http://news.ycombinator.com/newest |
| 09:58 | djcoin | dnolen: awesome ! |
| 09:58 | djcoin | :) |
| 09:59 | hyPiRion | dnolen: Sweet. I usually tend to upvote stuff after I've read through it though. |
| 10:01 | hyPiRion | Looks like a well done work. |
| 10:02 | ambrosebs | dnolen: cheers :) |
| 10:02 | djcoin | congrats :) |
| 10:03 | ambrosebs | djcoin: thanks! |
| 10:06 | mklappstuhl | how would I get the values of a hash-map in a list? {:a 1 :b 2} => (1 2) |
| 10:08 | dnolen | ,(vals {:a 1 :b 2}) |
| 10:08 | clojurebot | (1 2) |
| 10:08 | dnolen | mklappstuhl: ^ |
| 10:08 | Islaminati | shachaf, I think I need better dental hygiene. |
| 10:08 | dnolen | ambrosebs: this is a fantastic read :) seems like you've spent a considerable amount of time on this :D |
| 10:10 | ambrosebs | dnolen: lovely of you to say! |
| 10:11 | ambrosebs | dnolen: yes, it's basically been my year :) |
| 10:22 | dnolen | ambrosebs: well looky there #2 on HN, refreshing to see actual science at the top. |
| 10:22 | ambrosebs | dnolen: pity it's not a flashy webpage with browser repl ;) |
| 10:24 | dnolen | ambrosebs: what?! I have to read 74 pages of well written, well formatted, well referenced text! |
| 10:24 | ambrosebs | dnolen: but it's PDF! |
| 10:24 | ambrosebs | :D |
| 10:41 | mklappstuhl | another question :P |
| 10:44 | mklappstuhl | I have a list like (1 3 2 4 6) and I want to have a new list that contains the difference between the first and the second, the second and the third and so on |
| 10:45 | mklappstuhl | (2 -1 +2 +2) would be the wished outcome in the above example |
| 10:46 | ToBeReplaced | ,(let [coll '(1 3 2 4 6)] |
| 10:46 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 10:46 | ToBeReplaced | (map - coll (rest coll))) |
| 10:47 | ToBeReplaced | i don't know how to use the clojurebot! |
| 10:47 | Mr_Bond | ,(let [coll '(1 3 2 4 6)]) |
| 10:47 | clojurebot | nil |
| 10:48 | Mr_Bond | ,(let [coll '(1 3 2 4 6)] (map - coll (rest coll))) |
| 10:48 | clojurebot | (-2 1 -2 -2) |
| 10:48 | ToBeReplaced | i guess the carriage return was no good? |
| 10:48 | S11001001 | ToBeReplaced: true |
| 10:49 | ToBeReplaced | ,(let [coll '(1 3 2 4 6)] (map - coll (rest coll))) |
| 10:49 | clojurebot | (-2 1 -2 -2) |
| 10:49 | tmarsh | flipping the - gives the output requested |
| 10:49 | S11001001 | ToBeReplaced: more precisely, the intervening \r\nPRIVMSG #clojure : |
| 10:49 | tmarsh | ,(let [coll '(1 3 2 4 6)] (map - (rest coll) coll))) |
| 10:49 | clojurebot | (2 -1 2 2) |
| 10:56 | ohpauleez | dnolen: All done - http://dev.clojure.org/jira/browse/LOGIC-60 |
| 10:56 | dnolen | ohpauleez: sweet gotta run but will apply in a bit! |
| 10:57 | ohpauleez | Awesome |
| 11:02 | ambrosebs | Typed Clojure no.1 on HN :) |
| 11:03 | zerokarmaleft | ambrosebs: well-deserved, i'm 10 pages in |
| 11:08 | chronno | ambrosebs: congrats! :-) |
| 11:12 | ambrosebs | damn it, I have a big essay due tomorrow, but this is too exciting! |
| 11:16 | gfredericks | what are "functions accepting an even number of variable arguments"? like the mappy varargs? |
| 11:18 | ambrosebs | assoc, hash-map |
| 11:19 | gfredericks | that is quite fundamental. |
| 11:20 | ambrosebs | I cannot type check higher order usages |
| 11:20 | ambrosebs | but (assoc m k v k v) is easy |
| 11:20 | ambrosebs | In other words, they're hard coded primitives |
| 11:21 | ambrosebs | Are you reading the dissertation? Which part? Could I be clearer? |
| 11:24 | ambrosebs | gfredericks: a general solution would be quite interesting, and I think possible. |
| 11:27 | nDuff | ambrosebs: One minor nitpick -- it looks like there's some missing punctuation at the beginning of page 10. |
| 11:28 | nDuff | ambrosebs: personally, I'd add a semicolon and a comma, as such: "...for many uses; where other languages might use objects, Clojure ..." |
| 11:28 | nDuff | ambrosebs: ...but either way, the sentence seems like it's expressing two ideas without as much syntactic separation as should be there. |
| 11:31 | scriptor | nDuff: not sure about that, it's the same idea |
| 11:31 | scriptor | clojure uses maps where others use objects |
| 11:32 | scriptor | the 'where' binds the two phrases together |
| 11:33 | nDuff | scriptor: that piece I could take or leave; it's the second one, without the "where", that stands out most for me. |
| 11:33 | nDuff | (between "objects" and "Clojure") |
| 11:33 | scriptor | ah, right |
| 11:33 | scriptor | probably just missed a period there |
| 11:35 | hyPiRion | ambrosebs: Is your master thesis, or is it some other work? |
| 11:36 | hyPiRion | Well, look at that, I just completely skipped the bottom of page one. Disregard. |
| 11:38 | AdmiralBumbleBee | I just started reading about typed racket, and now this paper shows up |
| 11:38 | AdmiralBumbleBee | what excellent timing :) |
| 11:41 | antoineB | hello, does anyone has a project.clj working with lein-cljsbuild, noir and clojure 1.4 as dependancy ? |
| 11:42 | antoineB | mine don't |
| 11:43 | duck11231 | antoineB: What kind of issue are you seeing? |
| 11:43 | antoineB | java.io.FileNotFoundException: Could not locate clojure/instant__init.class or clojure/instant.clj on classpath: (tagged_literals.clj:1) |
| 11:43 | ambrosebs | hyPiRion: undergraduate honours dissertation |
| 11:44 | ambrosebs | nDuff: thanks, keep the nitpicks coming! |
| 11:44 | ambrosebs | nDuff: or any other suggestions |
| 11:44 | nDuff | ambrosebs: Not yet. That said -- I'm starting page 21 right now, so a ways from through. |
| 11:44 | ambrosebs | nDuff: this is my first paper, still have a lot to learn. |
| 11:51 | ambrosebs | nDuff: my email is abonnairesergeant at gmail dot com if you want to send any other suggestions |
| 11:51 | nDuff | *nod*. So far, I'm thoroughly impressed. |
| 11:52 | ambrosebs | Glad to hear. |
| 11:54 | antoineB | duck11231: the project.clj https://gist.github.com/3953538 |
| 11:55 | antoineB | duck11231: if i remove noir and fetch (that depends on noir), this will work |
| 12:03 | duck11231 | antoineB: I know I've seen that issue before, but can't remember what I did to fix it. I don't use noir. |
| 12:14 | duck11231 | antoineB: it looks like your noir dep is setting clojure to 1.3, try adding :exclusions [org.clojure/clojure] |
| 12:15 | duck11231 | to the noir dep, not globally |
| 12:18 | dnolen | ohpauleez: thanks for the patch, could we get the tests for simple unification and partial map unification copied over? |
| 12:18 | ohpauleez | dnolen: No problem, i have them in a codebase already - I'll have it done by the end of the day |
| 12:19 | ohpauleez | dnolen: Any thoughts about the weird discrepancy with partial-maps? https://github.com/clojure/core.logic/pull/10 |
| 12:20 | ohpauleez | I'm not sure why x doesn't unify (or potentially is just printing out like that) |
| 12:20 | antoineB | duck11231: nice that works, but i need to displace noir dependencie to "dev-dependencies", i don't know the difference |
| 12:22 | dnolen | ohpauleez: definitely a bug and probably a simple one. Open a separate ticket for that and I'll look into it. Thanks much. |
| 12:22 | ohpauleez | np |
| 12:22 | ohpauleez | thank you |
| 12:23 | duck11231 | antoineB: are you only using noir for tests? Chances are it won't work properly there. |
| 12:24 | duck11231 | also, unless you have a good reason to stay, it's probably best to get ahead of the curve and update your project to lein 2. |
| 12:24 | antoineB | yes for a little project |
| 12:31 | ynniv | has anyone written a KVO lib for clojurescript? |
| 12:35 | antoineB | duck11231: what do you mean by tests, do you mean unit tests or little project? |
| 12:35 | antoineB | and i use lein 1.7, what does 2.0 gives? |
| 12:35 | thorbjornDX | gfredericks: I messed with syntax quote a bit to try to get my macro going, and this is what I have so far: http://pastebin.com/kwhXyFzd any suggestions? (I'mm going to dig into Joy to try to understand it a bit better |
| 12:37 | nDuff | thorbjornDX: In the future, would you mind using gist.github.com, refheap, or otherwise something not full of ads? |
| 12:38 | thorbjornDX | nDuff: sure thing, adblock confused me |
| 12:39 | nDuff | thorbjornDX: ...so, re: that macro, the big thing that jumps out at me is that you should probably be using gensyms |
| 12:39 | duck11231 | antoineB: by tests, I meant unit tests. Dev dependencies is for dependencies used by your plugins and by lein itself. |
| 12:40 | thorbjornDX | nDuff: those are the # suffixes, correct? And I would use them in the let binding? |
| 12:40 | amalloy | nDuff, thorbjornDX: gensyms aren't the (main) issue. the issue is you're expanding to a doseq, which tries to do stuff at runtime, when really you want to expand into multiple defmacros at compile time |
| 12:41 | amalloy | er, defmethods, i guess |
| 12:42 | thorbjornDX | amalloy: yes, I'd like to end up with a single defmulti, and multiple defmethods. I guess I just jumped to doseq since I figured I was looping and causing side-effects (method definitions) |
| 12:42 | amalloy | you want something like https://gist.github.com/3953894 |
| 12:43 | amalloy | Raynes: https://github.com/Raynes/refheap.el says it's not useful to the general public; i think that's out of date? |
| 12:44 | duck11231 | antoineB: lein2 has a number of improvements, but it also changes the was some of the project options are laid out. Since lein2 will be "the thing" eventually all over, you'll save yourself a bit of a headache if you're mindful of those changes now. |
| 12:44 | thorbjornDX | amalloy: can you give me a quick explanation of ~@ vs ~? (or point me to a reference) |
| 12:44 | antoineB | ok |
| 12:45 | antoineB | i have another problem, but this time with macro in clojurescript |
| 12:45 | duck11231 | antoineB: This should help. https://github.com/technomancy/lein-precate |
| 12:45 | amalloy | &(let [x '(a b c)] (vector `(1 2 ~x 3) `(1 2 ~@x 3))) |
| 12:45 | lazybot | ⇒ [(1 2 (a b c) 3) (1 2 a b c 3)] |
| 12:45 | antoineB | i have go this two requiring (:require [fetch.remotes :as remotes]) (:require-macros [fetch.macros :as fm]) |
| 12:46 | jamii | Woah - strucjure.walk> (macroexpand-1 '(parser/view a #(= 1 %) 'ok)) |
| 12:46 | jamii | StackOverflowError java.util.regex.Pattern$CharProperty.match (Pattern.java:3362) |
| 12:46 | technomancy | antoineB: see also https://github.com/technomancy/leiningen/wiki/Upgrading |
| 12:46 | amalloy | jamii: parser/view probably expands to another call to parser/view |
| 12:47 | lispnik | if I have a file that contains "() |
| 12:48 | gfredericks | then he'll want some milk as well |
| 12:49 | antoineB | duck11231: my new problem :) https://gist.github.com/3953940 any ideas? |
| 12:50 | thorbjornDX | amalloy: perfect, thanks for that :) |
| 12:52 | duck11231 | antoineB: could you post your updated project.clj? |
| 12:54 | antoineB | https://gist.github.com/3953972 |
| 12:57 | arrdem | tool design question for you guys |
| 12:58 | duck11231 | I would try copying those 2 deps to :dependencies IIRC, cljsbuild uses your main classpath to look for cljs files. |
| 12:58 | arrdem | I'm wiriting a tool that reads BNF and generates the equivalent fnparse code, the problem is how to let users hook their code in. |
| 12:58 | duck11231 | but it's been a while since I've done anything with lein1 |
| 12:59 | arrdem | right now I just generate function stubs, I was hoping someone else had a better way. |
| 12:59 | antoineB | duck11231: the cljs file is found as well |
| 12:59 | antoineB | but the clj (the macro) is not |
| 12:59 | hiredman | arrdem: fnparse is kind of dead, no? |
| 13:00 | arrdem | hiredman: heh yeah as of several years ago. still works a treat tho. |
| 13:00 | hiredman | arrdem: last I checked it doesn't load in newer clojure versions |
| 13:01 | arrdem | hiredman: really? I've been using it in 1.4.0 projects with no problems... |
| 13:01 | hiredman | hmmmm |
| 13:01 | antoineB | duck11231: copying "fetch" dep to "dependencies" make it works |
| 13:01 | antoineB | duck11231: so defenitly i need docs on lein |
| 13:01 | hiredman | arrdem: not possible |
| 13:02 | hiredman | arrdem: I would recommend checking to make sure you are really using clojure 1.4 |
| 13:02 | duck11231 | lein2 cleaned upp a lot of the mess surrounding plugins |
| 13:02 | arrdem | hiredman: do tell |
| 13:02 | hiredman | arrdem: it pulls in some aot compiled bits of old contrib, and the abi for clojrue has changed since then |
| 13:02 | antoineB | i will take lein2 in account seriously |
| 13:02 | thorbjornDX | amalloy: here's my solution: https://gist.github.com/3954024 |
| 13:03 | duck11231 | antoineB: probably won't take any longer than 5 min or so. Just look at the guide technomancy linked |
| 13:04 | antoineB | i am currently on |
| 13:04 | arrdem | hiredman: herm. that squares whith what I'm seeing... is there a reason I should really care? looks like most of the code I'm writing is STDLIB only and good back to 1.1 or so |
| 13:05 | hiredman | arrdem: who do you expect to use this? |
| 13:05 | jamii | amalloy: turned out to be much more interesting - there was a cyclic datastructure in the metadata. it was well behaved until I had both *print-meta* set to true and had a compiler pass that forced the delay |
| 13:05 | arrdem | hiredman: me. anyone else is a bonus. |
| 13:05 | arrdem | it's just a question of software engineering "best practices" in Clojure. |
| 13:06 | hiredman | arrdem: if you care about bug fixes and new features, if not then using a old (2 year old?) version of clojure is fine |
| 13:07 | hiredman | clojurebot is locked on 1.2 at the moment because of fnparse, which is lame |
| 13:08 | arrdem | herm... TBH I really like fnparse's API so I may take it on myself to rewrite it for not 1.2 but no promises. |
| 13:08 | arrdem | after all there are other parser libs |
| 13:09 | amalloy | hah, that's great, jamii. to be fair i'd have spotted that if you'd pasted a whole stacktrace |
| 13:09 | amalloy | i thought someone had written an update to fnparse to get off of old-contrib |
| 13:10 | arrdem | amalloy: https://github.com/Cyrik/fnparse/commit/6009b69b60594bb357e28229d95ea75e03649fba |
| 13:10 | arrdem | (not me) |
| 13:10 | arrdem | but a 1.4 update |
| 13:11 | amalloy | arrdem: are you using that version? i think hiredman assumed you were using the canonical one, and thus stuck on clojure 1.2.x |
| 13:12 | arrdem | amalloy: hiredman has my number, I am guilty of the old build |
| 13:14 | arrdem | I just wanted to ask what the nicest way for someone else to hook into generated code would be |
| 13:15 | amalloy | arrdem: i think the usual way to use a combinator-based parser library is not to generate code, but to let the parser generate a data structure for you, and then manipulate/interrogate that structure however you need to |
| 13:19 | arrdem | amalloy: that make sense... the idea with this was that I ran into all kinds of transcription errors translating correct BNF to a fnparse code so I wanted something to do the parser generation for me. |
| 13:19 | duck11231 | arrdem: If you're looking for ways to hook code, you could check out https://github.com/technomancy/robert-hooke or https://github.com/francoisdevlin/Decorate |
| 13:19 | Hodapp | This is indeed how I used combinators when I wrote a parser in Scala. |
| 13:19 | Hodapp | It was kind of awesome. |
| 13:21 | arrdem | duck11231: that is epic |
| 13:21 | jkkramer | multimethods can be a nice way to provide hooks/extensibility |
| 13:22 | jkkramer | without mucking about with vars |
| 13:26 | ohpauleez | Additionally, depending on the types of hooks, protocols could be as far as you need to go |
| 13:40 | Cheiron_ | Hi, I want to translate this to clojure https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java |
| 13:40 | Cheiron_ | I will use proxy to extend the class and reify to implement the interface, correct? |
| 13:42 | joegallo | sounds right to me |
| 13:47 | Cheiron_ | extending should go to its own file and implementing goes to its own file ? so I can use gen-class ? |
| 13:52 | timewarrior | ,(+ 1 2) |
| 13:52 | clojurebot | 3 |
| 13:53 | Cheiron_ | clojurebot: do you run on Shen? |
| 13:53 | clojurebot | Pardon? |
| 13:56 | ohpauleez | Cheiron_: That's a good idea |
| 13:56 | ohpauleez | we should add Shen and core.logic to clojurebot |
| 13:57 | technomancy | ugh |
| 13:57 | technomancy | no |
| 13:58 | ohpauleez | ok ok ok, but how about just core.logic |
| 13:58 | ohpauleez | I think there is a growing curiosity of, "does this unify?" |
| 13:58 | Cheiron_ | how to tackle this? https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java#L12 |
| 13:58 | technomancy | running a helpful channel bot that's not OSS would be silly |
| 13:58 | Cheiron_ | how to declare an instance var when using proxy? |
| 13:58 | hiredman | write a core.logic rest service |
| 14:01 | dnolen | ohpauleez: maybe you can get Raynes to add it to lazybot? ;) |
| 14:01 | ohpauleez | hiredman: I just bought "unifythislogic.com" - I accept your challenge |
| 14:01 | hiredman | ohpauleez: lemme know when you have an api, and I'll see about having clojurebot fiddle it |
| 14:05 | ohpauleez | dnolen: I know you've been swamped lately, but I might have some general questions for you regarding generic data querying using unification |
| 14:06 | ohpauleez | I'm trying to make my datalog-like query more generic as a learning example for others |
| 14:08 | dnolen | ohpauleez: it's actually pretty tricky to do fully generic queries w/ core.logic since's it really more like an embedding programming language - similar challenges with Prolog. |
| 14:08 | ohpauleez | well, that makes me feel a lot better |
| 14:09 | ohpauleez | I have a weird mix of cond, filter, binding-map, and the unifier right now |
| 14:09 | dnolen | ohpauleez: one approach might be something like [:or g0 g1 [:and g2 g3]] - I've been thinking about supporting something like that. |
| 14:09 | dnolen | ohpauleez: I know the ekeko guys just use eval |
| 14:10 | ohpauleez | right now my queries are in this form: |
| 14:10 | ohpauleez | git ttt '[(?x :id :summary) :where [?x :current-state :open :summary "ticket"]]' |
| 14:10 | ohpauleez | the first turns into a select-keys, but alternate forms are allowed |
| 14:10 | ohpauleez | each thing in latter []'s are and's |
| 14:11 | ohpauleez | you do or's with multiple []'s |
| 14:11 | dnolen | if you have a link to your work I can give you some feedback when I have more free cycles. |
| 14:11 | ohpauleez | cool, thanks |
| 14:13 | Cheiron_ | how to call super method inside proxy macro? https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java#L23 |
| 14:13 | S11001001 | Cheiron_: proxy-super, *be warned*, *not*thread*safe*!!**! |
| 14:14 | S11001001 | sorry, I don't mean not thread safe, I mean *not reentrant*. |
| 14:15 | S11001001 | Cheiron_: in other words, prefer composition over class extension. |
| 14:15 | Cheiron_ | I don't hava I choice (I think). i have to translate this to Clojure https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java |
| 14:17 | Apage43 | Cheiron_: you actually want to reimplement DefaultKryoFactory, or are you just implementing the same interface? |
| 14:17 | Apage43 | at any rate, is it possible for you to use (reify) instead of (proxy) ? |
| 14:17 | Cheiron_ | I need to extend Kryo class and implement the interface IKryoFactory |
| 14:17 | Cheiron_ | should I pass this to proxy-super ? |
| 14:19 | Apage43 | proxy-super captures this for you |
| 14:19 | Apage43 | it's a macro |
| 14:20 | Cheiron_ | (proxy-super method) or (proxy-super .method) ? I guess the latter |
| 14:20 | Apage43 | former |
| 14:21 | Cheiron_ | .method? |
| 14:21 | Apage43 | no dot. |
| 14:21 | Cheiron_ | oh |
| 14:24 | Apage43 | anyway, just be aware that during method call you cannot call a method of the same name on the proxy object, as you'll get the super method instead of the proxied version |
| 14:25 | tgoossens | What is a good and short talk about datomic |
| 14:25 | tgoossens | I want to know what it is about |
| 14:30 | Cheiron_ | It is an immutable database :) |
| 14:31 | Cheiron_ | datomic website has a nice interview |
| 14:32 | hiredman | infoq has 5-6 videos (some of them are dups) of talks rich or stu have given on datomic |
| 14:34 | tgoossens | Ok |
| 14:34 | tgoossens | On clojure rationale |
| 14:34 | cmajor7 | since the approach for clojurescript is to compile everything in a single bootstrap.js, what is the recommended way to ensure the order? e.g. I have some listeners in one cljs file that need to be executed after another cljs file is done altering the DOM. |
| 14:34 | tgoossens | "OOP Born of simulation, now used for everything," |
| 14:34 | tgoossens | What does it mean |
| 14:35 | tgoossens | Born of simulation |
| 14:35 | technomancy | "when an Alan Kay loves a Simula very much ..." |
| 14:37 | tgoossens | ? |
| 14:39 | bhenry | need some help with korma. i have 2 tables tMessage and tMessageType. how can i structure the tMessage entity so that it has a field called messageType which is the tMessageType.messageType where tMessageType.id = tMessage.messageTypeID |
| 14:39 | Cheiron_ | hi, how to map this to clojure ? ((KryoSerializableDefault)k).overrideDefault(true); (how to cast) ? |
| 14:40 | S11001001 | Cheiron_: (.overrideDefault k true) |
| 14:40 | Cheiron_ | no need to type cast? |
| 14:40 | S11001001 | Cheiron_: no need |
| 14:40 | Cheiron_ | may I ask why? |
| 14:40 | muhoo | one of the great joys in clojure |
| 14:40 | S11001001 | Cheiron_: because it's more fun than requiring the cast |
| 14:41 | muhoo | not having to deal with java BDSM |
| 14:41 | Cheiron_ | i see :) |
| 14:41 | antares_ | Langohr 1.0.0-beta10 is released: http://blog.clojurewerkz.org/blog/2012/10/25/langohr-1-dot-0-beta10-is-released/ |
| 14:57 | ynniv | ibdknox: I'm looking for a backbone-like (data observing) library in clojurescript. are you using waltz this way? |
| 14:59 | ohpauleez | ynniv: You might want to checkout https://github.com/lynaghk/reflex |
| 15:00 | fbru02 | Hi all I'm trying to use with-derefs-fn to do mocking but i get an error like this : lemur_utils.sqs$get_message_from_queue cannot be cast to clojure.lang.IDeref ? anyone can help ? |
| 15:00 | ohpauleez | if what you want to do is data observation |
| 15:01 | ynniv | ah, that's a useful link. |
| 15:03 | gfredericks | (inc lynaghk) |
| 15:03 | lazybot | ⇒ 1 |
| 15:06 | ynniv | (= lynaghk) |
| 15:07 | ynniv | looks like reflex is used in the grander data vis system c2 |
| 15:08 | ynniv | innnnteresting |
| 15:10 | Sgeo | http://www.reddit.com/r/Clojure/comments/122ll8/free_clojure_course/ this might be good for some lolz. Will have to check it out later. |
| 15:10 | Sgeo | Same person who didn't understand doseq vs. for a while ago |
| 15:10 | Sgeo | Guess what? There course goes over doseq and for |
| 15:11 | Sgeo | *They're |
| 15:11 | gfredericks | *their |
| 15:11 | ohpauleez | ynniv: FWIW, kevin and I have been sketching out a new system for CLJS in this area - that handles two-way binding and full-binding-resolution-before-redraw |
| 15:11 | Sgeo | gfredericks, derp. |
| 15:11 | Sgeo | I need sleep. |
| 15:12 | ynniv | ohpauleez: oh yes. I was a happy sproutcorer for that exact reason, until the SC community went sideways |
| 15:13 | ynniv | what's up with the mix of cljs and coffeescript? |
| 15:13 | ynniv | (singult for instance) |
| 15:13 | ohpauleez | yes - while I think a lot of approaches in the general area are half-baked or naive implementations, there is a serious need to combine two-way-bind and bind-resolution-before-redraw |
| 15:14 | TimMc | Sgeo: "Clojure Lisp Programming" |
| 15:14 | ohpauleez | ynniv: singult's goals are to allow platform interop as well - so that you can use it from JS as well as in CLJS |
| 15:14 | ohpauleez | personally, I use enfocus and raw html partials |
| 15:15 | ynniv | sproutcore had a fairly mature data binding implementation, but it was a small part of a much larger system that was pulled in many directions and eventually fell apart |
| 15:15 | augustl | is there an "assoc if not already present" for maps? |
| 15:15 | TimMc | Sgeo: "The apply function" Oh god this does not bode well. |
| 15:15 | ohpauleez | but some people love the crap out of the other stuff |
| 15:15 | augustl | (merge {:foo bar} my-map) comes to mind |
| 15:15 | TimMc | augustl: update-in is close... |
| 15:15 | Sgeo | TimMc, I wish I could stick around, but I have to get to class. A _real_ class, I mean. |
| 15:15 | ohpauleez | augustl: like python's set-default? |
| 15:16 | Sgeo | No matter how boring I find my school, it's not likely to be utterly attrociously wrong |
| 15:16 | augustl | ohpauleez: like (if (not (contains? my-map :key) (assoc my-map :key some-value)) :) |
| 15:16 | augustl | could just write my own real quick of course |
| 15:17 | Sgeo | TimMc, apply isn't a function? Hmm, didn't realize that, to be honest |
| 15:17 | ohpauleez | make sure you put `my-map` in the else clause |
| 15:17 | Sgeo | ,(-> (meta #'apply) :macro) |
| 15:17 | ohpauleez | augustl: ^ |
| 15:17 | clojurebot | nil |
| 15:17 | Sgeo | ,(meta #'apply) |
| 15:17 | clojurebot | {:ns #<Namespace clojure.core>, :name apply, :arglists ([f args] [f x args] [f x y args] [f x y z args] [f a b c d ...]), :added "1.0", :static true, ...} |
| 15:18 | TimMc | Hmm? Oh, apply is weird in a different way, nvm. |
| 15:18 | TimMc | but he calls doseq, for, & loop functions |
| 15:18 | Sgeo | It does Java interop |
| 15:19 | TimMc | I think it's usually a compiler special in other lisps. |
| 15:19 | Sgeo | I really need to get going now |
| 15:19 | ynniv | ,(let [x { :foo 1 :bar 2 }] (conj x { :bar (or (:bar x) 3) :baz (or (:baz x) 4) })) ? |
| 15:19 | clojurebot | {:baz 4, :foo 1, :bar 2} |
| 15:19 | TimMc | Go! |
| 15:19 | konr_trab | do you recommend any article or book on programming with contracts or anything better on Clojure? 'The joy of clojure' is very brief on the issue |
| 15:21 | technomancy | konr_trab: afaict nothing exists around that because no one's really used those techniques in nontrivial systems yet |
| 15:21 | technomancy | and lived to tell the tale |
| 15:24 | mklappstuhl | I have a very general question about "putting files together" |
| 15:24 | mklappstuhl | I have a few files that use functions that might be defined in another file |
| 15:25 | mklappstuhl | I currently (load-file) these but I'm pretty sure that this is not the ideal way as it forces me to load files in a specific order... |
| 15:25 | gfredericks | ~leiningen |
| 15:25 | clojurebot | http://github.com/technomancy/leiningen |
| 15:27 | mklappstuhl | gfredericks, I'm not loading files from libraries... I load files I wrote myself ... is leiningen also useful for that? |
| 15:27 | gfredericks | quite |
| 15:27 | gfredericks | you should have 1 namespace per file, and the files should have filenames and be in directories corresponding to the namespace |
| 15:28 | gfredericks | then you declare dependencies between namespaces with (:require ...) clauses in the ns declaration |
| 15:28 | gfredericks | half to all of that is not particular to leiningen |
| 15:29 | gfredericks | but lein can do additional things like let you run arbitrary functions in your project from the command line, compile your project into a jar, etc |
| 15:30 | gfredericks | also leiningen is a lot easier for people (like in IRC) to help with, compared to doing stuff by hand |
| 15:30 | hiredman | http://clojure.org/namespaces |
| 15:31 | gfredericks | I knew there must be some docs somewhere :) |
| 15:33 | antares_ | gfredericks: there is also http://clojure-doc.org/articles/language/namespaces.html now |
| 15:34 | gfredericks | (inc docs) |
| 15:34 | lazybot | ⇒ 1 |
| 16:00 | mklappstuhl | gfredericks, using namespaces, do I need to load clojure.core itself? because it says I dont have (def ) anymore |
| 16:01 | amalloy | it's not possible for you to no longer have def |
| 16:01 | mklappstuhl | amalloy, |
| 16:01 | mklappstuhl | CompilerException java.lang.RuntimeException: No such var: clojure.core/def, compiling:(mklappstuhl/stock_utils/analyze.clj:1) |
| 16:02 | AtKaaZ | i think that happened to me once with the master branch, or it was something else but it fixed when I (use 'clojure.repl) |
| 16:02 | AtKaaZ | i think maybe it was just doc and source |
| 16:02 | mklappstuhl | my description might have been incorrect but I think its a similar effect |
| 16:02 | mklappstuhl | AtKaaZ, I'm loading it from the repl |
| 16:03 | AtKaaZ | do you have doc and source? |
| 16:03 | amalloy | mklappstuhl: (ns foo (:require ...)) (more-code...), not (ns foo (:require ...) (more-code...)) |
| 16:04 | AtKaaZ | amalloy, that was exactly my problem haha you rock |
| 16:04 | AtKaaZ | (inc amalloy) |
| 16:04 | ynniv | yes, (ns …) is non-functional. you don't put your code in the form |
| 16:04 | lazybot | ⇒ 34 |
| 16:06 | mklappstuhl | amalloy, this also solved my problem |
| 16:09 | AtKaaZ | hmm, I might've spoke too soon :D I actually had the ns/code like in the first variant hmm, in my case then something else happened that caused clojure.repl to get unloaded or something |
| 16:15 | mklappstuhl | I'm now getting this error: |
| 16:15 | mklappstuhl | Exception lib names inside prefix lists must not contain periods |
| 16:16 | mklappstuhl | with a core.clj like this: |
| 16:16 | mklappstuhl | (ns mklappstuhl.stock-utils.core |
| 16:16 | mklappstuhl | (:require [mklappstuhl.stock-utils.analyze :as analyze] |
| 16:16 | mklappstuhl | [mklappstuhl.stock-utils.metrics :as metrics] |
| 16:16 | mklappstuhl | [mklappstuhl.stock-utils.simulate :as simulate] |
| 16:16 | mklappstuhl | [mklappstuhl.stock-utils.utilities :as utilities])) |
| 16:16 | mklappstuhl | sorry for the long paste ;) |
| 16:19 | ynniv | mklappstuhl: https://gist.github.com/ is nice for long pastes, and it highlights syntax |
| 16:19 | AtKaaZ | what *clojure-version*? |
| 16:20 | mklappstuhl | ynniv, I know but yeah... 5 simple lines... :P |
| 16:20 | technomancy | 10 lines actually, since they wrapped |
| 16:21 | ynniv | didn't wrap for me... |
| 16:21 | ynniv | ,*clojure-version* |
| 16:21 | clojurebot | {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"} |
| 16:22 | AtKaaZ | mklappstuhl what's the full error and clojure version? |
| 16:23 | mklappstuhl | full message: |
| 16:23 | mklappstuhl | Exception lib names inside prefix lists must not contain periods clojure.core/load-lib (core.clj:5223) |
| 16:24 | mklappstuhl | how do I get the version I'm using? o.O |
| 16:24 | technomancy | I wonder if ambrose wants bug reports on his paper via github issues |
| 16:24 | mklappstuhl | 1.3 |
| 16:25 | brehaut | technomancy: on HN he was asking for them via email i think |
| 16:25 | gfredericks | the vararg section (with the not= example) seemed wrong |
| 16:25 | AtKaaZ | mklappstuhl, how do you know to which file the error applies? |
| 16:26 | brehaut | technomancy http://news.ycombinator.com/item?id=4698310 |
| 16:27 | technomancy | "O'Caml" is bugging me =) |
| 16:27 | mklappstuhl | AtKaaZ, I don't know it for sure to be honest. it just happens when I require .core .. |
| 16:27 | brehaut | technomancy: its the irish fork |
| 16:27 | ohpauleez | brehaut: haha |
| 16:27 | technomancy | did he explain why he uses a separate form for annotations rather than metadata? |
| 16:28 | brehaut | not that i saw |
| 16:28 | technomancy | weird |
| 16:28 | brehaut | but i havent got all the way through yet |
| 16:28 | technomancy | typed clojure wins as the best-documented clojure library of all time |
| 16:28 | amalloy | technomancy: because you can annotate functions you didn't write |
| 16:28 | technomancy | 74 pages of immaculately-typeset docs |
| 16:29 | gfredericks | how usable is typed-clojure currently? |
| 16:29 | technomancy | amalloy: vary-meta? |
| 16:29 | amalloy | i assume you mean alter-meta! |
| 16:29 | amalloy | since i doubt if it's metadata on the functions |
| 16:29 | technomancy | yeah, I spose so, stupid fns-not-having-metadata =P |
| 16:29 | mklappstuhl | where does leiningen pull its version of clojure from? I have 1.4 installed on my system but running lein repl => *clojure-version* returns 1.3 |
| 16:30 | technomancy | I was kind of hoping for more inference =\ |
| 16:30 | hiredman | technomancy: the annotation form my just be a short cut for putting metadata on vars |
| 16:30 | hiredman | may |
| 16:30 | technomancy | hiredman: yeah, maybe it's just using ann uniformly for pedagogical purposes |
| 16:31 | technomancy | less to explain to his thesis advisors =) |
| 16:33 | S11001001 | mklappstuhl: make a project and run lein repl within it |
| 16:34 | S11001001 | mklappstuhl: then lein repl will use whatever clojure version is in your project file, and also provide 3rd party libraries and your project's sources in right places in classpath |
| 16:34 | technomancy | mklappstuhl: system-wide installs are ignored by leiningen (and any sane library management system really) |
| 16:37 | mklappstuhl | technomancy, you did/do a really good job with leiningen... ;) |
| 16:37 | mmitchell | is there anything like Ruby's rake for Clojure? |
| 16:38 | antares_ | mmitchell: leiningen.org? |
| 16:38 | wunki | can someone recommend a fn which is well suited to "humanize" numbers. E.g., 100000 -> 100.000 |
| 16:38 | TimMc | wunki: I believe the Java standard libraries have NumberFormat or something. |
| 16:38 | Frozenlo` | you mean 100 000 ? |
| 16:38 | TimMc | No no, 100,000. :-P |
| 16:39 | wunki | It's for download size, so I want to keep it '.' :) |
| 16:39 | wunki | I'm going from bytes to kb/mb/gb etc. Now I just want the dots |
| 16:39 | TimMc | The right thing to do is use a locale-based formatter. |
| 16:41 | mmitchell | antares_: oh yeah! i kinda forgot that it supports that sort of thing |
| 16:41 | Frozenlo` | IMO dots and commas should never be used in numbers except for the decimal separator. |
| 16:41 | TimMc | ,(.format (java.text.NumberFormat/getInstance java.util.Locale/GERMAN) 1e5) |
| 16:41 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.ExceptionInInitializerError> |
| 16:41 | wunki | it's to make it human readable, not for calculation |
| 16:42 | TimMc | &(.format (java.text.NumberFormat/getInstance java.util.Locale/GERMAN) 1e5) |
| 16:42 | lazybot | ⇒ "100.000" |
| 16:42 | AtKaaZ | mmitchell: https://twitter.com/qertoip/statuses/20449282180 |
| 16:42 | Frozenlo` | wunki: It makes it human readable for a very local population |
| 16:42 | wunki | TimMc: thanks! |
| 16:42 | TimMc | wunki: Use the system locale, if possible. |
| 16:42 | antares_ | AtKaaZ: cake is no longer developed |
| 16:42 | antares_ | AtKaaZ: cake developers now work on leiningen. I think it has been going for almost one year now. |
| 16:43 | AtKaaZ | antares_: I see, I'd ofc use leiningen,but he asked :) |
| 16:43 | wunki | Frozenlo`: this is only about byte size, not money luckily |
| 16:43 | mmitchell | AtKaaZ: are people still using cake? For some reason I thought it and leiningen were merged? |
| 16:44 | TimMc | &(.. (java.text.NumberFormat/getInstance (java.util.Locale/getDefault)) (format 1e5)) ;; wunki |
| 16:44 | lazybot | ⇒ "100,000" |
| 16:44 | antares_ | mmitchell: that is correct |
| 16:44 | AtKaaZ | mmitchell: that was my interpretation of your question: <mmitchell> is there anything like Ruby's rake for Clojure? |
| 16:44 | antares_ | mmitchell: cake is no longer developed |
| 16:44 | TimMc | wunki: Is this to be run on a server or the user's own computer? |
| 16:44 | mmitchell | AtKaaZ: ok gotcha, thanks |
| 16:45 | wunki | TimMc: going to be run on a server |
| 16:45 | TimMc | wunki: OK, then grab the user's locale from their browser's request headers. |
| 16:45 | mmitchell | antares_: do you need leiningen 2 to run tasks? My team and I are all stuck on 1 :( |
| 16:45 | mmitchell | (definitely time to upgrade) |
| 16:46 | antares_ | wunki: take a look at https://github.com/ptaoussanis/tower, maybe it has something for your case |
| 16:46 | TimMc | otherwise they may be extremely surprised |
| 16:46 | antares_ | mmitchell: lein 1 can do that, too, but it is a good idea to upgrade. See lein-precate that will generate (mostly) updated project.clj for you. |
| 16:47 | mmitchell | antares_: cool thanks |
| 16:48 | antares_ | mmitchell: see https://github.com/technomancy/leiningen/wiki/Upgrading and https://github.com/technomancy/leiningen/blob/master/doc/MIXED_PROJECTS.md (if you have Java code in your projects) |
| 16:48 | wunki | TimMc: that's to much for now. Thanks for showing me how it's done. |
| 16:50 | AtKaaZ | antares_: do you have any pointers on how to aot compile leiningen and have the classes inside the .jar ? |
| 16:50 | TimMc | AtKaaZ: You want to AOT lein itself? |
| 16:50 | antares_ | AtKaaZ: leiningen itself? |
| 16:50 | AtKaaZ | timmc, yes something like what preview10 .jar has |
| 16:51 | AtKaaZ | both classes and .clj inside it |
| 16:51 | antares_ | AtKaaZ: https://github.com/technomancy/leiningen#building and then ./bin/lein uberjar |
| 16:52 | antares_ | https://github.com/technomancy/leiningen/blob/master/bin/release demonstrates what is done before release |
| 16:52 | AtKaaZ | I did both but they both give me no classes inside, esp. if I use preview10 lein to do it |
| 16:53 | muhoo | :aot :all in project? |
| 16:53 | AtKaaZ | :all too? hmm |
| 16:54 | TimMc | AtKaaZ: Why are you AOT'ing? |
| 16:55 | AtKaaZ | timmc, maybe for speed? I notice that the snapshot is 9.4mb jar and the preview10 is 11.1mb because the class files are missing |
| 16:56 | antares_ | full AOT does help with startup time and for leiningen that is important |
| 16:56 | AtKaaZ | but I am failing to do it for lein, if I use the 9.4mb .jar then I get this: http://pastebin.com/remhhXPR |
| 16:56 | technomancy | mklappstuhl: heh; thanks =) |
| 16:58 | technomancy | mmitchell: what's keeping you on lein1 if you don't mind my asking? |
| 16:58 | AtKaaZ | if I use pre10 lein.bat and its .jar it gives no errors but it won't aot http://pastebin.com/x6KQU5e3 |
| 16:58 | technomancy | trying to make sure the upgrade process is as smooth as possible, so I always want to heard from those who are blocked on it |
| 16:58 | nDuff | AtKaaZ: Could you please consider gist.github.com, refheap, or another pastebin not full of ads in the future? |
| 16:59 | AtKaaZ | nDuff, pastebin has ads? sorry, didn't know, I'll do gist I think |
| 16:59 | technomancy | AtKaaZ: ugh; it's a problem with AOT/protocols |
| 17:00 | technomancy | AtKaaZ: though if you already have a jar created I'm not sure why you're running through the release process again? |
| 17:00 | technomancy | AtKaaZ: you should build with bin/lein rather than a self-installed build |
| 17:01 | AtKaaZ | technomancy: the created .jar has only source code, I was hoping to get the .class files inside it too, somehow |
| 17:01 | mmitchell | technomancy: well, we have too many things to do :) and... I think we have a few in-house plugins that are needing an upgrade |
| 17:01 | amalloy | we should add a lazybot trigger for when someone says pastebin: "nDuff wishes you would stop using pastebin" |
| 17:02 | aphyr | mmmmm refheap. |
| 17:02 | technomancy | mmitchell: sure, fair enough. it's always those internal plugins that get ya |
| 17:02 | AtKaaZ | technomancy: I'll try with bin/lein too, but it's probably the same thing(?) |
| 17:02 | technomancy | AtKaaZ: if you clear out target/ first you shouldn't get hit by AOT issues |
| 17:02 | mmitchell | technomancy: yeah, other than that, we're all really looking forward to it |
| 17:02 | AtKaaZ | nDuff: didn't see the ads due to adblock plus+firefox |
| 17:03 | ynniv | there are ads in pastebin? not with adblock+flashblock+ghostery ... |
| 17:03 | technomancy | mmitchell: on the other hand the plugin ecosystem is big enough now that there are very few legitimate needs for custom one-off plugins anymore |
| 17:03 | technomancy | but existing code that works has inertia |
| 17:04 | Frozenlo` | Wait what... ads in pastebin? |
| 17:04 | nDuff | ynniv: sure, but why would you use something when you're disobeying the (implied if not effective/legal) terms of service, when something else exists that is both (1) a better service, and (2) expressly free for use (without the cost of providing ad views)? |
| 17:04 | nDuff | Frozenlo`: Yes, it's full of them. Big, animated ones, often. |
| 17:04 | Frozenlo` | Or rather "wait what, people without an ad-blocker?" |
| 17:04 | technomancy | AtKaaZ: TBH I don't understand exactly what's going on in this case other than "uuuuugh someone is using protocols; I hate it when they do that" |
| 17:04 | mmitchell | technomancy: true yep, we have one that shows, and dynamically creates the project version from the git commit sha. |
| 17:04 | technomancy | mmitchell: that's already done by lein jar actually |
| 17:04 | technomancy | it's in the pom |
| 17:04 | Frozenlo` | I'm all for using refheap, just surprised by the ad-blocker-lessness |
| 17:05 | technomancy | Frozenlo`: depends on the sites you frequent |
| 17:05 | AtKaaZ | technomancy: no idea what that means, I'm certainly not using them :) |
| 17:05 | technomancy | I don't make a habit of visiting annoying sites, so I don't bother |
| 17:05 | nDuff | Frozenlo`: I've worked for too many web startups where having adblockers prevented me from seeing bugs in my own employer's code (when embedded/whatnot on 3rd-party sites; can't whitelist _every_ partner)) |
| 17:05 | mmitchell | technomancy: really? so, how can i learn more about that feature (the version thingy)? |
| 17:05 | nDuff | Frozenlo`: ...also, I have moral issues with them. |
| 17:05 | technomancy | AtKaaZ: yeah unfortunately it's hard to avoid pulling them in transitively. in this case nrepl is the culprit; not your fault, it just makes for error-prone builds. |
| 17:05 | amalloy | there's just something about adblock that makes users of it really smug and feel they need to mention it anytime someone remarks that there are ads on the web |
| 17:06 | technomancy | AtKaaZ: especially self-hosting builds |
| 17:06 | technomancy | also: not having flash installed does wonders for reducing ad-based annoyance |
| 17:06 | technomancy | amalloy: it's in the ablock TOS I'm sure =) |
| 17:07 | technomancy | mmitchell: take a look inside your jar; you should see a pom.xml file for your project |
| 17:07 | Frozenlock | amalloy: if I told you I wasn't using a version control system, wouldn't you be surprised? |
| 17:07 | ynniv | nDuff: gist is only free because it's an implicit ad for github. as for the moral issue, websites rarely ask if I'm okay being tracked, so I'm okay not asking if they mind I don't view their ads |
| 17:07 | technomancy | mmitchell: under <scm> there should be a <tag> containing the rev under which your jar was generated |
| 17:07 | AtKaaZ | Frozenlock, I'd think less of you :D |
| 17:07 | Frozenlock | :D |
| 17:08 | mmitchell | technomancy: so actually, it's the other way around. The version is not read from project.clj, instead, it's injected into the project map by our version "middleware" plugin. |
| 17:08 | brehaut | Frozenlock: i wouldnt be; a lot of people still use SVN |
| 17:08 | nDuff | ynniv: Sure. I don't have a problem with _all_ ads. I have a problem with big, flashy, animated ads. |
| 17:08 | technomancy | mmitchell: oh, I see what you mean. yeah that's different. |
| 17:08 | technomancy | nDuff: remove flash; problem solved |
| 17:08 | nDuff | technomancy: "flashy" was maybe the wrong word. |
| 17:08 | amalloy | Frozenlock: if your job were software development, yes. but nDuff's job isn't web browsing, and there's a difference between adblock and git anyway, in that some folks are morally opposed to adblock (folks morally opposed to git are just dumb) |
| 17:08 | AtKaaZ | nDuff: flashblock plugin, you can turn on only flash that you want via 1 click |
| 17:09 | Frozenlock | brehaut: Which is a version control... |
| 17:09 | nDuff | AtKaaZ: Already described why that doesn't work for me. |
| 17:09 | technomancy | "flash you want" I don't understand |
| 17:09 | ynniv | technomancy: large animated images are pretty annoying, and don't require flash. as do animated DOM elements |
| 17:09 | Frozenlock | amalloy: Oh please say that in #emacs :D |
| 17:09 | muhoo | never had a problem with adblocker, but i do turn off flash and i use noscript |
| 17:09 | nDuff | AtKaaZ: If my company's code is embedded on a 3rd-party site, and that 3rd party runs some random flash or javascript thing that breaks our code, I need to see it in context. |
| 17:09 | brehaut | Frozenlock: that was a joke, son |
| 17:09 | Frozenlock | Sorry dad, need coffee I think. |
| 17:09 | technomancy | ynniv: sure, neither of which are present on pastebin |
| 17:09 | technomancy | or any reasonable site really |
| 17:09 | brehaut | </foghorn> |
| 17:09 | muhoo | Frozenlock: there's only one user in #emacs, IIRC who really hates git and is vocal about it. |
| 17:10 | Frozenlock | muhoo: yup, and I was thinking about him ;) |
| 17:10 | amalloy | oh shoot, i forget who that guy is. git destroys his data, right? |
| 17:10 | AtKaaZ | nDuff, got it, either way, I'll be using gist in the future, btw does http://ideone.com/ also have ads? cause that one seemed good |
| 17:10 | muhoo | amalloy: jordi something |
| 17:10 | nDuff | AtKaaZ: Not annoying ones. |
| 17:11 | nDuff | (and yes, it's pretty awesome) |
| 17:12 | ynniv | it's not like I'm browsing the web via email... http://stallman.org/stallman-computing.html |
| 17:12 | muhoo | so what'd be a good way in clojure to wrap a json service, much like the python ServiceProxy? |
| 17:12 | mklappstuhl | hey guys... |
| 17:12 | Raynes | AtKaaZ: https://www.refheap.com <3 |
| 17:12 | muhoo | or would that be so trivial that it's not even a thing |
| 17:12 | mklappstuhl | I'm kind of stuck with this https://gist.github.com/7d3443719b0d50463c93 |
| 17:13 | AtKaaZ | but technomancy, don't you want to know why preview10 doesn't aot leiningen even though there are no errors? |
| 17:13 | AtKaaZ | actually, that is likely fixed in master |
| 17:13 | AtKaaZ | Raynes, no ads? |
| 17:13 | Raynes | No way. |
| 17:13 | Raynes | Raynes don't do ads. |
| 17:14 | ynniv | mklappstuhl: require doesn't import symbols. use "use" instead |
| 17:14 | technomancy | Raynes has lucrative behind-the-scenes sponsors =) |
| 17:14 | Raynes | I wish. |
| 17:14 | mklappstuhl | ynniv, there are so many different ways to load other files/ns ... which is the best then? |
| 17:15 | Raynes | Though my fundraiser went really well for refheap funds. |
| 17:15 | AtKaaZ | Raynes, looks good, any idea why No is red ? as if private: No is bad? :D |
| 17:15 | technomancy | Raynes: yeah I was referring to Keming labs |
| 17:15 | clojurebot | if it's not one thing it's another |
| 17:15 | Raynes | technomancy: Yeah, That is pretty sick. He covered the whole darn thing. |
| 17:15 | ynniv | mklappstuhl: usually you (ns mynamespace (:require [library :as l] [otherlib :as ol])) |
| 17:15 | technomancy | and Heroku too in a way; free dyno-hours wooo =) |
| 17:16 | mklappstuhl | ynniv, It is highly recommended to use (:require ... :refer [...]) on Clojure 1.4 and later releases. (:use ...) is a thing of the past and now that (:require ...) with :refer is capable of doing the same thing when you need it, it is a good idea to let (:use ...) go. |
| 17:16 | mklappstuhl | http://clojure-doc.org/articles/language/namespaces.html |
| 17:16 | Raynes | AtKaaZ: No particular reason. Just because no is negative and yes is positive. |
| 17:16 | mklappstuhl | ynniv, so if I use :as when requiring it should work? |
| 17:16 | ynniv | then you'll have to prefix symbols in them with the specified prefix, which improves readability |
| 17:16 | ynniv | yeah |
| 17:16 | ynniv | i'm not familiar with the new :refer in 1.4. |
| 17:17 | Raynes | AtKaaZ: It's also important that you remember that your paste is going to be public if you don't explicitly make it private. People sometimes accidentally paste credentials and stuff without making it private. |
| 17:17 | ynniv | but use require in the ns form as much as possible. when using prefixes gets out of hand, use use (or this new refer) |
| 17:17 | AtKaaZ | Raynes: understood |
| 17:19 | AtKaaZ | Raynes: is not indexed by google? |
| 17:20 | Raynes | It's indexed. |
| 17:21 | AtKaaZ | I failed to find 150118 site:www.refheap.com ie. https://www.refheap.com/paste/6112 |
| 17:21 | ynniv | silly python requires commas in array literals… |
| 17:21 | Raynes | I just searched for 'refheap slurp" and got some results. |
| 17:22 | AtKaaZ | Raynes, ok it works then, might take some time for the recent ones to get indexes |
| 17:22 | Raynes | Perhaps it hasn't been crawled recently enough or something. |
| 17:22 | AtKaaZ | it's good stuff, thanks |
| 17:23 | brehaut | ynniv: yeah, and its got its colons at the wrong end of map keys |
| 17:23 | thorbjornDX | brehaut: the colons are syntax, as are the commas :( |
| 17:25 | ynniv | thorbjornDX: separating identifiers with whitespace seems like enough syntax to me |
| 17:25 | brehaut | thorbjornDX: i dont understand the distinction you are making |
| 17:25 | brehaut | ynniv: i certainly try all the time. parse disagrees :( |
| 17:26 | thorbjornDX | ynniv: agreed. brehaut: having a colon in a :key is more of a naming restriction, having it after {key: value} as in python is syntax. I don't know if there's any point to making that distinction though |
| 17:27 | ynniv | agreed, but again k v k v k v seems like enough syntax to me |
| 17:29 | thorbjornDX | ynniv: I think python's reasoning behind the {key: value, key: value} thing is to force a certain (restrictive) code formatting style |
| 17:29 | ynniv | certainly. having been doing well enough without it, it's irritating to return |
| 17:30 | ynniv | brehaut: pun intended? ;-) |
| 17:30 | brehaut | intended :) |
| 17:30 | thorbjornDX | ynniv: I find python's list comprehension syntax to be pretty hard to look at after 'for |
| 17:31 | ynniv | I've written my fair share of incomprehensible list comprehensions, and not enough for's to erase the memory |
| 17:31 | ynniv | but when editing someone else's code, you don't get to pick the language |
| 17:47 | callen | does anyone else here find the act of trying to make practical things with CSS intensely frustrating? |
| 17:47 | callen | I didn't want to ask ##css because that would be trolling. |
| 17:47 | stankley | callen: Hah |
| 17:47 | stankley | callen: Yes, it's absurd and broken |
| 17:48 | stankley | callen: Firedebug and a lot of patience |
| 17:48 | callen | I mean, I get the concept fine, but in practice there are so many interactions and overlapping possibilities that it's almost impossible to reason about the result of something. |
| 17:48 | stankley | *Firebug |
| 17:48 | callen | stankley: yeah, we use firebug and chrome (webkit inspector) |
| 17:49 | stankley | callen: That part is at least slightly rational. Then you have internet explorer to think about... |
| 17:49 | callen | stankley: I've never worked with anybody who likes CSS, even frontend people. |
| 17:49 | stankley | callen: Yeah, potential product right there |
| 17:49 | ynniv | it's better than specifying every style attribute for each element |
| 17:49 | stankley | callen: Abstract away the pain and brokenness of CSS |
| 17:50 | ynniv | less does that a little |
| 17:50 | stankley | ynniv: Yeah, but not all the way |
| 17:50 | callen | ynniv: it's not really about CSS alone, it's about the layout. |
| 17:51 | callen | ynniv: the layout model is obscene. |
| 17:51 | callen | it takes herculean effort just to make something that mostly works, let alone is responsive. |
| 17:51 | ynniv | ah, yes. my best layouts are all absolute |
| 17:51 | callen | :\ |
| 17:52 | ynniv | an ideal framework might only use the canvas element, doing all layout and eventing in JS |
| 17:53 | callen | that's obscene. |
| 17:53 | stankley | ynniv: hah |
| 17:53 | ynniv | there are issues rendering text like that, and accessibility, but relying on the DOM to be consistent across browsers is a mistake |
| 17:53 | stankley | ynniv: But also a potential solution |
| 17:53 | ynniv | callen: why is that obscene? |
| 17:54 | ynniv | do you not want the browser to draw your pixels accurately? |
| 17:54 | stankley | ynniv: Break all accessibility |
| 17:54 | callen | ynniv: because I'm an engineer and I care about simplicity and transparency. |
| 17:54 | stankley | ynniv: For one |
| 17:54 | brehaut | actually, with modernizr fixing ie8, and discounting anything older, the dom is surprisingly consistent across browsers |
| 17:54 | ynniv | relying on the DOM's inconsistencies is more simple or transparent? |
| 17:54 | callen | ynniv: I do not create stygian horrors out of distaste for a layout model. |
| 17:54 | stankley | ynniv: Both. |
| 17:55 | callen | brehaut: CSS is more consistently awful than it used to be. |
| 17:55 | ynniv | and what about events? have you not had to deal with event handling across browsers? |
| 17:55 | ynniv | i don't think that you give canvas a fair shake |
| 17:55 | ynniv | yes, accessibility requires some work |
| 17:57 | ynniv | brehaut: have you worked with touch events before? |
| 17:57 | stankley | ynniv: Agreed, but breaking out of HTML structure into raw canvas isn't the solution for the problems of CSS |
| 17:57 | brehaut | ynniv: yes |
| 17:58 | ynniv | the only sane way to work with touch events is to prevent them immediately, before the browser does something "intelligent" with them |
| 17:58 | stankley | ynniv: Hah |
| 17:59 | ynniv | but, I am a proponent of applications in browsers. those look a lot different than fancy web pages |
| 18:12 | TimMc | I hate app-in-a-page. |
| 18:13 | TimMc | Slow, breaks bookmarks/history/automation, hard to customize, inaccessible... |
| 18:14 | nDuff | TimMc: ...to be fair, bookmark/history/automation support _can_ be done, using the hash part of the URL. |
| 18:14 | brehaut | nDuff: god no. history API |
| 18:14 | brehaut | do it properly or dont do it at all |
| 18:15 | nightfly_ | I've got two versions of this function, one is cleaner looking and one is more efficent? Which is the better more Clojurey choice? https://gist.github.com/3955752 |
| 18:17 | emezeske | nightfly_: The comp one is kind of weird |
| 18:18 | TimMc | nDuff: Hash navigation should only be used for IE fallback. |
| 18:18 | emezeske | nightfly_: Maybe you'd be interested in the thrush macro? -> |
| 18:18 | TimMc | Even the history API is still... young? |
| 18:18 | ynniv | TimMc: depends on if it's supposed to be a web page or not |
| 18:18 | brehaut | TimMc: the history api works fine |
| 18:18 | TimMc | I haven't seen any site get it right yet. |
| 18:18 | TimMc | GitHub still gets out of sync a bunch. |
| 18:18 | brehaut | TimMc: the hard part is not the history api, its everything else you have to do to actually use it gracefully |
| 18:19 | TimMc | Yeah, it might not be the API's fault exactly... anyway, sync is HARD. |
| 18:19 | nDuff | ...well, been pressed into service as web dev before, but only held that position as a last-resort. |
| 18:19 | ynniv | TimMc: do you use native apps on mobile devices? |
| 18:19 | TimMc | Nope. |
| 18:19 | TimMc | I don't have a "mobile device", I have a cell phone. |
| 18:19 | ynniv | you're not the market then :) |
| 18:19 | TimMc | Oh, and a laptop -- that's a mobile device, right? :-P |
| 18:19 | nightfly_ | emezeske: That is exactly what I wanted! Thanks! |
| 18:20 | technomancy | I have a server that's mounted on a rack with wheels on it; that counts right? |
| 18:20 | technomancy | mo-bile computoring |
| 18:20 | TimMc | ynniv: In the case of cell apps, there's no existing usage model to break -- it's a clean slate. I'm not really concerned about that. |
| 18:21 | amalloy | nightfly_: the comp version doesn't even work |
| 18:21 | TimMc | technomancy: Back at Crutchfield we had a desktop with a UPS on a cart and wheeled it around for surprise usability testing. |
| 18:21 | ynniv | apps are characterized by offline rich interaction, which is not the web, but can use web technologies |
| 18:21 | TimMc | I don't know how they silenced the UPS. |
| 18:21 | emezeske | nightfly_: I pasted something into the comments that I liked |
| 18:21 | technomancy | "surprise usability testing" sounds like something you could make a reality show about |
| 18:21 | TimMc | It was pretty great. |
| 18:22 | ynniv | it might have been more exciting with the UPS beeping |
| 18:22 | ynniv | adds to the "surprise" |
| 18:24 | amalloy | emezeske: -> isn't thrush: thrush is a function that operates on functions; -> is a macro that operates on forms |
| 18:25 | technomancy | eh |
| 18:25 | emezeske | amalloy: I've only ever heard -> called thrush. I'm willing to believe that's technically wrong, but I don't know what else to google for. |
| 18:25 | technomancy | it's not "The Thrush Combinator" but it partakes of thrushiness |
| 18:25 | amalloy | emezeske: thread and arrow are both popular names |
| 18:26 | emezeske | amalloy: "Threading macro," that's right, I've heard that, thanks |
| 18:26 | technomancy | "thread" by itself is a terrible name. "thread macro" is OK. |
| 18:26 | technomancy | "thrush macro" is fine too |
| 18:26 | brehaut | reclaiming arrow from its catagorical crazies is approved of though |
| 18:26 | technomancy | just don't call it a combinator and you'll be fine |
| 18:27 | amalloy | agreed thrush macro is at least clear what you're referring to |
| 18:27 | emezeske | I like "thread macro" -- threading really paints a visual picture in my head of what it does |
| 18:27 | callen | emezeske: I tried to get hickey to call it the winchester macro. |
| 18:27 | brehaut | emezeske: but its a horribly overloaded term. |
| 18:27 | emezeske | callen: Haha, as in it looks like a gun? |
| 18:27 | nDuff | Hmm. I'm right now doing (count (for [item expensive-sequence] :when (some-test? item) 1)) to count the number of items in a sequence for which the test is true. I now have a few more tests I want to run against the same sequence, each incrementing their own counters, with only a single pass. |
| 18:27 | callen | emezeske: more or less. |
| 18:27 | emezeske | brehaut: Good point. :) |
| 18:28 | callen | emezeske: I liked to think of it as shooting data through the list of functions. |
| 18:28 | emezeske | callen: hahaha, I like it |
| 18:28 | technomancy | railgun macro |
| 18:28 | callen | emezeske: http://clojure-log.n01se.net/date/2010-08-05.html |
| 18:28 | callen | emezeske: ctrl-f "callen-nyc" |
| 18:28 | callen | emezeske: or "winchester" |
| 18:28 | callen | that wasn't even the first time I'd said it was called the winchester :P |
| 18:29 | brehaut | callen: you can point to the space beside the nick of a message an a link appears |
| 18:29 | callen | oh bother. |
| 18:29 | callen | brehaut: thanks. |
| 18:29 | callen | http://clojure-log.n01se.net/date/2010-08-05.html#17:36a there. |
| 18:29 | callen | emezeske: ^^ |
| 18:29 | callen | technomancy: you and I talked a bit about contrib after that. |
| 18:29 | emezeske | haha |
| 18:30 | amalloy | nDuff: (map (juxt test1 test2 test3) coll)? |
| 18:30 | zerokarmaleft | heh, pagerank as the go-to curator of libs |
| 18:31 | technomancy | remember that one time when there was that patch that didn't get applied; oh man, good times |
| 18:31 | callen | technomancy: LOL |
| 18:32 | nDuff | amalloy: desired output is the count of items for which each test returned true, so there's still a piece missing there. |
| 18:32 | amalloy | oh dang, the guy at riddell.us used to hang out in #clojure? before my time, i guess |
| 18:32 | lazybot | The riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.guess |
| 18:32 | brehaut | unapplied patches are a form of potential. by not applying them you can say 'oh man, you should check out clojure, it has a lot of potential' |
| 18:32 | amalloy | nDuff: sure, but it's a simple piece, and not one that will be expensive, which sounded like your primary question |
| 18:33 | zerokarmaleft | i got bit by that guy's blog when i first started out |
| 18:33 | TimMc | technomancy: "stitching macro", bro |
| 18:33 | bdesham | I'm looking for a way to encapsulate a value in a way similar to future or promise, but the value is not evaluated until the thing is deref'd. is this a built-in capability of clojure? |
| 18:33 | callen | TimMc: winchester. |
| 18:33 | brehaut | bdesham: delay ? |
| 18:33 | TimMc | Looks more like a harpoon than a gun. |
| 18:34 | callen | TimMc: I'm alright with calling something "the poon", are you? |
| 18:34 | bdesham | brehaut: yep. *sigh* it's always something built into the damn language... ;-) |
| 18:34 | bdesham | thanks |
| 18:35 | TimMc | callen: Deal. |
| 18:48 | antoineB | hello, is there some ring-server pro here? |
| 18:48 | Raynes | ~anyone |
| 18:48 | clojurebot | Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..." |
| 18:50 | antoineB | ok, is it possible to handle a request, terminate the thread (no send back response), and in another Thread forge a few responses? |
| 18:50 | nDuff | "forge a few responses"? |
| 18:51 | antoineB | forge responses, with request elements saved from requests |
| 18:52 | antoineB | https://github.com/weavejester/ring-serve when you look at the example you see (request -> response) pattern |
| 18:52 | nDuff | "forge" is pretty ambiguous here. I don't see any reason why you _couldn't_ do what you're asking about, I'm just unclear on the details. |
| 18:52 | hiredman | antoineB: I would recommend looking at the various async adaptations of ring |
| 18:52 | nDuff | What do you do with those "forged" responses? Cache them? Throw them away? |
| 18:52 | hiredman | aleph has one |
| 18:52 | antoineB | send them to client back |
| 18:52 | antoineB | for long polling ajax |
| 18:52 | nDuff | Ahhh. |
| 18:52 | antoineB | currently i do an infinite loop |
| 18:53 | antoineB | which use a thread for nothing |
| 19:07 | antoineB | thanks, aleph is the stuff i need |
| 19:07 | antoineB | expected i use noir as web framework |
| 19:08 | antoineB | but i don't realy need a web framework for serving 3 pages |
| 19:36 | technomancy | it's the same code |
| 19:36 | technomancy | for completion |
| 19:36 | technomancy | still no inspector though |
| 19:36 | nDuff | I'm getting completion now on items I've added to my code but not eval'd into the repl yet |
| 19:36 | nDuff | didn't see that with swank |
| 19:37 | technomancy | oh, well that's just dabbrev |
| 19:37 | nDuff | if it's nrepl.el's doing instead (looking at the source), it's still win. :) |
| 19:37 | technomancy | you can do that with slime, it just doesn't use it out of the box |
| 19:37 | nDuff | Ahh. |
| 20:15 | TimMc | nDuff: You're summing the 0-index elements, then the 1-index elements, etc.? |
| 20:17 | nDuff | TimMc: Yup. |
| 20:19 | brehaut | so ##(map + [1 2 3] [2 3 4] [3 4 5]) ? |
| 20:19 | lazybot | ⇒ (6 9 12) |
| 20:20 | brehaut | (map = zip and zip = transpose) |
| 20:48 | amalloy | brehaut: you're a closet infix heretic, aren't you |
| 20:48 | brehaut | amalloy: yes. i like static types too |
| 20:49 | amalloy | that's okay, they're semi-hip |
| 20:51 | brehaut | haskell and F# has corrupted me to liking crazy incantaitons of infix |
| 20:51 | brehaut | honestly, english is my first language |
| 20:54 | arrdem | gods haskell.. |
| 20:54 | arrdem | "we're gonna use prefix... and what you are reading is probably an s expression with no parens" |
| 20:54 | arrdem | "but don't count on it, and infix is cool to" |
| 20:55 | muhoo | heh |
| 20:55 | arrdem | </rant> </troll> |
| 20:55 | brehaut | it would be funnier if that sometimes infix notation werent incredibly useful |
| 20:56 | brehaut | ha |
| 20:56 | arrdem | really? |
| 20:57 | arrdem | I'm failing to think of anything where an infix assignment or operator is not semantically equivalent to a let or some other expression |
| 20:57 | emezeske | arrdem: There are other things than semantici equivalence, e.g. readability |
| 20:57 | brehaut | = is an abberation and doesnt count when people talk about haskell having infix |
| 20:57 | emezeske | arrdem: A lot of people like their math formulas to read like math formulas |
| 20:58 | arrdem | emezeske: totally understood |
| 20:58 | arrdem | pthon's inline if as example 1 A |
| 20:58 | brehaut | its worth keeping in mind that haskell/ml and lisp both have syntax that is heavily optimised for the style of programming that occurs in each. |
| 20:58 | emezeske | arrdem: (I tend to not mind prefix for everything, on a personal note) |
| 20:59 | arrdem | emezeske: nor do I. While I can't bash on let, usually it would be easier to read an equality operator |
| 21:00 | brehaut | emezeske, arrdem its unsurprising that a channel for a lisp would be full of people who like that particular syntactic trade off :) |
| 21:00 | emezeske | brehaut: ;) |
| 21:00 | arrdem | brehaut: I know... |
| 21:01 | brehaut | i also like lisp / prefix notation, i just happen to also like the haskell way too |
| 21:02 | emezeske | brehaut: I definitely like the ability to do infix, if only to give DSLs more freedom |
| 21:02 | arrdem | the Haskell type system is a thing of beauty... I just don't find that I need it. also as noted I have not made myself learn to read haskell yet so my comments are entirely academic as I do not "know" haskell per se |
| 21:02 | arrdem | emezeske: yeah. I was just pondering if an infix DSL would be possible in Clojure... I don't think so. |
| 21:03 | brehaut | you could really hurt yourself with some macro fu |
| 21:03 | arrdem | brehaut: I don't deny what I'm investigating is risky. |
| 21:03 | arrdem | just curious |
| 21:04 | brehaut | i think fogus or chouser has a function actually |
| 21:04 | brehaut | that does infix |
| 21:04 | arrdem | when it blows up in my face I'll crawl back here to say "I should have known" with my last breath.. |
| 21:04 | brehaut | (infix [1 + [2 * 3]]) ;=> 7 |
| 21:05 | arrdem | brehaut: nah man.. that's thinking small. |
| 21:05 | arrdem | that has been done many times.. |
| 21:05 | arrdem | I want a full inline a = (+ 1 2) |
| 21:06 | brehaut | im sure if clojure had reader macros, greate evil could be created |
| 21:06 | arrdem | clojure does have reader macros.. |
| 21:06 | brehaut | not user definable ones |
| 21:06 | arrdem | nope. |
| 21:06 | arrdem | they are user definable |
| 21:06 | arrdem | with the disclamar that they are evil |
| 21:07 | arrdem | and that bad things will happen to anyone who uses them |
| 21:07 | brehaut | i have no idea what you are talking about |
| 21:09 | TimMc | brehaut: It's true, you can hack into the reader. |
| 21:09 | brehaut | TimMc: are we talking actual crow bar and java jam some extra evil in? |
| 21:10 | TimMc | I don't know what it entails. |
| 21:12 | TimMc | brehaut: http://briancarper.net/blog/449/clojure-reader-macros |
| 21:12 | brehaut | TimMc: thanks (i think) |
| 21:13 | TimMc | (.setAccessible true) and you know shit's goin' down |
| 21:13 | brehaut | haha |
| 21:13 | brehaut | thats crowbars for sure |
| 21:14 | arrdem | that needs a giant "here be draggons" comment... |
| 21:14 | TimMc | arrdem: The blog post does have a "Oh sweet Jesus don't use this in real code" comment. |
| 21:14 | brainproxy | thoughts on jim duey's "protocol monads" library? anyone using it to great success? problems with it? |
| 21:14 | arrdem | TimMc: O know... read it last night |
| 21:15 | arrdem | *I |
| 21:15 | TimMc | brainproxy: I remember someone fussing about breakage of the monad laws, but I'm not position to confirm or deny that claim... |
| 21:17 | brainproxy | I know Sgeo was fussing about breakage of monad laws w.r.t. algo.monads |
| 21:17 | brainproxy | he filed a ticket in cloju're jira to that effect; but thought I remembered him saying the protocol monads were better |
| 21:25 | Sgeo | brainproxy, I may have complained about jimduey's protocol monads breaking the monad laws too, but I have withdrawn my complain, as far as I can tell, they don't. |
| 21:29 | brainproxy | Sgeo: have you spent any time with them? I'm starting to explore a use case for monads in one of my projects, but I feel unqualified to determine how seriously I should take the protocol-monads library |
| 21:29 | oskarth | is there anything in clojure which embraces FRP? |
| 21:30 | brainproxy | oskarth: that's been discussed in here from time to time; for the moment, the project to look at is lamina/aleph |
| 21:30 | oskarth | brainproxy: thanks :) |
| 21:30 | brainproxy | https://github.com/ztellman/lamina |
| 21:31 | oskarth | brainproxy: do you know if there has been any attempts to make it work in clojurescript? |
| 21:31 | Sgeo | brainproxy, haven't spent any significant amount of time. I think the use of do as a macro name is problematic, and more importantly/problematically, ... hmm. bind dispatches on the class of its first argument, so you can't have two monads that have one class as a monadic value. And there's no return function, rather, every defined monad has its own such function |
| 21:31 | Sgeo | At least, to the best of my memory |
| 21:31 | Sgeo | It's been a while |
| 21:34 | amalloy | someone used do as a macro name? i doubt if that works ever, in any case |
| 21:35 | brainproxy | Sgeo: okay, thanks; I may follow-up w/ you on some of those points as I dig further in |
| 21:35 | Sgeo | https://github.com/jduey/protocol-monads/blob/master/src/monads/core.clj#L16 |
| 21:35 | Sgeo | amalloy, ^ |
| 21:36 | brainproxy | oskarth: I don't think it works with clojurescript at present; there is the flapjax library |
| 21:36 | brainproxy | it's a nice, reactive library for js developed a few years ago |
| 21:36 | Sgeo | brainproxy, oh, do-result is sort of a return where you pass in a dummy instance of the type, I think |
| 21:37 | amalloy | Sgeo: i see him defining that macro, but not using it. i don't think it will work |
| 21:37 | TimMc | Every time I see "FRP" I think Relational, not Reactive. >_< |
| 21:38 | Sgeo | ,(special-symbol 'blah/do) |
| 21:38 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: special-symbol in this context, compiling:(NO_SOURCE_PATH:0)> |
| 21:38 | Sgeo | ,(special-symbol? 'blah/do) |
| 21:38 | clojurebot | false |
| 21:38 | amalloy | oh sure, if it's qualified |
| 21:38 | Sgeo | I think I've actually tried it, lemme try it again |
| 21:38 | oskarth | thanks brainproxy :) |
| 21:39 | brainproxy | oskarth: sorry, follow-up point.. flapjax is nice, but hasn't advanced too much since a few years ago |
| 21:39 | oskarth | I see |
| 21:39 | TimMc | (def do 5) user/do ;; => 5 |
| 21:39 | brainproxy | i tried starting from scratch and writing a more advanced versino of the library using coffeescript |
| 21:39 | brainproxy | but got stuck... and then got diverted to clojure/clojurescript |
| 21:40 | oskarth | where did you get stuck? do you know what makes it hard to port lamina to cljs? |
| 21:40 | amalloy | TimMc: works fine as a value |
| 21:40 | brainproxy | stuck dealing with the inner plumbing given my lofty goals |
| 21:40 | brainproxy | as for porting lamina to cljs, I'm not sure |
| 21:40 | Sgeo | http://ideone.com/IOMCVY |
| 21:41 | TimMc | Sgeo: http://ideone.com/yTsNSS |
| 21:42 | brainproxy | amalloy: he uses it in this test |
| 21:42 | brainproxy | https://github.com/jduey/protocol-monads/blob/master/test/monads/test/core.clj#L255 |
| 21:42 | amalloy | yeah, m/do will work fine. i just assumed users would try to (do ...), which will break unexpectedly |
| 21:43 | ivan | is there a working data binding thing anywhere that captures the operations/diffs? |
| 21:43 | TimMc | I wonder if the compiler should treat foo/do as do. |
| 21:43 | ivan | looks like C2 has something |
| 21:44 | amalloy | TimMc: i wonder what `(do foo) will read as, in a namespace with do use/refer/defined |
| 21:44 | hiredman | there is a todo in the wiki about namespacing special forms like do |
| 21:44 | Sgeo | Why would anyone ever write (vec [1 2 3]) |
| 21:44 | hiredman | they currently are not |
| 21:44 | gfredericks | Sgeo: no reason I know of |
| 21:44 | amalloy | Sgeo: temporary insanity |
| 21:44 | amalloy | well |
| 21:44 | amalloy | #(vec [1 2 %]) is something i could imagine seeing |
| 21:45 | amalloy | (in that case the reason would be laziness/rudeness) |
| 21:45 | gfredericks | being slightly shorter than #(vector 1 2 %)? |
| 21:45 | gfredericks | not to mention (partial vector 1 2) |
| 21:45 | amalloy | well, also the people who try to make every lambda a #() form typically don't know about the function vector |
| 21:46 | TimMc | (fn [x] [1 2 x]) |
| 21:46 | TimMc | Hmm, a little longer. |
| 21:47 | brainproxy | Sgeo: can you comment further on the point you made about dispatch? |
| 21:48 | Sgeo | There is a way to define a monad where the monadic values are lists. Protocol monads would have me define the monad by making all lists behave as if by that monad, when used in bind. |
| 21:49 | Sgeo | If there's a second way to use lists as monadic values, I can't use that too. |
| 21:49 | gfredericks | TimMc: #(do[1 2 %]) |
| 21:49 | Sgeo | I can only have one monad that uses lists as monadic values defined. |
| 21:49 | amalloy | isn't that true of haskell too? |
| 21:49 | amalloy | it's just less upsetting, because it's easy/normal to make up new data types in haskell |
| 21:50 | gfredericks | TimMc: oh oh oh #(do[1 2%]) even |
| 21:50 | Sgeo | hmmm..... actually, yes. |
| 21:50 | Sgeo | My bad |
| 21:51 | Sgeo | Although actually.... |
| 21:51 | Sgeo | You could define different Monad instances, and ... can't mix them at all in the same file probably, need to be careful to only import one instance.... |
| 21:52 | Sgeo | Or.. I don't know how extreme it goes in Haskell v Clojure |
| 21:52 | brainproxy | Sgeo: couldn't you just use deftype (or maybe defrecord) and then implement the variant monads on those derived types? |
| 21:52 | amalloy | of course, brainproxy. which is what you have to do in haskell too |
| 21:52 | brainproxy | if you use extend-type, then sure, I think you could only do one per file |
| 21:53 | Sgeo | The context in which I saw (vec [1 2 3]) was |
| 21:54 | Sgeo | (doseq [v (vec [1 2 3])] ... ) |
| 21:54 | ChongLi | can you dispatch on the return type? |
| 21:54 | ChongLi | like the way haskell does for return :: a -> m a |
| 21:55 | ChongLi | doesn't seem like you can |
| 21:55 | arrdem | ChongLi: you can.. |
| 21:55 | arrdem | using multimethods |
| 21:55 | ChongLi | how is the return type determined? |
| 21:56 | amalloy | you can't |
| 21:56 | amalloy | Sgeo: best to treat that as some kind of performance art |
| 21:57 | ChongLi | I guess you need static typing to do it? |
| 21:57 | amalloy | yes |
| 21:58 | ChongLi | I wonder if Ambrose's static type checker would work for this |
| 21:58 | ChongLi | I should read this paper |
| 21:59 | amalloy | it's a type-checker, not a recompiler :P |
| 21:59 | gfredericks | well that would involve the type annotations effecting the semantics of the code |
| 21:59 | gfredericks | which sounds out of scope for a type checker |
| 21:59 | gfredericks | and I can't think of any way you could make that work using the existing dispatch mechanisms in clojure |
| 21:59 | Sgeo | amalloy, this is the same person who did not understand doseq vs for |
| 21:59 | ChongLi | oh yeah, good point |
| 22:00 | Sgeo | Now offering an online class on Clojure |
| 22:00 | amalloy | who is? |
| 22:00 | Sgeo | http://www.reddit.com/r/Clojure/comments/122ll8/free_clojure_course/ |
| 22:00 | frio | the clojure vs. haskell decision tears me up |
| 22:00 | ChongLi | that's one area where haskell is really cool |
| 22:00 | frio | on the one hand, i love haskell's static typing, monadic control etc. |
| 22:00 | frio | on the other hand, everything in clojure feels so new, and easy to use |
| 22:00 | frio | clj-http is beautiful |
| 22:00 | ChongLi | yeah I feel the exact same way |
| 22:01 | Sgeo | How important are macros to you |
| 22:01 | ChongLi | haskell is a great language but a lot of its standard prelude doesn't make use of it |
| 22:01 | Sgeo | You can do macros with Template Haskell, but it's not as nice as in Clojure |
| 22:01 | ChongLi | too many concrete lists |
| 22:01 | frio | i try to avoid template haskell; it makes my recompiles painfully slow |
| 22:02 | ChongLi | yeah, you just can't beat lisp macros |
| 22:02 | frio | macros were never important to me, until i started using them. now, they're useful, but not something i can't do without |
| 22:02 | duck1123 | I tried to learn haskell, but I have a strong aversion to languages with significant whitespace |
| 22:02 | frio | haha duck1123 |
| 22:02 | frio | my background is python, so that's less of a concern for me :) |
| 22:02 | amalloy | duck1123: i do too, but it's a silly complaint. if either of us were serious about learning haskell we'd get over it |
| 22:02 | gfredericks | duck1123: I don't mind the whitespace as much as all the invisible precedence |
| 22:02 | ChongLi | you can use braces and semicolons if you want |
| 22:03 | frio | (and java, but the only reason whitespace is significant there is the amount of pain it inflicts on me when people ignore it) |
| 22:03 | ChongLi | a lot of stuff is pretty annoying though |
| 22:03 | Sgeo | I imagine any Lisp is unreadable when people don't indent correctly |
| 22:03 | brainproxy | thank goodness for paredit :D |
| 22:04 | arrdem | gg=g |
| 22:04 | arrdem | *gg=G |
| 22:04 | ChongLi | some stuff that makes haskell look quite bad is zip zip3 zip4 zip5 zip6 |
| 22:04 | ChongLi | :( |
| 22:04 | frio | i have a laundry list now of things the "perfect language" (and runtime) would provide me |
| 22:04 | ChongLi | and the corresponding zipWith versions |
| 22:04 | brainproxy | Sgeo: spent any time with the Clean language? |
| 22:04 | amalloy | Sgeo: so much so that the first response to "i'm new at lisp ant my function doesn't work" is always "holy jesus i can't read that, let me reindent" |
| 22:04 | ChongLi | clojure's map is so much cooler |
| 22:05 | duck1123 | frio: How many can't you acomplish with Clojure? |
| 22:05 | Sgeo | brainproxy, not really, no :/ |
| 22:05 | arrdem | (inc duck1123) |
| 22:05 | lazybot | ⇒ 4 |
| 22:05 | frio | duck1123: enforced static typing, enforced functional purity are the big two for me (i'm a software paranoid) |
| 22:05 | brainproxy | Sgeo: okay, just wondered; I started looking at it the other night, claims to be popular in academic circles |
| 22:05 | Sgeo | Not needing to leave the REPL |
| 22:06 | frio | im hoping more work goes into clojure-on-OSGi too; the more we can steal from erlang, the better |
| 22:06 | ChongLi | unsafePerformIO |
| 22:06 | frio | (erlang the platform/BEAM, anyway; not so much erlang the language) |
| 22:07 | duck1123 | As an update from last night. My app now has pretty little graphs for some of the events that happen via statsd/graphite |
| 22:07 | arrdem | I don't think I want static typing... so much as I want a compiler or vim plugin which can predict types and highlight where the type of a var isn't constant |
| 22:08 | amalloy | sounds like static typing, bro |
| 22:08 | arrdem | amalloy: yes, w/o the runtime enforcement |
| 22:08 | frio | arrdem: it's a tough call, for sure; i still think we're a long way from peak-type-system |
| 22:08 | amalloy | no such thing as runtime enforcement for static typing. that's the point |
| 22:09 | arrdem | s/runtime/compile time/g |
| 22:09 | duck1123 | how hard would it be to get flymake to identify functions that would cause reflection? |
| 22:09 | arrdem | it's all bits at the end of thd day |
| 22:10 | ChongLi | hmmm |
| 22:10 | arrdem | my point is that I could get a lot of the value one could derive from a staticly checked language out of having type hinting visible to the programmer |
| 22:10 | arrdem | /embedded in the editing env. |
| 22:11 | arrdem | I mean.. how much type insensitive code do most of us write in a day? |
| 22:11 | arrdem | almos all of it has assumptions, so making those more visible would be nice |
| 22:11 | gfredericks | I don't think most of those assumptions are reified in the compiler at the moment |
| 22:12 | gfredericks | just types for interop would be my guess |
| 22:12 | frio | what do you mean by "type insensitive code"? a depressing amount of my day job usually boils back to java sucking at dealing with null pointers |
| 22:12 | arrdem | frio: macros... map based functions... sequence manipulation without regards to the type of the elements etc. |
| 22:13 | frio | but, yes, i absolutely agree that much better type inference engines would help in a big way |
| 22:14 | ChongLi | the more complex your type system gets, the greater the cognitive load involved in understanding your code |
| 22:14 | frio | but those are still essentially typed, right? you might rely on a key being in a map etc., which, for whatever reason, might not be there -- maybe another dev doesn't read your documentation, and occasionally passes your function a map without that key |
| 22:14 | Sgeo | ,(#{:a} :b) |
| 22:14 | clojurebot | nil |
| 22:14 | frio | a strong+static type system helps to stop you from doing dumb things |
| 22:15 | ChongLi | and of course, if your type system is too simple it may prevent you from expressing your program in a specific way |
| 22:15 | ChongLi | I see a lot of people screwing around wishing they had dependent types in haskell |
| 22:16 | ChongLi | though that would bring its own problems |
| 22:16 | frio | yeah ChongLi, dependent types would be nice |
| 22:16 | frio | and yes, it does :) |
| 22:16 | frio | shrug. computer science is still a very very young science, and we're a long way from getting this stuff right |
| 22:16 | arrdem | The point is that the type system is there when I want it to do a quick static check on a subsection of my code with respect to some preconditions, but I don't want to deal with it all the time. |
| 22:17 | frio | yeah arrdem. that sounds like having a much stronger type inference system, which would be absolutely awesome :) |
| 22:17 | arrdem | I like that for the most part Clojure and Python silently do the right thing |
| 22:17 | frio | i think Go's typing is supposed to be a good mix of static/dynamic, but i've not yet had a chance to give it a go |
| 22:21 | uroborus_labs | ibdknox: When using jayq, how can you pass clojurescript functions to bind? |
| 22:23 | amalloy | aren't clojurescript functions just javascript functions? |
| 22:25 | uroborus_labs | Yeah, I think I am running into an unrelated issue that I assumed was the problem |
| 22:25 | uroborus_labs | Particularly, not exactly knowing what I am doing yet ;) |
| 22:46 | amalloy | that's probably the most common cause of software defects |
| 22:46 | amalloy | "dear diary, today i added another bug because, while i don't realize it, i didn't know what i was doing" |
| 22:47 | ynniv | it's sort of amazing that any useful software ever gets written |
| 22:47 | mont453 | ,(+ 1 2) |
| 22:47 | clojurebot | 3 |
| 22:47 | mont453 | Nice |
| 22:48 | xeqi | proofs are hard |
| 22:49 | brehaut | lets go shopping |
| 22:49 | TimMc | *shipping |
| 22:49 | xeqi | lets go monkey patching |
| 22:49 | Sgeo | There's Typed Clojure, paper released recently |
| 22:50 | xeqi | though shipping does have a nice ring at the end |
| 22:52 | brehaut | i tried to write a set monad implementation in haskell once, without the internet handy. brain asplode |
| 22:53 | brehaut | im not smart enough for a real static language |
| 22:53 | amalloy | brehaut: it would basically just be like List, but use sets? |
| 22:53 | brehaut | amalloy: yeah, thats what i thought |
| 22:53 | brehaut | i couldnt appease the typechecker though |
| 22:54 | brehaut | soemthing about ord |
| 22:54 | amalloy | huh. doesn't sound that hard, but maybe "conj" needs ord for sets? |
| 22:54 | brehaut | maybe? its entirely possible that im a dimwit |
| 22:56 | amalloy | Data.Set unions :: Ord a => [Set a] -> Set a is the only thing that jumps out at me |
| 22:56 | amalloy | but i dunno how to use haskell so help yourself to a grain of salt |
| 22:56 | brehaut | heh |
| 22:57 | amalloy | ah! you can't have a Set a be a Monad a, because you can't infer Ord from Monad |
| 22:57 | brehaut | amalloy: i googled and found this http://www.randomhacks.net/articles/2007/03/15/data-set-monad-haskell-macros |
| 22:57 | amalloy | so the signature for bind will be wrong |
| 22:57 | brehaut | yeah |
| 22:57 | amalloy | i worked it out though! don't take away from my ebullience with a link |
| 22:57 | brehaut | well done. i couldnt |
| 22:58 | brehaut | i just threw my hands in the air and ragequit |
| 22:58 | amalloy | yeah. haskell just needs a Hashable typeclass so all the dang collections don't have to be sorted |
| 22:58 | amalloy | (i'm aware there is one, but it's in some weird library and seems little-used) |
| 22:59 | brehaut | the language does suffer a bit from ad hoc academic style growth over a long period of time. a lot of the older libraries are bit weird |
| 23:00 | brehaut | one of split or join on strings is surprisingly hard to fathom using the prelude string type (the list of chars type) |
| 23:01 | amalloy | the implementation of it, you mean? |
| 23:02 | brehaut | what to use to do it |
| 23:02 | brehaut | again, i might just be a muppet |
| 23:02 | amalloy | no worries. i can't tell, cause i can't understand your complaint |
| 23:03 | amalloy | so your reputation is safe |
| 23:04 | brehaut | i think i wanted to do (.split "abc,de,f,g,hij" ",") |
| 23:05 | brehaut | im pretty sure that function is inexplicably absent |
| 23:10 | amalloy | brehaut: is it just me, or is hoogle awful for this? i tried looking for [a]->a->[[a]] and [a]->[a]->[[a]] and i just get piles of irrelevant functions |
| 23:10 | brehaut | its not just you |
| 23:12 | amalloy | hoogle is the one tool the haskell community has that we lack (aside from a type-checker). how can it be rubbish? |
| 23:12 | brehaut | ha |
| 23:13 | brehaut | they also have monad towers that looks like jenga games that they call web frameworks |
| 23:13 | amalloy | so i've heard |
| 23:14 | amalloy | one of these days i should go back to RWH with an understanding of monads |
| 23:14 | amalloy | last time i just gave up at about chapter twelve |
| 23:14 | brehaut | probably wouldnt hurt |
| 23:14 | amalloy | "he's run out of things to say that make any sense to me" |
| 23:14 | brehaut | i cant remember where i gave up |
| 23:14 | brehaut | i think 18 did my head in |
| 23:15 | brehaut | chapter 16 was wonderfully enlightening |
| 23:15 | TimMc | brehaut: "i did 18 in my head" <-- how I read that at first |
| 23:16 | brehaut | haha |
| 23:16 | brehaut | only oleg does that |
| 23:16 | brehaut | The other thing that they do have over there in haskell land that would be nice (seriously this time) is rewrite rules in the compiler (which i guess flows from the static types) |
| 23:18 | Sgeo | Please tell me that Typed Clojure does not use clojure.walk/macroexpand-all |
| 23:18 | amalloy | Sgeo: please read the paper yourself |
| 23:19 | amalloy | or tell ambrose you're worried he's an idiot |
| 23:19 | amalloy | (i have no idea what his macroexpansion plan is) |
| 23:21 | dnolen | Sgeo: it uses the Clojure analyzer which does fully macroexpand, it's not clear to me how else it should work. |
| 23:22 | amalloy | dnolen: he's objecting specifically to macroexpand-all, which is awful and broken |
| 23:23 | amalloy | (from clojure.walk) |
| 23:30 | ynniv | even broken optional typing is useful, as long as it only produces false positive warnings |
| 23:30 | ynniv | not sure this is the case, but that's my humble opinion |
| 23:32 | amalloy | http://en.wikipedia.org/wiki/False_positive_paradox |
| 23:33 | bfabry | can you tell leiningen which version of nrepl to use when you run lein repl? I've set the dependency in the project to 0.2.0-beta10 but it's running 0.1.0-beta10 |
| 23:33 | ynniv | I can manually check a false positive. not so with a false negative |
| 23:34 | amalloy | so? if only 0.1% of your code has type errors, and 5% of it gets flagged, the typechecker is not helping you |
| 23:34 | ynniv | 80% of statistics are made up |
| 23:35 | ynniv | I agree to your point, but if the false positive rate is constant, I can verify and diff from commit to commit |
| 23:35 | ynniv | "is this new false positive important"? |
| 23:35 | ynniv | err, "is this new positive false"? |
| 23:36 | ynniv | in optional type systems (and linting systems), it's okay to be false positive, but not false negative |
| 23:37 | bfabry | alternatively, is there any way to get nrepl to reload files that are aot compiled? |
| 23:38 | ynniv | bfabry: i just learned of lein-pedantic |
| 23:38 | ynniv | it might reveal an unexpected higher priority dependency |
| 23:38 | ynniv | [lein-pedantic "0.0.5"] |
| 23:39 | amalloy | nrepl runs in the lein classloader, not yours. so your dependency version is probably irrelevant |
| 23:39 | amalloy | though i may be confusing some of lein's details with some of cake's |
| 23:39 | ynniv | amalloy: https://github.com/clojure/tools.nrepl "Installation" suggests otherwise |
| 23:40 | ynniv | not saying that you're wrong |
| 23:40 | bfabry | ynniv: that looks like a very cool project... but my project only has like 1 dependency other than clojure. the aot files are in the project itself |
| 23:41 | ynniv | doesn't hurt to try, but your problem does not sound like the one I fixed with lein-pedantic |
| 23:42 | bfabry | so.. is there any way to get lein to run the old repl if I can't get nrepl to reload anything? |
| 23:44 | amalloy | lein trampoline repl might do it |
| 23:44 | amalloy | but in general AOTed classes don't get reloaded afaik |
| 23:45 | bfabry | amalloy: which makes perfect sense.. except when you're trying to do development on aot'd classes :) |
| 23:48 | Sgeo | ynniv, want a type-checker that gives only false positives? |
| 23:48 | Sgeo | (constantly "This form has a type error!") |
| 23:48 | ynniv | not "only"… I'm just more concerned about false negatives than false positives |
| 23:49 | ynniv | I can ignore false positives |
| 23:49 | Sgeo | Too many false positives makes your type checker useless |
| 23:49 | ynniv | seriously… what's with taking this to the extreme? |
| 23:49 | Sgeo | With my little type checker, how do you find only the interesting positives |
| 23:49 | ynniv | i said that positives are less bad than negatives |
| 23:49 | ynniv | practically, you have a source base that |
| 23:50 | ynniv | that's mostly working. you run the type checker and get errors |
| 23:50 | xeqi | ynniv: out of curiousity, where did you hear of lein-pedantic from? |
| 23:50 | ynniv | then an intern adds a bunch of features. you run the type checker, and discard what was previously flagged |
| 23:50 | ynniv | now you have interesting data on what the intern might have broken |
| 23:51 | Sgeo | ynniv, the intern might have broken something in a way that's not statically checked. |
| 23:51 | ynniv | erm… someone well known in #clojure. i could check the logs... |
| 23:51 | ynniv | absolutely true, but that's already a problem |
| 23:51 | xeqi | ah, thats good enough |
| 23:51 | ynniv | anything better than the status quo is in fact better |
| 23:54 | ynniv | Sgeo: see http://www.altdevblogaday.com/2011/12/24/static-code-analysis/ |
| 23:58 | Sgeo | Something like Strongtalk, although I haven't seen Strongtalk in action. |
| 23:59 | egghead | Sgeo: have you looked at dart? |