#clojure log - May 06 2014

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

1:41 seangrove: bbloom: Any thoughts on animation re: layout systems?

1:41 Working on porting the layout stuff to reducers to see if there's any perf benefit from reduced GC pressure, but thinking about animation off in the distance

2:50 waynr: how do i run a task before creation of jar file in clojure

2:52 dbasch: waynr: I don’t know if this is what you’re asking, but you can chain tasks in leiningen, e.g. lein do clean, test, jar

2:52 waynr: i'd like to run a function prior to the creation of the jar

2:53 to create a manifest of the contents of the resources directory

2:54 someone mentioned the possibility yesterday and i thought "no, surely there must be some java-y or clojure-y way to learn the contents of a directory in the jar at runtime)

2:54 s/)/"/

2:54 now my brain is pretty much done for the day

2:54 dbasch: worst case you can do it with a custom plugin

2:55 which is easier than it sounds

2:55 e.g. https://github.com/technomancy/leiningen/wiki/Plugins

2:56 waynr: yeah

2:56 or simpler, use a simpler language like bash or python to puke out the manifest

2:58 dbasch: I don’t think bash or python are simpler than clojure :)

2:58 waynr: i am writing a plugin right now to so i think i see wha tyou mean

3:17 gws: waynr: would this help? http://docs.oracle.com/javase/7/docs/api/java/util/jar/JarFile.html (ex: http://www.java2s.com/Code/Java/File-Input-Output/Listfilesinajarfile.htm)

5:26 f3ew: http://pastebin.com/SAQqPm79 Why is my function capturing the entire string?

5:28 maxthoursie: f3ew: guessing, but usualy with regex group 0 is the whole string

5:28 f3ew: try [_ top_level hostname srv]

5:29 (that is ignore the first argument)

5:29 clgv: f3ew: yes the first entry in the vector is the entire match, after that follow the groups

