#clojure logs

2012-10-25

00:01unnaliambrosebs: looks fun!
00:01ivanambrosebs: tell the mailing list
00:03ambrosebsivan: ok
00:04technomancyambrosebs: congratulations
00:04ivanvery pleased to hear "We capture the Clojure idiom of using maps with known keyword fields by using heterogeneous map types."
00:05technomancyanyone care to fork the repo and add a .mobi? =)
00:05ambrosebsivan: there's a wealth of research related to O'Caml records that take this even further.
00:05ambrosebstechnomancy: cheers :)
00:33georgekhi, 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:34georgekanyone know what the problem might be? I'm using Clojure 1.4
00:39muhoowhat is an #inst?
00:39georgekan instant literal
00:42georgekhmm, if I define a test #inst like (def test "#inst ....") it works fine
00:43georgekI guess the map is messed up somehow
00:44unnalihm
00:44unnalido you need to use READ-STRING if it's defined as #inst "2012-10…" in the map?
00:44unnalilike, what do you get for just (:date foo)?
00:44georgeknil
00:45georgekand nil for the class and type as well
00:45unnaliI guess it is a bit messed up then!
00:45georgekhaha, yep
00:46timewarriorHi 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:50muhootimewarrior: persist ring sessions, theere's a lib for that
00:51timewarriorsomething like this? https://github.com/timewarrior/mongodb-session
00:51timewarriorthis is persisting sessions..
00:51muhooyep. there's one for couch too, probably others
00:52timewarrioryea.. 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:52muhooprobably persist the sessions to disk/db
00:53muhoothat's what i've done anyway
00:53timewarriorawesome.. appreciate your responses
00:53timewarriordid you build your own auth layer or did you use something like friend
01:00timewarriorI had another questions, is there any way to access request object at the route handling layer
01:02SgeoI forget where exactly this syntax is used, but something like [a b :as r]
01:02SgeoFor Compojure and Noir (based on Compojure) I think
01:02timewarriorI am using compojure
01:02SgeoWell, as in, for Compojure, and also for Noir (which uses Compojure)
01:03timewarriorgreat.. thanks..
01:03timewarriorI am still trying to wrap my head around compojure
01:04RaynesYour head will be all bent like.
01:05timewarrior:)
01:21zackzackzackIn 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:22Raynes&((fn [&b] &b) 1 2 3)
01:22lazybotclojure.lang.ArityException: Wrong number of args (3) passed to: sandbox7657$eval319527$fn
01:22Raynes&((fn [&b] &b) 1)
01:22lazybot⇒ 1
01:22amalloygives you a variable named &b
01:22RaynesIt becomes a symbol.
01:24zackzackzackSo &b is the same as b effectively?
01:24unnalizackzackzack: nope, it's a different symbol entirely.
01:24unnalibut it "acts" like b, there's nothing special about it per se.
01:25zackzackzackRight, sorry that is the idea I meant to express
01:25zackzackzackThanks!
01:25Sgeozackzackzack, note that in the body of a macro, &env and &form have special meaning.
01:25amalloynot a helpful thing to learn at this time, though
01:25zackzackzackActually yes it is
01:25zackzackzackI'm messing around with defn
01:26Sgeozackzackzack, amalloy may have been referring to my mention of &env and &form
01:26zackzackzackAnd seeing if I can't get it to print out the types of the arguments
01:26zackzackzackWhenever the function gets called
01:27unnalizackzackzack: e.g.?
01:27zackzackzack(defn-type-example typed [a b] [a b])
01:27zackzackzack(typed 1 2)
01:27zackzackzack; Integer Integer
01:27zackzackzack[1 2]
01:28unnaliso how are you going about it?
01:29zackzackzack Not sure yet. I've been trying to understand how defn works as a macro
01:29unnaliit'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:29Sgeo,(macroexpand-1 '(defn my-fn [arg1 arg2] some code here))
01:29clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
01:29unnaligrossly understated.
01:30Sgeo&(macroexpand-1 '(defn my-fn [arg1 arg2] some code here))
01:30lazybot⇒ (def my-fn (clojure.core/fn ([arg1 arg2] some code here)))
01:30unnalihmm.
01:31zackzackzackhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L266
01:31unnali&(meta (first (next (macroexpand-1 '(defn my-fn [a1 a2] blah)))))
01:31lazybot⇒ {:arglists (quote ([a1 a2]))}
01:31unnalihuh!
01:31unnalizackzackzack: yeah, that's it.
01:32unnali"fdecl" is consumed throughout that LET starting line 280, and the meta hash "m" is builtup by pieces.
01:32unnalithat's kinda the scariest bit.
01:32SgeoI don't entirely understand the &form and &env actually being in the arglist
01:32zackzackzackRight, that's why I asked originally
01:32zackzackzackIt isn't actually a macro at first
01:32unnalizackzackzack: try https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L422 defmacro.
01:32zackzackzackdefn becomes a macro after it is defined
01:33unnaliyeah, which is equivalent, more or less.
01:33unnalijust 'cause defmacro has yet to be defined!
01:33unnalinote that defmacro itself just calls defn (line 464), then calls setMacro on it and then returns the var.
01:33zackzackzackWhich makes sense.
01:33unnaliyup, so it's as much a macro as you're going to get.
01:34unnaliso &form and &env are magic, anyway.
01:34unnalinot that that showed that, sorry.
01:35SgeoWhere is the magic?
01:35unnaligood question.
01:35unnali(searching)
01:36AtKaaZis ideone down? I need this code: http://ideone.com/z6MTLx
01:36SgeoAtKaaZ, is that my code by any chance?
01:36Sgeohttp://webcache.googleusercontent.com/search?q=cache:http://ideone.com/z6MTLx
01:36AtKaaZSgeo it is
01:36SgeoOh hey it is :)
01:37AtKaaZthanks
01:37Sgeoyw
01:37SgeoI'm curious what you need it for
01:38AtKaaZthe 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:40SgeoHmm. Symbol known at runtime or compiletime?
01:40AtKaaZruntime
01:40unnalizackzackzack: getting closer I think.
01:40unnalizackzackzack: https://github.com/clojure/clojure/commit/277f023
01:41AtKaaZSgeo, last time you said something about &env and resolve, I'm attempting that, as soon as I understand how to use &env xD
01:41unnalizackzackzack: 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:42unnaliso 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:42SgeoAtKaaZ, 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:42SgeoAlmost wrote runetime
01:43SgeoThis 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:43Sgeo(let [a 1] ...) the ... is within a lexical scope of the a
01:44AtKaaZyep I got that
01:44AtKaaZso that is why I also need resolve to see others that are maybe def-ed
01:44zackzackzackAHHHH okay
01:44zackzackzackSo setMacro is not exactlyyyy defmacro
01:45unnalizackzackzack: not close, it just tells the compiler to treat it as a macro
01:45AtKaaZSgeo, but that &env is not available at runtime right? something like ~&env
01:45unnalizackzackzack: e.g.
01:45unnali&(defn x [& args] `(print ~(count args)))
01:45lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
01:45unnalibah.
01:45unnalithis would be difficult to demonstrate.
01:46zackzackzackhaha gist?
01:46unnalisure.
01:46SgeoThat ~&env tells a quasiquote to splice in the &env, the only being avaibale at macroexpand shouldn't matter
01:46SgeoI'm not entirely sure why it breaks
01:46SgeoBut yeah, only macros have &env
01:46unnalizackzackzack: https://gist.github.com/3950619
01:47AtKaaZSgeo, I just wanted to know how can I refer it inside a ` block hmm
01:47unnalinote we get 3 as the result; &form and &env are always there in macroexpansion.
01:47unnaliAtKaaZ: try `(... blah ... ~'&env ... bah ...)
01:47SgeoYou could do something like `(println ~(keys &env))
01:47zackzackzackHmmm
01:48Sgeounnali, not sure how that's of use unless AtKaaZ is writing a macro that writes macros?
01:48unnaliSgeo: neither really.
01:50AtKaaZhmm they both err
01:51alex_baranoskysounds like some exciting macro talk tonight
01:52alex_baranoskyI've never seen .setMacro
01:52Sgeo,(let [b 2] `(let [a 1] `(blah blah ~a blah ~~b blah)))
01:52clojurebot(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:52unnalijust an implementation detail, really
01:52SgeoOh come on
01:53Sgeo,(let [b 2] `(let [a 1] `(~a ~~b)))
01:53clojurebot(clojure.core/let [sandbox/a 1] (clojure.core/seq (clojure.core/concat (clojure.core/list sandbox/a) (clojure.core/list 2))))
01:53alex_baranoskySgeo: what are you attempting to do there?
01:53Sgeoalex_baranosky, learn about nested quasiquoting
01:53Sgeo(is what I'm attempting to do)
01:53SgeoThat sandbox/a is a problem, but I know how to fix it
01:53AtKaaZwow that ~~b 's return
01:55SgeoOh, I only know how to fix that first sandbox/a
01:55unnaliSgeo: if you use a# and ~a# it should do the trick?
01:55AtKaaZSgeo, i see I can't simply return &env -> Can't embed object in code,
01:55unnali,(let [b 2] `(let [a# 1] `(~a# ~~b)))
01:55clojurebot(clojure.core/let [a__27__auto__ 1] (clojure.core/seq (clojure.core/concat (clojure.core/list a__27__auto__) (clojure.core/list 2))))
01:55Sgeounnali, ooh, right, I should do that
01:56SgeoAtKaaZ, yeah, I don't know why that occurs
01:56unnaliSgeo: 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:56Sgeounnali, I guess I wasn't thinking in those terms
01:57Sgeo,(let [b 2] `(let [a# 1] `(a# ~~b)))
01:57clojurebot(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:57unnalinote that that's done something subtly different
01:57SgeoI want to write a macro to write macros that write macros
01:58SgeoNo particular examples in mind, sadly
01:58unnalithere's no problem with that. I'd start by working out what you want it to produce.
01:59AtKaaZa macro that produces it's own source code
02:10SgeoAtKaaZ, completely possible, I believe.
02:10AtKaaZI don't doubt it, but too tough to compute
02:11SgeoIt's a quine
02:11AtKaaZis there another way to find out if a symbol is defined lexically?
02:11Sgeohttp://esolangs.org/wiki/Quine
02:12AtKaaZI remember that for a pascal program
02:12SgeoShould be able to modify this to make it macro-y
02:13AtKaaZ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
02:13clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
02:13AtKaaZlol , amazing if you ask me
02:14SgeoHmm, why not ' like in the original
02:14Sgeo,((fn (x) (list x (list 'quote x))) '(fn (x) (list x (list 'quote x))))
02:14clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
02:15Sgeo,((fn [x] (list x (list 'quote x))) '(fn [x] (list x (list 'quote x))))
02:15clojurebot((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x)))))
02:15Sgeooh
02:16zackzackzackunnali: this is what I've had in mind
02:16zackzackzackhttps://github.com/zmaril/pssst/blob/master/src/psssst/core.clj
02:16AtKaaZ,(let [b 1] (eval b))
02:16clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
02:17unnalizackzackzack: I see!
02:17zackzackzackIf you use defn-recorded, it captures the types of all your function calls and then spits them out to a file automatically
02:17zackzackzackSo, it's a tool for type-hinting and also seeing what is going on with your functions
02:18Sgeozackzackzack, want to make body a rest argument and use unquote-splice?
02:18zackzackzackGood idea, done. There is still a fair amount of work to be done
02:18AtKaaZhow can I cause (eval b) to complain that b doesn't exist only after calling eval (ie. inside eval) or something
02:18unnaliAtKaaZ: (eval "b")?
02:19zackzackzackAt this point, I am just hard coding all the different ways to use defn into there
02:19AtKaaZthat's a string?
02:19unnalino, that was dumb.
02:19Sgeounnali, eval takes forms, not strings
02:19unnaliAtKaaZ: so it is.
02:19AtKaaZok
02:19unnaliSgeo: my bad.
02:19AtKaaZmaybe something similar to eval?
02:19unnaliAtKaaZ: how could something just come into existence if it didn't already exist?
02:19unnaliAtKaaZ: (eval 'b) ?
02:19zackzackzackAnd then working through how to record types of destructured maps and seqs
02:20AtKaaZoh yeah that might work also this (try (eval (symbol "b")) (catch Throwable t t))
02:20AtKaaZunnali, that works too thanks
02:20AtKaaZunnali, like, it can encounter a def later on i guess
02:21Sgeozackzackzack, https://github.com/Sgeo/pssst/commit/1eb029e3598dc5e13fe4a9a6221ab7dd05668af8
02:21unnaliI guess.
02:21SgeoAlso, why are you splicing in record, lemme look at that
02:21SgeoOh woah, I thought it was just a gist
02:22zackzackzackNah, I see this being something that people import and then specifically state they want to record the parameters for a certain function
02:23SgeoHmm
02:23Sgeo,`(~resolve 'blah)
02:23clojurebot(#<core$resolve clojure.core$resolve@601c9cb9> (quote sandbox/blah))
02:23Sgeohuh.
02:23SgeoSo actually splicing in record would work
02:24SgeoWell, maybe
02:24SgeoI wouldn't rely on it though, doesn't seem good stylistically
02:43zackzackzackI'm still looking at splicing in record
02:44zackzackzackI'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:49AtKaaZcan 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:51alex_baranoskywhat are you favorite libraries for java object/class introspection?
02:58SgeoAtKaaZ, more clarification on what exactly you're looking for?
02:58SgeoOh, removing a key?
02:59Sgeo,(dissoc {:a 1 :b 2} :a)
02:59clojurebot{:b 2}
03:01AtKaaZSgeo, 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:02SgeoJust don't make maps that look like {:state :unbound :value :blah}
03:02_ulisesAtKaaZ: can you wrap :value using a function like (value ...); then you can log there
03:02SgeoCan make a consistency checker that throws on an inconsistent map
03:02SgeoIn Haskell you'd use an or type
03:03Sgeodata Whatever = Unbound | Bound Int
03:03SgeoStatically checked
03:03SgeoThat you don't have inconsistent whatever
03:04AtKaaZ_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_ulisesAtKaaZ: 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:07AtKaaZxD
03:07_ulisesheh
03:07AtKaaZ,(get {:a 1} :a)
03:07clojurebot1
03:07AtKaaZyou'd use that?
03:07Sgeo,({:a 1 :b 2} :a)
03:07clojurebot1
03:07AtKaaZ,(get nil :a)
03:07clojurebotnil
03:07Sgeo,(find {:a 1 :b 2} :a)
03:07clojurebot[:a 1]
03:07Sgeo,(find {:a 1 :b 2} :c)
03:07clojurebotnil
03:08AtKaaZwhat's the diff ?
03:08AtKaaZoh i see, i can provide default with get
03:08Sgeofind allows you to always determine whether the key is present along with getting the value
03:08Sgeo,({:a 1} :b :nothere)
03:08clojurebot:nothere
03:09AtKaaZ(find [:a nil :b 1] :a)
03:09AtKaaZ,(find [:a nil :b 1] :a)
03:09clojurebotnil
03:09AtKaaZ,(find {:a nil :b 1} :a)
03:09clojurebot[:a nil]
03:09AtKaaZoh that's good , now i notice
03:16AtKaaZcan I call a macro based on the type? ie. if param is a var or a symbol
03:17AtKaaZI'd syphon it through a function except that the param could be undefined hmm
03:17Sgeo,(if (== (+ 1 1) 2) (-> 5 inc) (->4 dec))
03:17clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ->4 in this context, compiling:(NO_SOURCE_PATH:0)>
03:17Sgeo,(if (== (+ 1 1) 2) (-> 5 inc) (-> 4 dec))
03:17clojurebot6
03:18SgeoNot sure exactly what you want to do
03:19AtKaaZI 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:20PuercoPophi, 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:24alex_baranoskyis .bindRoot thread-local?
03:40john2xhow do I get the key/s of a map given a value?
03:44alex_baranoskyNice: "The ability to specify types that explicitly include or exclude
03:44alex_baranoskynil is one of the strengths of Typed Clojure, and an aspect where it is more
03:44alex_baranoskyexpressive than standard type systems like that for Java."
03:44_ulisesjohn2x: 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_ulisesjohn2x: if you find that fn, then it's trivial
03:45_ulises,(doc map-invert)
03:45clojurebotI don't understand.
03:45john2x_ulises: clojure.set/map-invert :) thanks!
03:45_ulisesjohn2x: yay!
03:46ro_stanyone running in production on EC2 willing to answer some noob questions?
03:48vijaykiranro_st: "don't ask to ask, just ask :P"
03:51ro_stwhen 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:51vijaykiranbased on time it is up
03:52vijaykiranbill is as long as you keep the node up
03:52ro_stthought so. how quickly do nodes come up?
03:52vijaykiranpretty quick in my experience - but depends on what you run on the node as well.
03:52ro_stcould you spawn staging clouds on demand, for a couple hours here and a couple hours there?
03:53ro_st1 datomic + 1 ring, basically
03:54vijaykiranshould be pretty quick to boot up, I don't think I understood your "staging clouds" question
03:54ro_stwell, we want a staging environment for our system. trying to determine the best way to have one without paying full production costs
03:55vijaykiranhmm - you can spin up as many instances as you want and as long as you want
03:55ro_stso we could stage inside production, through the use of feature flags to hide new code
03:55ro_stbut that doesn't give us as much freedom as a completely separate stack
03:56ro_styeah. it seems like starting up new nodes as we need them and switching them off again when we're done is the way
03:56vijaykiranyes
03:57ro_stare you using pallet, vijay?
03:57vijaykiranno, just raw git pull and shell scripts - not automated.
03:58ro_stbrave man :-)
03:58vijaykiranand provisioning is manual :)
03:59ro_sthow many nodes are you using?
03:59vijaykiranright now 2 for "failover" and 1 testing/staging/breaking stuff
04:00vijaykiranstill undercover for a small app - so nothing "webscale" :)
04:00ro_stawesome, and you have your entire stack on each node? db/web/etc?
04:00vijaykiranno DB is on RDS
04:01ro_stah of course
04:01vijaykiranI guess it depends on the app - how you want to distribute - there are high i/o instances and other choices
04:03ro_styeah
04:05ro_stthanks vijay. i return you to your regularly scheduled coffee and parenthesis
04:06vijaykiranyw
04:11AtKaaZin a test unit what's the way to test for an expected exception?
04:12ro_stin midje it's =throws=>
04:12ro_stnot sure about clojure.test
04:13AtKaaZthanks I'll check that too
04:13ro_st#not-so-subtle-hint-to-check-midje-out
04:13AtKaaZlol
04:14Fossiwhat he said :)
04:14ro_stusing lein2 AtKaaZ?
04:15AtKaaZyes
04:15ro_sthere's my profiles.clj
04:15ro_sthttps://www.refheap.com/paste/6128
04:16AtKaaZthat means, in one of your projects?
04:16AtKaaZohh nvm i get it now
04:16ro_st:repositories, lazytest, midje lines are what you'll want to add to your own ~/.lein/profiles.clj
04:16ro_stthen you can run lein midje —lazytest in any lein project and it'll run any clojure.test and/or midje facts you have
04:17ro_stand re-run affected namespaces whenever you update a file
04:18ro_sthttps://github.com/marick/Midje/wiki/Midje-mode is indispensible if you use emacs
04:18AtKaaZi use eclipse/ccw/lein
04:18ro_stwe use both lazytest and midje-mode extensively
04:19ro_stthat's also fine. lazytest by itself is plenty
04:24AtKaaZI 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:39bbeansvm2k3-cfm5.mgt.hosting.dc2.netsol.com (205.178.152.214)
04:40bbeansWow, I was passed testing.
04:58tomojI typed `pkill emacs`, hesitated a moment, then it woke up :)
04:59AtKaaZwhat's the repl equivalent for lein midje?
05:01ro_stthat's why midje-mode, AtKaaZ
05:02ro_styou can just evaluate a midje facts file into your repl, and re-evaluate individual facts as you need to
05:03ro_stmidje-mode makes this simpler by providing keybinds for sending a fact and printing the result directly into the source file as comments
05:03ro_stbut you could just as easily watch your repl for output
05:34AtKaaZmaybe I should switch to emacs
05:35AtKaaZbut I am afraid of new things :D so much to learn
05:35AtKaaZfear of the unknown
05:35AtKaaZcan emacs find the definition of some function?
05:35AtKaaZor can refactor? (not that you can in ccw)
05:36ro_stno refactoring. swank does support goto definition
05:36ro_stnot sure about nrepl
05:37ro_stit's a massive learn curve. worth it, though.
05:37ro_stproblem with emacs is it's *very* easy to burn time tinkering
05:37AtKaaZtinkering within emacs or with clojure code?
05:37mpenetthere is a project that allows refactoring, but sure how good it is though
05:38AtKaaZmpenet, what's its name?
05:38Raynesnrepl does goto definition as well, IIRC. Better than SLIME if I remember right.
05:38mpenetAtKaaZ: clojure-refactoring, surprisingly
05:38AtKaaZslime is swank?
05:38mpenetRaynes: better how?
05:38Raynesido-mode integration.
05:38mpenetoh nice
05:39AtKaaZwhat's that? ido-mode?
05:39AtKaaZnvm I'll google it
05:39AtKaaZoh yes “Interactively DO things” sounds good :D
05:40ro_stRaynes: what about breakpoint support? i lean quite heavily on (swank.core/break)
05:40ro_sti'm still using swank
05:40ro_sthave't made the switch to nrepl.el yet
05:40Raynesro_st: I don't think it has breakpoint support yet.
05:41AtKaaZis nrepl.el supposed to be better?
05:41ro_stnewer
05:41ro_stbuilt on top of nrepl, which is quite awesome
05:41Raynesro_st: https://github.com/pallet/ritz/tree/develop/nrepl
05:42RaynesAtKaaZ: 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:42Raynesnrepl.el misses a few things from SLIME, but it is evolving.
05:42ro_stah, ritz. another tool i've not had time to muck with
05:43ro_stthanks for the link, Raynes
05:44AtKaaZmpenet: this seems to be the most recent one https://github.com/joodie/clojure-refactoring
05:45AtKaaZi'll try look into emacs even though I am on windows
05:46AtKaaZthis seems to be a good start: http://clojure-doc.org/articles/tutorials/emacs.html
05:46ro_sthighly recommend the peepcode 'cast on emacs, too.
05:47ro_stbut not the clojure one(s). they're quite out of date now
05:47AtKaaZro_st this one? https://peepcode.com/products/meet-emacs
05:47ro_stdats der bunny
05:48AtKaaZmust be good since it's $12 :)
05:48mpenetWould 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:49mpenetwell, wishing I could do this
05:52mpenetProbably not.
05:54AtKaaZro_st: are you using Magit? seen the preview for that cast it's very appealing so far
05:55ro_styes
05:55ro_stlove it
05:55ro_sti open emacs just to use magit, sometimes
05:55AtKaaZawesome
05:58alex_baranoskyThat one last Clojure/Conj ticket on the site is eating at my soul
06:02alex_baranoskympenet: 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:02mpenetyep, or take collections
06:05mpenetI 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:05mpenet,(comp)
06:05clojurebot#<core$identity clojure.core$identity@566f653b>
06:06mpenet(partial)
06:06mpenet,(partial)
06:06clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$partial>
06:06mpenetwell for partial I can understand why, but if it works for comp, it should for others maybe
06:08john2xhow do I declare bindings in fixtures (clojure.test)? the doc didn't have any examples..
06:20john2xhere's what I'm trying to do (but it's wrong) http://pastie.org/5113784
06:27mpenet,((every-pred (fn [_])))
06:27clojurebottrue
06:30mpenet,((some-fn (fn [_])))
06:30clojurebotnil
06:54mpenet,(every? identity [])
06:54clojurebottrue
06:56Islaminati,(identity)
06:56clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core$identity>
06:56IslaminatiOhh
06:56IslaminatiYeah
06:56Islaminati,(every? #(false) [])
06:56clojurebottrue
06:59black_joeI'm trying to make a function that checks to see if a list and all of its nested lists is completely empty.
07:00black_joeHow could I check that? Because a list like (()) is not equal to () or nil.
07:00black_joeCurrent 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:00shachafDo you mean "or"?
07:00_ulisesblack_joe: something like (apply and (map empty? your-lists-here))
07:01shachafI assume black_joe meant something recursive.
07:01shachafI.e. a tree made of only conses and empty lists.
07:01Islaminatiblack_joe, so you basically want () to be true, (() () ()) to be true and (((() ()) ())) to be true etc.
07:01_ulisesah, gotcha
07:01black_joeRight. Just to check if they're empty.
07:02black_joeAnd I really haven't done enough work with trees to do this effectively with them.
07:02shachafblack_joe: That's a bit of a strange operation.
07:02AtKaaZ,(empty? (flatten '(() ())) )
07:02clojurebottrue
07:02CheironHi, what is the recommended way to define a const in Clojure ? yes def but what the naming convention?
07:02AtKaaZ,(empty? (flatten '(() (()))) )
07:02clojurebottrue
07:02AtKaaZ,(empty? (flatten '(() ((2)))) )
07:02clojurebotfalse
07:03shachafHah, AtKaaZ++'s solution should work.
07:03black_joeOkay. Well, I didn't know about either function. Thanks.
07:03IslaminatiFlatten flattens to infinite depth?
07:04shachafblack_joe: If you're learning, you should be able to write this function yourself. :-)
07:04black_joeI've spent too much time on the data types and other specifics of Clojure and not enough about the core libraries.
07:04black_joeI'll look into what's out there.
07:04shachafYou don't need to know about the libraries.
07:04shachafJust write it using the primitives.
07:05black_joeWell, I tried to use recursion, but that didn't work. It would only go 2 levels deep.
07:05shachafSounds like you didn't use very much recursion. :-)
07:05black_joeUsing 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:06shachafIt seems to me like you don't need to treat car any differently from cdr.
07:07black_joeYou 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:07shachafYou 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:08shachaf(defn foo? [a] (or (null? l) (and (cons? l) (foo? (car l)) (foo? (cdr l)))))
07:08shachafSomething like that, I don't know Clojure.
07:08black_joeTrees in general give me a pain. Our class starts covering them soon though, so that should clear a lot up.
07:08Islaminatishachaf, first and rest, clojure doesn't have car and cdr.
07:08shachafGet a head start, write some recursive functions!
07:08IslaminatiOr cons cells.
07:08IslaminatiAnd list?
07:09shachafIslaminati: Oh. I saw the word "car" in that link black_joe linked to.
07:09black_joeI still refer to first and rest as cars and cdrs in my documentation.
07:09shachafIslaminati: It doesn't have cons cells? What are lists?
07:09Islaminati,car
07:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: car in this context, compiling:(NO_SOURCE_PATH:0)>
07:09shachaf,(cons 1 2)
07:09clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
07:09shachafOK, Clojure /= Scheme.
07:09Islaminati,(car '("Ahh", "girl" "look" "at" "that" "list"))
07:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: car in this context, compiling:(NO_SOURCE_PATH:0)>
07:09black_joeIt still has cons, but it's for sequences.
07:09shachafSo you can simplify what I said a bit. :-)
07:10Islaminatishachaf, yeah well, there are no true 'cons pairs', there are list nodes, whichbdemands its cdr are lists
07:10black_joeAnd usually recursion is achieved with the (recur) macro since the JVM has poor tail-call optimization.
07:10shachaf,(null? '())
07:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: null? in this context, compiling:(NO_SOURCE_PATH:0)>
07:10IslaminatiWhich honestly is pretty sweet and solves a lot of issues, especially with mutable conses.
07:10shachaf,(empty? '())
07:10clojurebottrue
07:10Islaminatithat'd be empty?
07:10Islaminatiempty? also works on vectors and hashes an dwhat not.
07:10shachaf,(all? empty? '())
07:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: all? in this context, compiling:(NO_SOURCE_PATH:0)>
07:10IslaminatiAlso, it doesn't have TCO.
07:10shachaf,(all empty? '())
07:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: all in this context, compiling:(NO_SOURCE_PATH:0)>
07:11Islaminatishachaf, every
07:11Islaminati(every? empty '())
07:11shachaf,(every? empty? '())
07:11clojurebottrue
07:11Islaminati(every? empty? '())
07:11IslaminatiLike that
07:12shachafAnyway, you get the idea.
07:13black_joeIt would just be nice is () was equal to nil.
07:13black_joeThat was a convenience in Lisp.
07:13shachafThat seems un-nice to me.
07:14ro_stwhat's the best way to map over a seq, but stop early? like break; in js loops
07:14shachafWhy do you want to stop?
07:14ro_stlist of regexen to attempt until one matches, then do some work and return the result
07:14clojurebothttp://haacked.com/images/haacked_com/WindowsLiveWriter/IConfigMapPathIsInaccessibleDueToItsProt_1446B/works-on-my-machine-starburst.png
07:15black_joeProbably loop and recur with a collector and counter.
07:15mpenetro_st: for with :while, or reduce
07:16Islaminatiblack_joe, it's good that it keeps them separate honestly.
07:16mpenetnm not reduce
07:16IslaminatiCLojure actually has lists as a datatype
07:16IslaminatiCL does not.
07:16IslaminatiIt has cons as a datatype and nill, which is basically null.
07:16Islaminatilist? in clojure runs in constant tyime for instance.
07:17IslaminatiYou 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:17black_joeI suppose that's good, but a lot of functions that operate on lists return nil if the list is empty.
07:17black_joeSo checking for (or (= list nil) (= list ()) is required.
07:17IslaminatiThis 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:18mpenetblack_joe: you can use seq for that
07:18shachafIslaminati: In Haskell, you can run list? at compile time! :-)
07:18mpenet, (seq [])
07:18clojurebotnil
07:18ro_stwith for, can you test something from :let in :while ?
07:18ro_stah i see that you can
07:18Islaminatishachaf, so about unsafeCoerce :: a -> b again.
07:19shachafGreat function!
07:19IslaminatiBut nil in clojure is basically null, as in 'no meaningful value here'
07:19shachaf@let isJust :: Maybe a -> Bool; isJust = unsafeCoerce
07:19Islaminatibest function ever, it can implement unsafeperformio which is also fabulous
07:19shachafIslaminati: unsafePerformIO is part of the Haskell spec, unlike unsafeCoerce.
07:20shachafAnd you can use unsafePerformIO to write unsafeCoerce, too.
07:20IslaminatiI know, which is what makes both fabulous.
07:20Islaminatican types still be inferred by the way if you you replace every function x with unsavecoerce . x?
07:21IslaminatiMy intuition says me that type inference in that case would fail.
07:21shachafWell, no it would be a huge crashing mess.
07:21shachafEverything would have every type.
07:21IslaminatiYeah, but assume that you take a type checking progrmingt
07:21Islaminatiand just do that.
07:22IslaminatiAfter you already know it checks.
07:22shachafOh, you're wondering whether it'll always compile?
07:22shachafHmm, there'll be some ambiguities with type classes.
07:22shachafOh, you're Lajla.
07:23IslaminatiOf course.
07:23shachafYou should just take one nick and stick with it.
07:23IslaminatiI beg to differ, we should in fact all constantly change nicknames.
07:25ro_stthat sounds like something a Culture Mind would say
07:25IslaminatiWhat's a culture mind?
07:26ro_sthttp://en.wikipedia.org/wiki/Culture_series
07:27IslaminatiAh, and they are against established identity?
07:29ro_sti've no idea. i simply meant what i said :-)
07:31IslaminatiAh
07:31Islaminatiyou should be too though
07:31Islaminatiestablished identity is a posion to thought.
07:31IslaminatiIt influences the way peolpe think and lets them make faulty decisions.
07:32ro_stit's also an incredibly handy tool. communication would be tedious beyond usefulness without established identity
07:33IslaminatiNo, it's only useful exactly because people use establish identity and think in it.
07:33ro_stpass 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:33IslaminatiTHey need to know who people 'are' to be comfortable.
07:33IslaminatiEXACTLY, that is the point
07:33Islaminatiyou do not need salt, what you want is 'something that alters the taste of your food in that way'
07:33IslaminatiThis needn't be salt
07:34Islaminatiit needn't be a specific identified object, it can be an indeterminate anything that achieves that goal.
07:34ro_stbut, in this case, it is salt, because the requestor had already decided this
07:34ro_sthence using the word 'salt' in the request
07:34IslaminatiWhat if language worked that you didn't ask for salt but asked for something that could do that?
07:34IslaminatiBut in a quicker way
07:34IslaminatiSurely 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:34ro_sti look forward to finding out how that would work
07:35CheironHi, 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:35IslaminatiYou 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:35mklappstuhlhey
07:36ro_stwhat if my need is actually 'salt', and not your arbitrarily chosen assumption on my reason for needing it?
07:36ro_sti might want to put some in my ear
07:36mklappstuhlI'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:37Islaminatiro_st, that's the point, that can never happen and with this system you can communicate that in a superior way.
07:37IslaminatiYou 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:37IslaminatiSo you can communicate that easily and efficiently.
07:38ro_stexcept when the object i've asked for is the object that best fulfils that purpose, of course
07:38IslaminatiIdentities are basically a poison to thought and force people to think in such weird ways
07:38Islaminatiperhaps 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:39ro_stplease tell me you don't work in medicine
07:39ro_stor child care
07:39ro_stor operate any heavy machinery
07:39ro_st-grin-
07:40ro_st"hand me the number 5 scalpel". "here's a screwdriver".
07:40IslaminatiThat doesn't fulfill that purpose
07:40Islaminati...
07:40mklappstuhlanyone an idea regarding financial data stuff?
07:40IslaminatiClearly whjat you want is any intstrument that can savely cut to curgical praecision.
07:40ro_stwho is best equipped to make the decision on need?
07:40IslaminatiClearly a screwdriver does not fulfill that.
07:40ro_stthe requestor, or the requested-of?
07:41IslaminatiOne assumes a fellow surgeon in the room is well equipped.
07:41IslaminatiWho is equipped to correctly 'identify' the object that you mean?
07:41IslaminatiSame story that is just displaced.
07:41ro_sti should think the person asking the question
07:41mklappstuhlor whats a good place to look for libraries in the current clojure ecosystem
07:41ro_styou seem to posit the person being asked the question is better equipped
07:42mklappstuhlI know http://clojuresphere.herokuapp.com/ and clojure toolbox
07:42ro_stwhich can be the case, but most of the time, it isn't
07:42ro_stanyway. i have non-specific effort to perform. this was fun to think about
08:25cmdrdatsfor library projects, is there an implementation agnostic clojure logging library?
08:26mklappstuhl(use 'org.clojars.bmabey/csvlib)
08:26mklappstuhlI use this in the beginning of my file and it has been installed fine by leiningen...
08:26mklappstuhlno the less I get this
08:26mklappstuhlException namespace 'org.clojars.bmabey/csvlib' not found after loading '/csvlib' clojure.core/load-one (core.clj:5203)
08:27mklappstuhlmessage after (load-file)ling the file with the use statement from the repl
08:32ro_stcmdrdats: datomic uses logback, if that helps
08:33cmdrdatsro_st: cool, i'll look into it
08:35ro_stwe're using it too, speak to V for code
08:38clgvmklappstuhl: a namespace must not contain "/"
08:39clgvmklappstuhl: you probably want to do (use 'csvlib) if that is a namespace in that lib
08:39mklappstuhlclgv, 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:39ro_sti 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:40clgvmklappstuhl: 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:45clgvmklappstuhl: but you seem to be right, that require worked. but only because it discards what you have written before "/"
08:45clgvmklappstuhl: fact is, you were using require/use wrongly
08:46mklappstuhlclgv, I'm using (require 'csvlib) now
08:46clgvmklappstuhl: good. :)
08:47clgvmklappstuhl: btw there is also a german irc channel #clojure.de ;)
08:50mklappstuhlclgv, oh cool
08:50mklappstuhlI actually prefer english when it gets technical but I'll stop by for sure :)
08:51clgvjust mentioned it since it has not much advertisement elsewhere and you seemed to be in the target group ;)
08:52edlichCan someone help me
08:52edlich(filter #(re-find #"findstr" %) mystrcoll)
08:52edlichhow to correctly replace #"pattern" by a val?
08:53edlichI want to filter every string in a string collection that matches the pattern
08:53edlichIs there an easier way to find if strings match in a string collection.
08:54edlich?
08:54zoldarin 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:55ro_stedlich: "a" in "a" "b" "c" ?
08:56edlichno, lets say we have a collection of sentences
08:56edlichI want to get a collection of every sentences that contain the word "beer". But beer is a var.
08:56ro_stah
08:56ro_stre-pattern
08:57mpenetor (filter #(.contains % "thing") sentences) ?
08:57ro_st,(re-pattern "beer")
08:57clojurebot#"beer"
08:57edlichaah Thanks!
08:57clgvzoldar: you can use update-in as in ##(let [v [[1 2] [3 4]]] (update-in v [(dec (count v))] conj 5))
08:57lazybot⇒ [[1 2] [3 4 5]]
08:58ro_stah, didn't know update-in worked on vectors!
08:58clgvvectors are associative as well
08:58ro_stwhat about sets and lists and seqs? any of those, too?
08:58clgv,(-> [] class ancestors)
08:58clojurebot#{java.lang.Runnable java.util.List clojure.lang.Associative clojure.lang.ILookup java.lang.Iterable ...}
08:58clgvro_st: no
08:59ro_st,(-> #{} class ancestors)
08:59clojurebot#{java.lang.Runnable java.lang.Iterable java.util.Collection clojure.lang.IObj java.util.concurrent.Callable ...}
08:59ro_stneat!
08:59clgvsets do only have values, no keys
08:59zoldarclgv: thanks
09:00mklappstuhlI want to write a file. everything I can find is the advice to use java io... is that still true?
09:00mpenetyou can use spit
09:00mklappstuhlmpenet, It might be a long long file
09:00mpenetoh well better not then
09:01mpenetthere is clojure.java.io
09:02uvtcmklappstuhl: some i/o examples at http://clojure-doc.org/articles/cookbooks/files_and_directories.html .
09:03babilenmklappstuhl: 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:29mklappstuhlis (doseq) the idiomatic way to iterate over lists?
09:29joegalloyes, quite so
09:30joegalloyou 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:30uvtcmklappstuhl: `doseq` is for side-effects.
09:34clgvmklappstuhl: for side effects like printing something to stdout, yes. if you want to transform the list there is `map` or `for`
09:38jcromartieit's going to be OK
09:38jcromartiehere, have a REPL
09:40Hodapp:)
09:53mklappstuhlhaving (:a :b) and (1 2) how would I get to {:a 1 :b 2} ?
09:54dnolen,(zipmap '(:a :b) '(1 2))
09:54clojurebot{:b 2, :a 1}
09:54dnolenmklappstuhl: ^
09:54mklappstuhldnolen, thanks
09:54mklappstuhlI knew it was something with zip :P
09:56dnolenif you've got some spare cycles upvote Ambrose's sweet Typed Clojure paper on HN http://news.ycombinator.com/newest
09:58djcoindnolen: awesome !
09:58djcoin:)
09:59hyPiRiondnolen: Sweet. I usually tend to upvote stuff after I've read through it though.
10:01hyPiRionLooks like a well done work.
10:02ambrosebsdnolen: cheers :)
10:02djcoincongrats :)
10:03ambrosebsdjcoin: thanks!
10:06mklappstuhlhow would I get the values of a hash-map in a list? {:a 1 :b 2} => (1 2)
10:08dnolen,(vals {:a 1 :b 2})
10:08clojurebot(1 2)
10:08dnolenmklappstuhl: ^
10:08Islaminatishachaf, I think I need better dental hygiene.
10:08dnolenambrosebs: this is a fantastic read :) seems like you've spent a considerable amount of time on this :D
10:10ambrosebsdnolen: lovely of you to say!
10:11ambrosebsdnolen: yes, it's basically been my year :)
10:22dnolenambrosebs: well looky there #2 on HN, refreshing to see actual science at the top.
10:22ambrosebsdnolen: pity it's not a flashy webpage with browser repl ;)
10:24dnolenambrosebs: what?! I have to read 74 pages of well written, well formatted, well referenced text!
10:24ambrosebsdnolen: but it's PDF!
10:24ambrosebs:D
10:41mklappstuhlanother question :P
10:44mklappstuhlI 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:45mklappstuhl(2 -1 +2 +2) would be the wished outcome in the above example
10:46ToBeReplaced,(let [coll '(1 3 2 4 6)]
10:46clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
10:46ToBeReplaced (map - coll (rest coll)))
10:47ToBeReplacedi don't know how to use the clojurebot!
10:47Mr_Bond,(let [coll '(1 3 2 4 6)])
10:47clojurebotnil
10:48Mr_Bond,(let [coll '(1 3 2 4 6)] (map - coll (rest coll)))
10:48clojurebot(-2 1 -2 -2)
10:48ToBeReplacedi guess the carriage return was no good?
10:48S11001001ToBeReplaced: true
10:49ToBeReplaced ,(let [coll '(1 3 2 4 6)] (map - coll (rest coll)))
10:49clojurebot(-2 1 -2 -2)
10:49tmarshflipping the - gives the output requested
10:49S11001001ToBeReplaced: more precisely, the intervening \r\nPRIVMSG #clojure :
10:49tmarsh,(let [coll '(1 3 2 4 6)] (map - (rest coll) coll)))
10:49clojurebot(2 -1 2 2)
10:56ohpauleezdnolen: All done - http://dev.clojure.org/jira/browse/LOGIC-60
10:56dnolenohpauleez: sweet gotta run but will apply in a bit!
10:57ohpauleezAwesome
11:02ambrosebsTyped Clojure no.1 on HN :)
11:03zerokarmaleftambrosebs: well-deserved, i'm 10 pages in
11:08chronnoambrosebs: congrats! :-)
11:12ambrosebsdamn it, I have a big essay due tomorrow, but this is too exciting!
11:16gfrederickswhat are "functions accepting an even number of variable arguments"? like the mappy varargs?
11:18ambrosebsassoc, hash-map
11:19gfredericksthat is quite fundamental.
11:20ambrosebsI cannot type check higher order usages
11:20ambrosebsbut (assoc m k v k v) is easy
11:20ambrosebsIn other words, they're hard coded primitives
11:21ambrosebsAre you reading the dissertation? Which part? Could I be clearer?
11:24ambrosebsgfredericks: a general solution would be quite interesting, and I think possible.
11:27nDuffambrosebs: One minor nitpick -- it looks like there's some missing punctuation at the beginning of page 10.
11:28nDuffambrosebs: personally, I'd add a semicolon and a comma, as such: "...for many uses; where other languages might use objects, Clojure ..."
11:28nDuffambrosebs: ...but either way, the sentence seems like it's expressing two ideas without as much syntactic separation as should be there.
11:31scriptornDuff: not sure about that, it's the same idea
11:31scriptorclojure uses maps where others use objects
11:32scriptorthe 'where' binds the two phrases together
11:33nDuffscriptor: that piece I could take or leave; it's the second one, without the "where", that stands out most for me.
11:33nDuff(between "objects" and "Clojure")
11:33scriptorah, right
11:33scriptorprobably just missed a period there
11:35hyPiRionambrosebs: Is your master thesis, or is it some other work?
11:36hyPiRionWell, look at that, I just completely skipped the bottom of page one. Disregard.
11:38AdmiralBumbleBeeI just started reading about typed racket, and now this paper shows up
11:38AdmiralBumbleBeewhat excellent timing :)
11:41antoineBhello, does anyone has a project.clj working with lein-cljsbuild, noir and clojure 1.4 as dependancy ?
11:42antoineBmine don't
11:43duck11231antoineB: What kind of issue are you seeing?
11:43antoineBjava.io.FileNotFoundException: Could not locate clojure/instant__init.class or clojure/instant.clj on classpath: (tagged_literals.clj:1)
11:43ambrosebshyPiRion: undergraduate honours dissertation
11:44ambrosebsnDuff: thanks, keep the nitpicks coming!
11:44ambrosebsnDuff: or any other suggestions
11:44nDuffambrosebs: Not yet. That said -- I'm starting page 21 right now, so a ways from through.
11:44ambrosebsnDuff: this is my first paper, still have a lot to learn.
11:51ambrosebsnDuff: my email is abonnairesergeant at gmail dot com if you want to send any other suggestions
11:51nDuff*nod*. So far, I'm thoroughly impressed.
11:52ambrosebsGlad to hear.
11:54antoineBduck11231: the project.clj https://gist.github.com/3953538
11:55antoineBduck11231: if i remove noir and fetch (that depends on noir), this will work
12:03duck11231antoineB: I know I've seen that issue before, but can't remember what I did to fix it. I don't use noir.
12:14duck11231antoineB: it looks like your noir dep is setting clojure to 1.3, try adding :exclusions [org.clojure/clojure]
12:15duck11231to the noir dep, not globally
12:18dnolenohpauleez: thanks for the patch, could we get the tests for simple unification and partial map unification copied over?
12:18ohpauleezdnolen: No problem, i have them in a codebase already - I'll have it done by the end of the day
12:19ohpauleezdnolen: Any thoughts about the weird discrepancy with partial-maps? https://github.com/clojure/core.logic/pull/10
12:20ohpauleezI'm not sure why x doesn't unify (or potentially is just printing out like that)
12:20antoineBduck11231: nice that works, but i need to displace noir dependencie to "dev-dependencies", i don't know the difference
12:22dnolenohpauleez: definitely a bug and probably a simple one. Open a separate ticket for that and I'll look into it. Thanks much.
12:22ohpauleeznp
12:22ohpauleezthank you
12:23duck11231antoineB: are you only using noir for tests? Chances are it won't work properly there.
12:24duck11231also, 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:24antoineByes for a little project
12:31ynnivhas anyone written a KVO lib for clojurescript?
12:35antoineBduck11231: what do you mean by tests, do you mean unit tests or little project?
12:35antoineBand i use lein 1.7, what does 2.0 gives?
12:35thorbjornDXgfredericks: 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:37nDuffthorbjornDX: In the future, would you mind using gist.github.com, refheap, or otherwise something not full of ads?
12:38thorbjornDXnDuff: sure thing, adblock confused me
12:39nDuffthorbjornDX: ...so, re: that macro, the big thing that jumps out at me is that you should probably be using gensyms
12:39duck11231antoineB: by tests, I meant unit tests. Dev dependencies is for dependencies used by your plugins and by lein itself.
12:40thorbjornDXnDuff: those are the # suffixes, correct? And I would use them in the let binding?
12:40amalloynDuff, 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:41amalloyer, defmethods, i guess
12:42thorbjornDXamalloy: 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:42amalloyyou want something like https://gist.github.com/3953894
12:43amalloyRaynes: https://github.com/Raynes/refheap.el says it's not useful to the general public; i think that's out of date?
12:44duck11231antoineB: 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:44thorbjornDXamalloy: can you give me a quick explanation of ~@ vs ~? (or point me to a reference)
12:44antoineBok
12:45antoineBi have another problem, but this time with macro in clojurescript
12:45duck11231antoineB: This should help. https://github.com/technomancy/lein-precate
12:45amalloy&(let [x '(a b c)] (vector `(1 2 ~x 3) `(1 2 ~@x 3)))
12:45lazybot⇒ [(1 2 (a b c) 3) (1 2 a b c 3)]
12:45antoineBi have go this two requiring (:require [fetch.remotes :as remotes]) (:require-macros [fetch.macros :as fm])
12:46jamiiWoah - strucjure.walk> (macroexpand-1 '(parser/view a #(= 1 %) 'ok))
12:46jamiiStackOverflowError java.util.regex.Pattern$CharProperty.match (Pattern.java:3362)
12:46technomancyantoineB: see also https://github.com/technomancy/leiningen/wiki/Upgrading
12:46amalloyjamii: parser/view probably expands to another call to parser/view
12:47lispnikif I have a file that contains "()
12:48gfredericksthen he'll want some milk as well
12:49antoineBduck11231: my new problem :) https://gist.github.com/3953940 any ideas?
12:50thorbjornDXamalloy: perfect, thanks for that :)
12:52duck11231antoineB: could you post your updated project.clj?
12:54antoineBhttps://gist.github.com/3953972
12:57arrdemtool design question for you guys
12:58duck11231I would try copying those 2 deps to :dependencies IIRC, cljsbuild uses your main classpath to look for cljs files.
12:58arrdemI'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:58duck11231but it's been a while since I've done anything with lein1
12:59arrdemright now I just generate function stubs, I was hoping someone else had a better way.
12:59antoineBduck11231: the cljs file is found as well
12:59antoineBbut the clj (the macro) is not
12:59hiredmanarrdem: fnparse is kind of dead, no?
13:00arrdemhiredman: heh yeah as of several years ago. still works a treat tho.
13:00hiredmanarrdem: last I checked it doesn't load in newer clojure versions
13:01arrdemhiredman: really? I've been using it in 1.4.0 projects with no problems...
13:01hiredmanhmmmm
13:01antoineBduck11231: copying "fetch" dep to "dependencies" make it works
13:01antoineBduck11231: so defenitly i need docs on lein
13:01hiredmanarrdem: not possible
13:02hiredmanarrdem: I would recommend checking to make sure you are really using clojure 1.4
13:02duck11231lein2 cleaned upp a lot of the mess surrounding plugins
13:02arrdemhiredman: do tell
13:02hiredmanarrdem: it pulls in some aot compiled bits of old contrib, and the abi for clojrue has changed since then
13:02antoineBi will take lein2 in account seriously
13:02thorbjornDXamalloy: here's my solution: https://gist.github.com/3954024
13:03duck11231antoineB: probably won't take any longer than 5 min or so. Just look at the guide technomancy linked
13:04antoineBi am currently on
13:04arrdemhiredman: 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:05hiredmanarrdem: who do you expect to use this?
13:05jamiiamalloy: 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:05arrdemhiredman: me. anyone else is a bonus.
13:05arrdemit's just a question of software engineering "best practices" in Clojure.
13:06hiredmanarrdem: if you care about bug fixes and new features, if not then using a old (2 year old?) version of clojure is fine
13:07hiredmanclojurebot is locked on 1.2 at the moment because of fnparse, which is lame
13:08arrdemherm... 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:08arrdemafter all there are other parser libs
13:09amalloyhah, that's great, jamii. to be fair i'd have spotted that if you'd pasted a whole stacktrace
13:09amalloyi thought someone had written an update to fnparse to get off of old-contrib
13:10arrdemamalloy: https://github.com/Cyrik/fnparse/commit/6009b69b60594bb357e28229d95ea75e03649fba
13:10arrdem(not me)
13:10arrdembut a 1.4 update
13:11amalloyarrdem: are you using that version? i think hiredman assumed you were using the canonical one, and thus stuck on clojure 1.2.x
13:12arrdemamalloy: hiredman has my number, I am guilty of the old build
13:14arrdemI just wanted to ask what the nicest way for someone else to hook into generated code would be
13:15amalloyarrdem: 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:19arrdemamalloy: 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:19duck11231arrdem: 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:19HodappThis is indeed how I used combinators when I wrote a parser in Scala.
13:19HodappIt was kind of awesome.
13:21arrdemduck11231: that is epic
13:21jkkramermultimethods can be a nice way to provide hooks/extensibility
13:22jkkramerwithout mucking about with vars
13:26ohpauleezAdditionally, depending on the types of hooks, protocols could be as far as you need to go
13:40Cheiron_Hi, I want to translate this to clojure https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java
13:40Cheiron_I will use proxy to extend the class and reify to implement the interface, correct?
13:42joegallosounds right to me
13:47Cheiron_extending should go to its own file and implementing goes to its own file ? so I can use gen-class ?
13:52timewarrior,(+ 1 2)
13:52clojurebot3
13:53Cheiron_clojurebot: do you run on Shen?
13:53clojurebotPardon?
13:56ohpauleezCheiron_: That's a good idea
13:56ohpauleezwe should add Shen and core.logic to clojurebot
13:57technomancyugh
13:57technomancyno
13:58ohpauleezok ok ok, but how about just core.logic
13:58ohpauleezI think there is a growing curiosity of, "does this unify?"
13:58Cheiron_how to tackle this? https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java#L12
13:58technomancyrunning a helpful channel bot that's not OSS would be silly
13:58Cheiron_how to declare an instance var when using proxy?
13:58hiredmanwrite a core.logic rest service
14:01dnolenohpauleez: maybe you can get Raynes to add it to lazybot? ;)
14:01ohpauleezhiredman: I just bought "unifythislogic.com" - I accept your challenge
14:01hiredmanohpauleez: lemme know when you have an api, and I'll see about having clojurebot fiddle it
14:05ohpauleezdnolen: I know you've been swamped lately, but I might have some general questions for you regarding generic data querying using unification
14:06ohpauleezI'm trying to make my datalog-like query more generic as a learning example for others
14:08dnolenohpauleez: 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:08ohpauleezwell, that makes me feel a lot better
14:09ohpauleezI have a weird mix of cond, filter, binding-map, and the unifier right now
14:09dnolenohpauleez: one approach might be something like [:or g0 g1 [:and g2 g3]] - I've been thinking about supporting something like that.
14:09dnolenohpauleez: I know the ekeko guys just use eval
14:10ohpauleezright now my queries are in this form:
14:10ohpauleezgit ttt '[(?x :id :summary) :where [?x :current-state :open :summary "ticket"]]'
14:10ohpauleezthe first turns into a select-keys, but alternate forms are allowed
14:10ohpauleezeach thing in latter []'s are and's
14:11ohpauleezyou do or's with multiple []'s
14:11dnolenif you have a link to your work I can give you some feedback when I have more free cycles.
14:11ohpauleezcool, thanks
14:13Cheiron_how to call super method inside proxy macro? https://github.com/nathanmarz/storm/blob/master/src/jvm/backtype/storm/serialization/DefaultKryoFactory.java#L23
14:13S11001001Cheiron_: proxy-super, *be warned*, *not*thread*safe*!!**!
14:14S11001001sorry, I don't mean not thread safe, I mean *not reentrant*.
14:15S11001001Cheiron_: in other words, prefer composition over class extension.
14:15Cheiron_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:17Apage43Cheiron_: you actually want to reimplement DefaultKryoFactory, or are you just implementing the same interface?
14:17Apage43at any rate, is it possible for you to use (reify) instead of (proxy) ?
14:17Cheiron_I need to extend Kryo class and implement the interface IKryoFactory
14:17Cheiron_should I pass this to proxy-super ?
14:19Apage43proxy-super captures this for you
14:19Apage43it's a macro
14:20Cheiron_(proxy-super method) or (proxy-super .method) ? I guess the latter
14:20Apage43former
14:21Cheiron_.method?
14:21Apage43no dot.
14:21Cheiron_oh
14:24Apage43anyway, 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:25tgoossensWhat is a good and short talk about datomic
14:25tgoossensI want to know what it is about
14:30Cheiron_It is an immutable database :)
14:31Cheiron_datomic website has a nice interview
14:32hiredmaninfoq has 5-6 videos (some of them are dups) of talks rich or stu have given on datomic
14:34tgoossensOk
14:34tgoossensOn clojure rationale
14:34cmajor7since 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:34tgoossens"OOP Born of simulation, now used for everything,"
14:34tgoossensWhat does it mean
14:35tgoossensBorn of simulation
14:35technomancy"when an Alan Kay loves a Simula very much ..."
14:37tgoossens?
14:39bhenryneed 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:39Cheiron_hi, how to map this to clojure ? ((KryoSerializableDefault)k).overrideDefault(true); (how to cast) ?
14:40S11001001Cheiron_: (.overrideDefault k true)
14:40Cheiron_no need to type cast?
14:40S11001001Cheiron_: no need
14:40Cheiron_may I ask why?
14:40muhooone of the great joys in clojure
14:40S11001001Cheiron_: because it's more fun than requiring the cast
14:41muhoonot having to deal with java BDSM
14:41Cheiron_i see :)
14:41antares_Langohr 1.0.0-beta10 is released: http://blog.clojurewerkz.org/blog/2012/10/25/langohr-1-dot-0-beta10-is-released/
14:57ynnivibdknox: I'm looking for a backbone-like (data observing) library in clojurescript. are you using waltz this way?
14:59ohpauleezynniv: You might want to checkout https://github.com/lynaghk/reflex
15:00fbru02Hi 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:00ohpauleezif what you want to do is data observation
15:01ynnivah, that's a useful link.
15:03gfredericks(inc lynaghk)
15:03lazybot⇒ 1
15:06ynniv(= lynaghk)
15:07ynnivlooks like reflex is used in the grander data vis system c2
15:08ynnivinnnnteresting
15:10Sgeohttp://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:10SgeoSame person who didn't understand doseq vs. for a while ago
15:10SgeoGuess what? There course goes over doseq and for
15:11Sgeo*They're
15:11gfredericks*their
15:11ohpauleezynniv: 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:11Sgeogfredericks, derp.
15:11SgeoI need sleep.
15:12ynnivohpauleez: oh yes. I was a happy sproutcorer for that exact reason, until the SC community went sideways
15:13ynnivwhat's up with the mix of cljs and coffeescript?
15:13ynniv(singult for instance)
15:13ohpauleezyes - 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:14TimMcSgeo: "Clojure Lisp Programming"
15:14ohpauleezynniv: singult's goals are to allow platform interop as well - so that you can use it from JS as well as in CLJS
15:14ohpauleezpersonally, I use enfocus and raw html partials
15:15ynnivsproutcore 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:15augustlis there an "assoc if not already present" for maps?
15:15TimMcSgeo: "The apply function" Oh god this does not bode well.
15:15ohpauleezbut some people love the crap out of the other stuff
15:15augustl(merge {:foo bar} my-map) comes to mind
15:15TimMcaugustl: update-in is close...
15:15SgeoTimMc, I wish I could stick around, but I have to get to class. A _real_ class, I mean.
15:15ohpauleezaugustl: like python's set-default?
15:16SgeoNo matter how boring I find my school, it's not likely to be utterly attrociously wrong
15:16augustlohpauleez: like (if (not (contains? my-map :key) (assoc my-map :key some-value)) :)
15:16augustlcould just write my own real quick of course
15:17SgeoTimMc, apply isn't a function? Hmm, didn't realize that, to be honest
15:17ohpauleezmake sure you put `my-map` in the else clause
15:17Sgeo,(-> (meta #'apply) :macro)
15:17ohpauleezaugustl: ^
15:17clojurebotnil
15:17Sgeo,(meta #'apply)
15:17clojurebot{: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:18TimMcHmm? Oh, apply is weird in a different way, nvm.
15:18TimMcbut he calls doseq, for, & loop functions
15:18SgeoIt does Java interop
15:19TimMcI think it's usually a compiler special in other lisps.
15:19SgeoI really need to get going now
15:19ynniv,(let [x { :foo 1 :bar 2 }] (conj x { :bar (or (:bar x) 3) :baz (or (:baz x) 4) })) ?
15:19clojurebot{:baz 4, :foo 1, :bar 2}
15:19TimMcGo!
15:19konr_trabdo 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:21technomancykonr_trab: afaict nothing exists around that because no one's really used those techniques in nontrivial systems yet
15:21technomancyand lived to tell the tale
15:24mklappstuhlI have a very general question about "putting files together"
15:24mklappstuhlI have a few files that use functions that might be defined in another file
15:25mklappstuhlI 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:25gfredericks~leiningen
15:25clojurebothttp://github.com/technomancy/leiningen
15:27mklappstuhlgfredericks, I'm not loading files from libraries... I load files I wrote myself ... is leiningen also useful for that?
15:27gfredericksquite
15:27gfredericksyou should have 1 namespace per file, and the files should have filenames and be in directories corresponding to the namespace
15:28gfredericksthen you declare dependencies between namespaces with (:require ...) clauses in the ns declaration
15:28gfrederickshalf to all of that is not particular to leiningen
15:29gfredericksbut 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:30gfredericksalso leiningen is a lot easier for people (like in IRC) to help with, compared to doing stuff by hand
15:30hiredmanhttp://clojure.org/namespaces
15:31gfredericksI knew there must be some docs somewhere :)
15:33antares_gfredericks: there is also http://clojure-doc.org/articles/language/namespaces.html now
15:34gfredericks(inc docs)
15:34lazybot⇒ 1
16:00mklappstuhlgfredericks, using namespaces, do I need to load clojure.core itself? because it says I dont have (def ) anymore
16:01amalloyit's not possible for you to no longer have def
16:01mklappstuhlamalloy,
16:01mklappstuhlCompilerException java.lang.RuntimeException: No such var: clojure.core/def, compiling:(mklappstuhl/stock_utils/analyze.clj:1)
16:02AtKaaZi think that happened to me once with the master branch, or it was something else but it fixed when I (use 'clojure.repl)
16:02AtKaaZi think maybe it was just doc and source
16:02mklappstuhlmy description might have been incorrect but I think its a similar effect
16:02mklappstuhlAtKaaZ, I'm loading it from the repl
16:03AtKaaZdo you have doc and source?
16:03amalloymklappstuhl: (ns foo (:require ...)) (more-code...), not (ns foo (:require ...) (more-code...))
16:04AtKaaZamalloy, that was exactly my problem haha you rock
16:04AtKaaZ(inc amalloy)
16:04ynnivyes, (ns …) is non-functional. you don't put your code in the form
16:04lazybot⇒ 34
16:06mklappstuhlamalloy, this also solved my problem
16:09AtKaaZhmm, 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:15mklappstuhlI'm now getting this error:
16:15mklappstuhlException lib names inside prefix lists must not contain periods
16:16mklappstuhlwith a core.clj like this:
16:16mklappstuhl(ns mklappstuhl.stock-utils.core
16:16mklappstuhl (:require [mklappstuhl.stock-utils.analyze :as analyze]
16:16mklappstuhl [mklappstuhl.stock-utils.metrics :as metrics]
16:16mklappstuhl [mklappstuhl.stock-utils.simulate :as simulate]
16:16mklappstuhl [mklappstuhl.stock-utils.utilities :as utilities]))
16:16mklappstuhlsorry for the long paste ;)
16:19ynnivmklappstuhl: https://gist.github.com/ is nice for long pastes, and it highlights syntax
16:19AtKaaZwhat *clojure-version*?
16:20mklappstuhlynniv, I know but yeah... 5 simple lines... :P
16:20technomancy10 lines actually, since they wrapped
16:21ynnivdidn't wrap for me...
16:21ynniv,*clojure-version*
16:21clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
16:22AtKaaZmklappstuhl what's the full error and clojure version?
16:23mklappstuhlfull message:
16:23mklappstuhlException lib names inside prefix lists must not contain periods clojure.core/load-lib (core.clj:5223)
16:24mklappstuhlhow do I get the version I'm using? o.O
16:24technomancyI wonder if ambrose wants bug reports on his paper via github issues
16:24mklappstuhl1.3
16:25brehauttechnomancy: on HN he was asking for them via email i think
16:25gfredericksthe vararg section (with the not= example) seemed wrong
16:25AtKaaZmklappstuhl, how do you know to which file the error applies?
16:26brehauttechnomancy http://news.ycombinator.com/item?id=4698310
16:27technomancy"O'Caml" is bugging me =)
16:27mklappstuhlAtKaaZ, I don't know it for sure to be honest. it just happens when I require .core ..
16:27brehauttechnomancy: its the irish fork
16:27ohpauleezbrehaut: haha
16:27technomancydid he explain why he uses a separate form for annotations rather than metadata?
16:28brehautnot that i saw
16:28technomancyweird
16:28brehautbut i havent got all the way through yet
16:28technomancytyped clojure wins as the best-documented clojure library of all time
16:28amalloytechnomancy: because you can annotate functions you didn't write
16:28technomancy74 pages of immaculately-typeset docs
16:29gfrederickshow usable is typed-clojure currently?
16:29technomancyamalloy: vary-meta?
16:29amalloyi assume you mean alter-meta!
16:29amalloysince i doubt if it's metadata on the functions
16:29technomancyyeah, I spose so, stupid fns-not-having-metadata =P
16:29mklappstuhlwhere 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:30technomancyI was kind of hoping for more inference =\
16:30hiredmantechnomancy: the annotation form my just be a short cut for putting metadata on vars
16:30hiredmanmay
16:30technomancyhiredman: yeah, maybe it's just using ann uniformly for pedagogical purposes
16:31technomancyless to explain to his thesis advisors =)
16:33S11001001mklappstuhl: make a project and run lein repl within it
16:34S11001001mklappstuhl: 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:34technomancymklappstuhl: system-wide installs are ignored by leiningen (and any sane library management system really)
16:37mklappstuhltechnomancy, you did/do a really good job with leiningen... ;)
16:37mmitchellis there anything like Ruby's rake for Clojure?
16:38antares_mmitchell: leiningen.org?
16:38wunkican someone recommend a fn which is well suited to "humanize" numbers. E.g., 100000 -> 100.000
16:38TimMcwunki: I believe the Java standard libraries have NumberFormat or something.
16:38Frozenlo`you mean 100 000 ?
16:38TimMcNo no, 100,000. :-P
16:39wunkiIt's for download size, so I want to keep it '.' :)
16:39wunkiI'm going from bytes to kb/mb/gb etc. Now I just want the dots
16:39TimMcThe right thing to do is use a locale-based formatter.
16:41mmitchellantares_: oh yeah! i kinda forgot that it supports that sort of thing
16:41Frozenlo`IMO dots and commas should never be used in numbers except for the decimal separator.
16:41TimMc,(.format (java.text.NumberFormat/getInstance java.util.Locale/GERMAN) 1e5)
16:41clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.ExceptionInInitializerError>
16:41wunkiit's to make it human readable, not for calculation
16:42TimMc&(.format (java.text.NumberFormat/getInstance java.util.Locale/GERMAN) 1e5)
16:42lazybot⇒ "100.000"
16:42AtKaaZmmitchell: https://twitter.com/qertoip/statuses/20449282180
16:42Frozenlo`wunki: It makes it human readable for a very local population
16:42wunkiTimMc: thanks!
16:42TimMcwunki: Use the system locale, if possible.
16:42antares_AtKaaZ: cake is no longer developed
16:42antares_AtKaaZ: cake developers now work on leiningen. I think it has been going for almost one year now.
16:43AtKaaZantares_: I see, I'd ofc use leiningen,but he asked :)
16:43wunkiFrozenlo`: this is only about byte size, not money luckily
16:43mmitchellAtKaaZ: are people still using cake? For some reason I thought it and leiningen were merged?
16:44TimMc&(.. (java.text.NumberFormat/getInstance (java.util.Locale/getDefault)) (format 1e5)) ;; wunki
16:44lazybot⇒ "100,000"
16:44antares_mmitchell: that is correct
16:44AtKaaZmmitchell: that was my interpretation of your question: <mmitchell> is there anything like Ruby's rake for Clojure?
16:44antares_mmitchell: cake is no longer developed
16:44TimMcwunki: Is this to be run on a server or the user's own computer?
16:44mmitchellAtKaaZ: ok gotcha, thanks
16:45wunkiTimMc: going to be run on a server
16:45TimMcwunki: OK, then grab the user's locale from their browser's request headers.
16:45mmitchellantares_: do you need leiningen 2 to run tasks? My team and I are all stuck on 1 :(
16:45mmitchell(definitely time to upgrade)
16:46antares_wunki: take a look at https://github.com/ptaoussanis/tower, maybe it has something for your case
16:46TimMcotherwise they may be extremely surprised
16:46antares_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:47mmitchellantares_: cool thanks
16:48antares_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:48wunkiTimMc: that's to much for now. Thanks for showing me how it's done.
16:50AtKaaZantares_: do you have any pointers on how to aot compile leiningen and have the classes inside the .jar ?
16:50TimMcAtKaaZ: You want to AOT lein itself?
16:50antares_AtKaaZ: leiningen itself?
16:50AtKaaZtimmc, yes something like what preview10 .jar has
16:51AtKaaZboth classes and .clj inside it
16:51antares_AtKaaZ: https://github.com/technomancy/leiningen#building and then ./bin/lein uberjar
16:52antares_https://github.com/technomancy/leiningen/blob/master/bin/release demonstrates what is done before release
16:52AtKaaZI did both but they both give me no classes inside, esp. if I use preview10 lein to do it
16:53muhoo:aot :all in project?
16:53AtKaaZ:all too? hmm
16:54TimMcAtKaaZ: Why are you AOT'ing?
16:55AtKaaZtimmc, 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:56antares_full AOT does help with startup time and for leiningen that is important
16:56AtKaaZbut I am failing to do it for lein, if I use the 9.4mb .jar then I get this: http://pastebin.com/remhhXPR
16:56technomancymklappstuhl: heh; thanks =)
16:58technomancymmitchell: what's keeping you on lein1 if you don't mind my asking?
16:58AtKaaZif I use pre10 lein.bat and its .jar it gives no errors but it won't aot http://pastebin.com/x6KQU5e3
16:58technomancytrying 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:58nDuffAtKaaZ: Could you please consider gist.github.com, refheap, or another pastebin not full of ads in the future?
16:59AtKaaZnDuff, pastebin has ads? sorry, didn't know, I'll do gist I think
16:59technomancyAtKaaZ: ugh; it's a problem with AOT/protocols
17:00technomancyAtKaaZ: though if you already have a jar created I'm not sure why you're running through the release process again?
17:00technomancyAtKaaZ: you should build with bin/lein rather than a self-installed build
17:01AtKaaZtechnomancy: the created .jar has only source code, I was hoping to get the .class files inside it too, somehow
17:01mmitchelltechnomancy: well, we have too many things to do :) and... I think we have a few in-house plugins that are needing an upgrade
17:01amalloywe should add a lazybot trigger for when someone says pastebin: "nDuff wishes you would stop using pastebin"
17:02aphyrmmmmm refheap.
17:02technomancymmitchell: sure, fair enough. it's always those internal plugins that get ya
17:02AtKaaZtechnomancy: I'll try with bin/lein too, but it's probably the same thing(?)
17:02technomancyAtKaaZ: if you clear out target/ first you shouldn't get hit by AOT issues
17:02mmitchelltechnomancy: yeah, other than that, we're all really looking forward to it
17:02AtKaaZnDuff: didn't see the ads due to adblock plus+firefox
17:03ynnivthere are ads in pastebin? not with adblock+flashblock+ghostery ...
17:03technomancymmitchell: 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:03technomancybut existing code that works has inertia
17:04Frozenlo`Wait what... ads in pastebin?
17:04nDuffynniv: 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:04nDuffFrozenlo`: Yes, it's full of them. Big, animated ones, often.
17:04Frozenlo`Or rather "wait what, people without an ad-blocker?"
17:04technomancyAtKaaZ: 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:04mmitchelltechnomancy: true yep, we have one that shows, and dynamically creates the project version from the git commit sha.
17:04technomancymmitchell: that's already done by lein jar actually
17:04technomancyit's in the pom
17:04Frozenlo`I'm all for using refheap, just surprised by the ad-blocker-lessness
17:05technomancyFrozenlo`: depends on the sites you frequent
17:05AtKaaZtechnomancy: no idea what that means, I'm certainly not using them :)
17:05technomancyI don't make a habit of visiting annoying sites, so I don't bother
17:05nDuffFrozenlo`: 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:05mmitchelltechnomancy: really? so, how can i learn more about that feature (the version thingy)?
17:05nDuffFrozenlo`: ...also, I have moral issues with them.
17:05technomancyAtKaaZ: 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:05amalloythere'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:06technomancyAtKaaZ: especially self-hosting builds
17:06technomancyalso: not having flash installed does wonders for reducing ad-based annoyance
17:06technomancyamalloy: it's in the ablock TOS I'm sure =)
17:07technomancymmitchell: take a look inside your jar; you should see a pom.xml file for your project
17:07Frozenlockamalloy: if I told you I wasn't using a version control system, wouldn't you be surprised?
17:07ynnivnDuff: 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:07technomancymmitchell: under <scm> there should be a <tag> containing the rev under which your jar was generated
17:07AtKaaZFrozenlock, I'd think less of you :D
17:07Frozenlock:D
17:08mmitchelltechnomancy: 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:08brehautFrozenlock: i wouldnt be; a lot of people still use SVN
17:08nDuffynniv: Sure. I don't have a problem with _all_ ads. I have a problem with big, flashy, animated ads.
17:08technomancymmitchell: oh, I see what you mean. yeah that's different.
17:08technomancynDuff: remove flash; problem solved
17:08nDufftechnomancy: "flashy" was maybe the wrong word.
17:08amalloyFrozenlock: 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:08AtKaaZnDuff: flashblock plugin, you can turn on only flash that you want via 1 click
17:09Frozenlockbrehaut: Which is a version control...
17:09nDuffAtKaaZ: Already described why that doesn't work for me.
17:09technomancy"flash you want" I don't understand
17:09ynnivtechnomancy: large animated images are pretty annoying, and don't require flash. as do animated DOM elements
17:09Frozenlockamalloy: Oh please say that in #emacs :D
17:09muhoonever had a problem with adblocker, but i do turn off flash and i use noscript
17:09nDuffAtKaaZ: 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:09brehautFrozenlock: that was a joke, son
17:09FrozenlockSorry dad, need coffee I think.
17:09technomancyynniv: sure, neither of which are present on pastebin
17:09technomancyor any reasonable site really
17:09brehaut</foghorn>
17:09muhooFrozenlock: there's only one user in #emacs, IIRC who really hates git and is vocal about it.
17:10Frozenlockmuhoo: yup, and I was thinking about him ;)
17:10amalloyoh shoot, i forget who that guy is. git destroys his data, right?
17:10AtKaaZnDuff, 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:10muhooamalloy: jordi something
17:10nDuffAtKaaZ: Not annoying ones.
17:11nDuff(and yes, it's pretty awesome)
17:12ynnivit's not like I'm browsing the web via email... http://stallman.org/stallman-computing.html
17:12muhooso what'd be a good way in clojure to wrap a json service, much like the python ServiceProxy?
17:12mklappstuhlhey guys...
17:12RaynesAtKaaZ: https://www.refheap.com <3
17:12muhooor would that be so trivial that it's not even a thing
17:12mklappstuhlI'm kind of stuck with this https://gist.github.com/7d3443719b0d50463c93
17:13AtKaaZbut technomancy, don't you want to know why preview10 doesn't aot leiningen even though there are no errors?
17:13AtKaaZactually, that is likely fixed in master
17:13AtKaaZRaynes, no ads?
17:13RaynesNo way.
17:13RaynesRaynes don't do ads.
17:14ynnivmklappstuhl: require doesn't import symbols. use "use" instead
17:14technomancyRaynes has lucrative behind-the-scenes sponsors =)
17:14RaynesI wish.
17:14mklappstuhlynniv, there are so many different ways to load other files/ns ... which is the best then?
17:15RaynesThough my fundraiser went really well for refheap funds.
17:15AtKaaZRaynes, looks good, any idea why No is red ? as if private: No is bad? :D
17:15technomancyRaynes: yeah I was referring to Keming labs
17:15clojurebotif it's not one thing it's another
17:15Raynestechnomancy: Yeah, That is pretty sick. He covered the whole darn thing.
17:15ynnivmklappstuhl: usually you (ns mynamespace (:require [library :as l] [otherlib :as ol]))
17:15technomancyand Heroku too in a way; free dyno-hours wooo =)
17:16mklappstuhlynniv, 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:16mklappstuhlhttp://clojure-doc.org/articles/language/namespaces.html
17:16RaynesAtKaaZ: No particular reason. Just because no is negative and yes is positive.
17:16mklappstuhlynniv, so if I use :as when requiring it should work?
17:16ynnivthen you'll have to prefix symbols in them with the specified prefix, which improves readability
17:16ynnivyeah
17:16ynnivi'm not familiar with the new :refer in 1.4.
17:17RaynesAtKaaZ: 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:17ynnivbut use require in the ns form as much as possible. when using prefixes gets out of hand, use use (or this new refer)
17:17AtKaaZRaynes: understood
17:19AtKaaZRaynes: is not indexed by google?
17:20RaynesIt's indexed.
17:21AtKaaZI failed to find 150118 site:www.refheap.com ie. https://www.refheap.com/paste/6112
17:21ynnivsilly python requires commas in array literals…
17:21RaynesI just searched for 'refheap slurp" and got some results.
17:22AtKaaZRaynes, ok it works then, might take some time for the recent ones to get indexes
17:22RaynesPerhaps it hasn't been crawled recently enough or something.
17:22AtKaaZit's good stuff, thanks
17:23brehautynniv: yeah, and its got its colons at the wrong end of map keys
17:23thorbjornDXbrehaut: the colons are syntax, as are the commas :(
17:25ynnivthorbjornDX: separating identifiers with whitespace seems like enough syntax to me
17:25brehautthorbjornDX: i dont understand the distinction you are making
17:25brehautynniv: i certainly try all the time. parse disagrees :(
17:26thorbjornDXynniv: 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:27ynnivagreed, but again k v k v k v seems like enough syntax to me
17:29thorbjornDXynniv: I think python's reasoning behind the {key: value, key: value} thing is to force a certain (restrictive) code formatting style
17:29ynnivcertainly. having been doing well enough without it, it's irritating to return
17:30ynnivbrehaut: pun intended? ;-)
17:30brehautintended :)
17:30thorbjornDXynniv: I find python's list comprehension syntax to be pretty hard to look at after 'for
17:31ynnivI've written my fair share of incomprehensible list comprehensions, and not enough for's to erase the memory
17:31ynnivbut when editing someone else's code, you don't get to pick the language
17:47callendoes anyone else here find the act of trying to make practical things with CSS intensely frustrating?
17:47callenI didn't want to ask ##css because that would be trolling.
17:47stankleycallen: Hah
17:47stankleycallen: Yes, it's absurd and broken
17:48stankleycallen: Firedebug and a lot of patience
17:48callenI 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:48stankley*Firebug
17:48callenstankley: yeah, we use firebug and chrome (webkit inspector)
17:49stankleycallen: That part is at least slightly rational. Then you have internet explorer to think about...
17:49callenstankley: I've never worked with anybody who likes CSS, even frontend people.
17:49stankleycallen: Yeah, potential product right there
17:49ynnivit's better than specifying every style attribute for each element
17:49stankleycallen: Abstract away the pain and brokenness of CSS
17:50ynnivless does that a little
17:50stankleyynniv: Yeah, but not all the way
17:50callenynniv: it's not really about CSS alone, it's about the layout.
17:51callenynniv: the layout model is obscene.
17:51callenit takes herculean effort just to make something that mostly works, let alone is responsive.
17:51ynnivah, yes. my best layouts are all absolute
17:51callen :\
17:52ynnivan ideal framework might only use the canvas element, doing all layout and eventing in JS
17:53callenthat's obscene.
17:53stankleyynniv: hah
17:53ynnivthere are issues rendering text like that, and accessibility, but relying on the DOM to be consistent across browsers is a mistake
17:53stankleyynniv: But also a potential solution
17:53ynnivcallen: why is that obscene?
17:54ynnivdo you not want the browser to draw your pixels accurately?
17:54stankleyynniv: Break all accessibility
17:54callenynniv: because I'm an engineer and I care about simplicity and transparency.
17:54stankleyynniv: For one
17:54brehautactually, with modernizr fixing ie8, and discounting anything older, the dom is surprisingly consistent across browsers
17:54ynnivrelying on the DOM's inconsistencies is more simple or transparent?
17:54callenynniv: I do not create stygian horrors out of distaste for a layout model.
17:54stankleyynniv: Both.
17:55callenbrehaut: CSS is more consistently awful than it used to be.
17:55ynnivand what about events? have you not had to deal with event handling across browsers?
17:55ynnivi don't think that you give canvas a fair shake
17:55ynnivyes, accessibility requires some work
17:57ynnivbrehaut: have you worked with touch events before?
17:57stankleyynniv: Agreed, but breaking out of HTML structure into raw canvas isn't the solution for the problems of CSS
17:57brehautynniv: yes
17:58ynnivthe only sane way to work with touch events is to prevent them immediately, before the browser does something "intelligent" with them
17:58stankleyynniv: Hah
17:59ynnivbut, I am a proponent of applications in browsers. those look a lot different than fancy web pages
18:12TimMcI hate app-in-a-page.
18:13TimMcSlow, breaks bookmarks/history/automation, hard to customize, inaccessible...
18:14nDuffTimMc: ...to be fair, bookmark/history/automation support _can_ be done, using the hash part of the URL.
18:14brehautnDuff: god no. history API
18:14brehautdo it properly or dont do it at all
18:15nightfly_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:17emezeskenightfly_: The comp one is kind of weird
18:18TimMcnDuff: Hash navigation should only be used for IE fallback.
18:18emezeskenightfly_: Maybe you'd be interested in the thrush macro? ->
18:18TimMcEven the history API is still... young?
18:18ynnivTimMc: depends on if it's supposed to be a web page or not
18:18brehautTimMc: the history api works fine
18:18TimMcI haven't seen any site get it right yet.
18:18TimMcGitHub still gets out of sync a bunch.
18:18brehautTimMc: the hard part is not the history api, its everything else you have to do to actually use it gracefully
18:19TimMcYeah, it might not be the API's fault exactly... anyway, sync is HARD.
18:19nDuff...well, been pressed into service as web dev before, but only held that position as a last-resort.
18:19ynnivTimMc: do you use native apps on mobile devices?
18:19TimMcNope.
18:19TimMcI don't have a "mobile device", I have a cell phone.
18:19ynnivyou're not the market then :)
18:19TimMcOh, and a laptop -- that's a mobile device, right? :-P
18:19nightfly_emezeske: That is exactly what I wanted! Thanks!
18:20technomancyI have a server that's mounted on a rack with wheels on it; that counts right?
18:20technomancymo-bile computoring
18:20TimMcynniv: 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:21amalloynightfly_: the comp version doesn't even work
18:21TimMctechnomancy: Back at Crutchfield we had a desktop with a UPS on a cart and wheeled it around for surprise usability testing.
18:21ynnivapps are characterized by offline rich interaction, which is not the web, but can use web technologies
18:21TimMcI don't know how they silenced the UPS.
18:21emezeskenightfly_: I pasted something into the comments that I liked
18:21technomancy"surprise usability testing" sounds like something you could make a reality show about
18:21TimMcIt was pretty great.
18:22ynnivit might have been more exciting with the UPS beeping
18:22ynnivadds to the "surprise"
18:24amalloyemezeske: -> isn't thrush: thrush is a function that operates on functions; -> is a macro that operates on forms
18:25technomancyeh
18:25emezeskeamalloy: 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:25technomancyit's not "The Thrush Combinator" but it partakes of thrushiness
18:25amalloyemezeske: thread and arrow are both popular names
18:26emezeskeamalloy: "Threading macro," that's right, I've heard that, thanks
18:26technomancy"thread" by itself is a terrible name. "thread macro" is OK.
18:26technomancy"thrush macro" is fine too
18:26brehautreclaiming arrow from its catagorical crazies is approved of though
18:26technomancyjust don't call it a combinator and you'll be fine
18:27amalloyagreed thrush macro is at least clear what you're referring to
18:27emezeskeI like "thread macro" -- threading really paints a visual picture in my head of what it does
18:27callenemezeske: I tried to get hickey to call it the winchester macro.
18:27brehautemezeske: but its a horribly overloaded term.
18:27emezeskecallen: Haha, as in it looks like a gun?
18:27nDuffHmm. 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:27callenemezeske: more or less.
18:27emezeskebrehaut: Good point. :)
18:28callenemezeske: I liked to think of it as shooting data through the list of functions.
18:28emezeskecallen: hahaha, I like it
18:28technomancyrailgun macro
18:28callenemezeske: http://clojure-log.n01se.net/date/2010-08-05.html
18:28callenemezeske: ctrl-f "callen-nyc"
18:28callenemezeske: or "winchester"
18:28callenthat wasn't even the first time I'd said it was called the winchester :P
18:29brehautcallen: you can point to the space beside the nick of a message an a link appears
18:29callenoh bother.
18:29callenbrehaut: thanks.
18:29callenhttp://clojure-log.n01se.net/date/2010-08-05.html#17:36a there.
18:29callenemezeske: ^^
18:29callentechnomancy: you and I talked a bit about contrib after that.
18:29emezeskehaha
18:30amalloynDuff: (map (juxt test1 test2 test3) coll)?
18:30zerokarmaleftheh, pagerank as the go-to curator of libs
18:31technomancyremember that one time when there was that patch that didn't get applied; oh man, good times
18:31callentechnomancy: LOL
18:32nDuffamalloy: desired output is the count of items for which each test returned true, so there's still a piece missing there.
18:32amalloyoh dang, the guy at riddell.us used to hang out in #clojure? before my time, i guess
18:32lazybotThe 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:32brehautunapplied 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:32amalloynDuff: sure, but it's a simple piece, and not one that will be expensive, which sounded like your primary question
18:33zerokarmalefti got bit by that guy's blog when i first started out
18:33TimMctechnomancy: "stitching macro", bro
18:33bdeshamI'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:33callenTimMc: winchester.
18:33brehautbdesham: delay ?
18:33TimMcLooks more like a harpoon than a gun.
18:34callenTimMc: I'm alright with calling something "the poon", are you?
18:34bdeshambrehaut: yep. *sigh* it's always something built into the damn language... ;-)
18:34bdeshamthanks
18:35TimMccallen: Deal.
18:48antoineBhello, is there some ring-server pro here?
18:48Raynes~anyone
18:48clojurebotJust 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:50antoineBok, is it possible to handle a request, terminate the thread (no send back response), and in another Thread forge a few responses?
18:50nDuff"forge a few responses"?
18:51antoineBforge responses, with request elements saved from requests
18:52antoineBhttps://github.com/weavejester/ring-serve when you look at the example you see (request -> response) pattern
18:52nDuff"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:52hiredmanantoineB: I would recommend looking at the various async adaptations of ring
18:52nDuffWhat do you do with those "forged" responses? Cache them? Throw them away?
18:52hiredmanaleph has one
18:52antoineBsend them to client back
18:52antoineBfor long polling ajax
18:52nDuffAhhh.
18:52antoineBcurrently i do an infinite loop
18:53antoineBwhich use a thread for nothing
19:07antoineBthanks, aleph is the stuff i need
19:07antoineBexpected i use noir as web framework
19:08antoineBbut i don't realy need a web framework for serving 3 pages
19:36technomancyit's the same code
19:36technomancyfor completion
19:36technomancystill no inspector though
19:36nDuffI'm getting completion now on items I've added to my code but not eval'd into the repl yet
19:36nDuffdidn't see that with swank
19:37technomancyoh, well that's just dabbrev
19:37nDuffif it's nrepl.el's doing instead (looking at the source), it's still win. :)
19:37technomancyyou can do that with slime, it just doesn't use it out of the box
19:37nDuffAhh.
20:15TimMcnDuff: You're summing the 0-index elements, then the 1-index elements, etc.?
20:17nDuffTimMc: Yup.
20:19brehautso ##(map + [1 2 3] [2 3 4] [3 4 5]) ?
20:19lazybot⇒ (6 9 12)
20:20brehaut(map = zip and zip = transpose)
20:48amalloybrehaut: you're a closet infix heretic, aren't you
20:48brehautamalloy: yes. i like static types too
20:49amalloythat's okay, they're semi-hip
20:51brehauthaskell and F# has corrupted me to liking crazy incantaitons of infix
20:51brehauthonestly, english is my first language
20:54arrdem gods haskell..
20:54arrdem"we're gonna use prefix... and what you are reading is probably an s expression with no parens"
20:54arrdem"but don't count on it, and infix is cool to"
20:55muhooheh
20:55arrdem</rant> </troll>
20:55brehautit would be funnier if that sometimes infix notation werent incredibly useful
20:56brehautha
20:56arrdemreally?
20:57arrdemI'm failing to think of anything where an infix assignment or operator is not semantically equivalent to a let or some other expression
20:57emezeskearrdem: There are other things than semantici equivalence, e.g. readability
20:57brehaut= is an abberation and doesnt count when people talk about haskell having infix
20:57emezeskearrdem: A lot of people like their math formulas to read like math formulas
20:58arrdememezeske: totally understood
20:58arrdempthon's inline if as example 1 A
20:58brehautits 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:58emezeskearrdem: (I tend to not mind prefix for everything, on a personal note)
20:59arrdememezeske: nor do I. While I can't bash on let, usually it would be easier to read an equality operator
21:00brehautemezeske, arrdem its unsurprising that a channel for a lisp would be full of people who like that particular syntactic trade off :)
21:00emezeskebrehaut: ;)
21:00arrdembrehaut: I know...
21:01brehauti also like lisp / prefix notation, i just happen to also like the haskell way too
21:02emezeskebrehaut: I definitely like the ability to do infix, if only to give DSLs more freedom
21:02arrdemthe 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:02arrdememezeske: yeah. I was just pondering if an infix DSL would be possible in Clojure... I don't think so.
21:03brehautyou could really hurt yourself with some macro fu
21:03arrdembrehaut: I don't deny what I'm investigating is risky.
21:03arrdemjust curious
21:04brehauti think fogus or chouser has a function actually
21:04brehautthat does infix
21:04arrdemwhen it blows up in my face I'll crawl back here to say "I should have known" with my last breath..
21:04brehaut(infix [1 + [2 * 3]]) ;=> 7
21:05arrdembrehaut: nah man.. that's thinking small.
21:05arrdemthat has been done many times..
21:05arrdemI want a full inline a = (+ 1 2)
21:06brehautim sure if clojure had reader macros, greate evil could be created
21:06arrdemclojure does have reader macros..
21:06brehautnot user definable ones
21:06arrdemnope.
21:06arrdemthey are user definable
21:06arrdemwith the disclamar that they are evil
21:07arrdemand that bad things will happen to anyone who uses them
21:07brehauti have no idea what you are talking about
21:09TimMcbrehaut: It's true, you can hack into the reader.
21:09brehautTimMc: are we talking actual crow bar and java jam some extra evil in?
21:10TimMcI don't know what it entails.
21:12TimMcbrehaut: http://briancarper.net/blog/449/clojure-reader-macros
21:12brehautTimMc: thanks (i think)
21:13TimMc(.setAccessible true) and you know shit's goin' down
21:13brehauthaha
21:13brehautthats crowbars for sure
21:14arrdemthat needs a giant "here be draggons" comment...
21:14TimMcarrdem: The blog post does have a "Oh sweet Jesus don't use this in real code" comment.
21:14brainproxythoughts on jim duey's "protocol monads" library? anyone using it to great success? problems with it?
21:14arrdemTimMc: O know... read it last night
21:15arrdem*I
21:15TimMcbrainproxy: I remember someone fussing about breakage of the monad laws, but I'm not position to confirm or deny that claim...
21:17brainproxyI know Sgeo was fussing about breakage of monad laws w.r.t. algo.monads
21:17brainproxyhe filed a ticket in cloju're jira to that effect; but thought I remembered him saying the protocol monads were better
21:25Sgeobrainproxy, 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:29brainproxySgeo: 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:29oskarthis there anything in clojure which embraces FRP?
21:30brainproxyoskarth: that's been discussed in here from time to time; for the moment, the project to look at is lamina/aleph
21:30oskarthbrainproxy: thanks :)
21:30brainproxyhttps://github.com/ztellman/lamina
21:31oskarthbrainproxy: do you know if there has been any attempts to make it work in clojurescript?
21:31Sgeobrainproxy, 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:31SgeoAt least, to the best of my memory
21:31SgeoIt's been a while
21:34amalloysomeone used do as a macro name? i doubt if that works ever, in any case
21:35brainproxySgeo: okay, thanks; I may follow-up w/ you on some of those points as I dig further in
21:35Sgeohttps://github.com/jduey/protocol-monads/blob/master/src/monads/core.clj#L16
21:35Sgeoamalloy, ^
21:36brainproxyoskarth: I don't think it works with clojurescript at present; there is the flapjax library
21:36brainproxyit's a nice, reactive library for js developed a few years ago
21:36Sgeobrainproxy, oh, do-result is sort of a return where you pass in a dummy instance of the type, I think
21:37amalloySgeo: i see him defining that macro, but not using it. i don't think it will work
21:37TimMcEvery time I see "FRP" I think Relational, not Reactive. >_<
21:38Sgeo,(special-symbol 'blah/do)
21:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: special-symbol in this context, compiling:(NO_SOURCE_PATH:0)>
21:38Sgeo,(special-symbol? 'blah/do)
21:38clojurebotfalse
21:38amalloyoh sure, if it's qualified
21:38SgeoI think I've actually tried it, lemme try it again
21:38oskarththanks brainproxy :)
21:39brainproxyoskarth: sorry, follow-up point.. flapjax is nice, but hasn't advanced too much since a few years ago
21:39oskarthI see
21:39TimMc(def do 5) user/do ;; => 5
21:39brainproxyi tried starting from scratch and writing a more advanced versino of the library using coffeescript
21:39brainproxybut got stuck... and then got diverted to clojure/clojurescript
21:40oskarthwhere did you get stuck? do you know what makes it hard to port lamina to cljs?
21:40amalloyTimMc: works fine as a value
21:40brainproxystuck dealing with the inner plumbing given my lofty goals
21:40brainproxyas for porting lamina to cljs, I'm not sure
21:40Sgeohttp://ideone.com/IOMCVY
21:41TimMcSgeo: http://ideone.com/yTsNSS
21:42brainproxyamalloy: he uses it in this test
21:42brainproxyhttps://github.com/jduey/protocol-monads/blob/master/test/monads/test/core.clj#L255
21:42amalloyyeah, m/do will work fine. i just assumed users would try to (do ...), which will break unexpectedly
21:43ivanis there a working data binding thing anywhere that captures the operations/diffs?
21:43TimMcI wonder if the compiler should treat foo/do as do.
21:43ivanlooks like C2 has something
21:44amalloyTimMc: i wonder what `(do foo) will read as, in a namespace with do use/refer/defined
21:44hiredmanthere is a todo in the wiki about namespacing special forms like do
21:44SgeoWhy would anyone ever write (vec [1 2 3])
21:44hiredmanthey currently are not
21:44gfredericksSgeo: no reason I know of
21:44amalloySgeo: temporary insanity
21:44amalloywell
21:44amalloy#(vec [1 2 %]) is something i could imagine seeing
21:45amalloy(in that case the reason would be laziness/rudeness)
21:45gfredericksbeing slightly shorter than #(vector 1 2 %)?
21:45gfredericksnot to mention (partial vector 1 2)
21:45amalloywell, also the people who try to make every lambda a #() form typically don't know about the function vector
21:46TimMc(fn [x] [1 2 x])
21:46TimMcHmm, a little longer.
21:47brainproxySgeo: can you comment further on the point you made about dispatch?
21:48SgeoThere 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:49SgeoIf there's a second way to use lists as monadic values, I can't use that too.
21:49gfredericksTimMc: #(do[1 2 %])
21:49SgeoI can only have one monad that uses lists as monadic values defined.
21:49amalloyisn't that true of haskell too?
21:49amalloyit's just less upsetting, because it's easy/normal to make up new data types in haskell
21:50gfredericksTimMc: oh oh oh #(do[1 2%]) even
21:50Sgeohmmm..... actually, yes.
21:50SgeoMy bad
21:51SgeoAlthough actually....
21:51SgeoYou 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:52SgeoOr.. I don't know how extreme it goes in Haskell v Clojure
21:52brainproxySgeo: couldn't you just use deftype (or maybe defrecord) and then implement the variant monads on those derived types?
21:52amalloyof course, brainproxy. which is what you have to do in haskell too
21:52brainproxyif you use extend-type, then sure, I think you could only do one per file
21:53SgeoThe context in which I saw (vec [1 2 3]) was
21:54Sgeo(doseq [v (vec [1 2 3])] ... )
21:54ChongLican you dispatch on the return type?
21:54ChongLilike the way haskell does for return :: a -> m a
21:55ChongLidoesn't seem like you can
21:55arrdemChongLi: you can..
21:55arrdemusing multimethods
21:55ChongLihow is the return type determined?
21:56amalloyyou can't
21:56amalloySgeo: best to treat that as some kind of performance art
21:57ChongLiI guess you need static typing to do it?
21:57amalloyyes
21:58ChongLiI wonder if Ambrose's static type checker would work for this
21:58ChongLiI should read this paper
21:59amalloyit's a type-checker, not a recompiler :P
21:59gfrederickswell that would involve the type annotations effecting the semantics of the code
21:59gfrederickswhich sounds out of scope for a type checker
21:59gfredericksand I can't think of any way you could make that work using the existing dispatch mechanisms in clojure
21:59Sgeoamalloy, this is the same person who did not understand doseq vs for
21:59ChongLioh yeah, good point
22:00SgeoNow offering an online class on Clojure
22:00amalloywho is?
22:00Sgeohttp://www.reddit.com/r/Clojure/comments/122ll8/free_clojure_course/
22:00friothe clojure vs. haskell decision tears me up
22:00ChongLithat's one area where haskell is really cool
22:00frioon the one hand, i love haskell's static typing, monadic control etc.
22:00frioon the other hand, everything in clojure feels so new, and easy to use
22:00frioclj-http is beautiful
22:00ChongLiyeah I feel the exact same way
22:01SgeoHow important are macros to you
22:01ChongLihaskell is a great language but a lot of its standard prelude doesn't make use of it
22:01SgeoYou can do macros with Template Haskell, but it's not as nice as in Clojure
22:01ChongLitoo many concrete lists
22:01frioi try to avoid template haskell; it makes my recompiles painfully slow
22:02ChongLiyeah, you just can't beat lisp macros
22:02friomacros were never important to me, until i started using them. now, they're useful, but not something i can't do without
22:02duck1123I tried to learn haskell, but I have a strong aversion to languages with significant whitespace
22:02friohaha duck1123
22:02friomy background is python, so that's less of a concern for me :)
22:02amalloyduck1123: i do too, but it's a silly complaint. if either of us were serious about learning haskell we'd get over it
22:02gfredericksduck1123: I don't mind the whitespace as much as all the invisible precedence
22:02ChongLiyou can use braces and semicolons if you want
22:03frio(and java, but the only reason whitespace is significant there is the amount of pain it inflicts on me when people ignore it)
22:03ChongLia lot of stuff is pretty annoying though
22:03SgeoI imagine any Lisp is unreadable when people don't indent correctly
22:03brainproxythank goodness for paredit :D
22:04arrdemgg=g
22:04arrdem*gg=G
22:04ChongLisome stuff that makes haskell look quite bad is zip zip3 zip4 zip5 zip6
22:04ChongLi:(
22:04frioi have a laundry list now of things the "perfect language" (and runtime) would provide me
22:04ChongLiand the corresponding zipWith versions
22:04brainproxySgeo: spent any time with the Clean language?
22:04amalloySgeo: 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:04ChongLiclojure's map is so much cooler
22:05duck1123frio: How many can't you acomplish with Clojure?
22:05Sgeobrainproxy, not really, no :/
22:05arrdem(inc duck1123)
22:05lazybot⇒ 4
22:05frioduck1123: enforced static typing, enforced functional purity are the big two for me (i'm a software paranoid)
22:05brainproxySgeo: okay, just wondered; I started looking at it the other night, claims to be popular in academic circles
22:05SgeoNot needing to leave the REPL
22:06frioim hoping more work goes into clojure-on-OSGi too; the more we can steal from erlang, the better
22:06ChongLiunsafePerformIO
22:06frio(erlang the platform/BEAM, anyway; not so much erlang the language)
22:07duck1123As an update from last night. My app now has pretty little graphs for some of the events that happen via statsd/graphite
22:07arrdemI 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:08amalloysounds like static typing, bro
22:08arrdemamalloy: yes, w/o the runtime enforcement
22:08frioarrdem: it's a tough call, for sure; i still think we're a long way from peak-type-system
22:08amalloyno such thing as runtime enforcement for static typing. that's the point
22:09arrdems/runtime/compile time/g
22:09duck1123how hard would it be to get flymake to identify functions that would cause reflection?
22:09arrdemit's all bits at the end of thd day
22:10ChongLihmmm
22:10arrdemmy 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:10arrdem /embedded in the editing env.
22:11arrdemI mean.. how much type insensitive code do most of us write in a day?
22:11arrdemalmos all of it has assumptions, so making those more visible would be nice
22:11gfredericksI don't think most of those assumptions are reified in the compiler at the moment
22:12gfredericksjust types for interop would be my guess
22:12friowhat 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:12arrdemfrio: macros... map based functions... sequence manipulation without regards to the type of the elements etc.
22:13friobut, yes, i absolutely agree that much better type inference engines would help in a big way
22:14ChongLithe more complex your type system gets, the greater the cognitive load involved in understanding your code
22:14friobut 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:14Sgeo,(#{:a} :b)
22:14clojurebotnil
22:14frioa strong+static type system helps to stop you from doing dumb things
22:15ChongLi and of course, if your type system is too simple it may prevent you from expressing your program in a specific way
22:15ChongLiI see a lot of people screwing around wishing they had dependent types in haskell
22:16ChongLithough that would bring its own problems
22:16frioyeah ChongLi, dependent types would be nice
22:16frioand yes, it does :)
22:16frioshrug. computer science is still a very very young science, and we're a long way from getting this stuff right
22:16arrdemThe 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:17frioyeah arrdem. that sounds like having a much stronger type inference system, which would be absolutely awesome :)
22:17arrdemI like that for the most part Clojure and Python silently do the right thing
22:17frioi 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:21uroborus_labsibdknox: When using jayq, how can you pass clojurescript functions to bind?
22:23amalloyaren't clojurescript functions just javascript functions?
22:25uroborus_labsYeah, I think I am running into an unrelated issue that I assumed was the problem
22:25uroborus_labsParticularly, not exactly knowing what I am doing yet ;)
22:46amalloythat's probably the most common cause of software defects
22:46amalloy"dear diary, today i added another bug because, while i don't realize it, i didn't know what i was doing"
22:47ynnivit's sort of amazing that any useful software ever gets written
22:47mont453,(+ 1 2)
22:47clojurebot3
22:47mont453Nice
22:48xeqiproofs are hard
22:49brehautlets go shopping
22:49TimMc*shipping
22:49xeqilets go monkey patching
22:49SgeoThere's Typed Clojure, paper released recently
22:50xeqithough shipping does have a nice ring at the end
22:52brehauti tried to write a set monad implementation in haskell once, without the internet handy. brain asplode
22:53brehautim not smart enough for a real static language
22:53amalloybrehaut: it would basically just be like List, but use sets?
22:53brehautamalloy: yeah, thats what i thought
22:53brehauti couldnt appease the typechecker though
22:54brehautsoemthing about ord
22:54amalloyhuh. doesn't sound that hard, but maybe "conj" needs ord for sets?
22:54brehautmaybe? its entirely possible that im a dimwit
22:56amalloyData.Set unions :: Ord a => [Set a] -> Set a is the only thing that jumps out at me
22:56amalloybut i dunno how to use haskell so help yourself to a grain of salt
22:56brehautheh
22:57amalloyah! you can't have a Set a be a Monad a, because you can't infer Ord from Monad
22:57brehautamalloy: i googled and found this http://www.randomhacks.net/articles/2007/03/15/data-set-monad-haskell-macros
22:57amalloyso the signature for bind will be wrong
22:57brehautyeah
22:57amalloyi worked it out though! don't take away from my ebullience with a link
22:57brehautwell done. i couldnt
22:58brehauti just threw my hands in the air and ragequit
22:58amalloyyeah. haskell just needs a Hashable typeclass so all the dang collections don't have to be sorted
22:58amalloy(i'm aware there is one, but it's in some weird library and seems little-used)
22:59brehautthe 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:00brehautone of split or join on strings is surprisingly hard to fathom using the prelude string type (the list of chars type)
23:01amalloythe implementation of it, you mean?
23:02brehautwhat to use to do it
23:02brehautagain, i might just be a muppet
23:02amalloyno worries. i can't tell, cause i can't understand your complaint
23:03amalloyso your reputation is safe
23:04brehauti think i wanted to do (.split "abc,de,f,g,hij" ",")
23:05brehautim pretty sure that function is inexplicably absent
23:10amalloybrehaut: 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:10brehautits not just you
23:12amalloyhoogle is the one tool the haskell community has that we lack (aside from a type-checker). how can it be rubbish?
23:12brehautha
23:13brehautthey also have monad towers that looks like jenga games that they call web frameworks
23:13amalloyso i've heard
23:14amalloyone of these days i should go back to RWH with an understanding of monads
23:14amalloylast time i just gave up at about chapter twelve
23:14brehautprobably wouldnt hurt
23:14amalloy"he's run out of things to say that make any sense to me"
23:14brehauti cant remember where i gave up
23:14brehauti think 18 did my head in
23:15brehautchapter 16 was wonderfully enlightening
23:15TimMcbrehaut: "i did 18 in my head" <-- how I read that at first
23:16brehauthaha
23:16brehautonly oleg does that
23:16brehautThe 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:18SgeoPlease tell me that Typed Clojure does not use clojure.walk/macroexpand-all
23:18amalloySgeo: please read the paper yourself
23:19amalloyor tell ambrose you're worried he's an idiot
23:19amalloy(i have no idea what his macroexpansion plan is)
23:21dnolenSgeo: it uses the Clojure analyzer which does fully macroexpand, it's not clear to me how else it should work.
23:22amalloydnolen: he's objecting specifically to macroexpand-all, which is awful and broken
23:23amalloy(from clojure.walk)
23:30ynniveven broken optional typing is useful, as long as it only produces false positive warnings
23:30ynnivnot sure this is the case, but that's my humble opinion
23:32amalloyhttp://en.wikipedia.org/wiki/False_positive_paradox
23:33bfabrycan 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:33ynnivI can manually check a false positive. not so with a false negative
23:34amalloyso? if only 0.1% of your code has type errors, and 5% of it gets flagged, the typechecker is not helping you
23:34ynniv80% of statistics are made up
23:35ynnivI agree to your point, but if the false positive rate is constant, I can verify and diff from commit to commit
23:35ynniv"is this new false positive important"?
23:35ynniverr, "is this new positive false"?
23:36ynnivin optional type systems (and linting systems), it's okay to be false positive, but not false negative
23:37bfabryalternatively, is there any way to get nrepl to reload files that are aot compiled?
23:38ynnivbfabry: i just learned of lein-pedantic
23:38ynnivit might reveal an unexpected higher priority dependency
23:38ynniv[lein-pedantic "0.0.5"]
23:39amalloynrepl runs in the lein classloader, not yours. so your dependency version is probably irrelevant
23:39amalloythough i may be confusing some of lein's details with some of cake's
23:39ynnivamalloy: https://github.com/clojure/tools.nrepl "Installation" suggests otherwise
23:40ynnivnot saying that you're wrong
23:40bfabryynniv: 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:41ynnivdoesn't hurt to try, but your problem does not sound like the one I fixed with lein-pedantic
23:42bfabryso.. is there any way to get lein to run the old repl if I can't get nrepl to reload anything?
23:44amalloylein trampoline repl might do it
23:44amalloybut in general AOTed classes don't get reloaded afaik
23:45bfabryamalloy: which makes perfect sense.. except when you're trying to do development on aot'd classes :)
23:48Sgeoynniv, want a type-checker that gives only false positives?
23:48Sgeo(constantly "This form has a type error!")
23:48ynnivnot "only"… I'm just more concerned about false negatives than false positives
23:49ynnivI can ignore false positives
23:49SgeoToo many false positives makes your type checker useless
23:49ynnivseriously… what's with taking this to the extreme?
23:49SgeoWith my little type checker, how do you find only the interesting positives
23:49ynnivi said that positives are less bad than negatives
23:49ynnivpractically, you have a source base that
23:50ynnivthat's mostly working. you run the type checker and get errors
23:50xeqiynniv: out of curiousity, where did you hear of lein-pedantic from?
23:50ynnivthen an intern adds a bunch of features. you run the type checker, and discard what was previously flagged
23:50ynnivnow you have interesting data on what the intern might have broken
23:51Sgeoynniv, the intern might have broken something in a way that's not statically checked.
23:51ynniverm… someone well known in #clojure. i could check the logs...
23:51ynnivabsolutely true, but that's already a problem
23:51xeqiah, thats good enough
23:51ynnivanything better than the status quo is in fact better
23:54ynnivSgeo: see http://www.altdevblogaday.com/2011/12/24/static-code-analysis/
23:58SgeoSomething like Strongtalk, although I haven't seen Strongtalk in action.
23:59eggheadSgeo: have you looked at dart?