#clojure logs

2014-11-14

02:35cosmicexplorertest
02:35TEttingermic check, 1, 2
02:36cosmicexplorerwe're good to go
02:36TEttingerwelcome to clojure, here's some bots. ##["lazybot"]
02:36lazybot⇒ ["lazybot"]
02:36TEttinger,"clojurebot"
02:36clojurebot"clojurebot"
02:56godd2"redbot, standing by"
03:06amalloyneat, i didn't know that M-q takes a prefix argument to justify the text
04:04engblomWhere should I look if I want to make simple clickable 2D graphics with Clojure for Android mobile devices?
04:04engblomA nice sample project to look at would be nice and of course some reference material to check up things.
04:14sm0kewell said justin_smith
04:23m00nlightWhen I use some clojure code in an java project using storm, it seems conflict of clojure.core/some? with backtype.storm/some?, does anyone have sollutions?
04:24Glenjaminm00nlight: see the example on https://clojuredocs.org/clojure.core/refer-clojure
04:27m00nlightGlenjamin: Thanks, I will have a try right now
04:27sm0kem00nlight: you will still get that warning
04:27sm0keunless you are willing to compile and edit storm code
04:29TEttingerengblom: I know libgdx works on android, and play-clj is a wonderful clojure binding to that library, but I don't know how well clojure in general runs on android
04:34TEttinger$google play-clj
04:34lazybot[oakes/play-clj · GitHub] https://github.com/oakes/play-clj
04:34TEttinger^ engblom
04:35m00nlightsm0ke : but in fact it cause a exception
04:35TEttinger"The mobile support is currently experimental, and may have poor performance or even fail to run on some devices." That mainly refers to iOS, which has been trouble to perform well on even for the main lib in java
04:35m00nlightsm0ke:
04:35m00nlightjava.lang.IllegalStateException: Attempting to call unbound fn: #'backtype.storm.util/some?
04:35m00nlightat clojure.lang.Var$Unbound.throwArity(Var.java:43) ~[clojure-1.6.0.jar:na]
04:36sm0ke,(doc some?)
04:36clojurebot"([x]); Returns true if x is not nil, false otherwise."
04:37m00nlightsm0ke: I already exclude the some? in core
04:37m00nlight(doc some?)
04:37clojurebot"([x]); Returns true if x is not nil, false otherwise."
04:37m00nlightnil
04:38TEttingerdid you then include backtype.storm ?
04:38TEttingerI guess the word is require or use
04:38sm0keah nice catch TEttinger
04:38sm0kem00nlight: what are you trying to do?
04:39m00nlightVery simple code implement in clojure for some other Java program to use in storm
04:39TEttingerm00nlight, do you want to call storm's some? or your own some?
04:39sm0kerun storm of clojure 1.6 is not possible unless storm updates it
04:39TEttingeror clojure's some? i mean
04:39m00nlightTEttinger: So I need to use an old version of clojure?
04:40TEttinger1.5 isn't that old, actually...
04:40TEttingersm0ke, do you think 1.5 will work?
04:40sm0keyes
04:41sm0kestorm has updated to 1.5
04:41m00nlightsm0ke: OK. Thanks, I will try to use clojure 1.5 instead
04:49m00nlightsm0ke: TEttinger: Glenjamin: Thanks very much, problem solved :)
04:49TEttingerwoo
04:49TEttinger(inc sm0ke)
04:49lazybot⇒ 7
04:51sm0kestorm is notorius with respect to clojure compatibility
04:52mnngfltgVim users rejoice! I've created an "alternate star": https://www.refheap.com/93358
04:53mnngfltgSo you can move your cursor over a namespace and hit `_` to cycle through all uses of that namespace in your code.
04:53sm0keand i am not sure where if that code style does any good
04:54TEttingeris that vimscript, mnngfltg?
04:54mnngfltgtettinger yes I think :)
04:55TEttingerthat's _ in non-insert mode, right? :)
05:09whodidthis_how does one eval just a single line or symbol in fireplace
05:11mnngfltgTettinger, right
05:12mnngfltgwhodidthis_, a single form (the one under the cursor): `cpp`
05:13whodidthis_what if i just want to see what is up in a symbol without writing (println mythingie)
05:15engblomTEttinger: Thanks!
05:15whodidthis_return contents of mythingie without writing println around it i mean
05:16engblomI thought (or ...) was always taking the arguments in order.
05:26engblom(first vector) will give the first element rather than using (nth 0 vector). Is there a similar thing for changing the first element rather than using (assoc vector 0 value) ?
05:28sm0ke,(cons 0 (rest [1 2 3]))
05:28clojurebot(0 2 3)
05:29engblomsm0ke: the same long as (assoc [1 2 3] 0 0)
05:29engblom,(assoc [1 2 3] 0 0)
05:29clojurebot[0 2 3]
05:30sm0keengblom: thats pretty short imo
05:30engblomMaybe there is not a ready function for changing the first element and this is how it is done normally
05:31engblom,(nth [1 2 3] 0)
05:31clojurebot1
05:31engblom,(first [1 2 3])
05:31clojurebot1
05:32engblomWhat I meant is that in the same way as (first ...) is more elegant than (nth ...) for getting the first element, I was wondering if there is more elegant ways for changing the first rather than refering with an index.
05:34hyPiRionengblom: no, but if you use the list/vector as a stack, you can use pop, conj and peek
05:35hyPiRion,(conj 0 (pop (list 1 2 3)))
05:35clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IPersistentCollection>
05:35hyPiRion,(conj (pop (list 1 2 3)) 0)
05:35clojurebot(0 2 3)
06:25dysfunhrm, is there something in ring.middleware.session i've missed for setting how long the cookie will be valid? i see the cookie options but those don't appear to take functions, in which case how can i provide a DateTime (which it requires for Expires:) when it's a middleware?
06:26dysfuni'm using the cookie store
07:21dysfunis there an idiomatic way to rethrow an exception, adding extra information?
07:22dysfunpreferably one that might reasonably be understood by timbre so there's helpful information in the logs
07:24clgvdysfun: only the java way. you can wrap the exception in a new one and throw that one or just throw the current exception
07:24hyPiRionyou can bounce with ex-info tricks. Lemme make a macro/function for that
07:25dysfun:)
07:32hyPiRiondysfun: https://www.refheap.com/93366
07:32hyPiRionNot sure how that works with timbre, but you can add data to the exception like this
07:34hyPiRionactually, this is a bit better: https://www.refheap.com/93367
07:34dysfunhrm, i'm not guaranteed to be getting an ExceptionInfo though. I'd like to catch Exception more generally and then turn that into an ExceptionInfo
07:34hyPiRionmultiple clauses.
07:34hyPiRionOh.
07:35hyPiRionWell, you can add another catch for Exception afterwards, and let the map be an empty one
07:36hyPiRionThere, I updated it to do just that. Same link as latest
07:36dysfunI suppose in those cases, I can just create a new one, putting the original exception in the map of info. It's not ideal, but i can postprocess it
07:37dysfunhrm, the colour scheme on refheap is quite nice on the eyes
07:38dysfunhyPiRion: thanks for the help
07:38hyPiRiondysfun: no problem, hope it's useful for you
07:39dysfun:)
07:48dysfunhyPiRion: also why is it that so often the problem that makes people understand why macros are special involves exceptions? Are they really more tedious in most languages? I've never thought so.
07:48dysfunwell, no more than other things
07:52hyPiRiondysfun: Well, most things macros are used for is control flow related. Either through looping (dotimes, doseq) or exceptions. Most other things can just be solved by functions
07:53dysfunyeah. i find the lack of first class anonymous functions and closures to be much more annoying
07:56hyPiRionI feel that persistent data structures and functional programming matters more, but I suppose that's because most of the useful macros are already included in Clojure
07:58dysfunyes, i'm liking them both a lot. i found it very hard to program an imperative language recently after about 6 months of almost full time clojure
07:58dysfuna lot of my imperative code has smelled functional for years though
07:58dysfun(damn you, elisp!)
07:59hyPiRionhah – for me it was a lot harder to transition. Took a lot of time to unlearn mutable data structures.
08:02dysfunyes, i admit i struggled with that at first
08:02dysfunbut i've come to prefer it
08:03dysfunbut i used to program a lot of perl, which has map and grep built in
08:03hyPiRionme too – much easier to work with after the struggle was over
08:53sveriHi, anyone here using clara (rule system) and knows how to generate rules on the fly?
09:07sveriOr can I somehow create namespaces on the fly in clj / cljs and add rules and whatever to it to evaluate it in memory then?
09:12hyPiRionsveri: yeah, you can create namespaces on the fly in clj. Not sure how clara works, but I wouldn't be surprised if you could make "anonymous" rules on the fly.
09:15sverihyPiRion: thanks, something more to read about :-)
09:54zand`Anyone using the debugger in cursive clojure? I can't seem to get it to stop at a breakpoint in a very simple test.. :-/
10:04gfredericks,'ping
10:04clojurebotping
10:17justin_smith$ping
10:17lazybotjustin_smith: Ping completed in 0 seconds.
10:25gfredericks~ping
10:25clojurebotPONG!
10:41puredangeridle Friday question - one change as a side effect of proposed changes in http://dev.clojure.org/jira/browse/CLJ-1546 is that vec would no longer guarantee a new vector instance. If passed a vector, it would simply return it. I imagine that 99.9???% of users would benefit from this change in meaning (by saving 100+ ns every time this is done).
10:42puredangerDoes anyone know of a case where a library actually relies on this "new vector instance" behavior? it would have to be something where identity is important (not just equality)
10:42justin_smithpuredanger: going on intuition alone, I would have naively assumed vec already did that
10:42puredangerhttp://crossclj.info/fun/clojure.core/vec.html might jog your memory
10:42justin_smith(inc crossclj)
10:42lazybot⇒ 3
10:42puredangerjustin_smith: agreed. I'm looking for the odd duck here.
10:42puredanger(inc crossclj)
10:42lazybot⇒ 4
10:42puredangerfor sure
10:42puredangerI have been regularly using it to answer questions like this
10:44vermais this also the place for clojure-clr? or is there a dedicate channel for it?
10:44justin_smithhmm - I'll add a crossclj lookup plugin to my "lazybot nice to have" list - seems it would be straightforward to do
10:44puredangerverma: questions welcome here, not sure if there is a separate channel
10:44EvanRpuredanger: if anyone is relying on something like that, they deserve to get broke by this ;)
10:45vermapuredanger, sure thanks :)
10:45justin_smithEvanR: well the docs did explicitly say it would always make a new vec
10:45puredangerEvanR: I somewhat sympathize with this. I think Rich is on board with that too.
10:45EvanRthe ideal of referential transparency and all
10:45puredangerjustin_smith: the docs will change
10:45EvanRjustin_smith: yurg
10:46justin_smithpuredanger: right, just my 2¢ regarding "anyone who expected it deserves breakage"
10:46puredangerthis is definitely a semantic (potentially breaking) change in behavior, but one that I think is extremely subtle
10:47stuartsierraI would be surprised if it broke anything.
10:48puredangeragreed, just trying to uncover that surprise early :)
10:49puredangerI've looked through many usages found in crossclj and I have a hard time finding anything that relies on this "new" behavior
10:50Bronsa(inc crossclj)
10:50lazybot⇒ 5
10:51kungi(inc crossclj)
10:51lazybot⇒ 6
10:55EvanRwhoever decided that and then decided it needed to be documented as such also deserves breakage
10:55EvanRcreative destruction
10:57puredangerone possible use case for old behavior would be to ensure the removal of meta
10:57puredanger,(meta (vec (with-meta [1 2] {:foo "foo"})))
10:57clojurebotnil
10:57EvanRwhat is meta :(
10:58TimMcyuck
10:58puredangermetadata
10:58EvanRvery powerful
10:58EvanRis metadata mutable?
10:58TimMcEvanR: with-meta attaches metadata to certain Clojure objects (gives you back a new object); meta retrieves it.
10:59puredangercollections generally retain meta through collection functions
10:59puredangersequence functions generally do not retain meta
10:59puredanger(since they convert the coll to a seq)
11:00TimMcEvanR: When you see something like ^{:foo :bar}, that's attaching metadata to the next form for the benefit of the compiler.
11:00edwSpeaking of crossclj, it's sketchy how it makes it so difficult to click out to wherever code originates from. It's like it doesn't want you to leave the site.
11:00edwA more prominent link would be an important act of good faith.
11:01TimMcYou think it's intentional?
11:01puredangerI don't think it's sketchy. just a lot of stuff on those pages :)
11:01bbloom,123
11:01clojurebot123
11:01justin_smithedw: no matter what you are trying to do, crossclj is a little confusing
11:01puredangerexactly :)
11:01justin_smithedw: they just need a UX overhaul
11:02edwTimMc: I have no idea whether it's intentional. But pretty every other similar resource makes it relativly easy. justin_smith, you're right; I should not ascribe to malice what's more easily explained by UX breakage.
11:03justin_smithedw: if they were serving any ads I may feel differently - but what do they gain from your page view?
11:04edwjustin_smith: I hear you; some people (not saying the CrossClj folk(s), see above) are just greedy for people's attention.
11:05edwThe (old) Google ethos--get em in and out as quickly as possible--is not shored by most people.
11:05edws/shored/shared/
11:06puredangerso, vec could return essentially the same vector sans meta and it would at least be constant time 
11:06justin_smithedw: also, gmail is like the opposite of that
11:07bbloompuredanger: that would also produce a new identity
11:07puredangeryes
11:07justin_smithpuredanger: that likely solves everything except folks who were exploiting array aliasing - and THEY deserve breakage I think
11:07puredangerjustin_smith: I don't care about that
11:08justin_smithgood
11:08puredangerI would happily break that :)
11:08puredangernew patches hitting master right now, btw
11:08puredangerincluding CLJ-1529 which has the Class.forName() improvement in it
11:08stuartsierraBrace yourselves, people.
11:09puredangerhttps://github.com/clojure/clojure/commits/master
11:12clj-learnerhi, i'm learning neo4j with neocons, how do i vizualize a path in my application?
11:15TimMcpuredanger: You think vec *should* strip metadata?
11:15puredangerit does now and someone might rely on that
11:16TimMcYou think that's a more likely case than relying on identity changing?
11:16puredangeryes
11:16bbloomTimMc: definitely
11:16puredangerbut it would also address that case
11:16owengalenjonesin cljs, if Im using an external library do I need to *both* declare it in :cljsbuild :compiler :externs AND include it in a <script src = > tag?
11:17TimMchuh
11:17dc_in multimethod dispatch based on class, how do i specify that
11:17edwjustin_smith: The Marissa-Mayer, Google-as-search-engine part of the company's history was dominated by the sort of thinking I described. It's well suited to things like the Grimoire, CrossClj, MELPA.
11:17justin_smithdc_: specify class as the dispatch function
11:18dc_i want a different method dispatched for a collection of chars vs a collection of integers
11:18justin_smithdc_: or use a protocol - they do that, and have better performance
11:18dc_justin_smith: sry hit send early
11:18dc_k, i'm aware of protocols and their power, but haven't used them yet, except in clojure koans
11:19stuartsierradc_: That's not a class, you would need a dispatch function like (fn [coll] (type (first coll)))
11:19justin_smith,(map (comp class first) [[] [1] "a"]) ; dc_
11:19clojurebot(nil java.lang.Long java.lang.Character)
11:19Bronsawow, t.a.jvm loads noticeably faster with clj master than with clj 1.7.0-alpha3
11:21justin_smithdc_: yeah, for dispatch based on item type a protocol wouldn't help really, but you could use a dispatch function that checks the type of the first item
11:22puredangerBronsa: yes, expect more of that :) doesn't help every project, but it does help in many cases, macro-heavy projects in particular.
11:31EvanRcan i dynamiclly instantiate a java class that i have in a variable
11:31EvanRcan i even have java classes in a variable
11:31EvanR,(let [x java.lang.Long] x)
11:31clojurebotjava.lang.Long
11:32EvanR,(let [x java.lang.Long] (new x))
11:32clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: x, compiling:(NO_SOURCE_PATH:0:0)>
11:32BronsaEvanR: no, you need reflection to do that
11:33BronsaEvanR: core.incubator has a function for that
11:33Bronsanew-from-string or something similar
11:33EvanRhmm
11:33hyPiRionyou can wrap them in functions as well
11:33Bronsahttps://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/incubator.clj#L76
11:33Bronsanew by name
11:33EvanRok
11:43donbonifacioI have autotest running, after some full test runs (about 30), I start to get out of memory exception. Isn't it weirf?
11:43donbonifacio- /s/weirf/weird
11:43sdegutisSeems normal to me.
11:44donbonifaciowhat about the GC? isn't it working? should I expect this kind of behaviour in prd?
11:44sdegutisClojure is still young, and most libraries are ad-hoc and written just to get the job done for the author.
11:44sdegutisSo expect to see lots of room for improvement all around.
11:45justin_smithdonbonifacio: running out of heap, or permgen?
11:46justin_smithif heap, something in your test is holding onto data it does not need, if permgen, use a newer jvm that doesn't segregate permgen, or turn on permgen gc (it is often off by default)
11:46donbonifaciojava.lang.OutOfMemoryError: unable to create new native thread
11:46Bronsasdegutis: that's not true at all
11:46technomancys/Clojure/the field of computing/
11:46TimMc*tools
11:46justin_smithdonbonifacio: are you creating threads in your tests?
11:46sdegutisBronsa: Well maybe you and I are using different libraries.
11:47sdegutisBut the ones I'm using seem to break all the time.
11:47donbonifaciojustin_smith: I'm testing pedestal, and making several requests to test the public rest api
11:47justin_smithdonbonifacio: in the test teardown, are you properly shutting down the pedastal instance?
11:47donbonifacionoooo
11:48donbonifacioI'm not doing anything like that
11:48donbonifaciodidn't know I had to, I confess
11:48justin_smithdonbonifacio: so, to be clear: your test starts up pedastal, runs a few requests against it, and leaves it running?
11:49ohpauleezOr are you using Pedestal's testing `response-for`?
11:49donbonifacioyes, I have autotest running, and it reloads every thime. I don't know if it reloads pedestal
11:49Bronsasdegutis: I don't see how you can go from "the libraries I use have bugs" to "most clojure libraries are ad-hoc and wrotten just to ghet the job done for the author"
11:49sdegutisBronsa: Well sure, if that was all there was to it.
11:49stuartsierraBronsa: I'll go there.
11:50donbonifacioohpauleez: response-for
11:50justin_smithdonbonifacio: does the test code start up pedastal, or does it assume pedastal is already up and running?
11:50sdegutisBronsa: But experience fills in the missing context.
11:50ohpauleezdonbonifacio: Ahh, so there's no running Pedestal. Are you doing a POST in any of the endpoints?
11:50donbonifacioI don't start pedestal, I use response-for
11:50donbonifaciosome POSTs and PUTs
11:50donbonifacioa lot actually
11:50justin_smithoh, OK, I misunderstood that part
11:51ohpauleezdonbonifacio: Do you store or hold onto the results to compare them across multiple tests?
11:51justin_smithdonbonifacio: I would try profiling, to see what is being leaked each time the tests run. the jdk comes with jvisualvm which should suffice for this
11:51ohpauleezI've personally never heard of this happening, just seems like you're creating some data somewhere and never letting it go (you're always keeping a reference to it)
11:52donbonifacioohpauleez: nop, each test is independent. But sometimes tests perform several requests
11:52ohpauleezit could also be the autotest runner
11:52justin_smithdonbonifacio: ohpauleez: either way a profiler should likely catch it
11:52ohpauleezdonbonifacio: Yeah, the multiple requests thing should be ok. I do that across a lot of Pedestal projects (and within pedestal itself)
11:53ohpauleezdonbonifacio: Yeah, if you just use jvisualvm, or whatever you have on hand, you'll see what's holding on to data
11:53donbonifaciook, i'll try to use it, and if I find something and get back to you ohpauleez
11:53ohpauleezAlso, feel free to bounce into #pedestal if you have any specific questions. Always more than happy to help!
11:53ohpauleezThanks! I appreciate it
11:54justin_smithdonbonifacio: one thing to look for is in the threads panel, if it is creating new threads each time the tests run that maybe don't get disposed of
11:55donbonifaciokay thanks, never used it before, will play with it
11:55donbonifaciobtw, anyone using VIM? still can't find a nice workflow
11:56engblomdonbonifacio: I am using vim, but I have a bit of the same problem.
11:56ohpauleezdonbonifacio: I'm also using vim
11:56ohpauleezI love my workflow
11:56ohpauleez:)
11:56donbonifaciohow's your workflow?
11:57engblomohpauleez: Would you mind making a tar.gz of your setup? Or putting it on github?
11:59ohpauleezI use Pathogen. And then these: Paredit, fireplace, Ack, gundo, classpath, clojure-highlight, clojure-static, dispatch, leiningen, projectionist, surround
11:59ohpauleezIn my tmux, I split horizontally, and my lower pane is tiny. It runs a repl
12:00ohpauleezFrom there I mostly only `cpp` and `cpr`
12:00donbonifaciohow do you reload the code on the repl?
12:00ohpauleezI always have a `(comment )` block in the file I work in, to try things out
12:01ohpauleezcpr
12:01donbonifacioreloads all or just the current file?
12:01ohpauleezrequires-reloads current file (to my knowledge) and runs any tests present.
12:02donbonifacioone thing I like on my ruby workflow, is that I can run a test, and then go to other files make changes and run that test again.
12:02ohpauleezWhy do you need to reload all? You just `cpr` when you make a change
12:02donbonifaciohum
12:02donbonifacioyes, you're right ohpauleez
12:07andyf_Bronsa: So, I?m finally changing Eastwood?s suspicious-expression linter to use asts rather than source forms, so it is no longer giving incorrect warnings for things like (-> 1 (= 1))
12:07andyf_Except for keyword typos, I think it is the last one that doesn?t use asts
12:09andyf_I?m now hitting what should have been predictable: nested macro calls inside things like defrecord expansions that contain things that issue warnings, and/or with > 1 arg contain in their expansion a 1-arg and/or that warns if I don?t prevent it somehow, same for cond, etc.
12:10andyf_My current plan is to add in checks for these cases by looking in the ancestor nodes of the ast for context that says "oh, that one is normal and shouldn't warn because it was expanded from foo". If you happen to think of a cleaner way, I'd be interested to know.
12:10andyf_but I'm content going down this path if we don't think of anything better
12:14justin_smithandyf_: it seems like there would be a lot of constructs that would be a likely error at the top level of code, but be present expansion of a well-made macro
12:16andyf_Sure, but I can't think of a precise definition of "the top level of code" that doesn't eliminate checking inside macros you write yourself.
12:16mdrogalistbaldrid_: re mailing-list: I'm not saying I agree/disagree with you about feature expressions being in core, but I find it funny that we sometimes argue that larger things should be in core 'because it would be convenient', and we use the exact opposite argument about adding very small things to clojure.core.
12:16tbaldrid_how is this a large change/
12:16tbaldrid_?
12:16justin_smithandyf_: yeah, that's tricky
12:17mdrogalistbaldridge: Feature expressions?
12:17andyf_justin_smith: Hmm. Perhaps "if the last macro expanded to get here was in clojure.core, then don't warn for it"
12:17tbaldridgeif file.endswith(".clj") or file.endswith(".cljp") { load(file)}
12:17mdrogalistbaldridge: That's really all there is to it?
12:17tbaldridgeThe approach I advocated isn't really feature expressions at all, it's just a new "portable" file extension.
12:18mdrogalisYeah, I got'cha. I guess I'm mis-remembering some things from the last time I read the feature-expressions design doc.
12:18tbaldridgeyou put cross-platform code in the new file type, everything platform specific goes in .clj, cljc, or .cljs
12:18tbaldridgeyeah, it's changed alot recently
12:18tbaldridgeAnd some people like cfleming chimed in saying that anything that modifies the guts of the reader is going to be super hard for tools to figure out without evaling the namespace or something.
12:19mdrogalistbaldridge: Ah, ignore my comment then.
12:19tbaldridgeNow I have no say in the final approach Clojure takes here, it's just worth pointing out that not every variant of "feature expressions" is complex
12:20mdrogalisThat's a good point.
12:20Bronsawow. the reduce impl is even more confusing than I though. there are now 3 interfaces + 2 protocols implementing it
12:21Bronsaand some implementations are unreachable, e.g. it looks like reduce will never use the ArraySeq_prim IReduce impl
12:22Bronsapuredanger: ^ that's maybe something that should be addressed before 1.7, it seems that some IReduce/IChunk reduce impls still don't handle reduced
12:22puredangerwhich?
12:23puredangertbaldridge was supposed to find and fix all of those, so I'll blame him :)
12:23Bronsapuredanger: ArrayChunk/ArraySeq_[prim]/gvec
12:24tbaldridgeYeah, except, adding "reduced?" support to ArrayChunk breaks a bunch of thigns
12:25Bronsaalso reduce on primitive arrays seems slower than it could be
12:25tbaldridgeBronsa: well it does do boxing, or are you thinking of something else?
12:25puredangeroh right, we talked about that didn't we
12:25Bronsait gets routed from collreduce to internalreduce's Obejct impl rather than to the IReduce impl for their ArraySeq_*
12:26puredangerreduce will have a special case to prefer IReduce over CollReduce
12:26Bronsapuredanger: the thing is that (long-array [1 2 3]) is not IReduce, (seq (long-array [1 2 3])) is
12:26puredangerthat's in CLJ-1572 which almost made it in today
12:27Bronsaah wait, I see I'm wrong
12:27Bronsaor not. uhm.
12:28Bronsayup, reduce doesn't seem to use the arrayseq path for arrays
12:30puredangerhmm, yeah CollReduce could potentially be extended to arrays
12:30Bronsaah! there's an impl for arrayseq_* of internalreduce that's not broken
12:31puredangerif there's a gap here, please file a ticket
12:31Bronsaso arrayseq_* IReduce impl is broken, but internalreduce's impl is not broken
12:31Bronsapuredanger: I'll try to figure out what is a bug and what is just dead code and open a ticket
12:32Bronsa,(.reduce (seq (long-array [1 2 3 4 5])) (fn [_ a] (println a) (reduced 6)))
12:32clojurebot2\n3\n4\n5\n#<Reduced@d85409: 6>
12:32puredangercertainly, ArraySeq* should check reduced
12:32Bronsalike, this is obviously wrong but this path will never be used by reduce
12:33Bronsa,(reduce (fn [_ a] (println a) (reduced 9)) (seq (long-array [1 2 3 4 5])))
12:33clojurebot2\n9
12:33puredangerthose sound like 2 separate jiras to me
12:35Bronsapuredanger: do you have any idea why IChunk defines a reduce method but doesn't extend IReduce?
12:35bodie_has anyone tried anything around pair programming in lighttable besides the firepad demo?
12:35bodie_I'm thinking something like a floobits plugin or something over xmpp
12:37puredangerBronsa: timbaldridge just looked into some of that stuff recently, but don't know. IChunk.reduce() has slightly different semantics than IReduce.reduce() iirc.
12:37puredangerin particular, around reduced
12:38Bronsapuredanger: ok I'll dig into that code and try to figure it out.
12:38puredangerhe was (I think) trying to reconcile them in the patch for http://dev.clojure.org/jira/browse/CLJ-1515
12:39Bronsaah, there's also IKVreduce lol. 3interfaces+3protocols then
12:39BronsaI feel like this could be cleaned out quite a bit
12:40puredangerBronsa: if designed fresh, surely
12:41puredangerbut harder if considering how not to break existing users of CollReduce or IReduce
12:42Bronsapuredanger: meh, IReduce just got a breaking change
12:42puredanger?
12:42BronsaIReduce -> IReduce,IReduceInit
12:43Bronsanevermind, I missed that IReduce extends IReduceInit
12:44andyf_you are in a maze of twisty little passages, all alike. :)
12:44puredangerI was just eaten by reduced
12:45Bronsareduced added a ton of complexity in the impl
12:46Bronsabut I have to say, it's really handy
12:49puredangerBronsa: I'm stepping away to work on some conj stuff but would really like those tickets. if you don't have time, drop me an email and I'll take care of it.
12:50Bronsapuredanger: I'll look into the code a bit more to understand what's a bug and what's just my misunderstanding but will definitely open those tickets later
12:51Bronsaas it stands now I'm pretty sure c.c/reduce is fine, OTOH using IReduce's reduce directly can be broken
13:01brucehaumanhey all, Is anyone looking for a Conj ticket?
13:09bbloomif i suspect a `lein repl` instance, and come back, it says "Welcome back!"
13:09bbloombut it doesn't seem toa ctually work
13:11justin_smithbbloom: also, odd behavior if you try to tell it to keep running in the background
13:12bblooms/suspect/suspend
13:13stuartsierrabbloom: I always suspect lein.
13:13bbloomstuartsierra: my subconscious agrees
13:14justin_smithbbloom: you could compare the behavior of "rlwrap java -cp $(lein cp) clojure.main"
13:16cflemingtbaldridge: I think your proposed solution probably leads to more code duplication, but still gets a big (inc) from me.
13:22kanobeSo I have a Go project that uses other Go projects (i.e. has their repos cloned)
13:22kanobeoops wrong chan :P
13:22kanobeSorry
13:22technomancy~guards
13:22clojurebotSEIZE HIM!
13:22technomancy=)
13:22hfaafbD:
13:23martinklepschIn James Reeves' `template` what are endpoints useful for? https://github.com/weavejester/duct
13:23martinklepschIs that for when parts of the application use different components/systems?
13:27justin_smithmartinklepsch: I think that's the REST endpoint concept - you can have multiple endpoints that act as entities, each one accepts some subset of request methods (get/post/put/delete etc.)
13:28stuartsierraIsn't there a way to do (map first (partition 2 …)) with a single function?
13:29TimMcstuartsierra: take-nth I think
13:29TimMc,(take-nth 2 (range 20))
13:29clojurebot(0 2 4 6 8 ...)
13:30stuartsierraTimMc: That's it, thanks
13:31TimMc$findfn 2 [0 1 2 3 4] [0 2 4]
13:31lazybot[clojure.core/take-nth]
13:31TimMc\o/
13:31TimMcYou're a bot!
13:41EvanRcan extend (the protocol thing) be used to implement java interfaces?
13:41EvanRlike ILookup
13:42stuartsierraEvanR: no
13:42EvanRalrighty then
13:44_2_perez hi(L)
13:45Bronsatbaldridge: ok so ArrayChunk's reduce impl is right as it is now
13:46csd_What are some good books on unit testing, TDD, and debugging? They don't have to necessarily be Clojure specific
13:47Bronsatbaldridge: basically reduce on a chunked-seq reduces over each chunk via ArrayChunk/reduce, that needs to return a reduced so that the chunked-seq reduce can know it has to unwrap it & return rather then reduce the other chunks
13:47tbaldridgewhich breaks the .reduce contract
13:47Bronsatbaldridge: so changing that in your patch for range is wrong
13:47Bronsatbaldridge: not really, that/s IChunk/reduce not IReduce/reduce
13:47Bronsathat's*
13:48tbaldridgeoh, they're different, didn't know that
13:48BronsaI guess that's why IChunk defines a reduce that's not IReduce's one
13:48Bronsatbaldridge: it's similar to how kvreduce is implemented for maps -- kvreduce on PHM unwraps, kvreduce on the internal nodes doesn't
13:49Bronsatbaldridge: yeah all that impl is kinda confusing bcause same signature but different contracts
13:51eric_normandI'm having trouble with tagged literals
13:51eric_normandThis is the error message: RuntimeException No reader function for tag subspace/core-async-channe
13:51eric_normand(sorry, has \l at the end)
13:52eric_normandand this is my *data-readers*: {subspace/core-async-channel #'portal.subspace/read-channel}
13:52eric_normandportal.subspace/read-channel exists
13:52eric_normandany clues?
13:52stuartsierraeric_normand: Have you loaded 'portal.subspace'?
13:52eric_normandyes
13:53stuartsierraThen I got nothing.
13:53stuartsierraExcept that data readers are rarely necessary.
13:53eric_normandhmm
13:53eric_normandI might try doing without
13:53eric_normandthanks
13:55sdegutis,zero?
13:55clojurebot#<core$zero_QMARK_ clojure.core$zero_QMARK_@113722b>
13:55sdegutis,one?
13:55clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: one? in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:55sdegutisWhy isn't there a (one?) function?
13:57sdegutis,(let [[foo1 & fooN] [1 2 3]] (if (empty? fooN) foo1 (first fooN)))
13:57clojurebot2
13:57sdegutisI wanted to test whether a collection had 1 or more elements. Ultimately I ended up with something like that.
13:58dmitrygusevwhy returning 2nd element then?
13:59eric_normand(seq coll) tests if there are one or more elements in coll
13:59eric_normand,(seq [])
13:59clojurebotnil
13:59eric_normand,(seq [1 2 3])
13:59clojurebot(1 2 3)
14:00technomancysdegutis: sounds like you need a pattern match
14:01dmitrygusevbtw, quoting https://twitter.com/hlship/status/530395233410764800 : I'm experimenting with a convention that varargs arguments are prefixed with '&' (i.e. (defn foo [x & &xs]) … helps with the calling side
14:01eric_normandsdegutis: what technomancy said
14:01sdegutisSee, I'm trying to return either the only one, or one that matches a pattern.
14:01sdegutistechnomancy: I don't know what that means in Clojure.
14:02eric_normandsdegutis: I see.
14:02eric_normandwhat kind of pattern?
14:03sdegutis(str/contains ":" (:title %))
14:03eric_normandnice
14:03eric_normandwhat about:
14:03sdegutisI could just look for the pattern first, and (or) it with (first).
14:04sdegutisBut that's less, umm, accurate.
14:04sdegutis(or (filter pattern thingies) (first thingies))
14:04eric_normand,(let [coll [1 2 3] f (fn [pred coll] (or (first (filter pred coll)) (first coll)))] (f coll))
14:04clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox/eval142/f--143>
14:04sdegutiseric_normand: mainly because that fails
14:04eric_normand,(let [coll [1 2 3] f (fn [pred coll] (or (first (filter pred coll)) (first coll)))] (f even? coll))
14:04clojurebot2
14:04sdegutisOh.
14:08sdegutiseric_normand: So yeah, we had the same idea. Seems more idiomatic Clojure, but seems much less semantically correct.
14:09sdegutisI admit that I sound like a heretic, but I've fallen out of love with Clojure, and I'm more annoyed with it these days than anything else.
14:11nkozasdegutis: what are you using instead of clojure?
14:11sdegutisNothing.
14:11sdegutisI just use Clojure.
14:12xeqii thought pixie was the new hotness
14:13godd2I just started learning Clojure, so I haven't had the opportunity to be annoyed with it yet
14:13sdegutisI've had my eye on Swift, but it's Apple only so pretty much useless for my job (web app).
14:13technomancywriting code without pattern matching is super annoying to me too, but at least for application-level stuff you can bring in core.match, right?
14:13technomancyI have a hard time understanding why you wouldn't, anyway
14:13sdegutisI've also had my eye on Rust, but I'm waiting until it's done changing before I seriously look at it.
14:13sdegutistechnomancy: I don't know what that's for.
14:14sdegutistechnomancy: does Clojure have pattern matching?
14:14technomancysdegutis: there is a clojure lib that implements it as a macro, yeah
14:14eric_normandsdegutis: it's really nice
14:14sdegutistechnomancy: core.match?
14:14sdegutiseric_normand: it looks nice
14:14technomancyyup
14:14sdegutiseric_normand: did you write it?
14:14eric_normandno
14:14eric_normanddavid nolen
14:14sdegutisOh.
14:15sdegutisI guess that makes sense.
14:15eric_normandsdegutis: but I've used it
14:15sdegutisIt looks just like a fancy (cond), is that all it does?
14:16eric_normandcond with unification
14:16technomancythat's like saying vars are just fancy variables
14:16eric_normandbinds locals, pattern matches, and optimizes the matching
14:16sdegutiseric_normand: sold.
14:17technomancyit's like ... when you try to destructure against something that's not a collection, you get an error or nils or whatever, but pattern matching lets you offer a bunch of patterns and pick the branch that matches
14:19sdegutisOh so it's also an enhanced destructuring? Nice.
14:20sdegutisWhat's a decent testing framework?
14:20technomancylol
14:20Bronsasdegutis: didn't you set yourself up to writing a better one for clojure last year? or am I confusing you with someone else?
14:21sdegutisBronsa: That was me, I've since given up on trying to contribute to things.
14:21sdegutisBronsa: So I'm just looking for a decent, stable one. Has the landscape changed since last year?
14:22BronsaI've always only used clojure.test and have been happy with it.
14:23sdegutisI imagine clojure.test hasn't changed since last year.
14:23Bronsaright
14:23sdegutisNever mind. Perhaps I'll just fix this bug in the one I'm using.
14:23sdegutis(If only I knew how.)
14:32arrdemis there a core.logic idiom like run-1?
14:33arrdemrun-db has an [n]. okay.
14:51radsis there a difference between a reference and an identity when we're talking about state management?
14:51radsI understand that both represent a sequence of values changing over time
14:51gfredericksI think I use those words interchangeable in that context
14:51gfredericks-bly*
14:51TimMcwordsbly
14:52gfredericksIbly thinkbly Ibly usebly thosebly wordsbly interchangeablebly inbly thatbly contextbly
14:52gfredericks^FTFM
14:52radsI feel like identity is a more abstract concept, and a reference type is an implementation of an identity in a program
14:53radsdoes that make sense?
14:53gfredericksthat sounds fair
14:53radsthat helps with my understanding a bit
14:53radsthanks
15:03stuartsierrarads: Sometimes we use "identity" to mean object identity, as in a Java Object.
15:05justin_smithamalloy_: I figured the eval privmsg thing out: the clojure plugin duplicates all the message dispatch logic that was in registry/try-handle, and I had only updated the latter. So I am going to abstract it out so it can continue to be correct in both places.
15:14xyprotoCould someone please test "quine-relay-git" on Arch Linux (from AUR) and see if clojure errs out for you as well?
15:14xyprotoUnsure if it is a problem with quine-relay or clojure.
15:15justin_smithI don't use arch, but may be able to help if nobody more qualified is around: what's the error message?
15:16justin_smithxyproto: if the error is the fact that there is no clojure package, you likely want leiningen in its stead (which is a builder / packager / runner tool for clojure, clojure is just a jar file)
15:18kenrestivo"ibly" sounds like something i should register and domain-squat until some startup wants to use it as their company nam
15:19justin_smithkenrestivo: butter jump!
15:19justin_smith*better, lol
15:19kenrestivobutterjump.com is taken
15:20justin_smithhttp://ibly.com/ also
15:20kenrestivosorry, ibly is taken, butterjump.com is not
15:20justin_smithbutterjump.com is already halfway to being viral just by the name - next you need some unwarranted enthusiasm and absurd juxtapositions of in-jokes
15:21justin_smithmaybe some loud noises
15:21justin_smithand BANG you have a hit
15:21kenrestivo~butterjump is a hit
15:21clojurebotOk.
15:21kenrestivoi wonder if there's a browsable database somewhere of all the clojurebot factoids. must be some high entertainment in there
15:24sdegutis~guards
15:24clojurebotSEIZE HIM!
15:24puredanger(inc guards)
15:24lazybot⇒ 1
15:24justin_smith~gourds
15:24clojurebotSQUEEZE HIM!
15:35gfrederickskenrestivo: hiredman gave out a db dump once
15:35gfredericksI think I had it at one point but probably misplaced it
16:33LIHOY#bitcoin: Beware of scams! Scammers are sending users private messages with bitcoin-stealing malware and offers to trade. We are unable to stop them, so you must protect yourself. NEVER download or run programs from strangers! When in doubt, ask the ops.
16:33LIHOYîé
16:33LIHOYI'm from Russia . I thought that Russian server) fuck karoch )
16:34arrdemtechnomancy: fingerguns required
16:34bbloomtechnomancy: ^^
16:35arrdem(inc technomancy)
16:35lazybot⇒ 157
16:35technomancypew pew pew
16:43TimMcWhat an odd little spammer.
16:46hfaafbgood advice tho
16:46akkadteknemancy?
16:46technomancyhfaafb: except for the last two words, yeah
16:57augustlanyone got some tips for using clojure data structures from another JVM language? I'm gonna use Groovy, with Gradle as the build system.
16:57augustljust depend on clojure, and call something.Something.init()?
17:01gfredericksaugustl: you might need to require RT?
17:02gfredericksprobably not though
17:02gfredericksso I don't think you have to explicitly init anything
17:02arrdemaugustl: as of 1.6 or 1.5 you no longer need to explicitly init core
17:03augustlafaik there's something protocol related in maps that fails without RT
17:03augustlI'll just try 1.6 and see what happens :)
17:06scape_with string replace, how would I supply a var instead of a raw regex string? ie: #"abc" with (str "ab" "c")
17:07scape_oh wait
17:07scape_I can
17:07scape_hah
17:07scape_:-\
17:07scape_wait no i can't
17:07arrdemvars are an implementation detail and should always be transparent
17:08scape_https://clojuredocs.org/clojure.string/replace
17:08arrdemwhich example, scape_?
17:09dbaschscape_: use re-pattern
17:09scape_(clojure.string/replace "The color is red" #"red" "blue") where #"red" is instead (str "red") or something evaluated
17:09scape_oh
17:09scape_I'll see
17:09dbasch&(clojure.string/replace "abcabc" (re-pattern (str "ab" "c")) "def")
17:09lazybot⇒ "defdef"
17:10bbloom(doc clojure.string/replace)
17:10clojurebot"([s match replacement]); Replaces all instance of match with replacement in s. match/replacement can be: string / string char / char pattern / (string or function of match). See also replace-first. The replacement is literal (i.e. none of its characters are treated specially) for all cases above except pattern / string. For pattern / string, $1, $2, etc. in the replacement string are substituted with the string that
17:10scape_thanks
17:10scape_repattern looks like it will work
17:10bbloom,(clojure.string/replace "abc" "b" "x")
17:10clojurebot"axc"
17:10bbloomscape_: seems to work for me...
17:10bbloomif you use re-pattern, you'll need to escape any metacharacters
17:10bbloom,(clojure.string/replace "abc" (str "b" "c") "x")
17:10clojurebot"ax"
17:11dbaschof course a string works too for that case
17:11scape_yea it looks like it is
17:11scape_hmm
17:11scape_I get clojure.lang.Compiler$CompilerException: java.lang.IllegalArgumentException: Invalid match arg: ,
17:12scape_gotta look closer I think, thanks
17:14bbloomscape_: i bet you're not passing it what you think you're passing it
17:14scape_yea I was willy nilly searching a map without checking if key existed
17:15scape_thx
17:18hfaafbhow come rich hickey never says hi to anyone here
17:18hfaafbi just wanna autocomplete rhickey once in my life
17:18hfaafbor rich
17:18hfaafbor whatever
17:21bbloomhfaafb: i think you answered your own question... people want to talk to him just to talk to him, and he wants to accomplish things :-P
17:28rads"rads: Sometimes we use "identity" to mean object identity, as in a Java Object."
17:28radsdoes that mean the identity of a java object is actually a value?
17:29radsoh darn, stuartsierra is no longer here
17:30gfrederickswe should have a ceremonial annual event where rich comes into #clojure and everybody gets to A) suggest using github PRs instead of jira and B) request exactly one function to add to clojure.core
17:30puredangeryeah, that would go over great :)
17:31dbaschrads: no, in java different objects can have the same value
17:32dbaschi.e. two objects can be equal but not identical
17:32seancorfieldgfredericks: would that be a bit like the annual event on the mailing list where the CA process is discussed? :)
17:32gfredericksseancorfield: oh right that should be a part of it somehow
17:33dbaschwell, there’s always the old cardboard cutouts of rich hickey from the last conj, maybe someone can send one to hfaafb
17:35radsdbasch: do you know how the jvm determines if two objects are identical? does it simply compare the pointers to where the state is stored in memory?
17:35gfredericksmaybe also everything gets to paste one stack trace they've encountered and gesture wildy while saying "just look at this thing!"
17:35gfredericksrads: depends on what you ask it to do
17:35gfredericksrads: the jvm can do pointer equality, or it can do custom equality based on Object#equals
17:36gfredericksclojure.core/= does something more complicated
17:36dbaschrads: == means are they the same reference
17:36gfrederickswhere == is java syntax
17:36radsI'm trying to get a fundamental understanding of these three terms: reference, value, and identity
17:36dbasch.equals means “do they have the same value” (for whatever definition of equals the class has)
17:37radsthe "reference" is a location in virtual memory, correct?
17:38radsit's just a pointer?
17:40arohnerrads: 'value' typically means an immutable object: "foo", 42, {:a :b}
17:40arohnerrads: 'reference' typically means a box that can point to a value. refs, atoms and vars are all reference types
17:41arohnerrads: identity typically means a thing that is unique, that can be found by its unique attribute. it can be an immutable value that has e.g. an :id column, or a ref where there's only one of them in the system, etc
17:42amalloyhmmmm. can anyone think of a case where ~''x would produce something different from '~'x? i've seen the latter numerous times, and it just occurred to me that it should be identical to the former but i've never actually seen it
17:42radsarohner: thanks for that succinct explanation
17:43radshere's something I've been wondering: is it fair to say that physical memory slots and CPU registers are the lowest level "references" available to programmers?
17:43radsat the operating system level at least
17:43arohnerprobably
17:44EvanRregisters in memory on devices
17:44gfredericksrads: people are being wishy-washy about this because these words don't have official definitions. you just gotta figure out what are useful meanings for your context and be explicit about that when you need to
17:46radsso technically there's no limit to how far you can "move the reference up" in a functional program, since you could represent your program as a function on the current state of the CPU registers and physical memory
17:46radsdoes that make sense?
17:46EvanRrads: its useful to consider yourself working on a virtual machine with abstract notions of whatever the programming language is manipulating
17:46dbaschrads: memory and cpu registers are not “references”, any more than a mailbox or the trunk of your car is a reference
17:46dbaschthey are storage units
17:46dbaschyou can refer to them, of course
17:46EvanRthinking that you are direct accessing anything at any level is either misguided or inappropriate for the current abstraction
17:47EvanRvirtual memory, microcode, its all a lie
17:48EvanRthe internet protocol is a rich source of abstractions over things no one has ever heard of, or cares about for the purposes of application programming
17:49radsokay, so you make references that point to locations in storage units
17:49EvanRfor example
17:49radsthe storage unit is abstract
17:49radscould be a CPU register, could be redis
17:49radsthe reference is a symbol within the program that provides access to that location within the storage unit?
17:50radsis `int c` a reference in the C programming language since it changes mutable state?
17:50justin_smithrads: no, it is a storage location
17:51justin_smithrads: vars or local bindings provide access via symbols to those locations
17:51justin_smiththat is no it is not a symbol
17:51EvanRint c is a declaration for storage
17:52dbaschin C, int c means “make a space for an int in the stack, and when you see c in this scope I’m talking about that space”
17:52radsI'm using C as an example for now because it's simpler than clojure's model
17:52EvanRdbasch: depending on where it appears
17:52EvanRrads: you think?
17:52dbaschEvanR: yeah, I’m assuming a function
17:52justin_smith"int c" tells the c compiler you want to refer to some location in the stack or memory heap by the symbol c
17:53justin_smith"(def c)" tells clojure you want to refer to something, within this namespace, by the symbol c
17:53radsEvanR: not for writing programs on top of, but it's easier for me to understand if I can see the connection of the system itself
17:53EvanRdo does (declare c)
17:53EvanRso*
17:53oskarkvamalloy apparently ``'~'x is not the same as ``~''x. I don't know how to think about these cases, ie how to predict what they will produce
17:53justin_smithrads: (let [c 1]) tells clojure that you want to refer to 1 locally as c
17:53radsI see
17:54radswhat if you're mutating a struct? is the struct a reference?
17:54justin_smithrads: everything in the jvm that is not a primitive is a reference type
17:54EvanRrads: "the system" is another abstraction, you just more familiar with it, but its not even that simple of an abstraction
17:54amalloyoskarkv: well, ``~''x is identical to `''x
17:54amalloybecause `~ is a no-op
17:55radsI'm trying to understand how `c = 1` in C is different than `(reset! c 1)` in clojure
17:56radsthe end result is the same for the programmer
17:56justin_smithrads: so, if you are mutating a "struct" that struct will be represented in the jvm as an "Object" - an instance of some "Class", and you can refer to it the same way you would any other value - via local binding, or a namespaced global var
17:56radsin clojure, c is a reference type
17:56technomancyI had a waaaay easier time understanding C pointers after learning clojure's reference model.
17:56justin_smithrads: or of course a value in a slot of some other Object
17:56technomancynot that they're the same thing, but the fact that clojure's model was so explicit helped me keep the concepts straight in C where they can be fuzzier
17:57dbaschrads: for one, c = 1 is not an atomic operation
17:57EvanRthe storage units in question have different lifetimes
17:58radsis reset! atomic?
17:58EvanRrads: its not exactly right to call anything in C a reference
17:58radsI thought you only get atomicity with swap!
17:58dbaschrads: what does reset! operate on?
17:59radsyou would get the same semantics if you replaced c variables with atoms and only used resets instead of assignment, wouldn't you?
17:59radsC, the language, variables I mean
17:59EvanRC the language doesnt guarantee any atomic operations
18:00radsbut I'm saying if you have a bunch of writers using reset! on an atom, those operations are also not atomic
18:00radseven though the reference type is called an atom
18:00EvanR:doc reset!
18:01rads"Sets the value of atom to newval without regard for the
18:01radscurrent value. Returns newval."
18:01radsif there is no coordination of the previous value, how can there be atomicity?
18:01dbaschrads: there is a subtle difference
18:02dbaschyou could execute a clojure program in discrete steps and a c program in discrete steps too
18:02dbaschright after a reset!, the value would be what you put in
18:02tuftatomicity just means it either happens completely or not at all. if two threads try to assign the same variable in C a third may see an inconsistent state / partial update
18:02dbaschin c, the step after an assignment makes no guarantees if there are concurrent assignments
18:02technomancydbasch: reset! is the same though
18:04radsso when you do `c = 1` in a C program, it is not immediately visible to other threads with access to the same memory location?
18:04EvanRyoure not guaranteed to see the value you put it right after putting it in
18:04dbaschtechnomancy: you’re right, just looked at the code
18:04radsand the different with clojure is that the other threads will see the new value immediately?
18:04radsdifference*
18:04technomancyatomicity only matters if the new value is based on the old
18:05technomancy(so, swap! but not reset!)
18:05radsyes, that's what I was confused about
18:05EvanRrads: when you were asking about atomicity issues, i was thinking you were talking about word tearing
18:05EvanRlike your variable gets half way committed
18:06tuftyeah that's what i'm talking about
18:06tuftthat to me is atomicity too
18:06oskarkvamalloy yeah but I have trouble understanding what happends with ``'~'x
18:06oskarkvhappens*
18:06radsmy main motivation for this is figuring out what a useful AtomicReference implementation might look like in JavaScript
18:06tuftthe other thing is more about serialization
18:06amalloyoskarkv: nothing very good. it's hard to imagine wanting to use taht
18:07EvanRrads: in browser javascript you are in luck, because the threads do not interleave, everything you do is atomic in this sense
18:07oskarkvhehe but i'm curious. amalloy do you understand it? :P
18:07amalloytake a look at even like ##``'x
18:07lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote quote)) (clojure.core/list (quote clojure.core/x))))
18:07tuftrads: doesn't ClojureScript already have an atom?
18:07amalloy`'~'x produces the code necessary to output (quote x)
18:07dbaschrads: javascript is single-threaded (at least in the browser) so atomicity means nothing
18:07radstuft: yeah I'm talking JS only
18:08radsit becomes important when you're synchronzing data with the server
18:08EvanRjavascript over the years has silently saved countless programmers from even knowing that concurrent programming challenges exist
18:08amalloy``'~'x produces the code necessary to produce the code necessary to output (quote x), which is not very useful
18:08tuftyeah no volatiles in js land
18:08tuftexcept web workers?
18:08dbaschrads: no, it means nothing
18:08EvanRtuft: new fangled contraptions ;)
18:08radswhat if I want to perform an operation on the client concurrently with other clients?
18:08oskarkvamalloy yeah ok gonna think about it some more. Just as an exercise ;)
18:09radsthat needs to be an atomic operation
18:09oskarkvthanks
18:09dbaschrads: in that case you care about atomicity on the server side
18:09EvanRrads: are you sure you are using the word correctly yet?
18:10radsmaybe this is a better phrasing: I want to make an abstraction in JavaScript that makes performing atomic operations between the client and server easier
18:10technomancyhooo boy
18:10dbaschI give up
18:10technomancyso yeah, a distributed system is completely different
18:11tuftrads: could we have a concrete example please?
18:11technomancywelcome to CAP theorem =)
18:11dbaschthe point is that if you run an operation in js, nobody will come and change your state while it’s pending
18:11radsI can't go into a ton of detail
18:12radsbasically I want to perform simple synchronization between the client and server in a web app where the writes are not very common, but better than just last write wins
18:12tuftrads: maybe you can obfuscate your $1e6 idea sufficiently? =)
18:12dbaschrads: if you’re competing with other clients, it’s up to the server to synchronize access to whatever
18:13radsI just don't want to risk violating any contracts with my employer, sorry
18:13dbasche.g. you and someone else are trying to buy the last ticket to a concert
18:13tuftrads: what dbasch said
18:13dbascheither you buy it or the other person does, but there’s nothing the browser can do about it
18:14radsdbasch: no, but the browser can perform the operation optimistically. at that point you have two states to reconcile when you get the next response from the server
18:15dbaschrads: why would you want to do that?
18:15radswhy would I want to perform operations optimistically before I get a response from the server?
18:15dbaschnot for that example. Are you writing a text editor that claims to save but really hasn’t saved anything?
18:16radsit's more about not making the UI block when the user performs an action
18:17radsotherwise you have to wait for the server response to have a consistent state if you have no plan to reconcile any optimistic opereations
18:18radstechnomancy: any recommendations for learning about distributed systems?
18:19radsdbasch, tuft: I appreciate your help so far. this is a tough problem
18:19dbaschrads: look into Om if you want to do this in Clojure
18:20dbaschor any other react-based framework
18:20radsthat's what this is for, a react application
18:21radstrying to understand how the different pieces fit together and centralize the state synchronization with the server in one place
18:21radsI followed Om closely when it came out last year, but I'm trying to understand the fundamentals behind Om itself
18:22radsso that maybe I could contribute back to Om one day with a better understanding of these principles
18:41myguidingstarhi all, what is the best way to write a Leiningen template?
18:42myguidingstaris there anyway to make one from a working project?
18:43justin_smithmyguidingstar: not that I know of. But there is "lein new template [name]"
18:43myguidingstarwell, I know that
18:44justin_smithoh, you knew about the template template?
18:44justin_smithhave you checked out the files it makes?
18:46myguidingstarI know how to write lein template from scratch
18:47myguidingstarI'm thinking of a conventional way to convert a 'working temple' into a template with {{placeholders}}
18:47myguidingstars/working temple/working template/
18:48myguidingstaroh, I meant 'working project'
18:48justin_smithif that exists, I have not heard of it
18:49technomancyyou should write one =)
18:49myguidingstartechnomancy, yeah, I'm thinking of it
18:51myguidingstarshould be a set of rules: hello-project (real, runnable symbols!!!) to {{placeholders}}
18:53myguidingstarand finally: "lein templatize input-dir output-dir"
18:54myguidingstartechnomancy, any suggestions about such rules?
18:54technomancypart of the reason it doesn't exist yet is it's difficult to come up with sufficiently generalizable rules =)
19:04andyftechnomancy: "Subprocess failed." Is printed by lein if a plugin does (System/exit 1) and that is by design, yes? Just confirming
19:08technomancyandyf: ideally the plugin could replace that generic message with something more descriptive, but if they don't, then yeah that's what you'd see if a project JVM exited nonzero.
19:09andyfUnderstood. I'm just documenting it for now since it wasn't already and someone thought it was a bug in Eastwood
19:14gfredericksandyf: is issue #21 still unworked-on, and is it work-onable?
19:16andyfgfredericks: I think I have both time and interest to get a start on it this weekend, but it depends how much time it takes me to finish #93 first
19:17andyfBut if you want to go for it, I don't mind
19:17gfredericksokay I will give you a heads up if I do
19:19andyfI keep getting reminded when creating linters (1) how much easier tools.analyzer makes it, and (2) how much I don't know about corner cases that exist when I start
19:20technomancyandyf: I'd recommend doing eval-in-project in a try/catch and watching for :exit-code on an ExceptionInfo
19:21technomancyalso... why ExceptionInfo and not InfoException?
19:21gfrederickswell it's not an exception due to Info
19:22andyfOn the exception name, Bronsa named it
19:23technomancyit's less verbose at least than DataConevyingException
19:23Bronsaandyf: I believe technomancy is talking about c.l.ExceptionInfo, not about t.a.j.ExceptionThrown
19:23andyfOr is there an existing InfoException you are asking why we are not using it instead?
19:23gfredericksclojure.lang.ClojureProblem
19:23Bronsabut I haven't read the scrollback so I might not have all the context
19:25technomancytotal bikeshed, forget I said anything
19:25andyfBronsa: You did not choose name of ExceptionInfo in tools.reader?
19:26Bronsaah
19:26andyfWait, what were we talking about again? :-)
19:26Bronsaandyf: not really, that's just to implement c.l.ExceptionInfo in clj 1.3 or whatever the version
19:27Bronsapuredanger: ah by the way, importing by default ExceptionInfo would be super for writing cross language code.
19:27andyfBronsa: I currently aot that class only in Eastwood and I recall adding that because things broke without doing so
19:27eric_normandclojure.edn/read does not use *data-readers*
19:28eric_normandis that a bug?
19:28Bronsaeric_normand: no, a design choice
19:28eric_normandBronsa: why?
19:28Bronsaeric_normand: c.edn/read has a different signature than c.c/read
19:28Bronsaeric_normand: it uses a map arg rather than dynamic vars
19:28andyferic_normand: it lets you specify them in arg I think?
19:28eric_normandI see
19:29andyfMore explicit that way
19:29eric_normandyes
19:29Bronsaandyf: dunno, I don't recall how compilation works there. but tools.reader's ExceptionInfo is only used by clj <=1.3
19:33andyfBronsa: Namespace c.t.reader.impl.utils requires it unconditionally, doesn't it ?
19:34Bronsaandyf: ah yeah. right so it has to be AOT compiled or the type hint will fail
19:35Bronsaandyf: now I remember, loading the namespace conditionally would mess with maven or something like that
19:35andyfNo big deal for me. Just making sure I wasn't missing something
19:37andyfBronsa: Some years down the road I hope that (= 3 (:minor *clojure-version*)) requires updating :-)
19:37Bronsaheh
19:38Bronsaandyf: I'm just counting on the fact that when (if) the time comesclojure 2.x will break so much existing code that changing that will be the last of my problems
19:38andyfProbably so
19:38technomancyMAH EYEZ https://github.com/ztellman/cambrian-collections/blob/master/project.clj#L10-L15
19:39technomancywhy, github, why?
19:39technomancyis this revenge for something untoward rich said about pull requests?
19:39Bronsalol
19:39Bronsatechnomancy: syntax highlighting for clojure has been broken for over 20 days :(
19:39andyfGithub has seen the rising tide of Clojure popularity and is trying to quell it
19:40justin_smithtechnomancy: what really got me was the bright red highlighting of some square brackets in racket code
19:40justin_smithbut yeah, that is pretty wtf too
19:40technomancyhttp://p.hagelb.org/chair.gif
19:42andyfBut how do you feel, really?
19:42technomancyactually it's a shame the gif cuts off where it does
19:42technomancybecause the next few frames reflect it perfectly
19:43justin_smiththat movie was surprisingly good
19:43andyfYoutube source?
19:43technomancy(inc lego-movie)
19:43lazybot⇒ 1
19:44technomancyandyf: http://www.youtube.com/watch?v=YkCeUjvgXRk
19:45Jaoodto bad that patch didn't made it to 1.7
19:46amalloyjustin_smith: currently in https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj, some of the commas are highlighted bright red and some are not
19:46BronsaJaood: which patch?
19:46amalloyi think it's the case that commas preceded by punctuation are bright red; if there's a letter before it, it's not
19:46JaoodBronsa: ztellman's
19:47justin_smithamalloy: woah, that sucks
19:51andyfTime to make an overlay site for github with better highlighting choices?
19:51technomancyandyf: yeah, a userstyles.org thing would be great
19:51justin_smithmaybe a petition of payed members (I pay for membership there, and I would sign)
19:52martinklepschwhats a good project to look at to understand the component system? I looked at duct but it seems to be different to most (https://github.com/weavejester/duct)
19:52justin_smiths/membership/account I guess
19:52technomancymaybe it's a sign that github's pseudomonopoly needs to come to an end
19:53technomancyI really wish I could recommend gitlab. so close, but still frustrating.
19:54hyPiRionLet's make something ourselves, how hard could it be
19:54andyfPushes, pulls, issues, free hosting of public files and static web pages. All still good
19:57technomancya fork of gitlab that actually uses the project readme as the splash page. boom.
19:58justin_smithmaybe the new highlighting is a passive-agressive way to encourage us to do less code-browsing on site
19:58justin_smith(original definition of passive-agressive, not the new one)
19:59hyPiRionthe new one?
19:59justin_smithhyPiRion: where people call being friendly while making a criticism, or leaving a note, or being indirect "passive agressive"
19:59justin_smiththe old definition was pretty specific: undermining a project without overt hostility
20:00Jaoodtechnomancy: but gitlab is for self-hosting so you can really compare them?
20:00Jaoods/can/can't/
20:00technomancyJaood: gitlab is both
20:01technomancybut they make some decisions that only make sense in the context of private repos
20:01technomancylike refusing to use readmes as splash pages
20:01technomancythey have hosted gitlab both for OSS and private stuff
20:04Jaoodtechnomancy: oh true, was not obvious from their landing page
20:06Jaoodtechnomancy: you don't like bitbucket?
20:07technomancyJaood: I remember being very unimpressed with the issues system
20:07technomancybut GH's isn't great either
20:08technomancymaybe it just reminded me too much of jira
20:10michaniskin_what's the best way to read in a clojure file that contains forms like ::foo/bar?
20:10michaniskin_i don't want to evaluate it, i just want to read the forms
20:11Bronsamichaniskin_: it's not possible without at least evaluating the namespace form
20:11michaniskin_wonderful
20:11michaniskin_thanks Bronsa
20:12Bronsamichaniskin_: well that's not entirely true I guess, you *can* read it without evaluating it, all you need is the alias setup
20:12michaniskin_yeah i have that already
20:12michaniskin_i was just checking that i wasn't insane
20:13michaniskin_i was hesitant to assume that reading and evaluation were complected
20:14Bronsamichaniskin_: also you can use tools.reader to do that without messing with the namespace system if you already know the aliases
20:14Bronsamichaniskin_: https://github.com/clojure/tools.reader/blob/master/src/main/clojure/clojure/tools/reader.clj#L303-L313
20:14michaniskin_i don't want an AST, i want to read forms
20:14Bronsamichaniskin_: tools.reader is not tools.analyzer :)
20:14michaniskin_ah ok
20:15michaniskin_yes i have some filthy code that sniffs ns decls
20:15michaniskin_but i don't feel good about myself when i think of it
20:16michaniskin_it makes me sad how clojure seems to get more complicated every release
20:16michaniskin_instead of more elegant
20:16Bronsareally? why do you say that?
20:16andyfYou are in good company, if it is anything like tools.namespace ns form detection
20:17michaniskin_well i make a lot of build tooling, and it just requires more and more filthy hacks every release
20:17michaniskin_i have a ghetto compiler basically to emulate the evaluation that's mixed up in the reader
20:18Bronsamichaniskin_: I'm just curious, examples of features added in recent releases that complicate it?
20:18michaniskin_::foo/bar is a big one
20:18Bronsathat's been there since 1.0
20:18michaniskin_also the stuff that supports that kind of thing in the destructuring forms
20:18michaniskin_tagged literals in source files
20:19andyfmichaniskin_: How do those features affect a build tool?
20:19michaniskin_because you can't manipulate source files without evaluating them in some way
20:19andyfMaybe you do want tools.analyzer :-)
20:19michaniskin_instead of being able to read lists like normal, you need a context in which to evaluate a minilanguage
20:19Bronsamichaniskin_: the only valid complaint I'll give you is the one about tagged literals, but that's been there for 2 years now
20:20michaniskin_if you do a lot of metaprogramming stuff these affordances really weigh on you
20:21michaniskin_anyway i know it's a minority opinion
20:21Bronsamichaniskin_: don't get me wrong, I can agree with you if you said that some things in clojure could be easier, I just don't agree on you when you say that it's getting more complex with every new release
20:22michaniskin_i don't want it to be easier, i want it to be simpler :)
20:22andyfI don't know exactly the goals your tool have, but I wonder whether there is a different approach that works better with Clojure, rather than at odds with it
20:22Bronsaforgive my loose usage of language, that was not my point though
20:22michaniskin_haha i know, i'm just pulling your chain :)
20:23michaniskin_but seriously this is how it seems to me, things getting easier but less simple
20:23Bronsaandyf: I guess the biggest source of "complexity" for tool writers for clojure is that clojure's evaluation model is form-at-a-time and that the namespace system is mutable
20:24michaniskin_Bronsa: yes, that, too. that's exactly right
20:24Bronsaandyf: it's much better for cljs `ns` is a special form and there's no way to intern something at runtime
20:25michaniskin_we're currently experimenting with that with boot
20:25michaniskin_using fresh clojure runtimes for each expression and so forth
20:26michaniskin_maybe what i need is a language that compiles to clojure
20:33andyfBronsa: I tried timing whole Eastwood crucible run with 1.7 alpha3 vs alpha4 and it went from 36.3 mins to 33.3 mins. Nice, but not huge.
20:34andyfI think of code speedups as opportunity to add more projects in :-)
20:41justin_smithamalloy: pr that fixes the privmsg triggers on lazybot submitted
20:41justin_smithalso, it is a clean history
20:42amalloy*chuckle*
20:42amalloyjustin_smith: you tested it?
20:42justin_smithyes indeed
20:42justin_smithbut feel free to double check my work, of course
20:43Bronsaandyf: yeah alpha4 has only load time enhancements, alpha3 had a big impact on runtime for t.a.jvm because of better caching in multimethods
20:46arrdemjustin_smith: r u havin a giggle there with lossy karma m8
20:46justin_smithheh
20:47justin_smitharrdem: note that that hasn't been submitted officially as a pr (yet?)
20:47amalloyjustin_smith: i think he is now not responding to PMs which are commands *or* inline hook things
20:47justin_smitherr...
20:49amalloyitym Raynes/lazybot#104
20:49lazybotcorrect privmsg handling -- https://github.com/Raynes/lazybot/pull/104 is closed
20:49arrdemhuh. didn't know about that command.
20:50amalloyarrdem: well, of course it's not actually a command but a hook: if he sees user/repo#issuenum in any message he says that
20:50arrdemjustin_smith: yo was this supposed to get comitted? https://github.com/noisesmith/lazybot/commit/a79782382763cef9cc00f08b8b03c621443742f0#diff-f3ec7c8cbebc04166e5e467a96fe641aR30
20:51justin_smitharrdem: damn, gotta fix that too, thanks
20:51arrdemnp
20:52justin_smiththis pr was not as ready as I thought it was...
20:53justin_smithamalloy: odd, I am sending anybot clojure commands and he is evaluating them
20:54justin_smithamalloy: he is evaluating regular commands but only when prefix is supplied...
20:55justin_smithand the only diff I see from upstream/master is the removal of that pprint
21:54Bronsaandyf: not sure if this will help you w/ eastwood, but t.a now supports early termination of walking at any point via reduced: http://sprunge.us/UNdd?clj
21:55andyf Nice. Can't think of where I'd use that, but will try to keep it in mind. Tend to just scan all the nodes.
21:55Bronsathe impl suffered a bit in readability but this is a great feature to have when needed
21:56Bronsaandyf: e.g. in the mexpansion-steps function I wrote a while ago for cfleming I used a dyn var to short-circuit walking after the first macroexpansion, this makes it possible to do that without it
21:57Bronsathen: https://gist.github.com/Bronsa/28720fbc280d661f91d7/007717a14f48488bc5e795b5ea45ea5af3322166#file-gistfile1-clj-L46-L47 vs now: https://gist.github.com/Bronsa/28720fbc280d661f91d7#file-gistfile1-clj-L44
22:00andyfToday I learned that using :raw-forms, your assumptions of what is there can be made wrong if someone uses their own custom macro expander, as tools.macro's with-symbol-macros does
22:01gfredericksdang symbol-macros
22:01gfredericksandyf: do you know if riddley does that too?
22:01Bronsaandyf: your assumption of my assumption? :P
22:02andyfI don't know about riddley.
22:02Bronsagfredericks: IIRC riddley's macroexpander matches clojure's
22:03andyfMy assumption. My approach to writing linters is to look at ast contents of one or a few cases, write some pattern matching conditions, and see what happens. Usually works well
22:03Bronsaah, gotcha
22:03Bronsaandyf: have you thought about using core.match for eastwood linters btw? could save you some trouble
22:04andyfFortunately this is "only" a linter, so if I don't catch everything possible, it is par for the course
22:04ztellmanriddley matches it, but also does inline expansion
22:05Bronsaztellman: I believe clojure's does too
22:05ztellmanBronsa: it doesn't
22:05Bronsa,(macroexpand-1 '(inc 1))
22:05clojurebot(inc 1)
22:05lazybot⇒ 9
22:05andyfThought about it, but haven't learned core.match yet.
22:05Bronsaouch.
22:05Bronsaztellman: weird, I assumed it did
22:05ztellmanso did I, until it bit me
22:05BronsaI guess it does inlining later during analysis
22:06ztellmanlikewise, (clojure.walk/postwalk macroexpand ...) doesn't do what it should in quoted forms
22:06ztellmanand a bunch of other things
22:06ztellmanbasically clojure.walk/macroexpand-all is badly named
22:07Bronsamacroexpan-all-and-maybe-more?
22:07andyfSorry, what is it in "riddley matched it "?
22:07ztellmanmacroexapnd-some-and-maybe-more
22:07andyfA subset of a superset of the right thing?
22:07Bronsaztellman: I know about the "maybe-more" what about the "some"? :)
22:07ztellmanBronsa: the inlined forms
22:07Bronsaah ok
22:08gfredericks"A subset of a superset of X" can be basically anything I think
22:08gfredericksthat must be the joke
22:08ztellmanandyf: I'm not following
22:08andyfThat's what I was going for
22:08Bronsawell the subset of the superset of x kinda approximates x
22:08gfredericksjoke explanations brought to you by gfredericks
22:08Bronsakinda sorta until it stops working
22:09andyfztellman: Earlier you said "riddley matches it ..." and I didn't understand the meaning
22:09ztellmanah! I mean riddly matches the compiler's macroexpansion behavior
22:09ztellman+e
22:10ztellmanthe clojure.walk version is both less and more than the compiler's macroexpansion
22:11Bronsariddley could be implemented in a couple of lines using t.a.jvm btw :P
22:12ztellmanBronsa: well, I'm actually using the LOCAL_ENV exposed by the compiler, so I'm more guaranteed to be accurate, but sure
22:12Bronsaztellman: that's true, yeah
22:13ztellmanI don't recall t.a.jvm being available at the time, though
22:13ztellmanmaybe I wasn't paying attention
22:14Bronsaztellman: it was still really alpha at the time
22:15Bronsait's unfortunate that the vals of &env leak compiler classes rather than an info map. luckly because of that almost nobody uses it (except probably ztellman and amalloy)
22:16ztellmanBronsa: the compiler was clearly never designed with extensibility in mind, I'd be overjoyed if that were changed
22:16ztellmanbut I'm only brave enough to poke at the compiler a bit
22:18arrdemmore or less convinced that the existing compiler is ossified by simple virtue of core not being interested in changes to it forget anything else
22:20andyfOther fish for them to fry, most likely
22:21andyfC-in-C seems to be taking shape nicely, though
22:21andyfThanks to someone whose nick rhymes with kadonsa
22:29cflemingWhile we're talking macroexpansion, is it true that if I want to accurately expand a subform inside some larger form, I would have to macroexpand all its ancestors from the top-level form down to the form I want, but should not have to macroexpand any of the siblings of those ancestors?
22:29arrdemunless your users are evil people who have non-toplevel defmacros
22:30cflemingUnfortunately I have to assume that all my users are potentially evil
22:30cflemingOr at least misguided
22:30andyfOther possible evilness that is rare: macros with side effects during expansion
22:31andyfE.g. gen-class if I recall correctly
22:31Bronsamidje does interning at macroexpansion for example
22:32cflemingI see - I actually did that myself while trying to write my macroexpand stepper, I used an atom to count when to stop.
22:32andyf gen-class writes to file system
22:32cflemingBronsa: I'll have to go back and look at your example again. The feedback I got was that naive stepping took too long and was tedious for large forms.
22:33cflemingBut it turns out to be quite hard to support accurate expansion of arbitrary subforms.
22:33justin_smithandyf: during macro expansion?
22:34Bronsacfleming: if you want to try https://gist.github.com/Bronsa/28720fbc280d661f91d7 out, behare that you'll need t.a and t.a.j from master
22:35cflemingThanks, I'll take a look. I'm a little worried about needing t.a. and t.a.j as a dependency since I'd have to load them into the user's REPL, but I might have to.
22:35andyfjustin_smith: Yes.
22:35justin_smithwow
22:35cflemingI wanted to use Riddley, but that was also slightly complicated by the need to load a Java class over a REPL connection.
22:37andyfcfleming: Eastwood uses a copy and rename hack to avoid namespace version conflicts with user projects. Not fun, but effective
22:37cflemingandyf: gen-class just writes the class files, right? Or does it write more than that?
22:37cflemingandyf: Yes, I'd have to do that, for sure.
22:37andyfcfleming: I think only 1 class file
22:37TEttingerI'm wondering if anyone with experience in uberjar internals would be able to make sense of this issue I'm having bundling JREs with Clojure Uberjars, but not Java Runnable Jars. https://github.com/libgdx/packr/issues/33#issuecomment-62863164
22:38TEttingerthat's a jump to the comment that gets to what I think the issue may be
22:41cflemingandyf: I assume proxy probably does as well - deftype/reify have built in forms so they don't have to.
22:42andyfI don't recall the others I found right now - keeping a list for future reference would have been a good idea
22:46cflemingI guess definterface etc as well - pretty much anything pre-protocols which generates a class
22:47Bronsacfleming: btw if you're interested in that, I think I can think of a way to do out-of-order macroexpansion with t.a.jvm
22:47Bronsacfleming: you're correct, yes
22:47cflemingBronsa: I am definitely interested in that.
22:48Bronsadeftype/defprotocol/reify do that at analysis time otoh
22:48cflemingI'm still not sure how the UI should work, but basically the desire is to be able to select a form for expansion, and have that expansion be as accurate as possible.
22:49justin_smithregarding proxy, I just did ##(proxy [Object] [] (toString [] "boo")) and did not see anything show up on disk
22:49lazybotjava.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to clojure.lang.DynamicClassLoader
22:49cflemingjustin_smith: Actually, proxy might just define the class from memory directly.
22:50cflemingjustin_smith: gen-class and definterface have to.
22:50Bronsajustin_smith: proxy aots only with *compile-files* true
22:50justin_smithcool
22:50cflemingto write to disk, that is.
22:51justin_smithcfleming: now that I think about it, it makes sense on an intuitive level that the constructs that directly deal with java stuff like classes / interfaces would construct things on disk
22:51Bronsacfleming: yes I think I understand what you need. I'm going to sleep now but I'll think about it & let you know if it can be done in a reasonable way
22:51cflemingBronsa: BTW Cursive can now mark vars that are not used anywhere in the project
22:51justin_smithwhile more abstracted stuff may not
22:51cflemingBronsa: Ok, thanks. I'm pretty busy right now, this will all be post-conj, so no rush.
22:53cflemingjustin_smith: Right, it's just a little odd that it happens in macroexpansion. It makes sense though since there's really no other time to do it without language changes.
22:54justin_smithyeah, a side-effect-free expansion stage would allow interesting tooling though
22:54justin_smithand simpler
22:54cflemingjustin_smith: Yeah, this is why I don't want to automatically macroexpand for Cursive's analysis
22:55cflemingScheme macros would be easier since that's a pattern matching system IIRC, it doesn't allow arbitrary code execution.
23:00Bronsacfleming: would you be able to add a metadata flag to the sub-form that needs to be macroexpanded? e.g. (foo (bar ^:mexpand-this (baz ..) ..) ..)
23:01cflemingBronsa: I was planning to, I can't see any other way to keep track of where you need to macroexpand.
23:02cflemingBronsa: I'm not doing anything with metadata yet, I'd actually like to be able to expand with full metadata, then I can hide it in the UI and selectively show what the user wants to see (full metadata, only type hints, etc).
23:03cflemingBronsa: But I think to do that I'd have to read from the top of the file for the metadata to be accurate.
23:08Bronsacfleming: you mean, for source-info metadata?
23:08cflemingBronsa: Right.
23:09cflemingBronsa: Plus whatever metadata previous macroexpansions have added, but I don't need to parse from the top of the file for that, just from the top-level form.
23:09Bronsacfleming: well, you could use tools.reader's IndexingPushbackReader :P you can specify the line/col offset in the ctor
23:10cflemingBronsa: Oh nice :)
23:11cflemingBronsa: It might be possible to get away without custom metadata, and just saying "expand the form at line 100, col 23"
23:11cflemingBronsa: That metadata should be preserved through expansions I think.
23:11Bronsacfleming: there might be ways to do that with the clojure reader aswell but I'm obviously going to promote my libs :P
23:12cflemingBronsa: Of course, I expect nothing else :)
23:12Bronsacfleming: yeah that should be possible aswell
23:12cflemingBronsa: Anyway, you should go to bed, this isn't urgent for me.
23:12Bronsaright.
23:22sm0keplay-clj is great, but it still feels very low level, i wish there was a higher level of abstraction for making games
23:22sm0kesomething like elm in clojure
23:28bbloomsm0ke: https://twitter.com/ClojureNYC/status/533435896939700224
23:29sm0ke$google github clojure reagi
23:29lazybot[weavejester/reagi · GitHub] https://github.com/weavejester/reagi
23:29sm0kebtw reagi is awesome, but the main problem lies in tying frp with game entities
23:31sm0keanyhow the paper on elm could be an intersting read
23:31sm0kethanks bbloom