#clojure logs

2015-08-04

02:04lxsameerfolks, is the any good clojure podcast aroudn?
02:18lambda-smithHmmm... so you can use bigint to "cast" a string to a number.
02:18lambda-smithAny reasons why I wouldn't want to use bigint?
02:40oddcullylambda-smith: if you don't want a BigInteger maybe?
03:06arrdemAs of 1.8 Clojure supports ^int? is ^float also supported?
03:15amalloywhat do you mean, supports ^int?
03:19arrdemnevermind
03:19arrdemsomeone on the mailing list seems to have been silly
03:57tgoossensAnyone experience with Clojure+gradle (clojuresque). It seems to be unmaintained?
05:24gkoQuestion regarding defmulti/method vs CLOS eql dispatch: how do I define a defmulti that has 4 parameters and create methods for combinations of 1, 2, 3 or even 4 parameters, without blowing up defmulti dispatch-fn? For example, I could have a call (my-method v1 v2 v3 v4) and have an actual method for v1 = :x and v3 = :y and the values of v2 and v4 would be irrelevant, and another actual method for v1 = :z and v2, v3 and v4
05:24gkoirrelevant. All other combinations would call the default.
05:40quoB1phegko: well, you can implement any logic you want in the dispatch function. It's all up to you.
06:50OlajydAnyone using clojure with apache spark
06:51tslockeCan someone explain why this is nil? — (meta ^:a 'a)
07:03hyPiRiontslocke: 'a is expanded to (quote a). What would (meta ^:a (quote a)) return?
07:04tslockehyPiRion: OK got that, what about (meta (first '[^:a a]))
07:08hyPiRionMm. That's like (meta '^:a a), which is equivalent to (meta (quote ^:a a))
07:09hyPiRionThe metadata is attached to the symbol, and since it's not resolved/evaluated, it's kept on the symbol itself.
07:09hyPiRioncompare this to (let [a {}] (meta ^:a a)), which will return nil because a is evaluated
07:16michel_slmis clojurescript.net broken at the moment?
07:16tslockeThe best example is (quote ^:a a) — I don’t understand why the returned symbol has no metadata on it
07:17quoB1phemichel_slm: looks like it is
07:24hyPiRiontslocke: but it does
07:24hyPiRion,(meta (quote ^:a a))
07:24clojurebot{:a true}
07:26tslockehyPiRion: looks like a clojurescript issue - evals to nil in clojurescript
07:27tslockealthough I’m not on 1.7 so could well be fixed
07:29hyPiRionoh
07:44blackbird_if I need to generate a string key for clojure data structures, is the best way (str (hash coll))?
07:47JickelsenWhat would be a good approach to scrape javascript-based sites? Could i.e. Enfocus handle this or would I need to use something like PhantomJS?
08:00ebzzryWhy is it that after a spit to *out* I can no longer print to *out*?
08:02Bronsaebzzry: maybe you need to flush the stream?
08:03ebzzryBronsa: (flush) doesn't work though.
08:07Bronsaebzzry: what error are you getting?
08:08ebzzryBronsa: I don't get any errors. I just can't get print to *out* anymore: (spit *out* "") (print "foo")
08:10Bronsaebzzry: ah, spit closes the out stream
08:10ebzzryBronsa: ok
10:03justin_smithgko: about your defmulti question - you can have a dispatch function with multiple arities, or varargs (or even a mixture of the two)
10:03IceD^got strange issue
10:04IceD^let's say I got function foo/migrate. When I run it from repl - it executes instantly. When I run it with lein run -m foo/migrate - it still executes instantly (plus lein start time) and hangs for like 20-30 seconds afterwards (lein still running, nothing else happens)
10:05justin_smithIceD^: does migrate use futures or agents?
10:05IceD^no idea. it's drift this time
10:05justin_smithIceD^: if so, you may need to call shutdown-agents
10:05IceD^let me try
10:06justin_smithIceD^: if futures or agents are used, clojure won't exit immediately unless you explicitly shut down the thread pool
10:06IceD^yeah, that's it
10:07justin_smithof course be sure all the other threads are done... :)
10:07IceD^and it's probably nomad
10:07IceD^you are helping me 3rd time now and giving right answers immideatly :)
10:08justin_smithglad I could help
10:08oddcully(inc justin_smith)
10:08lazybot⇒ 283
10:08justin_smith(identity amalloy)
10:08lazybotamalloy has karma 288.
10:09clojurebotIt's greek to me.
10:09justin_smithcatching up...
10:10IceD^just in case - fighting to replace legacy erlang projects (which will be rewritten in any case) with clojure ;]
10:10justin_smithinteresting
10:11IceD^have had more than enough of erlang for quite few lifetimes
10:11justin_smithclojure has a few different concurrency models to choose from, but none of them are quite like erlang
10:11IceD^at least clojure got strings ;)
10:11justin_smithheh
10:15IceD^and tooling (thanks to technomancy)
10:35dstocktonis there a semantic difference in defining protocol methods and implementations begining with -
10:37justin_smithdstockton: - is the default prefix used by gen-class, protocol methods are special even without gen-class
10:37dstocktonaha, so thats why i can't seem to access this method outside the namespace it's in?
10:37dstocktoni get method not implemented
10:37dstockton'no implementation of method'
10:39justin_smithdstockton: how are you invoking it, and what is the definition?
10:41dstockton(defprotocol Search (search [coll pattern])) and (defrecord Obj [] Search (search [coll pattern] ... in a db namespace
10:41justin_smithcommon mistakes include not requiring the namespace that defines the protocol, and trying to use the protocol function without first ensuring it is in scope (protocol function scope is like regular scope), and forgetting that the first argument is always "this"
10:41dstocktonand then (db/search (Obj.) pattern) in another
10:41justin_smithhmm
10:42dstocktonjustin_smith: i lied, its not (Obj.)
10:42dstocktonand i think what im using there is not an instance of the record
10:42justin_smithdstockton: well that would do it :)
10:42dstocktonyeah, i think i can sort it out, was just checking i wasn't missing something basic
10:42justin_smithdstockton: perhaps you wanted (search Obj coll pattern)
10:43justin_smithjust a wild guess
10:43dstocktonregarding the - prefix, this is something i'd want if i needed java interop?
10:43justin_smithexactly, it's for making methods that are directly callable from java
10:43dstocktonok, got it
10:43dstocktonthanks!
10:43justin_smitheg. to implement the methods jsvc looks for in a jar
10:44justin_smithwhich reminds me, why must jsvc log handling be so garbage :(
10:48sdegutisWhat are some testing library options like Specl?
10:48sdegutisBetter yet, what are the best testing libraries for Clojure?
10:49sdegutisSpeclj has become unusable for me due to https://github.com/slagyr/speclj/issues/109 which was closed by the author as Can't Reproduce.
10:51blkcatgood morning #clojure
10:55justin_smithgood morning, blkcat
11:14sdegutisI'm back.
11:14sdegutisWhat are the best Clojure testing libraries of 2015?
11:17zerokarmaleftI'm partial to expectations, but ymmv
11:33sdegutiszerokarmaleft: thanks
11:59sdegutisThese days I'm seeing less and less advantage of Clojure over just ES6 + Immutable.js on Io.js
12:00tcrayford____integers
12:00sdegutisOverrated.
12:16sdegutisI can't think of a single thing I would miss.
12:16sdegutisI was going to say ->> but that's already naturally present in JS using the dot operator.
12:20zerokarmaleftthe JS community has co-opted a lot of good ideas from Clojure, and that's good for everyone
12:27sdegutisI have to agree with zerokarmaleft here.
12:27sdegutistcrayford____: seriously though, the nature of JS's floating point doesn't affect the vast majority of numbers that we actually encounter in real life code.
12:28tcrayford____sorry I responded earlier. Not interested in this discussion, and especially not in this place.
12:28sdegutis:)
12:28tcrayford____s/not interested/not taking part/
12:31sdegutis:D
12:39talvdavi use ccw with eclipse, and i can't use AltGr+Q to type an @
12:40talvdavanyone knows about this?
12:40talvdavchecked keybindings
12:40talvdavthere is nothing bind to Altgr+q and there was only one binding to ctrl+alt+q
12:40talvdavwich i unbound
12:40talvdavbut nothing
12:44talvdavwithout plugin everything works
13:00schauehoI'm looking into core.async pipelines currently and have a seemingly simple question.
13:00schauehowhen would you use pipeline-blocking vs. pipeline-async?
13:01schauehoMy current use case would be fetching html -- I can go either way, but it's not clear to me why I would chose the one or the other
13:08puredangerpipeline-async is for when you expect to be called back from another system
13:08puredangeranother piece of code that is
13:09puredangerso the case where you're sending a callback off to someone else
13:09puredangerotherwise, if you know when your operation has been completed, use -blocking
13:13schauehoI'm using clj-http currently to fetch HTML, so no callbacks involved.
13:13schauehosounds like -blocking would be the way to go.
13:14schauehoI guess using http-kit/get would be a use-case for -async then (haven't looked at it in detail).
13:15schaueho@puredanger thx for the explanation
13:17puredangerwith -async, the function you give pipeline should never put onto the queue - that can cause a deadlock, particularly in an expanding transducer case like mapcat
13:22kwladyka_how often do you have trace missing? I have almost all the time when i am writing something... it doesnt help :/
13:23expezkwladyka_: you can turn that off by setting some jvm setting. Leiningen sets this option by default for most users, though...
13:24{blake}kwladyka: Well, more than I'd like.
13:24kwladykaexpez, but i want better error message then trace missing, it doesnt help
13:24kwladyka{blake}, oh i thought maybe it is only my problem...
13:25expezkwladyka: you can turn off the optimization option which optimizes away the information necessary for the stacktrace to remain, is what I meant
13:25{blake}kwladyka: No, I'll get it a couple of times a week. Down from several times daily when I started.
13:26afairy(defmacro [f & args] (apply ~f (concat args "foo")) <- what is the way to make args appear as quoted list in the macro expansion (so that concat works)
13:27{blake}It usually means (at least when I get it) that I've got a nil I'm trying to do something with.
13:28afairyI suppose (quote ~args) works.
13:35amalloyafairy: that should either be (defmacro foo [f & args] (~f ~@(concat args ["foo"]))) or, more likely, (defn foo [f & args] (apply f (concat args ["foo"])))
13:39afairyamalloy, the real macro has core.async <! in it, here it is: https://www.refheap.com/107541
13:39afairythe ugly thing is the captures, but it has to work for clojurescript...
13:40afairy<? is <! with a check for Error/Throwable.
13:56ripvanwinkleQuick question: Need to store many items with tags for fast recall & search, but tag each item & then call all that match a tag. Is map the right choice here - i.e. def x { :data "This is a sentence" :speaker "John Howard" :index 27234 } ?
14:00hiredmanclojure.set/index
14:00hiredmanamalloy_: bruncol needs the boot
14:03ripvanwinkle@hiredman - thanks
15:00gfrederickshow do I make a tuple schema (w/ prismatic)? I could've swore it was [Foo Bar]
15:00gfredericksI won't swear it anymore though because apparently it doesn't work
15:02gfredericksoh I see it has pair, which can work, but seems odd it only has that o_O
15:02gfredericksmaybe they think large tuples are smelly
15:13amalloygfredericks: obviously (reduce pair [int int int int])
15:14gfredericksit's what john mccarthy would have wanted
15:33scpikeIs deploying a clojure web service as a linux service that just runs `java -jar uberjar.jar` a normal thing to do? (I come from ruby-land where it's much more involved)
15:35stuartsierrascpike: yes, that is common.
15:36amalloyscpike: it's not the most sophisticated way to do things, but it's fine for most purposes
15:36stuartsierraDepending on your requirements, you may want additional tools to handle failure, restart, monitoring, etc.
15:36wasamasaout of interest, what would be the most sophisticated way?
15:37amalloyi dunno, there are a lot of features you can add on top of that depending what you want. you can put multiple services into the same container, for example
15:38amalloythat is the least sophisticated way
15:39scpikeawesome, thanks
15:40wasamasaI disagree
15:40wasamasahere's the least sophisticated way: http://briancarper.net/blog/510/deploying-clojure-websites
15:40wasamasa"Summary: Emacs + SLIME + Clojure running in GNU Screen; all requests are handled by Apache and mod_proxy sends them to the appropriate Jetty instance / servlet."
15:51justin_smithhahaha
15:52wasamasaat least I'm using systemd to manage it
15:52wasamasaso I'm pretty much done with the deployment, just wondering what would be better ways to run the app
15:52wasamasalet me guess, an uberjar/war?
15:53wasamasaor is there anything objectively better?
15:53sdegutis,:∑
15:53clojurebot:∑
15:53sdegutisfavorite new clojure keyword / emoticon
15:56sdegutis,(keyword "")
15:56clojurebot:
15:56sdegutisActually that one may be.
16:06sdegutisPop quiz: What's the coolest thing you can do with Clojure maps? The winner gets 10 points. Second place gets 5 points.
16:16winkApparently I am boring, because into and :keyword is cool enough for me :P
16:19gfredericks,(defmethod print-method :sdegutis [o pw] (.write pw "I am sdegutis"))
16:19clojurebot#object[clojure.lang.MultiFn 0x60103242 "clojure.lang.MultiFn@60103242"]
16:19gfredericks,(-> {:this :is :my :map} (vary-meta assoc :type :sdegutis))
16:19clojurebotI am sdegutis
16:19sdegutisNice!
16:19sdegutisgfredericks takes the lead!
16:22TimMc,{:sdegutis "This."}
16:22clojurebot{:sdegutis "This."}
16:22TimMcbecause map literals are the shit
16:24sdegutisSo true.
16:29gfredericks~map literals |are| the shit
16:29clojurebotc'est bon!
16:30sdegutisI'm not eligible to win because I'm the facilitator, but here's my shot at it anyway:
16:30sdegutis,(-> (->> get (repeat 2) (apply hash-map)) (get get))
16:31clojurebot#object[clojure.core$get 0x46e18aac "clojure.core$get@46e18aac"]
16:31sdegutisWait what?? Is this ClojureScript!?
16:31sdegutisOh I bet Clojure 1.7 changed the pretty-printing of objects.
16:33ebzzryHow can I make function x refer to a latter defined function y?
16:34oddcully,(doc declare)
16:34clojurebot"([& names]); defs the supplied var names with no bindings, useful for making forward declarations."
16:34ebzzryoddcully: thanks
16:35sdegutisAlright, get your entries in if you haven't. 30 minutes left.
16:37chouser,(reduce #(%2 % '(sdegutis is)) '{(sdegutis is) (awesome) (sdegutis is-not) (lame)} [get conj])
16:37clojurebot((sdegutis is) awesome)
16:38sdegutisWhoa!
16:38chouser...because Clojure maps support complex keys. And parens are awesome.
16:38blkcati think chouser has it on lock
16:38sdegutisgfredericks has some pretty tough competition by the late chouser!
16:41sdegutisBut we've yet to see amalloy's and Bronsa's entries. It's not over yet!
16:46sdegutisAlso, using juxt as an alternative to select-keys in a way that's compatible with ->>: ##(->> {:a 10, :b 20, :c 30} ((juxt :a :b :c :d)) (sort))
16:46lazybot⇒ (nil 10 20 30)
16:49sdegutisBut that only works with keys that act as their own functions on maps.
17:23sdegutisTime's running out!
17:27sdegutisWhat an exciting competition. Any number of candidates have yet to submit their entries! Will we see what creative answers puredanger or TEttinger2 come up with? Stay tuned to find out!
17:32justin_smith,(into {} ['([:a :b] 42)]) ; sdegutis - I like this misleading error message
17:32clojurebot#error {\n :cause "java.lang.Long cannot be cast to java.util.Map$Entry"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to java.util.Map$Entry"\n :at [clojure.lang.ATransientMap conj "ATransientMap.java" 44]}]\n :trace\n [[clojure.lang.ATransientMap conj "ATransientMap.java" 44]\n [clojure.lang.ATransientMap conj "ATransientMap.java" 17]\n [clojure.co...
17:32justin_smitherr
17:32justin_smithnot that one
17:32{blake}Yeah, that one's great.
17:33sdegutisHaha.
17:33justin_smith,(into {} ['([:a :b] 42)]) ; sdegutis - I like this misleading error message
17:33clojurebot#error {\n :cause "java.lang.Long cannot be cast to java.util.Map$Entry"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to java.util.Map$Entry"\n :at [clojure.lang.ATransientMap conj "ATransientMap.java" 44]}]\n :trace\n [[clojure.lang.ATransientMap conj "ATransientMap.java" 44]\n [clojure.lang.ATransientMap conj "ATransientMap.java" 17]\n [clojure.co...
17:33sdegutisI think justin_smith may have to be disqualified due to intoxication.
17:33justin_smithoh wait, that is still wrong, but different from the kind of wrong I get locally
17:33justin_smithlol
17:34justin_smithsorry for the double up
17:34justin_smithsdegutis: locally I get "ClassCastException clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry clojure.lang.ATransientMap.conj"
17:34Bronsajustin_smith: i think that might change in 1.8
17:34justin_smithBronsa: oh, cool
17:35Bronsalol
17:35justin_smith,*clojure-version*
17:35clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "alpha2"}
17:35Bronsaclojurebot is at 1.8 yeah
17:35justin_smithBronsa: it's still wrong, but it picks the val instead of the key now
17:35Bronsayeah
17:35Bronsawait
17:35Bronsa, (into {} ['([:a :b])])
17:35clojurebot{:a :b}
17:35{blake}Ever have days where you just can't recurse?
17:36justin_smith,(into {} ['(:key [:a :b])])
17:36clojurebot#error {\n :cause "clojure.lang.Keyword cannot be cast to java.util.Map$Entry"\n :via\n [{:type java.lang.ClassCastException\n :message "clojure.lang.Keyword cannot be cast to java.util.Map$Entry"\n :at [clojure.lang.ATransientMap conj "ATransientMap.java" 44]}]\n :trace\n [[clojure.lang.ATransientMap conj "ATransientMap.java" 44]\n [clojure.lang.ATransientMap conj "ATransientMap.java" 17]\n ...
17:36Bronsa&(into {} ['([:a :b])])
17:36lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.util.Map$Entry
17:36Bronsa,(into {} ['([:a :b])])
17:36clojurebot{:a :b}
17:36justin_smithoh I was doing it wrong
17:36Bronsaa nice enhancement
17:36sdegutisHint: We've yet to see any entries that invert a map.
17:37justin_smith,(into {} (map (comp vec reverse) {:a 0 :b 1 :c 2}))
17:37clojurebot{0 :a, 1 :b, 2 :c}
17:39chouserThat's a cool thing you can do in spite of a map.
17:39justin_smithheh
17:40hiredman,*clojure-version*
17:40justin_smith,(into {} (map (comp vec rseq) {:a 0 :b 1 :c 2})) ; shaved off a few characters
17:40clojurebot{:major 1, :minor 8, :incremental 0, :qualifier "alpha3"}
17:40clojurebot{0 :a, 1 :b, 2 :c}
17:40hiredmanmicroservices man, the future
17:41sdegutisIf you haven't submitted an entry, time's running out!
17:41sdegutisJust a reminder for those joining us: "What's the coolest thing you can do with Clojure maps? The winner gets 10 points. Second place gets 5 points."
17:44TimMcFor those not joining us, you can also talk about other things.
17:44sdegutisNow hold on a second, that's just not true.
17:53puredangerI put all my cool stuff into the 1.7 release
17:54puredangerAnyone notice the new IMapIterable interface? Direct iteration of only keys or vals without making entries.
17:54puredangerUsed under keys or vals or for iterating sets
17:54Bronsaw00t
17:55Bronsais that 1.7 or 1.8? totally missed that
17:55puredanger1.7
17:55Bronsacool
17:56oddcully,{nil nil}
17:56clojurebot{nil nil}
17:57Bronsa,(let [a (array-map Double/NaN 1)] (assoc a (key (first a)) "foo"))
17:57clojurebot{NaN 1, NaN "foo"}
17:57Bronsa,(let [a (hash-map Double/NaN 1)] (assoc a (key (first a)) "foo"))
17:57clojurebot{NaN "foo"}
17:57Bronsathis one was fun the other night
17:57oddcully,({nil nil} nil ::default)
17:57amalloyoh, that's nice, puredanger
17:57clojurebotnil
17:58Bronsapuredanger: ^ does that deserve a fix? I have one
17:58puredangerWhich?
17:58Bronsapuredanger: difference between array-map and hash-map wrt NaN handling
17:58Bronsaas key
17:58Bronsathe edgiest of edge cases :)
17:59puredangerI can't say that's at the top of my list
18:00Bronsa,(let [a (array-map (reify Object (equals [_ _] false)) 1)] (assoc a (key (first a)) "foo"))
18:00clojurebot{#object[sandbox$eval121$reify__122 0x210788a3 "sandbox$eval121$reify__122@210788a3"] 1, #object[sandbox$eval121$reify__122 0x210788a3 "sandbox$eval121$reify__122@210788a3"] "foo"}
18:00Bronsa,(let [a (hash-map (reify Object (equals [_ _] false)) 1)] (assoc a (key (first a)) "foo"))
18:00clojurebot{#object[sandbox$eval147$reify__148 0x42848dfb "sandbox$eval147$reify__148@42848dfb"] "foo"}
18:00Bronsaactually not only for NaN
18:00Bronsaall objects that compare identical? but not equal
18:03yojoeis it possible to load a lein plugin as a dependency? Would like to use some functions from a lein plugin in clojure code (not from command line)
18:04yojoeWhenever I try to regularly add it as a dependency, i get errors like "Could not locate leiningen/help__init.class"
18:04justin_smithyojoe: sure, you can put it in your :dependencies rather than :plugins
18:04justin_smithI think you need to manually add leiningen.core
18:04justin_smithplugins shouldn't depend on their host :)
18:05yojoejustin_smith: awesome. thank you for the quick reply. i really appreciate it. will try now :)
18:05TEttingerBronsa: didn't justin_smith discover that here on IRC?
18:05Bronsayup
18:06TEttinger,#{Double/NaN Double/NaN Double/NaN}
18:06clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: Double/NaN>
18:06TEttinger,(hash-set Double/NaN Double/NaN Double/NaN)
18:06clojurebot#{NaN NaN NaN}
18:06TEttingerbatman!
18:06sdegutisoddcully, Bronsa: excellent entries!
18:07sdegutisAnyway TEttinger2's NaN-set wins.
18:08TEttingerit's justin_smith
18:08TEttingerI thieved it from justin_smith's IRC shenanigans
18:09sdegutisHold on just a second. Are you telling me TEttinger2 is justin_smith and not TEttinger?
18:09TEttinger,{Double/NaN 1 Double/NaN 2}
18:09sdegutisIf only we had some stable concept of identity in #clojure!
18:09clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: Double/NaN>
18:09sdegutis*bu dum tshhhh*
18:09TEttinger,(hash-map Double/NaN 1 Double/NaN 2)
18:09clojurebot{NaN 1, NaN 2}
18:10TEttinger,(get (hash-map Double/NaN 1 Double/NaN 2) Double/NaN)
18:10clojurebotnil
18:10sdegutisAMAZING
18:10TEttingerthat's a good one.
18:10sdegutisThat definitely wins.
18:10justin_smithand also mine
18:10sdegutisWhich was yours?
18:10TEttingerI don't think it's actually un-gettable... justin_smith, yep it's all been yours
18:10justin_smithI'm gonna move to china and be the NaN-king
18:11justin_smithsdegutis: all the nan ones
18:11sdegutisjustin_smith: oh
18:11sdegutisWhat's your twitter so I can announce it?
18:11TEttinger,(hash Double/NaN)
18:11sdegutisTEttinger: also whats yours
18:11clojurebot2146959360
18:11TEttingerI don't know what this is
18:12sdegutistwitter?
18:12clojurebothttp://haicolon.wordpress.com/tweetility/
18:12justin_smithsdegutis: mine?
18:12sdegutisYes both.
18:12justin_smith@noisesmith
18:13sdegutisTEttinger: whats urs
18:15TEttingerI don't actively twitter-ize
18:16sdegutisFine, whatever. The results are in! https://twitter.com/_sdegutis/status/628690897845243904
18:17oddcully,(Long/toBinaryString 2146959360)
18:17clojurebot"1111111111110000000000000000000"
18:27kwladykais any function to create new empty data from old data, but with all metadata from old data? just something like (new-with-meta (with-meta #{1 2 3 4} {:super-meta 1})) and return #{} with :super-meta 1?
18:27kwladykai know how to do that only using with-meta and meta
18:28kwladykaanyway it is maybe enough good
18:30Bronsa,(meta (empty (with-meta {1 2} {3 4})))
18:30clojurebot{3 4}
18:31Bronsaalthough the docs don't mention it
18:32justin_smithoh, nice trick
18:36kwladyka(with-meta #{} (meta boards)) <- i am doing this like that now, but i thought maybe it something shorter
18:38Bronsakwladyka: use `empty`
18:42yojoejustin_smith: after i added leiningen and the leiningen core as dependencies, now i get new error. "No such var: b/doc-from-ns-form, compiling:(leiningen/help.clj:12:21)". any ideas?
18:42justin_smithb * weird
18:43kwladykawould it consume less memory with empty?
18:44kwladykabut trick with empty is nice, thx
18:45justin_smithkwladyka: empty is going to do less irrelevant work, because what you want is exactly what empty is designed for
18:57herrwolfein cider, is there a way to interrupt a set of tests that is running without closing the nrepl session?
19:00kwladykai am asking because i am looking all possible ways to reduce memory consumption :)
19:00{blake},(read-string "08")
19:00clojurebot#error {\n :cause "Invalid number: 08"\n :via\n [{:type java.lang.NumberFormatException\n :message "Invalid number: 08"\n :at [clojure.lang.LispReader readNumber "LispReader.java" 330]}]\n :trace\n [[clojure.lang.LispReader readNumber "LispReader.java" 330]\n [clojure.lang.LispReader read "LispReader.java" 256]\n [clojure.lang.LispReader read "LispReader.java" 196]\n [clojure.lang.LispReade...
19:00{blake}huh
19:01Bronsa{blake}: 8 is not a valid octal value
19:01Bronsa,012
19:01clojurebot10
19:01{blake}Bronsa, leading zero means octal. I had forgotten that. I was read-string-ing to convert string to numbers.
19:02Bronsa{blake}: use Long/parseLong
19:03{blake}Bronsa: Is that the mode? I've never found a canonical approach described.
19:04Bronsa{blake}: if all yoou have to parse is integer numbers sure
19:05kwladykait is time to sleep, goodnight and see you tomorrow :)
19:05{blake}Bronsa: Yeah. It's parsing out a month, day, year.
19:05Bronsaif you want to parse stuff like XeY though it won't work
19:20{blake}Bronsa: Newp. That's fine.
19:21{blake}(inc Bronsa)
19:21lazybot⇒ 117
21:46sdegutisI've noticed my Clojure code is looking very foreign. I just wrote this: (def templates (comp (partial sort-by template-id) :templates))
21:47akkadno args?
21:47sdegutisWhereas previously it was like this: (defn templates [m] (->> m :templates (sort-by template-id)))
21:47akkadoh nvm
21:48sdegutisAnd then it hit me: my code is turning into just Haskell with s-expressions.
21:49sdegutisPretty sure the transliterated Haskell (with pseudo-stdlib) equivalent of the exact same function is: templates = sortBy templateId . getField "templates"
21:50sdegutisWhere . is Haskelleze for (comp).
21:54sdegutisWhich is super surprising because I thought I was starting to like JavaScript more, not Haskell.
22:26justin_smithpoint-free is fun
23:37rhaywoodI'm using Circe version 1.6-d1f9740 with GNU Emacs 24.4.1 (of 2014-10-20)