#clojure logs

2015-03-17

00:03TEttingerraspasov: command line to the program curl, which fetches from a url
00:04TEttingerbcm, I've never really dealt with complex url gathering, slurp has always sufficed for me
00:31akuttruf`hey guys, can someone explain to me the difference between @ and '#?
00:32akuttruf`I am having a difficult time researching threads and docs due to the special characters, and hope someone might be able to clarify.
00:33scottj'# is nothing, #' is var, @ is deref
00:33akuttruf`ah, thank you!
01:33ewemoaakuttruff: i was introduced to the following and found it helpful for this sort of situation: http://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/
02:27TEttinger(inc ewemoa)
02:27lazybot⇒ 1
02:27TEttingerI am always linking to that site, it's great
02:27TEttingerit's how I found out about #_ , which I love
02:34optout(which site?)
02:35scottjoptout: http://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/
02:41optoutwhat i like about that site
02:42optoutis that it has some js to say 'this post might be outdated'
02:42optouti think that needs to come by default with technical/programming blogs
03:04chengloudoes clojure do some optimization concerning (get-in coll [1 2 3]) and pull that vector out if it's used many times?
03:04chengloupulls*
03:05EmpperiI'd have to guess the answer is no
03:05arrdemClojure does not, to my knowledge, do constant lifting. That said, the cost of repeating that expression is zero.
03:05arrdemeffectively.
03:05chenglouarrdem: how so
03:05chenglouarrdem: just because it's so cheap? Or something else
03:05arrdemchenglou: bingo. just about anything else will dominate that cost.
03:05arrdembecause it's a constant, it'll get lifted into the function constant pool
03:06arrdemso N identical vectors will be computed once
03:06arrdemand then reused forever
03:06chengloufunction constant pool?
03:06chenglouis there any article that explains how this works
03:06arrdemnot really.
03:06arrdemsorry.
03:06arrdemIf you're feeling brave, checkout how tools.emitter.jvm works
03:07chenglouoh well. But how does the constant pool work for the vector?
03:07arrdemFunctions are really classes implementing clojure.lang.IFn
03:08arrdemfunctions can have fields just like any other object
03:08arrdemit just so happens that Clojure uses const function fields to cache values (like constant expressions) which will be reused.
03:09arrdemso keywords like :foo will be computed once when the class is first instantiated, that keyword instance will be written to a generated const field of the function and then that field will be referenced whenever the key :foo is needed for the stack.
03:09arrdemdoes that make sense?
03:09arrdemsame thing happens for more complex structures like vectors and maps.
03:09arrdemif they are actually constant.
03:10chenglouthey always are, aren't they?
03:11arrdemno, you can reference locals in a literal expression.
03:11chenglouoh, right. Was thinking about immutability
03:12chenglouarrdem: that's interesting. Do you know if the same constant optimization applies to clojurescript as well?
03:13arrdemchenglou: I know about tools.emitter voodoo because I worked on it last summer. I have nothing to do with clojurescript.
03:13arrdembesides the Google Closure compiler is deep magic beyond the ken of mortals
03:14chenglouhah, alright thanks
03:17ewemoaTEttinger: lol...i probably learned about the link from you ;)
05:18nicola_hi all
05:18kungiHi nicola_
05:19kungican someone help me make this code snippet more readable: https://gist.github.com/Kungi/b7c55fae2be594ce3452
05:19clojurebotHuh?
05:20nicola_I am a first year computer science student wanting to do google summer of code. but I have to propose a project and I have no idea where to start. I have never worked on an open source project before but I really want to! help?
05:21kunginicola_: What are you interested in?
05:21nicola_well im big into functional programming, thats why im here :P
05:24kunginicola_: ;-P
05:25nicola_I just really want to get involved but most projects are big and scary
05:26hyPiRionnicola_: anything more specific? Like, do you want to work on anything listed on http://dev.clojure.org/display/community/Project+Ideas ?
05:26nicola_to be honest i havent even taken a look
05:28hyPiRionI guess that's somewhere you can get ideas at least :)
05:28nicola_im taking a look right now :)
05:31kungihyPiRion: Can you help me with some code for a second?
05:33hyPiRionkungi: I can try at least
05:33hyPiRionjust post the url and I'll see
05:34kungihyPiRion: https://gist.github.com/Kungi/e3d43696983d70e72fd8
05:34kungihyPiRion: can I write this in some prettier way?
05:34hyPiRionah
05:34hyPiRionyeah, give me a second
05:39hyPiRionkungi: https://www.refheap.com/8bea851de16b40e0bd74e1da0
05:39hyPiRionthe indentation went a bit off there, but you should grok the idea
05:41nicola_okay, i took a look and all those ideas seem pretty scary
05:41kungihyPiRion: I did not know of cond-> :-)
05:41kungihyPiRion: Thank you
05:42shemnicola_: maybe work on some project you already use?
05:42hyPiRionkungi: np
05:42dysfuncond-> is pretty shiny
05:48dysfunstuartsierra: around?
05:48stuartsierrayes
05:50dysfuni built a thing on top of component. i'd be interested to hear what you think https://github.com/jjl/oolong
05:54stuartsierraLots of people have built stuff on top of component. I'm always happy when people find it useful. Can't comment beyond that.
05:55dysfunwell in particular, you asserted that you don't think libraries should be distributed in component form. the platform this will power is planning to do exactly that.
05:57stuartsierraThat's fine. https://github.com/danielsz/system and https://github.com/juxt/modular do that too.
05:57dysfunah okay. cool.
06:26danielcomptonDoes anyone know of a python version of Clojure's iterate?
06:31dysfunit should be fairly easy to do in a list comprehension
06:32dysfunwell, the whole thing
06:32dysfunjust the iterate part sounds like generators
06:37dysfuntry this https://www.refheap.com/98536
07:00noncomis it possible that *ns* and Compiler.currentNS() differ during performing (eval) on a piece of code ?
07:06agarmancan you eval in-ns?
07:07noncomyes...
07:08noncomyou mean that compiler-ns will be different?
07:18agarmanVar is thread local
07:18agarmanonly the thread it belongs to should have access to it.
07:19zotis there any way to refer to ILookup (from clojure.lang) without the full prefix?
07:19agarmanso a Var can change, but it has to be done by the thread
07:21agarman*ns* is a Var, so unless I am just plain wrong, it shouldn't change in an eval unless what you eval changes it
07:23agarmanzot: you mean something like associative?
07:25agarman,(map associative? [{} [] () #{}])
07:25clojurebot(true true false false)
07:28noncomagarman: i was just evaling some forms read by clojure.tools.analyzer and it got stuck, misassociating a symbol with a worng ns
07:31agarmannoncom: ask later when there's more folks here
07:32noncomyeah, this question is very specific.. there were people like Bronsa who know the internals...
07:32Bronsanoncom: Compiler.currentNS() literally just dereferences *ns* so there's no way they can return different values
07:32agarmanyep, usually don't see Bronsa or tbaldrid answering questions this early
07:33noncomoh, hi!
07:33noncomstrange... i got into a situation where the evaled symbols are wrongly attributed to a different namespace...
07:34noncomso, you're saying that *ns* and compiler ns is the same.. that adds more strangeness
07:35Bronsanoncom: t.a.jvm uses the :ns value in the env to bind *ns* to
07:36Bronsanoncom: if you use analyze-ns it will handle *ns* for you, if you manually loop with analyze+eval, you'll need something like (binding [*ns* *ns*] (loop [..] (analyze+eval form env) ..)) to make sure *ns* keeps bound to the right value
07:37noncomi did not use t.a.jvm yet.. i only read forms with tools.reader and then eval with the regular (eval)...
07:37Bronsaagarman: that's because I'm a late sleeper :P it's 12.30 for me now
07:37noncomi do the *ns* *ns* binding, but i did not pass env as you pointed now
07:37Bronsanoncom: ah, you talked about t.analyzer earlier
07:37agarmanBronsa: much earlier for me :-)
07:38noncomyou see, all is read ok with tools.reader
07:38noncombut during eval it fails to attribute some symbols to a correct ns
07:38kitallispeople with compojure-api experience:- how do I do middlewares post-schema validations for a bunch of routes (I can write a restructure-params macro but I'd have to repeat that in every route)?
07:39Bronsanoncom: if you nopaste the code you're using and a snippet that's using it that causes the error, I can try and help you
07:39agarmankitallis: try liberator or roll your own
07:40noncomBronsa: i will try to factor out a smaller code example now
07:41ikitommi_kitallis: does this help? https://github.com/metosin/compojure-api/blob/master/test/compojure/api/core_integration_test.clj#L132
07:42agarmanikitommi_ kitallis are you trying to remove description of validation and validation descriptions from your routes
07:42kitallisagarman, I want a more high-level middleware that isn't on the request, but instead post-params validations
07:42pandeirois (in-ns 'foo.bar) not supposed to load the foo.bar namespace?
07:43pandeiro(if not, what command am i looking for?)
07:43kitallisagarman, so req --> (run middlewares) --> extract params --> (validate) --> (run middleware) --> send response
07:45ikitommi_kitallis: was just experimenting context* -macro, which could setup shared metadata for all routes beneath + make the endpoints (GET* etc.) read the accumulated metada at runtime instead of statically generating codes. Would solve that too.
07:45Bronsanoncom: I have to go for a while now, you can send me a mail if you need it or I'll be back in a couple of hours
07:46agarmankitallis: we wrote something that works like that , but it needs some fixes
07:46agarmanincluding actual updated documentation: https://github.com/CareLogistics/somni
07:47agarmanand like I said liberator does that as well
07:47kitallismoving to liberator now isn't an option anymore
07:47kitallisone solution is I move all the schema validations as a part of this middleware and remove them from the routes
07:48kitallisikitommi_, I only vaguely understood that, would you have an example?
07:49ikitommi_kitallis: something ~https://github.com/metosin/compojure-api/blob/context-star/examples/src/examples/thingie.clj#L123
07:49noncomBronsa: sure! making a smaller example wont be easy, so itll take time
07:53ikitommi_kitallis: so one could either run the rules on the path/context (like pedestal interceptors) or one could add metadata on the route and they would accumulate on the endpoint.
08:05ikitommi_kitallis: but for now, can't figure an easy way to inject common code to multiple routes AFTER the validations. :middlewaress wrap the whole handler body so kicks in before the input validations. Open to suggestions.
08:11timvisheris anyone using s3 to manage their service artifacts for their deployments?
08:23ThomasDeutschhow can i partition a set by missing values? #{1 2 5 6} => ((1 2) (4 5))
08:24ThomasDeutschno, i mean ... like this #{1 2 5 6} => ((1 2) (5 6))
08:24mpenet,(doc partition-all)
08:25clojurebot"([n] [n coll] [n step coll]); Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end. Returns a stateful transducer when no collection is provided."
08:25mpenet(partition-all 2 [1 2 3 4 5])
08:25mpenet,(partition-all 2 [1 2 3 4 5])
08:25clojurebot((1 2) (3 4) (5))
08:25mpenetnevermind, I should read stuff before replying
08:27ThomasDeutschmaybe partitioning is not the best way to do it in this case?
08:28mpenetindeed
08:28noncomThomasDeutsch: i think that what you're trying to do is more mathematical than programming
08:29noncomThomasDeutsch: i would think of a math approach to this. for example, i would walk over the original set and coin the subsets that do not have breaks
08:30noncomThomasDeutsch: what is your real application? do you have a big set og ints and you must find gas in it?
08:31noncom*of
08:34ThomasDeutschin my application i can also calculate split points. in this case #{3}. so i think the best way will be to sort the set, and split it apart on every split-point
08:36mpenetyou could abuse clojure.set or just loop
08:37mpenet,(let [s #{1 2 3 4 7 9}] (clojure.set/difference (set (range (apply max s))) s))
08:37clojurebot#error{:cause "clojure.set", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassNotFoundException: clojure.set, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.ClassNotFoundException, :message "clojure.set", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLClassLoader$1 r...
08:37mpenethmm
08:37mpenet,(use 'clojure.set)
08:37clojurebotnil
08:37mpenet,(let [s #{1 2 3 4 7 9}] (difference (set (range (apply max s))) s))
08:37clojurebot#{0 6 5 8}
08:37mpenetbut no ordering/grouping here
08:39noncomThomasDeutsch: also, if you do something math-related, take a look at http://data-sorcery.org/
08:45hellofunkis there any reason to prefer one of these idioms over the other: (into [] (for [x (range 10)] x)) vs. (vec (for [x (range 10)] x))
08:46mpenetinto is a tiny bit faster currently i believe (depends maybe on the size of the seq)
08:46mpenetit uses transient under the hood, set I dont think so
08:46mpenetcould have changed recently tho
08:47hellofunksince the end result is the same, it's a curious notion
08:47hellofunkinto is just conj i think.
08:48hellofunkvec does a to-array
08:48mpenetah! http://dev.clojure.org/jira/browse/CLJ-1384
08:49mpenetwell vec != set
08:49mpenetso not sure
08:50mpenetmaybe it's the same after all
09:20jack0Hi!
09:20gfredericks~hello
09:21clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline gfredericks
09:21jack0Would someone help me out with unit testing?
09:21gfredericks~anyone
09:21clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
09:22jack0:)
09:27hellofunkand ~hello to you too
09:39kungiAnyone uses kerodon for web testing?
09:41jack0Unit testing? Anyone??!!
09:41kungijack0: yes
09:42Glenjaminkungi: i do, why?
09:43jack0kungi: Could you explain in detail how I must do it?
09:43kungiGlenjamin: Im am trying to get (follow) to work.
09:43kungijack0: sorry but this is just too broad a question.
09:44jack0Ok, I'll simplify
09:44Glenjaminkungi: what isn't working? if you use it after receiving a redirect it should just work
09:45kungiGlenjamin: I get this error:
09:45kungi java.lang.ClassCastException: clojure.lang.PersistentStructMap cannot be cast to java.lang.CharSequence
09:45kungiSomewhere in the trim function
09:47Glenjaminoh wow, that sounds quite broken
09:47kungiGlenjamin: yes it does
09:47Glenjaminif you add (doto prn) into the flow before the (follow), can you pastebin the output?
09:47kungiGlenjamin: It breaks is css-or-content
09:47kungiGlenjamin: sure
09:47Glenjaminsounds like you might have a dodgily formed response/header
09:50kungiGlenjamin: http://pastebin.com/NqsHkbDe
09:51kungiGlenjamin: Hmm the link is not present ... but it still should not break in this way
09:54kungiGlenjamin: Maybe it is because the link text looks like this in enlive?
09:54kungi{:tag :a, :attrs {:id "menu-item-alternate", :href "/configuration/alternate"}, :content ("Vertreter")}
09:54kungiMaybe not ...
09:55justin_smithhellofunk: definitely into would be faster, unless the argument is an array
09:56hellofunkjustin_smith: while it is an interesting clojure question, i'm actually using it in cljs, and dnolen suggested that in the JS world there was little difference between the two, fyi
09:56justin_smithhellofunk: aha! I did a window switch while composing my reply before, somehow
09:56justin_smithah, interesting
09:56dnolenhellofunk: the difference also doesn't matter enough to care in Clojure or ClojureScript
09:57dnolenhellofunk: the only time I would really spend any time to think about it would be performance situations where vec can adopt an array directly
09:57hellofunki'm using the line to process 16 million credit cards, so was curious which would go faster. just kidding.
09:58dnolenchoosing one or the other in idiomatic code isn't really worthy of discussion IMO
09:58dnolenhellofunk: not criticising your query, just pointing having a strong opinion about it doesn't make sense to me
09:59hellofunkdnolen: it's one of those odd syntantical questions that some like to discuss. i know amalloy has often found good reason to prefer one little convention over another, so i like to get the feedback
09:59Glenjaminkungi: can you include the kerodon code too?
09:59kungiGlenjamin: sure
10:00kungiGlenjamin: http://pastebin.com/fV7VdGkt
10:01Glenjaminhrm, so the :id doesn't exist
10:01Glenjaminthat should definitely give a better error
10:01Glenjaminwould you mind reporting as an issue on github?
10:06kungiGlenjamin: I can do that. Can you please explain to me what the error is exactly?
10:07Glenjaminit would appear that you get a bad error when trying to reach an element with a selector that doesn't match
10:08Glenjaminbut if you include the contents of those pastebins that'd be ace
10:14kungiGlenjamin: Yep I can do that. But that's not at the heart of the problem. I realized that I tried to access a link which does not exist and fixed this. Now the link exists on the page, but I get the same error. I created another pastebin including the state, the stacktrace and the actual kerodon code.
10:14kungihttp://pastebin.com/dzQQu5ts
10:15kungiGlenjamin: When I use the id of the Link it works fine.
10:25cnb_when using gen-class is it possible to define a method with a function/class as parameter
10:33justin_smithcnb_: like a method that has a clojure.lang.IFn arg?
10:33Glenjaminkungi: you should be able to work around by using a keyword as a css selector for the link
10:33Glenjamini'm not sure why this is broken though
10:36kungiGlenjamin: Ok thank you. I will file a bug report this evening
10:36kungiGlenjamin: thanks for looking into it
10:45cnb_what does # means I have this : foo [ this ^String #^{WebParam{:name "some"}}]
10:53andyfcnb_: #^ is older style syntax for what is now usually written as only ^. That is a prefix for metadata
10:54Bronsacnb_: the snippet you pasted doesn't make sense, though.
10:54andyfI don't recognize the way it is used in your example
10:58fredddandyf: I just pulled up the ant demo and swapped ^ in for #^ and it still works. Is there any reason to use #^ now instead of ^? Symbols are hard to Google.
10:59andyfNo reason to keep using #^
10:59justin_smithfreddd: http://clojure.org/reader and http://symbolhound.com/ is helpful sometimes too
11:01fredddandyf: Nice. Thanks.
11:01fredddjustin_smith: Thanks. symbolhound doesn't seem to be working right now, but I'll try again later.
11:03fortruceWhen using speclj, how can I bind symbols for several 'it' specifications?
11:03fortrucewrapping the 'it's in a let causes only the last one to actually be tested
11:04fortruceI could just wrap the underlying 'should's, but I want to be able to label my tests with descriptive strings
11:08fortruceAhh, if I wrap them in a context it works, duh
11:15Glenjaminfortruce: generally you'd use (with) inside a context
12:18lxsameerguys, I'm looking for a cool podcast about clojure , any suggestion ?
12:19justin_smithlxsameer: tbaldridge has some videos
12:21fortruce\u
12:22lxsameerjustin_smith: let me check them out
12:25lxsameerjustin_smith: do you have any url ?
12:25justin_smithhttps://tbaldridge.pivotshare.com/
12:27lxsameerthanks
12:34andyflxsameer: Cignitect's Cognicast podcast has many interesting Clojure-related discussions, but they explore other topics, too
12:35lxsameerandyf: cool thanks
13:28gfrederickswhat on earth is BigDecimal#plus() useful for
13:28gfredericks,(.plus 3.0M)
13:28clojurebot3.0M
13:29justin_smith,(.plus 3.0M 1.0M)
13:29clojurebot#error{:cause "java.math.BigDecimal cannot be cast to java.math.MathContext", :via [{:type java.lang.ClassCastException, :message "java.math.BigDecimal cannot be cast to java.math.MathContext", :at [sandbox$eval49 invoke "NO_SOURCE_FILE" -1]}], :trace [[sandbox$eval49 invoke "NO_SOURCE_FILE" -1] [clojure.lang.Compiler eval "Compiler.java" 6784] [clojure.lang.Compiler eval "Compiler.java" 6747] [cl...
13:29justin_smithahh!
13:29gfredericksthe docs just say "well we had .negate() so it seemed like we ought to have .plus()"
13:29justin_smith,(.plus -3.0M)
13:29clojurebot-3.0M
13:29justin_smithwat
13:29fortrucehaha
13:29gfredericksit's the identity, by definition
13:30Bronsa"This method, which simply returns this BigDecimal is included for symmetry with the unary minus method negate()."
13:30Bronsa:|
13:30justin_smith;D
13:30TimMcsuperb reasoning
13:30gfredericksit maks me cry a little bit on the inside
13:30justin_smithwe could totally do a loljvmapi blog
13:31TimMcjvmsadness
13:31gfredericks,(-> 42M .plus .plus .plus .plus .plus .plus)
13:31clojurebot42M
13:32gfredericksalso does anybody know if there's any functional difference between ##[42.0M 42.00M]
13:32lazybot⇒ [42.0M 42.00M]
13:32justin_smith,(.plus 0.99999999999999999999999999999999999999999999M java.math.MathContext/DECIMAL32)
13:32clojurebot1.000000M
13:33justin_smith,(.plus 0.99999999999999999999999999999999999999999999M java.math.MathContext/DECIMAL128)
13:33clojurebot1.000000000000000000000000000000000M
13:33justin_smith,(.plus 0.99999999999999999999999999999999999999999999M java.math.MathContext/UNLIMITED)
13:33clojurebot0.99999999999999999999999999999999999999999999M
13:34justin_smithso there's that
13:34gfredericksis there another method for doing that?
13:34justin_smithchecking...
13:35gfredericksI don't see one
13:35justin_smithwell, you could use .add 0.0 context
13:35justin_smithwhich may make more or less sense than .plus, dunno
13:35gfredericks,(.stripTrailingZeros 42.100000000)
13:35clojurebot#error{:cause "No matching field found: stripTrailingZeros for class java.lang.Double", :via [{:type java.lang.IllegalArgumentException, :message "No matching field found: stripTrailingZeros for class java.lang.Double", :at [clojure.lang.Reflector getInstanceField "Reflector.java" 271]}], :trace [[clojure.lang.Reflector getInstanceField "Reflector.java" 271] [clojure.lang.Reflector invokeNoArgInst...
13:35gfredericks,(.stripTrailingZeros 42.100000000M)
13:35clojurebot42.1M
13:36gfredericksoh wait
13:36pandeirois it possible to create a postgresql database from clojure code, outside of shelling out to `createdb` or something?
13:36gfredericks,(.round 0.99999999999999999999999999999999999999999999M java.math.MathContext/DECIMAL128)
13:36clojurebot1.000000000000000000000000000000000M
13:36gfredericksjustin_smith: ^ there it is with a much better name
13:37justin_smith,(.round 0.99999999999999999999999999999999999999999999M java.math.MathContext/UNLIMITED)
13:37clojurebot0.99999999999999999999999999999999999999999999M
13:37justin_smithoh yeah, that is a much better name
13:38justin_smithit's surrealist logic: round -> fat -> plus-size -> plus
13:39gfredericksone weird trick to make sense of the JVM std lib
13:39justin_smithhaha
13:39gfredericks1990's developers hate him
13:40vermapretty sure I've asked this before, but can I get some clojure stickers printed and give them out on the day of my clojure workshop?
13:40vermaI mean has anyone tried to do it and knows about any legal implications?
13:43gabrbeddHi guys, I'm working on a recursive function (using recur) and for some reason I keep smashing the stack.
13:43gabrbeddHow do you trace/debug/understand what's failing to do loop optimization?
13:43justin_smithgabrbedd: are you building up a lazy seq with many calls to concat?
13:44justin_smithgabrbedd: the recur itself won't consume stack, but you could be doing something that leads to stack usage (like nested concat calls, which are a classic case of that)
13:44gabrbeddjustin_smith: No, it's a fixed-length sequence where I iteratively transform the sequence.
13:44justin_smithcan you share a paste?
13:44hiredmanhttps://groups.google.com/forum/#!searchin/clojure/logo/clojure/_o-sHr_YIwo/7R1fOaVQVOMJ
13:45djames_I was hoping to find a (fail) function in clojure.test. I didn't see it.
13:45justin_smithdjames_: (is nil "I am failing on purpose here because ...")
13:45djames_justin_smith thanks
13:45gabrbeddjustin_smith: yeah, give me a sec to see if I can make a smaller example
13:47djames_,(it nil "FAIL")
13:48clojurebot#error{:cause "Unable to resolve symbol: it in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: it in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: it in this context", :at [clojure.lang...
13:48djames_,(is nil "FAIL")
13:48clojurebot#error{:cause "Unable to resolve symbol: is in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: is in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: is in this context", :at [clojure.lang...
13:48justin_smithdjames_: try referring clojure.test first, and is doesn't do much outside a deftest form
13:48djames_,(clojure.test/is nil "FAIL")
13:48clojurebot#error{:cause "clojure.test", :via [{:type java.lang.ClassNotFoundException, :message "clojure.test", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366] [java.net.URLClassLoader$1 run "URLClassLoader.java" 355] [java.security.AccessController doPrivileged "AccessController.java" -2] [java.net.URLClassLoader findClass "...
13:48justin_smith,(require '[clojure.test :refer [deftest is]])
13:48clojurebot#error{:cause "denied", :via [{:type java.lang.ExceptionInInitializerError, :message nil, :at [java.lang.Class forName0 "Class.java" -2]} {:type java.lang.SecurityException, :message "denied", :at [clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69]}], :trace [[clojurebot.sandbox$enable_security_manager$fn__835 invoke "sandbox.clj" 69] [clojurebot.sandbox.proxy$java.lang.Se...
13:48djames_no worries, just playing around
13:49justin_smithclojurebot seems not to like clojure.test
14:01gabrbeddjustin_smith: ok, here's a simpler test case http://pastebin.com/gbju6Mwi
14:01gabrbeddTrivial example (convert a sequence to all zeros)... but still.
14:02gabrbedd(count (recur-xform 1000)) => 1000
14:02gabrbedd(count (recur-xform 10000)) => smashed stack
14:04justin_smithgabrbedd: yeah, this is the same issue - it's unrealized lazy seqs stacked on top of unrealized lazy-seqs
14:05justin_smithtry forcing some of the lazy stuff with (doall (map ...)) instead of just (map ...) and your stack issues should disappear
14:05justin_smiththe stack is getting smashed after the looping, when in the process of realizing the result
14:06justin_smithgabrbedd: I had referred to nested concat in a loop because that is a common pattern for this to happen, but any lazy operation nested in a loop has the danger of doing this
14:07gabrbeddjustin_smith: thanks... yeah in the trivial example it was the map... in the /real/ example it appears to be a concat.
14:07justin_smithhaha :)
14:08gabrbeddjustin_smith: still... how do you debug this stuff? Is there a way to single-step through code or tracers or anythin?
14:08gabrbedd(e.g. in Haskell, they have a really nice built-in profiler)
14:08gabrbedd(...not that I expect Clojure to be Haskell... :-))
14:08justin_smithgabrbedd: the oracle jdk comes with jvisualvm, which is a decent profiler
14:08justin_smiththough it expresses everything in jvm terms, not clojure terms, which can be a bit confusing
14:09justin_smiththere is also yourkit, which is free for open source work
14:09justin_smithgabrbedd: also, the best debugging integration I know if is cursive, which is a clojure plugin for intellij idea ide
14:09gabrbeddjustin_smith: thanks (i'm new to the JVM world, too...)
14:11gabrbeddjustin_smith: thank you!
14:12justin_smithalso the stack traces you can get from thrown exceptions can be useful (even if you don't get it, someone who knows clojure's implementation better can probably decipher it)
14:12justin_smithdepending on your setup the stack trace may not print, but you can use (.printStackTrace *e) to see the trace for the last exception thrown in the repl
14:13gabrbeddOK, cool.
14:13justin_smithand the better you get to know clojure, the more useful the traces are.
14:25gfredericksoh another cool thing about the new #error printing is that stacktrace customization is probably, like, even easier, or something
14:27justin_smithgfredericks: you could probably like redefine the print method for that type or something?
14:28gfredericksI mean that's already possible
14:29gfredericksbut now it's trivial to reparse and rearrange
14:29justin_smithgfredericks: I thought the typical stack trace printing scenario wasn't a print method thing, it was an exception handler that happens to print
14:31gfredericksuuuhm
14:31gfrederickswell if you call .printStackTrace on something then you can't be helped
14:31gfredericksbut I'm thinking of repls and other tools and whatnot that now have a standard way to represent an exception as data
14:33justin_smithgfredericks: yeah. My available 1.6 repl doesn't return a value for an exception, it prints a message, *1 is not touched, but *e is set.
14:34gfredericksjustin_smith: I don't think that will change
14:34justin_smithand .printStackTrace prints to the stdout on the remote server rather than my local nrepl client
14:34justin_smithyeah, makes sense
14:34gfredericksnrepl probably returns it as a distinguished thing?
14:35justin_smithnot this nrepl
14:35gfredericksrather than just generic stderr prints? Not sure
14:35gfrederickswell you can't necessarily tell from the other side of the client
15:01thesaskwatchHi, I have a question regarding ring. I understand what are handlers and middlewares, but I don't understand why in the case of static resources ( https://github.com/ring-clojure/ring/wiki/Static-Resources ) a handler is needed. Any help?
15:06gfredericksthesaskwatch: it's not strictly needed, the library author just decided to structure static resources as a middleware instead of as a handler
15:06gfredericksyou can use a trivial handler, I think there's a not-found handler somewhere
15:07gfredericksor just (constantly {:status 404}) would probably work
15:07thesaskwatchgfredericks: Thanks, that makes sense.
15:07gfredericksI'm assuming you're trying to setup a static-only server of some sort
15:07seangroveI came across this in some code I'm working on, wondering if there's a way to add a reader for it (looks doubtful from https://github.com/clojure/tools.reader/blob/1908c673fc60873a5da688e6fc87f6b07b222963/src/main/clojure/clojure/tools/reader.clj#L616)
15:07seangrove,(read-string "[{:time #<DateTime 2015-03-06T00:00:51.888Z>}]")
15:07clojurebot#error{:cause "Unreadable form", :via [{:type java.lang.RuntimeException, :message "Unreadable form", :at [clojure.lang.Util runtimeException "Util.java" 221]}], :trace [[clojure.lang.Util runtimeException "Util.java" 221] [clojure.lang.LispReader$UnreadableReader invoke "LispReader.java" 1106] [clojure.lang.LispReader$DispatchReader invoke "LispReader.java" 616] [clojure.lang.LispReader readDelim...
15:08thesaskwatchgfredericks: Yes, I want to include clojurescript js file that way
15:08gfredericksseangrove: you'd want to change how it prints in the first place
15:20seangrovegfredericks: Yeah, I don't control the serialization side
15:20seangroveOwell, not a big deal
15:21gfredericksseangrove: who on earth is subjecting you to this
15:22Bronsaseangrove: in a hackish way, just alter-var-root `macros` and replace the dispatch for the unreadable reader
15:23gfredericks#protip
15:24gfredericksseangrove: the thing to be careful of is parsing #<> "correctly"
15:24gfredericksthings that aren't timestamps can also print as #<> and might throw off the parser
15:24gfredericks,(atom \>)
15:24clojurebot#<Atom@5bd7757a: \>>
15:24gfrederickslike so
15:24Bronsawait
15:24Bronsashouldn't that print with the new #object syntax
15:25gfredericksyeah what's the deal clojurebot
15:25Bronsaoh it does, it's just clojurebot
15:25gfrederickswat
15:25gfredericksdoes it special case reference types? why on earth?
15:25gfredericks,(prn (atom \>))
15:25clojurebot#<Atom@69983f60: \>>\n
15:25gfredericks,(Object.)
15:25clojurebot#object[java.lang.Object "java.lang.Object@4e737800"]
15:25Bronsa,(promise)
15:25clojurebot#<core$promise$reify__6695@28ed12da: :pending>
15:26Bronsagfredericks: ^
15:26BronsaIDerefs are handled specially so that they can print :pending/:done & the value they hold
15:26amalloyderefables have print-methods, yeah
15:26gfredericksBronsa: but rhickey updated that
15:26gfredericksBronsa: amalloy: https://github.com/clojure/clojure/commit/e03d787720a16fae37a2ec9afb3859a15e67b976
15:27Bronsagfredericks: ah yeah but it looks like clojurebot is still to the previous commit
15:27gfredericksclojurebot: I thought you were always bleeding
15:27clojurebotCool story bro.
15:27gfredericksanyhow my original point to seangrove still applies
15:27gfrederickshey seangrove just convince whoever is emitting these to upgrade to clojure/master :P
15:29gfredericks,(java.util.Date.)
15:29clojurebot#inst "2015-03-17T19:29:02.024-00:00"
15:29gfredericksurhm
15:29gfredericks,(java.sql.Date.)
15:29clojurebot#error{:cause "No matching ctor found for class java.sql.Date", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.IllegalArgumentException: No matching ctor found for class java.sql.Date, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6732]} {:type java.lang.IllegalArgumentException, :message "No matching ctor found for class java.sql...
15:29gfredericks,(java.sql.Date. 383)
15:29clojurebot#inst "1970-01-01T00:00:00.383-00:00"
15:29arrdem,*ns*
15:29clojureboteval service is offline
15:29gfrederickswhatever nevermind ugh
15:30Bronsa&(java.util.Date.)
15:30lazybot⇒ #inst "2015-03-17T19:29:56.393-00:00"
15:30gfredericks,clj-time.core/now
15:30clojurebot#error{:cause "clj-time.core", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.ClassNotFoundException: clj-time.core, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.ClassNotFoundException, :message "clj-time.core", :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}], :trace [[java.net.URLClassLoader$...
15:30gfredericks&clj-time.core/now
15:30lazybot⇒ #<core$now clj_time.core$now@2d6eed3f>
15:30gfredericks&(clj-time.core/now)
15:30lazybot⇒ #<DateTime 2015-03-17T19:30:26.158Z>
15:31gfrederickswell that doesn't matter though cause I wanted to see that with the new code
15:47lvhI have a function that wraps a Java API. One of the args is annotated #^Group, Group being a Java class. For testing, I want to create a fake Group that won't confuse Clojure.
15:52lvhWhat do I use for that? I've used reify before, but there's no Interface or Protocol to adhere to. From what I understand how it works, #^Group means that things you pass to it should be instances of Group, right?
15:52lvhSo, do I do deftype and override all the methods?
15:55gfrederickslvh: you can try proxy
15:55gfrederickslvh: is the #^Group annotation yours?
15:55gfredericksis there not an interface you could put there instead?
15:58borkdudeis there a way to get an over view of 'dead' code in your clojure project?
16:01gfredericksborkdude: expressions or functions?
16:01borkdudegfredericks functions would be good enough
16:01gfredericksborkdude: you could try running clj-usage-graph and scrutinizing the output
16:01gfredericksor adapting that code for the purpose
16:02gfredericksI wouldn't be surprised if there were something else that already existed though
16:04borkdudegfredericks thanks
16:07kungiGlenjamin: I created a bug report for kerodon: https://github.com/xeqi/kerodon/issues/32
16:11gfredericksoh man clojure.math.numeric-tower/sqrt
16:11gfrederickswith bigdecimal
16:12gfredericksstays in bigdecimal if there's an exact answer and drops down to double otherwise
16:12paulswilliamsesqdnolen hi, what's the best channel for a query / feedback on the cljs quick start? Don't want to disturb ;-)
16:12dnolenpaulswilliamsesq: #clojurescript
16:22fredddCan an atom not be changed if its associated watch has not completed?
16:23Wayneswhich is the most appropriate channel for ring.middleware.flash questions?
16:23paulswilliamsesqdnolen cheers
16:27patrickgombert freddd: atoms notify watches after running a CAS
16:27WaynesI'm trying to use ring.middleware.flash/wrap-flash, but (get request :flash) is always nil http://pastebin.com/raw.php?i=axDw6dvd
16:27patrickgombertor just a set in the case of rest!
16:28patrickgombertreset!*
16:28lvhgfredericks: Yes, the #^Group annotation is mine, but there's no Group interface defined yet. Unless I misremember how Java works, I don't think I can define it myself and then define Group and MyFakeTestingGroup to be IGroups, right?
16:29lvhgfredericks: Proxy looks like what I want; thanks!
16:31gfrederickslvh: correct, if the lib isn't designed around interfaces then you end up pretty constrained
16:33ordnungswidrigwaynes: what do you expect?
16:34Waynesordnungswidrig: (= (get request :flash) "WORK, GODDAMNIT")
16:34ordnungswidrigwaynes: I think you need wrap-session for flash to work...
16:35ordnungswidrigshould work better than shouting curses.
16:35Waynesstill does not work
16:36Waynessorry, for the curses, I have tried for quite a while and I'm running weechat-curses which totally screwed itself up after I accidentally pressed the wrong key and it took a while to fix it
16:36ordnungswidrigIn the repl, when you invoke (handler {:uri "/" :request-method :get}) what does it return?
16:39Waynesordnungswidrig: repl freezes while starting atm, I'll see what's up with that, brb
16:48Waynesordnungswidrig: apparently I shouldn't write ":main foo.core/-main" in project.clj or "lein repl" will freeze, anyway, it gives "{:session {:_flash "WORK, GODDAMNIT!"}, :flash "WORK, GODDAMNIT!", :status 200, :headers {}, :body "{:params {}, :route-params {}, :session/key nil, :cookies {}, :flash nil, :session {}, :uri \"/\", :request-method :get}"}"
16:50ordnungswidrigThat's without wrap-session, right?
16:50lxsameerguys, I want to read some easy to understand clojure code as a practice , any suggestion what to read?
16:50justin_smithlxsameer: one possibility is doing 4clojure and looking at other people's answers
16:50arrdemwhat are you interested in? what are you trying to do?
16:51lxsameerarrdem: I'm trying to learn clojure as way it meant to be learned
16:51Waynesordnungswidrig: that's with wrap-session, but the only difference is :session/key nil
16:51lxsameerjustin_smith: 4clojure ?
16:52arrdemhttp://4clojure.org
16:52justin_smithhttp://www.4clojure.com/
16:52arrdemhttps://github.com/arrdem/batbridge
16:52arrdemit's a collection of small(ish) programs with blog posts.. could be something useful to you.
16:52arrdemaphyr has some good "intro to Clojure with code" posts too..
16:53Waynesordnungswidrig: I could just put all the stuff in :session, that seems to work
16:53lxsameercool thanks
16:54arrdemtop post to go with the batbridge project, http://arrdem.com/2014/01/10/Batbridge/
16:55arrdeme talking about the mechanics of the simulator to be worthwhile for you
16:55arrdemsorry.
16:55arrdemblarg C-u lxsameer ignore my posts, not enough clojure density.
16:56lxsameerarrdem: I confused man
16:56justin_smitharrdem: you should write more blog posts about Clojure
16:56arrdemjustin_smith: I should pass my classes
16:56arrdemlxsameer: ignore my posts they aren't beginner level enough sorry.
16:56lxsameerarrdem: thanks anyway
16:56arrdemlxsameer: they assume you know clojure and teach computer architecture rather than teaching clojure worth a darn.
17:01gabrbeddI sometimes get runtime errors when variables bind to unexpected types. What strategies do you guys use to manage that?
17:02arrdemgabrbedd: core.typed, prismatic/schema, aggressive use of assertions and preconditions are all strategies I've seen.
17:03arrdemgabrbedd: of late I've been doing pre/post conditions and type predicate assertions. It works reasonably well.
17:03justin_smithgabrbedd: it is also possible to attach validators to vars
17:03justin_smithunless by variables you mean arguments to functions
17:03justin_smiththen yeah, pre is good for that
17:04justin_smithor prismatic/schema
17:04arrdemjustin_smith: I think he's talking about let-bound symbols.
17:04arrdemor other locals.
17:04justin_smithright, right
17:04justin_smith,(def foo 1)
17:04gabrbeddActually, I mean all of them... but I think the ones I hit today were arguments to functions.
17:04clojurebot#'sandbox/foo
17:05justin_smith,(set-validator #'foo number?)
17:05clojurebot#error{:cause "Unable to resolve symbol: set-validator in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: set-validator in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6535]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: set-validator in...
17:05justin_smith,(set-validator! #'foo number?)
17:05clojurebotnil
17:05justin_smith,(def foo nil)
17:05clojurebot#error{:cause "Invalid reference state", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.IllegalStateException: Invalid reference state, compiling:(NO_SOURCE_FILE:0:0)", :at [clojure.lang.Compiler$DefExpr eval "Compiler.java" 452]} {:type java.lang.IllegalStateException, :message "Invalid reference state", :at [clojure.lang.ARef validate "ARef.java" 33]}], :trace [[clojur...
17:05justin_smith,foo
17:05clojurebot1
17:05gabrbeddjustin_smith: arrdem: Thanks.
17:05arrdemhttp://conj.io/store/v0/org.clojure/clojure/1.7.0-alpha4/clj/clojure.core/set-validator!/
17:05justin_smith,(def foo 5)
17:05clojurebot#'sandbox/foo
17:05arrdem##clojure.core/even?
17:06gabrbeddI usually used statically typed languages... so I'm trying to find my way. :-)
17:06justin_smitharrdem: ## only works with () bounded things
17:06Waynes,(prn "neat")
17:06clojurebot"neat"\n
17:06arrdem##(print clojure.core/even?)
17:06lazybot⇒ #<core$even_QMARK_ clojure.core$even_QMARK_@2e89de1c>nil
17:07gfredericksI used it with ##[] earlier
17:07lazybot⇒ []
17:07gfredericksI bet also ##{}
17:07lazybot⇒ {}
17:07gfrederickswhat about ###{}
17:07lazybot⇒ #{}
17:07gfredericksor ###'first
17:07lazybot⇒ #'clojure.core/first
17:07amalloygfredericks: anything that reads as a collection
17:08justin_smithgfredericks: oh, weird
17:08gfredericksokay so not ##"this"
17:08gfredericksnor ###"this"
17:08Waynes["test"]
17:08amalloyto prevent incidents when people talk about irc channels like ##java
17:08gfredericksthat would be a disaster
17:08Waynes##(print "test")
17:08lazybot⇒ testnil
17:08justin_smithbut ###'future-cancel works
17:08lazybot⇒ #'clojure.core/future-cancel
17:08amalloyjustin_smith: that reads as (var future-cancel), of course
17:08ordnungswidrigwaynes: wrap-session should add a session cookie to the response when working correctly
17:08justin_smithamalloy: of course
17:09justin_smith(doc future-cancel)
17:09clojurebot"([f]); Cancels the future, if possible."
17:09justin_smithmy favorite doc string
17:09justin_smithpoetry
17:09Waynesordnungswidrig: yeah, wrap-session works, but :flash stays nil
17:10whodidthiswhats a fun way to combine a pair of keywords like :page/one :load into :page.one/load
17:11justin_smithwhat's with the adjectives all the time anyway
17:12amalloywhodidthis: it sounds like a bad thing to do
17:13whodidthisalrite, ill do without hehe
17:13ordnungswidrigwaynes: there was no session cookie in the above example you pasted
17:13justin_smithwhodidthis: this works ##(assoc {} [:page :one :load] 42)
17:13lazybot⇒ {[:page :one :load] 42}
17:14Waynesordnungswidrig: ok, I got it working by wrapping it in a compojure.handler/site instead of ring.middleware.flash/wrap-flash :)
17:14amalloyalso, you probably really want 1, not :one
17:14justin_smithamalloy: perhaps it's a site themed on various U2 albums
17:14amalloybut then strings, not keywords
17:14justin_smithheh
17:15ordnungswidrigwaynes: I think you might had the order of wrap-flash and wrap-session wrong, site contains both in a sensible order
17:15ordnungswidrigwanyes: additionall side note: compojure.handler is deprecated
17:17Waynesordnungswidrig: ah yes, that did it, wrap-flash has to come before wrap-session
17:17ordnungswidrigWaynes: using ring-defaults might be a good idea anyways
17:18Waynesordnungswidrig: I tried that, but then firefox would only want to download the website instead of displaying it
17:18justin_smithWaynes: that's a sign that {:headers {:content-type ...}} was not set up properly
17:19whodidthiso yea why did i think of matching against just keywords, vectors be fine
17:19Waynesjustin_smith: I guessed so, too, but I didn't guess the correct setup
17:25pandeiroordnungswidrig: should liberator + ring-defaults' site-defaults have sessions working out of the box? i'm trying to attach :session inside a defresource and i can't get it to stick
17:33pandeirook i just needed (liberator.representation/ring-response (update-in resp [:body] pr-str)) to do what i meant
18:33TravistyDoes technomancy still hang out here?
18:35amalloyTravisty: i haven't seen him for a while. he might be on vacation or something? he hasn't been active in #leiningen either
18:36TravistyShucks. I wanted to tell him that he’s on the front page of hacker news right now! https://news.ycombinator.com/
18:38ambrosebsI thought he was taking a break from computers
18:38AeroNotixTravisty: I doubt it's the first time for him
18:38ambrosebsor he was moving or something
18:38arrdemamalloy: he moved to singapore
18:38ambrosebsah
18:38Travistyah, well, I was excited :P
18:39arrdemas part of this he seems to have stepped back from all the f/oss stuff besides lurking #emacs
18:39raekI lives in Thailand now
18:39raek*he
18:39arrdemI was close :P
18:39ambrosebsI'm not sure if being on HN is cause for celebration ;)
18:39raekhttp://technomancy.us/177
18:39Travistyheh, how come?
18:39amalloyi don't get how living in thailand or singapore or whatever is relevant. it's the internet
18:39ambrosebsif anyone sees him, warn him about the trolls coming his way :)
18:40arrdem^
18:40arrdemthe last article of mine to make HN frontpage just got trolled.
18:40ambrosebsyea sorry to hear
18:40arrdemthe traffic was nice when Grimoire made it, but none of them stuck around as users.
18:41arrdemambrosebs: you gonna make it to clj/west?
18:41ambrosebsarrdem: nope. conferenced out
18:41ambrosebsafter going to india for POPL
18:41Travistyarrdem: Have you had mulitple first page articles? :O
18:41arrdemlaem. fair enough.
18:41TravistyI think I saw one a few months back, when I spent more time here
18:42arrdemTravisty: I think other people have made front page with my work three times now
18:42Travistyheh
18:45hiredmanambrosebs: timezones are a thing still, they effect irc a lot
18:45hiredmaner
18:45hiredmanamalloy:
19:27mdeboardarrdem: Why the (apparent?) evasiveness about Grimoire in http://arrdem.com/2015/01/27/ox:_some_motivation/
19:28mdeboardAlso conj.io is a dead link now I guess
19:28arrdemmdeboard: site's still up...
19:28arrdemmdeboard: which link?
19:28mdeboardOh
19:29arrdem"htttp"
19:29arrdemlol I did that
19:29mdeboardThe 3rd bullet point in that--
19:29mdeboardyeah
19:30arrdemfixed thanks
19:30mdeboardSorry, combined with the "I will say no more on the matter" and the "dead" link I thought you got sued or something :P
19:31arrdemI mean... it's like arguing the contribution process. I have a philisophical difference with Core and it's not useful to anyone to beat on it.
19:31mdeboardAh I see
19:31arrdemit just creates unproductive drama
19:31mdeboardA political ballyhoo
19:31arrdemright.
19:32arrdemI'd be happy to write about that stuff if you're interested, I just didn't think it's worth my time.
19:33mdeboardI'm sure it's as boring to an outsider like me as it is irritating to insiders on both sides
19:33arrdem"insider" lol
19:34mdeboard:)
19:36hyPiRionJust to be sure: When you compile a namespace, its dependencies also have to be compiled, yes?
19:36arrdemhyPiRion: yes AFAIK
19:37amalloyhyPiRion: yes
19:38hyPiRionamalloy, arrdem: Thanks for confirming
19:44danlentzgood afternoon, clojurians. I just promoted clj-uuid 0.1.5 which is documentation and feature complete now. It is a library for efficient UUID generation and a fairly comprehensive implementation of RFC4122.
19:45danlentzPlease have a look, if it is of interest: http://danlentz.github.io/clj-uuid
19:46mdeboardis tree-shaking a recently coined phrase ? or recently re-discovered from computing antiquity?
19:46mdeboardI have trouble finding any references to it that don't involve JS, Dart or Clojure
19:46danlentzcommon lisp uses the term frequently
19:47mdeboardI see
19:47danlentzwell, some implementations. the ones that have the capability to compile reduced-functionality binaries like lispworks i believe
19:48danlentzI saw an experimental one for an old version of SBCL but i dont remember where.
19:49eprogramminghi all
19:49eprogrammingcan't import BufferedImage...
19:49eprogrammingdon't know why any help would be really good
19:49eprogrammingthanks
19:50eprogramming...Unable to resolve classname: BufferedImage..
19:50danlentzmdeboard: https://gist.github.com/danlentz/4778188019707b21aa16
19:50danlentzthere is a tree shaker from 1989
19:51hyPiRioneprogramming: (import 'java.awt.image.BufferedImage) or (:import java.awt.image.BufferedImage) in the ns declaration
19:51mdeboarddanlentz: nice
19:51eprogramminghyPiRion: thanks i will do this now to try !
19:52hyPiRionnp
19:55danlentzmdeboard: of course more modern tree-shakers are generally implemented with a Taylor Swift backing track.
19:55eprogramminghyPiRion: now getting: 'No matching ctor found for class java.awt.image.BufferedImage'
19:56amalloyeprogramming: that means your import worked but you're using it wrong
19:57eprogrammingamalloy: got it ! doing this: (let [space (BufferedImage.)])
19:57eprogrammingctor 'constructor' right ?
19:57amalloy$javadoc java.awt.image.BufferedImage
19:57lazybothttp://docs.oracle.com/javase/6/docs/api/java/awt/image/BufferedImage.html
19:57amalloyyes
19:57eprogrammingthx
19:57amalloynote that there is no 0-arg constructor
19:58eprogrammingyup ! sorry i'm just really noob on clojure
19:58eprogrammingtrying to migrate a small game to clojure
19:58eprogrammingthnks a lot amalloy hyPiRion
19:59mdeboarddanlentz: I wasn't aware Apple had forked Swift into different versions
19:59mdeboardregular Swift and Taylor Swift? Or are there more variants
19:59mdeboard-.-
20:00danlentzheh :)
20:03hyPiRionmdeboard: the Swift on Security variant
20:05SeyleriusWhat's with the - prefix before some functions in Clojure? Like (-main)?
20:06eprogramminghyPiRion: amalloy i have another one ;)
20:06eprogrammingmy project is called dinga_invaders
20:07eprogrammingunderline on namespace
20:07ambrosebsSeylerius: I believe -init and -main are special if you use gen-class
20:07eprogrammingi saw unit tests doing test_clojure for directory and test-clojure
20:07eprogrammingfor ns
20:07Seyleriusambrosebs: gen-class?
20:07eprogrammingweird because here works only if i declare ns with underline
20:07ambrosebsSeylerius: almost guaranteed you don't need to know
20:07gratimaxeprogramming: that's a feature
20:08gratimaxthe jvm can't handle - in package names afaik
20:08eprogramminggratimax: really ?
20:08eprogramminggratimax: ok np but is good to have some of this on main docs agree ?
20:08gratimaxhttp://stackoverflow.com/questions/4420944/why-does-clojure-convert-dashes-in-names-to-underscores-in-the-filesystem
20:09gratimaxwell honestly it's hidden behind a 5-keyword google search...
20:09eprogramminggratimax: tks will look
20:09eprogramminggratimax: i part of a group to try not use google by the way
20:09eprogrammingto do feedback about main docs
20:09eprogrammingbut thanks i will take a look
20:09gratimaxok. it's hidden behind a 5-keyword duckduckgo search
20:10gratimaxoh I see :P
20:10eprogramminghaha gratimax not like dr. stallman
20:10eprogrammingno he is great person reply my emails 2013 a lot but
20:10eprogrammingthis not the point
20:10eprogrammingthe point is get the doc and vim and try to do something
20:11eprogrammingi'm on 5 days only in clojure and learning a lot using this technique ( sorry my english )
20:12eprogrammingbtw gratimax thanks for this
20:14Seyleriusambrosebs: Short version is that it uses the "-" prefix to identify things that the JVM will care about in the resulting class? Like main, init, and so on?
20:14amalloySeylerius: yes
20:14amalloyspecifically methods
20:14SeyleriusShiny. Useful to know about.
20:14SeyleriusBut not particularly necessary _right_now_.
20:15SeyleriusGlad I looked it up in more detail, though.
20:15SeyleriusI'll probably want to know about this later.
20:15gratimaxeprogramming: I looked around a bit and turns out an explanation is in the docs http://dev.clojure.org/display/doc/FAQ
20:16gratimaxwell it's an FAQ... idk if you consider that "main docs"
20:16eprogramminggratimax: this is great !
20:16gfredericksanybody know what the weird doublebooked slots are in the clojurewest schedule?
20:16amalloygfredericks: link?
20:17eprogramminggratimax: yes going to take a look on this
20:17gfredericksamalloy: clojurewest.org
20:17gratimaxactually it's even mentioned twice in the main documentation, here http://clojure.org/libs
20:17gfredericksamalloy: in three different slots it has two talks inexplicably in one room opposite nothing
20:17gratimaxunder example lib, "note the translations from period to slash and hyphen to underscore"
20:18amalloyi only see two, but okay
20:18gfredericksas if six different talks all ended up being crammable into a halfslot
20:18amalloyoh, three
20:20eprogramminggratimax: thanks a lot
20:20eprogramming'So a "_" in a namespace "folder name/file name" has to correspond to a "-" in the namespace name.'
20:20eprogramminghttp://dev.clojure.org/display/doc/FAQ as you shared