#clojure logs

2014-05-06

01:41seangrovebbloom: Any thoughts on animation re: layout systems?
01:41seangroveWorking 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
02:50waynrhow do i run a task before creation of jar file in clojure
02:52dbaschwaynr: 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
02:52waynri'd like to run a function prior to the creation of the jar
02:53waynrto create a manifest of the contents of the resources directory
02:54waynrsomeone 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)
02:54waynrs/)/"/
02:54waynrnow my brain is pretty much done for the day
02:54dbaschworst case you can do it with a custom plugin
02:55dbaschwhich is easier than it sounds
02:55dbasche.g. https://github.com/technomancy/leiningen/wiki/Plugins
02:56waynryeah
02:56waynror simpler, use a simpler language like bash or python to puke out the manifest
02:58dbaschI don’t think bash or python are simpler than clojure :)
02:58waynri am writing a plugin right now to so i think i see wha tyou mean
03:17gwswaynr: 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)
05:26f3ewhttp://pastebin.com/SAQqPm79 Why is my function capturing the entire string?
05:28maxthoursief3ew: guessing, but usualy with regex group 0 is the whole string
05:28maxthoursief3ew: try [_ top_level hostname srv]
05:29maxthoursie(that is ignore the first argument)
05:29clgvf3ew: yes the first entry in the vector is the entire match, after that follow the groups
05:29clgvjust use (rest (re-find #"^(sys)\.(\w+)\.(.+)$" service))
05:31clgvf3ew: it does not make much sense to destructure the result just to assemble it to a vector again
05:33clgvf3ew; why do you capture "sys" in a group anyway if it is just a constant?
05:33f3ewclgv: it's not going to be captured into a vector
05:33f3ewI'm trying to build up the parsing function
05:34f3ewFirst, easy test case is strings starting with sys
05:35f3ewThe data source is arbitrary '.' separated strings, some of which I've to handle
05:38f3ew-t
05:38f3ewerm, s/t$//
05:40f3ewThanks.
05:40f3ewSo why is capture group 0 always the whole string?
05:40maxthoursief3ew: it's the whole string that matched
05:41maxthoursief3ew: it your not using ^ and $, that might not be the whole string
05:41f3ewHmmm, my understanding of capture groups was that you would need to enclose them in ()
05:41maxthoursief3ew: so there's always an impicit capture group around the whole re
05:42f3ewYes, but why?
05:43maxthoursieit's a shortcut if you only matching something simpl
05:44maxthoursie(first (re-find #"\.(.*)")) would give you everything except for the text before the first dot, for example
05:45CookedGr1phonHey, 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
05:45maxthoursie,(first (re-find #"\.(.*)" "foo.bar.baz"))
05:45clojurebot".bar.baz"
05:45CookedGr1phonI 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
05:47maxthoursief3ew: ok, just read (doc re-groups), that would have been better using just
05:47maxthoursie,(re-find #"\..*" "foo.bar.baz")
05:47clojurebot".bar.baz"
05:48maxthoursief3ew: can't find a use case right now, but that's the way regex functions in most languages works
05:59foofoobarHi. When I'm in the REPL, how can I go to a new line (without submitting the current command)
06:00foofoobarhitting just enter works, but then I cant indent with tab, I have to use spaces then
06:04clgvf3ew: consistency, without capturing groups you just get the match
06:13clgvfoofoobar: "lein repl"? some emacs repl? ccw? cursive? vim-fireplace?
06:18foofoobarclgv, lein repl
06:21clgvfoofoobar: well if you want features like autoident I guess you have to use some kind of "IDE", e.g. one of the above mentioned
06:22foofoobarclgv, I'm a vim user, so I will have a look at vim-fireplace
06:22foofoobarthanks
06:24visofi have created package jar using leinengen leun uberjar and it depends on other java jar package how can i run it?
06:25visofjava -cp bar.jar foo.jar , foo.jar is what is created by lein uberjar
06:25visofbar is a java jar
06:25visofi need to use some methods from bar.jar in foo.jar
06:25visofhow can i do this?
06:27llasramvisof: (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
06:27llasram(b) java -cp foo.jar:bar.jar WhateverClass
06:28visofllasram: how can inject this local jar to lein project to package all together?
06:29llasramIs this a JAR for an existing other Leiningen project, and you just want it available locally for testing the whole app or something?
06:29llasramIf so, `lein install` will install the JAR in your local maven repository (~/.m2)
06:34fizrukhow do I convert string to int or nil (if parse fails)
06:34fizruk?
06:36llasram,(defmacro ignore-errors [& body] `(try ~@body (catch Exception _# nil)))
06:36llasram
06:36clojurebotllasram: Cool story bro.
06:36llasramAww
06:36llasramRight, no exceptinos in bots
06:36llasramfizruk: Anyway, just use `Long/parseLong` and catch any exceptions
06:37fizrukokay
06:46fizruk,(Boolean "123")
06:46clgvvisof: as llasram said uberjars already contain all declared dependencies
06:46clojurebot#<RuntimeException java.lang.RuntimeException: Expecting var, but Boolean is mapped to class java.lang.Boolean>
06:46fizruk,(Boolean. "123")
06:46clojurebotfalse
06:47clgv,(= (Boolean. true) true)
06:47clojurebottrue
06:47clgv,(= (Boolean. false) false)
06:47clojurebottrue
06:47visofclgv: can i declare jars which isn't remote?
06:47clgvfizruk: better do not construct booleans manually ;)
06:47clgvvisof: I dont understand that question
06:48alex______My clojure project run on localhost is fine but after the deploy on heroku some page not functioning well
06:48fizrukclgv: I want “true” -> true, “false” -> false, “whatever” -> nil
06:49clgv,(Boolean/parseBoolean "true")
06:49clojurebottrue
06:49clgv,(= (Boolean/parseBoolean "false") (Boolean/parseBoolean "false"))
06:49clojurebottrue
06:49fizruk,(Boolean/parseBoolean "123")
06:49clojurebotfalse
06:50fizrukclgv: ^ that’s the problem :(
06:50clgvlol a number is no boolean ;)
06:50llasram(fn tristate [x] (case x "true" true, "false" false", #_else nil)) ;; Although why the hell do you want this?
06:50fizrukwhy is it so inconsistent? T_T
06:50clgvyou just want something according to clojure's truthy semantics?
06:50clgv,(boolean "123")
06:50clojurebottrue
06:51fizrukno, I want to ignore things that are not “true” or “false”
06:51clgv,(mapv boolean ["123" 1 false true nil])
06:51clojurebot[true true false true false]
06:51clgvfizruk: you need to explain that with some more examples.
06:51llasram,(map (fn tristate [x] (case x "true" true, "false" false, #_else nil)) ["true" "false" "whatever"])
06:51clojurebot(true false nil)
06:51fizrukllasram: that’s how I’d do it, yeah
06:52clgvfizruk: ,(filterv boolean? ["123" 1 false true nil])
06:52clgv,(filterv boolean? ["123" 1 false true nil])
06:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: boolean? in this context, compiling:(NO_SOURCE_PATH:0:0)>
06:52clgv,(filterv #(instance? Boolean %) ["123" 1 false true nil])
06:52clojurebot[false true]
06:52fizrukllasram: clgv: just would like it to be simpler
06:52alex______My clojure project run on localhost is fine but after the deploy on heroku some page not functioning well
06:53fizrukclgv: I get strings from user and i want to ignore invalid boolean fields
06:54clgvfizruk: whats the probelm with "case" then?
06:54fizruk,(Boolean. "asd")
06:54clojurebotfalse
06:54clgvfizruk: forget about that class and its constructor
06:54fizrukclgv: no problem, it just seems inconsistent that (Integer. “asd”) throws exception, but (Boolean. “asd”) returns value
06:56clgvfizruk: well its consistent to its docstring http://docs.oracle.com/javase/7/docs/api/java/lang/Boolean.html
06:56clgv,(Boolean/parseBoolean "123")
06:56clojurebotfalse
06:56clgvsame there...
06:57fizrukI just don’t get why they made it work this way
06:58fizruki’d expect parseBoolean to parse booleans
06:58fizruknot to return false when string is not “true”
06:58clgvwell, you probably wont find out here ;)
06:58fizruki guess :)
06:59clgvthere is a java channel where they might now. but I dont know if the reason will matter that much to your dev project ;)
06:59fizruki’m just complaining, nvm
07:17bilbobragginsI'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?
07:23fizruk,({"true" true "false" false} "123”)
07:23clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
07:23fizruk,({"true" true "false" false} "123")
07:23clojurebotnil
07:24fizrukllasram: clgv: going to use this ^
07:28visofi have created local repo and added the my jar package to it
07:29visofand then i did lein deps
07:29visofbut i got this errors http://sprunge.us/aaUe
07:29visofis there anybody can help in this?
07:30clgvfizruk: ah right. thats in fact the same procedure as in case ;)
07:30clgvfizruk: since case uses hashing as well
07:30fizrukgood to know case uses hashing
07:31clgv~repeatability
07:31clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
07:32clgvvisof: for temporary development you need to install the jar you want as dependency locally (lein install or such) at least
07:32visofclgv: lein install give me the same resutl
07:34clgvvisof: you need to install the dependency locally not the project that is using it
07:34visofclgv: how can i do this?
07:35clgvvisof: how did you get its jar in the first place?
07:37clgvvisof: http://www.elangocheran.com/blog/2013/03/installing-jar-files-locally-for-leiningen-2/
08:03clgvusing 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))) ?
08:07visofclgv: how can i add deploy-file plugin to pom.xml ?
08:07visofin lein project
08:09maxthoursieclgv: that does look weird
08:18maxthoursieclgv: gen/nat doesn't generate very big numbers
08:22maxthoursieclgv: you should use gen/choose
08:22maxthoursieclgv: ((juxt first last) (sort (gen/sample (gen/choose -128 127) 100000)))
08:27maxthoursieclgv: oh, you should probably use gen/byte :)
08:31f3ewWhat does the -> operator/macro/function do? /win 10
08:31maxthoursief3ew: it's the threading macro
08:31llasram(doc ->)
08:31clojurebot"([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."
08:32f3ewRight, so just reverse ordering for readability
08:32f3ew?
08:32maxthoursieyes
08:32llasramKind of
08:32llasramNote that it is thread-first, vs ->>'s threat-last
08:33maxthoursiethat is insert as first argument or last argument
08:35maxthoursie->> tend to be more useful with higer order fns
08:37AWizzArdamalloy_: 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)
08:38AWizzArd(defrecord Foo [a b c]) (.b (Foo. 10 20 30)) => 20
08:48visofi 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
08:48visofplease anybody can help in this?
08:49visofit doesn't see the local pacakge
08:51beamsolein won't respect you setting M2_HOME in your shell?
08:53visofbeamso: for me?
08:53KeithPMamalloy_: 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?
08:53llasramvisof: You installed the hdt-java-core JAR in your local repository with the group-id `local`?
08:53beamsovisof: yeah
08:53visofllasram: yeah
08:53visofllasram: is this wrong?
08:53beamsoto me it sounds strange to not use ~/.m2
08:54llasramsrlsy
08:54visofbeamso: if i have used the default path of ~/.m2 i got the same
08:54beamsocould you find the .jar under ~/.m2/repository?
08:55visofbeamso: 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"
08:55visof?
08:56llasramvisof: I'm not sure if this is the only problem, but your -Dpackaging should be "jar" not "jars"
08:58visofllasram: i did
08:59visofllasram: now to use this api from this jar i should use (import ?? )?
09:01CookedGr1phondoes clojurescript not support clojure.core/require?
09:04visofllasram: lein deps; lein install; don't notify me anything it's downloading jar from local repo
09:04visofand don't give me anything
09:05llasramUm. It doesn't need to download anything
09:05llasramIf you don't get an error, that means it's working
09:07visofllasram: i don't get anything, should i get classes compiled at classed dir
09:07llasramI'
09:08llasramSorry, I've used up my IRC support time this morning. Best of luck
09:08visofthanks
09:15clgvmaxthoursie: damn missed that one... I'll need it for the other sizes as well ;)
09:16clgvgen/choose is the trick I was looking for...
09:31clgvvisof: local repo is just a folder on your disk - there is no downloading needed
09:31clgvvisof: if you want to see all your dependencies use "lein deps :tree"
10:02visofi have a java method which is called HDTManager.mapHDT("data/example.hdt", null); how can i call it inside clojure?
10:03CookedGr1phon(HDTManager/mapHDT "data/example.hdt" nil)
10:06visofCookedGr1phon: i should import and require also right?
10:13CookedGr1phonah, so if you haven't alreaady got HDTManager imported you will need to *either* fully namespace qualify it (com.mycompany.whatever/HDTManager/mapHDT ....)
10:13CookedGr1phonor import it
10:13CookedGr1phonwhich will let you use the short version of the name
10:14CookedGr1phonrequire is only for clojure namespaces and shouldn't come into it
10:14visofCookedGr1phon: i did http://sprunge.us/PAMO
10:14visofCookedGr1phon: so now i can do as you told (HDTManager/mapHDT "data/example.hdt" nil) ?
10:16CookedGr1phonpossibly, I'm not sure about your use of import, I usually import them like so (:import [org.refhdt.hdt.hdt HDTManager HDT])
10:17michaniskincemerick: ping?
10:18CookedGr1phonvisof 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:22visofimport stuff is running using lein run without calling any method
10:22visofCookedGr1phon: i tried as you suggested and got Caused by: java.lang.RuntimeException: No such namespace: HDTManager ?
10:22visofCookedGr1phon: have i missed something?
10:22jcromartieno need to quote
10:22visofjcromartie: what do you mean?
10:23jcromartie(ns foo (:import java.util.Iterator (org.rdfhdt.hdt.hdt HDT HDTManager) (org.rdfhdt.hdt.triples IteratorTripleString TripleString
10:23jcromartie)))
10:23MrJones98Relatively inexperienced with clojure and encountering a weird error that highlights a fundamental lack of understanding on my part of what's going on…
10:24MrJones98if i do (clojure.walk/postwalk identity m) where m is (def m (somefunc)), it works as expected
10:24MrJones98if i do (clojure.walk/postwalk identity (somefunc)), i get an abstractmethoderror
10:25cemerickmichaniskin: pong, but leaving in 10m :-P
10:25MrJones98specifically, java.lang.ClassCastException: java.lang.Character cannot be cast to java.util.Map$Entry
10:26MrJones98not 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:26michaniskincemerick: 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:26jcromartieMrJones98: the 2nd arg to postwalk should be the value you want to walk
10:26jcromartieyou can't walk a function
10:26jcromartieyou can walk a structure
10:27cemerickmichaniskin: I don't know of any...but then, I don't use windows much for development
10:28MrJones98jcromartie: as in you can't call a function whose return value is used as the argument?
10:28michaniskincemerick: 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:28jcromartieMrJones98: that should be fine
10:28jcromartieoh sorry
10:28jcromartieI thought it was (defn m ...)
10:28michaniskincemerick: 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:28jcromartieis (somefunc) stateful?
10:29jcromartiei.e. does it return the same thing every time?
10:29cemerickmichaniskin: I'm not aware of anything aside from the compiler environment change that would be relevant
10:29michaniskincemerick: cool thanks!
10:30MrJones98jcromartie: somefunc pulls info from datomic… but there are no changes to the database in between calls in the above example
10:30MrJones98so, unless there's something else i don't understand about datomic, somefunc is effectively returning the same value between calls
10:31jcromartieWhat does (somefunc) return in the REPL?
10:31jcromartieis it what you'd expect?
10:32MrJones98yes, it's what i expect… i've been tweaking/experimenting with a bunch of stuff and my symptoms may have changed a little
10:33MrJones98if i do (somefunc) in the repl, and copy/paste the output into (def m <result of (somefunc)>), everything works as expected
10:34MrJones98if 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:35visofi can't run this http://sprunge.us/DXPD and got ns HDTManager not found
10:35jcromartievisof: you are still putting your classes in lists?
10:35jcromartievisof: there are two ways to import classes into a namespace
10:36jcromartie(import 'foo.bar.Class)
10:36jcromartieor the prefix list way
10:36jcromartie(import '(foo.bar Class1 Class2))
10:36visofjcromartie: is this wrong?
10:36gfredericks,(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:36clojurebot#'sandbox/inc-double
10:36gfredericks,(inc-double 3.14)
10:36clojurebot3.1400000000000006
10:36jcromartiewhen 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:37jcromartiei.e. it interprets (import '(foo.bar.Class)) as "import () from the package foo.bar.Class"
10:37jcromartiedoes that make sense?
10:37visofyeah
10:37visofi'll change it now and try again
10:37gfredericks,(inc-double 100.0)
10:37clojurebot100.00000000000001
10:38gfredericks,(inc-double 9e9)
10:38clojurebot9.000000000000002E9
10:39visofafter changing http://sprunge.us/GbSMM and i got this error: Caused by: java.lang.ClassNotFoundException: org.rdfhdt.hdt.hdt.HDT
10:39jcromartiealright, now we're getting somewhere :)
10:39visofcorrect http://sprunge.us/GbSM
10:40jcromartieso
10:41jcromartieare you using Leiningen?
10:41visofjcromartie: yeah
10:41jcromartieyou should have a dependency for the hdt stuff
10:42visofjcromartie: [local/hdt-java-core "1.1.1"]]
10:42jcromartiehuh, local?
10:42visofjcromartie: http://sprunge.us/aOSJ
10:42visofjcromartie: yeah local, because it's a java jar
10:42jcromartiethe [local/whatever "…"] in a dependency does not specify a repo
10:42jcromartieBTW
10:42jcromartieit's a group ID
10:43MrJones98i 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:43visofjcromartie: yeah i know :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}
10:43jcromartieso you would have to have installed that lib under a "local" group ID
10:43jcromartieOK
10:43jcromartieso
10:43jcromartiewhat's in maven_repository?
10:43visofjcromartie: http://sprunge.us/WeNf
10:44jcromartiethere's no group
10:44jcromartieit should be maven_repository/local/hdt-java-core/1.1.1
10:44visofyeah
10:44visofit's
10:44visofbut i have cd maven_repository; tree
10:44jcromartiestill wrong
10:45visofwhat wrong?
10:45jcromartieit's not going to find an artifact with the group ID "local", artifact ID "hdt-java-core", version "1.1.1"
10:45jcromartieif it's /maven_repository/hdt-java-core/1.1.1
10:45jcromartiethat's wrong
10:45jcromartieyou need /maven_repository/local/hdt-java-core/1.1.1
10:45visofit's maven_repository/local/hdt-java-core/1.1.1
10:45jcromartieoh ok
10:46jcromartieyou said "cd maven_repository; tree"
10:46visofyeah
10:46jcromartieand I don't see "local"
10:46jcromartieI see "."
10:46jcromartiehere http://sprunge.us/WeNf
10:46visofit's ok
10:46jcromartieOK
10:46visofnow?
10:46visofis there anything i did wrong?
10:47jcromartiewell presumably
10:48jcromartiealso what happened to all the quotes in your project.clj
10:49jcromartiehttp://sprunge.us/aOSJ
10:51visof_jcromartie> well presumably9 the last thing i got
10:51visof_jcromartie: what else you paste?
10:51jcromartiealso what happened to all the quotes in your project.clj
10:52jcromartiehttp://sprunge.us/aOSJ <— is missing quotes
10:52visof_jcromartie: the site
10:52jcromartieO
10:52jcromartieare you running your project in a REPL?
10:52jcromartieif you updated the project.clj you would need to restart
10:52visof_jcromartie: https://www.refheap.com/85177
10:52jcromartiebut this local custom maven repo thing is probably hugely messy… there has to be a better way to do it
10:53jcromartiewhy do you have it in a "local" group instead of the normal group that the lib uses?
10:53visof_jcromartie: what should i do?
10:53jcromartieoh also
10:53visof_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:54visof_jcromartie: remove groupId=local ?
10:54jcromartiealright that should be fine
10:54jcromartieOK
10:54jcromartieyour :repositories
10:54jcromartieshould be a vector of vectors, not a map
10:54jcromartiei.e.
10:54jcromartie:repositories [["local" ~(str (.toURI (java.io.File. "maven_repository")))]]
10:54jcromartiealso, you can define vars up above defproject if you want to
10:55jcromartieso you could say
10:55jcromartie(def local-repo (-> "maven_repository" java.io.File. .toURI str)) then later just ~local-repo
10:55jcromartiekeep your defproject cleaner
10:56visof_okay
10:56visof_now
10:56visof_what do you think about fixing this?
10:56jcromartieso have you updated your :repositories in project.clj?
10:57visof_yeah
10:58jcromartieand restarted your project?
10:59visof_jcromartie: i don't use repl
10:59visof_jcromartie: i can use it as java -cp hdt-java-core.jar foo.jar main.class ?
11:00visof_jcromartie: is this another way to use sdk from hdt-java-core.jar inside foo.jar?
11:01MrJones98jcromartie: 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:03jcromartievisof_: is there a reason you're using a custom build of the hdt lib?
11:03visof_jcromartie: is there another way to do this?
11:03jcromartievisof_: I mean is there a reason you're installing it locally rather than using one in the maven central repo, for instance
11:03jcromartiedo you have custom changes to it?
11:04visof_jcromartie: nope
11:04jcromartiethen use a repo where it already exists!
11:05jcromartieif you can live with 1.1, it's on maven central
11:05visof_jcromartie: http://mvnrepository.com/artifact/org.rdfhdt/hdt-java-core
11:05jcromartiedo you need 1.1.1?
11:05visof_nope
11:05visof_jcromartie: so what should i do?
11:05jcromartiejesus christ
11:05jcromartieexcuse me
11:05jcromartieuse that!
11:06jcromartie[org.rdfhdt/hdt-java-core "1.1"]
11:06jcromartiedone
11:06jcromartieno custom repos
11:07jcromartiesorry I assumed you had a reason to go through all the pain of an extra custom local maven repo
11:08jcromartiebut it is really easy to grab most open source maven artifacts, because Leiningen includes maven central
11:08visof_jcromartie: thanks
11:10visof_jcromartie: this HDTManager.loadHDT return HDT type which i use HDT hdt = HDTManager.loadHDT.... ; hdt.search("", "", "");
11:10visof_jcromartie: how can convert hdt.search() to clojure
11:12TEttingervisof_: http://clojure.org/java_interop
11:12alejandrovisof_: something like (.search (HDTManager/loadHDT))
11:32clgvvisof_: do yourself a favour and speed up your learn process by buying and reading one of those excellent clojure books ;)
11:51ghadishaybanI'm having trouble importing a closure library enum http://docs.closure-library.googlecode.com/git/namespace_goog_history.html goog.history.EventType
11:53ghadishaybanIt'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:56ghadishaybanCan 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:56dannoSo with (def ^:dynamic x 10) isn't ^:dynamic redundant? since all def and defn is a dynamic root binding?
11:57ghadishaybandanno: dynamic is not the default anymore, it's opt-in
11:59dannook, thanks ghadishayban
12:07ghadishaybanOk I successfully imported it, my cljsbuild output-dir was off
12:47rolfbo/ 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:49jcromartieit's not forbidden
12:51cbpvectors are not sorted collections so I doubt you can use subseq there
12:51rolfbany hints to what I should be doing?
12:52jcromartieI think subvec is going to be more useful to you
12:53rolfbthe docs doesn't even make sense to me for that function
12:53rolfbwhere do I go to read up on it?
12:54cbpsubseq is to be used with sorted-set's or sorted-map's
12:54rolfb(doc subseq)
12:54clojurebot"([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:54rolfbwhat does ek mean here anyway?
12:55rolfbend key?
12:56lemonodorno, 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:58cbprolfb: 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:59rolfbcbp: i've been considering that, but i hit a speedbump trying to pass a nested structure back via recur
13:00dbaschrolfb: I’m looking and how I did that problem, and I did exactly what cbp suggested
13:01dbaschthere’s nothing nested, just two vectors in my recur
13:01dbaschand a couple of flags
13:02rolfbdbasch: what's your username? would love to follow your solutions when i'm done
13:02cbpIf it makes things easier you can have two accumulators. One for the groups and another for the last group you have
13:02dbaschrolfb: dbasch :) not particularly proud of my solutions though, there are much better ones
13:02rolfbmore data is good ;)
13:03dbaschthere are a few that I like, the rest are mostly embarrasing
13:03jcromartieI did this one without recursion
13:03jcromartieit might be really bad performance-wise though
13:03rolfbjcromartie: oh?
13:03jcromartieyeah
13:03rolfbi can make a list of conditions that will pass the test
13:03rolfb:P
13:04rolfbwould be without recursion as well
13:04dbaschI didn’t use recursion either, just a plain old loop-recur
13:04rolfbrecur is ... recursion?
13:04dbasch(doc recur)
13:04clojurebotTitim gan éirí ort.
13:05dbasch,(doc recur)
13:05clojurebotGabh mo leithscéal?
13:05rolfbhaha
13:05rolfb:)
13:06jcromartierolfb: loop/recur is recursion if you ask me
13:06jcromartieI did it entirely with seq fns
13:06jcromartiehttps://www.refheap.com/85181
13:06dbaschjcromartie: loop / recur is definitely not recursion
13:06sdegutisHow do you usually pass plain old Clojure data from Clojure to ClojureScript?
13:07cbpapplication/edn? :-P
13:07sdegutisI 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:07sdegutislazybot is gone btw
13:08jcromartieedn/read-string
13:08sdegutisOh, I could alternatively render it as JSON on the server-side and unroll it on client-side that way.
13:09rolfbjcromartie: need to read up on macros a bit more
13:09jcromartiedbasch: it is effectively the same thing as a fn that recurs, no?
13:09sdegutiscbp: I don't understand your answer.
13:09sdegutisjcromartie: Thanks I will look for where to download the EDN library for ClojureScript.
13:09dbaschjcromartie: no, it’s the same thing as a for loop in other languages
13:10jcromartiesdegutis: it should be included as clojure.edn
13:10cbpsdegutis: you can serve edn and set Content-Type: application/edn
13:10dbaschjcromartie: or at least you can use it that way
13:10jcromartiedbasch: yeah sure, but it's equivalent to setting up an anonymous fn that recurs and passing it initial args
13:12dbaschjcromartie: ok, but it’s semantics. Nobody would say that (for i = 0; i < 10 ; i++) is a recursive solution to anything
13:12sdegutiscbp: that sounds like a hack
13:12sdegutisjcromartie: Is that included with ClojureScript? I get the error goog.require could not find clojure.edn
13:13sdegutisAh a staackoverflow post suggests it's "cljs.reader"
13:13jcromartieI guess not
13:13sdegutisWhich seems to work, except now I have to track down *print-fn* and who's supposed to set it.
13:14nullptryou can see edn going in both directions @ https://github.com/swannodette/om-sync/blob/master/src/om_sync/util.cljs
13:14sdegutisOh :)
13:15sdegutisIt works!
13:15sdegutis(I forgot that you just have to do .log js/console
13:15whodidthis(js/console.log
13:15cbpyou can put (enable-console-print!)
13:16cbpthat lets you use println and so on
13:16whodidthisyou know what really grinds my gears? printlns in dev tools pointing to the implementation of println
13:18jcromartiewhy in the world would println *not* do that by default
13:20sdegutisAlright everyone let's just all calm down.
13:20sdegutisBtw this worrrrks!!
13:20whodidthisi guess :( its just useful to know where prints are coming from in your code and console.log pretty bad at displaying clojure data
13:23jcromartiethat makes some sense
13:23coventry`I almost never use raw console.log, I have a utility function which composes it with pr-str.
13:23jcromartiethat would be much better
13:23sdegutisI guess I'm lazy then, for I always write (.log js/console whatever)
13:24jcromartieor convert clojure collections to JS ones, so that they can be inspected with the Chrome/Firefox console
13:24bbloomsdegutis: truly lazy would copy paste a function pp and then (pp whatever) :-)
13:25sdegutisNot 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:25sdegutisThat's extra work.
13:25bbloomsdegutis: why would you have to delete it?
13:25sdegutisBecause it doesn't belong there.
13:25bbloomit's not hurting anyone... leave it there :-P
13:25bbloomi have it in my lein profile tho for the clj
13:25sdegutisNo! It is wrong!
13:25bbloomer rather the jvm
13:25jcromartiesdegutis: to have a util function?
13:25jcromartiesdegutis: why?
13:25sdegutisTo leave a development function in production code.
13:26whodidthiswould advanced compilation remove such function if it was never used anywhere
13:26bbloomsdegutis: that is a bad mentality
13:26jcromartiethere is really no reason not to
13:26sdegutisI see.
13:26jcromartieI use production apps that console.log all the time
13:26jcromartieno qualms from me here
13:26sdegutisThank you for your time.
13:26ssswdondefmacro question, I want to do the following
13:27bbloomsdegutis: if it was useful for debugging during development, it will be useful for debugging in production
13:27bbloomsdegutis: all functions are production functions :-P
13:27coventry`Is this a teaching of Uncle Bob?
13:27bbloomUncle BBloom
13:28coventry`I was asking sdegutis :-)
13:28sdegutiscoventry`: Be you trolling, O sir?
13:29cbp nil
13:30rolfbthanks for the input everyone, need to get back to learning some principles
13:30sdegutisThanks.
13:30ssswdonI 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:31coventry`What is the correct result in that case?
13:31ToxicFrogssswdon: ...what would you expect? println returns nil, no?
13:31sdegutisssswdon: Are you sure you want to create a macro?
13:31shaungilchrist'false' is going to be problematic as well
13:32ssswdonif I use reverse case I don't get the ok just nil
13:32sdegutiscoventry`: No, it is my own idea.
13:32ToxicFrog,(if (> 3 9) (println 'false') 'ok)
13:32clojurebotok
13:32ToxicFrogwait
13:33seangroveAny way to "name" a time?
13:33ToxicFrogOh, I see.
13:33seangrove(time do-something "Do something")
13:33ToxicFrogThe way you wrote that is confusing as hell, ssswdon
13:33ssswdonyeah let me give another example
13:34ssswdon(my-iif(> 3 9) :then 'false :else 'ok) this is passed to a macro
13:35cbpseangrove: I think only something like another macro + an atom with a map will do?
13:35sdegutisssswdon: are you making Clojure more Ruby-like?
13:35ssswdonnope just playing with some macro
13:35sdegutisYou may want to use refheap.com
13:36coventry`I don't see why you'd need an atom. What's wrong with this? https://www.refheap.com/85182
13:36PigDudehm how do you prevent duplication in your test code of common test params?
13:37ssswdonjust trying to understand macors
13:37cbpWell I guess it depends how is the name going to be used
13:37coventry`Oh, I guess.
13:38ToxicFrogssswdon: so, either ask questions about macros, or pastebin your implementation and ask questions about that?
13:38clgvssswdon: (defmacro my-iif [expr & {:keys [then, else]}] `(if ~expr ~then ~else))
13:39clgv,(defmacro my-iif [expr & {:keys [then, else]}] `(if ~expr ~then ~else))
13:39clojurebot#'sandbox/my-iif
13:39clgv,(my-iif(> 3 9) :then 'false :else 'ok)
13:39clojurebotok
13:39ssswdonlet me play with that @clgv I will come back pastebin if needed
13:39ssswdonThanks!
13:40coventry`,(macroexpand '(my-iif(> 3 9) :then 'false :else 'ok))
13:40clojurebot(if (> 3 9) (quote false) (quote ok))
13:43clgv,(symbol "wait what?")
13:43clojurebotwait what?
13:44clgv:D
13:44coventry`,(keyword "I know, I know")
13:44clojurebot:I know, I know
13:45amalloycoventry`: 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:46coventry`That clever macro was clgv's actually.
13:46amalloyor, really, not using & {...} at all, because you *know* some genius is going to write (if t else y then x)
13:46amalloywell, it's your fault for having the same first letter as him. you get all the credit now
13:47coventry`Learning a new destructuring trick *and* undeserved credit for it. Such a deal!
13:48amalloycoventry`: see also :strs
13:48amalloyhandy for destructuring deserialized json
13:48bbloomamalloy: and a major reason why i simply don't believe in keywordize-keys :-)
13:49clgvamalloy: I just implemented it such that the given example runs ;)
13:50amalloyclgv: wellllll...his given example included the keyword :else'ok, which sounds like something an orc would say
13:52AWizzArdhaha
13:52clgvamalloy: automatic error correction - I purchased that brain addon last week -seems to work ;)
13:58jcromartieoh, clojure-test-mode, where have you been all this time?
13:59nullptrjcromartie: melpa? :)
14:00technomancywait... clojure-test-mode is not good software =\
14:01jcromartieOK wait
14:01jcromartieno it's not
14:01jcromartiewhy does it run more tests every time I run C-c C-,
14:02jcromartieWTF
14:04technomancyit's just a big monkeypatch
14:05gtrakfunny to see monkeypatch nouned.
14:05gtrakconjures a field a monkeys.
14:05gtrakof*
14:05shaungilchristhttps://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRklQbX8XAroKzht35BqhfkAjZrBP2zB2zg7cv7thN0QSIPUeHMOw
14:06gtrakmonkey patches: https://www.google.com/search?q=monkey+patch&amp;es_sm=122&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ei=iyNpU471BPLCyAGd1ICgCg&amp;ved=0CAkQ_AUoAg&amp;biw=950&amp;bih=478
14:07jcromartieWHYYYYYYYY
14:07jcromartieI'm scared
14:10jcromartieok but seriously, why does C-c C-, keep adding to the tests that are run every time?
14:10jcromartiemaybe I need to RTFS
14:19gunsDoes 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:20gunsSetting up the analyzer takes a bit of work, so I thought I'd ask here first
14:22bbloomguns: could maybe do something for very simple cases, but determining that sort of thing more generally requires abstract interpretation. the analyzers are lexical
14:22gunsbbloom: Do you think it would be possible at least for type hinted forms?
14:22amalloyguns: imagine (let [c (Closeable.) f (fn [x] (.close x))] (f c))
14:23amalloyyou 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:24bbloomguns: 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:24bbloomanything beyond that requires symbolic execution
14:24bbloomguns: it also won't work for deftype and other runtime-created types that may implement Closable
14:24bbloomguns: again, that would require symbolic execution
14:25gunsamalloy: Unfortunately, I don't see the problem with that
14:25gunsbbloom: I was hoping that the analyzer was capable of this. There is an Eclipse plugin that purports to do something similar
14:26bbloomguns: the analyzer serves the needs of a static compiler
14:26bbloomguns: and lexical macros
14:26waynrgws: that might help
14:26bbloomguns: it does not aim to do dynamic analysis of any kind
14:27bbloomguns: i believe core.typed does some symbolic execution, however. ambrosebs ?
14:27amalloyi'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:27ambrosebsbbloom: what does that mean?
14:27amalloyand i guess the same thing with: if(true) y.run();
14:28gunsamalloy: I suppose it would respond "maybe closed". It looks like it checks for a literal try or try-with-resource
14:28bbloomambrosebs: https://en.wikipedia.org/wiki/Symbolic_execution
14:32ambrosebsbbloom: seems like a bit of a stretch. core.typed isn't that smart.
14:32bbloomambrosebs: don't you do some kind of occurrence typing?
14:32ambrosebsah yes
14:32ambrosebsI get it
14:33ambrosebsthere's a separate proposition environment that relates bindings + paths to types
14:33ambrosebshelps with branch elimination and other things
14:34bbloomambrosebs: guns was wondering if he could use tools.analyzer to identify obviously broken usages of Closeable objects
14:34bbloomi told him probably not, but core.typed *might* be able to stretch to do it
14:35ambrosebsbbloom: like don't close things twice?
14:35ambrosebsetc
14:35bbloomguns: ?
14:35bbloomi figured like not use a try/finally construct such as with-open
14:35gunsNo, just warn that Closeable objects should generally be closed within the same scope
14:36gunsnot looking for 100% accuracy
14:36ambrosebsthe area of affine types is related to resource management in type systems
14:37ambrosebsI've been looking at it recently, I'm not sure if it fits with core.typed.
14:37ambrosebshttp://www.eecs.harvard.edu/~tov/pubs/alms/tovpucella-alms.pdf
14:38ambrosebsguns: is it easy to tell where Closeable things are created/scoped?
14:38ambrosebsdo you need a full type system to figure it out?
14:39ambrosebsAffine types could enforce programmers use transients correctly.
14:40gunsambrosebs: 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:40gunsAnd multiple .close calls on Closeable objects are not generally a problem
14:41gunsFalse positives are also not a problem; this would be a developer tool
14:41ambrosebsI don't know anything about Closeable tbh
14:42ambrosebscould you give an example?
14:42gunsthere's not much to know; classes implementing Closeable represent resources that should be manually closed
14:42gunsReaders Writers, etc
14:42gunsInputStreams
14:42ambrosebsahk
14:43ambrosebswhat's a bad example of using Closeable?
14:43gunsClosing resources at the same scope in which they are created is a sane way of dealing with them; like RAII
14:43gunsambrosebs: not closing an open file handle :)
14:44amalloyfalse positives aren't a problem, huh? i got your tool right here: (constantly true)
14:44gunsamalloy: :). one step closer
14:45gunsI guess I'll take a look at the Eclipse plugin and see if can be extracted for general use
14:45mikerodSo, 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:46mikerodI tried profiling a bit
14:46ambrosebsguns: it sounds possible. Would like to see some real macroexpansions of good/bad usage, I could comment more precisely
14:46mikerodmap-> definitely seems to get much slower when called many many times
14:46mikerod*I mean the performance diverges from the others quite a bit
14:47mikerodIt seems the hot spot comes down to <record-class>#create method
14:47amalloymikerod: i would be surprised if it were close to being as fast
14:47mikerodamalloy: it is much slower when I call it over 1mil times or so
14:48amalloy(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:49mikerodI 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:50mikerodamalloy: 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:50mikerodHowever, looks like I will need to be keeping positional around for now :)
14:51amalloyi don't think it should be three thousand times slower
14:52amalloyyou said "much slower", which i think is true: it should be like three times slower
14:52mikerodamalloy: hmmm
14:52gunsambrosebs: https://gist.github.com/guns/bc722e7ffd9ad1ee92ee
14:52mikerodWhen 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:52gunsexample file handle leak I wrote recently
14:53mikerodThe 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:54ambrosebs,(source with-open)
14:54clojurebotSource not found\n
14:54amalloymikerod: clojure.lang.Compiler$NewInstanceExpr/emitStatics
14:54coventry`Why can't (io/file file) close itself when it goes out of scope and is gc'd?
14:55mikerodamalloy: ah, hidden int he Compiler
14:55amalloydo you have the code for your example dotimes?
14:55mikerodin the*
14:55amalloycoventry: File objects don't need to be closed
14:55ambrosebsguns: what you want is simple to write.
14:55coventry`amalloy: Well, the FileInputStream in guns's example, then.
14:56amalloyand 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:56ambrosebsguns: use tools.analyzer to recurse down the macroexpansion until you hit a :let
14:56ambrosebshttps://github.com/clojure/core.typed/blob/master/src/main/clojure/clojure/core/typed/check.clj#L4398
14:56amalloywhat 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:56coventry`amalloy: Oh, I see.
14:57amalloyhttp://blogs.msdn.com/b/oldnewthing/archive/2010/08/09/10047586.aspx is a good article about gc philosophy
14:58gunsamalloy: That's just one kind of leak; closing resources is a good practice
14:58dbaschfile descriptor leak has always been an issue to watch out for in Java
14:59mikerodamalloy: I tink I can get one up
14:59Jaoodis clojure.java.io just a wrapper to java.io ?
14:59mikerod*think (can't type today)
14:59gunsamalloy: Thanks for the lead! this is the answer I was looking for
14:59gunsambrosebs: ^ meant for you
14:59amalloybbloom: guns is thanking you
14:59amalloyoh, ambrosebs? okay. bbloom brought ambrosebs in
14:59gunsand bbloom :)
15:00ambrosebsguns: the details should be straightforward, let me know if you get stuck
15:00rolfbjcromartie: seems like there's a lot of bugs in your solution
15:01rolfbre https://www.refheap.com/85181
15:01rolfbor, one atleast ;)
15:01rolfbtry calling it with [1 2 3]
15:02bbloomamalloy: guns: ambrosebs: :-)
15:03amalloyrolfb: yeah, he needs to add an (inc) in between (count v) and (range 2)
15:03amalloyand also, oh my god, that ->> makes things completely illegible
15:03rolfbwhat's the difference between -> and ->> ?
15:03rolfbis it as simple as left to right and right to left?
15:03amalloy,(macroexpand '(->> 1 (f x y z)))
15:03clojurebot(f x y z 1)
15:03amalloy,(macroexpand '(-> 1 (f x y z)))
15:03clojurebot(f 1 x y z)
15:03dbaschrolfb: where they expect the argument
15:04rolfbamalloy: interesting trick
15:04rolfbi'm called away, ttyl, thanks for information :)
15:06foofoobarsomeone coding clojure in atom (atom.io editor) ?
15:08amalloymikerod: you can also inspect the bytecode for MyRecord/create, which is probably easier than trying to understand the assembly stuff in the compiler
15:12amalloyfor 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:13amalloywhereas (->MyRec x y z) is (MyRec. x y z nil nil)
15:13mikerodamalloy: hmm, yeah decompiled is easier
15:13mikerodI'm trying to reproduce
15:13mikerodmy minimal attempt to reproduce got me about a 3x slow down, as you anticipated
15:13mikerodhttps://gist.github.com/mrrodriguez/e2138f220a9aa7eacc20
15:14mikerodHowever, my real example had a more "complex" map as the argument to map-> factory
15:14mikerodso I'm trying to see what could make the difference
15:14amalloymikerod: oh man, that benchmark is no good
15:14amalloyyou're timing the creation of the map as well as turning it into a record
15:14amalloy(let [m {...}] (time (dotimes ...))) is what you need
15:16amalloyalso, use criterium instead of time/dotimes - hugod is better at benchmarking than you or i
15:19mikerodamalloy: 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:19mikerodThis is a good library though that I wasn't aware of.
15:19mikerod*looks good
15:24agarmanI ran with criterium... map->MyTest 4 microsecond on my rig vs new taking 17 nanoseconds
15:25agarman5 microseconds actually
15:25amalloymikerod: 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:25PigDudeis there update-in for single case?
15:25amalloyso doing a linear number of them takes quadratic time
15:25PigDudei forgot the name, pretty sure there is a function for this
15:26gtrakPigDude: nah.
15:26PigDudelike how swap! works but for replacing a key
15:26PigDudegtrak: hm ok
15:26gtrakjust a weird quirk :-)
15:27dbaschPigDude: you mean like clojure.set/rename-keys ?
15:27mikerodamalloy: 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:27PigDudedbasch: nah, just for updating a value in-place
15:27mikerodIt seems they make the claim that map-> is "400x slower" than the -> factory
15:28gtrakI believe it.
15:28PigDudehm so is this the idiomatic way to append to a list in a hash? (update-in h :the-vec (partial concat appended)) ?
15:28gtrakbut 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:28PigDudeer, [:the-vec]
15:28gtrakPigDude: looks reasonable.
15:28arrdemnow if only schema could generate schemas from xss source...
15:29PigDudegtrak: there's not some shorthand for partial that i'm missing is there?
15:29PigDudegtrak: kinda wordy :P
15:29amalloyPigDude: if you're appending, you probably should have a vector rather than a list
15:29PigDudeamalloy: right, a vector, sorry
15:29amalloyand then you can just use into, instead of partial concat
15:29gtrakPigDude: could just use it without the partial.
15:30gtrak(update-in h [:the-vec] concat appended)
15:30PigDudeah, i see
15:30gtrakupdate-in uses apply and supplies the first arg to concat.
15:30gtrakappended would be the second.
15:30PigDudeamalloy: how does into differ from concat?
15:30PigDudeamalloy: besides concat taking several collections
15:31amalloy&(into [1 2 3] [4 5 6])
15:31gtrakconcat returns a lazy seq, into is essentially reduce+conj
15:31amalloy,(into [1 2 3] [4 5 6])
15:31clojurebot[1 2 3 4 5 ...]
15:31amalloyi hate all bots
15:31PigDude,(= (into [1 2 3] [4 5 6]) (concat [1 2 3] [4 5 6]))
15:32clojurebottrue
15:32PigDudeoh ok
15:32gtrakthat's because equality doesn't care about seq vs vector.
15:32amalloyPigDude: but one of those is a vector, and the other is a lazy seq
15:32gtrak'equality partitions' or whatever.
15:32PigDudeso (update-in h [:k] into v2)?
15:32gtrakbeautiful
15:33PigDudethanks for the help, i am still pretty new to clojure
15:33arrdemremind me why we don't have clojure.core/update ....
15:33gtrakbecause we're lazy bastards
15:33arrdem(inc gtrak) ;; truth hurts
15:33arrdemriiight. I'm bot ignored.
15:33lazybot⇒ 9
15:34amalloyarrdem: what does (clojure.core/update m a b c d e) do?
15:34bbloomhttp://dev.clojure.org/jira/browse/CLJ-1251
15:34arrdembbloom: cheers, voted up
15:35arrdemamalloy: bbloom's link is perfect :P
15:35amalloyarrdem: no, it doesn't address the question i asked
15:35gtrakthrows an error.
15:35amalloyokay, three
15:35amalloyer
15:35arrdemamalloy: oh, in that case I'd accept an arity assertion failure or an identity update.
15:36amalloyarrdem: 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:36amalloyie, (update-in m [a] b c d), or (-> m (update-in [a] b) (update-in [c] d)))
15:37amalloy(ignore the e, because i can't count)
15:37gtrakah, I guess the second behavior is more intuitive, michael church's update could be given a different name.
15:38gtrakmore inline with the other functions.
15:38gtrakin<space>line
15:38arrdemamalloy: 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:38bbloomi didn't read the ticket closely
15:39bbloomi'd also prefer varargs
15:39gtrakupdate-multi?
15:39amalloyarrdem: that's exactly the opposite of what gtrak said, i think
15:39gtrakamalloy: but I think I agree with what arrdem just said.
15:39amalloyanyway, 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:40arrdemgtrak: I vote that you are an inconsistent node and should be ignored...
15:40gtrakarrdem: It's probably for the best.
15:40gtrakI reserve the right to change my opinion instantly and tell noone.
15:42gtrakarrdem: did you see the mailing list thread about the varargs map? I thought it was funny.
15:42gtrakwhile you were having finals.
15:42arrdemgtrak: neg. that I'm back here is a poor choice I'll remedy once the coffee's done brewing
15:43gtrakbasically, they were like
15:43gtrak'Did cognitect suddenly change their position on varargs map-destructuring? Can anyone confirm or deny??!??!'
15:44ambrosebsninja edit
15:44foofoobarI just read on the LightTable website that it is written in ClojureScript. How can this be? I thought ClojureScript is compiled to javascript?
15:45gtrakfoofoobar: yes
15:45arrdemhahahaha oh right I tweaked the wiki :P
15:45foofoobargtrak, so LightTable is written in javascript?
15:45arrdemfoofoobar: and it runs on node
15:45gtrakfoofoobar: https://github.com/LightTable/LightTable/tree/master/src/lt
15:45foofoobaroh, okay. Thats interesting! I did not know you can create GUI applications with node
15:46gtrakfoofoobar: node-webkit is the shell that runs it all: https://github.com/rogerwang/node-webkit
15:47gtrakessentially it allows node.js to share memory with the browser dom JS transparently.
15:47foofoobarOkay. This is nice! LightTable looks awesome!
15:47gtrakso you can start up a system tray menu and mutate the dom in a single function :-)
15:48cbphopefully they keep developing it, in view of that aurora thing =/
15:48gtrakfoofoobar: 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:49foofoobargtrak, thanks, I'll have a look at it.
15:50gtrakit 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:51kelseygiwhat are reasonable JVM opts for a lil app running on a 1gb machine?
15:52gtrakkelseygi: I heartily recommend the G1 collector for lower memory usage with no downside, if run with -server.
15:52kelseygiooh, a hearty recommendation!
15:52gtrak-XX:+UseG1GC
15:53gtrakI think later versions of 6 can do it, but I haven't tested, 7 and 8 are great with it.
15:53kelseygihowsabout heap size & the such
15:54gtrakprobably 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:54gtrakG1 at least is more aggressive about freeing unused heap back to the OS.
15:57gtrakI 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:58kelseygiyeah this is for an extremely silly twitter bot
15:58kelseygiand i decided to have a go of deploying it myself on a lil server
15:58kelseygibut it's slooooooowwwwww to boot up
15:58kelseygiand tends to die
15:58kelseygiso i'm thinking i'm doing something incorrect
15:58gtrakwhy's it die?
15:59kelseygii'm not sure tbh--i'm just doing nohup lein trampoline run, nothing very clever or, uh, nice
15:59gtrakthere's no error or anything?
15:59kelseygii'm sure there is but i don't think i'm saving it unfortunately
15:59gtrakheh, well, you should probably figure that out before you tweak jvm opts blindly.
16:00kelseygioh hush, voice of reason
16:00kelseygihaha i think at first it was because i wasn't using trampoline
16:00kelseygii don' tknow, it doesn't seem to respect nohup
16:00kelseygiit seriously takes like 5 min to start up though which is nuts
16:01PigDudewhat's this operation called?
16:01PigDude,(let [x 13] (- x (rem x 3)))
16:01clojurebot12
16:01gtrakremainder?
16:01PigDudethis is a compound operation
16:01kelseygibut 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:02justin_smithPigDude: truncate-to-multiple-of-3 ?
16:02gtrakkelseygi: if you could attach a jvisualvm process to it, that might tell you something.
16:02gtrakbut you should be logging stuff for sure.
16:02kelseygiyes yes
16:02PigDudeeh nevermind :P
16:02arrdemwell if nohup isn't doing it, just run it in screen or at :P
16:02kelseygii tried screen!
16:02gtrakbut it makes no sense for nohup to be the problem.
16:03gtrakunless it does.
16:03kelseygihaha
16:03gtrakwe can't know that until we know why.
16:03kelseygiknown knowns, and known unknowns...
16:03coventry`What about a signature of (update m :key1 fn1 other-args1 :key2 fn2 other-args2), where other-args are seqs of values?
16:03gtrakkelseygi: you can simplify further, don't run it from lein, use an uberjar.
16:04kelseygioh that's a good idea
16:04justin_smithkelseygi: lein uberjar; java -jar target/yourapp.jar
16:04justin_smithmuch better startup time if you find the need for restarts
16:04justin_smithalso it's better not to run lein on production anyway
16:05coventry`(update m (fn1 k-or-ks1 other1 args1) (fn2 k-or-ks2 other2 args2)) seems like a pretty handy macro, actually.
16:05kelseygithere's a lot of things i'm doing here that are not really "production" quality...
16:05kelseygibut if you tweet "can i kick it" to @abotcalledquest it now responds with "yes you can"
16:05kelseygivery critical stuff :)
16:05kelseygiuberjar is a good idea though
16:05kelseygiwill try that after work, thank you!
16:05justin_smithnp
16:06justin_smithif nothing else it will restart faster after a crash if it is an uberjar :P
16:06arrdemheh
16:09gtrakkelseygi: https://www.youtube.com/v/t5CZJwB5R2k&amp;start=18&amp;end=26
16:09kelseygilololol
16:10nooniani can't wait for prismatic to release some of their other libs
16:10noonianall of their talks are like teaser trailers for their unreleased stuff lol
16:13kelseygithe 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:13kelseygithe sequels, about switching to streaming API and then deploying, will feature a lot more cursing
16:16gtrakkelseygi: were you the one asking about chunking in the streaming API?
16:16kelseygiyup!
16:16gtrakah ok.
16:16kelseygii got it working with atoms
16:16kelseygibut also got some good feedback on making it better
16:16gtrakerr wait, that was a different guy.
16:16gtrakSimon Katz.
16:17gtrakkelseygi: https://groups.google.com/forum/#!searchin/clojure/twitter$20api/clojure/dLMjY2i9tCg/voplu7ek9XQJ
16:18kelseygioh sweet!
16:18kelseygii did get to play with atoms to get it running which was pretty cool
16:18gtraknot sure if this should make it back into twitter-api or what.
16:18gtrakbut you can see my core.async impl there.
16:18kelseygii opened an issue and he basically said "nope"
16:18kelseygithank you, rad!
16:18seangroveI 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:19kelseygihere is mine, which is terrible https://github.com/kelseyq/clojure-twitter-bot
16:19kelseygibut i am like 10 days into clojure :)
16:19seangroveI could easily map through it, flatten the list, and then into {}, but that feels very wasteful if I care about gc
16:19gtrakmy core.async code is write-only at this point.
16:19gtrakI have no idea how to test it.
16:20arrdemseangrove: flatten is almost certainly the wrong answer...
16:20arrdemseangrove: I'd probably build a custom recursive walk, or even an iterative worklist walk.
16:20gtrakseangrove: filter+tree-seq?
16:20arrdem,(doc tree-seq)
16:20clojurebot"([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:20arrdemdamnit clojure y u so osum
16:22gtrakI used it on a massive clojure.data.xml thing to great effect.
16:22seangrovegtrak: That doesn't help me trak the path into the tree, and still going to be rough on gc
16:22seangroveI'll play around with it a bit more though
16:22gtrakbut it was relatively flat, I assume if it's not flat, then that takes up space.
16:22seangrovethanks gtrak
16:23stompyjxml?
16:23clojurebotxml is like violence; if it's not working, you're not using enough of it.
16:23stompyjred flag
16:23stompyj:D
16:23arrdem:D
16:23technomancy~botsnack
16:23clojurebotthanks; that was delicious. (nom nom nom)
16:24stompyjremember the days of CORBA, and RMI, and WSDL, and XML
16:24stompyjman
16:24stompyjwhat the hell were we all thinking
16:24stompyjthe saddest thing was, I was on board with it at the time
16:24arrdemI heard about CORBA from my software engineering lecturer and was promptly glad that I grew up with json-rpc
16:25stompyjthe late 90s were a rough ride
16:25stompyjheh
16:25arrdemI was about five at the time >.>
16:25stompyjhahahahah
16:26stompyjI was 18-ish *cough*
16:26stompyjso I can claim architectural ignorance
16:27gtrakstompyj: I once felt bad about getting turned down from a gig due to not having enough experience with OO. They used CORBA.
16:27gtrakthis was only 5 years ago.
16:27stompyjO_O
16:27arrdemhahahahaha
16:27arrdemoo?
16:27stompyjWe now have proof purgatory exists
16:28gtrakit's in Florida, at Harris corp.
16:28stompyjDid they want ERwin experience? LOL
16:30stompyjsorry, I’ve taken us to some dark corners here
16:30stompyj(dec stompy)
16:30lazybot⇒ -1
16:30gtrakI'm really glad now that I didn't get that job, I might've taken it.
16:30stompyjyeah man, you’d be hating life right now
16:36mordocaiI 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:36mordocailatest*
16:37arrdemmordocai: you're running cider 0.7.0, you need to add cider-nrepl to your lein profile
16:37arrdemmordocai: it's an unannounced breaking change from the Cider maintainer :D
16:37mordocaiarrdem: Ah, i'm new to clojure. Can you give step by step directions or a link? :P
16:37arrdem$google cider-nrepl
16:37lazybot[clojure-emacs/cider-nrepl · GitHub] https://github.com/clojure-emacs/cider-nrepl
16:38gtrakexcept 0.7.0-SNAPSHOT is probably what you want.
16:38mordocaiAh, nice. Right at the top. Thanks!
16:38gtrakstill churning a lot right now.
16:38arrdemmordocai: you want to add [cider/cider-nrepl "0.6.0"] to your profile, not the .1-SNAPSHOT
16:38mordocaigtrak: That's what it reports
16:38arrdemfuck snapshots
16:38gtrakarrdem: 0.6.0 is totally broken.
16:39arrdemgtrak: for real? working on both my machines...
16:39gtrakok, maybe not totally.
16:39arrdemheh.
16:39gtraktry doing M-. on a function with a map-arglist.
16:39arrdemmordocai: gtrak is one of the contribs, I'd go with what he says :P
16:40gtrak0.6.1-SNAPSHOT has an asm dependency that's broken for my work-project.
16:40gtrak0.7.0-SNAPSHOT should be relatively stable now.
16:41gtrakwe'll do a real release next time, I promise :-)
16:41arrdemgtrak: <3
16:42gtrakI was hoping to add CLJS support and be done with it, I'm ending up just being dependency and stability police.
16:43mordocaiAlright, seems to work now. Thanks!
16:43gtrakb/c I hate breaking people.
16:43mordocaiOn with "The Joy of Clojure"!
16:44PigDudein python / is an integer division operator, so 5/2 = 2. what's the equivalent in clojure?
16:44gtrak,(int (/ 5 2))
16:44clojurebot2
16:44nightfly(/ 5 2)
16:44clojurebot5/2
16:44PigDudegtrak: thanks
16:44gtraklong's probably better, actually.
16:44gtraksince the rest of clojure uses longs
16:44gtrak,(long (/ 5 2))
16:44clojurebot2
16:44pyrtsa,(quot 5 2)
16:44clojurebot2
16:45gtrakahh, I like that better
16:47amalloyseangrove: i'm curious what you're doing that you think optimizing for gc is necessary
16:48bbloomamalloy: he's trying to run a layout engine smoothly during browser resizing
16:49amalloyah. if you're not on the jvm, optimizing for gc is not unreasonable
16:55mordocaiAlright, 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:55arrdemmordocai: that's the expected CIDER version.'
16:55arrdemmordocai: did you add that plugin to your ~/.lein/profiles.clj?
16:56mordocaiarrdem: 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:56mordocaiDo I need to change that to alpha or something?
16:56arrdemmordocai: that should be the 0.6.1-SNAPSHOT
16:57arrdemunless gtrak says that's silly.
16:57gtrakmordocai: that sounds reasonable.
16:57gtrak0.7.0 should be working.
16:57mordocaiAh, kk. I thought he was saying it should be 0.7.0
16:58mordocaigtrak: 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:59gtrakreally? that's very odd.
16:59gtrakI'm using 0.7.0 all day without issues.
16:59arrdemgtrak: 0.7.0 or -SNAPSHOT...
16:59gtraksnapshot
16:59gtraklemme try updating my cider version to what's on melpa.
17:00arrdembetter do a git-commit and tag first...
17:00arrdemjust in case everything breaks >.>
17:00gtrakmeh
17:00seangroveamalloy: user-land layout in the browser
17:00gtrakdogfooding.
17:01amalloycrashed emacs? i've found that almost impossible; the best i've managed is to once or twice send it into an unresponsive coma
17:02mordocaigtrak: 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:02mordocaiamalloy: Yeah, that's actually what happened
17:02amalloywhich?
17:02mordocaiamalloy: coma
17:02amalloyah
17:03amalloymordocai: 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:03seangroveamalloy: It's too slow for production use, and GC is dominating everything
17:03amalloyand C-g woke it right up
17:03mordocaiamalloy: 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:03gfredericksamalloy: I swear I've got it to segfault a few times
17:03amalloyseangrove: yeah, bbloom filled me in, and i conceded that if you're not on the jvm then thinking about gc is reasonable
17:03gtrakmordocai: cider-nrepl should have no effect on what buffers cider sets up.
17:03seangroveamalloy: I would 100% prefer not to think about it at all :(
17:03gtrakI can't see how that could be the case.
17:04seangroveOr at least not in this goddamn goat-entrails-reading approach
17:04Bronsaamalloy: I've had emacs crash on me multiple times (I use it through emacsclient)
17:04amalloygfredericks: you could just use sudo and /dev to muck with its address space. that should get you a segfault right quick
17:04gfredericksamalloy: oh I didn't mean intentionally
17:05gfredericksbut that's an interesting capability I was unaware of
17:05arrdem /proc is an amazing thing :P
17:06amalloyyeah, i actually meant /proc
17:06gtrak/dev/kmem russian roulette?
17:06amalloyalthough you could probably do it with /dev/kmem if you knew how
17:06amalloyactually debian doesn't expose kmem anymore afaict. just /dev/mem
17:06gtrak'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:07arrdemgtrak: you need to clarify the rules so that it's iterative with random choice of the first "player"
17:07amalloyhttps://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:08arrdembut but how can I play with writing my own rootkits then...
17:08arrdemT_T
17:08amalloyand people playing silly games. c'mon, ubuntu, get with the program
17:10arrdemlooks like Arch doesn't expose /dev/kmem anymore either...
17:10gtraklatest 0.7.0-SNAPSHOT and latest melpa's working fine for me.
17:11gtrakI recommend it b/c it should stop the freezing issues.
17:11gtrakthough my attempt at a wrap-exceptions nrepl-middleware left me with more questions.
17:11gtrakI don't feel comfortable merging it in yet.
17:14mordocaigtrak: Okay, so weird shit on my end. May be seomthing with my setup specifically. Short overview http://paste.debian.net/97845/
17:16gtrak*cider repl localhost* seems to tell me this is being run outside of a project?
17:16justin_smithamalloy: re crashing emacs, there are some low level ops in elisp that can totally segfault if misused
17:16gtrakmordocai: I haven't tested that at all.
17:17gtrakthere's a lot of edgecases in leiningen around that.
17:17mordocaigtrak: I've been running it outside of a project the whole time I think. Just a raw .clj
17:17Bronsajustin_smith: my emacs used to crash from time to time while opening Compiler.java
17:17Bronsaor while resizeing the terminal
17:17gtrakmordocai: try making a project, then we'll make an issue if that fixes it.
17:17technomancyare you guys running from trunk or something?
17:17mordocaigtrak: Kk, one sec
17:17gtraktechnomancy: lein-trunk?
17:18technomancygtrak: emacs trunk
17:18technomancyI've seen one of two segfaults when I ran from trunk, but it's been years.
17:18arrdemI've never had emacs straight up crash. I've killed it with JVM system memory usage, but never had it crash
17:18technomancynot since before 23 was released anyway
17:18gtrakI'm using ubuntu 14.04's standard emacs24
17:19arrdemoh good they finally have emacs24... no more janky PPAs for 24.
17:19gtrakarrdem: that's been the case for a couple years :-)
17:19gtrakbut you had to explicitly install emacs24
17:19gtraktechnomancy: do you think running outside of a project would have issues with nrepl-middlewares by cider-nrepl's plugin mechanism?
17:20gtrakI've never tried.
17:20gtrakbut I also don't see what would be different about 0.6.1-SNAPSHOT vs 0.7
17:20gtrakin that regard.
17:20technomancygtrak: seems unlikely, but possible
17:20technomancyhard to think of how that would affect an nrepl middleware
17:21technomancydo you have a link to the source?
17:21mordocaigtrak: 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:21gtrakyea: https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider_nrepl/plugin.clj
17:22technomancygtrak: hm... one of those artifacts that's a plugin and a dependency at the same time?
17:22gtrakyea
17:22gtrakbad idea?
17:22gtrakI stole it from cemerick
17:23technomancywhen I used to do that with swank it was more trouble than it was worth
17:23gtrakarrdem: http://packages.ubuntu.com/search?keywords=emacs24 13.10 had it
17:23arrdemgtrak: ah. I was on 13.04 at work last summer.
17:23gtrak13.04 also
17:24technomancygtrak: but yeah, I can't see anything here that would run differently outside a project vs inside
17:24cemericktechnomancy: 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:24technomancycemerick: well, this was before we could slurp the version at runtime, so we had to maintain the two numbers by hand
17:25seangroveAutomatic type conversion...
17:25technomancymy gut still tells me it's better that different things remain different, but I don't know if I have any concrete warnings.
17:25arrdemtechnomancy: on that note... thoughts on having project version be (slurp "VERSION.txt")? :P I recall getting that to work before...
17:25mordocaigtrak: Alright, seems to work with a project
17:25gtrakmordocai: phew
17:26technomancyarrdem: you can read pom.properties
17:26gtrakI'll try to investigate it sometime.
17:26mordocaigtrak: Got *cider-repl learning-clojure* and errors are reported
17:26gtrakcemerick: 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:27gtraknext 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:30gtrakmordocai: https://github.com/clojure-emacs/cider-nrepl/issues/57 if you feel like investigating it more yourself.
17:30mordocaiHow 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:31mordocaigtrak: I may take a look later, focusing on just clojure right now :P
17:31gtrakyou can do that with tools.namespace
17:32gtrakmordocai: 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:32gtrakI like full control.
17:32arrdemyou can also just C-c C-k the file, or (require '[] :reload)
17:32stompyjI was defending clojure in a haskell/clojure thread and the dude who’s comments I gently eviscerated downvoted me… annoying
17:33arrdemstompyj: welcome to the haskell/clojure jihad, here's your paper shield enjoy the rain of downvotes
17:33justin_smithtechnomancy: not running from trunk, but operating on fairly low level stuff in the way emacs represents buffers, with bugs in my elisp code
17:33stompyjarrdem: LOL
17:34arrdemstompyj: fighting in the shade isn't as easy as it would seem...
17:34stompyjIf I had known he was going to downvote me anyway, I would have at least verbally destroyed him in the thread
17:35arrdemheh. Idk... the Haskell vs. Clojure thing is something I'm still struggling with.
17:35stompyjI’ve never used Haskell, I have a buddy who uses it and seems to dig it tho
17:36stompyjThis one guy was just outright lying about clojure, so I corrected his points, very nicely and got downvoted for my efforts :)
17:36amalloyi don't know that you can gently eviscerate something
17:36gtrakamalloy: it takes a long time.
17:36stompyj(inc gtrak)
17:36lazybot⇒ 10
17:36RaynesAlso pics or it didn't happen.
17:37stompyjprecisely
17:37arrdemTIL stompyj is a Bolton
17:37stompyjhahahahah
17:38stompyjThat’s the last house I’d be for!
17:38arrdemhehe. The north remembers
17:38stompyjWhy isn’t there a “X language is like Y house in GoT” yet?
17:38stompyjThats what I should have responded to that dude with “Winter is coming."
17:39RaynesI'm hoping because people are getting sick of the internet dripping with GoT references.
17:43stompyjit’s been fun to see it translated to tv
17:43arrdemI watched the first two seasons, read all the books before the 3rd and am now enjoying the ride.
17:44TEttingerRaynes: you like unusual music, right? http://youtu.be/qubi8F7H6qA
17:44arrdemthat said the show's visuals often mismatch with my imagination so there's some jarring.
17:46stompyjyeah, tyrion is much too attractive
17:46stompyjhe’s like a hobbling sack of potatoes in the book
17:47technomancyarrdem: too young to remember that happening with lotr? =)
17:47arrdemtechnomancy: shhhh I'm trying to blend in with the grown ups
17:47cbpits time for some scaphism
17:47justin_smithTEttinger: 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:48gtrakoh 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:48gtrakway worse
17:48coventry`justin_smith TEttinger: I'm enjoying it.
17:49TEttingerjustin_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:51stompyjI watched all three LOTR movies back to back in a movie theater here in NYC
17:51stompyjand I’ve never recovered
17:51stompyjI haven’t even watched The Hobbit
17:51stompyjit broke me
17:52arrdemall three in one sitting? ouch. I've done that but with like bathroom breaks, beer, friends, popcorn and daylight..
17:52stompyjyeah
17:52stompyjit was too much
17:52coventry`I guess these youtube songs will last just as long as they stay unnoticed by the RIAA. :-)
17:53nooniani tried all the lotr in a basement with friends but afterward i just felt depressed; also they were the extended editions :(
17:53TEttingerthey're also available from his site, which offers, cleverly, a download link via MEGA
17:53arrdemthe extended editions are totally better...
18:05gtrakTEttinger: I like the Billy-Jean Smells like Teen Spirit mashup more than the one you linked.
18:05TEttingerindeed.
18:05TEttingerit's not easy listening
18:15saolsenhas 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:17gtrakyou mean like an array?
18:17gtrakdidn't know JS had such a thing.
18:18gtrakbut you could look to vertigo for inspiration? https://github.com/ztellman/vertigo
18:18saolsenwell, core.logic runs on top of a bunch of custom types
18:19saolsenpairs and vars and cons thingies
18:19mdeboardIs Hiccup pretty much the de facto HTML thinger for COmpojure? I've found that I'm kind of clumsy with it
18:19justin_smithsaolsen: yeah, I think you would have to use a subset of the language that does not allocate to reimplement the functionality you want
18:19saolsenbut 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:20mdeboardWould really like to just write HTML and put variables in place a la erb templates
18:20technomancymdeboard: it's definitely the most obvious way to start
18:20gtrakmdeboard: laser, enlive, selmer are some alternatives.
18:20justin_smithsaolsen: the problem is that the core.logic code is probably using heap allocation, and I'm assuming you can't really change that
18:20gtrakluminus comes with selmer.
18:22saolsenCouldn'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:22arrdemsaolsen: now you're building your own garbage collector...
18:22justin_smithexactly
18:23gtraksaolsen: if the data is repetitive, you might benefit from memoization.
18:23saolsenyeah, but just a little one :)
18:23mdeboardtechnomancy, gtrak, thanks
18:23arrdemsaolsen: size has no impact on the difficulty of correctness unfortunately..
18:23turbofailwell building your own garbage collector isn't insane if you know you can throw everything you've allocated away every frame
18:24arrdemsaolsen: 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:24arrdemsaolsen: what you _really_ want to do is probably not do manual allocation but have manual transients.
18:26saolsenI'm not sure what that means
18:28coventry`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:31saolsenNo 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:31ztellman_gtrak: I think you're the only person who suggests vertigo to anyone
18:31gtrakhehe
18:31ztellman_I still haven't even rewritten the Go AI using it yet
18:32coventry`saolsen: Yeah the options for debugging this kind of thing in js seem very limited.
18:32gtrakztellman_: that's the risk you take by open-sourcing a lib.
18:33gtrakbut there was a guy on the ML that was actually trying to use vertigo for C interop.
18:34gtrakjust yesterday
18:34coventry`I thought that was kind of the idea.
18:34arrdemouch my brain
18:34gtrakcoventry`: the idea was arrays-of-structs
18:34gtrakwhich the jvm can't do very easily.
18:35coventry`"...can also make interop with C libraries significantly simpler and more efficient."
18:35gtraksupposedly, if you have a direct-mapped bytebuffer, you can just send pointers over to C
18:35gtrakI haven't tried.
18:36saolsenI wish I could tell chrome I want to know all the allocations that happen within a specific function
18:36saolsenlike you can tell chrome "time this function"
18:52sdegutisIs 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:53arrdem(juxt (partial map first) (partial map second))?
18:54noonian,(doc juxt)
18:54clojurebot"([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:54sdegutisThat does not seem superior.
18:54sdegutisI tried (map (juxt first second)) at first, but that's just (identity) here.
18:54arrdemagreed, just the next "one liner" that came to mind.
18:54noonian,((juxt keys vals) (into {} [[:a 1] [:b 2]]))
18:54clojurebot[(:a :b) (1 2)]
18:54arrdemnoonian's answer is my #2
18:55ztellman_gtrak: what, really?
18:55ztellman_link?
18:55arrdemnoonian: nice to meet you Dr. Soong
18:55noonianarrdem: you too! I think you're the only one here who got the reference
18:55gtrakztellman_: https://groups.google.com/forum/#!searchin/clojure/vertigo/clojure/Z0j9rizY6uQ/crkbrtda4soJ
18:56ztellman_haaaaa
18:56ztellman_but yeah, .address() on a direct byte buffer
18:56ztellman_works a treat
18:58gtrakztellman_: I'm just in it for the frankensteins
18:58gtrakI find useful monsters amusing.
18:59arrdemthere's a certain elegance in every monster...
18:59gtrakeven numbered-trolling
18:59ztellman_gtrak: the Antlr parsing of the Eclipse disassembler certainly qualifies
19:01gtrakmaybe emacs is someone else's double-troll.
19:01gtrakwhy do I always hate it so much but continue to use it.
19:02technomancyemacs 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:03gtrakyea, that's about right.
19:03arrdemtechnomancy: 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:04coventry`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:06bblooma major reason for the poor behavior of GCs is that they assume mutability
19:06technomancyarrdem: we put a man on the moon. that kind of thing isn't insurmountable.
19:06arrdemtechnomancy: and we did it with magnetic core wire memory that was read-only...
19:08gtrakarrdem: immutability mofos
19:11dyresharkcoventry`: 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:11sdegutisThank you.
19:15justin_smithbbloom: do you have a cite for the gc assuming mutation thing? sounds interesting
19:24seangrovejustin_smith: I assume https://www.youtube.com/watch?v=XtUtfARSIv8 should have something in there
19:24seangroveHaven't watched it yet
19:27seangroveI feel like Haskell's GC is in a very privileged position and should be able to do some fantastic things
19:28turbofailhttp://c2.com/cgi/wiki?ImmutableObjectsAndGarbageCollection
19:31dyresharkjustin_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:32dyresharkspecifically, it starts near "Tri-color invariant and concurrency" IIRC
19:37justin_smith(inc seangrove)
19:37lazybot⇒ 4
19:37justin_smith(inc turbofail)
19:37lazybot⇒ 3
19:37justin_smith(inc dyreshark)
19:37lazybot⇒ 1
19:37justin_smiththanks guys
19:48seangroveSpeaking of immutable GC, and perf in generaly, etc., how is this possible? http://jsperf.com/performance-frozen-object/25
19:51yediseancorfield: just wanted to say your om-sente example is so much more useful than the regular sente example
19:52justin_smithseangrove: 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:52seangrovejustin_smith: Sure, but it should be *faster*, not slower
19:52justin_smithoh, wow, I misread :)
19:53justin_smithlooks like some anti-optimization happened
19:53dbaschseangrove: perhaps there’s more overhead in the seal check than in the lookup itself
19:53seangroveThere must be some interesting challenges involved, or maybe they haven't had time to optimize
19:53seangrovedbasch: It's sealed pre-test
19:54justin_smithseangrove: he said the seal check, which I assume happens at lookup
19:54dbaschseangrove: I know, but perhaps the lookup checks that it’s sealed for some reason, and if it’s sealed does something
19:54seancorfieldyedi: cool, glad it helps someone!
19:54seangrovedbasch: Ah, sorry. Could be, yeah
19:54dbaschthat lookup is so ridiculously fast that it probably obscures everything else
19:55amalloyseangrove: 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:55dbaschin fact, I would assume sealing an object means there’s extra work to make sure you don’t try to alter it
19:56dbaschafter all, mutation is free just like not checking array bounds is free
19:56seangrovedbasch: Surely only on assignment though, not on read
19:57seangroveamalloy: Interesting idea, definitely
19:57amalloydbasch: but you *are* allowed to mutate a sealed object's properties
19:57amalloyyou just aren't allowed to add or remove properties
19:57dbasch,([1 2 3] 4)
19:57clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
19:58amalloywhich suggests that what they're doing is changing the storage layout to optimize particular kinds of access
19:58seangroveamalloy: I think you're not allowed to...
19:58turbofailhm. those two run at the same speed for me in firefox
19:58seangroveamalloy: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
19:58amalloyseangrove: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal
19:58amalloyyou're looking at freeze, not seal
19:58turbofailthough i suspect firefox may be cheating
19:59seangroveamalloy: Ah, yes, sorry, being sloppy today
20:00amalloyi'd be interested to see how the test behaves using o2.a instead of o2['a']
20:01dyresharkentirely 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:02turbofailit shouldn't be changing the object layout during the course of the benchmark
20:03jcromartieI am *all about* aligning my lets, conds, and map literals
20:03jcromartieamong others
20:04jcromartieI wish it were easier to do it in an editor
20:04jcromartieoh
20:04jcromartiehttps://github.com/gstamp/align-cljlet
20:04coventry`jcromartie: How do you handle long destructurings?
20:05jcromartiethey can get mexs
20:05jcromartiemessy
20:05jcromartiebut for map destructures I like to put the destructured variable one space to the right of the furthest-right form in the map
20:05jcromartieif that makes any sense
20:05jcromartiebut like I said, they get messy
20:05technomancyI 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:06jcromartiebut like for conds and simple lets, at least, I think it makes a huge difference in readability
20:07jcromartieit should just be considered polite
20:07jcromartieif anybody has to read your code
20:07jcromartieand it also exerts a design pressure on your code
20:07amalloyjcromartie: it makes a big difference in maintainability, too - you're impolite to the technomancys of the world, who want to edit your code
20:07jcromartieyes, exactly
20:07lemonodoraligning always breaks down eventually. so i tend not to even start.
20:07amalloymaybe i want to add a clause to the let, and the sensible variable name is 10 characters long
20:08amalloybut you've lined everything up to 5-character names. what do i do?
20:08amalloyi curse you under my breath and use a shitty name
20:08coventry`I should add logic to align-cljlet so it gives up if the LHS extends too far to the right.
20:09coventry`amalloy: Put in your def with 10-char name and hit C-c C-a, which you've bound to align-cljlet. :-)
20:09jcromartiecoventry`: I just did that exactly
20:09hiredmandoes it matter what color the walls are painted when the house is on fire?
20:09lemonodori do wish clojure’s let used an extra level of nesting, like common lisp’s. i guess that ship has sailed :(
20:09amalloymeh. i forked align-let to make it work with clojure, when i had to put up with aligned code
20:09dbaschdyreshark: freeze doesn’t cause a performance penalty (for me on Chrome) but seal does
20:09amalloybut i'm not happy about having to put up with such code
20:09jcromartieI don't mind doing it by hand, which I did before I literally just discovered align-cljlet 5 minutes ago
20:10jcromartieamalloy: what do you mean "put up with"?
20:10jcromartieyou mean having the standard imposed on you?
20:10dyresharkdbasch: ah, ok
20:10jcromartiesurely you can't be opposed to *reading* aligned forms
20:11coventry`Moving the setup in that jsperf test to the initial html doesn't change the result.
20:11amalloyi 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:12coventry`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:12coventry`Not much compared to doing an incremental search, though.
20:13amalloyhiredman: i'm not sure which part of this is the fire and which is the walls
20:13jcromartieI disagree, I think it's much more readable at a glance
20:13jcromartieit adds more visual hierarchy to the code
20:13jcromartiethat's never a bad thing
20:14jcromartieparticularly with cond
20:14amalloyjcromartie: xml has lots of visual hierarchy. "never a bad thing" is comically false in that context
20:14jcromartieyou see the tests and results grouped
20:15lemonodorit can be a little nicer to read. i’ve just decided that the advantages are not usually outweighed by the disadvantages
20:15technomancywhy not implement it as a render-time hack?
20:15coventry`When that gets confusing, I generally start using ";; =>" between the tests and results.
20:15lemonodorer, i mean *are* outweighed.
20:15technomancyjust don't touch the source on disk
20:15amalloythe 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:16jcromartiethe 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:16nullptr+1 for render time hacks, ala http://www.gnu.org/software/emacs/manual/html_node/emacs/Glasses.html
20:16coventry`(add-to-list 'magit-diff-options "-w")
20:17amalloycoventry`: try -b instead. it's a more-aggressive -w
20:17quizmehi, 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:18amalloyquizme: 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:19coventry`Thanks, amalloy
20:19quizmeI 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:22justin_smithquizme: 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:22quizmehttp://pastebin.com/x6VQ3Z9r
20:23justin_smithquizme: manually copying the jar into lib/ shouldn't be the right way to do it, even if it did actually work
20:23quizmejustin_smith: i'll try that thanks
20:29bbloomjustin_smith: seangrove: GHC doesn't make too much use of immutability b/c lazy thunk cells are inherently mutable
20:29seangroveAh, fair enough
20:29danielcomptonI'm using cider with emacs, is there any way to stop it doing a round robin on open windows when I evaluate results?
20:29bbloomErlang, on the other hand, actually can enforce the ordering constraint provided by immutability
20:29danielcomptoni.e. each time I throw an exception it puts it in a different window
20:30seangrovebbloom: I thought the Elixir post you linked to was pretty cool, other than the strange tone.
20:30bbloomthat, 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:30seangrove"This is good shit", "a pain in the bottom"
20:30bbloomelixir is cool
20:32coventry`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:32coventry`*a Haskell page
20:34quizmei hate grails
20:34gtrakdanielcompton: if you figure this out, let me know :-)
20:35danielcomptongtrak: it's driving me up the wall
20:35gtrakI'll investigate.
20:36danneudanielcompton: never found a solution to it. ideally the stacktrace would pop up on one of those buffers you can dismiss with `q`
20:36danielcomptondanneu: It does pop up in a dismissable buffer but it's a different one every time
20:36gtrakyou can dismiss it with q, but it doesn't go there automatically.
20:36danneuman, i can't even get that to work
20:37danielcomptonI feel like I need to stop everything for a month and just study Emacs
20:37danneumy '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:37gtrakdanielcompton: found it.
20:37danielcomptonAt the end of the month I'd have a foot long grey beard
20:38danielcomptongtrak: do tell
20:38gtrakin cider-interaction.el there's a defcustom "cider-auto-select-error-buffer" default to nil.
20:38gtrakso you do whatever defcustom does to make that truthy.
20:38gtrakshould be truthy by default, imo.
20:38gtrakbut I've been meaning to figure this out, so I'll find out right now.
20:39gtrakaha, custom-set-variables
20:40gtrakput this in your init.el: (custom-set-variables '(cider-auto-select-error-buffer t))
20:40nullptrif you want to do that via custom, M-x customize-variable
20:40nullptrit will write that for you
20:40gtrakeval it, and you're good to go.
20:41gtraknullptr: I don't trust it, because I don't understand it.
20:41coventry`Should I be using custom-set-variables rather than setq?
20:41gtraki think that's the point of defcustom
20:41technomancymeh
20:41gtraklisten to technomancy
20:42technomancyunless you're doing something visual like face changes, I'd recommend just treating everything like regular elisp
20:42justin_smiththe tricky thing is if you have setq plus custom-set-variables - then whichever one is loaded last wins
20:42nullptri typically use setq for things that i want the same everywhere, and custom for env-specific things
20:42justin_smithbut the customize interface will warn you if something was changed out of custom-set-variables
20:43nullptrsome people setq everything, some people use custom for everything
20:43nullptrgood to be familiar with both imho
20:44nullptrat 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:45technomancyfor the most part customize comes across as just a way to let you avoid learning elisp
20:45technomancywhich I do not understand at all
20:45quizmejustin_smith maybe I could just use gen-class
20:46gtrakI tried using the custom faces menus and whatever, it was really opaque and I gave up after a while.
20:46gtrakI have derision towards good UIs, emacs's seems pretty pointless.
20:46justin_smithquizme: that seems like a nonsequitor to our previous discussion - how would gen-class help you resolve your deps?
20:47quizmejustin_smith package all the deps into a stand-alone jar
20:47danielcomptonIt's still doing the round robin thing for me
20:47justin_smithso make an uberjar then, no need for gen-class
20:47gtraklike 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:47gtrakdanielcompton: but is it letting you hit 'q' to get out of it?
20:47gtrakround-robin is just how emacs makes new frames.
20:48danielcomptonYeah it always did that part
20:48quizmejustin_smith then how do i invoke the method from grails ?
20:48danielcomptonI had that sorted :)
20:48justin_smithquizme: 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:48justin_smithinvoke what method?
20:49quizmejustin_smit the clojure method that i want to invoke from within grails.
20:49gtrakdanielcompton: 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:50danielcomptonemacs and esoteric are likes peas and carrots
20:50gtrakpersonally, I'm 100% ok with it now that it throws me over to it.
20:50justin_smithquizme: 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:51quizmejustin_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:51gtrakI was hitting C-x o a bunch before, now I don't have to.
20:51amalloyjustin_smith: clojure.java.api.Clojure was added in 1.6
20:51justin_smithamalloy: ahh, yeah, that is the one I was looking for, thanks
20:51justin_smithquizme: yeah, if you want clojure 1.6+ you should use clojure.java.api.Clojure
20:52justin_smithquizme: did you add clojars?
20:52quizmejustin_smith yes i did
20:53justin_smithOK, 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:55quizmejustin_smith: alright thanks i'll try
20:56quizmeis 1.6 the recommended clojure version these days ?
20:56justin_smithit's the latest stable version, yes
20:56justin_smithuse it unless you have a pressing reason to use an older one
20:56amalloy1.5.1 probably has the most users, but 1.6 is newest, stable, and good. i'm using it in new projects
20:57quizmeamalloy i c thnx
21:08danielcomptonWhen you switch from your default user namespace at the repl, how do you reload all of the repl goodies?
21:08danielcomptonclojure.core/refer-clojure brings in clojure.core but what about the other parts?
21:08danielcomptonlike doc
21:08justin_smithdanielcompton: (use 'clojure.repl)
21:08justin_smithone of the few valid usages of use
21:10danielcomptonThanks, is that the standard way to do it? refer-clojure, use repl?
21:11justin_smithI 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:11justin_smithalso the (ns) form has an implicit refer-clojure
21:11justin_smithso if you load an ns from a file it will have the clojure.core functions bound
21:11danielcomptonAh, I was moving to a namespace that didn't exist on disk
21:12justin_smithyou can still use (ns) from the repl
21:14danielcomptonNice, thanks
21:14danielcompton,(inc justin_smith)
21:14clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: justin_smith in this context, compiling:(NO_SOURCE_PATH:0:0)>
21:14justin_smithno need for the ,
21:15danielcompton(inc justin_smith)
21:15lazybot⇒ 40
21:15danielcomptonjustin_smith ta
21:15justin_smithnp
21:18danielcomptondanneu how did you get stack traces in the minibuffer?
21:19danielcomptondanneu if you set (setq cider-repl-popup-stacktraces f) does that do it?
21:21seangroveAny naming convention for mutable objects?
21:22amalloyseangrove: no
21:22gfredericks!<muta-foo-var>!
21:22seangroveamalloy: If only the blink tag worked automatically in emacs...
21:23amalloysuggestion: instead of foo, call it plz-stop-changing-foo
21:24justin_smithf͗ͧ͐͒̏̑ͮͥ̎̇ͩ̓̾͆̽ͮͦͤ̆͏̶̴̨͉̦̜̳͍̬̭̲̺ͅọ̡͔̪̞͈͎̘ͩ͐̆̇͐̂̃͋ͯ͐͌͆͌̑̔ͣͥ́͢ớ͙͕̱̮̩̬̤͖͈̬̞̉̿̏͗͂̅͐̿̈́ͨͬ̓ͦ͝
21:24justin_smithhopefully the above will instill the proper respect
21:25seangrovegfredericks: Probably go with something like yours, I think
21:25gfredericks(inc me)
21:25lazybot⇒ 4
21:25seangrove(inc gfredericks)
21:25lazybot⇒ 54
21:25gfredericksyou're welcome, clojure community
21:25gfredericksfive years from now everybody will be using it
21:26TEttingerwas hat like 60 combining characters, justin_smith?
21:26justin_smith⸘es-mucho-mutable‽
21:26justin_smithTEttinger: yeah http://eeemo.net/
21:27TEttingerI only saw 4 blobs on one line -- unifont
21:27justin_smithTEttinger: interesting - yeah, they are intended to stack http://knowyourmeme.com/memes/zalgo
21:28TEttingerhttps://dl.dropboxusercontent.com/u/11914692/zalgo.PNG
21:28dbasch,(def Δvariable 1)
21:28clojurebot#'sandbox/Δvariable
21:29TEttinger,(def Կիրիլիցա "Cyrillic")
21:29clojurebot#'sandbox/Կիրիլիցա
21:29justin_smithhttp://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags one of the best SO answers of all time
21:29TEttingeroh I know it
21:30justin_smith'tis a classic, we should all know it
21:53Jadenclojure sucks. No tail recursion. even worse than ancient lisps like scheme and common lisp. Learn arc or go home.
21:54arrdemhttp://www.arrdem.com/i/troll.jpg
21:54justin_smithJaden: I am home :P
21:54arrdemJaden: you leave home? get a real job...
21:55ddellacostaI feel like Jaden actually likes Clojure
21:55TerranceWarriorhey arrdem
21:55arrdemTerranceWarrior: ACK ACK ACK ACK
21:56JadenI 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:56technomancyJaden: http://p.hagelb.org/scsb.png
21:57Jadenworst decision ever to piggy on the JVM. It hurts cross platform. It doesn't help.
21:58arrdemat least chord tried to be a help vampire...
21:58arrdemthis guy just comes in slinging mud and thinks he's gonna derail anything...
21:58arrdemhave fun in /dev/null mate
21:58JadenLook at all you noobs using clojure. Of all the lisps and you choose to go the Java route. Yea that's really cool.
21:59justin_smithif you're interested in cool you should check out ruby, that's definitely hip
22:00Jadenruby sucks too, but as a lisp, clojure must be held to a higher standard of review.
22:00technomancynot as cool as node.js
22:00technomancynode.js is so hot right now
22:01arrdemyou should check out my hardware node.js project...
22:01technomancyhttp://v8.en.memegenerator.net/instance/43297831
22:02Jadenseriously. I want to know. Why would you (in your right mind) choose clojure? Functional programming without recursion? Was the creator drunk?
22:02nullptrwow. such node.js. so recurse.
22:02technomancyclojure has recursion; we just pretend we don't in order to make schemers mad.
22:02arrdemhttps://twitter.com/doge_js
22:02technomancyit's pretty hilarious.
22:03arrdemnullptr: please tell me that's you. I owe that person beer for the amount of entertainment they've provided me.
22:03nullptrarrdem: i wish i could take credit
22:03JadenRecursion you can't use in a natural way. Yeah, that's great. Defeats the entire point.
22:04arrdemevery time I just crack up...
22:04JadenI can't believe this is a lisp chat room.
22:04technomancyit's worth it for the lulz tho
22:04justin_smithdatabae caught me shardin' lol
22:05danielcomptonJaden hot lisps in ur area wanna talk abt abstract academic concepts like wow u dont kno recursion wtf
22:06arrdem(inc danielcompton)
22:06lazybot⇒ 1
22:07Jadenscheme implements recursion naturally. It's such an old language. 2014 and the "modern" langauges can't get it right.
22:07arrdemseancorfield: hahaha you taking on Tony Morris is great :P
22:08gfredericksJaden: but if it had a recursive then algorithms wouldn't
22:08JadenI'm done here. Nobody gives a sh*t about recursion.
22:08technomancysweet
22:08danielcompton(s/validate FancyMap {"a" "b"})
22:08danielcompton(s/validate FancyMap {:foo :f "c" "d" "e" "f"})
22:08justin_smithJaden: it's the internet, you can say shit
22:08arrdemdanielcompton: wrong buffer...
22:08danielcomptonarrdem yup :)
22:09Jadennope. Not in the US. FCC regulated and NSA tracked.
22:09danielcomptonarrdem IRC driven development
22:09arrdemdanielcompton: if you can get #clojure to write code for you it's totally a thing
22:09Jadengoes on your permanent NSA record. truth.
22:11JadenAnyway. 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:11TEttinger(doc recur)
22:11clojurebotI don't understand.
22:11TEttinger,(doc recur)
22:11clojurebotI don't understand.
22:11TEttingerwow is it a special form? must be
22:11JadenFitting your bot can't do recursion. Expected
22:11arrdemTEttinger: yes it is
22:12justin_smithTEttinger: don't ruin it, if he thinks recursion doesn't exist in clojure he'll just leave
22:12bob2is it school holidays somewhere?
22:12arrdembob2: finals time here...
22:12TEttingerwe had a bunch of trolls /noticing earlier
22:12JadenJaden out
22:12TEttingerthank god
22:13jeremyheileraww, i was just going to ask him what he thought about types.
22:13seancorfieldarrdem: seriously, I miss Tony Morris's threads from the Scala lists, back when I was doing Scala in 2009/2010...
22:13dbaschat least he didn’t mention Haskell
22:13TEttingerhuh, hagerstown, Maryland
22:13gfredericksI've been there
22:14arrdemTEttinger: I love geolocating trolls...
22:14arrdemTEttinger: they never see it comming
22:14seancorfieldbut I would really like to hear Tony's opinion on why Haskell isn't more popular...
22:14justin_smithoh, it's no use, he's behind 7 proxies, you'll never find him
22:15seancorfieldBrian McKenna's reason wasn't very helpful "People do not care about working software" :)
22:15arrdemjustin_smith: that's ok, ,we just start bombing the proxies.
22:15justin_smithhttp://www.imdb.com/name/nm1535523/ anyway I am pretty sure Jaden lives in beverly hills or something
22:15arrdemseancorfield: yeah that was fabulous
22:15nullptrhttps://twitter.com/officialjaden/status/329768040235413504
22:18masconejosHowdy all. I have a meta/philosophical clojure question I’m hoping someone can help me with.
22:19masconejosI’ve been working at learning clojure for a few days by working project euler problems
22:19masconejosI’ve noticed that the code I’m writing tends to be very procedural and not very “idiomatic clojure” like
22:20justin_smithmasconejos: using atoms as if they were variables?
22:20arrdemseancorfield: 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:20masconejosno
22:20masconejosspecifically for propblem 4, I’ve generated this: https://dl.dropboxusercontent.com/u/2755300/004.clj
22:20`szxmasconejos: 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:21masconejosLooking at solutions at (http://clojure-euler.wikispaces.com/Problem+004) I see my code is very different
22:21masconejoshowever, my code runs in a fraction of the time it takes most of the solutions at clojure-euler to run
22:22masconejosIt does this by only calculating exactly what is asked for, while most of the clojure-euler answers overcalculate then reduce
22:22arrdemseancorfield: I'd be interested to hear what you think on the matter.
22:23masconejosWhich 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:23dbaschmasconejos: your mirror code is just (concat x (reverse x))
22:24justin_smithdbasch: well he also puts it in a vector, for whatever reason
22:24masconejosSpecifically, 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:24rufoathe loop/recur acting as a for loop isn't nice. could probably refactor that as a filter/range
22:25masconejos(I’m having trouble expressing myself clearly, sorry) Now on to addressing your comments..
22:25justin_smithrufoa: or even a reduce / reduced
22:25rufoayeah
22:25masconejosdbasch: does concat+reverse work on vectors?
22:25dbaschmasconejos: try 4clojure, it’s better in that respect (up to a point)
22:25justin_smithmasconejos: do you have a reason to put everything into vectors?
22:25Jaoodarrdem: is the discussion on the google group thread?
22:26dbasch,(concat [1 2 3] (reverse [1 2 3]))
22:26clojurebot(1 2 3 3 2 ...)
22:26justin_smithmasconejos: yes, they get coerced into seqs
22:26jeremyheilermasconejos: 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:26masconejosprocessing 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:27seancorfieldarrdem: 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:27sjymasconejos: 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:27justin_smithmasconejos: 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:27sjyi don't see why one method or the other would be more idiomatic in clojure
22:27justin_smithmasconejos: oh, so you mean you wanted vector's conj at end behavior
22:28arrdemseancorfield: 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:29dbasch,(reduce #(+ (* 10 %1) %2) [1 2 5 3 6])
22:29clojurebot12536
22:29sjyarrdem: 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:29dbaschmasconejos: that’s for converting a vector of digits into a number
22:30masconejossjy: 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:30masconejosbeing optimized, should I just be writing (inefficient) idiomatic clojure for the purposes of learning clojure the “clojure way"?
22:30dbaschmasconejos: you could write the same code much more idiomatically
22:30masconejosdbasch: thank you. That is better for vec to it conversion
22:31justin_smithmasconejos: the idiomatic / efficient concerns are orthogonal in this case
22:31seancorfieldarrdem: 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:31masconejosjustin: that’s what I was thinking
22:31rufoaime 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:31rufoa4clojure wasn't much better but that might not be a popular opinion here
22:31justin_smithyou could have terser code, using reduce / reduced or maybe in some case iterate rather than loop
22:32dbaschmasconejos: also you can convert a number into a vector of digits in a one-liner (e.g. via str)
22:33masconejosjustin: 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:33rufoalazy seq + first
22:34masconejosAll in all though, it’s sounding like if I want idiomatic clojure, I shouldn’t worry about efficiency for project euler
22:34lemonodoras a clojure beginner, 4clojure helped me. I also did the matasano crypto exercises, and am going through rosalind.info now.
22:34dbaschmasconejos: you can have both, you have to think in terms of laziness though
22:34justin_smithmasconejos: reduce short circuits. I think I mentioned REDUCED at least five times.
22:35`szxmasconejos: you can use reduced to terminate a reduce
22:35justin_smithsorry for the all caps but I feel like I have been repeating myself
22:35sjymasconejos: 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`szxheh
22:35masconejosre: reduced - didn’t realize that. I was reading ‘reduced’ as past tense of ‘reduce’
22:35danielcomptonlemonodor: do you have any tips for the matasano crypto exercises? I found it tricky handling byte-arrays e.t.c.
22:35arrdemnot entirely true... one of these days I'm gonna benchmark some code in sbcl vs in clojure...
22:36justin_smithmasconejos: it was in a context where I was explicitly saying you could short circuit, also
22:36arrdembut to do that I'd have to make myself write Common Lisp so
22:36masconejosjustin: sorry I misunderstood. Still a beginner and there are so many functions…
22:36justin_smithnp
22:37lemonodordanielcompton: 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:37dbaschmasconejos: it’s a bit overwhelming at first, but it does get much better over time
22:37masconejossjy: 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:37dbaschmasconejos: there are so many “lightbulb” moments
22:38justin_smithmasconejos: 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:38dbaschmasconejos: as a beginner, you probably don’t know enough clojure to make that assertion
22:38masconejosdbasch: 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:39masconejosdbash: that may be true
22:39masconejosjustin: can you give me an example?
22:39dbaschmasconejos: I’m sure there’s some eye-opening stuff here: http://clojure-euler.wikispaces.com/
22:40RaynesI've never learned anything worth learning that wasn't a bit difficult.
22:40RaynesFor example: programming.
22:40RaynesThat took me a bit.
22:40technomancywhat about eating ice cream
22:40RaynesLearning to eat in general.
22:40technomancyactually yeah, that does take a while
22:40bbloomI'm still learning to eat ice cream
22:40dbaschtechnomancy: the difficult part in eating ice cream is stopping :P
22:41technomancyI have firsthand eyewitness proof
22:41arrdembreathing was pretty hard too...
22:41bbloomI somehow manage to get chocolate on everything every time.
22:41bbloomalso, i can't be trusted with spaghetti sauce
22:41masconejosdasch: 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:43justin_smithmasconejos: 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:43justin_smithmasconejos: 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:43justin_smithand less likely to randomly break
22:44dbaschmasconejos: if you had a lazy sequence and did drop-while not-palindrome of that, your code would be equally efficient
22:45masconejosjustin: 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:45justin_smithdbasch: dropping non-palindromes would be as efficient as generating all palendromes?
22:46dbaschjustin_smith: I mean something like
22:46dbasch,first (drop-while #(not= 234 %) (range)))
22:46clojurebot#<core$first clojure.core$first@195cc92>
22:46dbasch,(first (drop-while #(not= 234 %) (range))))
22:46clojurebot234
22:46dbaschI don’t think I generated all numbers :P
22:47justin_smithmasconejos: 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:47justin_smithdbasch: but he is synthesizing palendromes directly, since we know their structure
22:47dbaschjustin_smith: ok, I was thinking of something else
22:47justin_smithwhy check all numbers when you know how to generate the structure they have?
22:47justin_smithok
22:48justin_smith(I mean all numbers below some limit, of course)
22:49masconejosjustin: your last comment to me is still in regards to get-digits and digits-to-int, yes?
22:49arrdem,[(- 23 21) (- 60 42)]
22:49clojurebot[2 18]
22:49justin_smithmasconejos: yeah, about coercing a seq to vector on output
22:49dbaschjustin_smith: take-while not-factors
22:50justin_smithdbasch: ahh yeah, that would be an equivalent :)
22:50dbaschjustin_smith: and the lazy sequence generated with palindromes
22:50justin_smithand it would be much clearer
22:50masconejosjustin: I agree. I did something weird there
22:51masconejosdbasch: lazy seq generated with palindromes….. that’s a good idea. I’ll have to figure out how to do that
22:51justin_smith(doc lazy-seq)
22:51clojurebot"([& 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:52justin_smithor probably you could just use map or iterate
22:52justin_smithhttp://clojuredocs.org/clojure_core/clojure.core/lazy-seq old docs but still relevant
22:53jared314is clojuredocs.org dead or just slow in updating?
22:53arrdemthe maintainer got abducted by aliens
22:53arrdemor something
22:54arrdemso dead
22:54jared314is it open source?
22:55justin_smithmainly I only end up linking to clojuredocs.org because of http://clojure.org/cheatsheet
22:55justin_smiththat plus laziness
22:55danielcomptonWhen should you use filter vs take-while?
22:55jared314if it was open, it could be rehosted
22:55danielcomptonThey seem pretty similar
22:56arrdemdanielcompton: take-while stops taking, filter doesn't :P'
22:56rufoatake-while stops as soon as the condition fails, filter doesn't
22:56TravisDdanielcompton: take-while wont return anything after the first element of the seq that doesnt' match the predicate, where filter will return all matches
22:56danielcompton:facepalm:
22:59dbasch,(take-while #(not= 10 %) (range)) ;; danielcompton
22:59clojurebot(0 1 2 3 4 ...)
23:00danielcomptonI think it's coffee time
23:00jared314,(take-while #(not= 3 %) (range))
23:00clojurebot(0 1 2)
23:00justin_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:00clojurebot("00" "11" "22" "33" "44")
23:01justin_smithI am probably doing silly things that could be fixed above
23:04gtrakoh man, cider's java support is brilliant.
23:04justin_smithreally?
23:04gtraknow it is.
23:04gtrakyea, jeffvalk added a bunch of awesome.
23:05gtraklike jump-to-source if you add the source jar to deps.
23:05gtrakand javadoc and such.
23:05masconejosWell, I have enough to play around with for now. Thank you all for your input.
23:06technomancycan you read javadoc using eww?
23:07technomancyjared314: you volunteering?
23:07gtrakeww?
23:07gtrakit opens up chrome
23:07jared314technomancy: that depends on if you actually have the source and data
23:07justin_smithhttp://www.emacswiki.org/emacs/eww
23:08technomancynot me personally
23:08arrdemjared314: it was only ever a Ruby wrapper around the Clojure source...
23:08gtraktechnomancy: sounds possible, the client is doing it.
23:09technomancycool. I hate going to the browser; it's why I never use javadoc if I can avoid it.
23:10gtrakditching inline clojure is really working out.
23:11technomancyit wasn't that bad when you could write it as proper forms
23:11technomancybut the stuff that had to be strings... ugh
23:11gtrakyea, but we need real namespaces and things.
23:12technomancydinc
23:12gtrakand tests.
23:12arrdem"real namespaces"?
23:12gtrakarrdem: cider-nrepl used to be scattered across elisp files.
23:12gtrakin snippets
23:13arrdemgtrak: ah. I didn't know the context.
23:13gtrakit was totally unmaintainable.
23:13technomancystill no real namespaces in emacs lisp, sadly
23:14gtrakalso I couldn't have practically implemented CLJS support like that.
23:14arrdemtechnomancy: isn't there a cl-namespaces library?
23:15technomancyarrdem: there are some crackpot code-rewriting macros on the fringe.
23:16arrdemlazybot: macros are crackpot code rewriting
23:16technomancysorry, code-walking
23:16technomancyand then rewriting
23:19justin_smithseems like in theory you could make a namespace out of closures, except for the part where you reference the values in the ns