#clojure logs

2015-01-13

01:06koreth_Is there no way to get a browser REPL unless you first launch the HTTP server from a (non-browser) REPL and then reload the web page? Seems like the Piggieback code doesn't play nice with the concept of connecting a brand-new REPL to a running browser application (session management depends on a lot of dynamic vars that aren't bound in a fresh REPL session).
01:07koreth_If there's a ClojureScript equivalent to programmatically starting an nREPL server, I'd love a pointer to it.
04:11dysfunare there any sparse vector implementations for clojure? preferably ones backed by maps?
04:11SagiCZ1dysfun: maybe check out incanter?
04:12dysfunugh. server app. i really don't want to embed encanter
04:27cflemingkoreth_: Unfortunately all of the existing CLJS REPLs work by making an outbound connection from the browser, since that's pretty much all you can do from JS
04:28cflemingkoreth_: There's no way to listen on a port in the browser. Chrome doesn't even let you do it from extensions.
04:29cflemingdysfun: Perhaps mikera's libs have something? vectorz etc. IIRC a sparse matrix fix went in recently, but I don't know if that included sparse vectors.
04:30hellofunkwhy is it that Cider jack-in sometimes takes me to a user prompt initially, while other times, it takes me directly into the namespace declared at the top of the file on which i called jack-in, having automatically compiled the file upon jack-in?
04:31cflemingdysfun: https://groups.google.com/d/topic/clojure/LLpq4WHx-k8/discussion "It isn't just matrices - you can have sparse vectors, N-dimensional arrays etc."
04:41dysfunwheee!
04:41dysfunthanks
04:42sm0ke,(not (Boolean. "false"))
04:43clojurebotfalse
04:43sm0kehttp://dev.clojure.org/jira/browse/CLJ-1640
04:44sm0kewas this reported before?
04:46dysfunthat's not a bug
04:46dysfunstrings are truthy values
04:46sm0ke,(class (Boolean "false"))
04:46clojurebot#<CompilerException java.lang.RuntimeException: Expecting var, but Boolean is mapped to class java.lang.Boolean, compiling:(NO_SOURCE_PATH:0:0)>
04:46sm0ke,(class (Boolean. "false"))
04:46clojurebotjava.lang.Boolean
04:46scottjsm0ke: pretty sure it's known and not won't fix. you're supposed to use Boolean/FALSE
04:46sm0ke,(Boolean. "false")
04:46clojurebotfalse
04:46scottjs/not//
04:47sm0ke,(= (Boolean. "false") Boolean/FALSE)
04:47clojurebottrue
04:47sm0kewtf right?
04:47dysfunyeah that is a bit wtf
04:48sm0keand funny part
04:48sm0ke,(source if)
04:48clojurebotSource not found\n
04:48sm0ke,(source not)
04:48clojurebotSource not found\n
04:48scottjsm0ke: " Note that if does not test for arbitrary values of java.lang.Boolean, only the singular value false (Java's Boolean.FALSE), so if you are creating your own boxed Booleans make sure to use Boolean/valueOf and not the Boolean constructors." from http://clojure.org/special_forms
04:49sm0keaah
04:49sm0kebut i dont get it not's source is (not [x] (if x false true))
04:50sm0ke,(if (Boolean. "false") false true)
04:50clojurebotfalse
04:50sm0ke,(if (not (Boolean. "false")) false true)
04:50clojurebottrue
04:50sm0ke^^
04:50scottjread what I quoted and see the page how it's documenting if
04:51sm0keyea i read that
04:51sm0kebut it always works correctly for `if` and fails for `not`
04:52sm0ke,(doseq [i (range 1000)] (assert (if (not (Boolean. "false")) false true)))
04:52clojurebotnil
04:53sm0ke,(doseq [i (range 1000)] (assert (not (Boolean. "false"))))
04:53clojurebot#<AssertionError java.lang.AssertionError: Assert failed: (not (Boolean. "false"))>
04:55sm0keugh i did a not in if conition
04:55sm0ke,(if (Boolean. "false") false true)
04:55clojurebotfalse
04:55sm0kemakes sense
04:56scottjsm0ke: you understand why (not (Boolean. "false")) is false right?
04:56sm0keyeah
04:56sm0kebut thats really nasty
04:57scottj,(doc not)
04:57clojurebot"([x]); Returns true if x is logical false, false otherwise."
04:57cflemingBronsa: ping
04:58sm0kescottj: isnt (Boolean. "false") logically false?
04:58scottjno, it's true
04:58sm0kescottj: i think the doc of the function should mention this
04:58sm0ke,(Boolean. "false")
04:58clojurebotfalse
04:59luxbockI'm trying to simulate function argument destructuring
04:59luxbockhttps://gist.github.com/luxbock/626e8d6192491564c6bf
04:59sm0ke,(= true (Boolean. "false"))
04:59clojurebotfalse
04:59sm0ke,(= false (Boolean. "false"))
04:59clojurebottrue
04:59CookedGryphondoes anyone know if I can match something like [map* {:foo int}] (vector of maps ending in a map containing :foo int) in miner.herbert? Or does it not work like that? At the moment I'm using a combo of herbert and seqexp
04:59luxbockthis works, but I was wondering if anyone can think of a better way to achieve this
04:59sm0kewhat are you talking about
05:00CmdrDats,(not (Boolean/valueOf "false"))
05:00clojurebottrue
05:03sm0ke,(let [a (Boolean. "false")] (when a (print 1)) (when (not a) (print 2)))
05:03clojurebot1
05:03scottjsm0ke: "if" only checks for nil or false, and that's the false from Boolean/false or false not (Boolean. "foo").
05:03scottjsm0ke: and "not" is defined in terms of "if"
05:04scottjsm0ke: that this is confusing I don't know if anyone will argue with you. I'd guess there are good performance reasons for doing it. Just don't use the Boolean constructor.
05:04scottjuse Boolean/FALSE or Boolean/valueOf
05:05sm0ke+1
05:06sm0keLets make a point on this
05:06sm0keand mention it to other java devs too
05:07hyPiRionLet's fork Clojure and make boolean constructors throw an UnsupportedOperationException or something.
05:07hyPiRion(through reflection)
05:07foofoobarHi. A few question to this clojure irc bot: http://hastebin.com/xizokerura.clj — Line15: Why is doto used here? Is a simple (Thread. #(conn-handler conn)) .start) also possible or is doto the only way to call methods of java classes?
05:08sm0kehyPiRion: awesome idea bro
05:11sm0kecan be done through proxies
05:12sm0kehttp://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Proxy.html
05:12scottjfoofoobar: your code looks fine. doto may be his preferred method or maybe he used to do more more things with the thread or wanted it as a return value and then changed the code but didn't change the doto
05:12sm0keit would help catch if some library is using a boolean constructor and kill it before it gets out of hand
05:13scottjfoofoobar: oh I didn't read your code. yours should be (.start (Thread. #(...))) no?
05:14foofoobarIt works the way it is now. Give me a second, then I try your way.
05:14scottjfoofoobar: to have the .start at the end like you have it you would need to use ->
05:14scottj(-> (Thread. #(...)) .start)
05:15scottjfoofoobar: (.start ...) is the most common form I believe
05:15foofoobarscottj: Yeah this works, the doto is not needed here.
05:16foofoobar(Thread. #(conn-handler conn)) — the #(..) here is used so it’s a closure, right? So the conn-handler is not executed, instead the Thread does execute this function, correct?
05:17scottjyep
05:17sm0kehttps://stackoverflow.com/questions/18676956/boolean-false-in-clojure
05:17scottjfoofoobar: are you reading a book or tutorial on clojure?
05:18foofoobarscottj: Yes, I’m reading a guide and testing the things I have read with an irc bot. (I’m trying to understand the irc bot)
05:18foofoobarlet .. conn (ref {:in in :out out})] — the ref makes conn atomic so it can be access from different threads, correct?
05:20opqdonutfoofoobar: something like that, yes
05:20foofoobarok.
05:20foofoobarSo what happens if the connection drops?
05:20opqdonutto be more precise, the ref is something that can safely be _mutated_ from different threads
05:20foofoobar(Instead of the irc server sending the „closing link“ ?
05:21opqdonutand actually, many refs can be mutated transactionally
05:21opqdonutI have no idea about the concrete code you're looking at
05:21clgvsm0ke: in case no one mentioned it -> "never construct booleans yourself! parse them via valueOf or read-string"
05:22opqdonutfoofoobar: but it looks like something like line 20 would just throw an exception
05:23sm0keclgv: the doc mentioned it
05:23opqdonutfoofoobar: or if the conn-handler thread has noticed the exit (see line 28), it will add an ":exit true" to the conn map
05:23sm0ke:D
05:23foofoobaropqdonut: okay. maybe I will test what happens when I disable WLAN while beeing connected
05:23foofoobaropqdonut: Yeah but when the connection drops, it will not notice
05:24sm0keso in clojure values can be true, false and 'i dont know' ?
05:25sm0kei am not trying to be pedantic about bools here, but using Boolean constructor can be true/false
05:26opqdonutsm0ke: in clojure a value can be true, false, nil, :borg, {:hello "there"}, (Object.), ...
05:26opqdonutsm0ke: in terms of booleannes though, they can be truthy or falsy
05:26opqdonutsm0ke: where truthy and falsy are defined by what (if val 1 2) returns
05:27sm0keopqdonut: all those are logically true except nil and false
05:27opqdonutbut yeah, java Boolean objects are just horrible
05:27sm0keopqdonut: but you can say that about a Boolean
05:27sm0keopqdonut: ok agreed
05:27sm0kebut it effects clojure
05:28opqdonutonly if you let it :)
05:28sm0keto a extend where you cant say values can be truthly or falsely
05:28sm0kethey can be 'god_knowsly' too
05:28CmdrDatssmoke: it's a design decision, consciously taken and documented, why belabour the point?
05:29clgvsm0ke: no, the JVM is to blame here
05:29sm0keguys please i am not blaming clojure here
05:29opqdonutsm0ke: in clojure's eyes, values are either truthy or falsy
05:29sm0kei agree Boolean with arbit argument constructor is horrible
05:29clgvsm0ke: two static constants for true and false instead of the public constructor would have been a better choice
05:29opqdonutbecause (if val 1 2) always returns 1 or 2
05:30opqdonutthere is no third alternative
05:30sm0keclgv: ##(not (Boolean. false))
05:30lazybot⇒ false
05:30cflemingLooks like 2 to me
05:30sm0kecfleming: lol
05:31cflemingThere are warnings in at least one of the Clojure books (JoC, I think) about using the Boolean constructor
05:32cflemingBoolean/TRUE
05:32cfleming,Boolean/TRUE
05:32sm0kehttp://grokbase.com/t/gg/clojure/1247108a4b/boolean#20120413qoo2wt5qscaqp5vv6sde4wav6y
05:32clojurebottrue
05:32sm0ke^^ Rich's thought on this
05:32cfleming,(not Boolean/FALSE)
05:32clojurebottrue
05:33sm0kewell at least the doc doesnt say "Note: It is rarely appropriate to use this constructor." anymore
05:33sm0ke:P
05:33sm0keoh it still does
05:33cflemingI'd say that's an accurate statement
05:33sm0kewell that settles it then
05:36sm0kebut if you see the whole thread it caused a problem due to Boolean constructor being used in a library
05:38sm0keits just strange, Doesnt clojure's if uses Java's if?
05:41opqdonutlet's see
05:44sm0kealso if you could point me to the equality special form code
05:44sm0ke,(= (Boolean. false) false (Boolean. "false"))
05:44clojurebottrue
05:45sm0kei would like to see why if doesnt borrows some wit from =
05:46kyrreHow can I call functions listed in a edn file?
05:46sm0keoh = is just a function
05:46hyPiRion,(identical? true (Boolean. true))
05:46clojurebotfalse
05:46sm0kekyrre: edn supports functions?
05:46hyPiRionthere's your answer
05:46sm0kei think it only supports data
05:47cfleming,(identical? true Boolean/TRUE)
05:47clojurebottrue
05:48cflemingsm0ke: Clojure doesn't compile to Java, so you can't really say whether it uses Java's if - it probably compiles to similar bytecode. For truthy/falsy tests it uses RT.booleanCast IIRC
05:49opqdonuthttps://github.com/clojure/clojure/blob/9f277c80258b3d2951128ce26a07c30ad0b47af0/src/jvm/clojure/lang/Compiler.java#L2688
05:50opqdonutthat shows the compiler generating a comparison to Boolean/FALSE
05:51lxsameerhey guys, what books do you recommend for to learn Clojure ? ( I'm a ruby/python user )
05:51sm0keweird
05:51cflemingtrue and false in Clojure are Boolean/TRUE and Boolean/FALSE, respectively, always
05:52sm0ke,(= (Boolean. false) false (Boolean. "false") Boolean/FALSE nil)
05:52scottjlxsameer: clojurebook.com is the most frequently recommended.
05:52clojurebotfalse
05:52sm0ke,(= (Boolean. false) false (Boolean. "false") Boolean/FALSE)
05:52clojurebottrue
05:53lxsameerthanks
05:54sm0kehyPiRion: thats just comparing refs
05:54sm0keit will never be equal with a constructor
05:54sm0ketrue and Boolean/TRUE are idential because they probably would be interned
05:55sm0kewell at least clojure's = is java's =
05:55sm0kehttps://github.com/clojure/clojure/blob/9f277c80258b3d2951128ce26a07c30ad0b47af0/src/jvm/clojure/lang/Util.java#L24
05:55sm0ke.equals i mean
05:59sm0keonly core dev's can comment on why it doesnt work
06:07hyPiRionsm0ke: exactly. That's why (Boolean. true) is truthy but not true, and why (Boolean. false) is truthy as well
06:07hyPiRionthey're compared against nil and Boolean/{False, True}
06:07hyPiRion*{FALSE, TRUE}
06:47clgvlxsameer: there is also "Programming Clojure" (2nd Edition) which I found useful
06:47lxsameerclgv: thanks
07:18zarkonehello all! I've noticed that there's almost no info in the Internet about configuring Clojure view server for CouchDB. Does somebody use it?
07:26ggherdovHello, I have an algorithm in mind that sounds like this: start with an empty list L, and for each element E in a given collection, concatenate some stuff to L.
07:26ggherdovHow do I express that in clojure? A minimal example in python here: https://bpaste.net/show/444bbe7695e7
07:27clgvggherdov: via `reduce`
07:27ggherdovclgv: right, thanks
07:28clgvggherdov: the pattern might look like: (reduce (fn [coll, x] ....) [] given-coll)
07:28ggherdovclgv: ok trying
07:29clgvggherdov: iterations usally translate to `reduce` or `map`. in special case you might need a custom recursion
07:30ggherdovok
07:32clgvggherdov: you got a book or one of the online courses to get a quick start?
07:32ggherdovclgv: yup, "Clojure Programming" o'reilly
07:33clgvggherdov: that should help you to get started quickly
07:33ggherdovyes, need to study example and get into the mindset
07:33ggherdovs/example/examples
07:39hellofunkggherdov: and if you are looking for quick, free online clojure tutorial that is fairly comprehensive, go to braveclojure.com
07:39ggherdovcool thanks hellofunk
07:42morfeenHey, where can I find problems to solve, which will allow me to think in Clojure? I've been learning the syntax and constructs, but I would become confident only if I can solve some problems for excercise.
07:43hellofunkmorfeen: 4clojure.com
07:43morfeenhellofunk: cool
08:55irctc\?
08:55irctc\help
08:55irctc\name matt
08:55irctc\name = matt
08:55js1forward slash
08:56irctcThanks :-)
09:02arrdem'morning
09:03n0n3suchg'day
09:07js1good morning!
09:48yotsovHello. Is there a way to tell leiningen to :aot :all on the command line (without changing project or global config)?
09:49clgvyotsov: use a profile with that configuration, then you can decide on the commandline when to use that profile
09:49llasramyotsov: if you really need that, you can use `lein update-in`
09:50yotsovllasram: clgv: thank you!
10:05zB0hswhat happened to the core.async docs at https://clojure.github.io/core.async/ ??
10:05lazybotzB0hs: Definitely not.
10:06arrdemzB0hs: I'm gonna guess that something's up with the autodoc system right now
10:07CookedGryphonIt's based off master and so might not correspond to the code you're using anyway, I like to use https://github.com/jaley/cloc
10:07CookedGryphonlein cloc, generates docs from everything it finds in your classpath
10:07CookedGryphonguaranteed to match the version you're using, searchable and everything
10:08H4nsis there a predefined way to send log message to the cider repl rather than to the nrepl server buffer?
10:08zB0hsthanks CookedGryphon ill check that out. for now i was able to find a cached version
10:08arrdemnot gonna lie, Grimoire is converging on being a souped-up version of cloc with a bunch of stuff "in the box"
10:08arrdemH4ns: send a message as in what... print to stdout?
10:09H4nsarrdem: i'm using clojure.tools.logging with log4j2, and i would like to see the logs in the repl, not in the nrepl server buffer.
10:09arrdemH4ns: right. So you need to capture the value of *out* that cider uses somehow.
10:27kaiyinWhat is wrong with this: (#(map #(str "hi, " %) %&) "newton" "plato") ?
10:28arrdemkaiyin: #() doesn't nest.
10:28arrdemkaiyin: those functions are fine, you just can't use the #() reader sugar like that
10:28kaiyinarrdem: ok. I see. Would be nice it does allow nesting.
10:29hipsterslapfighthow would it know what % to use though!
10:29arrdemkaiyin: nice but ambiguous. is %1 in the inner #() a parameter or a closed over parameter?
10:29arrdemI actually dropped #() as a feature in my toy clojure imp'l... it doesn't really buy you anything except reader complexity.
10:29kaiyinarrdem: what is a closed over param?
10:30Glenjamin,(fn [a] (fn [b] (+ a b))) ; try and write that using #()
10:30clojurebot#<sandbox$eval25$fn__26 sandbox$eval25$fn__26@77b9a19a>
10:30arrdemkaiyin: (fn [x] (fn [y] (+ x y 1))) ;; x is closed over or captured in the inner function.
10:30kaiyinarrdem: i see.
10:31kaiyinarrdem: % in the inner #() is closed over then. It's meant to be applied to each element of %&.
10:32arrdemkaiyin: not the meaning of closed over. your inner % is a distinct function argument, meaning the element of %& being mapped over by the outer #().
10:33arrdemkaiyin: (fn [xs] (map (fn [x] (str "Hello, " x)) xs)) is what you tried to write
10:33arrdemkaiyin: (fn [xs] (map (fn [x] (str "Hello, " xs)) xs)) is what you just described to me.
10:34arrdembrb coffee refill
10:34kaiyinok, it's not crossed over. interesting.
10:36kaiyin, ((fn [xs] (map (fn [x] (str "Hello, " xs)) xs)) "newton" "plato")
10:36clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: sandbox/eval53/fn--54>
10:36kaiyinarrdem: it doesn't quite work though.
10:37arrdemOh. that needs to be [& xs]. my bad.
10:37arrdem&((fn [& xs] (map (partial str "Hello, ") xs)) "Newton", "Plato")
10:37lazybot⇒ ("Hello, Newton" "Hello, Plato")
10:38arrdem&((fn [& xs] (map (fn [x] (str "Hello, " x)) xs)) "Newton", "Plato")
10:38lazybot⇒ ("Hello, Newton" "Hello, Plato")
10:38kaiyincool.
10:41kaiyin&&((fn [& xs] (map (partial str "Hello, ") xs)) "Newton", "Plato")
10:41lazybotjava.lang.RuntimeException: Unable to resolve symbol: & in this context
10:41kaiyin&((fn [xs] (map (fn [x] (str "Hello, " x)) xs)) ["newton" "plato"])
10:41lazybot⇒ ("Hello, newton" "Hello, plato")
10:41arrdem=D
10:42ashtonkemMorning.
10:43ashtonkemWhy thank you.
10:43ashtonkemAnd now that you mention it, I do want more coffee.
10:53arrdemis ^:no-wiki supposed to be a documentation convention or just an implementation detail for core's autodoc tool?
10:53arrdemI'm thinking either way I should try and respect it..
10:56ashtonkemI'd just grep for it in the codebase.
10:56ashtonkemAnd see if it's docced or just used.
10:57ashtonkemAlso see if codox cares about it.
10:58ashtonkemhttps://github.com/weavejester/codox/pull/4
10:58ashtonkemRelevant, I think.
10:58arrdemhttp://tomfaulhaber.github.io/autodoc/#adding_documentation_to_your_project
10:58arrdemashtonkem: nice find!
10:58ashtonkemDid you mean skip-wiki?
10:58arrdemyeah.
10:59ashtonkemThanks. It looks like it's just for the official wiki.
10:59arrdemI need to read into codox
10:59ashtonkemAt least that's what weavejester said.
11:04zotbanging my head on this: clojure compiler seems to be referencing a library version that doesn't exist in my repo. i can't figure out where it's coming from, but it's wrong. when i tab-complete in emacs, it also refers to the wrong version, so they're in cahoots. any suggestions on how to track down the source of loaded clojure source jars?
11:04arrdemzot `ein deps :tree`
11:04arrdem*lein
11:05clgvzot: the clojure compiler does not know of dependencies. leiningen does
11:05zoti started there, and it appears to be correct. i also removed the offending incorrect version from my .m2 space, so it's gone from there.
11:05ashtonkemYou sure it wasn't in the tree? A lot of times another dependency will pull in the version you don't want.
11:06zoti unzipped the jarfile of the correct version to confirm that it has the version i expect
11:06zotunless something else is registering under the same clojure-loadable-namespace, i don't see where it could be. the incorrect version isn't being re-downloaded, so it still exists somewhere. i just don't know where. or why it's being loaded.
11:08ashtonkemTry 'lein classpath' and see if any surprises hide in there.
11:08ashtonkemAlso, you aren't using something like nailgun are you?
11:08zotnot familiar with nailgun
11:08zotso, not intentionally :)
11:09ashtonkemIt's not auto-setup by anything to my knowledge, so that's a no.
11:11ashtonkemDid you do a lein clean?
11:11ashtonkemBeyond that it sounds like either a running process has the old code loaded (nailgun would do this I think), or you've got a jar hidden somewhere in a cache.
11:11zotdon't think so. that seems way too easy. ;)
11:12zotyeah, the cache is my suspicion too, but dunno where it lives. hoped that blowing it out of .m2 would be sufficient.
11:12ashtonkemThat's most of it, but if you're doing any AOT or uberjar then stuff can live in target/
11:12zotthat was enough. restarting repls and running lein clean: part of clojure black magic toolkit.
11:12ashtonkemHence my suggestion to lein clean.
11:12zotthanks!
11:12zot(inc ashtonkem)
11:12lazybot⇒ 1
11:12ashtonkemNo problemo.
11:13ashtonkemIt seems every toolchain has a "Fuck it, I'll just clean the whole thing out and see if that clears it" moment.
11:13ashtonkemI can't count the number of times i've "rake assets:clean tmp:clear" and had my issues go away.
11:13arrdemheh
11:14ashtonkemI call it my "I have a hammer!" moment.
11:14zotlol
11:14tcrayford____ashtonkem: yeaaaaha hahaha
11:14tcrayford____fuck a rails assets clean
11:14tcrayford____my favorite part is working on rails projects with designers
11:15ashtonkemThe asset pipeline is my main evidence that the rails designers want to go back to 2008.
11:15zotthat's a better hammer than most, if a little bit kludgy. it's a bit sad that dependencies feels like NP-completeness… ethereal, and never to be reached.
11:15ashtonkemYup. I'm a bit happier with explicit numbers at least.
11:15ashtonkemRanges have always screwed me.
11:16tcrayford____ashtonkem: mind if I quote you in an upcoming yeller post about asset pipelines?
11:16ashtonkemSure thing.
11:16tcrayford____:D
11:16ashtonkemI'm never quiet about my opinions.
11:17ashtonkemOr afraid to have them attributed to me.
11:17tcrayford____also I love that twitter's full text index doesn't include me for some reason: https://twitter.com/search?f=realtime&amp;q=from%3At_crayford%20asset%20pipeline
11:17tcrayford____(I *know* there's a toot there)
11:18arrdemhttp://i.imgur.com/n0Tu73G.gif someone say hammer?
11:19crash_epwhy am I completely unable to find the API doc for core.async
11:19arrdemcrash_ep: autodoc seems to have messed up and deleted it. someone else was asking that earlier and the GH page is definitely devoid of content.
11:19ashtonkemThey're gone!
11:20arrdemhttp://conj.io/store/org.clojure/core.async/0.1.346.0-17112a-alpha
11:20arrdemmay not be up to date but still alive :p
11:20crash_epThankfully there's at least: http://clojuredocs.org/clojure.core.async
11:21ashtonkemIn other news, I'm not really sure why my coworkers go nuts over Go.
11:21puredangerhttp://clojure.github.io/core.async/
11:22ashtonkemThey were talking up a websockets demo in Go that was holding "up to 14k connections"
11:22arrdempuredanger: is that nonblank for you?
11:22puredangeroh, I see what you mean.
11:23ashtonkemYeah, it's a little emptier than most of us remember.
11:23puredangerI was unaware it was not working. will look at it
11:23Bronsahttps://github.com/clojure/core.async/commit/96803979dc1d12bcfa2c7f89e87d00d4ef2154a0
11:24Bronsain the meantime http://crossclj.info/doc/org.clojure/core.async/0.1.346.0-17112a-alpha/index.html is up to date and awesome :P
11:27puredangerlooks like Tom must have updated his autodoc process or something. certainly doesn't seem to be driven by a commit in the project or anything.
11:30puredangerTom's on it
11:34ashtonkemLatest Datomic release looks cool.
11:34ashtonkemI'm a bit worried that all these features might muddle the syntax a bit though.
11:35ashtonkemAlthough all this stuff was super needed.
11:35tcrayford____ooo
11:36ashtonkemI guess prefix operations make it easy to add syntax after the fact, so that's a good lesson.
11:36tcrayford____yeaaaahhhhhhh
11:36tcrayford____"The query engine will make better use of AVET indexes when range predicates are used in the query."
11:36tcrayford____GOOO TEAM
11:37ashtonkemI look forward to 2 things from Datomic.
11:37ashtonkem1) Realistic perf. comparison. (I know it's in the EULA, it'd have to come from cognitect).
11:37ashtonkem2) A Jepsen article on it.
11:37tcrayford____3) pagination
11:37ashtonkemI thought pull did that now.
11:38tcrayford____oh, it can kinda do it, but it's pretty clunky
11:38tcrayford____afaik
11:38ashtonkemLimit to whatever.
11:38ashtonkemThen grab the last and use that as the minimum for the next page.
11:38ashtonkemIt's awkward, but the performance of limit + offset on most databeses is *awful*.
11:39ashtonkemEven on postgres limit + offset is the only way to get good throughput.
11:39tcrayford____yeah
11:39ashtonkemAlthough a "paginate on this attribute" would be nice.
11:40ashtonkemIt reasonably could be a wrapper.
11:40ashtonkemBecause queries compose (hooray!)
11:41crash_epany core.async gurus? I am having difficulty structuring a pipeline…
11:41ashtonkemIn other news, I'm taking my "let's test Ruby in Clojure" thing to the Ruby Rogues podcast.
11:41hyPiRionashtonkem: Yeah, 1) is a bit of a bummer. Without any perf. comparisons I can't argue to use it for work.
11:42ashtonkemYeah.
11:42ashtonkemI think the easiest sell would be it after you buy into the Clojure way of doing things.
11:42ashtonkemIt's a pretty bad impedence mismatch if you're used to mutability.
11:43ashtonkemBut I really want to hear about switch over wins.
11:43andyfBronsa: Minor question: what was motivation to add \xHH syntax for chars in tools.reader? Is that used in ClojureScript, perhaps?
11:43ashtonkemI think the profession is hungering for more throughput and predictability than RoR + MySQL can give. But it's just so hard to do an apples to apples comparison.
11:43hyPiRiontrue
11:44ashtonkemAnd nobody wants to admit their secret sauce.
11:44Bronsaandyf: no, I just added it back when it wasn't yet tools.reader and forgot about it
11:46andyfJust noticed it while looking for differences between t.r and Clojure, and it seemed one of the odder differences.
11:50csd_Is there any way to create a hash-map whose keys are byte-maps?
11:51ashtonkemHave you tried the hash-map function instead of reader literals?
11:52csd_ashtonkem: i can create the map OK, but byte-map equality requires using Arrays/equals rather than just =
11:52csd_so i can't access the map's values
11:52ashtonkemAh.
11:53andyfcsd_: Standard precautionary note: be careful not to mutate keys in a map, or elements of a set, or you won't be able to access them
11:53ashtonkemThen the answer is probably no then.
11:53ashtonkemYou'd have to wrap them in something that works well with =
11:53csd_andyf: good to know thanks
11:54csd_i'll just store as a vector
11:55andyfcsd_: Clojure has immutable byte vectors, created by vector-of
11:55andyfVector-of can save memory vs using regular vectors, if you have many of them
11:56csd_oh thats neat
11:56csd_i don't think ill need that but good to know
12:07shinty-six-4Anyone have an updated link to David Nolen's article from http://dosync.posterous.com/lispers-know-the-value-of-everything-and-the ?
12:09shinty-six-4I'm new to clojure and looking for direction on concepts for processing large amounts of data, (eg making a fast prime sieve, Having failed with use of sorted-map for incremental).
12:11ashtonkemHow large is large?
12:12dagda1_anybody know how I update my cider emacs package?
12:12ashtonkemOoh, you using emacs-live?
12:12ashtonkemI've had this issue.
12:13ashtonkemdagda1_: For in memory stuff transducers are the common answer. They're compact and make fork/join easy.
12:14ashtonkemIf it doesn't fit in memory, typically you'll have to reach for mapreduce (and a wrapper like cascalog), storm, or similar.
12:14ashtonkemPlus make sure that you aren't using boxed math. That really eats up the throughput.
12:17shinty-six-4ashtonkem: let's say, primes below 1 million. So for an incremental sieve, I think there would be 1 million candidates. I was trying to do something like the incremental sieve referenced http://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf, using sorted-map to maintain upcoming composites.
12:18shinty-six-4ashtonkem: thank you for the direction. I would not have gone first to transducers as I knew they were relatively new. I'll read up on them.
12:18ashtonkemSorted map as in a sorted hashmaps?
12:18ashtonkemThose'll get pretty expensive without mutability.
12:19ashtonkemI think you'll want to think of it as a lazy stream of primes.
12:19ashtonkemWith a memoized helper.
12:19ashtonkemAs a general rule transducers are more compact that regular map and filter.
12:19ashtonkemBecause they produce no intermediate collections.
12:19TimMcshinty-six-4: http://web.archive.org/web/20130511051357/http://dosync.posterous.com/lispers-know-the-value-of-everything-and-the and go donate to archive.org :-P
12:19ashtonkemHence why they fork/join well.
12:21chouserClojure's sorted-map is a red/black tree, not a hashmap, fwiw.
12:21shinty-six-4ashtonkem: ah. As someone new to fp in general, I know mutability is a watchword, so still working out when to embrace it. Thanks for the tips.
12:21chouserSo, binary tree instead of 32-way trie.
12:22ashtonkemIn general mutability is a mixed bag.
12:22shinty-six-4TimMc: thanks. And chouser: thanks. I was seeing 'PersistentTreeMap' in stack traces.
12:22ashtonkemIt'll always be faster and more compact in a flat line.
12:22ashtonkemBut it's less safe, and eliminates interesting optimizations available without it.
12:22ashtonkemGenerally speaking mutability is fine inside one function.
12:23ashtonkemIf it accepts and returns immuteable objects and uses some muteability inside to make things faster, who cares?
12:23ashtonkemIt's when you start passing mutable objects around that the pain starts.
12:24chouserright. Or closing over them, or storing them in refs, etc.
12:24shinty-six-4good points. very helpful.
12:24ashtonkemSo you'll see them used locally in core.async IIRC.
12:25ashtonkemBecause some algorithms are painful without it, and if accessibility is limited atoms are too slow.
12:30thorwilhi! it has been a while since i last worked with clojure. where does leiningen put dependencies? if nothing shows up below "classes", is that an issue with my setup?
12:31ashtonkemThe m2 directory is where it drops its jars.
12:31ashtonkemJust like maven.
12:31andyf$HOME/.m2 in case Maven is not familiar to you
12:31thorwilty. so i see everything expected is right there
12:32patrkrishi folks. is there a protocol I can implement, such that I can use my own type as the dp-spec parameter for clojure.java.jdbc/query and friends?
12:32ashtonkemYeah. In general it'll start littering the classes dir when you start AOTing things.
12:32ashtonkemBut that's more of a prod time concern.
12:32ashtonkemIf it's working ATM I wouldn't worry.
12:32thorwilnot quite working ...
12:33ashtonkemWell, what's the issue then?
12:33thorwili'm trying to play with quil. i get a compiler exception when defsketch comes up
12:34thorwilwith either the example on he quil github, or the one in the template
12:34ashtonkemPut the trace in a pastebin?
12:37thorwilhmm, interesting behavior of that buffer
12:37thorwilhttps://www.refheap.com/96061
12:41dysfunhow will stm transactions behave around a clojure.core.cache?
12:41ashtonkemHuh, I really can't figure out what's going on there thorwil.
12:42ashtonkemPerhaps I'd recommend opening a bug on the quil github project?
12:43thorwilashtonkem: thanks for having a look. sure, i will open a bug ... if a bit further investigation doesn't help
12:50clgvdysfun: as usual
12:53clgvdysfun: the caches in core.cache are persistent datastructures
13:40instilledhi. how can i extract the metadata of a function that was passed as a parameter to another function?
13:41mi6x3m-altinstilled: (meta myfn)
13:43instilledcan i access the var of that function as well (still within the other function)?
13:44mi6x3m-altinstilled: why not just pass the var?
13:44mi6x3m-alt#'myfn
13:45instilledmi6x3m-alt: that works of course. i just wanted to know if there was another way. …i think i'll then go with passing the var as parameter.
13:45instilledmi6x3m-alt: thanks.
13:46mi6x3m-altinstilled: well if you need the var it makes no sense to go through a function and then back
13:46mi6x3m-alt:)
13:46instilledmi6x3m-alt: absolutely.
13:49lodininstilled: I'm curious. Why do you need the var?
13:56instilledlodin: i'm working with prismatic schema, defnk and the like. validating the input-schema is automatic but i would also like to validate outputs and i've passed these as metadata to defnk (placed on the var, not the fn unfortunately)
14:25cesparehas anyone made a ticker for core.async?
14:25cespareimplementing it without timeout is fairly error-prone
14:35nooniancespare: whats wrong with using timeout?
14:38zanesI have two transducer pipelines I want to run in parallel, joining the results at the end. What’s the idiomatic way to do that? Does that even make sense?
14:43arrdemthat makes sense, but note that "in parallel" is abstract. As of right now, transducers are singly threaded.
14:45amalloyarrdem: aren't transducers divorced from considerations like that? a transducer is a method for transforming some input; where that input comes from, how it gets where it's going, how many threads are used, isn't that all handled outside the transducer itself?
14:46arrdemzanes: so looking at Clojure's map transducer I don't see a way to do that, I was thinking of Haskell arrows which transducers approximate.
14:47arrdemamalloy: maybe. I'm confusing myself the more I think about this.
14:54dnolenarrdem: a transducer pipeline is a function, you can use them today with parallel folds
14:54cesparenoonian: as I said, it's error-prone
14:54cesparenoonian: I thought about how to make a ticker with timeout in my program, and it took me a while to write the code, and I still had a bug
14:55cesparewhatevs, I'll write my own ticker
14:55noonianah, I thought you meant without using timeout it is error prone
14:55dnolenzanes: that doesn't seem weird to me so far
14:55arrdemdnolen: sure, but how does that interact with stateful transducers like partition? that's what I'm not persuading myself of.
14:55cesparenoonian: oops, I meant implementing it *with* timeout
14:55dnolenarrdem: don't use stateful transducers in your pipeline - this is not a real problem
14:57zanesThe way I’m doing it right now is by having two transducer’d channels, one for each pipeline. One goroutine feeds both of the channels from the source, and another joins them at the end.
14:57zanesDoes that seem like the right way to approach the problem?
15:01justin_smithcespare: OK, timeout + a pub channel, send a "tick" message after each timeout, then loop
15:01justin_smithcespare: or am I missing something here?
15:06cesparejustin_smith: nope, that's pretty much it. Unless you care about not skewing, but I don't
15:07cesparejustin_smith: just have to do a non-blocking send to avoid getting slowed up by a slow/nonexistent receiver
15:08justin_smithcespare: well for skewing you would just calculate the timeout based on an absolute time, rather than an absolute timeout
15:23dnolenzanes: not sure about one go routine feeding both channels depending on the size of the work
15:24dnolenzanes: perhaps examining how clojure.core.async/pipeline works for some ideas
15:24dnolens/perhaps/perhaps worth
15:24zanesWill do. Thanks!
15:27[blake|So, I've noticed that my compojure app, when it starts running, immediately goes to the 404 path. Which was weird, but whatever.
15:27[blake|Now I've noticed that it does the same thing when I "lein ring uberwar" which is...problematic.
15:28[blake|What's going on here? Have I done something to make the 404 happen, or is that just a Compojure thing?
15:28[blake|And why does uberwar cause code to be executed?
15:28weavejes_[blake|: You've done something to make it happen
15:28[blake|weavejes_: Well, that's good news.
15:28weavejes_[blake|: And compiling Clojure code means evaluating the namespace
15:29weavejes_I don't know what you mean by "cause code to be executed", though
15:29weavejes_Or "immediately goes to the 404 path"
15:29weavejes_Are you talking about the browser?
15:29weavejes_Or the root path?
15:30[blake|weavejes_: No. My defroutes has a 404 path... (route/not-found...)...and that code is executed when the namespace is evaluated.
15:30weavejes_[blake|: Well, route/not-found is just a function
15:30weavejes_If you evaluate a function in Clojure, it's arguments are also evaluated.
15:31[blake|Could it be a side-effect of using (def app (-> (handler/site app-routes))"?
15:31[blake|Right, I'm just trying to figure out WHY it's being called.
15:31weavejes_It's just because it's a function. If you make a function call at the root level, it's going to execute when the namespace compiles.
15:32justin_smith[blake|: you could add (print (clojure.string/join "\n" (.getStackTrace (Thread/currentThread)))) to the 404 handler and see what is calling it
15:32weavejes_e.g. (def foo (println "bar")) will print "bar" whenever the namespace is loaded
15:32amalloy[blake|: my first question is, what makes you think the 404 handler is being executed? how do you even know? all it would do most of the time is return something
15:33[blake|justin_smith: Let me try that.
15:33[blake|weavejes_: My defs are all just that app and two empty {} atoms.
15:34weavejes_justin_smith: It sounds as if [blake| has something like (route/not-found (side-effectful-code))
15:34weavejes_[blake|: Is that about right?
15:34[blake|amalloy: Because I noticed it happening earlier.
15:35[blake|weavejes_: Yeah, the app shows a bootstrap navigation bar at the top regardless, so that's called everywhere.
15:35weavejes_[blake|: Wait... let's back up here. What exactly is happening?
15:36[blake|My app is hitting the database when it's being uberwar'ed. Well, it's trying to.
15:36weavejes_[blake|: Okay, so you're detecting a side effect
15:37weavejes_[blake|: And you have something like: (route/not-found (something-that-accesses-the-database)) ?
15:37[blake|Well, stacktrace is not as enlightening as I'd hoped...
15:37[blake|weavejes_: Yeah. The navigation bar looks to the database to populate certain things.
15:37weavejes_[blake|: Well, that's because route/not-found is a function
15:38weavejes_It's not a macro
15:38crash_epIs there a canonical way to detect whether something is a transducer? I'd like to convert a multi-arity function to accept an optional transducer as its first parameter.
15:38arohnercrash_ep: not reliably.
15:39arohnercrash_ep: transducers are fns, but there's not a good way to determine whether an argument fn is a transducer
15:39weavejes_[blake|: You're not delaying the (something-that-accesses-the-database). You're telling Clojure to evaluate when the namespace is compiled.
15:39crash_epHm, that will probably have to suffice. Thanks arohner
15:39[blake|weavejes_: Not deliberately. =P
15:40weavejes_[blake|: If you don't want something to execute immediately, put it in a function
15:40weavejes_[blake|: So (println "foo") would print immediately if evaluated
15:40[blake|weavejes_: Sure.
15:40weavejes_[blake|: And (defn foo (println "foo")) wouldn't
15:40weavejes_route/not-found is just a function
15:40[blake|weavejes_: Right.
15:40weavejes_It doesn't delay evaluating its arguments
15:41weavejes_It supports static values, or another handler function
15:41weavejes_So you could write: (route/not-found (fn [_] (access-the-database))
15:42[blake|weavejes_: OK! So, it's not like an immediate function, it's actually just arguments?
15:42weavejes_If you don't have (access-the-database) inside a function definition, Clojure will run it when it loads the namespace
15:42weavejes_[blake|: Right. It's just a function that takes arguments. Not a macro or any special form.
15:45[blake|weavejes_: OK, thanks. That explains it. I was looking at it as being like the difference between calling a function and putting an immediate function in there, e.g. "map a-fn a-coll" versus "map #(inc %) a-coll".
15:45[blake|(i.e., no difference)
15:45[blake|(inc weavejes_)
15:45weavejes_[blake|: If you wrap it in parentheses, Clojure will evaluate it if it's not in a macro.
15:45lazybot⇒ 1
15:45weavejes_Clojure has a pretty simple evaluation model :)
15:46[blake|heh
15:46weavejes_Function arguments are evaluated. Macro return values are evaluated.
15:46[blake|Yeah. It's my fault for not "getting" Compojure. I've been treating defroutes as black magic.
15:46weavejes_Everything evaluates to itself except symbols and lists
15:46weavejes_[blake|: defroutes is just (def ... (routes ...))
15:47weavejes_[blake|: Like how defn is just (def ... (fn ...))
15:47[blake|weavejes_: Too simple. =P
15:47weavejes_[blake|: routes is just a function that takes many routing functions and combines them into one
15:48[blake|weavejes_: OK, well, I get that now. Sort of. More than I did.
15:48weavejes_[blake|: Literally just: (defn routes [& handlers] (fn [request] (some (fn [h] (h request)) handlers)))
15:49weavejes_[blake|: Basically a route is just a function that takes a request and returns a response or nil if it doesn't match
15:49weavejes_[blake|: "routes" tries out each routing function in order until it finds a non-nil value
15:49weavejes_That's basically it.
15:52[blake|weavejes_: In most cases, I'm just returning text to display.
15:52[blake|weavejes_: But obviously there's some session stuff in there, too, right?
15:52weavejes_[blake|: In Compojure? Nope. That's Ring.
15:52weavejes_[blake|: Compojure just handles routing
15:53weavejes_[blake|: What to execute if you get a certain request.
15:54[blake|weavejes_: Fair 'nuff. I'm still unclear on what's being passed around to whom. But now that I have some more real world experience I'm going back to the docs to (hopefully) fill in the gaps.
16:00justin_smith[blake|: I think what that stack trace should have shown is that the function was being called when the definition was being compiled (for the reasons weavejes_ explains)
16:01mi6x3m-altif a library you are developing depends on another library
16:01mi6x3m-altwould you specify it only as a dev dependency?
16:01[blake|justin_smith: It probably did. I was looking for some indirect reference in my code, but it was just a pile of "Invokes".
16:05justin_smithmi6x3m-alt: does it depend on the lib at dev time or run time?
16:05justin_smithif at run time, make it a regular dep
16:05mi6x3m-altjustin_smith: roger
16:05mi6x3m-altmostly runtime here
16:06justin_smithif your code misbehaves because of a lib you use but don't specify a runtime dep for, people will be annoyed (for good reason)
16:08TimMcmi6x3m-alt: dev-dependencies are strictly for deps that are used for generating documentation, running tests, etc.
16:08dagda1_anybody know how I can get rid of this warning from the emacs package cider https://www.refheap.com/96068
16:09TimMcmi6x3m-alt: If you don't specify :dependencies for things that are used at runtime your code will break and people will be mad.
16:09mi6x3m-altindeed
16:15mavbozodagda1_: use cider-nrepl 0.9.0-snapshot
16:15mavbozodagda1_: the instruction is here https://github.com/clojure-emacs/cider-nrepl
16:15dagda1_mavbozo: yes but it advises 0.8.2
16:16mavbozodagda1_: there's a quote "if you're using CIDER 0.x.y-SNAPSHOT, you should be using cider-nrepl 0.x.y-SNAPSHOT, etc"
16:16dagda1_mavbozo: works for me!
16:17mavbozodagda1_: so, what cider version what works for you? 0.8.2 or 0.9.0-SNAPSHOT ?
16:17dagda1_mavbozo: I mean the the quote works for me
16:18mavbozodagda1_: great!
16:35koreth_I am trying to understand how Piggieback works. Does anyone here know how its dynamic vars like *cljs-repl-options* are used? The (set!) calls on them appear to work, but they are never named in a (bindings) that I can see. I thought any var declared ^:dynamic was required to be bound before it could be set; is my understanding wrong?
16:35koreth_Err, never named in a (binding), that is.
16:37chouserUgh. Class file name is too long. Single largest contributor is "state_machine__1177__auto____22923". That's core.async, right?
16:38puredangeryeah
16:38puredangerthat doesn't look very long though
16:39amalloy_chouser: state_machine__1177__auto____22923 isn't even that long. what's the whole classname?
16:40hiredman$fn$fn$fn$fn
16:40hiredmanso fun
16:41puredangerchouser: any chance you're using 1.7.0-alpha3? class name length regressed there, was fixed in alpha4.
16:47chouserno, that's nested inside a couple anonymous fns which are nested inside a couple named fns, and then there's another anonymous function on the inside...
16:49cesparehmm. Why is the :default expr always evaluated inside an alt! ?
16:55cesparepuredanger: well, I would say that it's a bug, except that the documentation doesn't even say whether the exprs are supposed to be evaluated
16:55chouseroh actually, googling around a bit it looks like some languages without macros have this same problem. *ahem*scala*ahem*
16:55cesparepuredanger: the non-default exprs that aren't chosen aren't evaluated though
16:55puredangerthose seem like reasonable questions that should have definitive answers
16:57amalloy_man, the netsplits today. must be some bad weather on the information highway
16:57turbofailit was planned. an inside job, if you will
16:57justin_smithamalloy_: there was a wall about it
16:57amalloy_weather planning?
16:58justin_smithor global notice, or whatever they call it
16:58turbofail-mquin- [Global Notice] We are about to start rehubbing the network ahead of planned maintenance work. This will cause some netsplits, but should ...
16:58cespareokay, so now i'm on jira. I'm supposed to make an account on a non-HTTPS website?
16:58cespareand, more offensively, use jira?
16:58puredangersigh
16:58puredangeryes
16:59amalloywow, and it actually doesn't switch to https for account creation. i had guessed that something as enterprisey as jira would do that
17:00puredangerit does on newer versions, this one is ancient
17:00puredangerit doesn't actually support https
17:00amalloybrb changing my jira password before someone sniffs it
17:00puredangerif someone steals your jira auth, I'll refund your money
17:01arrdemamalloy: NSA's got you already
17:01cespareonly took 3 tries to get through the captcha
17:01amalloypuredanger: well uh...password reuse. not gonna lie
17:01cespareyou're a bad bad man
17:01puredangerfor the record, I am acutely aware of the myriad ways in which this particular JIRA version sucks
17:02amalloyi made my jira account before i started caring at all about password hygeine
17:02chouserah, apparently ubuntu encrypted home directory has a somewhat low limit on filename length. mount -o bind to the rescue
17:02puredangeras a finite resource, you can choose between having new Clojure versions or having new JIRA versions
17:03pmonksbrb coding a replacement for JIRA in 200 lines of Clojure
17:04arrdem(inc pmonks)
17:04lazybot⇒ 1
17:05puredangercan I inc contingent on delivery?
17:05justin_smith(delay (inc pmonks))
17:05arrdemunfortunately lazybot does not support contract based incs... however I suppose Etherium integration is possible...
17:06llasrampuredanger: Is that strictly true? Aren't there people Cognitect could pay to upgrade Jira who you wouldn't necessarily want to work on Clojure?
17:07puredangeryes and no
17:08puredangeryes there are people to pay to upgrade jira, but also someone needs to responsible for the overall effort and the greater decisions around where to even host it in the first place. everything is complected.
17:13[blake|OK...I have my nifty clojure program that has all this cool immutability. So cool it allows me to "undo" really easily. Then the user saves his work and quits the app. When he comes back, all that cool undo stuff is gone.
17:15justin_smith[blake|: the solution is to explicitly save and store (some amount of) the history
17:15[blake|justin_smith: Doesn't seem so "free" any more. =P
17:15justin_smith[blake|: once it's loaded, things are exactly like before
17:16justin_smiththe only difference is the save/load
17:16justin_smithwhich should be identical to how you save / restore anything else
17:16[blake|Maybe I need to look at an example.
17:17arrdem&(empty? {1 2})
17:17lazybot⇒ false
17:18amalloy[blake|: okay, so in order to get undo really easily, you must have a pointer to old versions of an object, right?
17:18cflemingI have a question about line numbers in generated classes - are these generated from the :line and :column metadata in the read forms?
17:18amalloycfleming: yes
17:18cflemingamalloy: So can I override those if I'm using nREPL?
17:18[blake|amalloy: Right.
17:18amalloyuhhhh, i don't understand the question anymore, cfleming
17:18cflemingamalloy: And relatedly, can I set the source file name if using nREPL?
17:19[blake|amalloy: Or, you're in a loop and you pop out of one level back to the previous?
17:19amalloy[blake|: so, when you want to save stuff, you save the current pointer by printing it (say), and you save any number of previous pointers in the same way
17:20cflemingamalloy: Here's the problem - I'm working on the debugging support in Cursive. Once a form has been evaluated in the REPL, the debugger no longer works for it since the source file is now form-xxxxxx.clj and the line and column numbers are now relative to the start of the form, and not to the start of the file
17:20cflemingamalloy: This makes sense for forms directly entered in the REPL, but when I'm sending forms from my editor I'd like to be able to set the source/line/column information correctly
17:21amalloycfleming: i am far from an nrepl expert. i really have no idea what your options are there, i'm afraid
17:21cflemingamalloy: Thanks
17:21cesparepuredanger: s
17:22cesparepuredanger: http://dev.clojure.org/jira/browse/ASYNC-113
17:22[blake|amalloy: OK, so let's say I have a sokoban game with a set containing locations, and each move creates a new map, a new set...
17:23[blake|Dumping the map I'm in is easy. I can unroll back level by level saving each set until I'm at the starting point.
17:23cflemingamalloy: Do you know where the form-xxxx.clj name comes from? I can't find it in clojure.main/repl, and LineNumberingPushbackReader doesn't add it either
17:23[blake|But if I did that, I'd end up with something different.
17:23justin_smith[blake|: to recover history, I would replay all the steps - that ensures that you get the same structural sharing you started out with
17:24justin_smithit's not like the state transitions should be anything expensive
17:24[blake|justin_smith: Yeah, so I save the initial map and then all the operations that created the new map.
17:24amalloycfleming: from nrepl or lein, i think
17:24justin_smithright
17:24[blake|Interesting.
17:24puredangercespare: thx
17:24[blake|Would I be saving the actual clojure code? Like, with assoc and conj and what-not?
17:25justin_smith[blake|: either that, or define your game update so it can be run forward or backward, and only load the undo as needed
17:25[blake|justin_smith: Yeah, seems like you'd want fluidity both ways. Hmmm. Prince of Persia, anyone?
17:25justin_smith[blake|: I would store edn that describes the move (and have the game code sturctured to be driven by the edn)
17:25amalloycfleming: eg, leiningen.core.eval contains (File/createTempFile "form-init" ".clj")
17:26amalloyi dunno if those are the same files as the ones you're seeing; maybe nrepl does something similar
17:26justin_smithand if designed right, you could have an "apply" and an "unapply" to move either direction across a series of moves
17:26[blake|justin_smith: OK, cool. I'll look into that.
17:26[blake|Thanks!
17:27cflemingamalloy: I can't find anything in the nREPL source
17:28justin_smith[blake|: one thing to watch out for though is that some things which are illegal for a player to do may have been implicitly so (because there was no code that could do that) and may need to change to explicitly enforced rules
17:28cflemingamalloy: but that code appears to be what Leiningen uses for executing forms, not REPL evaluation
17:28justin_smithsince you are adding new powers to the game engine if doing it this way
17:28kaiyinhttps://gist.github.com/kindlychung/a65bdf1cb4b0ef598d64 What went wrong with this implementation of reduce?
17:29justin_smithkaiyin: what are "correct" and "current" - is one of them a typo?
17:29[blake|justin_smith: Not sure I follow.
17:29justin_smithalso, hanging braces are very wrong :)
17:30justin_smithkaiyin: oh, currect even :) clearly that should have been current
17:30kaiyinjustin_smith, cool. got it.
17:31justin_smithkaiyin: also, the destructuring can happen in the loop binding
17:31amalloycfleming: do you think repl evaluation is different from executing forms? i mean, it might be, but i wouldn't start from that assumption
17:31cflemingamalloy: That appears to be the code used by lein to set up the trampoline. I just used no.disassemble to check - all forms from a single REPL appear to use the same file, which I guess is the file used to actually start the REPL
17:31justin_smithkaiyin: then you don't need a let block
17:32cflemingamalloy: Once nREPL is up and running, lein really doesn't have anything to do with it any more
17:32cflemingamalloy: It's just used in the initialisation of nREPL, not in each eval
17:32justin_smithkaiyin: (loop [result initial [current & rest] remaining] ...)
17:33kaiyinjustin_smith, nice.
17:33joobusdoes anyone use clojure for scripting? I made an alias to java -cp clojure-*.jar clojure.main $arg1, and have been trying to write quick scripts a la python. I've found if I can't use clojure for many things, I won't learn it.
17:33justin_smithkaiyin: add a check for 'reduced?' for completeness perhaps as well
17:33kaiyinAnyone knows how to strip an outer pair of parentheses in Cursive?
17:34kaiyinjustin_smith, what is that for?
17:34amalloybleh, i wouldn't bother with reduced. it's an odd quirk of clojure's reduce impl, not terribly useful for learning how to fold
17:34cflemingkaiyin: Edit->Structural Editing->Splice sexp
17:35kaiyincool.
17:37justin_smithamalloy: fair enough
17:38cflemingamalloy: nREPL load-file uses clojure.lang.Compiler/load, which allows you to set the source file etc - interruptible-eval doesn't. I guess I'm going to have to create a file for each form load which places the form at the right position in an otherwise empty file for this to work.
17:38kaiyinI just accidentally deleted a parenthesis and can't find out where to add it ...
17:39[blake|kaiyin: lol...been there...guessing you're not using paredit?
17:39cflemingkaiyin: You can temporarily turn off structural editing in the status bar at the bottom of the editor window
17:39cflemingkaiyin: Where it says Structural: on
17:39kaiyinI am using cursive with intellij, [blake|
17:39cflemingkaiyin: You can turn that off if things get unbalanced and you just want to fix them up.
17:40kaiyincfleming, ok, I will do that.
17:40[blake|kaiyin: Me, too. I turn off the structural editing, which makes it easy to delete a paren without its twin.
17:41[blake|This, I presume, is why the pros use it and have mastered all the slurping/spitting/disgusting bodily functions needed.
17:41cflemingkaiyin [blake|: I usually just use cut/paste, but both work
17:42cflemingkaiyin [blake|: It's surprising how little you need to do it once you get the hang of paredit though
17:42joobusalso *rant*: I experimented with scheme last weekend, and at the end of the day I can't figure out why anyone uses it. There about a million different flavors, almost nothing is interoperable, and there is very little community, support, or documentation. The reason I looked at it was for functional programming outside of the jvm
17:43[blake|cfleming: Yeah. I =will= get the hang of it. You've got the "normal" keybindings around somewhere now, right? (Just in case I have to use Emacs at some point.)
17:44cfleming[blake|: Yeah, you can set up some emacs-ish keybindings under Settings->Clojure->Keybindings
17:44kaiyinFinally fixed it. :-)
17:44justin_smithjoobus: for fp outside the jvm I would have gone with OCaml, Haskell, or F#
17:45cfleming[blake|: It's a fairly confusing UI though, check the doc here https://cursiveclojure.com/userguide/keybindings.html and also https://github.com/cursiveclojure/cursive/issues/552#issuecomment-60475268 for some info that hasn't made it into the doc yet
17:46cfleming[blake|: I'm hoping to make an interactive paredit tutorial at some point, sort of like a touch typing tutor
17:46[blake|cfleming: Thanks. So far I'm enjoying just making my own simple things like "Alt+L" to load and "Alt+T" to test. =P
17:46[blake|cfleming: Oh, that would be cool.
17:47justin_smith[blake|: as a long time emacs user, there is nothing "normal" about emacs keybindings
17:48amalloycfleming: as an avid paredit user, i have to say be careful: an interactive tutorial might make you a god among men
17:48cflemingjustin_smith: I didn't want to say anything, but...
17:49joobusjustin_smith: thanks, i'll check out ocaml. I've played with haskell briefly, and as far as I know F# is mainly a windows thing, but I don't run windows. I know there was some cross compatibility work similar to mono for F#.
17:49cflemingamalloy: I shall rule my subjects fairly, as long as they obey my every whim
17:49cflemingamalloy: Otherwise it'll be the vengeful wrathful god
17:50justin_smithjoobus: f# works anywhere via mono, but if you don't use windows OCaml will likely be more rewarding, yeah
17:50[blake|justin_smith: Heh. Yeah. Poor word choice. "Standard"? =P
17:50amalloy"intuitive", obviously
17:50justin_smithlol
17:51amalloythere's nothing more intuitive than playing your keyboard like a piano
17:51cflemingjustin_smith: I guess with .net being open source and cross platform, that's not such an issue. The good dev tools will only be on windows, though
17:51[blake|amalloy: "Intuitively obvious to even the most casual observer."
17:51justin_smithright - but I don't know if .net really has good cross platform support yet
17:51cfleming"intuitive" once you've had your brain reconfigured by 10 years of Emacs use
17:52cflemingjustin_smith: I'm not sure either, but MS seem to be taking it seriously and they have a lot of resource to make it happen
17:52justin_smithcfleming: decade of emacs use, still not intuitive, just memorized
17:52joobuslol, just went here http://www.tryfsharp.org/Learn/getting-started "Silverlight is required...". This is going well...
17:52justin_smithcfleming: well that's cool
17:52[blake|"The Little Schemer" seems like an easy intro to FP. It's got that going for it.
17:52amalloy[blake|: i remember one of my math professors allowing IOTTCO as a step in proofs
17:52Frozenlockcfleming: is there anything intuitive in computers?
17:52[blake|amalloy: Ha! Yeah. I heard that first from my dad, who got it from his math teacher.
17:52FrozenlockOffice's ribbon? :-p
17:53justin_smiththey keyboard is pretty damned intuitive - hit the key with an "a" on it to send "a"
17:53justin_smithit all goes downhill from there
17:53[blake|a
17:53[blake|justin_smith: No good. It says "A" but it makes an "a".
17:53iwilcoxTook a while to get there. The ZX Spectrum was in keyword mode by default..
17:53joobusjustin_smith: but it will be easier to play some of the 10 key Chopin or Debussy chords. :D
17:53turbofailyeah, as soon as you try and type a b you find out some joker has changed it to dvorak
17:55AtarianDoes anyone know why the read-line in this function appears to run before everything else in the function?
17:56Atarian(defn display-menu
17:56Atarian [menu-list]
17:56Atarian (dotimes [i (count class-list)]
17:56Atarian (printf "%d: %s\n" (+ i 1) (nth class-list i)))
17:56Atarian (printf "Please make a selection: ")
17:56Atarian (read-line)) ; Why does this run before the printf?!
17:56iwilcoxMaybe you need a (flush)
17:56amalloyAtarian: also pls refheap.com or gist.github.com or something
17:56AtarianCheers iwilcox, where would I put the (flush), just before the (read-line)
17:57Atarianamalloy: What are they, pastebin type things? Sorry
17:57amalloyyes
17:57[blake|cfleming: That bulk setting is very useful, whatever nays the naysayers say.
17:58justin_smithyeah, (flush) would go just after the last printf
17:58cfleming[blake|: Oh, it's definitely useful, it's just a confusing UI
17:58Atarianamalloy: Will do in future, sorry for the fubar
17:59Atarian(thanks chaps, that worked perfectly) <- I can't believe I put that in brackets, that's enough lisp for tonight lol
18:00andyfAtarian: printf is running before the read-line, but printing is buffered by default so data is in some non-displayed mem buffer until it is flushed, either manually, reaching the bug size, or calling a fn like println that calls flush for you
18:00andyfS/bug/buf/
18:01AtarianIC, thanks for the explanation, I was just wondering that
18:02mavbozoAtarian: there is a note about that in clojure docs https://clojuredocs.org/clojure.core/printf#example_542692d4c026201cdc327038. just noticing about it myself.
18:03AtarianStap me, so there is. I did a google search, but didn't check the official docs
18:05andyfClojureDocs site isn't exactly official, and some examples are wrong, but on average it is pretty good
18:06andyfI wrote that note about printf, so I will vouch for it :)
18:06AtarianI've learned alot tonight :)
18:06mavbozo(inc andyf) ;; for the flush note in printf docs
18:06lazybot⇒ 24
18:09kaiyin(partial func a) makes a partially applied function, with the first arg fixed right?
18:09kaiyinWhat if I want to give it the second arg instead of the first?
18:10amalloykaiyin: what if you wanted to write (partial func a), but weren't allowed to use partial?
18:11kaiyin,(fn [b] (func a b))
18:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: func in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:11kaiyin,(fn [b] (str a b))
18:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:11amalloykaiyin: indeed. and you can do the same thing if b is what you want to fix
18:12amalloypartial is an alternative way of writing it, if you want to fix the first N arguments, but you don't *need* it for anything
18:12kaiyinamalloy, thanks.
18:32dysfunis there a protocol or interface that allows you to overload 'conj'?
18:33amalloydysfun: clojure.lang.IPersistentCollection
18:33dysfunta
18:33amalloyit's the cons method
18:33dysfunfinding which one of these different things fall under is a chore
18:33dysfuni'm mostly resorting to github search
18:34dysfunbut something like 'conj' is impossible
18:35justin_smithdysfun: here's how I found it: (clojure.repl/source conj) followed by google for clojure.lang.RT, C+f "conj" which gives me IPersistentCollection
18:35justin_smiththat first jump because source of conj clearly shows a call to RT/conj
18:35dysfunoh, i forgot about source
18:37justin_smithaha - I also could have done (javadoc clojure.lang.RT)
18:45dysfuncan you do binary search against a sorted-map?
18:45arrdem$grim clojure.core/conj
18:45lazybothttp://grimoire.arrdem.com/1.6.0/clojure.core/conj
18:46arrdemyessssss didn't even break that :D
18:47justin_smithdysfun: as opposed to the existing "get" ?
18:47justin_smithor I guess I mean, how would this be differentiated from get?
18:48dysfunjustin_smith: i'm using a sorted-map-by, but the key
18:48dysfunis not lookupable directly
18:49dysfunit's an interval tree
18:49amalloydysfun: subseq
18:49dysfuneach key in the map is a bounded, they're ordered by minimum bound and don't overlap. given a key, i can tell if it matches
18:50_1_fuengxactivohola desde Fuengirola
18:50dysfunamalloy: with the index of the mid-point?
18:50amalloydysfun: with whatever key you are looking for
18:50amalloydon't do the binary search yourself
18:51dysfunoh, i see
18:51dysfunthat's brilliant
18:51justin_smithdysfun: you can get a Spliterator via the java.util.Set interface, maybe? just a guess though
18:51justin_smithbut I think a Spliterator does what you want
18:52justin_smithor use amalloy's suggestion, that is likely better
18:52amalloyjustin_smith: that is like...a java 8 addition to java.util.Set? i'm quite sure clojure's implementation of Set doesn't include any of that newfangled nonsense
18:54justin_smithamalloy: oh, yeah, another point toward your solution then :)
18:54amalloywhat on earth even is a spliterator? i should read https://docs.oracle.com/javase/8/docs/api/java/util/Spliterator.html but there are so many words
18:55justin_smithamalloy: like an iterator, but over a tree
18:55justin_smithso for directly doing the binary search as he mentioned
18:59mtravenHaving an :aot problem, any experts handy?
19:00amalloy~anyone
19:00clojurebotanyone is anybody
19:00amalloyi hate you, clojurebot
19:00arrdemnot sure anyone understands aot either...
19:02mtravenSigh...oh well. I am getting errors like this: Caused by: java.lang.Exception: namespace 'fresser.spark' not found after loading '/fresser/spark' from a file that has no obvious problems. I am assuming something is going wrong when it is compiled and the error is being eaten somewhere...
19:05justin_smithmtraven: what is the ns declaration in that file?
19:05justin_smithmtraven: that error usually means a file was loaded via require, but did not define the ns that require expected of it based on its path
19:12mtravenjustin: it's nothing obvious like that. The files compile OK normally but fail during :aot
19:14justin_smithmtraven: that error will not make compilation fail
19:14justin_smithbut it will make require fail, because the ns required is not present
19:14andyfA file can compile without errors if it has mismatched namespace / file name, but you should get that error if you try to require it with or without AOT
19:16justin_smithmtraven: try running eastwood, and see if it gives you a hint of what might be wrong (after double checking that the file src/fresser/spark.clj starts with (ns fresser.spark ...))
19:16andyfWe wouldn't harp on it like that if it didn't happen to some Clojure developer every day :)
19:17justin_smithI've done it myself enough times...
19:17andyfIf that is not the problem, aot experts are uncommon
19:19justin_smithand setting aside everything else, that is literally what that error is intended to mean (though some other root problem with the codebase could cause that problem as a side effect on rare occasions)
19:22mtraventhanks, trying eastwood now (new thing to me)
19:24akkadClojure: because I don't want to learn Emacs
19:25andyfakkad: Free light saber for everyone who learns Emacs, though. Pretty cool.
19:25justin_smithmtraven: also, does require of that ns work from a repl?
19:25justin_smith(try eastwood first though, it's great)
19:27amalloyi just ran eastwood for the first time. lint result: "jeez, you idiot, your code doesn't even compile"
19:27justin_smithhaha
19:28andyfWow, I must have forgotten and left that harsh err msg in there by accident :)
19:28amalloyandyf: feature request: more abusive lint errors
19:28amalloylike the sudo insult options you can compile with
19:28justin_smithandyf: iirc it was an easter egg that specifically checks for "amalloy" as the current logged in user name
19:29andyfI actually did that once for a program as an undergrad. A few days later, the user (my boss and often professor) came and said: "first of all, I am not a numbskull. Second, ..." He was pretty cool about it
19:30justin_smithandyf: custom translation files for languages like "dumbass"
19:30andyfHmm, maybe lines from Clint's films ...
19:30justin_smithoh that would be a good one
19:31justin_smithone could make it a pluggable edn based config
19:31andyfi18n ftw
19:32justin_smithandyf: "so about now you are probably asking, is this the root cause of the exception, or is there another exception left?"
19:32andyfThis bug could blow your head clean off
19:37justin_smith"It's a hell of a thing, killing a Thread. You free all the resources it ever had, and ever could have." (not strictly true)
19:40andyfGithub issue created. Not high priority
19:43kenrestivoyou know, i watched the youtube clip of that scene from the first dirty harry movie, and now i'm embarassed for ever having quoted it.
19:44kenrestivohaven't seen it in like 30 years, and... it did not age well.
19:48[blake|"Swell."
19:49hellofunklol justin_smith adding inline footnotes to your own movie quote variations
19:50iwohey, does anyone know if there's a good pattern for 'single item filter'? I dont mean (first (filter ...)) i mean (if (pred x) x nil)
19:53iwoor basically (when (pred x) x)
19:54amalloyiwo: pattern? just define that as a function, and then use that function
19:54iwoI guess (when (pred x) x) is already close to the shortest form that this could take
19:54iwoI suppose I'm looking for (f pred x)
19:55amalloyyou'd need a pattern if you needed to repeat this over and over, but with higher-order functions you can just define a function
19:55amalloy(defn f [pred x] (when (pred x) x))
19:55andyfiwo: #(= % x)
19:55amalloyandyf: i don't think that's it at all...?
19:56andyfMaybe I'm confused by mention of filter
19:56iwoamalloy: sorry, pattern was the wrong word, I just mean a function in clojure.core
19:56iwoI realise I can create a hof for this :)
19:56amalloyiwo: there's nothing in clojure.core
20:08pmonksPotentially silly question - any good reason why the REPL doesn't provide the source for a function that was defined in that REPL session?
20:10amalloybecause it can't
20:10amalloy(potentially silly answer)
20:10pmonks;-)
20:10pmonksI don't see why it can't, though the current impl apparently can't do it.
20:11amalloypmonks: because functions don't know their source
20:11amalloythey only know a file and a line number
20:11pmonksI guess that's my point - why not store the source with the compiled fn?
20:11pmonks(at least in the REPL)
20:13pmonksI haz a sad after runnng (source my-fn) on an fn I'd been experimenting with for a while. Had to go back through the scroll buffer and find the defn.
20:13[blake|pmonks: Heh. Try it some time after your defn has scrolled out of the buffer. That is a sadz.
20:14pmonksouch
20:14pmonks(inc sad)
20:14amalloy[blake|: C-r?
20:14pmonkslazybot doesn't like me today :-(
20:14[blake|amalloy: Я не говорю Emacs.
20:14amalloythat's just expensive, pmonks. clojure's vars are already heavyweight and add substantially to startup time, which causes people a lot of problems
20:15pmonksI (mostly) don't care about that in the REPL.
20:15pmonksGoing to classpath for "real" fns is fine.
20:15pmonksJust saying it'd be nice if fns hand-rolled at the REPL were special cased.
20:15[blake|amalloy: How could it impact the startup time if it only applied in the REPL to things defined in the REPL?
20:17[blake|(Not that I particularly care. It only happened in my early experiments, when working code was precious.)
20:17gfredericksmaking things special in the repl is a little tricky
20:17gfredericksbuuuuuttt
20:17[blake|That is a big but.
20:18pmonksI LIKE!!!1
20:18gfredericksI can imagine a piece of repl tooling that wrote each line to its own file and eval'd it from there and that would probably get you what you want and everybody would hate it and nobody would use it
20:18[blake|Perfect!
20:18arrdemgfredericks: that's hillariously close to how CIDER works
20:18arrdemiirc
20:19arrdembut everyone hates that and nobody uses it
20:19arrdem(inc bbatsov)
20:19gfredericks:)
20:19gfredericksbbatsov inc'd my nrepl commit the other day
20:19pmonks<n00b warning> Seems like a REPL-rolled fn var could just have additional metadata that (source) could be sensitive to.
20:20pmonksThough I guess that means the REPL wouldn't be using the "real" reader - it'd need it's own with defn redefined.
20:20gfrederickscould use the same reader
20:20gfrederickspmonks: you know what actually
20:20gfrederickswhat I would recommend
20:21gfredericksthis might still get the scorn of everybody else but that's okay
20:21gfredericksis
20:21amalloyready the scorn cannoncs
20:21arrdemfork clojure and add a *repl* context to Compiler.java?
20:21gfredericksan nrepl middleware that wraps your code in (macrolet [defn ...] ... your code ...)
20:22rhg135Blasphemy!
20:22gfredericksI don't know how to get the string source from that but there might be a way
20:22gfredericks(as opposed to the post-reader source)
20:22arrdemthat's... significantly less evil than I was expecting
20:22gfredericksyou could easily get the entire eval'd msg
20:23gfredericksand the reader probably adds metadata that you could use the same way clojure.repl/source does
20:23gfredericksI need to stop thinking about this or I'll end up writing it myself
20:23hiredmannrepl middleware that snapshots vars before and after eval, compares, then throws the string source on to new or changed vars
20:23gfredericksI think hiredman is just trying to out-scorn me
20:23pmonkshmm......I was just looking at the source for defn itself, and wondering if you could just redefine that (and source), in the REPL itself....
20:24arrdemcan you put watches on a var?
20:24gfrederickstotes
20:24arrdemso do that and you escape hiredman's snapshotting
20:24gfredericksyou can't put watches on yet-to-be-created vars
20:25gfredericksso you'd still have to iterate over the world
20:25gfredericksJust In Case
20:25arrdemor you could look at the nREPL return message and see if it's a var
20:25arrdembut that assumes single defs...
20:26rhg135That's pretty fragile imo
20:26arrdemcould you put a watch on *ns*?
20:27arrdemnope.
20:29gfredericksif somebody comes up with a good name for this library I will write it right now.
20:29pmonksdefning
20:30pmonksApologies - it was the first pun that pooped into my head.
20:30andyfI like it. Stning
20:30gfredericksis that another pun
20:31gfrederickshow about it-makes-source-work-on-defns-from-your-repl
20:31pmonksandyf: "Software Transaction Ning"?
20:31andyfI don't think so, but my condition may be advanced enough that I can't tell any more.
20:31andyfI simply meant stunning.
20:32cflemingI'm certainly stunned
20:58gfredericksokay fine I will write this and call it defning
21:02amalloyall right, guys, gfredericks has given in. we can stop silently applying peer pressure now
21:05andyfOh, we were doing it silently? I had my bots sending him private msgs every 5 secs
21:06amalloy(inc andyfbot)
21:06amalloyi think lazybot got lost in the netsplit
21:07gfredericksman I hate writing nrepl middleware
21:07amalloypeer pressure! quick!
21:07amalloyhe's more resilient than we ever imagined
21:07gfredericksprotip: #'clojure.tools.nrepl.middleware.interruptible-eval/*msg* is a magical wonderland
21:08gfredericksgo poke that in your repl and see what happens
21:09gfrederickse.g. try this
21:09gfredericks(:code clojure.tools.nrepl.middleware.interruptible-eval/*msg*)
21:11gfrederickswait a minute
21:12gfrederickshow can I get clojure.repl/source to work with this just by adding metadata
21:13gfredericksI take it all back this is completely impossible I give up
21:16amalloygfredericks: more metadata
21:16amalloyer, more middleware
21:17amalloyadd a middleware that replaces calls to clojure.repl/source with calls to your hijacked function. what could go wrong?
21:17gfredericksI can't stomach the idea of macroletting source because I use (./source ...) myself
21:18gfredericks~what
21:18clojurebotwhat is http://gist.github.com/306174
21:18gfredericks~what
21:18clojurebotwhat is this
21:18amalloy$what
21:18lazybotIt's AWWWW RIGHT!
21:23gfredericksif only all vars were dynamic again
21:23gfrederickslet's ask rich if he can revert that real quick
21:24justin_smithgfredericks: since the point of using this would be to get enhanced source, I don't think expecting someone to call sourcening instead of source is so onerous
21:25gfredericksyou can't make me make a separate dep called sourcening
21:25justin_smithOK, but your dep could define sourcening
21:44Travistycan anyone think of some device that has about 65kb of memory?
21:44gfredericksNintendo 65
21:44TravistyHeh, did the n64 have 64 bytes?
21:44gfredericksI don't think that was funny I retract the joke
21:44Travistyer, kb
21:52exaptic_65 is a weird amount of memory to have, given it's not a power of two
22:05gfredericks~65 is a power of 65
22:05clojurebotOk.
22:07justin_smithTravisty: I have a tandy 102 with 64k total storage (ram+rom), and many other computers from its era had the same
22:07gfredericksback in the 50's the Committee On Deciding What A Bit Is had to choose between two proposals, one that would have a 2-valued bit, and the other a 65-valued bit. The committee ended up choosing the latter because "it sounded more gooder"
22:07gfredericksand that's why today so many elements of computing involve powers of 65
22:09gfredericksthere isn't a programmer alive who hasn't committed the number ##(apply * (repeat 65 65N)) to memory
22:09lazybot⇒ 6908252164760920851405538694468286082230378724259454186289117297729987129104901877330036086277686990797519683837890625N
22:12Travistylol
22:40mmitchel_i'm using clojure.tools.logging - is there anyway to configure the log level at runtime, without an additional library?
22:41exaptichaha
23:01justin_smithmmitchel_: not that I know of, timbre makes it straightforward enough
23:01mmitchel_justin_smith: cool, does timbre use java logging like log4j etc.?
23:04justin_smithyeah, it just adds runtime config (via a global atom iirc)
23:19MethodicalI am successfully using environ locally for test and dev postgres connections. I have a heroku app with the postgres addon. I have the env variables set up and available in the heroku app. Yet the app blows up with PSQLException: Connection refused. Any heroku users aware of a gotcha I am overlooking?