#clojure logs

2016-05-22

00:47etiagoany Clojure gurus around to lend me a hand with this? http://pastebin.com/Xq7HksiY why don't I get any output?
00:47etiagoit's part of a larger thing, but I simplified it
00:48etiagoI would just like to print the references to those functions in trigger-cb-vector
00:51amalloyfor is lazy
00:52tolstoyetiago replace "for" with "doseq".
00:54etiagotolstoy: seriously? this whole thing was just because 'for' was not evaluating?
00:55etiagoamalloy: tolstoy: so... lazy means it would only evaluate once I would try to use its return value, is that so?
00:55tolstoyAs amalloy mentioned, `for` returns a lazy sequence, so it won't evaluate until something uses the values in it.
00:55amalloyetiago: yes
00:55etiagohah, yeah it works now :)
00:55amalloyin your -main you create a lazy sequence, and then throw it away
00:56etiagothanks tolstoy, amalloy!
00:56etiagoyeah... I haven't got used to lazy evaluation yet, it didn't even cross my mind
00:56etiago<-- clojure beginner
00:56tolstoyHeh. It can be confusing when you type that into the REPL, because it'll work!
00:57etiagotolstoy: exactly! I was debugging it and it did work, and in my program it didn't
00:57tolstoyThere's an implied print in there, which will then "realize" the lazy seq. read-eval-PRINT-loop. ;)
00:58etiagoand it's one of those "false friends" because I come from a declarative language background where for just... iterates. but 'for' in Clojure is a bit of a different story
00:58etiagoha yeah :D
01:07tolstoyThe other gotcha I've seen drive new folks crazy is (println "something") doesn't print the quotes. They think they have a string, but it's a symbol, or the opposite.
01:08etiagotolstoy: haven't ran into that before but thanks for the headsup :p
01:29Gh0stInTheShellWait cljs evaluates fractions as floating point and clj evaluates them as ratios?
01:31dysfunyes. cljs only has floats
01:31dysfun(because js only has floats)
01:32TEttingerdoubles?
01:32dysfunwell, they are doubles
01:32TEttingercan you do 1/3 in CLJS? is the numeric tower different?
01:32TEttinger,1/3
01:33clojurebot1/3
01:33dysfunthere are only doubles in cljs
01:33dysfunso that will come back approximately 0.33
01:33TEttingerouch
01:33Gh0stInTheShell,(defn square_root_three [] (loop [lower 1 upper 2 depth 50] (let [n (/ (+ upper lower) 2)] (if (== depth 0) n (if (< (* n n) 3) (recur n upper (dec depth)) (recur lower n (dec depth)))))))
01:33clojurebot#'sandbox/square_root_three
01:34Gh0stInTheShell,(square_root_three)
01:34clojurebot3900231685776981/2251799813685248
01:34dysfuncause with proper integers, we can build whatever binary structures we like
01:34Gh0stInTheShell,(double (square_root_three))
01:34clojurebot1.732050807568877
01:34Gh0stInTheShell,(time (double (square_root_three)))
01:34clojurebot"Elapsed time: 5.619722 msecs"\n1.732050807568877
01:35Gh0stInTheShell,(time (square_root_three))
01:35clojurebot"Elapsed time: 67.226463 msecs"\n3900231685776981/2251799813685248
01:35Gh0stInTheShell,(time (square_root_three))
01:35clojurebot"Elapsed time: 6.271845 msecs"\n3900231685776981/2251799813685248
01:35TEttingerha what...
01:35Gh0stInTheShelllol
01:35TEttingertiming isn't the most precise thing with IRC and printing
01:35Gh0stInTheShell:)
02:24idevanyone here written a Frege => Clojure compiler?
02:24idevI want the type checking of Frege, but CLJS's ability to generate JS code.
02:25dysfuni doubt it exists
02:25justin_smithas far as I know the only frege compiler is the one that generates java code
02:25dysfuncore.typed supports cljs
02:25idevcore.typed is very weird to use in practice (and quite slow the last time I tried it)
02:26dysfunyes, but since what you want doesn't exist, i'm giving you alternatives :)
02:26dysfunhowever, if you just want to generate javascript from a typed language, there are options
02:29tolstoyelm? purescript?
02:29dysfunelm is fantastic for beginners
02:30dysfunand lots of exciting research coming out of it at the minute
02:30dysfunthey have an entire project to improve their error messages
02:30idevpurescript's compiler is too slow
02:30idevand its dependence on bower/node/whatever is a mess
02:30idevelm is sorta-kinda-weak FRP
02:30dysfunhowever if i wanted types to build javascript, i'd probably use haste or fay (both haskell)
02:31idevfay doesn't support type classes
02:31dysfunhaste does
02:31idevhaste I kinda like, quite a bit faster than ghcjs
02:31dysfunghcjs tries to solve a bigger problem
02:31dysfunand because experience is king, i just can't use it yet
02:31idevbut I'd relaly like server side to have power of jvm
02:31idevso I'm looking at clojure and frege
02:32dysfunthen stop worrying about types
02:32dysfunclojure is the most integrated you are going to get on this
02:32idevI'm not smart enough to program without types.
02:32dysfunsure you are. if i can do it even though my brain doesn't wake up for several hours after i get out of bed, you can
02:33ben_vulpesdysfun: thoughts on typescript?
02:33dysfunben_vulpes: not even interesting.
02:33ben_vulpesreally! where does it fail?
02:34dysfunwell for a start it takes in javascript++ and spits out javascript
02:34dysfunyou have to like javascript to start with
02:35tolstoyIf you're going to go types, go advanced types?
02:35dysfunyeah, there's no point otherwise
02:36dysfuni don't like type systems as a concept, but when they're there, i'll use them to enforce invariants
02:36dysfunmost type systems just make you type a lot
02:36tolstoyhaha
02:37dysfuneverything is just a tool
02:38tolstoyMy biggest problems in code is organization, general architecture.
02:39tolstoyIf I learn enough to know I have the wrong approach, I'm not sure a sophisticated type system helps.
02:39dysfuninteresting, that's not a problem i experience except when i'm doing leading edge stuff
02:39tolstoyWell, I mean, if I have a big problem, "types" isn't it. It's architecture.
02:40tolstoyWhich is really a problem of Too Big.
02:40dysfunjust do what everyone else does and make it postgres' problem
02:41tolstoyI don't have a lack of solutions, but better types doesn't ever seem to be one of them.
02:42dysfun99 problems but lack of types aint one?
02:42tolstoyYikes! Clojure Remote vids are not high def!
02:42ben_vulpespostgres doesn't do much for my ui complexity.
02:42dysfunsure it does, it means every page starts to look like a table
02:43tolstoyYou all have seen that now ancient parody SQL on Rails?
02:43dysfunyup
02:44tolstoyOh, good. It's still on Youtube.
02:44tolstoyWebsite's gone, though. Lots of fun.
02:44dysfunshould've written it on top of access
02:46ben_vulpesthere's also the accidentally self-parodic aquameta
02:47tolstoyIs it possible to put a library out these days without a Brett Victor style rationale?
02:47dysfunwhat's special about his rationales?
02:51tolstoyI don't know. They seem low-key in tone, but high-brow in implication.
02:51tolstoyhttp://blog.aquameta.com/2015/08/28/introducing-aquameta/
02:51tolstoy"Software Development Complexity Bottlenecks Human Progress" -> therefore build a whole stack on Postgres. ben_vulpes is right. ;)
02:52dysfunwow, there's so much in that page that makes me not want to deploy it
02:52tolstoy"We believe that it is a social imperative, arguably one of the greatest demands of our time, to make software development more accessible to everyone."
02:53dysfunwell i do agree about the social imperative, but i'm not convinced he's gone in the right direction
02:53tolstoyHaving said that, here's my new UUID lib. ;) Eh. Just snarking for no good reason.
02:53dysfuni put in a rationale whenever it's not obvious why the user should give a fuck
02:54tolstoyI thought the light-table thing got caught up in the rhetoric a bit, then turned out to be an editor.
02:54dysfunhave you mixed up some of the talk about eve?
02:54dysfun(which was frankly underwhelming)
02:55tolstoyYeah, there's the rhetoric of it, and the reality.
02:56dysfunbut i can't fault the spirit they set out with
02:56tolstoyLightTable had some of that. I remember thinking it was going to be a whole new way of interacting with Clojure, but....
02:56dysfunheh, yes
02:56dysfunturns out that it's a very hard thing to do
02:56dysfun(yes, i've got projects on experimenting...)
02:57tolstoyI only complain about over-the-top rhetoric because I so want it to end up being true.
02:57dysfunyup. that's why my rationales include notes about when you may not want to use it
02:57dysfunrealism.
02:57tolstoyHeh. Any thoughts on that Arachne thing?
02:58dysfunwell i'm impressed he got it funded
02:59dysfunbut you know, we already have many http servers, html generation libraries, jdbc interfaces
03:00dysfuni have written three libraries that make jdbc less painful
03:00dysfunfor the amount of time he's going to have to give it attention, i'm expecting he'll settle for something activerecord-style
03:00tolstoyI'm kinda with yogthos' puzzlement: I just don't see what it adds. Yet another antidote as problematic as the poison it cures?
03:01dysfunyes, it's very confusing
03:01dysfunsince the amount of time involved for all of that is not that much, it's insane to think he can replace the world
03:01tolstoyTo me, every db-backed app is just a custom mini-language over JDBC. Just right for the job!
03:02dysfunwell i'm trying to change that :)
03:02tolstoydatalog for rdbms?
03:02dysfunmaybe one day
03:02dysfuni've tackled the toolchainy parts
03:02dysfuni'm currently procrastinating finishing my sql generation library
03:03tolstoyI remember sitting through the Pedestal talk and just being confused.
03:03dysfun(clojure data structures, pretty close to the language, designed for behind the scenes use)
03:03tolstoyThen react + cljs wrappers came along, and it as all clear (and superceded).
03:03dysfunyes, i still don't see the point of either pedestal or that other thing that claims to open up java apis as webservices easily
03:05tolstoyOn the other hand, I really like Luke's quiescent, though Magnar's PR to update to the latest React has languished for a month.
03:07tolstoyBefore it came along, I'd settled on a kind of "game loop" for CLJS UIs. Instead of React's render stuff, I just used dommy to do it the hard way.
03:07tolstoyIt was more about organization for me.
03:08dysfunreact + textboxes = disaster
03:08tolstoyOne namespace for updating state. Doesn't matter how crappy it is, it's in that one place. Etc, etc. Here's another for updating the UI.
03:08dysfunalso if you browse with a lot of tabs open, you can hear when you have react running
03:08tolstoyHeh.
03:09dysfunor ember. jesus that was slow
03:10dysfuni wonder if we could crowdfund an open source datomic-like
03:10tolstoyThe most convincing argument I've heard for Full Stack Clojure web stuff is that it provides solutions for stuff you don't have time to master, like auth, security, etc.
03:10tolstoyOh, that would be good.
03:10dysfuni could really use some paid work, but who wants to crowdfund someone they've never heard of?
03:11insamniaci'll do it!
03:11tolstoyIf you can put together a prototype, then you might be surprised.
03:11dysfunheh
03:11insamniaci've got at least 10 bucks
03:11dysfunit's tempting
03:11dysfuni would really like the product to exist
03:11dysfuni think a lot of people would really like the product to exist
03:12dysfunand the lack of the existence of it is why a lot of people don't stick with clojure
03:12tolstoySeems like if you know how to implement a persistent map, you're 1/2 the way there. The other 1/2 is datalog.
03:12dysfunwhich is mostly about learning datalog harder
03:12dysfunthere are only three datalog implementations on clojure toolbox
03:13tolstoyMaybe doesn't even need to be datalog especially.
03:13dysfundatalog is pretty cool
03:14dysfunfuck it, gonna play about
03:14tolstoydemo could just show EAVT saved to a data store, a transactor and peer, and the kickstarter is for datalog and produtionizing.
03:14tolstoyThat whole "datoms" thing would be good enough at first. ;)
03:14dysfunwell i was thinking local peer for the demo
03:16tolstoyconceptual transactor, I guess.
03:16dysfunyes
03:17tolstoyEven storing EAVT in a four column SQL table is really interesting.
03:17dysfunyes, i thought about that too
03:17tolstoyEnlightening, might be a better word.
03:17tolstoyI realized why the queries return just entity ids. Once you get that set back, you can then resolve them. Makes a lot of sense (for simplifying queries).
03:22dmilesit'd be nice if something like KnowdgeWorks existed in Clojure
03:23dysfunwhat's that?
03:24tolstoyThis? http://www.lispworks.com/products/knowledgeworks.html
03:24dmilesthat yes
03:24dmilesthat is actually a datalog env
03:34tolstoyLispWorks hobbyist edition 32bit $500. 64bit, $750.
03:36dmilessadly that is part of why i feel i have to write my own version
03:36dysfunthis is why i don't use lispworks
03:36dysfunand the smalltalks, some of the cool things are still spendy as well
03:38tolstoyIntellJ IDEA is $500 a year, so it's kinda inline with that.
03:38dmilesi brought KnowledgeWorks up since that is exactly what we want
03:38tolstoyOh, wait, that's biz users. Individual is $150.
03:38dmilesthe next ussue though.. is can you do an opensource project with it?
03:38dysfunand i wouldn't pay for IntelliJ either
03:39tolstoyYeah, sorry. Just curious about all those prices.
03:39dysfuneven if you can, would you?
03:39dmilesI mean Opensource that you and anyone you meet on the street can do code togehter in
03:39dysfunwhat's the point in opensourcing something built on something most people don't have?
03:39dmilesyup exactly
03:39tolstoyAh, because LispWorks isn't just the IDE, it's the actual runtime, right?
03:40dysfunthe licensing model is practically prehistoric
03:40dmilesRight my interest is the KnowlefgeWorkds rules system.. the stuff i want to work on opensourcewise is the rules peopel make
03:40dmilesand the bits of code the rules use
03:41tolstoyI suspect they're selling to a prehistoric market.
03:41dysfunprobably, yes
03:42tolstoydmiles: Sorry, yes, the rules stuff is interesting, but the Big Shiny is distracting. ;)
03:43dmilesone fun peice is i am cutting and pasting their docs into my systemsdocumation :P
03:44dmiles(and Cycorps documentation)
03:44dmilesbut i am very annoyed i even have to do this phase of recreationg that their stuff
03:45dmileswell annoyed there is not that level of a datalog system out there already
03:47dmilesi am told that there isnt due to the lack of utility and value of it :P
03:47dmiles(hehe)
03:48dmilesor from the other side of that coin is those few companies that possess the power of such a software system hide it for dear life (refering to cycorp)
07:01Kah0onaI have a ref, with a boolean. I basically want stuff to happen once that boolean becomes true, and block/park otherwise. I'm new to core.async, which functions should i use here?
07:01Kah0onafutures?
07:01Kah0onaalso; when said boolean changes to false again, it should stop 'stuff to happen'
07:04Kah0ona(I want to avoid any form of explicit busy-waiting if possible)
07:05dysfunsorry, you're trying to model this ref behaviour in core.async instead?
07:41dimon_hi, could any take a look? https://gist.github.com/jjmornim/8bebc673d0094b747ffdc7151fba8325
07:43dysfuni commented on it
07:44dimon_dysfun: tnx, man
07:44dysfunnp
07:50dimon_dysfun: not working properly
07:50dysfunhowso?
07:50dysfunoh i see
07:51dysfunfixed
09:10gourhello, i'm considering to learn racket and use it for desktop (gui) app. have no experience with either scheme or lisp, but wonder if someone if familiar with both, how does it compare with clojure, especially in regard to writing gui apps? i'm not very fond of java and java apps and did play with haskell in the past so like FP style in general. anyone?
09:21shiranaihitogour: well, with Clojure you could use Java's Swing for the GUI. With Racket.. is there anything comparable?
09:22gourshiranaihito: iirc, Racket has its own GUI which uses platform's native UI
09:22shiranaihitogour: so with OS X it would somehow use Cocoa?
09:23shiranaihitoi have no clue, but it would be surprising if it would be just as "full-fledged" for writing Mac UIs as using Cocoa etc through Apple's own tools
09:23gourshiranaihito: here is the info: http://blog.racket-lang.org/2010/12/racket-version-5.html
09:26shiranaihitook, but are there any examples of apps using that
09:28gourmaybe this: http://docs.racket-lang.org/gui/Windowing_Functions.html#%28part._.System_.Menus%29
09:31shiranaihitogour yeah, it looks kind of promising
09:31shiranaihitobut i'm still not sure it's a better choice than clojure
09:31shiranaihitoor.. let's say it's unclear that it would be :)
09:32gourshiranaihito: any pro/cons in reagard to racket vs clojure?
09:32shiranaihitono clue about racket, but at least clojure looks like a reasonably safe bet
09:32gourok.
09:33shiranaihitoit depends on your requirements / circumstances too ofc
09:33gourshiranaihito: let me explore web site etc.
09:33shiranaihitoe.g. what exactly do you want to accomplish (and why :p) and would doing something else be a better use of your time anyway :P
09:40gourshiranaihito: well in the past i tried with haskell (like FP); but there was too much of monads...otoh, i'd like to have some fun when working on a hobby project, have more type-safe language which is still (relatively) syntactically clean unlike things like e.g. Rust :)
09:40shiranaihito:P
09:41shiranaihitoif you're just exploring for fun and to learn a new language, i guess you can just go for it without worrying about the details too much :)
09:42shiranaihitoon the other hand, it would be nice if the language you learn would be suitable for getting stuff done in the real world too, so that your new skills could be applied towards that end later on :)
09:42shiranaihito.. and in that respect, clojure is a safe bet again :)
09:44gourok, i'll explore it a bit
09:49dysfunshiranaihito: Swing isn't going to have a native feeling ui
09:49shiranaihitodysfun true, but does he need one?
09:50dysfunwho knows?
09:50shiranaihitofor all we know, no one else will ever see his app
09:50shiranaihitoyeah.. so if we don't know, then we don't know that not having a native feeling UI will ever be a problem either, and so it's not all that relevant? :)
09:50dysfunbut to assume makes an ass out of u and me. oslt.
09:50shiranaihitowell.. who assumed and what? :P
09:51dysfuni'm just saying it's good not to assume that it isn't important
09:51shiranaihitobut it's good to assume it is? :P
09:51dysfuni didn't say that :p
09:52shiranaihitowell it's an assumption either way and assumptions are bad mmmm'kay? :P
09:52dysfunbut it is good to assume it's worth mentioning :)
09:52shiranaihitoit can't be if assumptions are bad! :P
09:52dysfuneverything is everything else.
09:53shiranaihitonow we're veering into r/philosophy -territory :P
09:53dysfunthe parentheses...manifold and fractal...
09:54shiranaihitoso how do you feel about Redux and the related ecosystem btw?
09:54dysfunredux?
09:54shiranaihitooh.. you've been spared.. :D
09:54shiranaihitook, nevermind :P
09:54dysfuni assume you're not talking of the only thing i know by that name
09:54shiranaihito(it's a "state management library" for javascript etc)
09:54shiranaihitooh? just messing with me or something?
09:55dysfunwell i think we can safely assume i don't like it even without reading it
09:55shiranaihitowell, you managed to confuse me with that mysterious comment.. care to elaborate?
09:55dysfunfirst comment: the only product i know called redux is an internal product at a company
09:56shiranaihitooh ok
09:56shiranaihitoit's not that then :)
09:56dysfunanyway, i'll save reading it by assuming it's
09:56shiranaihitohttps://github.com/reactjs/redux
09:56dysfunas bad as any other javasscript thing
09:56shiranaihitothis one gives you "predictable state" :)
09:56shiranaihito:P
09:56dysfunno it doesn't. it's clearly linked to react
09:56shiranaihitoyou're disappointed with javascript thingies? :p
09:57shiranaihitoreact is actually a good thing, btw
09:57shiranaihitoredux i'm not sure about, but it's got some neat ideas in it
09:57dysfuni think we're going to agree to disagree on this to save time.
09:58dysfunit is a matter of taste, therefore we can both be right
09:58shiranaihitodisagree on what? react being good?
09:59dysfunyes
09:59shiranaihitowell, i don't think it's just a matter of opinion
09:59shiranaihitoi'm not keen on a (lengthy) debate either, but it would be interesting to hear about your views on react
09:59shiranaihitolike.. why is it bad? :P
10:01jonaskoelkerI'm not intuiting the semantics of closures properly, see http://paste.debian.net/693856/ -- can someone explain or point me to a way of understanding what's happening?
10:01jonaskoelker(damn state)
10:02justin_smithjonaskoelker: why defn on line 4?
10:02jonaskoelkerjustin_smith: the real code involves mutually recursive functions (via post-delay on android). I'm not sure defn is necessary, but I would like to name my things
10:03justin_smithjonaskoelker: what's your question here?
10:04jonaskoelker"what's the minimal subset of the operational semantics of clojure which explains the difference in behavior?"
10:04jonaskoelker(... "between using defn and using fn")
10:04justin_smithjonaskoelker: oh, it doesn't work because you create foo twice - and the same foo is called by (f) or (g)
10:05justin_smithjonaskoelker: so this isn't about clojure, it's about the behavior of vars
10:05justin_smithdefn returns a var, when you call a var, it's latest value is looked up and called
10:05justin_smithso it always calls the most recent foo
10:05justin_smiththis difference has nothing to do with closures, it's just about what vars do
10:06jonaskoelkerlet me try and express that in my own words: counter has a scope, which the evaluation of (defn foo) mutates. On the second evaluation of (defn foo), the closure over the first atom becomes garbage.
10:06justin_smithif you did (def f @(counter)) (def g @(counter)) then you would see your expected behavior (but why use defn and create vars?)
10:06justin_smithjonaskoelker: no
10:06justin_smithvars are a mutable container, calling defn changes the contents
10:06justin_smiththat's it
10:07justin_smithyou aren't using the function directly, because you do not deref the var, so you always get the latest var contents
10:07justin_smithdefn foo doesn't mutate register, it just mutates foo (and the new foo points to a different register)
10:08jonaskoelkerso... is there an implicit global/per-function/... map of names to vars?
10:08justin_smithjonaskoelker: not implicit, explict
10:08jonaskoelkerthere's some context to that explanation which I probably don't (fully) know yet
10:08justin_smithjonaskoelker: vars are mutable globally accessible containers, that is their job
10:09justin_smithif you don't want that, don't call defn inside another defn
10:10jonaskoelkerI see, if I (eval foo) before (def f ...) it doesn't name-error
10:10jonaskoelkerthat is... interesting
10:10justin_smithright, the compiler creates foo when you define counter
10:10justin_smithbecause vars are not for locals
10:10jonaskoelkerso, what's the proper way to do named local functions?
10:10justin_smithjonaskoelker: let, or letfn
10:11jonaskoelkerI see
10:11justin_smithletfn allows mutual recursion, so I am guessing that is the one you want
10:12jonaskoelkerIs (defn bar ...) different from scheme's (define (bar ...))?
10:12jonaskoelkerI guess so too :)
10:12justin_smithyes, it is, because define in scheme is capable of creating locals
10:13justin_smithdefn is not
10:13jonaskoelkerI'll try to (assoc brain (not-predictive sicp-examples clojure)) ;-)
10:13justin_smithheh
10:14jonaskoelkerI'll probably prefer assoc!, but yeah :D
10:15justin_smithjonaskoelker: another thing that might help - after running your example, (= f g) returns true
10:15justin_smith(since they both point to the same var object - no two functions are ever equal in clojure)
10:16jonaskoelkerthat is unsurprising now that you mention it and I have though about it for 30 seconds ;)
10:18jonaskoelkerbtw, my question having been answered, about "so this isn't about clojure, it's about the behavior of vars" -- when & how would you use vars outside clojure?
10:18jonaskoelkerI guess you *can* via Java interop, but... why? What benefits do they provide, and at what cost?
10:18justin_smithjonaskoelker: I meant not about closures but about vars
10:19jonaskoelkeroh :)
10:19jonaskoelkereajy typo ;)
10:19justin_smithjava interop is used for the same reason you would use c ffi in scheme - to access a huge ecosystem of existing libraries
10:19justin_smithso we don't need to make things from scratch
10:20jonaskoelkerI get that. I meant using clojure vars from java (using java interop in the probably less used direction)
10:20justin_smithwell, if you want to access clojure values from java, you are going to need to access them via vars (even the function that returns a vale is in a var before you call it)
10:21justin_smith*value
10:23jonaskoelkerI see. So do namespaces have something like a Map<String, ClojureVar> baked into them?
10:23jonaskoelker(or just Var for short, I guess)
10:23justin_smithsymbol/var yes
10:23jonaskoelker"symbol/var"?
10:23justin_smithnot string to var, symbol to var
10:23jonaskoelkerah
10:24jonaskoelkerMap<texty-thing, Var> ;)
10:24justin_smith,(ns-interns *ns*) ; you can access the map
10:24clojurebot{}
10:24justin_smith,(defn f [])
10:24clojurebot#'sandbox/f
10:24justin_smith,(ns-interns *ns*)
10:24clojurebot{f #'sandbox/f}
10:24jonaskoelker,(f)
10:24clojurebotnil
10:25jonaskoelkerI got confused about , being unquasiquote(?) versus whitespace for a second :D
10:25justin_smithahh, right
10:25jonaskoelkerneatly, copy-pasting ",my-form-goes-here" to clojure --repl works as expected :)
10:26justin_smith,,,,,,(+,,,,,1,,,,1,,,,),,,,, ; don't do this in real code
10:26clojurebot2
10:26jonaskoelkerwhaa-eee? :(
10:26jonaskoelkerwhy would you *do* that?
10:26jonaskoelker:D
10:26justin_smithit's whitespace, that's all - just a very silly way to demonstrate that fact
10:26jonaskoelkerI understand that much.
10:27jonaskoelkereditor configuration: indent with tabs, spaces or commas? :D
10:28jonaskoelkernow that I have your ear, what's the difference between strings, keywords and symbols (under the hood)?
10:29justin_smithkeywords are self-evaluating, keywords and symbols are interned, keywords and symbols invoke get when used as a function
10:29justin_smithand symbols are resolvable
10:29justin_smiththat's the major stuff at least
10:29amalloysymbols don't necessarily have pointer equality semantics, which is what's usually meant by interned
10:30justin_smithamalloy: oh! I thought they were interned in clojure like keywords are
10:30amalloy,(identical? 'a 'a)
10:30clojurebotfalse
10:30jonaskoelkero.O
10:30justin_smithjonaskoelker: that just means they are equal, but not the same object in memory
10:31amalloythey can't be, because of metadata
10:31justin_smithahh! of course, that makes sense now, thanks
10:32jonaskoelker,(count (take-while identity (map identical? (iterate inc 0) (iterate inc 0)))) ; is that java.lang.Integer keeping the small ones identical, kinda' sorta' like what python does but in a different way?
10:32clojurebot128
10:33justin_smithjonaskoelker: iirc yes, the small ones are interned basically, the larger ones not - but amalloy is more likely to have the real dirt on that one than I
10:33amalloyi dunno about python, but yes
10:33jonaskoelkerISTR there being at *least* a java.lang.Integer.ZERO and .ONE, but I don't know about .ONE_HUNDRED_AND_TWENTY_SEVEN
10:34justin_smithjonaskoelker: this leads to a really weird stupid-jvm-trick where you can mutate 5 so it is equal to 4
10:34jonaskoelkermutable ints are the best ints :p
10:34justin_smithand braek just about everything in the process, of course
10:35jonaskoelkerintroducing a whole new *class* of off-by-one errors
10:35jonaskoelker;)
10:36jonaskoelkerI like how in python, True and False are just bound names in the builtins namespace, so you can say "True, False = False, True" and all hell breaks loose.
10:36jonaskoelkerbut mutating objects is even more evil
10:36justin_smithjonaskoelker: there's a weird one in the jvm
10:36justin_smith,(if (Boolean. "false") :yes :no)
10:36clojurebot:yes
10:36jonaskoelkerwat
10:37justin_smiththe answer here being, "never use the Boolean constructor"
10:37jonaskoelker,(boolean (Boolean. "false"))
10:37clojurebotfalse
10:37jonaskoelker,(boolean (Boolean. "False"))
10:37clojurebotfalse
10:37jonaskoelkerWHAT?!
10:37justin_smith,(= (Boolean, "false") (boolean (Boolean. "false")))
10:37clojurebot#error {\n :cause "Expecting var, but Boolean is mapped to class java.lang.Boolean"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Expecting var, but Boolean is mapped to class java.lang.Boolean, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6875]}\n {:type java.lang.RuntimeException\n :message "Expe...
10:37justin_smith,(= (Boolean. "false") (boolean (Boolean. "false")))
10:37clojurebottrue
10:38justin_smithnone of it makes sense
10:38jonaskoelker,(if (boolean (Boolean. "false")) :yes :no)
10:38clojurebot:no
10:38jonaskoelker:o
10:38jonaskoelker*!@^&#
10:38justin_smithjonaskoelker: so they are equal, but behave differently in an if check
10:38jonaskoelker@^#&$*!@$!!!!!
10:39justin_smithanyway, these things are actually refreshingly rare - but still totally daft
10:39jonaskoelkerhelp, I lost my sanity. Have you seen it lately?
10:39jonaskoelkerokay, two steps back. What is going on there?
10:40jonaskoelker,(= Boolean/FALSE (Boolean. "false"))
10:40clojurebottrue
10:40jonaskoelker,(.equals Boolean/FALSE (Boolean. "false"))
10:40clojurebottrue
10:40justin_smithjonaskoelker: boolean casts to an instance of Boolean, if only checks object identity, = checks value and not just object identity
10:41jonaskoelkerso clojure-if is "if (val != null && val != Boolean.FALSE)" ?
10:41justin_smithwait - I can express that fir part more clearly - the function boolean casts to one of the two canonical Boolean instances, the ones that are checked by identity
10:42justin_smithjonaskoelker: yeah, that sounds about right - looking it up because now I am curious
10:44jonaskoelkerhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L2696
10:44justin_smithjonaskoelker: well look at that, exactly what you suggested
10:45jonaskoelkeryay, I has a intuition :)
10:48jonaskoelkerso... (defn string2bool [s] (-> s Boolean. boolean)) and only ever use that?
10:48jonaskoelker,(defn string2bool [s] (-> s Boolean. boolean))
10:48justin_smithor maybe just never use the constructors
10:48clojurebot#'sandbox/string2bool
10:48jonaskoelker,(if (string2bool "false") :f :t))
10:48clojurebot:t
10:48jonaskoelkerwat?
10:49justin_smithreally one can usually get by with just using the literals, and if using a string you could usually use the reader
10:49justin_smithbut I guess if you need to turn a string into a boolean, the above makes sense
10:49jonaskoelkerif it's a string from the user (which they copy-pasted from the interwebs), I'd rather not invoke the reader
10:49justin_smith,(clojure.edn/read-string "false")
10:49clojurebotfalse
10:49jonaskoelker,(if (string2bool "false") :t :f))
10:49clojurebot:f
10:50justin_smithjonaskoelker: that is what the clojure.edn ns is for
10:50jonaskoelkerturns out I swapped the keywords I meant
10:50jonaskoelkerinteresting... I haven't looked at edn much, but my impression is that some thought went into it
10:50jonaskoelkerlike most clojure things :)
10:51justin_smithbig picture, clojure.edn only allows constructors that are whitelisted (the defaults are without known side effects) and has no read-eval option to turn on
10:53jonaskoelkerinteresting. This sounds like one of those few places where I would sleep better at night if I had a type checker prove the absence of side effects, but meh... even haskell has a cheat function (unsafePerformIO), so...
10:53justin_smithjonaskoelker: well, it's only about constructing value objects - it's a specific set of them allowed
10:53justin_smithhash-maps, sets, vectors, etc.
10:54justin_smithwe all hope none of those constructors have side effects, and so far we've not seen evidence of such bugs
10:54jonaskoelkeryes, I understand, but even so... I like proofs. That means I can be dumb and still do smart things :D
10:55justin_smithI think the best evidence that those constructors are side effect free is that our clojure code works? But no proof, right.
10:55jonaskoelkeragreed
10:55jonaskoelkerby the way, is there any kind of library which will let me turn a value from a process calculus into something I can execute?
10:56jonaskoelkerI'm contemplating modeling a UI in ccs and exploring the right-and-wrong-ness of my beliefs about the state transition graph.
10:56justin_smithwell, in a very abstract way that's what core.async is doing (but probably not the literal way you mean)
10:56justin_smithbut core.async is CSP - I don't know of CCP in clojure
10:57jonaskoelkerpotayto potarto, I hear Wadler says they're morally equivalent
10:57justin_smithin fact this is the first I have heard of CCP
10:57justin_smithhah, OK
10:57jonaskoelkerccp? you mean ccs?
10:58justin_smithoh, got all scrambled, sure
10:58justin_smithbut ccp exists too!
10:58justin_smithhttp://www.sciencedirect.com/science/article/pii/S0304397504006942 hah
10:59justin_smithbut while core.async implements CSP, it probably isn't the direct calculus tool you are looking for
11:00jonaskoelkeryeah, summary/paraphrase of what I heard on the net: core.async is based on CSP, but doesn't eval csp expressions
11:01jonaskoelkerthough... maybe... just like you can eval an arbitrary expression, maybe I could have a small symbolic program with hooks and async-eval it.
11:01jonaskoelkerand then put the heavy lifting in the hooks
11:02jonaskoelkerit's funny, when I began uni studies in 2004, I was like "C is cool! Python is cool! formal models is bs, and I can manage state perfectly well", and now I'm leaning much more in the other direction
11:03jonaskoelkerand I did a startup from right-after-uni (2012) to 2015-sep writing in python, so I was probably still going "python is cool" back then.
11:03jonaskoelkerWell, I better go watch https://www.infoq.com/presentations/core-async-clojure :)
11:04justin_smithI think most of us end up needing to learn the hard way that state doesn't scale very nicely.
11:04jonaskoelkerand also https://www.infoq.com/presentations/clojure-core-async
11:05jonaskoelkerwe also get dumberer as we age, so maybe the truth was less true for us when we were younger
11:05jonaskoelkeroh, how I love confounds :-\
11:05jonaskoelkerdamn you, confounds, for complecting truths!
11:06jonaskoelkeror rather, damn you, world, for being so complected :)
11:10jonaskoelkerI'm going to listen to Rich and cook food. Nice chatting with you, Justin, and thanks for the help :)
11:16dysfunjustin_smith: holy crap i just saw your new twitter avatar. you have a beard now
11:17dysfunwe can officially let you at the unix system
11:17justin_smithit's pretty long actually, I've had it for about 3/2 years
11:27jonaskoelkershit, I just shaved. Do I have to use windows now? :(
11:27dysfunhaha
11:27dysfunjustin_smith: you can use BeOS if you want
11:28dysfunOS/2?
11:31engblomOS/2 was really amazing for its time. You could format a floppy and still get stuff done while it happened.
11:31engblomAll stuff from MS became really slow as soon as you were writing anything to a floppy
11:31dysfunbeos too
11:32engblomYep
11:32dysfunbeos was quite shiny for the time and yet it was fast
11:32engblomSadly neither of them managed to crush the monopoly of MS
11:32engblomI was also playing a bit with BeOS during those times
11:34engblomDuring that time, alternative OS had a big disadvantage: Lack of proper office suite
11:34ridcullyos/2 hat the lotus stuff
11:34ridcullys/hat/had/
11:34engblomOh, yes they had Lotus
11:35ridcullyami word somethingsometing
11:35engblomBut if you ask me, lotus was terrible
11:37dysfunyes it was awful
11:37dysfunreally really awful
11:38engblomHmm, apparently staroffice existed for OS/2. Too bad it was so little known during that time.
11:39ben_vulpesdysfun tolstoy dmiles: neat thread
11:39engblomIt was 1998 I for the first time found staroffice. Then I already had begun playing with Linux
11:41justin_smithI've survived this far without needing an office suite, I've got high hopes this can continue.
11:42ben_vulpesdrive is a miserable miserable miserable office replacement
11:43ben_vulpesi never thought that i'd actually miss capital-e excel
11:43ben_vulpesbut holy fuck google spreadsheets a pos
11:43dysfunexcel is actually pretty amazing
11:43ben_vulpesapple's numbers idem.
11:43ben_vulpesdysfun: it is almost as though the product owners actually watched power users driving the thing for inspiration!
11:43dysfuni can only assume noone who develops openoffice has used excel in a few years
11:44engblomjustin_smith: It depends on your work. Much can be done in other ways. I have even made several issues of an magazin in LaTeX. Still for some stuff an office suite saves you a lot of time
11:44ben_vulpesengblom: like collaborating with normies?
11:46engblomben_vulpes: For example. Yesterday I had to quickly write down a food recipe my wife will use today at a course. It would have taken far longer time in LaTeX. Or if you need to quickly calculate some stuff, a spreadsheet might get you to the result faster than other methods
11:47ben_vulpesso true
11:48ben_vulpesand it's so easy to do scenario planning in spreadsheets too
11:48ben_vulpesnightmare to maintain tho
11:49engblomI hate how spreadsheets are misused as databases. But they are great for quickly calculating stuff, like total price before talking with a customer
11:49dysfunwhat spreadsheets need is refactoring tools
11:51engblomWhen I was designing an ocarina 3D model, I quckly used a spreadsheet for calculating all frequencies and the inital hole sizes.
11:52engblomIt would have been taking a lot of time to put together a program for the same task.
11:54ben_vulpesengblom: cadcam proggy should handle that.
11:55ben_vulpesbut if we balk at the 750 for a corporate single user lispworks license, i shudder to think what the response would be to the 8k list price for inventor.
11:55dysfunbollocks to that
11:55ben_vulpesare there any neat tricks for working with maps with the same key names?
11:56dysfunwhat do you mean?
11:56ben_vulpeseg a user map and a topic map in my test ns (representing harness data) both have a "name" key
11:56ben_vulpesso destructuring clobbers.
11:56dysfunoh i see what you mean
11:57justin_smithben_vulpes: you can destructure maps without using :keys
11:57dysfunyou can move to using the map-form destructure instead of :keys
11:57ben_vulpesmap form destructure
11:57justin_smith,(let [{a :a {a' :a} :b} {:a 0 :b {:a 1}}] [a a'])
11:57clojurebot[0 1]
11:58ben_vulpesaha
11:58justin_smithit's like a mirror image
11:58ben_vulpessure
11:59justin_smithit can be mixed with :keys too
11:59ben_vulpesi'm wondering if it wouldn't be more legible if i pulled keys out in place though
11:59ben_vulpesyo dysfun have you ever worked with the pro cadcam packages though?
11:59justin_smith,(let [{a' :a {:keys [a]} :b} {:a 0 :b {:a 1}}] [a a'])
11:59clojurebot[1 0]
11:59dysfunno
11:59dysfuni have worked with a cheap one
11:59ben_vulpesthey are *entirely* worth the cost.
11:59dysfunit was alright actually
12:00ben_vulpeswhich one?
12:00dysfunpro/desktop
12:00ben_vulpesand was *everything* parametricizeable?
12:00dysfunno, it was cheap and designed for studnets
12:00ben_vulpes> creo
12:01ben_vulpesyeah notgreat.winrar
12:01ben_vulpesi was spoiled as a child
12:02ben_vulpescannot use not-perfect cadcam
12:02ben_vulpesif it takes more than 3 keystrokes to parameterize a thing and link it to another value at the same tree level as i'm working i'm inclined to throw the workstation out a window
12:03ben_vulpesif i want to tie it to a sketch in a dimension in another part i am willing to open the tree
12:03ben_vulpesbut by god there better be a tree that goes all the way down to the feature level for every single part
12:03ben_vulpesaccessible from the assembly view
12:03ben_vulpesor seriously gtfo
12:03clojurebotHuh?
12:03dysfunmy laptop used to take 45s to get to a repl
12:04jasonmasonhuh
12:04ben_vulpesmy laptops are on a ~2 year depreciation cycle
12:06dysfunmine were when i had money
12:06justin_smiththis laptop is on year 4, still better specs than a new macbook pro
12:06ben_vulpesthe depreciation cycle is to avoid giving the irs the impression that i have money
12:06ben_vulpesjustin_smith: what do you hack on?
12:07dysfunthis desktop i'm borrowing is 4 years old but it's fast as
12:07dysfunalso i plugged an ssd into it
12:07justin_smithsystem76 bonobo, 32 gigs ram, 8 cores
12:07dysfuni have 16GB RAM, 4 hardware cores, 8 virtual cores
12:07justin_smith256gb sd plus a 1tb hd
12:08ben_vulpeshuh and it linuxes adequately?
12:08dysfuni'm actually running freebsd
12:08justin_smithben_vulpes: system76 only ships with linux installed, that's their whole deal
12:08ben_vulpes> matte display
12:08ben_vulpesbe still my heart
12:08ben_vulpesdysfun: was talking to justin_smith
12:08dysfunsystem76 laptops are just rebadged clevos with ubuntu installed and configured
12:08justin_smithyeah, I have the matte display too, it's awesome
12:08jasonmasondysfun wat, repl takes 45s to start on that machine?
12:09dysfunjasonmason: no, this is the desktop i am borrowing. my almost 3 year old macbook air takes that long
12:09jasonmasonah
12:09ben_vulpesjustin_smith: how much neckbeard flak does it catch for binary crud?
12:09dysfuni have to hand it back soon and moving onto a core 2 duo with 8 gigs of ram
12:09justin_smithben_vulpes: you're the first one to ask, but I guess I don't go around in neckbeard circles that much
12:10dysfunonly one of the system76 laptops doesn't require nvidia binary drivers
12:10justin_smithben_vulpes: but I have been drooling over the new purism machines
12:10ben_vulpesnot like i give much of a shit, just curious
12:10ben_vulpesdysfun: and the towers?
12:10dysfuni have no idea
12:11justin_smithin fact a big reason for getting this machine was to have big graphics capabilities (lots of high res displays) with linux, without wanting to kill myself because it's all just set up for me.
12:11dysfunoh the first tower i clicked on (ratel pro) comes with option of intel graphics
12:11ben_vulpesdysfun: are those open?
12:11justin_smithyeah, they have laptops with intel too, I explicitly didn't want intel
12:11ben_vulpesjustin_smith: why no intel?
12:12dysfunintel is about as open as it gets, which is to say they publish specs
12:12justin_smithbad / weak graphics
12:12dysfunhow often do you actually use graphics that intel couldn't handle?
12:12justin_smithnot often any more :P
12:12dysfunand that's why i go intel
12:13justin_smithbut the intel boards don't let me run 4 monitors like this one does either
12:13dysfun4 monitors?
12:13justin_smithbut that might just be circumstantial and not a limitation of on-board intel per se
12:13dysfunone does me
12:13justin_smithyeah
12:13dysfuni would like it to have more resolution though, this is a cheap 1080p display
12:13ben_vulpesi could probably settle for two
12:13justin_smithor they didn't when I was shopping, or I didn't look hard enough
12:14ben_vulpes1080p gross
12:14ben_vulpesso effectively a portable tower.
12:14ben_vulpesneeds a monitor to be useful.
12:14dysfunwhen i am unpoor i am going to buy myself a nice new desktop and a nice 4k monitor
12:15jasonmasonhow well are high ppi displays supported under linux
12:15ben_vulpesi'd probably be happy with a meerkat
12:16dysfuni imagine they mostly just work provided you have acceptable graphics drivers
12:17jasonmasonbut "just works" being what? tiny letters, with same definition as on lower ppi monitors?
12:18dysfunmore pixels in the same space. i think you're saying an equivalent
12:19ben_vulpesjasonmason: do you want it apple style? where it ships in "old and blind" mode?
12:19ben_vulpesscuse me i mean "large shiny and juicy" mode
12:20xtreakhttps://clojuredocs.org/clojure.core/cast#example-542692cdc026201cdc326ccd is throwing an error for me. What is the cast syntax?
12:20xtreak,(cast Integer 1)
12:20clojurebot#error {\n :cause "Cannot cast java.lang.Long to java.lang.Integer"\n :via\n [{:type java.lang.ClassCastException\n :message "Cannot cast java.lang.Long to java.lang.Integer"\n :at [java.lang.Class cast "Class.java" 3176]}]\n :trace\n [[java.lang.Class cast "Class.java" 3176]\n [clojure.core$cast invokeStatic "core.clj" 351]\n [clojure.core$cast invoke "core.clj" 346]\n [sandbox$eval25 invo...
12:21justin_smiththat makes sense, in clojure 1 is a Long not an Integer
12:21justin_smithfor converting, use int
12:21justin_smith,(int 1)
12:21clojurebot1
12:22jasonmasonben_vulpes yeah i much prefer that over font that is too small to be readable
12:22justin_smithxtreak: cast in clojure will mostly be for things like nil and when you are using weird APIs, I think
12:22justin_smith,(cast Integer nil)
12:22clojurebotnil
12:23xtreakThanks. The docs use the syntax for casting. Guess that example is a little confusing.
12:23justin_smithxtreak: also cast doesn't change the type of the input - it just throws an exception if it's the wrong typ
12:24justin_smith,(cast Number 1) ; since Long is a subclass of Number
12:24clojurebot1
12:24justin_smith,(type (cast Number 1))
12:24clojurebotjava.lang.Long
12:25justin_smithxtreak: definitely a documentation bug in that example
12:26xtreakThanks. was trying out the same in the repl :) will raise a pull request. Can I copy over your comments too?
12:26justin_smithsure! though we can skip the whole nil / weird APIs one I think, that's not actually what it's about at all
12:28Morgawrhow would I test if a parameter is an atom, in clojurescript?
12:28MorgawrIn clojure you can do (instance? clojure.lang.Atom my-param)
12:28Morgawrdoesn't seem to work in Clojurescript though
12:29dysfunwell for a start it's called cljs.core.Atom
12:29dysfunin cljs
12:29Morgawrah, that might be it, then
12:29dysfunbut iirc that won't help you
12:29dysfuntry it
12:29Morgawrdysfun: seems to have worked, thanks! :)
12:30dysfuncool :)
16:00jonaskoelkerHi all. I'm trying to build an android project with lein droid doall, and get "No such var: u/update-vals" right after "Compiling cider.nrepl". Does anyone have an idea what's going on?
16:00jonaskoelkerThat's with "compiling:(cider/nrepl/middleware/util/meta.clj:64:8)" which says "u/update-vals" at l64 c8 but also [cider.nrepl.middleware.util.misc :as u] in the (ns ...) block
16:01Gh0stInTheShelljonaskoelker: I don't know, but I'd like to know what you find out. :)
16:01Gh0stInTheShellI'm just getting ready to start trying to use lein droid
16:02jonaskoelkerI copied a thing from the net with some :aot-exclude-ns, including cider.nrepl; what's up with that?
16:03jonaskoelkerif I add #"cider.nrepl.middleware\..+" and #"cider.inlined-deps\..+" to the excludes I copied, things compile fine, but then emacs gets angry when I cider-connect
16:03jonaskoelkersaying very hurtful things, like "WARNING: CIDER requires nREPL 0.2.12 (or newer) to work properly" and "WARNING: CIDER's version (0.13.0-snapshot) does not match cider-nrepl's version (nil). Things will break!"
16:04jonaskoelkerwhich makes me a sad panda
16:04Gh0stInTheShelllol
16:10justin_smithjonaskoelker: in general, the clojure side deps and the elisp lib must agree, but until some very recent versions, you have to make them match by hand
16:12justin_smithjonaskoelker: CIDER's good and bad points are the same thing: it prioritizes features over stability - when I was using it every in-place update would break my install and I had to do a clean slate to make it work again (including gettign rid of any elc files) because the abi lacked backward compatibility
16:52jonaskoelkerso... do I just $ rm ~/.emacs.d/elpa/cider-*/*.elc?
16:52justin_smithand make sure the versions match, that should do it
16:53justin_smiththe lein plugin and elisp versions, that is
17:02jonaskoelkerare 0.13.0-SNAPSHOT and 0.13.0-snapshot different?
17:04jonaskoelkeroh well, the lower case version doesn't resolve when I build. I still get nil as the cider-nrepl version
17:04jonaskoelkerbut I put cider.nrepl in my :aot-exclude-ns -- when I don't, I get compile errors
17:05jonaskoelkerException in thread "main" java.lang.RuntimeException: No such var: u/update-vals, compiling:(cider/nrepl/middleware/util/meta.clj:64:8)
17:05justin_smithjonaskoelker: the lower case is a typo
17:05jonaskoelkeroh, I already said that
17:05jonaskoelkerin the 'WARNING: [...] bit', yes?
17:05justin_smithyou shouldn't have cider in normal deps, it should be a dev-only thing (which is implicitly no-aot)
17:05justin_smithyeah, typo in the warning
17:06jonaskoelkerbut nrepl should be in deps?
17:20jonaskoelkerIn *nrepl-messages localhost* (:9999 fwd to :9999 on my phone) I see this: http://paste.debian.net/694803/
17:21jonaskoelkerso apparently, it would appear that maybe I'm running nrepl 0.2.10 on my phone?
17:51justin_smithjonaskoelker: I said normal deps - eg. cider stuff (and most of the time even nrepl itself) should be specified for the :dev or :repl profile only, and ideally it's added in your personal profiles.clj so that your collaborators don't have to live with your dev tooling decisions
17:52justin_smithand things in :dev or :repl are not aot compiled for lein run or lein uberjar
17:58jonaskoelkerprofiles @ http://paste.debian.net/694839/ and project @ http://paste.debian.net/694840/ -- do they look right?
18:00justin_smithI would typically put things like piggieback and tools.nrepl and cider-nrepl in :dev or :repl, not :user - I forget whether :user ends up in aot, but :dev should be ignored during aot
18:03jonaskoelkerdone. I'm building with 'lein droid doall', which doesn't include :user
18:03justin_smithoh, OK
18:04jonaskoelkerother than that, it looks good?
18:04justin_smithyeah, looks fine
18:05jonaskoelkerdo you have an idea why I see >> version-string "0.2.10" << in my nrepl traffic?
18:06jonaskoelkerI'm thinking _something_ is putting a bad version of nrepl on my phone, but what?
18:06jonaskoelkerI even removed 0.2.10 from ~/.m2/..., but I still get 0.2.10
18:06justin_smithyou could look at `lein deps :tree' and check out the version conflicts
18:06justin_smithremoving or adding to m2 directly will never effect your deps when using lein
18:06justin_smithif lein doesn't find the version it thinks you need, it will download it
18:07justin_smith(or simply fail and say the version doesn't exist if that doesn't work)
18:07jonaskoelkerhttp://paste.debian.net/694851/
18:07jonaskoelker0.2.10 didn't come back, so I infer that lein didn't re-download it
18:08justin_smithjonaskoelker: lein doesn't check m2 to decide what to use
18:08jonaskoelkerright, put it puts its downloads there, yes?
18:08justin_smithsomething might have fixed your issue, but I promise deleting the file did not do it
18:08justin_smithright, it does
18:08justin_smithI guess I misunderstood your point there
18:09jonaskoelkerdepends, it wasn't clear (I think) from "I even removed .." but perhaps from later on :)
18:09jonaskoelkererr, my issue isn't fixed
18:11jonaskoelkerdo you know how to trace which nrepl goes into the shipped blob (of .apk flavor)?
18:11justin_smiththere's lein deps :tree to see how lein picked each dep to use
18:11justin_smithand another version for plugin deps (I forget how that one works)
18:13jonaskoelkeroh this is fun, I just did a "lein clean;lein droid doall" and now I get different errors :(
18:13justin_smithugh, caching sucks
18:14jonaskoelkerlein deps :plugin-tree is the one you mean, I take it
18:14justin_smiththat's the one
18:18jonaskoelkerNow I face "Caused by: com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)"
18:18jonaskoelkerdo you happen to know the fixing spell on the top of your head?
18:19justin_smithI don't know the android stack stuff, sorry to say
18:19justin_smithbut "cafebabe" sounds like a placeholder that didn't get properly filled in (I would use "deadbeef")
18:19jonaskoelkerI think it's plain old java stuff; "cafebabe" is the magic number (see file(1)) for .class
18:20justin_smithI know what magic numbers are
18:20jonaskoelker*thumbs up*
18:20justin_smithI am saying, if I was picking a placeholder... I would pick something like that
18:20justin_smithbut really, I don't know that error, sorry
18:21jonaskoelkerwhat I'm saying is: I'm fairly confident that cafebabe isn't a poison pattern, it's the right value
18:22justin_smithoh, cafebabe is the standard for class files, hah
18:22justin_smithnever mind then.
18:26justin_smithjonaskoelker: perhaps you pulled in compiled stuff that is incompatible with your java runtime version?
18:28jonaskoelkeryeees. It appears cider is java 1.7+ and I was building for java 1.6
18:29justin_smithI'd guess more likely the android stuff rather than cider? but yeah sounds right
18:29jonaskoelkerwhen I remove the cider :plugin it all works, except of course for cider-connect :\
18:30jonaskoelkerOh well, time for some experimentation with flipping switches and stuff :)
18:34jonaskoelkerdoing ":plugins [#_[cider/cider-nrepl "0.13.0-SNAPSHOT"]]" in :android-user seems to have done the trick
18:34jonaskoelkerin that it builds and runs and I can connect to the repl
18:34jonaskoelkerbut still, version-string "0.2.10" and ugly warnings
18:35justin_smithahh, so it's a fundamental incompatibility between the android and cider stuff
18:36jonaskoelkerI'm not sure. It looks to me like a wrong version of a dependency gets pulled out of nowhere and baked into my .apk
18:37justin_smithjonaskoelker: could be bad packaging, a dep that ships with some of its deps built in
18:37justin_smithand thus forcing a bad version on you
18:37jonaskoelkercan I grep through that somehow, somewhere?
18:38justin_smithjonaskoelker: you could maybe look at where the dep is in your classpath, at runtime
18:38jonaskoelker$ find ~/.m2 -name jar -exec jar xvf '{}' | grep nrepl
18:38jonaskoelker^_^
18:38justin_smithjonaskoelker: if it's the problem I am describing, it would be a class file or jar baked into a jar you are using
18:38justin_smithjonaskoelker: so if you looked for the classpath where that dep came in, you would see which jar it was in...
18:39jonaskoelkermy understanding of .apk is that it's everything bundled up. I don't think I have an nrepl on my phone separate from the one I push
18:39justin_smithright, you want to bundle all your things
18:39justin_smithwhat I am saying is that a lib that is badly packaged can force you to use a bad version by bundling a dep
18:39jonaskoelkerI understand that...
18:40justin_smithOK
18:40jonaskoelkerhere's a snippet from my "DEBUG=1 lein droid doall" output http://paste.debian.net/694914/
18:40jonaskoelkerit seems to point at nrepl 0.2.12
18:40jonaskoelkerbut I should probably walk down dependecies
18:41justin_smithjonaskoelker: you can also get the path where a dep is found at runtime in the repl - I'm looking it up now
18:42justin_smith,(.getResource clojure.lang.Atom "") ; do this with a class that ships with nrepl
18:42clojurebotnil
18:43justin_smithwell in a repl you would get the actual resource
18:43justin_smithmust be a security thing on clojurebot
18:46justin_smithjonaskoelker: user=> (.getResource (class clojure.tools.nrepl.server/start-server) "")
18:46justin_smithjonaskoelker: #object[java.net.URL 0x51edba41 "jar:file:/media/justin/806084F16084EEEA/m2/repository/org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar!/clojure/tools/nrepl/"]
18:47calligraffitit
18:47calligraffitit
18:48jonaskoelkerjustin_smith: (.getResource (class clojure.tools.nrepl.server/start-server) "") => nil
18:48justin_smithcuriouser and curiouser
18:49justin_smithjonaskoelker: I assume if you check eg. clojure.core/+ instead, you see the path to the clojure jar it loaded
18:49jonaskoelkerstill nil
18:50TEttingeroh resources may be weirdly different in APKs
18:50justin_smithTEttinger: fascinating
18:51TEttingerheh. I know that on Java, some "special" handling is needed for filesystem differences between android and desktop Java
18:51ealfonsoif my dependencies i project.clj change, how do I 'fresh' those in the cider repl?
18:51justin_smithoh, right
18:51ealfonsos/fresh/refresh
18:52justin_smithealfonso: as I remember it there is a command to pull in new deps, but nothing that will change a dep version or remove a dep
18:52TEttingerAPKs, like JARs, don't allow you to write to their contents, but I think APKs have a different way of loading resources... hopefully a better one than the classloader package-relative-sometimes crap on desktop
18:52justin_smithbut I also don't remember the command name / shortcut
18:53ealfonsojustin_smith right now i'm killing and re-starting the repl, which is annoying
18:55jonaskoelkerealfonso: cider has a ,refresh thing, but that may be a cider-only thing
18:55jonaskoelkerotherwise I have heard (vaguely) about https://github.com/clojure/tools.namespace
18:56justin_smithjonaskoelker: tools.namespace cannot pull in new classpath deps
18:56jonaskoelkeroh *derp*
18:56justin_smithpomegranate can, or the more friendly pallet/alembic wrapper to it
18:56justin_smithbut those don't come with cider iirc - cider has its own deal that loads classes
18:57justin_smithpomegranate will actually go and download a new dep then load it
18:59jonaskoelkerI have all the classes that went into my apk in ./debug/classes/org/clojure/tools/nrepl, might that help?
19:01jonaskoelkerhey wait!
19:02jonaskoelkernrepl.clj constructs version-string by getting a resource, (when-let [in (.getResourceAsStream (class connect) "/clojure/tools/nrepl/version.txt")] ...
19:02jonaskoelkerversion.txt is 0.2.12 -- but maybe getting the resource goes ookie
19:02justin_smithjonaskoelker: oh wow - so it is eerily related to my attempt to help failing in that way
19:03justin_smithfun coincidence
19:03justin_smithsounds like a bug for tools.nrepl?
19:06jonaskoelkercould be
19:12jonaskoelkercan I point lein to a hand-rolled tools.nrepl jar?
19:13jonaskoelkerI might hard-wire the resource value into stuff just for funzies
19:13justin_smithjonaskoelker: absolutely - clone the repo, change the version string in project.clj, run lein install
19:13justin_smithwell after making your other source changes of course :)
19:15jonaskoelkerthat sounds way too clean :D I was thinking about editing the *jar* file :D
19:28jonaskoelkerwould have been too easy, wouldn't it :\
19:28jonaskoelkerI still get "0.2.10"
23:36tolstoySpeaking of Excel, worked with a finance guy to said he HAD to use windows because Excel + Basic was the killer app he couldn't do without: and no basic on the Mac version of Excel.
23:36tolstoyOn the other hand, some people use it to create tables and use a calculator to plug in the right values. ;)
23:51TEttingertolstoy: ?
23:51tolstoyReferring to a conversation 12 hours ago. ;)
23:52tolstoyMade me realize that Excel is the IDE / Shell "for the rest of us".