5:29 just use (rest (re-find #"^(sys)\.(\w+)\.(.+)$" service))

5:31 f3ew: it does not make much sense to destructure the result just to assemble it to a vector again

5:33 f3ew; why do you capture "sys" in a group anyway if it is just a constant?

5:33 f3ew: clgv: it's not going to be captured into a vector

5:33 I'm trying to build up the parsing function

5:34 First, easy test case is strings starting with sys

5:35 The data source is arbitrary '.' separated strings, some of which I've to handle

5:38 * f3ew stabs irritatedlyt

5:38 f3ew: -t

5:38 erm, s/t$//

5:40 * f3ew fixes typo. Yay

5:40 f3ew: Thanks.

5:40 So why is capture group 0 always the whole string?

5:40 maxthoursie: f3ew: it's the whole string that matched

5:41 f3ew: it your not using ^ and $, that might not be the whole string

5:41 f3ew: Hmmm, my understanding of capture groups was that you would need to enclose them in ()

5:41 maxthoursie: f3ew: so there's always an impicit capture group around the whole re

5:42 f3ew: Yes, but why?

5:43 maxthoursie: it's a shortcut if you only matching something simpl

5:44 (first (re-find #"\.(.*)")) would give you everything except for the text before the first dot, for example

5:45 CookedGr1phon: Hey, I'm trying to use core.async in cljs. I have the dependency listed but I'm getting filenotfoundexception, could not locate cljs/core/async__init.class or cljs/core/async.clj on classpath

5:45 maxthoursie: ,(first (re-find #"\.(.*)" "foo.bar.baz"))

5:45 clojurebot: ".bar.baz"

5:45 CookedGr1phon: I have quite a complex profile setup, so I'm wondering if I have borked something to do with cljsbuild's configuration for pulling in libraries

5:47 maxthoursie: f3ew: ok, just read (doc re-groups), that would have been better using just

5:47 ,(re-find #"\..*" "foo.bar.baz")

5:47 clojurebot: ".bar.baz"

5:48 maxthoursie: f3ew: can't find a use case right now, but that's the way regex functions in most languages works

5:59 foofoobar: Hi. When I'm in the REPL, how can I go to a new line (without submitting the current command)

6:00 hitting just enter works, but then I cant indent with tab, I have to use spaces then

6:04 clgv: f3ew: consistency, without capturing groups you just get the match

6:13 foofoobar: "lein repl"? some emacs repl? ccw? cursive? vim-fireplace?

6:18 foofoobar: clgv, lein repl

6:21 clgv: foofoobar: well if you want features like autoident I guess you have to use some kind of "IDE", e.g. one of the above mentioned

6:22 foofoobar: clgv, I'm a vim user, so I will have a look at vim-fireplace

6:22 thanks

6:24 visof: i have created package jar using leinengen leun uberjar and it depends on other java jar package how can i run it?

6:25 java -cp bar.jar foo.jar , foo.jar is what is created by lein uberjar

6:25 bar is a java jar

6:25 i need to use some methods from bar.jar in foo.jar

6:25 how can i do this?

6:27 llasram: visof: (a) Are you sure you need the other JAR? Part of the point of uberjars is that they bundle together all of the project dependencies into a single JAR

6:27 (b) java -cp foo.jar:bar.jar WhateverClass

6:28 visof: llasram: how can inject this local jar to lein project to package all together?

6:29 llasram: Is this a JAR for an existing other Leiningen project, and you just want it available locally for testing the whole app or something?

6:29 If so, `lein install` will install the JAR in your local maven repository (~/.m2)

6:34 fizruk: how do I convert string to int or nil (if parse fails)

6:34 ?

6:36 llasram: ,(defmacro ignore-errors [& body] `(try ~@body (catch Exception _# nil)))


6:36 clojurebot: llasram: Cool story bro.

6:36 llasram: Aww

6:36 Right, no exceptinos in bots

6:36 fizruk: Anyway, just use `Long/parseLong` and catch any exceptions

6:37 fizruk: okay

6:46 ,(Boolean "123")

6:46 clgv: visof: as llasram said uberjars already contain all declared dependencies

6:46 clojurebot: #<RuntimeException java.lang.RuntimeException: Expecting var, but Boolean is mapped to class java.lang.Boolean>

6:46 fizruk: ,(Boolean. "123")

6:46 clojurebot: false

6:47 clgv: ,(= (Boolean. true) true)

6:47 clojurebot: true

6:47 clgv: ,(= (Boolean. false) false)

6:47 clojurebot: true

6:47 visof: clgv: can i declare jars which isn't remote?

6:47 clgv: fizruk: better do not construct booleans manually ;)

6:47 visof: I dont understand that question

6:48 alex______: My clojure project run on localhost is fine but after the deploy on heroku some page not functioning well

6:48 fizruk: clgv: I want “true” -> true, “false” -> false, “whatever” -> nil

6:49 clgv: ,(Boolean/parseBoolean "true")

6:49 clojurebot: true

6:49 clgv: ,(= (Boolean/parseBoolean "false") (Boolean/parseBoolean "false"))

6:49 clojurebot: true

6:49 fizruk: ,(Boolean/parseBoolean "123")

6:49 clojurebot: false

6:50 fizruk: clgv: ^ that’s the problem :(

6:50 clgv: lol a number is no boolean ;)

6:50 llasram: (fn tristate [x] (case x "true" true, "false" false", #_else nil)) ;; Although why the hell do you want this?

6:50 fizruk: why is it so inconsistent? T_T

6:50 clgv: you just want something according to clojure's truthy semantics?

6:50 ,(boolean "123")

6:50 clojurebot: true

6:51 fizruk: no, I want to ignore things that are not “true” or “false”

6:51 clgv: ,(mapv boolean ["123" 1 false true nil])

6:51 clojurebot: [true true false true false]

6:51 clgv: fizruk: you need to explain that with some more examples.

6:51 llasram: ,(map (fn tristate [x] (case x "true" true, "false" false, #_else nil)) ["true" "false" "whatever"])

6:51 clojurebot: (true false nil)

6:51 fizruk: llasram: that’s how I’d do it, yeah

6:52 clgv: fizruk: ,(filterv boolean? ["123" 1 false true nil])

6:52 ,(filterv boolean? ["123" 1 false true nil])

6:52 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: boolean? in this context, compiling:(NO_SOURCE_PATH:0:0)>

6:52 clgv: ,(filterv #(instance? Boolean %) ["123" 1 false true nil])

6:52 clojurebot: [false true]

6:52 fizruk: llasram: clgv: just would like it to be simpler

6:52 alex______: My clojure project run on localhost is fine but after the deploy on heroku some page not functioning well

6:53 fizruk: clgv: I get strings from user and i want to ignore invalid boolean fields

6:54 clgv: fizruk: whats the probelm with "case" then?

6:54 fizruk: ,(Boolean. "asd")

6:54 clojurebot: false

6:54 clgv: fizruk: forget about that class and its constructor

6:54 fizruk: clgv: no problem, it just seems inconsistent that (Integer. “asd”) throws exception, but (Boolean. “asd”) returns value

6:56 clgv: fizruk: well its consistent to its docstring http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html

6:56 ,(Boolean/parseBoolean "123")

6:56 clojurebot: false

6:56 clgv: same there...

6:57 fizruk: I just don’t get why they made it work this way

6:58 i’d expect parseBoolean to parse booleans

6:58 not to return false when string is not “true”

6:58 clgv: well, you probably wont find out here ;)

6:58 fizruk: i guess :)

6:59 clgv: there is a java channel where they might now. but I dont know if the reason will matter that much to your dev project ;)

6:59 fizruk: i’m just complaining, nvm

7:17 bilbobraggins: I'm writing a thin wrapper for a Java API that mainly provides interfaces. Let's say there's a Element interface, and a Vertex interface which inherits from it. I have two namespaces foo.element and foo.vertex. Is it looked down upon if I redefine the wrapper functions of Element in foo.vertex again instead of using something like potemkin?

7:23 fizruk: ,({"true" true "false" false} "123”)

7:23 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

7:23 fizruk: ,({"true" true "false" false} "123")

7:23 clojurebot: nil

7:24 fizruk: llasram: clgv: going to use this ^

7:28 visof: i have created local repo and added the my jar package to it

7:29 and then i did lein deps

7:29 but i got this errors http://sprunge.us/aaUe

7:29 is there anybody can help in this?

7:30 clgv: fizruk: ah right. thats in fact the same procedure as in case ;)

7:30 fizruk: since case uses hashing as well

7:30 fizruk: good to know case uses hashing

7:31 clgv: ~repeatability

7:31 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

7:32 clgv: visof: for temporary development you need to install the jar you want as dependency locally (lein install or such) at least

7:32 visof: clgv: lein install give me the same resutl

7:34 clgv: visof: you need to install the dependency locally not the project that is using it

7:34 visof: clgv: how can i do this?

7:35 clgv: visof: how did you get its jar in the first place?

7:37 visof: http://www.elangocheran.com/blog/2013/03/installing-jar-files-locally-for-leiningen-2/

8:03 using clojure.test.check, why does (def byte-gen (gen/fmap #(-> % (mod 256) (- 128)) gen/nat)) return only values in [-128, ... -29] for ((juxt first last) (sort (gen/sample byte-gen 1000000))) ?

8:07 visof: clgv: how can i add deploy-file plugin to pom.xml ?

8:07 in lein project

8:09 maxthoursie: clgv: that does look weird

8:18 clgv: gen/nat doesn't generate very big numbers

8:22 clgv: you should use gen/choose

8:22 clgv: ((juxt first last) (sort (gen/sample (gen/choose -128 127) 100000)))

8:27 clgv: oh, you should probably use gen/byte :)

8:31 f3ew: What does the -> operator/macro/function do? /win 10

8:31 maxthoursie: f3ew: it's the threading macro

8:31 llasram: (doc ->)

8:31 clojurebot: "([x & forms]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

8:32 f3ew: Right, so just reverse ordering for readability

8:32 ?

8:32 maxthoursie: yes

8:32 llasram: Kind of

8:32 * f3ew will go with that for now

8:32 llasram: Note that it is thread-first, vs ->>'s threat-last

8:33 maxthoursie: that is insert as first argument or last argument

8:35 ->> tend to be more useful with higer order fns

8:37 AWizzArd: amalloy_: Ah okay I see, I didn’t notice this. But when .- was added to Clojure back then, was the . accessor for fields removed? I think it still works no? (.publicField my-obj)

8:38 (defrecord Foo [a b c]) (.b (Foo. 10 20 30)) => 20

8:48 visof: i tried to add maven local repo, and this the result of lein deps and lein install http://sprunge.us/HNQG , project content: http://sprunge.us/jaRH , command i used to deploy the package to local repo http://sprunge.us/iPeQ

8:48 please anybody can help in this?

8:49 it doesn't see the local pacakge

8:51 beamso: lein won't respect you setting M2_HOME in your shell?

8:53 visof: beamso: for me?

8:53 KeithPM: amalloy_: Follow up on the set! issue. You're right, it works fine in a REPL but needs the '-' in Light Table. Maybe the Light Table environment forces a ClojureScript environment?

8:53 llasram: visof: You installed the hdt-java-core JAR in your local repository with the group-id `local`?

8:53 beamso: visof: yeah

8:53 visof: llasram: yeah

8:53 llasram: is this wrong?

8:53 beamso: to me it sounds strange to not use ~/.m2

8:54 llasram: srlsy

8:54 visof: beamso: if i have used the default path of ~/.m2 i got the same

8:54 beamso: could you find the .jar under ~/.m2/repository?

8:55 visof: beamso: Installing /home/visof/code/clojure/hdtsimplesearch/hdt-java-core-1.1.1-SNAPSHOT.jar to /home/visof/.m2/repository/local/hdt-java-core/1.1.1/hdt-java-core-1.1.1.jar , not dependencies should be local/hdt-java-core "1.1.1"

8:55 ?

8:56 llasram: visof: I'm not sure if this is the only problem, but your -Dpackaging should be "jar" not "jars"

8:58 visof: llasram: i did

8:59 llasram: now to use this api from this jar i should use (import ?? )?

9:01 CookedGr1phon: does clojurescript not support clojure.core/require?

9:04 visof: llasram: lein deps; lein install; don't notify me anything it's downloading jar from local repo

9:04 and don't give me anything

9:05 llasram: Um. It doesn't need to download anything

9:05 If you don't get an error, that means it's working

9:07 visof: llasram: i don't get anything, should i get classes compiled at classed dir

9:07 llasram: I'

9:08 Sorry, I've used up my IRC support time this morning. Best of luck

9:08 visof: thanks

9:15 clgv: maxthoursie: damn missed that one... I'll need it for the other sizes as well ;)

9:16 gen/choose is the trick I was looking for...

9:31 visof: local repo is just a folder on your disk - there is no downloading needed

9:31 visof: if you want to see all your dependencies use "lein deps :tree"

10:02 visof: i have a java method which is called HDTManager.mapHDT("data/example.hdt", null); how can i call it inside clojure?

10:03 CookedGr1phon: (HDTManager/mapHDT "data/example.hdt" nil)

10:06 visof: CookedGr1phon: i should import and require also right?

10:13 CookedGr1phon: ah, so if you haven't alreaady got HDTManager imported you will need to *either* fully namespace qualify it (com.mycompany.whatever/HDTManager/mapHDT ....)

10:13 or import it

10:13 which will let you use the short version of the name

10:14 require is only for clojure namespaces and shouldn't come into it

10:14 visof: CookedGr1phon: i did http://sprunge.us/PAMO

10:14 CookedGr1phon: so now i can do as you told (HDTManager/mapHDT "data/example.hdt" nil) ?

10:16 CookedGr1phon: possibly, I'm not sure about your use of import, I usually import them like so (:import [org.refhdt.hdt.hdt HDTManager HDT])

10:17 michaniskin: cemerick: ping?

10:18 CookedGr1phon: visof i think to import one thing at a time, they shouldn't be in a list like that, you should just quote it, so (:import 'org.refhdt.hdt.hdt.HDTManager 'org.refhdt.hdt.hdt.HDT)

10:22 visof: import stuff is running using lein run without calling any method

10:22 CookedGr1phon: i tried as you suggested and got Caused by: java.lang.RuntimeException: No such namespace: HDTManager ?

10:22 CookedGr1phon: have i missed something?

10:22 jcromartie: no need to quote

10:22 visof: jcromartie: what do you mean?

10:23 jcromartie: (ns foo (:import java.util.Iterator (org.rdfhdt.hdt.hdt HDT HDTManager) (org.rdfhdt.hdt.triples IteratorTripleString TripleString

10:23 )))

10:23 MrJones98: Relatively inexperienced with clojure and encountering a weird error that highlights a fundamental lack of understanding on my part of what's going on…

10:24 if i do (clojure.walk/postwalk identity m) where m is (def m (somefunc)), it works as expected

10:24 if i do (clojure.walk/postwalk identity (somefunc)), i get an abstractmethoderror

10:25 cemerick: michaniskin: pong, but leaving in 10m :-P

10:25 MrJones98: specifically, java.lang.ClassCastException: java.lang.Character cannot be cast to java.util.Map$Entry

10:26 not sure if there's an obvious explanation… i'm currently trying to trim down the example to remove any confidential information since (somefunc) is pulling data from datomic

10:26 michaniskin: cemerick: hi :) do you know of any issues with pomegranate resolving snapshot deps in windows? in boot i'm having this problem, and in windows8 making "SNAPSHOT" lowercase seems to have helped, but not in windows7

10:26 jcromartie: MrJones98: the 2nd arg to postwalk should be the value you want to walk

10:26 you can't walk a function

10:26 you can walk a structure

10:27 cemerick: michaniskin: I don't know of any...but then, I don't use windows much for development

10:28 MrJones98: jcromartie: as in you can't call a function whose return value is used as the argument?

10:28 michaniskin: cemerick: also i'm maintaining a cljs build task in boot, and i keep running into changes in cljs compiler that cause incremental compilation to be slower than necessary (like recent change to the way the analyzed stuff is stored between compiles)

10:28 jcromartie: MrJones98: that should be fine

10:28 oh sorry

10:28 I thought it was (defn m ...)

10:28 michaniskin: cemerick: since you're doing a lot of work with cljsbuild these days i was wondering if you could kind of alert me to these things from time to time?

10:28 jcromartie: is (somefunc) stateful?

10:29 i.e. does it return the same thing every time?

10:29 cemerick: michaniskin: I'm not aware of anything aside from the compiler environment change that would be relevant

10:29 michaniskin: cemerick: cool thanks!

10:30 MrJones98: jcromartie: somefunc pulls info from datomic… but there are no changes to the database in between calls in the above example

10:30 so, unless there's something else i don't understand about datomic, somefunc is effectively returning the same value between calls

10:31 jcromartie: What does (somefunc) return in the REPL?

10:31 is it what you'd expect?

10:32 MrJones98: yes, it's what i expect… i've been tweaking/experimenting with a bunch of stuff and my symptoms may have changed a little

10:33 if i do (somefunc) in the repl, and copy/paste the output into (def m <result of (somefunc)>), everything works as expected

10:34 if i do (def m (somefunc)), i get the same result as if i do (walk identity (somefunc))… so at least that part makes sense to me now

10:35 visof: i can't run this http://sprunge.us/DXPD and got ns HDTManager not found

10:35 jcromartie: visof: you are still putting your classes in lists?

10:35 visof: there are two ways to import classes into a namespace

10:36 (import 'foo.bar.Class)

10:36 or the prefix list way

10:36 (import '(foo.bar Class1 Class2))

10:36 visof: jcromartie: is this wrong?

10:36 gfredericks: ,(defn inc-double [x] (loop [x' (* 2 x)] (let [half-delta (/ (- x' x) 2) x'' (+ x half-delta)] (if (or (= x x'') (= x' x'')) x' (recur x'')))))

10:36 clojurebot: #'sandbox/inc-double

10:36 gfredericks: ,(inc-double 3.14)

10:36 clojurebot: 3.1400000000000006

10:36 jcromartie: when you say (import '(foo.bar.Class)) it's actually not going to import anything, because the list is interpreted as a prefix list with a package but no classes

10:37 i.e. it interprets (import '(foo.bar.Class)) as "import () from the package foo.bar.Class"

10:37 does that make sense?

10:37 visof: yeah

10:37 i'll change it now and try again

10:37 gfredericks: ,(inc-double 100.0)

10:37 clojurebot: 100.00000000000001

10:38 gfredericks: ,(inc-double 9e9)

10:38 clojurebot: 9.000000000000002E9

10:39 visof: after changing http://sprunge.us/GbSMM and i got this error: Caused by: java.lang.ClassNotFoundException: org.rdfhdt.hdt.hdt.HDT

10:39 jcromartie: alright, now we're getting somewhere :)

10:39 visof: correct http://sprunge.us/GbSM

10:40 jcromartie: so

10:41 are you using Leiningen?

10:41 visof: jcromartie: yeah

10:41 jcromartie: you should have a dependency for the hdt stuff

10:42 visof: jcromartie: [local/hdt-java-core "1.1.1"]]

10:42 jcromartie: huh, local?

10:42 visof: jcromartie: http://sprunge.us/aOSJ

10:42 jcromartie: yeah local, because it's a java jar

10:42 jcromartie: the [local/whatever "…"] in a dependency does not specify a repo

10:42 BTW

10:42 it's a group ID

10:43 MrJones98: i can't seem to create any cases (via the repl) where (clojure.walk/postwalk identity m) fails, regardless of what i put in for m

10:43 visof: jcromartie: yeah i know :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}

10:43 jcromartie: so you would have to have installed that lib under a "local" group ID

10:43 OK

10:43 so

10:43 what's in maven_repository?

10:43 visof: jcromartie: http://sprunge.us/WeNf

10:44 jcromartie: there's no group

10:44 it should be maven_repository/local/hdt-java-core/1.1.1

10:44 visof: yeah

10:44 it's

10:44 but i have cd maven_repository; tree

10:44 jcromartie: still wrong

10:45 visof: what wrong?

10:45 jcromartie: it's not going to find an artifact with the group ID "local", artifact ID "hdt-java-core", version "1.1.1"

10:45 if it's /maven_repository/hdt-java-core/1.1.1

10:45 that's wrong

10:45 you need /maven_repository/local/hdt-java-core/1.1.1

10:45 visof: it's maven_repository/local/hdt-java-core/1.1.1

10:45 jcromartie: oh ok

10:46 you said "cd maven_repository; tree"

10:46 visof: yeah

10:46 jcromartie: and I don't see "local"

10:46 I see "."

10:46 here http://sprunge.us/WeNf

10:46 visof: it's ok

10:46 jcromartie: OK

10:46 visof: now?

10:46 is there anything i did wrong?

10:47 jcromartie: well presumably

10:48 also what happened to all the quotes in your project.clj

10:49 http://sprunge.us/aOSJ

10:51 visof_: jcromartie> well presumably9 the last thing i got

10:51 jcromartie: what else you paste?

10:51 jcromartie: also what happened to all the quotes in your project.clj

10:52 http://sprunge.us/aOSJ <— is missing quotes

10:52 visof_: jcromartie: the site

10:52 jcromartie: O

10:52 are you running your project in a REPL?

10:52 if you updated the project.clj you would need to restart

10:52 visof_: jcromartie: https://www.refheap.com/85177

10:52 jcromartie: but this local custom maven repo thing is probably hugely messy… there has to be a better way to do it

10:53 why do you have it in a "local" group instead of the normal group that the lib uses?

10:53 visof_: jcromartie: what should i do?

10:53 jcromartie: oh also

10:53 visof_: jcromartie: mvn install:install-file -Dfile=hdt-java-core-1.1.1-SNAPSHOT.jar -DgroupId=local -DartifactId=hdt-java-core -Dversion=1.1.1 -Dpackaging=jar

10:54 jcromartie: remove groupId=local ?

10:54 jcromartie: alright that should be fine

10:54 OK

10:54 your :repositories

10:54 should be a vector of vectors, not a map

10:54 i.e.

10:54 :repositories [["local" ~(str (.toURI (java.io.File. "maven_repository")))]]

10:54 also, you can define vars up above defproject if you want to

10:55 so you could say

10:55 (def local-repo (-> "maven_repository" java.io.File. .toURI str)) then later just ~local-repo

10:55 keep your defproject cleaner

10:56 visof_: okay

10:56 now

10:56 what do you think about fixing this?

10:56 jcromartie: so have you updated your :repositories in project.clj?

10:57 visof_: yeah

10:58 jcromartie: and restarted your project?

10:59 visof_: jcromartie: i don't use repl

10:59 jcromartie: i can use it as java -cp hdt-java-core.jar foo.jar main.class ?

11:00 jcromartie: is this another way to use sdk from hdt-java-core.jar inside foo.jar?

11:01 MrJones98: jcromartie: in case you're interested… i think the problem was that one of my map values was a datomic entitymap so the walk was diving into the entity also and that's causing it to bomb

11:03 jcromartie: visof_: is there a reason you're using a custom build of the hdt lib?

11:03 visof_: jcromartie: is there another way to do this?

11:03 jcromartie: visof_: I mean is there a reason you're installing it locally rather than using one in the maven central repo, for instance

11:03 do you have custom changes to it?

11:04 visof_: jcromartie: nope

11:04 jcromartie: then use a repo where it already exists!

11:05 if you can live with 1.1, it's on maven central

11:05 visof_: jcromartie: http://mvnrepository.com/artifact/org.rdfhdt/hdt-java-core

11:05 jcromartie: do you need 1.1.1?

11:05 visof_: nope

11:05 jcromartie: so what should i do?

11:05 jcromartie: jesus christ

11:05 excuse me

11:05 use that!

11:06 [org.rdfhdt/hdt-java-core "1.1"]

11:06 done

11:06 no custom repos

11:07 sorry I assumed you had a reason to go through all the pain of an extra custom local maven repo

11:08 but it is really easy to grab most open source maven artifacts, because Leiningen includes maven central

11:08 visof_: jcromartie: thanks

11:10 jcromartie: this HDTManager.loadHDT return HDT type which i use HDT hdt = HDTManager.loadHDT.... ; hdt.search("", "", "");

11:10 jcromartie: how can convert hdt.search() to clojure

11:12 TEttinger: visof_: http://clojure.org/java_interop

11:12 * jcromartie needs a break :)

11:12 alejandro: visof_: something like (.search (HDTManager/loadHDT))

11:32 clgv: visof_: do yourself a favour and speed up your learn process by buying and reading one of those excellent clojure books ;)

11:51 ghadishayban: I'm having trouble importing a closure library enum http://docs.closure-library.googlecode.com/git/namespace_goog_history.html goog.history.EventType

11:53 It's for use with gf3/secretary. I see there is a closed issue https://github.com/gf3/secretary/issues/20 Compiler passes it, but page doesn't load

11:56 Can anyone help me refer to that from clojurescript? It's strange because it's an enum, and goog.require barfs with "undefined nameToPath for goog.history.EventType"

11:56 danno: So with (def ^:dynamic x 10) isn't ^:dynamic redundant? since all def and defn is a dynamic root binding?

11:57 ghadishayban: danno: dynamic is not the default anymore, it's opt-in

11:59 danno: ok, thanks ghadishayban

12:07 ghadishayban: Ok I successfully imported it, my cljsbuild output-dir was off

12:47 rolfb: o/ i'm working through problems on 4clojure, but i'm not sure if the problem is badly stated on http://www.4clojure.com/problem/53 ... should I use subseq or not?

12:49 jcromartie: it's not forbidden

12:51 cbp: vectors are not sorted collections so I doubt you can use subseq there

12:51 rolfb: any hints to what I should be doing?

12:52 jcromartie: I think subvec is going to be more useful to you

12:53 rolfb: the docs doesn't even make sense to me for that function

12:53 where do I go to read up on it?

12:54 cbp: subseq is to be used with sorted-set's or sorted-map's

12:54 rolfb: (doc subseq)

12:54 clojurebot: "([sc test key] [sc start-test start-key end-test end-key]); sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true"

12:54 rolfb: what does ek mean here anyway?

12:55 end key?

12:56 lemonodor: no, it’s just a placeholder. “returns a seq of those entries with keys X for which (test (.. sc comparator (compare X key)) 0) is true

12:58 cbp: rolfb: what you need to do is recurse over the vectors you're given while accumulating groups of incrementing numbers. On each recursion you check if the next number is incrementing respective to the last group you have which tells you to add to that group or create a new group

12:59 rolfb: cbp: i've been considering that, but i hit a speedbump trying to pass a nested structure back via recur

13:00 dbasch: rolfb: I’m looking and how I did that problem, and I did exactly what cbp suggested

13:01 there’s nothing nested, just two vectors in my recur

13:01 and a couple of flags

13:02 rolfb: dbasch: what's your username? would love to follow your solutions when i'm done

13:02 cbp: If it makes things easier you can have two accumulators. One for the groups and another for the last group you have

13:02 dbasch: rolfb: dbasch :) not particularly proud of my solutions though, there are much better ones

13:02 rolfb: more data is good ;)

13:03 dbasch: there are a few that I like, the rest are mostly embarrasing

13:03 jcromartie: I did this one without recursion

13:03 it might be really bad performance-wise though

13:03 rolfb: jcromartie: oh?

13:03 jcromartie: yeah

13:03 rolfb: i can make a list of conditions that will pass the test

13:03 :P

13:04 would be without recursion as well

13:04 dbasch: I didn’t use recursion either, just a plain old loop-recur

13:04 rolfb: recur is ... recursion?

13:04 dbasch: (doc recur)

13:04 clojurebot: Titim gan éirí ort.

13:05 dbasch: ,(doc recur)

13:05 clojurebot: Gabh mo leithscéal?

13:05 rolfb: haha

13:05 :)

13:06 jcromartie: rolfb: loop/recur is recursion if you ask me

13:06 I did it entirely with seq fns

13:06 https://www.refheap.com/85181

13:06 dbasch: jcromartie: loop / recur is definitely not recursion

13:06 sdegutis: How do you usually pass plain old Clojure data from Clojure to ClojureScript?

13:07 cbp: application/edn? :-P

13:07 sdegutis: I rendered an HTML element with a data-tag containing (pr-str [:foo :bar]) but I don't know how to evaluate it in ClojureScript, or if this is even the right way to do it.

13:07 lazybot is gone btw

13:08 jcromartie: edn/read-string

13:08 sdegutis: Oh, I could alternatively render it as JSON on the server-side and unroll it on client-side that way.

13:09 rolfb: jcromartie: need to read up on macros a bit more

13:09 jcromartie: dbasch: it is effectively the same thing as a fn that recurs, no?

13:09 sdegutis: cbp: I don't understand your answer.

13:09 jcromartie: Thanks I will look for where to download the EDN library for ClojureScript.

13:09 dbasch: jcromartie: no, it’s the same thing as a for loop in other languages

13:10 jcromartie: sdegutis: it should be included as clojure.edn

13:10 cbp: sdegutis: you can serve edn and set Content-Type: application/edn

13:10 dbasch: jcromartie: or at least you can use it that way

13:10 jcromartie: dbasch: yeah sure, but it's equivalent to setting up an anonymous fn that recurs and passing it initial args

13:12 dbasch: jcromartie: ok, but it’s semantics. Nobody would say that (for i = 0; i < 10 ; i++) is a recursive solution to anything

13:12 sdegutis: cbp: that sounds like a hack

13:12 jcromartie: Is that included with ClojureScript? I get the error goog.require could not find clojure.edn

13:13 Ah a staackoverflow post suggests it's "cljs.reader"

13:13 jcromartie: I guess not

13:13 sdegutis: Which seems to work, except now I have to track down *print-fn* and who's supposed to set it.

13:14 nullptr: you can see edn going in both directions @ https://github.com/swannodette/om-sync/blob/master/src/om_sync/util.cljs

13:14 sdegutis: Oh :)

13:15 It works!

13:15 (I forgot that you just have to do .log js/console

13:15 whodidthis: (js/console.log

13:15 cbp: you can put (enable-console-print!)

13:16 that lets you use println and so on

13:16 whodidthis: you know what really grinds my gears? printlns in dev tools pointing to the implementation of println

13:18 jcromartie: why in the world would println *not* do that by default

13:20 sdegutis: Alright everyone let's just all calm down.

13:20 Btw this worrrrks!!

13:20 whodidthis: i guess :( its just useful to know where prints are coming from in your code and console.log pretty bad at displaying clojure data

13:23 jcromartie: that makes some sense

13:23 coventry`: I almost never use raw console.log, I have a utility function which composes it with pr-str.

13:23 jcromartie: that would be much better

13:23 sdegutis: I guess I'm lazy then, for I always write (.log js/console whatever)

13:24 jcromartie: or convert clojure collections to JS ones, so that they can be inspected with the Chrome/Firefox console

13:24 bbloom: sdegutis: truly lazy would copy paste a function pp and then (pp whatever) :-)

13:25 sdegutis: Not so! For then I would have to keep track of that function and ensure that I delete it when I'm done with it.

13:25 That's extra work.

13:25 bbloom: sdegutis: why would you have to delete it?

13:25 sdegutis: Because it doesn't belong there.

13:25 bbloom: it's not hurting anyone... leave it there :-P

13:25 i have it in my lein profile tho for the clj

13:25 sdegutis: No! It is wrong!

13:25 bbloom: er rather the jvm

13:25 jcromartie: sdegutis: to have a util function?

13:25 sdegutis: why?

13:25 sdegutis: To leave a development function in production code.

13:26 whodidthis: would advanced compilation remove such function if it was never used anywhere

13:26 bbloom: sdegutis: that is a bad mentality

13:26 jcromartie: there is really no reason not to

13:26 sdegutis: I see.

13:26 jcromartie: I use production apps that console.log all the time

13:26 no qualms from me here

13:26 sdegutis: Thank you for your time.

13:26 ssswdon: defmacro question, I want to do the following

13:27 bbloom: sdegutis: if it was useful for debugging during development, it will be useful for debugging in production

13:27 sdegutis: all functions are production functions :-P

13:27 coventry`: Is this a teaching of Uncle Bob?

13:27 bbloom: Uncle BBloom

13:28 coventry`: I was asking sdegutis :-)

13:28 sdegutis: coventry`: Be you trolling, O sir?

13:29 cbp: nil

13:30 rolfb: thanks for the input everyone, need to get back to learning some principles

13:30 sdegutis: Thanks.

13:30 ssswdon: I would like to pass the following to a macro name my-iif (my-iif( > 3 9) :then(println 'false') :else'ok) and get the correct results. The best I can do is get a nil as results

13:31 coventry`: What is the correct result in that case?

13:31 ToxicFrog: ssswdon: ...what would you expect? println returns nil, no?

13:31 sdegutis: ssswdon: Are you sure you want to create a macro?

13:31 shaungilchrist: 'false' is going to be problematic as well

13:32 ssswdon: if I use reverse case I don't get the ok just nil

13:32 sdegutis: coventry`: No, it is my own idea.

13:32 ToxicFrog: ,(if (> 3 9) (println 'false') 'ok)

13:32 clojurebot: ok

13:32 ToxicFrog: wait

13:33 seangrove: Any way to "name" a time?

13:33 ToxicFrog: Oh, I see.

13:33 seangrove: (time do-something "Do something")

13:33 ToxicFrog: The way you wrote that is confusing as hell, ssswdon

13:33 ssswdon: yeah let me give another example

13:34 (my-iif(> 3 9) :then 'false :else 'ok) this is passed to a macro

13:35 cbp: seangrove: I think only something like another macro + an atom with a map will do?

13:35 sdegutis: ssswdon: are you making Clojure more Ruby-like?

13:35 ssswdon: nope just playing with some macro

13:35 sdegutis: You may want to use refheap.com

13:36 coventry`: I don't see why you'd need an atom. What's wrong with this? https://www.refheap.com/85182

13:36 PigDude: hm how do you prevent duplication in your test code of common test params?

13:37 ssswdon: just trying to understand macors

13:37 cbp: Well I guess it depends how is the name going to be used

13:37 coventry`: Oh, I guess.

13:38 ToxicFrog: ssswdon: so, either ask questions about macros, or pastebin your implementation and ask questions about that?

13:38 clgv: ssswdon: (defmacro my-iif [expr & {:keys [then, else]}] `(if ~expr ~then ~else))

13:39 ,(defmacro my-iif [expr & {:keys [then, else]}] `(if ~expr ~then ~else))

13:39 clojurebot: #'sandbox/my-iif

13:39 clgv: ,(my-iif(> 3 9) :then 'false :else 'ok)

13:39 clojurebot: ok

13:39 ssswdon: let me play with that @clgv I will come back pastebin if needed

13:39 Thanks!

13:40 coventry`: ,(macroexpand '(my-iif(> 3 9) :then 'false :else 'ok))

13:40 clojurebot: (if (> 3 9) (quote false) (quote ok))

13:43 clgv: ,(symbol "wait what?")

13:43 clojurebot: wait what?

13:44 clgv: :D

13:44 coventry`: ,(keyword "I know, I know")

13:44 clojurebot: :I know, I know

13:45 amalloy: coventry`: fwiw, if you were actually trying to write a macro to simulate the non-sexp-friendly 'if, i'd suggest using :syms rather than :keys, so that it looks like (iif t then x else y)

13:46 coventry`: That clever macro was clgv's actually.

13:46 amalloy: or, really, not using & {...} at all, because you *know* some genius is going to write (if t else y then x)

13:46 well, it's your fault for having the same first letter as him. you get all the credit now

13:47 coventry`: Learning a new destructuring trick *and* undeserved credit for it. Such a deal!

13:48 amalloy: coventry`: see also :strs

13:48 handy for destructuring deserialized json

13:48 bbloom: amalloy: and a major reason why i simply don't believe in keywordize-keys :-)

13:49 clgv: amalloy: I just implemented it such that the given example runs ;)

13:50 amalloy: clgv: wellllll...his given example included the keyword :else'ok, which sounds like something an orc would say

13:52 AWizzArd: haha

13:52 clgv: amalloy: automatic error correction - I purchased that brain addon last week -seems to work ;)

13:58 jcromartie: oh, clojure-test-mode, where have you been all this time?

13:59 nullptr: jcromartie: melpa? :)

14:00 technomancy: wait... clojure-test-mode is not good software =\

14:01 jcromartie: OK wait

14:01 no it's not

14:01 why does it run more tests every time I run C-c C-,

14:02 WTF

14:04 technomancy: it's just a big monkeypatch

14:05 gtrak: funny to see monkeypatch nouned.

14:05 conjures a field a monkeys.

14:05 of*

14:05 shaungilchrist: https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRklQbX8XAroKzht35BqhfkAjZrBP2zB2zg7cv7thN0QSIPUeHMOw

14:06 gtrak: monkey patches: https://www.google.com/search?q=monkey+patch&es_sm=122&source=lnms&tbm=isch&sa=X&amp;ei=iyNpU471BPLCyAGd1ICgCg&ved=0CAkQ_AUoAg&biw=950&bih=478

14:07 jcromartie: WHYYYYYYYY

14:07 I'm scared

14:10 ok but seriously, why does C-c C-, keep adding to the tests that are run every time?

14:10 maybe I need to RTFS

14:19 guns: Does tools.analyzer{,.jvm} provide enough information to build a tool that detects if a Closeable object is closed in the same scope in which it is created?

14:20 Setting up the analyzer takes a bit of work, so I thought I'd ask here first

14:22 bbloom: guns: could maybe do something for very simple cases, but determining that sort of thing more generally requires abstract interpretation. the analyzers are lexical

14:22 guns: bbloom: Do you think it would be possible at least for type hinted forms?

14:22 amalloy: guns: imagine (let [c (Closeable.) f (fn [x] (.close x))] (f c))

14:23 you have to know a lot about the lambdas you're calling to realize that this really is closed inside its creation scope. is that part of the goal?

14:24 bbloom: guns: what you can do: detect and warn if a closable local comes in to existence but is not directly passed to a with-open call

14:24 anything beyond that requires symbolic execution

14:24 guns: it also won't work for deftype and other runtime-created types that may implement Closable

14:24 guns: again, that would require symbolic execution

14:25 guns: amalloy: Unfortunately, I don't see the problem with that

14:25 bbloom: I was hoping that the analyzer was capable of this. There is an Eclipse plugin that purports to do something similar

14:26 bbloom: guns: the analyzer serves the needs of a static compiler

14:26 guns: and lexical macros

14:26 waynr: gws: that might help

14:26 bbloom: guns: it does not aim to do dynamic analysis of any kind

14:27 guns: i believe core.typed does some symbolic execution, however. ambrosebs ?

14:27 amalloy: i'm curious what that eclipse plugin thinks of {final Closeable x = whatever; y = new Runnable() {public void run() {x.close();}}; y.run();}, and the same thing with the y.run() excluded

14:27 ambrosebs: bbloom: what does that mean?

14:27 amalloy: and i guess the same thing with: if(true) y.run();

14:28 guns: amalloy: I suppose it would respond "maybe closed". It looks like it checks for a literal try or try-with-resource

14:28 bbloom: ambrosebs: https://en.wikipedia.org/wiki/Symbolic_execution

14:32 ambrosebs: bbloom: seems like a bit of a stretch. core.typed isn't that smart.

14:32 bbloom: ambrosebs: don't you do some kind of occurrence typing?

14:32 ambrosebs: ah yes

14:32 I get it

14:33 there's a separate proposition environment that relates bindings + paths to types

14:33 helps with branch elimination and other things

14:34 bbloom: ambrosebs: guns was wondering if he could use tools.analyzer to identify obviously broken usages of Closeable objects

14:34 i told him probably not, but core.typed *might* be able to stretch to do it

14:35 ambrosebs: bbloom: like don't close things twice?

14:35 etc

14:35 bbloom: guns: ?

14:35 i figured like not use a try/finally construct such as with-open

14:35 guns: No, just warn that Closeable objects should generally be closed within the same scope

14:36 not looking for 100% accuracy

14:36 ambrosebs: the area of affine types is related to resource management in type systems

14:37 I've been looking at it recently, I'm not sure if it fits with core.typed.

14:37 http://www.eecs.harvard.edu/~tov/pubs/alms/tovpucella-alms.pdf

14:38 guns: is it easy to tell where Closeable things are created/scoped?

14:38 do you need a full type system to figure it out?

14:39 Affine types could enforce programmers use transients correctly.

14:40 guns: ambrosebs: A fn that is tagged as a Closeable type, and use of the new form could tell you where a Closeable is created, no?

14:40 And multiple .close calls on Closeable objects are not generally a problem

14:41 False positives are also not a problem; this would be a developer tool

14:41 ambrosebs: I don't know anything about Closeable tbh

14:42 could you give an example?

14:42 guns: there's not much to know; classes implementing Closeable represent resources that should be manually closed

14:42 Readers Writers, etc

14:42 InputStreams

14:42 ambrosebs: ahk

14:43 what's a bad example of using Closeable?

14:43 guns: Closing resources at the same scope in which they are created is a sane way of dealing with them; like RAII

14:43 ambrosebs: not closing an open file handle :)

14:44 amalloy: false positives aren't a problem, huh? i got your tool right here: (constantly true)

14:44 guns: amalloy: :). one step closer

14:45 I guess I'll take a look at the Eclipse plugin and see if can be extracted for general use

14:45 mikerod: So, is it true that the `map-><record-name>` factory ctor function created via `defrecord` is actually much slower than calling the "real" ctor or the `->recordname` factory ctor performance-wise?

14:46 I tried profiling a bit

14:46 ambrosebs: guns: it sounds possible. Would like to see some real macroexpansions of good/bad usage, I could comment more precisely

14:46 mikerod: map-> definitely seems to get much slower when called many many times

14:46 *I mean the performance diverges from the others quite a bit

14:47 It seems the hot spot comes down to <record-class>#create method

14:47 amalloy: mikerod: i would be surprised if it were close to being as fast

14:47 mikerod: amalloy: it is much slower when I call it over 1mil times or so

14:48 amalloy: (Record. x y z) is one constructor call. (map->Record {:x x :y y :z z}) is at least three map lookups, plus probably three dissocs, and then a constructor call

14:49 mikerod: I was seeing ~50618.376 msecs for 10million calls to map-> vs. ~17.204 msecs for 10mil calls to -> vs. ~8.771 msecs for the actual ctor

14:50 amalloy: I figured there was some overhead happening. I actually saw bad performance degradation when I switched to map-> since I had a record with a lot of args; positional gets ugly

14:50 However, looks like I will need to be keeping positional around for now :)

14:51 amalloy: i don't think it should be three thousand times slower

14:52 you said "much slower", which i think is true: it should be like three times slower

14:52 mikerod: amalloy: hmmm

14:52 guns: ambrosebs: https://gist.github.com/guns/bc722e7ffd9ad1ee92ee

14:52 mikerod: When my perf issue initially came up it was in a complex scenario. However, the numbers I just ran I stripped down to just a `dotimes` loop

14:52 guns: example file handle leak I wrote recently

14:53 mikerod: The only interesting part was that I'm dealing with a record of about 15 fields. Maybe that weighs in... I cannot figure out where this #create method is generated for a defrecord.

14:54 ambrosebs: ,(source with-open)

14:54 clojurebot: Source not found\n

14:54 amalloy: mikerod: clojure.lang.Compiler$NewInstanceExpr/emitStatics

14:54 coventry`: Why can't (io/file file) close itself when it goes out of scope and is gc'd?

14:55 mikerod: amalloy: ah, hidden int he Compiler

14:55 amalloy: do you have the code for your example dotimes?

14:55 mikerod: in the*

14:55 amalloy: coventry: File objects don't need to be closed

14:55 ambrosebs: guns: what you want is simple to write.

14:55 coventry`: amalloy: Well, the FileInputStream in guns's example, then.

14:56 amalloy: and these things *do* close themselves when they get GCed. but since no correct program can rely on garbage collection being run ever, that's too late

14:56 ambrosebs: guns: use tools.analyzer to recurse down the macroexpansion until you hit a :let

14:56 https://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/check.clj#L4398

14:56 amalloy: what if you opened one file per millisecond, on a machine with 5TB of ram? you'd leake file handles for hours before the garbage collector felt any pressure

14:56 coventry`: amalloy: Oh, I see.

14:57 amalloy: http://blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx is a good article about gc philosophy

14:58 guns: amalloy: That's just one kind of leak; closing resources is a good practice

14:58 dbasch: file descriptor leak has always been an issue to watch out for in Java

14:59 mikerod: amalloy: I tink I can get one up

14:59 Jaood: is clojure.java.io just a wrapper to java.io ?

14:59 mikerod: *think (can't type today)

14:59 guns: amalloy: Thanks for the lead! this is the answer I was looking for

14:59 ambrosebs: ^ meant for you

14:59 amalloy: bbloom: guns is thanking you

14:59 oh, ambrosebs? okay. bbloom brought ambrosebs in

14:59 guns: and bbloom :)

15:00 ambrosebs: guns: the details should be straightforward, let me know if you get stuck

15:00 rolfb: jcromartie: seems like there's a lot of bugs in your solution

15:01 re https://www.refheap.com/85181

15:01 or, one atleast ;)

15:01 try calling it with [1 2 3]

15:02 bbloom: amalloy: guns: ambrosebs: :-)

15:03 amalloy: rolfb: yeah, he needs to add an (inc) in between (count v) and (range 2)

15:03 and also, oh my god, that ->> makes things completely illegible

15:03 rolfb: what's the difference between -> and ->> ?

15:03 is it as simple as left to right and right to left?

15:03 amalloy: ,(macroexpand '(->> 1 (f x y z)))

15:03 clojurebot: (f x y z 1)

15:03 amalloy: ,(macroexpand '(-> 1 (f x y z)))

15:03 clojurebot: (f 1 x y z)

15:03 dbasch: rolfb: where they expect the argument

15:04 rolfb: amalloy: interesting trick

15:04 i'm called away, ttyl, thanks for information :)

15:06 foofoobar: someone coding clojure in atom (atom.io editor) ?

15:08 amalloy: mikerod: you can also inspect the bytecode for MyRecord/create, which is probably easier than trying to understand the assembly stuff in the compiler

15:12 for a record with three args, (map->MyRec m) is basically (let [x (:x m), m (dissoc m :x), y (:y m), m (dissoc m :y), z (:z m), m (dissoc m :z)] (MyRec. x y z nil (not-empty m)))

15:13 whereas (->MyRec x y z) is (MyRec. x y z nil nil)

15:13 mikerod: amalloy: hmm, yeah decompiled is easier

15:13 I'm trying to reproduce

15:13 my minimal attempt to reproduce got me about a 3x slow down, as you anticipated

15:13 https://gist.github.com/mrrodriguez/e2138f220a9aa7eacc20

15:14 However, my real example had a more "complex" map as the argument to map-> factory

15:14 so I'm trying to see what could make the difference

15:14 amalloy: mikerod: oh man, that benchmark is no good

15:14 you're timing the creation of the map as well as turning it into a record

15:14 (let [m {...}] (time (dotimes ...))) is what you need

15:16 also, use criterium instead of time/dotimes - hugod is better at benchmarking than you or i

15:19 mikerod: amalloy: Valid points, I'm fairly sure my original code didn't suffer from timing the map creation as well. I was observing very significant slowdown in my real example, and I don't think it was called anywhere near 10mil times.

15:19 This is a good library though that I wasn't aware of.

15:19 *looks good

15:24 agarman: I ran with criterium... map->MyTest 4 microsecond on my rig vs new taking 17 nanoseconds

15:25 5 microseconds actually

15:25 amalloy: mikerod: in a way, though, a thousand times slower isn't *crazy* for a record with many keys, since dissoc/get have linear performance on maps with just a handful of keys

15:25 PigDude: is there update-in for single case?

15:25 amalloy: so doing a linear number of them takes quadratic time

15:25 PigDude: i forgot the name, pretty sure there is a function for this

15:26 gtrak: PigDude: nah.

15:26 PigDude: like how swap! works but for replacing a key

15:26 gtrak: hm ok

15:26 gtrak: just a weird quirk :-)

15:27 dbasch: PigDude: you mean like clojure.set/rename-keys ?

15:27 mikerod: amalloy: There is an interesting comment and re-implementation of defrecord in the Prismatic schema library. https://github.com/Prismatic/schema/blob/master/src/clj/schema/macros.clj#L407

15:27 PigDude: dbasch: nah, just for updating a value in-place

15:27 mikerod: It seems they make the claim that map-> is "400x slower" than the -> factory

15:28 gtrak: I believe it.

15:28 PigDude: hm so is this the idiomatic way to append to a list in a hash? (update-in h :the-vec (partial concat appended)) ?

15:28 gtrak: but 400x slower is still pretty fast.

15:28 {blake}: "No facts were checked. Is that what you wanted?" Well, no, midje, that's not what I wanted. Any hints on how to make :autotest actually, you know, =test= when a file is changed?

15:28 PigDude: er, [:the-vec]

15:28 gtrak: PigDude: looks reasonable.

15:28 arrdem: now if only schema could generate schemas from xss source...

15:29 PigDude: gtrak: there's not some shorthand for partial that i'm missing is there?

15:29 gtrak: kinda wordy :P

15:29 amalloy: PigDude: if you're appending, you probably should have a vector rather than a list

15:29 PigDude: amalloy: right, a vector, sorry

15:29 amalloy: and then you can just use into, instead of partial concat

15:29 gtrak: PigDude: could just use it without the partial.

15:30 (update-in h [:the-vec] concat appended)

15:30 PigDude: ah, i see

15:30 gtrak: update-in uses apply and supplies the first arg to concat.

15:30 appended would be the second.

15:30 PigDude: amalloy: how does into differ from concat?

15:30 amalloy: besides concat taking several collections

15:31 amalloy: &(into [1 2 3] [4 5 6])

15:31 gtrak: concat returns a lazy seq, into is essentially reduce+conj

15:31 amalloy: ,(into [1 2 3] [4 5 6])

15:31 clojurebot: [1 2 3 4 5 ...]

15:31 amalloy: i hate all bots

15:31 PigDude: ,(= (into [1 2 3] [4 5 6]) (concat [1 2 3] [4 5 6]))

15:32 clojurebot: true

15:32 PigDude: oh ok

15:32 gtrak: that's because equality doesn't care about seq vs vector.

15:32 amalloy: PigDude: but one of those is a vector, and the other is a lazy seq

15:32 gtrak: 'equality partitions' or whatever.

15:32 PigDude: so (update-in h [:k] into v2)?

15:32 gtrak: beautiful

15:33 PigDude: thanks for the help, i am still pretty new to clojure

15:33 arrdem: remind me why we don't have clojure.core/update ....

15:33 gtrak: because we're lazy bastards

15:33 arrdem: (inc gtrak) ;; truth hurts

15:33 riiight. I'm bot ignored.

15:33 lazybot: ⇒ 9

15:34 amalloy: arrdem: what does (clojure.core/update m a b c d e) do?

15:34 bbloom: http://dev.clojure.org/jira/browse/CLJ-1251

15:34 arrdem: bbloom: cheers, voted up

15:35 amalloy: bbloom's link is perfect :P

15:35 amalloy: arrdem: no, it doesn't address the question i asked

15:35 gtrak: throws an error.

15:35 amalloy: okay, three

15:35 er

15:35 arrdem: amalloy: oh, in that case I'd accept an arity assertion failure or an identity update.

15:36 amalloy: arrdem: but the point is, are a/b, c/d, etc alternating pairs of key/function? or are they varargs to be passed to a single update function on a single key?

15:36 ie, (update-in m [a] b c d), or (-> m (update-in [a] b) (update-in [c] d)))

15:37 (ignore the e, because i can't count)

15:37 gtrak: ah, I guess the second behavior is more intuitive, michael church's update could be given a different name.

15:38 more inline with the other functions.

15:38 in<space>line

15:38 arrdem: amalloy: ah. yeah I'm with gtrak, being able to do multiple updates with a single form is cute, but I'd rather have as you say varargs (more like update-in) than have to use partials for multiple updates.

15:38 bbloom: i didn't read the ticket closely

15:39 i'd also prefer varargs

15:39 gtrak: update-multi?

15:39 amalloy: arrdem: that's exactly the opposite of what gtrak said, i think

15:39 * arrdem reads more carefully

15:39 gtrak: amalloy: but I think I agree with what arrdem just said.

15:39 amalloy: anyway, what i'm getting at is that the reason there's not already a clojure.core/update to mirror clojure.core/assoc is because it's not clear what it should do, and reading it isn't obvious

15:40 arrdem: gtrak: I vote that you are an inconsistent node and should be ignored...

15:40 gtrak: arrdem: It's probably for the best.

15:40 I reserve the right to change my opinion instantly and tell noone.

15:42 arrdem: did you see the mailing list thread about the varargs map? I thought it was funny.

15:42 while you were having finals.

15:42 arrdem: gtrak: neg. that I'm back here is a poor choice I'll remedy once the coffee's done brewing

15:43 gtrak: basically, they were like

15:43 'Did cognitect suddenly change their position on varargs map-destructuring? Can anyone confirm or deny??!??!'

15:44 ambrosebs: ninja edit

15:44 foofoobar: I just read on the LightTable website that it is written in ClojureScript. How can this be? I thought ClojureScript is compiled to javascript?

15:45 gtrak: foofoobar: yes

15:45 arrdem: hahahaha oh right I tweaked the wiki :P

15:45 foofoobar: gtrak, so LightTable is written in javascript?

15:45 arrdem: foofoobar: and it runs on node

15:45 gtrak: foofoobar: https://github.com/LightTable/LightTable/tree/master/src/lt

15:45 foofoobar: oh, okay. Thats interesting! I did not know you can create GUI applications with node

15:46 gtrak: foofoobar: node-webkit is the shell that runs it all: https://github.com/rogerwang/node-webkit

15:47 essentially it allows node.js to share memory with the browser dom JS transparently.

15:47 foofoobar: Okay. This is nice! LightTable looks awesome!

15:47 gtrak: so you can start up a system tray menu and mutate the dom in a single function :-)

15:48 cbp: hopefully they keep developing it, in view of that aurora thing =/

15:48 gtrak: foofoobar: I have a tiny example of node-webkit from cljs right here: https://github.com/gtrak/node-cljs-template/blob/master/src-cljs/src/cljs_app/node_bits.cljs

15:49 foofoobar: gtrak, thanks, I'll have a look at it.

15:50 gtrak: it boots up a system tray and the main window of the app, I do that manually so there's no visible page-load delay.

15:51 kelseygi: what are reasonable JVM opts for a lil app running on a 1gb machine?

15:52 gtrak: kelseygi: I heartily recommend the G1 collector for lower memory usage with no downside, if run with -server.

15:52 kelseygi: ooh, a hearty recommendation!

15:52 gtrak: -XX:+UseG1GC

15:53 I think later versions of 6 can do it, but I haven't tested, 7 and 8 are great with it.

15:53 kelseygi: howsabout heap size & the such

15:54 gtrak: probably less than your max memory. If it gets too big, stuff might be paged out and you'll have swap-hell. The jvm isn't super intelligent about responding to what's happening at the OS level.

15:54 G1 at least is more aggressive about freeing unused heap back to the OS.

15:57 I was running a few JVMs on my dev-laptop, it got unusable without it on 8GB, since it's 2 jvm's per lein process, and I had a few going at once, plus some other stuff.

15:58 kelseygi: yeah this is for an extremely silly twitter bot

15:58 and i decided to have a go of deploying it myself on a lil server

15:58 but it's slooooooowwwwww to boot up

15:58 and tends to die

15:58 so i'm thinking i'm doing something incorrect

15:58 gtrak: why's it die?

15:59 kelseygi: i'm not sure tbh--i'm just doing nohup lein trampoline run, nothing very clever or, uh, nice

15:59 gtrak: there's no error or anything?

15:59 kelseygi: i'm sure there is but i don't think i'm saving it unfortunately

15:59 gtrak: heh, well, you should probably figure that out before you tweak jvm opts blindly.

16:00 kelseygi: oh hush, voice of reason

16:00 haha i think at first it was because i wasn't using trampoline

16:00 i don' tknow, it doesn't seem to respect nohup

16:00 it seriously takes like 5 min to start up though which is nuts

16:01 PigDude: what's this operation called?

16:01 ,(let [x 13] (- x (rem x 3)))

16:01 clojurebot: 12

16:01 gtrak: remainder?

16:01 PigDude: this is a compound operation

16:01 kelseygi: but it's also connecting to twitter so that could be another weak point? i have a long blog post about logging in clojure bookmarked :)

16:02 justin_smith: PigDude: truncate-to-multiple-of-3 ?

16:02 gtrak: kelseygi: if you could attach a jvisualvm process to it, that might tell you something.

16:02 but you should be logging stuff for sure.

16:02 kelseygi: yes yes

16:02 PigDude: eh nevermind :P

16:02 arrdem: well if nohup isn't doing it, just run it in screen or at :P

16:02 kelseygi: i tried screen!

16:02 gtrak: but it makes no sense for nohup to be the problem.

16:03 unless it does.

16:03 kelseygi: haha

16:03 gtrak: we can't know that until we know why.

16:03 kelseygi: known knowns, and known unknowns...

16:03 coventry`: What about a signature of (update m :key1 fn1 other-args1 :key2 fn2 other-args2), where other-args are seqs of values?

16:03 gtrak: kelseygi: you can simplify further, don't run it from lein, use an uberjar.

16:04 kelseygi: oh that's a good idea

16:04 justin_smith: kelseygi: lein uberjar; java -jar target/yourapp.jar

16:04 much better startup time if you find the need for restarts

16:04 also it's better not to run lein on production anyway

16:05 coventry`: (update m (fn1 k-or-ks1 other1 args1) (fn2 k-or-ks2 other2 args2)) seems like a pretty handy macro, actually.

16:05 kelseygi: there's a lot of things i'm doing here that are not really "production" quality...

16:05 but if you tweet "can i kick it" to @abotcalledquest it now responds with "yes you can"

16:05 very critical stuff :)

16:05 uberjar is a good idea though

16:05 will try that after work, thank you!

16:05 justin_smith: np

16:06 if nothing else it will restart faster after a crash if it is an uberjar :P

16:06 arrdem: heh

16:09 gtrak: kelseygi: https://www.youtube.com/v/t5CZJwB5R2k&start=18&end=26

16:09 kelseygi: lololol

16:10 noonian: i can't wait for prismatic to release some of their other libs

16:10 all of their talks are like teaser trailers for their unreleased stuff lol

16:13 kelseygi: the blog post if anyone's interested: http://nerd.kelseyinnis.com/blog/2014/05/06/talking-to-yourself-a-twitter-bot-in-clojure-by-a-total-newb/

16:13 the sequels, about switching to streaming API and then deploying, will feature a lot more cursing

16:16 gtrak: kelseygi: were you the one asking about chunking in the streaming API?

16:16 kelseygi: yup!

16:16 gtrak: ah ok.

16:16 kelseygi: i got it working with atoms

16:16 but also got some good feedback on making it better

16:16 gtrak: err wait, that was a different guy.

16:16 Simon Katz.

16:17 kelseygi: https://groups.google.com/forum/#!searchin/clojure/twitter$20api/clojure/dLMjY2i9tCg/voplu7ek9XQJ

16:18 kelseygi: oh sweet!

16:18 i did get to play with atoms to get it running which was pretty cool

16:18 gtrak: not sure if this should make it back into twitter-api or what.

16:18 but you can see my core.async impl there.

16:18 kelseygi: i opened an issue and he basically said "nope"

16:18 thank you, rad!

16:18 seangrove: I want to walk through a tree, picking off a key at every node, and collate them all into a single collection - or ideally, into a hashmap, with the path to the value as the key, and the value at the path as the value, and I want to do it with the absolute minimum pressure on the GC. What's the best pairing of tools?

16:19 kelseygi: here is mine, which is terrible https://github.com/kelseyq/clojure-twitter-bot

16:19 but i am like 10 days into clojure :)

16:19 seangrove: I could easily map through it, flatten the list, and then into {}, but that feels very wasteful if I care about gc

16:19 gtrak: my core.async code is write-only at this point.

16:19 I have no idea how to test it.

16:20 arrdem: seangrove: flatten is almost certainly the wrong answer...

16:20 seangrove: I'd probably build a custom recursive walk, or even an iterative worklist walk.

16:20 gtrak: seangrove: filter+tree-seq?

16:20 arrdem: ,(doc tree-seq)

16:20 clojurebot: "([branch? children root]); Returns a lazy sequence of the nodes in a tree, via a depth-first walk. branch? must be a fn of one arg that returns true if passed a node that can have children (but may not). children must be a fn of one arg that returns a sequence of the children. Will only be called on nodes for which branch? returns true. Root is the root node of the tree."

16:20 arrdem: damnit clojure y u so osum

16:22 gtrak: I used it on a massive clojure.data.xml thing to great effect.

16:22 seangrove: gtrak: That doesn't help me trak the path into the tree, and still going to be rough on gc

16:22 I'll play around with it a bit more though

16:22 gtrak: but it was relatively flat, I assume if it's not flat, then that takes up space.

16:22 seangrove: thanks gtrak

16:23 stompyj: xml?

16:23 clojurebot: xml is like violence; if it's not working, you're not using enough of it.

16:23 stompyj: red flag

16:23 :D

16:23 arrdem: :D

16:23 technomancy: ~botsnack

16:23 clojurebot: thanks; that was delicious. (nom nom nom)

16:24 stompyj: remember the days of CORBA, and RMI, and WSDL, and XML

16:24 man

16:24 what the hell were we all thinking

16:24 the saddest thing was, I was on board with it at the time

16:24 arrdem: I heard about CORBA from my software engineering lecturer and was promptly glad that I grew up with json-rpc

16:25 stompyj: the late 90s were a rough ride

16:25 heh

16:25 arrdem: I was about five at the time >.>

16:25 stompyj: hahahahah

16:26 I was 18-ish *cough*

16:26 so I can claim architectural ignorance

16:27 gtrak: stompyj: I once felt bad about getting turned down from a gig due to not having enough experience with OO. They used CORBA.

16:27 this was only 5 years ago.

16:27 stompyj: O_O

16:27 arrdem: hahahahaha

16:27 oo?

16:27 stompyj: We now have proof purgatory exists

16:28 gtrak: it's in Florida, at Harris corp.

16:28 stompyj: Did they want ERwin experience? LOL

16:30 sorry, I’ve taken us to some dark corners here

16:30 (dec stompy)

16:30 lazybot: ⇒ -1

16:30 gtrak: I'm really glad now that I didn't get that job, I might've taken it.

16:30 stompyj: yeah man, you’d be hating life right now

16:36 mordocai: I have emacs 24.3.1 with the lasest cider and nrepl packages from melpa and am having an issue where errors are not printed to the cider repl. If I connect through lein I see the errors. I googled this a bit, but most results were talking about errors with older versions of nrepl and/or cider. Any ideas?

16:36 latest*

16:37 arrdem: mordocai: you're running cider 0.7.0, you need to add cider-nrepl to your lein profile

16:37 mordocai: it's an unannounced breaking change from the Cider maintainer :D

16:37 mordocai: arrdem: Ah, i'm new to clojure. Can you give step by step directions or a link? :P

16:37 arrdem: $google cider-nrepl

16:37 lazybot: [clojure-emacs/cider-nrepl · GitHub] https://github.com/clojure-emacs/cider-nrepl

16:38 gtrak: except 0.7.0-SNAPSHOT is probably what you want.

16:38 mordocai: Ah, nice. Right at the top. Thanks!

16:38 gtrak: still churning a lot right now.

16:38 arrdem: mordocai: you want to add [cider/cider-nrepl "0.6.0"] to your profile, not the .1-SNAPSHOT

16:38 mordocai: gtrak: That's what it reports

16:38 arrdem: fuck snapshots

16:38 gtrak: arrdem: 0.6.0 is totally broken.

16:39 arrdem: gtrak: for real? working on both my machines...

16:39 gtrak: ok, maybe not totally.

16:39 arrdem: heh.

16:39 gtrak: try doing M-. on a function with a map-arglist.

16:39 arrdem: mordocai: gtrak is one of the contribs, I'd go with what he says :P

16:40 gtrak: 0.6.1-SNAPSHOT has an asm dependency that's broken for my work-project.

16:40 0.7.0-SNAPSHOT should be relatively stable now.

16:41 we'll do a real release next time, I promise :-)

16:41 arrdem: gtrak: <3

16:42 gtrak: I was hoping to add CLJS support and be done with it, I'm ending up just being dependency and stability police.

16:43 mordocai: Alright, seems to work now. Thanks!

16:43 gtrak: b/c I hate breaking people.

16:43 mordocai: On with "The Joy of Clojure"!

16:44 PigDude: in python / is an integer division operator, so 5/2 = 2. what's the equivalent in clojure?

16:44 gtrak: ,(int (/ 5 2))

16:44 clojurebot: 2

16:44 nightfly: (/ 5 2)

16:44 clojurebot: 5/2

16:44 PigDude: gtrak: thanks

16:44 gtrak: long's probably better, actually.

16:44 since the rest of clojure uses longs

16:44 ,(long (/ 5 2))

16:44 clojurebot: 2

16:44 pyrtsa: ,(quot 5 2)

16:44 clojurebot: 2

16:45 gtrak: ahh, I like that better

16:47 amalloy: seangrove: i'm curious what you're doing that you think optimizing for gc is necessary

16:48 bbloom: amalloy: he's trying to run a layout engine smoothly during browser resizing

16:49 amalloy: ah. if you're not on the jvm, optimizing for gc is not unreasonable

16:55 mordocai: Alright, so emacs crashed on me -.-. In any case, now that I restarted emacs i'm back where I started despite having the profiles.clj. However, now cider reports version CIDER 0.7.0alpha instead of SNAPSHOT. What'd I do wrong this time? :(

16:55 arrdem: mordocai: that's the expected CIDER version.'

16:55 mordocai: did you add that plugin to your ~/.lein/profiles.clj?

16:56 mordocai: arrdem: Ah, well before it said snapshot. And now it isn't working again (same symptoms, no error reporting). My profiles.clj is what it was before which is "{:user {:plugins [[cider/cider-nrepl "0.7.0-SNAPSHOT"]]}}"

16:56 Do I need to change that to alpha or something?

16:56 arrdem: mordocai: that should be the 0.6.1-SNAPSHOT

16:57 unless gtrak says that's silly.

16:57 gtrak: mordocai: that sounds reasonable.

16:57 0.7.0 should be working.

16:57 mordocai: Ah, kk. I thought he was saying it should be 0.7.0

16:58 gtrak: Back to working when I change it to 0.6.1-SNAPSHOT. I could help you debug if you can tell me how to get debug info with 0.7.0

16:59 gtrak: really? that's very odd.

16:59 I'm using 0.7.0 all day without issues.

16:59 arrdem: gtrak: 0.7.0 or -SNAPSHOT...

16:59 gtrak: snapshot

16:59 lemme try updating my cider version to what's on melpa.

17:00 arrdem: better do a git-commit and tag first...

17:00 just in case everything breaks >.>

17:00 gtrak: meh

17:00 seangrove: amalloy: user-land layout in the browser

17:00 gtrak: dogfooding.

17:01 amalloy: crashed emacs? i've found that almost impossible; the best i've managed is to once or twice send it into an unresponsive coma

17:02 mordocai: gtrak: It looks completely different btw, if that helps. With 0.6.1-SNAPSHOT I get a buffer *nrepl* and with 0.7.0-SNAPSHOT I got a *cider localhost* or something along those lines.

17:02 amalloy: Yeah, that's actually what happened

17:02 amalloy: which?

17:02 mordocai: amalloy: coma

17:02 amalloy: ah

17:03 mordocai: did you try C-g? i once thought it was dying but really it was just busy working on a task that was never going to finish

17:03 seangrove: amalloy: It's too slow for production use, and GC is dominating everything

17:03 amalloy: and C-g woke it right up

17:03 mordocai: amalloy: Yeah, I tried C-g. I have no idea what happened, I was messing with a lot of package related stuff trying to get Cider working though

17:03 gfredericks: amalloy: I swear I've got it to segfault a few times

17:03 amalloy: seangrove: yeah, bbloom filled me in, and i conceded that if you're not on the jvm then thinking about gc is reasonable

17:03 gtrak: mordocai: cider-nrepl should have no effect on what buffers cider sets up.

17:03 seangrove: amalloy: I would 100% prefer not to think about it at all :(

17:03 gtrak: I can't see how that could be the case.

17:04 seangrove: Or at least not in this goddamn goat-entrails-reading approach

17:04 Bronsa: amalloy: I've had emacs crash on me multiple times (I use it through emacsclient)

17:04 amalloy: gfredericks: you could just use sudo and /dev to muck with its address space. that should get you a segfault right quick

17:04 gfredericks: amalloy: oh I didn't mean intentionally

17:05 but that's an interesting capability I was unaware of

17:05 arrdem: /proc is an amazing thing :P

17:05 * gfredericks doesn't know how computers work

17:06 amalloy: yeah, i actually meant /proc

17:06 gtrak: /dev/kmem russian roulette?

17:06 amalloy: although you could probably do it with /dev/kmem if you knew how

17:06 actually debian doesn't expose kmem anymore afaict. just /dev/mem

17:06 gtrak: '2 or more players do execute "dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOM" successively. The one who crashes the computer has to make a beer run, brew coffee or whatever you like.'

17:07 arrdem: gtrak: you need to clarify the rules so that it's iterative with random choice of the first "player"

17:07 amalloy: https://wiki.ubuntu.com/Security/Features#dev-kmem "There is no modern user of /dev/kmem any more beyond attackers using it to load kernel rootkits."

17:08 arrdem: but but how can I play with writing my own rootkits then...

17:08 T_T

17:08 amalloy: and people playing silly games. c'mon, ubuntu, get with the program

17:10 arrdem: looks like Arch doesn't expose /dev/kmem anymore either...

17:10 gtrak: latest 0.7.0-SNAPSHOT and latest melpa's working fine for me.

17:11 I recommend it b/c it should stop the freezing issues.

17:11 though my attempt at a wrap-exceptions nrepl-middleware left me with more questions.

17:11 I don't feel comfortable merging it in yet.

17:14 mordocai: gtrak: Okay, so weird shit on my end. May be seomthing with my setup specifically. Short overview http://paste.debian.net/97845/

17:16 gtrak: *cider repl localhost* seems to tell me this is being run outside of a project?

17:16 justin_smith: amalloy: re crashing emacs, there are some low level ops in elisp that can totally segfault if misused

17:16 gtrak: mordocai: I haven't tested that at all.

17:17 there's a lot of edgecases in leiningen around that.

17:17 mordocai: gtrak: I've been running it outside of a project the whole time I think. Just a raw .clj

17:17 Bronsa: justin_smith: my emacs used to crash from time to time while opening Compiler.java

17:17 or while resizeing the terminal

17:17 gtrak: mordocai: try making a project, then we'll make an issue if that fixes it.

17:17 technomancy: are you guys running from trunk or something?

17:17 mordocai: gtrak: Kk, one sec

17:17 gtrak: technomancy: lein-trunk?

17:18 technomancy: gtrak: emacs trunk

17:18 I've seen one of two segfaults when I ran from trunk, but it's been years.

17:18 arrdem: I've never had emacs straight up crash. I've killed it with JVM system memory usage, but never had it crash

17:18 technomancy: not since before 23 was released anyway

17:18 gtrak: I'm using ubuntu 14.04's standard emacs24

17:19 arrdem: oh good they finally have emacs24... no more janky PPAs for 24.

17:19 gtrak: arrdem: that's been the case for a couple years :-)

17:19 but you had to explicitly install emacs24

17:19 technomancy: do you think running outside of a project would have issues with nrepl-middlewares by cider-nrepl's plugin mechanism?

17:20 I've never tried.

17:20 but I also don't see what would be different about 0.6.1-SNAPSHOT vs 0.7

17:20 in that regard.

17:20 technomancy: gtrak: seems unlikely, but possible

17:20 hard to think of how that would affect an nrepl middleware

17:21 do you have a link to the source?

17:21 mordocai: gtrak: I'm about to try it now, setup a project and nrepl seems to figure that out with the working version. Going to try 0.7.0

17:21 gtrak: yea: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider_nrepl/plugin.clj

17:22 technomancy: gtrak: hm... one of those artifacts that's a plugin and a dependency at the same time?

17:22 gtrak: yea

17:22 bad idea?

17:22 I stole it from cemerick

17:23 technomancy: when I used to do that with swank it was more trouble than it was worth

17:23 gtrak: arrdem: http://packages.ubuntu.com/search?keywords=emacs24 13.10 had it

17:23 arrdem: gtrak: ah. I was on 13.04 at work last summer.

17:23 gtrak: 13.04 also

17:23 * arrdem shrugs

17:24 technomancy: gtrak: but yeah, I can't see anything here that would run differently outside a project vs inside

17:24 cemerick: technomancy: you said something about it before, I think. What were the problems? Haven't had any complaints yet, but that doesn't mean much.

17:24 technomancy: cemerick: well, this was before we could slurp the version at runtime, so we had to maintain the two numbers by hand

17:25 seangrove: Automatic type conversion...

17:25 * seangrove sobs gently into his hands

17:25 technomancy: my gut still tells me it's better that different things remain different, but I don't know if I have any concrete warnings.

17:25 arrdem: technomancy: on that note... thoughts on having project version be (slurp "VERSION.txt")? :P I recall getting that to work before...

17:25 mordocai: gtrak: Alright, seems to work with a project

17:25 gtrak: mordocai: phew

17:26 technomancy: arrdem: you can read pom.properties

17:26 gtrak: I'll try to investigate it sometime.

17:26 mordocai: gtrak: Got *cider-repl learning-clojure* and errors are reported

17:26 gtrak: cemerick: while I got you here, I'm working through tools.nrepl dependency stuff. Would you consider that to be hokey? I ended up making a new middleware that manually composes the other middlewares.

17:27 next step I guess is to try to reproduce the descriptor metadata and make a test case. The impl code is non-obvious to me.

17:30 mordocai: https://github.com/clojure-emacs/cider-nrepl/issues/57 if you feel like investigating it more yourself.

17:30 mordocai: How do I force the cider-repl to reload files btw? Like it appears it automatically evaluated core.clj, but i've now made a change to that file.

17:31 gtrak: I may take a look later, focusing on just clojure right now :P

17:31 gtrak: you can do that with tools.namespace

17:32 mordocai: I'm not sure, I don't dev that way. When I make a change I'll eval the form with C-x C-e or the file with C-c C-k

17:32 I like full control.

17:32 arrdem: you can also just C-c C-k the file, or (require '[] :reload)

17:32 stompyj: I was defending clojure in a haskell/clojure thread and the dude who’s comments I gently eviscerated downvoted me… annoying

17:33 arrdem: stompyj: welcome to the haskell/clojure jihad, here's your paper shield enjoy the rain of downvotes

17:33 justin_smith: technomancy: not running from trunk, but operating on fairly low level stuff in the way emacs represents buffers, with bugs in my elisp code

17:33 stompyj: arrdem: LOL

17:34 arrdem: stompyj: fighting in the shade isn't as easy as it would seem...

17:34 stompyj: If I had known he was going to downvote me anyway, I would have at least verbally destroyed him in the thread

17:35 arrdem: heh. Idk... the Haskell vs. Clojure thing is something I'm still struggling with.

17:35 stompyj: I’ve never used Haskell, I have a buddy who uses it and seems to dig it tho

17:36 This one guy was just outright lying about clojure, so I corrected his points, very nicely and got downvoted for my efforts :)

17:36 amalloy: i don't know that you can gently eviscerate something

17:36 gtrak: amalloy: it takes a long time.

17:36 stompyj: (inc gtrak)

17:36 lazybot: ⇒ 10

17:36 Raynes: Also pics or it didn't happen.

17:37 stompyj: precisely

17:37 arrdem: TIL stompyj is a Bolton

17:37 stompyj: hahahahah

17:38 That’s the last house I’d be for!

17:38 arrdem: hehe. The north remembers

17:38 stompyj: Why isn’t there a “X language is like Y house in GoT” yet?

17:38 Thats what I should have responded to that dude with “Winter is coming."

17:39 Raynes: I'm hoping because people are getting sick of the internet dripping with GoT references.

17:40 * arrdem is mad that the show spoiled the books for the first time

17:43 stompyj: it’s been fun to see it translated to tv

17:43 arrdem: I watched the first two seasons, read all the books before the 3rd and am now enjoying the ride.

17:44 TEttinger: Raynes: you like unusual music, right? http://youtu.be/qubi8F7H6qA

17:44 arrdem: that said the show's visuals often mismatch with my imagination so there's some jarring.

17:46 stompyj: yeah, tyrion is much too attractive

17:46 he’s like a hobbling sack of potatoes in the book

17:47 technomancy: arrdem: too young to remember that happening with lotr? =)

17:47 arrdem: technomancy: shhhh I'm trying to blend in with the grown ups

17:47 cbp: its time for some scaphism

17:47 justin_smith: TEttinger: a cross of one of the most popular songs of the '80s with one of the most popular songs of the '90s - perhaps it is not weird but rather an exponential degree of normalcy

17:48 gtrak: oh man. I watched LOTR first, then read the books, then watched the movies again, and they were not like I remembered them at all.

17:48 way worse

17:48 coventry`: justin_smith TEttinger: I'm enjoying it.

17:49 TEttinger: justin_smith: maybe listen to the rest of the album, Mouth Sounds has some very weird stuff on it. I'm a fan of the quintuple-mashed http://youtu.be/S0ya2pjrSjY

17:51 stompyj: I watched all three LOTR movies back to back in a movie theater here in NYC

17:51 and I’ve never recovered

17:51 I haven’t even watched The Hobbit

17:51 it broke me

17:52 arrdem: all three in one sitting? ouch. I've done that but with like bathroom breaks, beer, friends, popcorn and daylight..

17:52 stompyj: yeah

17:52 it was too much

17:52 coventry`: I guess these youtube songs will last just as long as they stay unnoticed by the RIAA. :-)

17:53 noonian: i tried all the lotr in a basement with friends but afterward i just felt depressed; also they were the extended editions :(

17:53 TEttinger: they're also available from his site, which offers, cleverly, a download link via MEGA

17:53 arrdem: the extended editions are totally better...

18:05 gtrak: TEttinger: I like the Billy-Jean Smells like Teen Spirit mashup more than the one you linked.

18:05 TEttinger: indeed.

18:05 it's not easy listening

18:15 saolsen: has anybody tried using fixed memory pools for anything in clojurescript? I have some core.logic code I want to execute in an inner game loop and it evaluates fast enough but allocates and frees so much memory the gc runs for way longer than a tick

18:17 gtrak: you mean like an array?

18:17 didn't know JS had such a thing.

18:18 but you could look to vertigo for inspiration? https://github.com/ztellman/vertigo

18:18 saolsen: well, core.logic runs on top of a bunch of custom types

18:19 pairs and vars and cons thingies

18:19 mdeboard: Is Hiccup pretty much the de facto HTML thinger for COmpojure? I've found that I'm kind of clumsy with it

18:19 justin_smith: saolsen: yeah, I think you would have to use a subset of the language that does not allocate to reimplement the functionality you want

18:19 saolsen: but I was thinking maybe, since at the bottom they are just js object, I could keep a bunch of them around and reuse them with some good old fashon dirty mutation

18:20 mdeboard: Would really like to just write HTML and put variables in place a la erb templates

18:20 technomancy: mdeboard: it's definitely the most obvious way to start

18:20 gtrak: mdeboard: laser, enlive, selmer are some alternatives.

18:20 justin_smith: saolsen: the problem is that the core.logic code is probably using heap allocation, and I'm assuming you can't really change that

18:20 gtrak: luminus comes with selmer.

18:22 saolsen: Couldn't I just rewrite the constructors of all those objects to pull from a cache? It would be heap allocation at first but then I could reuse them.

18:22 arrdem: saolsen: now you're building your own garbage collector...

18:22 justin_smith: exactly

18:23 gtrak: saolsen: if the data is repetitive, you might benefit from memoization.

18:23 saolsen: yeah, but just a little one :)

18:23 mdeboard: technomancy, gtrak, thanks

18:23 arrdem: saolsen: size has no impact on the difficulty of correctness unfortunately..

18:23 turbofail: well building your own garbage collector isn't insane if you know you can throw everything you've allocated away every frame

18:24 arrdem: saolsen: if you have some very very simple use pattern like turbofail mentioned, then you could build a refcounting GC and do manual allocation pretty reasonably.

18:24 saolsen: what you _really_ want to do is probably not do manual allocation but have manual transients.

18:26 saolsen: I'm not sure what that means

18:28 coventry`: saolsen: Did you use any tools to identify the core.logic structures as the culprits? seangrove and I are running into similar issues, and it would be great to have a systematic way to identify where the garbage is coming from.

18:31 saolsen: No I would love to know that. I can take a heap snapshot from chrome's tools and it sorts by constructor but those don't seem to map to the clojure constructors.

18:31 ztellman_: gtrak: I think you're the only person who suggests vertigo to anyone

18:31 gtrak: hehe

18:31 ztellman_: I still haven't even rewritten the Go AI using it yet

18:32 coventry`: saolsen: Yeah the options for debugging this kind of thing in js seem very limited.

18:32 gtrak: ztellman_: that's the risk you take by open-sourcing a lib.

18:33 but there was a guy on the ML that was actually trying to use vertigo for C interop.

18:34 just yesterday

18:34 coventry`: I thought that was kind of the idea.

18:34 arrdem: ouch my brain

18:34 gtrak: coventry`: the idea was arrays-of-structs

18:34 which the jvm can't do very easily.

18:35 coventry`: "...can also make interop with C libraries significantly simpler and more efficient."

18:35 gtrak: supposedly, if you have a direct-mapped bytebuffer, you can just send pointers over to C

18:35 I haven't tried.

18:36 saolsen: I wish I could tell chrome I want to know all the allocations that happen within a specific function

18:36 like you can tell chrome "time this function"

18:52 sdegutis: Is there a superior method for transforming [[:a 1] [:b 2]] into [[:a :b] [1 2]] than (apply mapv vector p)? Thank you for your time, good bye.

18:53 arrdem: (juxt (partial map first) (partial map second))?

18:54 noonian: ,(doc juxt)

18:54 clojurebot: "([f] [f g] [f g h] [f g h & fs]); Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applying each fn to the args (left-to-right). ((juxt a b c) x) => [(a x) (b x) (c x)]"

18:54 sdegutis: That does not seem superior.

18:54 I tried (map (juxt first second)) at first, but that's just (identity) here.

18:54 arrdem: agreed, just the next "one liner" that came to mind.

18:54 noonian: ,((juxt keys vals) (into {} [[:a 1] [:b 2]]))

18:54 clojurebot: [(:a :b) (1 2)]

18:54 arrdem: noonian's answer is my #2

18:55 ztellman_: gtrak: what, really?

18:55 link?

18:55 arrdem: noonian: nice to meet you Dr. Soong

18:55 noonian: arrdem: you too! I think you're the only one here who got the reference

18:55 gtrak: ztellman_: https://groups.google.com/forum/#!searchin/clojure/vertigo/clojure/Z0j9rizY6uQ/crkbrtda4soJ

18:56 ztellman_: haaaaa

18:56 but yeah, .address() on a direct byte buffer

18:56 works a treat

18:58 gtrak: ztellman_: I'm just in it for the frankensteins

18:58 I find useful monsters amusing.

18:59 arrdem: there's a certain elegance in every monster...

18:59 gtrak: even numbered-trolling

18:59 ztellman_: gtrak: the Antlr parsing of the Eclipse disassembler certainly qualifies

19:01 gtrak: maybe emacs is someone else's double-troll.

19:01 why do I always hate it so much but continue to use it.

19:02 technomancy: emacs is like this spectre that reminds us of the fact that we could all be using lisp machines today except we screwed everything up, so it rightly mocks us.

19:03 gtrak: yea, that's about right.

19:03 arrdem: technomancy: you say that, but I'll keep pointing to the atrocious memory profile of even the Symbolics machines as reasons that they were doomed from the beginning...

19:04 coventry`: Yeah, this experience with js gc is making me think that part of the reason functional programming and data structures have taken off is that we can now often afford the overhead.

19:06 bbloom: a major reason for the poor behavior of GCs is that they assume mutability

19:06 technomancy: arrdem: we put a man on the moon. that kind of thing isn't insurmountable.

19:06 arrdem: technomancy: and we did it with magnetic core wire memory that was read-only...

19:08 gtrak: arrdem: immutability mofos

19:11 dyreshark: coventry`: also fp tends to be easier to make parallel, and just about everyone is saying "yeah, so we're going to get more cores, but we don't plan on making them TONS faster unless a miracle happens"

19:11 sdegutis: Thank you.

19:15 justin_smith: bbloom: do you have a cite for the gc assuming mutation thing? sounds interesting

19:24 seangrove: justin_smith: I assume https://www.youtube.com/watch?v=XtUtfARSIv8 should have something in there

19:24 Haven't watched it yet

19:27 I feel like Haskell's GC is in a very privileged position and should be able to do some fantastic things

19:28 turbofail: http://c2.com/cgi/wiki?ImmutableObjectsAndGarbageCollection

19:31 dyreshark: justin_smith: also this has a bit on things they had to do in the Rubinius GC in order to collect concurrently in a mutable environment http://rubini.us/2013/06/22/concurrent-garbage-collection/

19:32 specifically, it starts near "Tri-color invariant and concurrency" IIRC

19:37 justin_smith: (inc seangrove)

19:37 lazybot: ⇒ 4

19:37 justin_smith: (inc turbofail)

19:37 lazybot: ⇒ 3

19:37 justin_smith: (inc dyreshark)

19:37 lazybot: ⇒ 1

19:37 justin_smith: thanks guys

19:48 seangrove: Speaking of immutable GC, and perf in generaly, etc., how is this possible? http://jsperf.com/performance-frozen-object/25

19:51 yedi: seancorfield: just wanted to say your om-sente example is so much more useful than the regular sente example

19:52 justin_smith: seangrove: I wonder if maybe when an object is sealed, the hash table is cleaned up and optimized so that lookups can be faster? Also, I would assume there are certain locks or checks that can be avoided after sealing.

19:52 seangrove: justin_smith: Sure, but it should be *faster*, not slower

19:52 justin_smith: oh, wow, I misread :)

19:53 looks like some anti-optimization happened

19:53 dbasch: seangrove: perhaps there’s more overhead in the seal check than in the lookup itself

19:53 seangrove: There must be some interesting challenges involved, or maybe they haven't had time to optimize

19:53 dbasch: It's sealed pre-test

19:54 justin_smith: seangrove: he said the seal check, which I assume happens at lookup

19:54 dbasch: seangrove: I know, but perhaps the lookup checks that it’s sealed for some reason, and if it’s sealed does something

19:54 seancorfield: yedi: cool, glad it helps someone!

19:54 seangrove: dbasch: Ah, sorry. Could be, yeah

19:54 dbasch: that lookup is so ridiculously fast that it probably obscures everything else

19:55 amalloy: seangrove: speculation: before seal it's internally represented as a hashmap, and x['a'] does the fastest thing, look something up in a hashmap. after that, it's turned into an object, to speed up calls like x.a; when you do the "unexpected" x['a'] instead, it has to fake it up on top of the actual struct

19:55 dbasch: in fact, I would assume sealing an object means there’s extra work to make sure you don’t try to alter it

19:56 after all, mutation is free just like not checking array bounds is free

19:56 seangrove: dbasch: Surely only on assignment though, not on read

19:57 amalloy: Interesting idea, definitely

19:57 amalloy: dbasch: but you *are* allowed to mutate a sealed object's properties

19:57 you just aren't allowed to add or remove properties

19:57 dbasch: ,([1 2 3] 4)

19:57 clojurebot: #<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>

19:58 amalloy: which suggests that what they're doing is changing the storage layout to optimize particular kinds of access

19:58 seangrove: amalloy: I think you're not allowed to...

19:58 turbofail: hm. those two run at the same speed for me in firefox

19:58 seangrove: amalloy: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze

19:58 amalloy: seangrove: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal

19:58 you're looking at freeze, not seal

19:58 turbofail: though i suspect firefox may be cheating

19:59 seangrove: amalloy: Ah, yes, sorry, being sloppy today

19:59 * seangrove is watching the PWL GC talk

20:00 amalloy: i'd be interested to see how the test behaves using o2.a instead of o2['a']

20:01 dyreshark: entirely uninformed speculation: if `freeze` changes the layout of the object at all, it may be causing a perf penalty in Chrome. i read a blog a while back where a V8 engineer said that modifying object layout causes a pretty big perf penalty. no clue if that still applies/applies here, but it's a thought

20:02 * seangrove tries not to complain about the state of browsers

20:02 turbofail: it shouldn't be changing the object layout during the course of the benchmark

20:03 jcromartie: I am *all about* aligning my lets, conds, and map literals

20:03 among others

20:04 I wish it were easier to do it in an editor

20:04 oh

20:04 https://github.com/gstamp/align-cljlet

20:04 coventry`: jcromartie: How do you handle long destructurings?

20:05 jcromartie: they can get mexs

20:05 messy

20:05 but for map destructures I like to put the destructured variable one space to the right of the furthest-right form in the map

20:05 if that makes any sense

20:05 but like I said, they get messy

20:05 technomancy: I hate being torn between going to look up how to do that alignment stuff and being That Guy who introduces non-aligned lines to an otherwise aligned function.

20:06 jcromartie: but like for conds and simple lets, at least, I think it makes a huge difference in readability

20:07 it should just be considered polite

20:07 if anybody has to read your code

20:07 and it also exerts a design pressure on your code

20:07 amalloy: jcromartie: it makes a big difference in maintainability, too - you're impolite to the technomancys of the world, who want to edit your code

20:07 jcromartie: yes, exactly

20:07 lemonodor: aligning always breaks down eventually. so i tend not to even start.

20:07 amalloy: maybe i want to add a clause to the let, and the sensible variable name is 10 characters long

20:08 but you've lined everything up to 5-character names. what do i do?

20:08 i curse you under my breath and use a shitty name

20:08 coventry`: I should add logic to align-cljlet so it gives up if the LHS extends too far to the right.

20:09 amalloy: Put in your def with 10-char name and hit C-c C-a, which you've bound to align-cljlet. :-)

20:09 jcromartie: coventry`: I just did that exactly

20:09 hiredman: does it matter what color the walls are painted when the house is on fire?

20:09 lemonodor: i do wish clojure’s let used an extra level of nesting, like common lisp’s. i guess that ship has sailed :(

20:09 amalloy: meh. i forked align-let to make it work with clojure, when i had to put up with aligned code

20:09 dbasch: dyreshark: freeze doesn’t cause a performance penalty (for me on Chrome) but seal does

20:09 amalloy: but i'm not happy about having to put up with such code

20:09 jcromartie: I don't mind doing it by hand, which I did before I literally just discovered align-cljlet 5 minutes ago

20:10 amalloy: what do you mean "put up with"?

20:10 you mean having the standard imposed on you?

20:10 dyreshark: dbasch: ah, ok

20:10 jcromartie: surely you can't be opposed to *reading* aligned forms

20:11 coventry`: Moving the setup in that jsperf test to the initial html doesn't change the result.

20:11 amalloy: i don't mind reading it, except that in the back of my mind i know some poor sap will have to edit it. and it's not like it's any more readable

20:12 coventry`: It's the same readability if you're going through the code linearly, but it makes it a bit easier to look up a specific definition.

20:12 Not much compared to doing an incremental search, though.

20:13 amalloy: hiredman: i'm not sure which part of this is the fire and which is the walls

20:13 jcromartie: I disagree, I think it's much more readable at a glance

20:13 it adds more visual hierarchy to the code

20:13 that's never a bad thing

20:14 particularly with cond

20:14 amalloy: jcromartie: xml has lots of visual hierarchy. "never a bad thing" is comically false in that context

20:14 jcromartie: you see the tests and results grouped

20:15 lemonodor: it can be a little nicer to read. i’ve just decided that the advantages are not usually outweighed by the disadvantages

20:15 technomancy: why not implement it as a render-time hack?

20:15 coventry`: When that gets confusing, I generally start using ";; =>" between the tests and results.

20:15 lemonodor: er, i mean *are* outweighed.

20:15 technomancy: just don't touch the source on disk

20:15 amalloy: the problem with aligning is that code is either so small that aligning it doesn't really help (it's perfectly legible anyway) or so large that aligning it doesn't help (it's too large to be made legible just by adding some alignment)

20:16 jcromartie: the primary disadvantage being that introducing a change to the length of one line in the left-hand column means changing all the lines in the form in SCM

20:16 nullptr: +1 for render time hacks, ala http://www.gnu.org/software/emacs/manual/html_node/emacs/Glasses.html

20:16 coventry`: (add-to-list 'magit-diff-options "-w")

20:17 amalloy: coventry`: try -b instead. it's a more-aggressive -w

20:17 quizme: hi, sorry if this is off-topic, but the #grails channel is pretty dead. I am trying to use clojure within a grails project, but getting "java.lang.ClassNotFoundException: clj-time.core".

20:18 amalloy: quizme: you don't have clj-time on your classpath, and whatever clojure code you're using expects it. i don't know if you grails guys use maven or what, but something should be fetching clj-time from clojars's maven repo

20:19 coventry`: Thanks, amalloy

20:19 quizme: I copied clj-time-0.7.0.jar from ~/.m2 into GRAILS_APP/lib, and in ./src/clj/core.clj I put (ns (:require [clj-time :as t]))

20:22 justin_smith: quizme: this makes it look like you can do it the right way (that is declare an artifact / version and have it automatically taken care of) http://grails.org/doc/2.3.7/guide/conf.html#dependencyResolution

20:22 quizme: http://pastebin.com/x6VQ3Z9r

20:23 justin_smith: quizme: manually copying the jar into lib/ shouldn't be the right way to do it, even if it did actually work

20:23 quizme: justin_smith: i'll try that thanks

20:29 bbloom: justin_smith: seangrove: GHC doesn't make too much use of immutability b/c lazy thunk cells are inherently mutable

20:29 seangrove: Ah, fair enough

20:29 danielcompton: I'm using cider with emacs, is there any way to stop it doing a round robin on open windows when I evaluate results?

20:29 bbloom: Erlang, on the other hand, actually can enforce the ordering constraint provided by immutability

20:29 danielcompton: i.e. each time I throw an exception it puts it in a different window

20:30 seangrove: bbloom: I thought the Elixir post you linked to was pretty cool, other than the strange tone.

20:30 bbloom: that, plus the fact that there are agent-local tasks, is part of the reason erlang can have such a simple GC and perform reasonably well

20:30 seangrove: "This is good shit", "a pain in the bottom"

20:30 bbloom: elixir is cool

20:32 coventry`: There's a good deal of back-and-forth about that on the C2 page turbofail linked earlier. E.g., "The trick is that immutable data NEVER points to younger values. Indeed, younger values don't yet exist at the time when an old value is created, so it cannot be pointed to from scratch. And since values are never modified, neither can it be pointed to later." (A quote from the Haskell page, apparently.)

20:32 *a Haskell page

20:34 quizme: i hate grails

20:34 gtrak: danielcompton: if you figure this out, let me know :-)

20:35 danielcompton: gtrak: it's driving me up the wall

20:35 gtrak: I'll investigate.

20:36 danneu: danielcompton: never found a solution to it. ideally the stacktrace would pop up on one of those buffers you can dismiss with `q`

20:36 danielcompton: danneu: It does pop up in a dismissable buffer but it's a different one every time

20:36 gtrak: you can dismiss it with q, but it doesn't go there automatically.

20:36 danneu: man, i can't even get that to work

20:37 danielcompton: I feel like I need to stop everything for a month and just study Emacs

20:37 danneu: my 'solution' for the past year was to just turn it all off so that the top line of the stack trace shows up in the minibuffer. it's cool as long as i never make mistakes

20:37 gtrak: danielcompton: found it.

20:37 danielcompton: At the end of the month I'd have a foot long grey beard

20:38 gtrak: do tell

20:38 gtrak: in cider-interaction.el there's a defcustom "cider-auto-select-error-buffer" default to nil.

20:38 so you do whatever defcustom does to make that truthy.

20:38 should be truthy by default, imo.

20:38 but I've been meaning to figure this out, so I'll find out right now.

20:39 aha, custom-set-variables

20:40 put this in your init.el: (custom-set-variables '(cider-auto-select-error-buffer t))

20:40 nullptr: if you want to do that via custom, M-x customize-variable

20:40 it will write that for you

20:40 gtrak: eval it, and you're good to go.

20:41 nullptr: I don't trust it, because I don't understand it.

20:41 coventry`: Should I be using custom-set-variables rather than setq?

20:41 gtrak: i think that's the point of defcustom

20:41 technomancy: meh

20:41 gtrak: listen to technomancy

20:42 technomancy: unless you're doing something visual like face changes, I'd recommend just treating everything like regular elisp

20:42 justin_smith: the tricky thing is if you have setq plus custom-set-variables - then whichever one is loaded last wins

20:42 nullptr: i typically use setq for things that i want the same everywhere, and custom for env-specific things

20:42 justin_smith: but the customize interface will warn you if something was changed out of custom-set-variables

20:43 nullptr: some people setq everything, some people use custom for everything

20:43 good to be familiar with both imho

20:44 at the least, custom frees you from having to know the difference between setq/setq-default, and is less likely to stomp changes after lib load if they are set out of sequence

20:45 technomancy: for the most part customize comes across as just a way to let you avoid learning elisp

20:45 which I do not understand at all

20:45 quizme: justin_smith maybe I could just use gen-class

20:46 gtrak: I tried using the custom faces menus and whatever, it was really opaque and I gave up after a while.

20:46 I have derision towards good UIs, emacs's seems pretty pointless.

20:46 justin_smith: quizme: that seems like a nonsequitor to our previous discussion - how would gen-class help you resolve your deps?

20:47 quizme: justin_smith package all the deps into a stand-alone jar

20:47 danielcompton: It's still doing the round robin thing for me

20:47 justin_smith: so make an uberjar then, no need for gen-class

20:47 gtrak: like how the hell are you supposed to use them without knowing what's going on underneath, it's like using javadoc instead of looking at the code.

20:47 danielcompton: but is it letting you hit 'q' to get out of it?

20:47 round-robin is just how emacs makes new frames.

20:48 danielcompton: Yeah it always did that part

20:48 quizme: justin_smith then how do i invoke the method from grails ?

20:48 danielcompton: I had that sorted :)

20:48 justin_smith: quizme: still, you should be able to declare a dep and have grails resolve it and set up your classpath - that's like 80% of what a tool like that is for

20:48 invoke what method?

20:49 quizme: justin_smit the clojure method that i want to invoke from within grails.

20:49 gtrak: danielcompton: there looks to be some esoteric rules to this: https://www.gnu.org/software/emacs/manual/html_node/emacs/Window-Choice.html#Window-Choice

20:50 danielcompton: emacs and esoteric are likes peas and carrots

20:50 gtrak: personally, I'm 100% ok with it now that it throws me over to it.

20:50 justin_smith: quizme: you can use clojure.lang.RT to call clojure code from any jvm lang http://clojurefun.wordpress.com/2012/12/24/invoking-clojure-code-from-java/ I think there is something easier now too but I am not finding the link

20:51 quizme: justin_smith I tried to add it to BuildConfig.groovy 's dependency section and added clojure to the list of repos but it still gave the same error.

20:51 gtrak: I was hitting C-x o a bunch before, now I don't have to.

20:51 amalloy: justin_smith: clojure.java.api.Clojure was added in 1.6

20:51 justin_smith: amalloy: ahh, yeah, that is the one I was looking for, thanks

20:51 quizme: yeah, if you want clojure 1.6+ you should use clojure.java.api.Clojure

20:52 quizme: did you add clojars?

20:52 quizme: justin_smith yes i did

20:53 justin_smith: OK, I don't know what else to suggest, not being a grails expert myself. But it is using maven, so it is theoretically able to resolve your clojure deps. And you can use "lein uberjar" to make a jar of all your clojure deps if they are all in one project, and then use clojure.java.api.Clojure to invoke the clojure code

20:55 quizme: justin_smith: alright thanks i'll try

20:56 is 1.6 the recommended clojure version these days ?

20:56 justin_smith: it's the latest stable version, yes

20:56 use it unless you have a pressing reason to use an older one

20:56 amalloy: 1.5.1 probably has the most users, but 1.6 is newest, stable, and good. i'm using it in new projects

20:57 quizme: amalloy i c thnx

21:08 danielcompton: When you switch from your default user namespace at the repl, how do you reload all of the repl goodies?

21:08 clojure.core/refer-clojure brings in clojure.core but what about the other parts?

21:08 like doc

21:08 justin_smith: danielcompton: (use 'clojure.repl)

21:08 one of the few valid usages of use

21:10 danielcompton: Thanks, is that the standard way to do it? refer-clojure, use repl?

21:11 justin_smith: I don't find the need to switch out of the user namespace that often myself, but I know other people use the repl differently

21:11 also the (ns) form has an implicit refer-clojure

21:11 so if you load an ns from a file it will have the clojure.core functions bound

21:11 danielcompton: Ah, I was moving to a namespace that didn't exist on disk

21:12 justin_smith: you can still use (ns) from the repl

21:14 danielcompton: Nice, thanks

21:14 ,(inc justin_smith)

21:14 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: justin_smith in this context, compiling:(NO_SOURCE_PATH:0:0)>

21:14 justin_smith: no need for the ,

21:15 danielcompton: (inc justin_smith)

21:15 lazybot: ⇒ 40

21:15 danielcompton: justin_smith ta

21:15 justin_smith: np

21:18 danielcompton: danneu how did you get stack traces in the minibuffer?

21:19 danneu if you set (setq cider-repl-popup-stacktraces f) does that do it?

21:21 seangrove: Any naming convention for mutable objects?

21:22 amalloy: seangrove: no

21:22 gfredericks: !<muta-foo-var>!

21:22 seangrove: amalloy: If only the blink tag worked automatically in emacs...

21:23 amalloy: suggestion: instead of foo, call it plz-stop-changing-foo

21:24 justin_smith: f͗ͧ͐͒̏̑ͮͥ̎̇ͩ̓̾͆̽ͮͦͤ̆͏̶̴̨͉̦̜̳͍̬̭̲̺ͅọ̡͔̪̞͈͎̘ͩ͐̆̇͐̂̃͋ͯ͐͌͆͌̑̔ͣͥ́͢ớ͙͕̱̮̩̬̤͖͈̬̞̉̿̏͗͂̅͐̿̈́ͨͬ̓ͦ͝

21:24 hopefully the above will instill the proper respect

21:25 seangrove: gfredericks: Probably go with something like yours, I think

21:25 gfredericks: (inc me)

21:25 lazybot: ⇒ 4

21:25 seangrove: (inc gfredericks)

21:25 lazybot: ⇒ 54

21:25 gfredericks: you're welcome, clojure community

21:25 five years from now everybody will be using it

21:26 TEttinger: was hat like 60 combining characters, justin_smith?

21:26 justin_smith: ⸘es-mucho-mutable‽

21:26 TEttinger: yeah http://eeemo.net/

21:27 TEttinger: I only saw 4 blobs on one line -- unifont

21:27 justin_smith: TEttinger: interesting - yeah, they are intended to stack http://knowyourmeme.com/memes/zalgo

21:28 TEttinger: https://dl.dropboxusercontent.com/u/11914692/zalgo.PNG

21:28 dbasch: ,(def Δvariable 1)

21:28 clojurebot: #'sandbox/Δvariable

21:29 TEttinger: ,(def Կիրիլիցա "Cyrillic")

21:29 clojurebot: #'sandbox/Կիրիլիցա

21:29 justin_smith: http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags one of the best SO answers of all time

21:29 TEttinger: oh I know it

21:30 justin_smith: 'tis a classic, we should all know it

21:53 Jaden: clojure sucks. No tail recursion. even worse than ancient lisps like scheme and common lisp. Learn arc or go home.

21:54 arrdem: http://www.arrdem.com/i/troll.jpg

21:54 justin_smith: Jaden: I am home :P

21:54 arrdem: Jaden: you leave home? get a real job...

21:55 ddellacosta: I feel like Jaden actually likes Clojure

21:55 TerranceWarrior: hey arrdem

21:55 arrdem: TerranceWarrior: ACK ACK ACK ACK

21:56 Jaden: I don't like clojure. It piggy backs on the JVM (barf, gag, hurl). Even old lisps like CCL common lisp can make native binaries cross platform without a "VM".

21:56 technomancy: Jaden: http://p.hagelb.org/scsb.png

21:57 Jaden: worst decision ever to piggy on the JVM. It hurts cross platform. It doesn't help.

21:58 arrdem: at least chord tried to be a help vampire...

21:58 this guy just comes in slinging mud and thinks he's gonna derail anything...

21:58 have fun in /dev/null mate

21:58 Jaden: Look at all you noobs using clojure. Of all the lisps and you choose to go the Java route. Yea that's really cool.

21:59 justin_smith: if you're interested in cool you should check out ruby, that's definitely hip

22:00 Jaden: ruby sucks too, but as a lisp, clojure must be held to a higher standard of review.

22:00 technomancy: not as cool as node.js

22:00 node.js is so hot right now

22:01 arrdem: you should check out my hardware node.js project...

22:01 technomancy: http://v8.en.memegenerator.net/instance/43297831

22:02 Jaden: seriously. I want to know. Why would you (in your right mind) choose clojure? Functional programming without recursion? Was the creator drunk?

22:02 nullptr: wow. such node.js. so recurse.

22:02 technomancy: clojure has recursion; we just pretend we don't in order to make schemers mad.

22:02 arrdem: https://twitter.com/doge_js

22:02 technomancy: it's pretty hilarious.

22:03 arrdem: nullptr: please tell me that's you. I owe that person beer for the amount of entertainment they've provided me.

22:03 nullptr: arrdem: i wish i could take credit

22:03 Jaden: Recursion you can't use in a natural way. Yeah, that's great. Defeats the entire point.

22:04 arrdem: every time I just crack up...

22:04 Jaden: I can't believe this is a lisp chat room.

22:04 technomancy: it's worth it for the lulz tho

22:04 justin_smith: databae caught me shardin' lol

22:05 danielcompton: Jaden hot lisps in ur area wanna talk abt abstract academic concepts like wow u dont kno recursion wtf

22:06 arrdem: (inc danielcompton)

22:06 lazybot: ⇒ 1

22:07 Jaden: scheme implements recursion naturally. It's such an old language. 2014 and the "modern" langauges can't get it right.

22:07 arrdem: seancorfield: hahaha you taking on Tony Morris is great :P

22:08 gfredericks: Jaden: but if it had a recursive then algorithms wouldn't

22:08 Jaden: I'm done here. Nobody gives a sh*t about recursion.

22:08 technomancy: sweet

22:08 danielcompton: (s/validate FancyMap {"a" "b"})

22:08 (s/validate FancyMap {:foo :f "c" "d" "e" "f"})

22:08 justin_smith: Jaden: it's the internet, you can say shit

22:08 arrdem: danielcompton: wrong buffer...

22:08 danielcompton: arrdem yup :)

22:09 Jaden: nope. Not in the US. FCC regulated and NSA tracked.

22:09 danielcompton: arrdem IRC driven development

22:09 arrdem: danielcompton: if you can get #clojure to write code for you it's totally a thing

22:09 Jaden: goes on your permanent NSA record. truth.

22:11 Anyway. I don't want to chat in a room full of "lispers" who don't care about recursion. That's not the kind of place I want to hang out.

22:11 TEttinger: (doc recur)

22:11 clojurebot: I don't understand.

22:11 TEttinger: ,(doc recur)

22:11 clojurebot: I don't understand.

22:11 TEttinger: wow is it a special form? must be

22:11 Jaden: Fitting your bot can't do recursion. Expected

22:11 arrdem: TEttinger: yes it is

22:12 justin_smith: TEttinger: don't ruin it, if he thinks recursion doesn't exist in clojure he'll just leave

22:12 bob2: is it school holidays somewhere?

22:12 arrdem: bob2: finals time here...

22:12 TEttinger: we had a bunch of trolls /noticing earlier

22:12 Jaden: Jaden out

22:12 TEttinger: thank god

22:13 jeremyheiler: aww, i was just going to ask him what he thought about types.

22:13 seancorfield: arrdem: seriously, I miss Tony Morris's threads from the Scala lists, back when I was doing Scala in 2009/2010...

22:13 dbasch: at least he didn’t mention Haskell

22:13 TEttinger: huh, hagerstown, Maryland

22:13 gfredericks: I've been there

22:14 arrdem: TEttinger: I love geolocating trolls...

22:14 TEttinger: they never see it comming

22:14 seancorfield: but I would really like to hear Tony's opinion on why Haskell isn't more popular...

22:14 justin_smith: oh, it's no use, he's behind 7 proxies, you'll never find him

22:15 seancorfield: Brian McKenna's reason wasn't very helpful "People do not care about working software" :)

22:15 arrdem: justin_smith: that's ok, ,we just start bombing the proxies.

22:15 justin_smith: http://www.imdb.com/name/nm1535523/ anyway I am pretty sure Jaden lives in beverly hills or something

22:15 arrdem: seancorfield: yeah that was fabulous

22:15 nullptr: https://twitter.com/officialjaden/status/329768040235413504

22:18 masconejos: Howdy all. I have a meta/philosophical clojure question I’m hoping someone can help me with.

22:19 I’ve been working at learning clojure for a few days by working project euler problems

22:19 I’ve noticed that the code I’m writing tends to be very procedural and not very “idiomatic clojure” like

22:20 justin_smith: masconejos: using atoms as if they were variables?

22:20 arrdem: seancorfield: IMO it's because most of the Haskell people I've met are in it for the borderline masturbatory use of mathematics backed type theory rather than for some higher goal like utility or productivity. The consequent pervasive use of mathematical terminology and lack of willingness to abandon or familiarize it I see as a massive roadblock to entry. Let alone the lack of clear value proposition besides "you don't know what you're missi

22:20 masconejos: no

22:20 specifically for propblem 4, I’ve generated this: https://dl.dropboxusercontent.com/u/2755300/004.clj

22:20 `szx: masconejos: 4clojure.com was a big help for me in the beginning since you could see other people's solutions (not sure if that's the case with project euler)

22:21 masconejos: Looking at solutions at (http://clojure-euler.wikispaces.com/Problem+004) I see my code is very different

22:21 however, my code runs in a fraction of the time it takes most of the solutions at clojure-euler to run

22:22 It does this by only calculating exactly what is asked for, while most of the clojure-euler answers overcalculate then reduce

22:22 arrdem: seancorfield: I'd be interested to hear what you think on the matter.

22:23 masconejos: Which brings me to my question: is there an idiomatic way to calculate things the way I do, or is project euler not indicative of general programming?

22:23 dbasch: masconejos: your mirror code is just (concat x (reverse x))

22:24 justin_smith: dbasch: well he also puts it in a vector, for whatever reason

22:24 masconejos: Specifically, project euler asks for very specific things, where in more real world programming, you would probably be more likely to process a lot of records in a specific matter, rather than looking for an optimum solution

22:24 rufoa: the loop/recur acting as a for loop isn't nice. could probably refactor that as a filter/range

22:25 masconejos: (I’m having trouble expressing myself clearly, sorry) Now on to addressing your comments..

22:25 justin_smith: rufoa: or even a reduce / reduced

22:25 rufoa: yeah

22:25 masconejos: dbasch: does concat+reverse work on vectors?

22:25 dbasch: masconejos: try 4clojure, it’s better in that respect (up to a point)

22:25 justin_smith: masconejos: do you have a reason to put everything into vectors?

22:25 Jaood: arrdem: is the discussion on the google group thread?

22:26 dbasch: ,(concat [1 2 3] (reverse [1 2 3]))

22:26 clojurebot: (1 2 3 3 2 ...)

22:26 justin_smith: masconejos: yes, they get coerced into seqs

22:26 jeremyheiler: masconejos: i feel teh same way about project euler, which is why when i do the problems, i don't worry about the proper mathematical solution and focus on the language i'm learning.

22:26 masconejos: processing a number as a list or vector of digits is faster than doing strings. I chose vectors because it made my numbers appear in the order I wanted overa list

22:27 seancorfield: arrdem: your opinion aligns pretty closely with mine - although you are more eloquent about it :) - but it's not a popular opinion with Haskellers unfortunately :(

22:27 sjy: masconejos: having a quick look at some of those other solutions (and i'm far from fluent in clojure), they seem to be finding products and working out if they're palindromes, rather than finding palindromes and working out if they're products? maybe your solution is just more effective because it's "backwards" like that (compared to the problem statement)

22:27 justin_smith: masconejos: I guess my confusion is you keep forcing things into vector but then don't use any of the features that make vector desirable

22:27 sjy: i don't see why one method or the other would be more idiomatic in clojure

22:27 justin_smith: masconejos: oh, so you mean you wanted vector's conj at end behavior

22:28 arrdem: seancorfield: I'll take eloquence to be willingness to use colorful language in a public/professional forum, but thank you anyway :P idk, as a compilers guy their type system buys them a lot of power and some interesting stuff, but the community is just a total turn off compared to this lot :P

22:29 dbasch: ,(reduce #(+ (* 10 %1) %2) [1 2 5 3 6])

22:29 clojurebot: 12536

22:29 sjy: arrdem: FP has interesting implications for software engineering and abstract maths, i don't think it's surprising (or bad) that there is a division between the communities that are more interested in one aspect or the other

22:29 dbasch: masconejos: that’s for converting a vector of digits into a number

22:30 masconejos: sjy: I understand why my solution is more efficient: it serches the palindrome space (of which there are 899) rather than the product space of which there are 899^2. MY question is more philosophical. MY code runs better, no question, but it doesn’t feel very clojure-like and it isn’t fun to write. In general, do you think that project euler questions are representitive of what clojure is good for, and rather than

22:30 being optimized, should I just be writing (inefficient) idiomatic clojure for the purposes of learning clojure the “clojure way"?

22:30 dbasch: masconejos: you could write the same code much more idiomatically

22:30 masconejos: dbasch: thank you. That is better for vec to it conversion

22:31 justin_smith: masconejos: the idiomatic / efficient concerns are orthogonal in this case

22:31 seancorfield: arrdem: yeah, I like Haskell but actually using it for real world projects is fraught with difficulties (both cultural and technical). I like Elm too. A lot. But I worry that it will be no more than a niche language used by a small fragment of the Haskell community who consider JS to be too dirty to use in their web apps :(

22:31 masconejos: justin: that’s what I was thinking

22:31 rufoa: ime project euler problems weren't particularly interesting as far as clojure's features are concerned, nor particularly well suited to elegant clojure-esque solutions

22:31 4clojure wasn't much better but that might not be a popular opinion here

22:31 justin_smith: you could have terser code, using reduce / reduced or maybe in some case iterate rather than loop

22:32 dbasch: masconejos: also you can convert a number into a vector of digits in a one-liner (e.g. via str)

22:33 masconejos: justin: for the purposes fo rpoblem 4, I typically found I wanted to exit a loop when I found what I was looking for, but reduce, maybe iterate, not sure, makes you work through the entire input

22:33 rufoa: lazy seq + first

22:34 masconejos: All in all though, it’s sounding like if I want idiomatic clojure, I shouldn’t worry about efficiency for project euler

22:34 lemonodor: as a clojure beginner, 4clojure helped me. I also did the matasano crypto exercises, and am going through rosalind.info now.

22:34 dbasch: masconejos: you can have both, you have to think in terms of laziness though

22:34 justin_smith: masconejos: reduce short circuits. I think I mentioned REDUCED at least five times.

22:35 `szx: masconejos: you can use reduced to terminate a reduce

22:35 justin_smith: sorry for the all caps but I feel like I have been repeating myself

22:35 sjy: masconejos: i thought you were agreeing with us earlier, that the inefficiency of the other clojure solutions has nothing to do with the fact that they're in clojure

22:35 `szx: heh

22:35 masconejos: re: reduced - didn’t realize that. I was reading ‘reduced’ as past tense of ‘reduce’

22:35 danielcompton: lemonodor: do you have any tips for the matasano crypto exercises? I found it tricky handling byte-arrays e.t.c.

22:35 arrdem: not entirely true... one of these days I'm gonna benchmark some code in sbcl vs in clojure...

22:36 justin_smith: masconejos: it was in a context where I was explicitly saying you could short circuit, also

22:36 arrdem: but to do that I'd have to make myself write Common Lisp so

22:36 masconejos: justin: sorry I misunderstood. Still a beginner and there are so many functions…

22:36 justin_smith: np

22:37 lemonodor: danielcompton: that was actually the first code i ever wrote in clojure, and i’m sure i did it wrong. i just tried to use vectors, mostly.

22:37 dbasch: masconejos: it’s a bit overwhelming at first, but it does get much better over time

22:37 masconejos: sjy: I’m not saying clojure is inefficient. I’m thinking that the project euler questions don’t lend themselves to efficient, terse clojure statements

22:37 dbasch: masconejos: there are so many “lightbulb” moments

22:38 justin_smith: masconejos: if you need conj to have append semantics, the coercion to vector should be done to the arguments coming in, not the value being returned

22:38 dbasch: masconejos: as a beginner, you probably don’t know enough clojure to make that assertion

22:38 masconejos: dbasch: I’ve had a long time love/hate relationship to lisp. I’m fascinated by it, but getting over the learning hump is hard

22:39 dbash: that may be true

22:39 justin: can you give me an example?

22:39 dbasch: masconejos: I’m sure there’s some eye-opening stuff here: http://clojure-euler.wikispaces.com/

22:40 Raynes: I've never learned anything worth learning that wasn't a bit difficult.

22:40 For example: programming.

22:40 That took me a bit.

22:40 technomancy: what about eating ice cream

22:40 Raynes: Learning to eat in general.

22:40 technomancy: actually yeah, that does take a while

22:40 bbloom: I'm still learning to eat ice cream

22:40 dbasch: technomancy: the difficult part in eating ice cream is stopping :P

22:41 technomancy: I have firsthand eyewitness proof

22:41 arrdem: breathing was pretty hard too...

22:41 bbloom: I somehow manage to get chocolate on everything every time.

22:41 also, i can't be trusted with spaghetti sauce

22:41 masconejos: dasch: that’s the website I was comparing my code against. The answers are all roughly the same except for the ~7th one down by rockman, which I don’t understand the semantics of what he is doing, but its run time is similar to mine

22:43 justin_smith: masconejos: I was refering to the usage of (into []) in get-digits and mirror-palendrome - you had said this was because you prefer the conj behaviour of vectors, but it is being called on the return value

22:43 masconejos: so it is either noise, or some other function needs a vector as input, and it would be more clear if it did the coercion to vector on its arg

22:43 and less likely to randomly break

22:44 dbasch: masconejos: if you had a lazy sequence and did drop-while not-palindrome of that, your code would be equally efficient

22:45 masconejos: justin: I’m not sure what I was doing there. Originally it was a vector, and I obviously changed it around while debugging something-or-other… and then forgot I did so.

22:45 justin_smith: dbasch: dropping non-palindromes would be as efficient as generating all palendromes?

22:46 dbasch: justin_smith: I mean something like

22:46 ,first (drop-while #(not= 234 %) (range)))

22:46 clojurebot: #<core$first clojure.core$first@195cc92>

22:46 dbasch: ,(first (drop-while #(not= 234 %) (range))))

22:46 clojurebot: 234

22:46 dbasch: I don’t think I generated all numbers :P

22:47 justin_smith: masconejos: ok, just trying to help - most clojure functions (aside a few notable exceptions like conj get put assoc pop peek) do the same thing on a seq or vector and if what you are doing in your function is not a collection op the behavior should be identical

22:47 dbasch: but he is synthesizing palendromes directly, since we know their structure

22:47 dbasch: justin_smith: ok, I was thinking of something else

22:47 justin_smith: why check all numbers when you know how to generate the structure they have?

22:47 ok

22:48 (I mean all numbers below some limit, of course)

22:49 masconejos: justin: your last comment to me is still in regards to get-digits and digits-to-int, yes?

22:49 arrdem: ,[(- 23 21) (- 60 42)]

22:49 clojurebot: [2 18]

22:49 justin_smith: masconejos: yeah, about coercing a seq to vector on output

22:49 dbasch: justin_smith: take-while not-factors

22:50 justin_smith: dbasch: ahh yeah, that would be an equivalent :)

22:50 dbasch: justin_smith: and the lazy sequence generated with palindromes

22:50 justin_smith: and it would be much clearer

22:50 masconejos: justin: I agree. I did something weird there

22:51 dbasch: lazy seq generated with palindromes….. that’s a good idea. I’ll have to figure out how to do that

22:51 justin_smith: (doc lazy-seq)

22:51 clojurebot: "([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls. See also - realized?"

22:52 justin_smith: or probably you could just use map or iterate

22:52 http://clojuredocs.org/clojure_core/clojure.core/lazy-seq old docs but still relevant

22:53 jared314: is clojuredocs.org dead or just slow in updating?

22:53 arrdem: the maintainer got abducted by aliens

22:53 or something

22:54 so dead

22:54 jared314: is it open source?

22:55 justin_smith: mainly I only end up linking to clojuredocs.org because of http://clojure.org/cheatsheet

22:55 that plus laziness

22:55 danielcompton: When should you use filter vs take-while?

22:55 jared314: if it was open, it could be rehosted

22:55 danielcompton: They seem pretty similar

22:56 arrdem: danielcompton: take-while stops taking, filter doesn't :P'

22:56 rufoa: take-while stops as soon as the condition fails, filter doesn't

22:56 TravisD: danielcompton: take-while wont return anything after the first element of the seq that doesnt' match the predicate, where filter will return all matches

22:56 danielcompton: :facepalm:

22:59 dbasch: ,(take-while #(not= 10 %) (range)) ;; danielcompton

22:59 clojurebot: (0 1 2 3 4 ...)

23:00 danielcompton: I think it's coffee time

23:00 jared314: ,(take-while #(not= 3 %) (range))

23:00 clojurebot: (0 1 2)

23:00 justin_smith: ,(take 5 (map (fn [i] (let [d (map #(char (+ (int \0) (- (int %) (int \0)))) (str i))] (apply str (concat d (reverse d))))) (range))) ; a starting point?

23:00 clojurebot: ("00" "11" "22" "33" "44")

23:01 justin_smith: I am probably doing silly things that could be fixed above

23:04 gtrak: oh man, cider's java support is brilliant.

23:04 justin_smith: really?

23:04 gtrak: now it is.

23:04 yea, jeffvalk added a bunch of awesome.

23:05 like jump-to-source if you add the source jar to deps.

23:05 and javadoc and such.

23:05 masconejos: Well, I have enough to play around with for now. Thank you all for your input.

23:06 technomancy: can you read javadoc using eww?

23:07 jared314: you volunteering?

23:07 gtrak: eww?

23:07 it opens up chrome

23:07 jared314: technomancy: that depends on if you actually have the source and data

23:07 justin_smith: http://www.emacswiki.org/emacs/eww

23:08 technomancy: not me personally

23:08 arrdem: jared314: it was only ever a Ruby wrapper around the Clojure source...

23:08 gtrak: technomancy: sounds possible, the client is doing it.

23:09 technomancy: cool. I hate going to the browser; it's why I never use javadoc if I can avoid it.

23:10 gtrak: ditching inline clojure is really working out.

23:11 technomancy: it wasn't that bad when you could write it as proper forms

23:11 but the stuff that had to be strings... ugh

23:11 gtrak: yea, but we need real namespaces and things.

23:12 technomancy: dinc

23:12 gtrak: and tests.

23:12 arrdem: "real namespaces"?

23:12 gtrak: arrdem: cider-nrepl used to be scattered across elisp files.

23:12 in snippets

23:13 arrdem: gtrak: ah. I didn't know the context.

23:13 gtrak: it was totally unmaintainable.

23:13 technomancy: still no real namespaces in emacs lisp, sadly

23:14 gtrak: also I couldn't have practically implemented CLJS support like that.

23:14 arrdem: technomancy: isn't there a cl-namespaces library?

23:15 technomancy: arrdem: there are some crackpot code-rewriting macros on the fringe.

23:16 arrdem: lazybot: macros are crackpot code rewriting

23:16 technomancy: sorry, code-walking

23:16 and then rewriting

23:19 justin_smith: seems like in theory you could make a namespace out of closures, except for the part where you reference the values in the ns

Logging service provided by n01se.net