#clojure logs

2014-12-25

04:26hellofunkmany splendid holiday wishes to you folks
04:40dysfunso how many people are writing code instead of lazing about eating too much?
04:44hellofunkdysfun: yeah i'm working today
04:44TEttingerdysfun: I got an F# book on the last day of hanukkah
04:44hellofunknot too much food here to eat anyway
04:44SagiCZ1good morning guys
04:44TEttingerthinking of working through that
04:45dysfuni used to love working christmas
04:45dysfunyou spend most of the time in the pub anyway
04:45hellofunkTEttinger so wait every song in the entire book is in the key of F#? that would get interesting
04:45dysfunTEttinger: commiserations. i find f# to be horrible
04:46dysfunthe marketing seemed to be largely centered around "hey, look we've implemented the |> operator which does for functions what the unix pipe does for stdio"
04:46dysfuntheir minds might be blown if they discovered ->
04:46TEttingerha
04:46SagiCZ1heh
04:47dysfunthere's an online tutorial with repl for it somewhere
04:47dysfunbut you need silverlight
04:47SagiCZ1bleh
04:47dysfuni ran through most of it and decided i didn't like it
04:47TEttingerfor games, I kinda think the JVM is a rat's nest of performance pitfalls
04:47dysfunclojure/clr
04:47TEttingerI really did spend a lot of time optimizing clojure code to use arrays, etc.
04:47dysfunit'll still work and you can pick up more recent versions of the libraries
04:48dysfunof course now you've got a slightly different problem
04:48dysfunbut hey there are lots of games libraries for .net
04:49TEttingerindeed. I'll probably use monogame. java has libgdx, which is bound to clojure with play-clj, but I kinda doubt play-clj scales well since it abstracts so much
04:49dysfunfwiw i'm using jmonkeyengine for graphical stuff
04:49dysfunbut i'm not trying to squeeze the last ounce of performance out of it
04:50AimHereIf you're using monogame, why not just ramp up to Unity?
04:50TEttingerI can manage pretty well with libgdx and java right now, actually
04:50TEttingerugh
04:50dysfunwith the exceptions of gaming and compiling scala code, computers have been 'fast enough' for some while
04:50TEttingerUnity is a totally alien environment to me, it's very opposed to the way I like to develop
04:51dysfunyeah, but it feels like the future too
04:51AimHereIt is a bit of a culture shock, sure, but it is quite pleasant
04:51AimHereOnce you get used to it
04:51dysfuni asked a friend who'se been building games for a living for like 20 years about the good bits. he said a surprising thing: everyone (not just devs) uses unity, that's the value in it
04:51dysfunso teamwork is enhanced
04:52dysfunas someone who's sat on the project management side of the fence a little too often, this might be the killer feature
04:52TEttingerheh, I'm a one-man team so that point kinda is missed on me
04:52AimHereWell even if you're a lone dude, that does mean that there are plenty of people on the net able to answer any questions on IRC, StackOverflow, Unity forums and the like
04:53dysfunme too, but i'm also not working in a games studio
04:53dysfunthe pricing model is fascinating actually
04:53dysfuni think they've been very clever
04:54TEttingerI'm sure they make a lot of money off asset store purchases
04:54AimHereThe price is another killer feature
04:54SagiCZ1yeah i thought jmonkey was worth mentioning.. it works pretty ok.. it would be lovely if someone made a clojure wrapper like they made seesaw, because the api is not great
04:54dysfunvery hard to get ubiquity as a non open-source product
04:54dysfunSagiCZ1: i'm using some code someone else cribbed together and am writing a library as i go along
04:54SagiCZ1dysfun: in clojure?
04:54dysfunSagiCZ1: but i'm mostly rendering in 2d right now, so it may not meet your needs
04:54dysfunyes clojure
04:55SagiCZ1cool.. im using it for my bachelor thesis project, not sure if my profesor would let me switch to clojure..
04:55dysfunoh, you're in java?
04:55SagiCZ1yea
04:55dysfunsorry, you're on your own :)
04:56SagiCZ1still, do you have any github project i could check out?
04:56dysfuni'll ping you a link once i've tidied it up a bit
04:56SagiCZ1great, thanks
04:57dysfunbut i should get back to my swift code
04:57hellofunkdysfun: how do you like swift
04:58hellofunkdysfun: i started in Obj-C before the ARC days and now I wonder what swift would be like had we sticked with iOS products
04:58dysfunit feels quite programmable on the whole. my complaints are largely around compiler segfaults, ridiculous error messages, objectionable c interop and decisions they made a long time ago in libraries because objectionable c
04:59dysfune.g. i had to disable autorelease on an NSWindow because otherwise i got a bizarre runtime error
04:59hellofunkdysfun: in short, how is it an improvement over Obj-C, which I rather liked?
04:59dysfunmemory management is a lot more automatic-feeling
05:00dysfunlocals just drop out of scope quietly and drop the reference count
05:00hellofunkdysfun: more so than Arc?
05:00dysfunyeah
05:00dysfunand if you overwrite something with nil it decrements the refcount too
05:01hellofunkinteresting. syntax as a whole, more elegant, or about same basket of boilerplate for classes, etc?
05:01dysfunthat NSWindow thing was because swift's cleverness tried to double-dealloc an NSWindow
05:02dysfunoh the syntax is much nicer than objectionable C imo. much less verbose too
05:02dysfunthere are some things that are tedious, mind
05:02hellofunksounds nice. i really liked developing for apple products, i must admit. too bad swift wasn't around when i did
05:02dysfunespecially if you're using xctest
05:02dysfuni'm starting to appreciate cocoa
05:02dysfunthis is a desktop project, not ios though. i no longer own any ios devices
05:03dysfuncocoa seems largely well put together
05:03dysfunswift, they've obviously compromised a lot to make it mostly seamless with objectionable c, but it's a good language
05:03dysfunthe compiler is crap though and it segfaults a lot compiling complex code
05:04hellofunkhow do you get around that?
05:04hellofunkif you can't compile your code?!
05:05dysfunyou... rewrite it :/
05:06dysfunand hope that one day they'll fix the compiler
05:06dysfuni didn't say the experience was perfect, but i have to put up with a lot of shit in most languages
05:06dysfunpart of why i like clojure so much is it takes care of most of that for you
05:25tickingI wonder how long it takes for cljs to get an eval after all, the original point that eval is needed for dev environments has kinda gone out of the window since a lot of IDEs are now written in cljs...
05:27SagiCZ1what would be the predicate for take-while to return all elements until for some succesive two elements a condition is met?
05:27SagiCZ1for example (1 2 3 4 5 5 6 7) --> (1 2 3 4 5 5) when the predicate is =
05:27tickingSagiCZ1: that would require state in the predicate or someting not that simple I think
05:28SagiCZ1yeah..
05:28SagiCZ1maybe use partial to create succesive pairs..
05:28SagiCZ1partition
05:28tickingyeah
05:28SagiCZ1,(partition-all 2 1 (range 10))
05:28clojurebot((0 1) (1 2) (2 3) (3 4) (4 5) ...)
05:28tickingpartition is the first thing I came up as well
05:28tickingSagiCZ1: you could also do
05:29ticking,(first (partition-by = [1 2 3 4 5 5 6 7]))
05:29clojurebot(1 2 3 4 5 ...)
05:29ticking,(first (partition-by = [1 2 5 5 6 7]))
05:29clojurebot(1 2 5 5 6 ...)
05:29tickinghrm sec
05:31tickingSagiCZ1: lol sorry, partition-by is not partition between...
05:43hellofunkmaybe a simple recursive loop would be good in that case SagiCZ1
05:44luxbock,(reduce (fn [seen n] (if (= (last seen) n) (reduced seen) (conj seen n))) [] '(1 2 3 4 5 5 6 7))
05:44clojurebot[1 2 3 4 5]
05:46hellofunkluxbock: but the reduce would still go through the entire seq, right? because reduce doesn't cut out on a test
05:46luxbockthat's what `reduced` does
05:46tickinghellofunk: reduced will cut
05:46hellofunkwell hot damn learned something new, that's awesome. didn't know that one.
05:50dysfunhrm, that would have been handy to know about
05:52hellofunkdysfun: if you didn't know reduced either, then i won't feel too bad
05:52dysfunwhy would you feel bad? i discover things all the time
05:53dysfuni've been paid to write code for over ten years now, not to mention all the unpaid before and i've not stopped learning yet
06:07dysfunokay, writing tests in swift/xctest is a lot more tedious than clojure/midje
06:14hellofunkdysfun: so in other words you can do it in clojure even more swiftly than swift
06:17dysfunbecause it's so unlike apple to employ marketing in the naming of things
06:27tickingdysfun: far better than iLanguage though
06:28tickingwhich is only the version without assignment and bitwise operations btw if you want that you need Language Pro
06:32dysfunhah
06:48dysfunthanks to multicultural britain, my local greasy spoon cafe is actually open today so we're outsourcing breakfast
07:33hellofunkdysfun: here in NL i had to go to train station to find anything open, and got myself some doner kebab
08:16dysfunhellofunk: well my flatmate and i have feasted on fryups. great stuff.
08:38justin_smithluxbock: don't use last on vectors, use peek
08:38justin_smithlast is guaranteed linear time
08:39justin_smithpeek is O(1)
08:42justin_smith,(butlast (reductions (fn [prev n] (if (= prev n) (reduced n) n)) [1 2 3 4 4 5 6 7]))
08:42clojurebot(1 2 3 4)
08:43justin_smith(lazy version)
10:47delexiis there an abs function in clojure?
10:50AimHeredelexi, a lot of mathematical functions are palmed off to java so that it becomes Math/function
10:50AimHere,(Math/abs -0.3)
10:50clojurebot0.3
10:51AimHereIt might not work with all numeric types
10:54delexiAimHere: Ah, dang, of course! Thanks!
10:57SagiCZ1btw look at incanter if you care about infix notation and such things
11:41AimHereHmmm, I'm feeling stupid. Is it possible to create a record with defrecord that has a circularly linked field, without mutable state? I figure that consigning the whole field to dirty old mutability forever because you only want to change it once to actually initialize it is a bit overkill
12:47TimMc&(Math/abs 5N)
12:47lazybotjava.lang.IllegalArgumentException: No matching method found: abs
12:48TimMc&(.longValue 9999999999999999999999999999999999N)
12:48lazybot⇒ 4003012203950112767
12:49TimMc&(.longValue (inc' Long/MAX_VALUE))
12:49lazybot⇒ -9223372036854775808
12:49TimMc:-(
12:49andyf.longValue is asking for truncation, yes?
12:49TimMcApparently.
12:50TimMcSo to get get the absolute value of a Number you'd have to do something with checking if it is < 0 and then multiplying by -1 if so.
12:51andyfmath.numeric-tower should already have it implemented
12:51andyfI haven't used it personally, but its there in the docs
12:51TimMc*nod*
12:53engblom,(println "Merry Christmas")
12:53clojurebotMerry Christmas\n
13:32preschemahi, is there a wiki engine written in Clojure?
13:32preschemaalso, is there a list anywhere of the various web-based softwares written in Clojure?
13:43preschemaso in case there is no wiki engine written in Clojure yet, would anyone be interested in a collaboration to port Instiki from rails to Clojure? i think it would be great for Clojure, if done well. furthermore it will go live on a very big wiki used by pure mathematicians (where i am technical admin)
13:47kenrestivoyou could go to http://crossclj.info/ and search for compojure, ring, even "wiki"
13:48kenrestivoi think searching for the basic compojure functions, and looking up all its usage, will give you pretty much all the existing clojure web apps, at least the ones indexed there
13:49kenrestivo"transitively used by 491 artifacts" eg http://crossclj.info/ns/compojure/1.3.1/project.clj.html
13:50preschemathanks
13:51kenrestivotho there are web apps that don't use compojure, but most do. searching for ring might be good too. i find crossclj the best tool for choosing libraries or looking for example code for how to use one (esp when the documentation is thin).
14:01jonathanjyogthos: it seems like specifying :target-path in project.clj was breaking `lein ring uberjar`
14:03yogthosjonathanj: ah lein-ring is might be expecting a hardcoded location for the target?
14:04jonathanjyogthos: i'm not sure what the reason is, all i know is that removing that stopped the warning about missing a main method
14:31newfrienddoes anyone know how to enable syntax highligting in the cider-repl
14:51justin_smithAimHere: I would make the :children key (or whatever you call it in your record) a promise
14:51justin_smiththat allows circularity via delayed evaluation, without mutability
14:52justin_smiththough it does require deref for direct access - likely you would want to implement a protocol that hides all that ugliness
14:52AimHereAha, I forgot laziness
14:52justin_smithwell promises aren't lazy, per-se
14:52justin_smithbut similar concept, for sure
14:53AimHereSICP tends to use promises in their implementation, as I recall
14:54justin_smithpromises implement lazy-seqs, but are not lazy-seqs concretely :)
14:54justin_smith*can implement
14:54justin_smithI don't think clojure lazy-seqs use promises
14:55AimHereWon't it use a similar mechanic, even if hardcoded in Java?
14:55justin_smith (list 'new 'clojure.lang.LazySeq (list* '^{:once true} fn* [] body)))
14:55justin_smiththat's lazy-seq (arg vector was [& body])
14:56justin_smithnot java, not a promise
14:56justin_smithwell, partially java, OK
14:56justin_smiththat looks more like delay than promise though
14:57justin_smithand delay isn't as nice for circular structures as promise is
15:29OscarZ-im trying to get NREPL server running on my Java application.. i suppose i need to run start-server somehow from native java.. any ideas?
15:29OscarZ-or is that even possible.. do I need to have native Clojure application for that?
15:29justin_smithOscarZ-: should just be a question of using clojure.lang.RT - but it would be easier to make a namespace of clojure code that takes care of all the details, and makes a function you can invoke from java
15:29justin_smiths/would/might
15:30OscarZ-yeah.. i'll probably have use for some helper functions in that namespace.. thanks ill look into RT
15:31justin_smithhttp://blog.jayfields.com/2011/12/clojure-java-interop.html this has a good intro in the second half
15:32justin_smithpretty simple actually
15:38delexiI am trying to solve the doublets wonderland-clojure-kata but got stuck with an error I don't know what to do with. The Exception along with the code can be found here: https://gist.github.com/5e29a9ab0bdecb6cdec1 What did I do wrong?
15:39justin_smithdelexi: in the let binding for neighbors, map gets the args in the wrong order
15:40justin_smithI think you meant to use ->> instead of ->
15:40justin_smith(in fact every clause there gets the args in the wrong order, but ->> would fix that)
15:42justin_smithsince it gets a function instead of a collection, and a collection instead of a function, you get the error "Don't know how to create ISeq from: doublets.solver$doublets$doublets_rec__3564$fn__3569"
15:42delexiah, thank you, this removes the exception. Now off to see, why the code returns the wrong result!
16:02griosAll Clojure code (and other lisps) I find has very short variable names, people seem to favour one-letter namer rather than something more descriptive. Is there a style guide that say's that's good, or is that just lisp tradition? //Confused code-reader
16:02OscarZ-justin_smith, cool i got it to work.. was really easy :)
16:02justin_smithgrios: it really depends - I think super short names are common in fp
16:03justin_smithgrios: also, in fp, sometimes the code is so general, no longer name would be especially helpful
16:03griosjustin_smith: why? Do people need to save 5 bytes of source code?
16:03justin_smith(look at the variable names they use in math)
16:03griosjustin_smith: ah, that kinda makes sense
16:04justin_smithie. if you have a function like (defn dotwice [f] (fn [x] (f (f x)))) - f and x are probably the best names you can use there
16:05justin_smithgrios: in haskell, they have "point free style" where they even eliminate variable names (it's all implicit application on unnamed args)
16:05OscarZ-justin_smith, heh yeah.. i always have trouble with that point free style
16:16OscarZ-justin_smith, in interop/Example.java, why is there no arguments in (defn main [] println) ? it seems that when its called from Java, there is argument passed f.invoke("hello world") ?
16:29OscarZ-ah its returning the function to java side.. misunderstood what its trying to do
16:31OscarZ-if i want to have something like a global variable that is only assigned once.. a bit like Java final, is it ok to just use def to assign it to some namespace?
16:31OscarZ-it will be some java object which methods i will be calling later on
16:33justin_smithOscarZ-: well, vars are mutable
16:33chouseryes, though you may want (defonce ^:constant foo value)
16:33justin_smithif you want something that is truly single assignment maybe you could use a promise or delay and hold onto that, and not its var
16:34chouseroh, sorry ^:const
16:34OscarZ-i see
16:37chouserI wouldn't worry about vars being technically mutable. People generally don't mutate them.
16:39OscarZ-yes, in this case im calling my nrepl setup code from Java application and i just want to pass in some object that i can refer to in my clojure code
16:39OscarZ-im impressed how to easy it was to get this thing going :)
16:40justin_smithclearly some thought was put into making it a usable API
16:40OscarZ-going to try the "bean" function you told about earlier
16:45SagiCZ1how does one mutate a var?
16:45justin_smithSagiCZ1: def
16:45SagiCZ1,(def x 6)
16:45clojurebot#'sandbox/x
16:45SagiCZ1,(def x 7)
16:45clojurebot#'sandbox/x
16:45SagiCZ1thats how?
16:45justin_smithyes, that mutates the var
16:45SagiCZ1thats not something you would do in a production code though
16:45justin_smithone would hope not
16:47SagiCZ1now that you are here.. do you have any idea what the exclamation marks in different function names mean? like why is the new run! function with exclamation mark when it does almost the same thing as doseq which has no ! ..
16:48justin_smithit's complicated and not super internally consistent. One general idea is that things unsafe in transactions often have !
16:49justin_smithbut in scheme things that do side effects have ! and we see some of that carried over too
16:50SagiCZ1too bad its not consistent
16:51SagiCZ1what is a transaction?
16:51justin_smith&(->> (all-ns) (mapcat ns-publics) (map (comp name key)) (filter #(.endsWith % "!")))
16:51lazybotjava.lang.SecurityException: You tripped the alarm! ns-publics is bad!
16:51justin_smithblergh
16:51justin_smith,(->> (all-ns) (mapcat ns-publics) (map (comp name key)) (filter #(.endsWith % "!")) (clojure.string/join "; "))
16:51clojurebot"vswap!; vreset!; set-error-mode!; set-agent-send-executor!; disj!; conj!; pop!; compare-and-set!; reset-meta!; set-error-handler!; set-agent-send-off-executor!; dissoc!; assoc!; reset!; alter-meta!; persistent!; run!; set-validator!; swap!; volatile!; io!; set-break-handler!"
16:51andyfYou can also mutate at least the thread-locally bound value of a Var with set! I believe.
16:51justin_smithas you see, it's not many things that are named that way
16:52justin_smithandyf: and alter-var-root
16:52SagiCZ1okay then
16:53justin_smithI wonder why ns-publics is restricted
16:53justin_smith(on lazybot, that is)
17:19Dynastydoes anyone know if there is documentation for writing Light Table plugins?
17:26dbacarhello
17:27dbacari have a web app initiated like this
17:27dbacar(def app (-> #'app-routes
17:27dbacar (enforce-content-type-middleware "text/html")
17:27dbacar (wrap-defaults site-defaults)
17:27dbacar (nses/wrap-noir-session {:store (memory-store nses/mem)})
17:27dbacar ))
17:27dbacar
17:28dbacarit seems I use two session wrappers
17:29dbacarand in my application session-id seems to change in between requests
17:29dbacarso I lose the session
17:30dbacarit is convenient to use noir to have get and put! commands, is it still the recommended way to deal with sessions?
17:31dbacarany ideas?
17:37dbacaranyone here?
17:37dbacaranyone reading my message?
17:38SagiCZ1i do
17:38SagiCZ1but i have no idea how to help you.. sorry
17:38hyPiRionit's christmas day, most people are probably doing something with their family
17:43dbacarterribly sorry, i am new to emacs erc, so thought it was sth wrong with connection
17:43dbacarmerry christmas
17:43dbacar:)
17:44hyPiRionhappy holidays
17:51octei have a nested list like this: http://pastebin.com/4YPSqGTL
17:51octei want to extract the lists containing numbers from that
17:51octetransform it into ((30000139 30000144 30000140 30000142) (30000139 30000144 30000142) (30000139 30000144 30000143 30000142)) i guess
17:52SagiCZ1you want to leave out the nils?
17:52octeand semi-flatten it
17:52SagiCZ1whenever you encounter something like this, think first about how you actually got such a mess and try to fix it there
17:52andyfI was going to suggest flatten, but it sounds like you want some list structure to remain?
17:53octeyes
17:53andyf(remove nil? ...) is good for one level, at least.
17:54octeSagiCZ1, yes, that's probably something i need to fix. i became curios on how to solve this though
17:55dbacarwould clojure.walk be helpful here?
17:55SagiCZ1maybe treeseq
17:55octeit feels like it
17:55octebut i'm not sure ho
17:55octew
18:03SagiCZ1can i hook a listener to an atom to do something when its value changes?
18:03SagiCZ1in seesaw particulaly
18:04justin_smithSagiCZ1: add-watch maybe?
18:04SagiCZ1cool thanks
18:05justin_smithSagiCZ1: octe: yeah, tree-seq plus a filter based on (fn [el] (and (coll? el) (every? number el)) would probably do it
18:07andyfocte: This probably won't always do what you want, but it seems to work on the example given: (filter #(and (sequential? %) (every? number? %)) (tree-seq seq? seq d1))
18:07octejustin_smith, thanks, i'll give it a try
18:08andyfAh, missed justin_smith answer
18:08octeandyf, cool, that works
18:11justin_smithocte: https://www.refheap.com/95412
18:12justin_smithandyf: haha, and you got the more concrete answer while I was busy composing, formatting, and pasting mine
18:12justin_smithbut the fact that the two of us each came up with that is reassuring :)
18:16SagiCZ1i have a collection on which i take while like this (take-while #(some-predicate %) coll), i also want to stop taking when the lement is nil.. how would i do that?
18:17justin_smithSagiCZ1: (take-while #(and (some %) (some-predicate %)) coll)
18:17justin_smithwait, no, not some
18:17justin_smithsome?
18:18justin_smithI get the two confused sometimes :)
18:18justin_smith(doc some?)
18:18SagiCZ1me too
18:18clojurebot"([x]); Returns true if x is not nil, false otherwise."
18:18justin_smith&(some? false)
18:18lazybot⇒ true
18:18justin_smithyup, that's the right one
18:18SagiCZ1thank you
18:20SagiCZ1,(map some? [nil 0 false true])
18:20clojurebot(false true true true)
18:20SagiCZ1,(map boolean [nil 0 false true])
18:20clojurebot(false true false true)
18:20SagiCZ1i see
18:23hex6What's the best practice to split up your project into several files? right now I have one ns and use (load "file") and (in-ns ...)
18:23SagiCZ1you can group functions and have a namespaces for each of them
18:35SagiCZ1i need to format a double
18:35SagiCZ1,(format "%.2d" 45.976)
18:35clojurebot#<IllegalFormatPrecisionException java.util.IllegalFormatPrecisionException: 2>
18:36SagiCZ1,(format "%.2f" 45.976)
18:36clojurebot"45.98"
18:36SagiCZ1,(String/format "%.2f" 45.976)
18:36clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Double cannot be cast to [Ljava.lang.Object;>
18:37SagiCZ1,(String/format "%.2f" (to-array 45.976))
18:37clojurebot#<RuntimeException java.lang.RuntimeException: Unable to convert: class java.lang.Double to Object[]>
18:37SagiCZ1,(String/format "%.2f" (to-array [45.976]))
18:37clojurebot"45.98"
18:37dbacar`(= 3 4)
18:37SagiCZ1,(String/format Locale.US "%.2f" (to-array [45.976]))
18:37clojurebot#<CompilerException java.lang.ClassNotFoundException: Locale.US, compiling:(NO_SOURCE_PATH:0:0)>
18:38dbacar`,(= 3 4)
18:38clojurebotfalse
18:38dbacar`oh my goodness :), ididnt know this
18:38SagiCZ1,(String/format java.util.Locale.US "%.2f" (to-array [45.976]))
18:38clojurebot#<CompilerException java.lang.ClassNotFoundException: java.util.Locale.US, compiling:(NO_SOURCE_PATH:0:0)>
18:38SagiCZ1god damn
18:38SagiCZ1what a hassle
18:39SagiCZ1(String/format java.util.Locale/US "%.2f" (to-array [45.976]))
18:39SagiCZ1,(String/format java.util.Locale/US "%.2f" (to-array [45.976]))
18:39clojurebot"45.98"
18:39SagiCZ1finally
18:39SagiCZ1clojure should really make the format function to accept locale, this is just terrible
18:41andyfSagiCZ1: Why not just use format?
18:41hex6What was wrong with ,(format "%.2f" 45.976)?
18:42andyfah, because you need to specify a locale?
18:42SagiCZ1whats wrong? it ASSUMES my locale.. and since my locale is non us, it uses different decimal separator
18:42SagiCZ1i hate when someone ASSUMES locale.. horrible
18:42SagiCZ1it solve 2 problems and creates 5000 new ones
18:43andyfYou might have gotten there with a bit less hassle if you had read (source format)
18:45JackRack , (source format)
18:46clojurebotSource not found\n
18:46SagiCZ1(source format)
18:46JackRack ,(source format)
18:46clojurebotSource not found\n
18:46SagiCZ1did this ever work?
18:47JackRack ,(clojure.repl/source format)
18:47clojurebotSource not found\n
18:57andyfSagiCZ1: Try a local repl instead
18:57SagiCZ1i just ctrl+click to see the source
19:33sovaI am fascinated by clojurebot. does anyone know how it (she?) works?
19:33alexbara`how can I set styles on a snippet using Kioo/Enlive?
19:53alexbara`anyone around who has used much Enlive or Kioo that I could run a question by?
19:57klWhat does (Boolean. "false") do?
19:58klSpecifically, it's the (Something. "something") syntax I'm looking to decipher
20:00ambrosebskl: expands to (new Something "something")
20:00ambrosebscalls the 1 argument constructor on Something
20:00klambrosebs: I see, thank you!
20:01ambrosebskl: np
20:10andyfkl: Strongly recommended against using the constructor for class Boolean, though, for Java and Clojure
20:11andyfbecause this....
20:11andyf,(if (Boolean. false) "true" "false")
20:11clojurebot#<AccessControlException java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessDeclaredMembers")>
20:11andyfwell, if you do that in a local repl, you will see "true" as the result, which is very surprising.
20:12andyfsova: There is source code in a GitHub repo for clojurebot, I'm pretty sure.
20:14andyfsova: Not sure if this is the most up to date repo: https://github.com/hiredman/clojurebot
20:14klandyf: thanks for the heads up, I'm aware of that issue :)
20:14klThe text explained that problem, without the syntax (from what I saw, at least!)
21:10ffwacomis there any reason why 'lein test' would be taking forever to run?
21:30mearnshstumped by a bug. see two examples at end, using a trusty prn to find where the first one fails and testing directly on that case (second example), works https://www.refheap.com/95414
22:15justin_smithffwacom: a common culprit for things like that is side effects (like creating a server or thread) at the top level of a namespace
22:15justin_smithie. (def server (run-jetty ...))
22:15justin_smithbad idea
22:16ffwacomhmm might be the case, datomic transactor is being started
22:17justin_smithmearnsh: the exception clearly states that the function "atom" is being used where a number is expected
22:17justin_smithbut nothing in the code you pasted uses atom
22:18justin_smithalso, using "atom" to mean things other than clojure.core/atom is going to confuse people
22:18ffwacomjustin_smith: ah had some api calls being made
22:18ffwacomthanks
22:19justin_smithffwacom: yeah, the common pattern is to def an "init" function, and either generate the resources you need inside that and return them, or fulfill a promise/ force a delay, whathaveyou
22:19justin_smithand just document that init must be called, of course
22:20ffwacomsounds good
22:21justin_smithactually, if you use delays (which only run when \they are dereffed) you may not need an init
22:21justin_smithdepending on your logic of course
23:15sovaandyf: thanks on the linkage.