#clojure logs

2014-09-09

00:26arrdem&(count (for [x (range 9999)] (zero? (mod x 2))))
00:26lazybotExecution Timed Out!
00:33justin_s`&(count (for [x (range 9999)] (zero? (mod x 2))))
00:33lazybotExecution Timed Out!
00:40elarsonI was trying to give core.async a try and I get this error: reduce already refers to: #'clojure.core.async/reduce in namespace
00:40yedidoes anyone know why the macro go isn't being recognized in cljs? (https://gist.github.com/yedi/42dad0640f57327b16ea)
00:41yediwhenever i uncomment that section, i get a cannot read property 'call' of undefined at line 22
00:41yedigo-loop seems to work fine however
00:42yedinvm, looks like the error is within the go block and debugging it is just janky
00:55J_Arcanewhich JDK should I be running for Clojure on windows?
01:07maxthoursieelarson: there's a reduce function in core.async, which is also in core, if you import both, you'll get a clash
01:07joshuafcole_Is destructuring capable of taking a map and destructuring it into a vec with keys in the order given?
01:08joshuafcole_e.g. I'd want something like (bogus synax)
01:09joshuafcole_(let [[:keys [x y]] point]) ; -> [(:x point) (:y point)]
01:09maxthoursieelarson: I would recommend [:require [core.async :as async]] or similar
01:11joshuafcole_I guess I'm probably just trying to be too clever about it. There isnt' really a good way to get a symbol in there to name the list anyway.
01:12maxthoursiejoshuafcole_: (let [{:keys [x y]} point] [x y]) ?
01:13maxthoursieJ_Arcane: dont think it matters much, what is your choices?
01:14maxthoursieJ_Arcane: I've used the latest JDK7
01:15joshuafcole_maxthoursie: yeah, I think that's the closest I can get. Thanks!
01:17dorkmafialet's say i created a library project for myself to use lein new mylib how do i reference mylib in another project? :)
01:17maxthoursiejoshuafcole_: or something like ((juxt :x :y) point)
01:17maxthoursiejoshuafcole_: that's not destructing anymore though
01:19J_Arcanemaxthoursie
01:19dorkmafiasymlinks cool
01:19J_ArcaneWell, it seems that I'm getting a pile of errors when I run lein repl on jdk 8, so I'm gonna try 7.
01:20maxthoursieJ_Arcane: oh, that's surprising, but I haven't tried it
01:20maxthoursiedorkmafia: or something like https://github.com/kumarshantanu/lein-localrepo maybe
01:21dorkmafiamaxthoursie: i was going to try with the checkouts dir what should i symlink in there? and then what do i put in my lein project dependencies?
01:23maxthoursiedorkmafia: sorry, I don't know, havn't run into it yet, but I suspect I will
01:24dorkmafia:(
01:27J_Arcanehuh, no, same page full of errors on 1.7 too. :P
01:30J_ArcaneIs this at all normal? http://pastebin.com/hTrThtys
01:34J_ArcaneHuh. Apparently a known issue: https://github.com/technomancy/leiningen/issues/1625
01:54justin_smithJ_Arcane: is this inside a project directory?
01:54joshuafcoleI'm looking to construct a 2 dimensional grid of values as a vec of vecs. The obvious way I can think of to do so is with nested maps (one per dimension). I feel like there's probably a cleaner way to do it (perhaps doseq?) that doesn't require the explicit nesting, but I can't think of what it would be
01:54J_ArcaneNay. Just running the bare repl from anywhere. I forget if I tried it in a project.
01:55J_Arcane2.4.2 works fine from anywhere though, so I'm mollified.
01:55joshuafcoleI know doseq can provide the values from N ranges the way I'd like it to, but I'm not sure how I'd neatly compose the actual result from it, since it's intended for side effects
01:55joshuafcoleAnd actually, come to think of it, it doesn't really need to be structured as a vec of vecs, it just needs to be addressable by coord
01:55justin_smithjoshuafcole: for is like a lazy doseq that returns all the results
01:56joshuafcoleah derp, I didn't even think of that. Laziness should be fine in this case, since I'm going to be consuming the values directly.
01:56joshuafcoleCheers
02:03J_ArcaneHrm. My Light Table docs functions don't seem to be working.
02:05seancorfieldJ_Arcane can you be a bit more specific?
02:05seancorfieldDo you mean showing docs for LT, or for a specific symbol?
02:10J_Arcaneseancorfield: the language docs. Neither in-line with the right click or the search seem to do anything at all.
02:14J_ArcaneOK, it seems it was missing some deps that the koan-runner was preventing it from acquiring, but now in attempting it I get a stream of console errors.
02:14J_Arcanesearch works now, just not the right-clock option.
03:48sveriHi, using stuarts tools.namespace is there a way to keep some namespaces from being refreshed when calling (refresh)?
05:05ARM9any idea why lein repl goes bonkers?
05:06hyPiRionARM9: it's the dreaded technomancy/leiningen#1625
05:06lazybotnREPL barfing in non-project REPLs -- https://github.com/technomancy/leiningen/issues/1625 is open
05:06ARM9NoSuchMethodError clojure.tools.nrepl.StdOutBuffer.length() and then the classic wall of at namespace.xyz java errors
05:06ARM9I'll have a look
05:06hyPiRionit's solved on master, we're working on a new release coming in a few days
05:06hyPiRionin the meantime you can do `lein downgrade 2.4.2`
05:07ARM9cheers
05:20clgvhyPiRion: is there a short explanation why that happened all of a sudden with the last release?
05:21hyPiRionclgv: We still don't know really. https://github.com/technomancy/leiningen/issues/1629
05:21hyPiRionOr at least I don't know
05:21hyPiRionAether magic
05:22clgvok. not so "repeatable" it seems ;)
05:23hyPiRionoh, it's repeatable
05:23hyPiRionBut bumping version numbers somehow solved the issue
05:23clgvwell I meant the dependency resolution which seems to differ as described in the ticket
05:24clgvbut must be pretty weird since it did not seem to occur in other projects
05:24hyPiRion~mystery
05:24clojurebotmystery is http://p.hagelb.org/mystery.gif
05:25clgv:P
05:25ddellacostathat is such a cute image
05:25ddellacostathe bug itself is not cute
05:26hyPiRionIt's not a funny bug, trust me
05:26hyPiRionEsp. because Phil didn't manage to reproduce it at first
05:34lvhHow do I use a leiningen checkout for a java dependency?
05:34lvhleiningen ignores it because there's no project.clj
05:37wombawombaI'm passing a really convoluted predicate (containing macros) to a macro. I would like to break this up into parts, e.g. turn (mymacro (or (= :something 2) (= :something-else 3))) into something like (mymacro (or something-equals-2 something-else-equals-3)). How would I do this?
05:43dm3wombawomba: what did you try already?
05:48wombawombadm3: er, I tried (def some-equals-2 '(= :something 2)) and (defmacro some-equals-2 [] (= :something 2))
05:48wombawombaI don't really have any idea what I'm doing though
05:49dm3that's the problem :)
05:49dm3try macroexpanding the inner macros
05:49dm3I would strongly advice coming up with the function-based API first and then wrapping into macros
06:03wombawombaHmm, so there's no easy way to just transplant (= :something 2) out of the predicate and just have the compiler paste it back in regardless of its contents? In (pseudo-)C I would just #define some-equals-2 (= :something 2).
06:03wombawombaI figure I should be able to do something similar
06:13clgvlvh: do you plan to compile the java project yourself?
06:15lvhclgv: Not manually, no. I contributed a feature to an upstream Java project. I want to test that my Clojure code works with it. The Java project has not yet done a release, and would like me to manually confirm that the code does what I think (because they made some additional changes) before activating the release machinery.
06:15lvhSo maybe what I want to say is "pretend that you got this thing off of maven even though you're atually getting it off of github"
06:16clgvlvh: so you temporarily need to build it until you are sure it works and it ends up in an official release?
06:16clgvlvh: is it maven based?
06:17lvhclgv: Correct.
06:17lvhclgv: Yes. At least, it has a pom.xml. I think that means it's Maven-based?
06:18clgvlvh: if so, just dont use it as checkout - change the version number to something that marks it as you temporary snapshot and then build and install locally it via maven. you can then use it as a normal dependency in your clojure project
06:18piranhais there a way to check that data.json/read-str didn't read the whole string?
06:19clgvlvh: update after changes are only one maven commandline execution
06:19lvhclgv: Wait, to be clear: the *upstream Java thing* is Maven based. I'm just using lein.
06:19piranha,(clojure.data.json/read-str "1[]")
06:20clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.data.json>
06:20piranhaeh
06:20piranhaanyway, it reads 1 from there and I would love to have exception
06:20clgvlvh: yeah, what I was saying is build your fork of the java project via maven (and install it locally) then get it in your clojure project as normal dependency
06:20lvhaha
06:22clgvlvh: probably "mvn package && mvn install" is what you need
06:23lvhclgv: Does "normal dependency" there mean I have to upload it to clojars/central?
06:23clgvlvh: depending on the pom.xml "mvn install" might suffice - I am no maven expert ;)
06:23lvhI'll try. Thanks :)
06:23clgvlvh: no you dont. it is locally installed on the maven folden on your current machine
06:23lvhOh, cool.
06:31clgvlvh: probably someone should summarize those use cases in a blogpost or similar ^^
06:52CookedGryphongah, does anyone else use prelude?
06:52CookedGryphonand is cider utterly borked for you?
07:03noncom|2clgv: ping
07:04clgvnoncom|2: pong
07:04noncom|2CookedGryphon: i am learning emacs, so prelude is my current main setup.. cider kinda works :) but it si not included with prelude..
07:04clgvah vectors in 1.7 will implement IReduce :D
07:04CookedGryphonnoncom|2: it is if you enable the clojure module isn't it?
07:05noncom|2clgv: hi! did you try to use the latest ccw with java 8 + eclipse luna ? i get some stalls with lein->update deps in eclipse..
07:05clgvclgv: I switched back to kepler because of weird multiwindow issues with luna
07:06clgvnoncom|2: what do you mean by "getting some stalls"?
07:06noncom|2clgv: well, eclipse just hangs when i call Leiningen->Update dependencies ..
07:06noncom|2and never comes back
07:06clgvnoncom|2: my workspace shows errors that dependencies could not be retrieved which "lein deps" does not report
07:07noncom|2clgv: is it in luna or kepler ?
07:07clgvluckily it does not prevent a repl to start. this is in kepler with latest ccw
07:07noncom|2CookedGryphon: hmmm right.. still, working within emacs seems a bit complicated to me, i am in the process of learning..
07:09noncom|2clgv: well, kepler worked just fine for me.. all works at 100%.. i guess i'll go get back to it then :) luna will have to wait for some time i guess..
07:11noncom|2clgv: is your os linux or windows ?
07:14clgvnoncom|2: linux
07:15clgvnoncom|2: the multiwindow issue on luna is a showstopper for me as well
07:16noncom|2clgv: how do you reproduce the multiwindow issue ?
07:17clgvnoncom|2: I can't immediatel. It occurs after some time working in the project
07:18clgvnoncom|2: https://code.google.com/p/counterclockwise/issues/detail?id=650
07:20noncom|2clgv: hmmmm... i see.. well.. eclipse keeps going astray with their changes to the api i guess :)
07:21clgvnoncom|2: well probably CCW needs to drop support for older eclipse versions and move to the new eclipse 4 API. that compatibility layer for eclipse 3 plugins is probably causing this issue
07:22clgvnot sure though
07:23noncom|2clgc: what linux are you using ? are you installing eclipse from their website or via some linux app manager ?
07:23noncom|2Clgv: sorry for mistyping the nic .. :)
07:23noncom|2omg again..
07:23noncom|2:)
07:23noncom|2phew..
07:24clgvnoncom|2: linux mint 17, I always install eclipse manually
07:24clgvnoncom|2: if you dont know it just think "Ubuntu 14.04" ;)
07:27noncom|2clgv: yeah, tried mint several times :) but mainly use ubuntu 14.04 for it being less in size. not my main os, so no care for media and other comfort stuff provided by mint..
07:28noncom|2clgv: currently researching the usability of clojure programming on android device with linux deploy + ubuntu 14.04.. i bet you remember this one
07:31clgvah right
07:32clgvnoncom|2: I like mint because it has two usable window managers where ubuntu has none ;)
07:32clgvwarning: highly opinionated :P
07:33clgvah well lets say subjective ;)
07:33noncom|2haha.. well, i just put lxde on ubuntu for now :) less size, less memory.. less power consumption - that's vital for me now
07:35clgvI am running cinnamon on my workstations and mate on my laptop
07:37clgvI need usable shortcuts for those forward/backward slurp/barf commands
08:52lavokadevery time evaluation in cider throws a error, the *cider-error* buffer gets focused? How can I avoid this?
08:53apodlavokad: (setq cider-auto-select-error-buffer nil)
08:54lavokadapod: thank you
09:09mikkerHow can I auto-run a command as soon as I start my lein repl?
09:10arrdem:injections or user.clj
09:10mikkerSomething like .irbrc (I'm a clojure beginner coming from ruby)
09:10mikkeruser.clj in proj root ?
09:10arrdemuser.clj on the source path
09:11arrdemClojure will by default load the file "user.clj" from the classpath as part of its boot sequence. whether this is a feature has been debated.
09:12arrdemalternatively if you want _global_ injections you could use the :injections key in your leiningen user profile
09:12mikkersrc/user.clj works, thanks
09:12arrdemthose will be applied to any REPL you start with lein anywhere
09:12arrdemkk
09:13mikkerI just want to automatically boot my ring server, when I start a repl
09:13jajumikker: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded may be helpful. Talks about user.clj and excluding it in production etc.
09:13jajuIn addition, I mean, to this discussion.
09:14mikkerI saw that, never actually read it
09:14mikkerWill do now
09:14mikkerThis is my third, I think, stab at my first clojure project and this time I think I'm getting it
09:15mikker(enough to get somewhere useful at least)
09:16jajuIncidentally, I am using clojurescript for the JS in an RoR project. Still trying to figure out the integration...
09:16mikkermix-n-match :)
09:33clgvis :inline-arities metadata something that is checked by the compiler on inlining?
09:34clgvhumm seems it should be https://github.com/clojure/clojure/blob/1a560c80fece9de8d5d2b1260c4e5dff8be63eca/src/jvm/clojure/lang/Compiler.java#L6561
09:35clgvbut I get no error when using the wrong arity
09:35clgvwell maybe it just does not inline then
09:37clgvah ok that's it
09:57thirdOrangehi - if I have a default template leinigen project and add another file under source, how can i use that file in the lein repl? i get a could not locate...on classpath error
09:57rweirwhat did you call it, hwo did you try to load it
09:58thirdOrangefirst i tried sending it there using fim fireplace -> cpr hotekey, then i tried (load "mynamespace.second")
09:58thirdOrangevim fireplace
09:58lvhhow do I spell a transducer that merges elems into a map? I was hoping either merge, but that doesn't appear to be it, or conj, but that appears to conj to [].
09:59arrdemlvh: conj of two element vectors onto a map should work..
10:00lvhactually, lemme restart cider first, I'm still running .1.6
10:00clgvthirdOrange: you probably didn't place and/or name the namespace file right and thus the classloader is not able to find it
10:00arrdemthat could be an issue
10:01clgvthirdOrange: for the namespace "a.b.c" you need the file "c.clj" in the folder "src/a/b/" (assuming the default source folder "src")
10:02thirdOrangeclgv: that was it. i had a dash in my file name but not in the namespace name. wasn't aware of that restriction, thanks!
10:02clgvthirdOrange: dashes need to be converted to underscore
10:02arrdemthirdOrange: dashes in namespace names correspond to _ in file names
10:02lvhhm, in alpha1, (conj) is still [], not a transducer
10:02arrdemlvh: alpha2?
10:03thirdOrangearrdem: ah thanks!
10:03arrdemthirdOrange: it's a known pitfall that Rich has been unwilling to improve the handling of for some reason
10:04lvharrdem: that's a thing? http://clojure.org/downloads still says -alpha1 :/
10:04arrdemI think the argument is that "everyone does it once and only once so why bother"
10:04arrdemlvh: hum... I would have sworn there was an alpha2 [ann] on the mailing list.
10:04lvharrdem: maven central agrees with you
10:04arrdemhttps://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha2/
10:04lvhso I guess the page just never got updated :)
10:04arrdemlol
10:08lvharrdem: thanks :)
10:19samfloresarrdem, alpha2 here: (type (conj)) ;; => clojure.lang.PersistentVector
10:19samfloresshouldn't it be a fn?
10:20samfloreslike: (type (map identity)) ;; => clojure.core$map$fn__4341
10:21clgv,(conj)
10:21clojurebot[]
10:22lvhI guess async/into {} actually does what Iw ant
10:31cbp,(type (map identity))
10:31clojurebotclojure.core$map$fn__4341
10:31cbpo snap
10:31cbpI've been away from clojure for too long it seems
10:32TEttinger,(map identity)
10:32clojurebot#<core$map$fn__4341 clojure.core$map$fn__4341@450563>
10:32TEttingerwoah
10:32TEttinger,((map identity) [1 2 3])
10:32clojurebot#<core$map$fn__4341$fn__4342 clojure.core$map$fn__4341$fn__4342@a21ac2>
10:33TEttinger,((map identity))
10:33clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/map/fn--4341>
10:33hyPiRionxducers
10:33TEttingerhow does that work?
10:33cbp,*clojure-version*
10:33clojurebot{:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}
10:34hyPiRion$google clojure transducers hickey
10:34lazybot[Transducers are Coming — Cognitect Blog] http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
10:36clgvclojurebot: transducers |are| explained here: http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
10:36clojurebotAck. Ack.
10:36clgvtransducers?
10:36clojurebottransducers are a thing
10:36clgv:(
10:36clgv~transducers
10:36clojurebottransducers are explained here: http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming
10:36clgv:D
10:36mdrogalisclgv: Emphasis on -are-.
10:36mdrogalisJust to be sure.
10:36rweirthey're the monads of the clojure world
10:36clgvmdrogalis: huh? what?
10:36rweircan someone explain them to me in terms of a burrito in a space suit?
10:37mdrogalisclgv: Heh, just a joke. Nothing.
10:37clgv:P
10:37hyPiRionrweir: they are not monads, but have roughly the same "wat"-factor
10:38clgvfunction compositions would be a pretty general description, I guess
10:38TEttingerbut not the same as comp, I guess
10:40danneudoes anyone else have a problem with their aot compilation hanging every few times they push to heroku?
10:40clgvyes, something that has to fulfill the contract of "map" needs to include some iteration specific code
10:41rweirhyPiRion, yeah, I know, I meant that they're an important abstraction that seems exceedingly hard for people to get
10:41rweir[me included]
10:42clgvI dont know if I am wrong there, but I am reminded of ring middleware definitions when looking at the single arity implementation of "map"
10:42hyPiRionI wouldn't say hard necessarily, but very foreign
10:43hyPiRionI would guess I used more time to grok for loops the first time, compared to transducers
10:43clgvhyPiRion: the c/c++/java-things or the clojure "for"?
10:46hyPiRionclgv: java/c/c++/all-other-algol-like language style for
10:46clgv:O
10:47justin_smithI spent more time learning the word "bird" than the word "modem" - I think it may be related to the order I learned things
10:47hyPiRionhuh? It was insanely hard to grok how it worked when I first started programming
10:49clgv"a function getting a function F as argument returning a function M that takes a function C as argument and recursively combining F and C" is pretty complicated compared to "iterate through all numbers between A and B" ;) maybe too much implementation details on 1-map
10:49samfloresis the clojurebot source available?
10:49rweirc/c++ for is much harder than it looks, since it's for (arbitrary_expression ; arbitrary_expression ; arbitray_expression_interpreted_as_boolean)
10:49justin_smithsamflores: yeah, it is findable on github
10:49rweirwhereas e.g. python's is "hit the object with the 'next' stick until it is empty"
10:49clgvsamflores: yes, look on github
10:50samfloresthanks
10:50clgv$google clojurebot github
10:50lazybot[hiredman/clojurebot · GitHub] https://github.com/hiredman/clojurebot
10:50clgv$google lazybot github
10:50lazybot[Raynes/lazybot · GitHub] https://github.com/Raynes/lazybot
11:13gdeer81arrdem, doing the clojurecup this year?
11:56dorkmafia#<CompilerException java.lang.IllegalArgumentException: No matching ctor found for class org.jivesoftware.smack.XMPPConnection, compiling
11:57dorkmafiadoes that mean it can't find the jar?
11:57gdeer81dorkmafia, it could mean you're trying to call the constructor with the wrong number of arguments
11:57bbloomI dislike JIRA so much that the new HipChat redesign makes me dislike it too: https://twitter.com/bjburton/status/509369159697068033/photo/1
11:58dorkmafiait's an abstract class (defn stop [#^XMPPConnection conn] (when conn (.disconnect conn)))
11:58dorkmafiathat's the only place it's called :\
11:59numbertenis there a good way to create new leaf values for prismatic's schema?
11:59numbertenlike a new primitive for non-zero ints or something
12:00dorkmafiaor wait maybe here conn (XMPPConnection. connect-config)]
12:01clgvdorkmafia: Clojure does not find a constructor in the class that matches the constructor call in your code with respect to the number or arguments and maybe also the types of the arguments
12:01gdeer81dorkmafia, the constructor is marked as protected
12:01dorkmafiagot ya
12:01clgvdorkmafia: yeah, that's very likely the spot it complains about - you should have a line number in the exception as well
12:02gfredericksnumberten: the pred function would help with that, no?
12:03numbertengfredericks: aye I just found that, thank you :)
12:04dorkmafiaclgv it was just telling me line 1 before where the import was
12:05dorkmafiawhich was a bit frustrating :P
13:10justin_smith,:ping
13:10clojurebot:ping
13:14jtacketthey does ring reload work if there is a long running process that needs to be returned to a web page?
13:16justin_smithby "long running process that nees to be returned to a web page" do you mean some result or statsu of a long running process needs to be used as input to render a page?
13:16jtackettyes
13:16justin_smithhow do you bind that process for retrieval?
13:16jtackettthe long running process would return the text that needs to be placed in a text area
13:16justin_smithis there an atom? something in the session?
13:16jtackettin a future
13:17justin_smithhow is the future bound? in an atom? something in the session?
13:17jtackettwrite now the method is just called in the html view
13:17justin_smitha global var?
13:17jtackettnot bound now
13:17justin_smithso, in the handler that renders the page, you have a local binding to a long running process
13:17jtackettyes
13:18justin_smithand the client just sits and waits for the long running process to complete before they get their response?
13:18jtackettyep
13:18jtackettwhich ultimately leads to a time out error
13:18justin_smithas I would expect
13:19jtackettwould like to avoid web sockets and polling if possible
13:19justin_smithyou could attach a binding to the long running process to the session, so they could get the result with a future request. Or you could write some front end AJAX that polls for the result and fills it in later.
13:20justin_smithwith no web sockets or polling, your best bet is to attach a binding to the process in the session, and on the following request, check if it is complete, returning the result if it is available
13:21jtacketthow does AJAX work?
13:21justin_smith,(realized? (future (Thread/sleep 300000)))
13:21clojurebot#<SecurityException java.lang.SecurityException: no threads please>
13:21justin_smithbleh
13:21justin_smithjtackett: AJAX is where the javascript on the rendered page sends a request back to the server
13:22justin_smithand then, usually, uses the data it gets to update the page without a full reload of the page
13:22jtackettso what is an easy way to wrap a method call in AJAX?
13:22justin_smithlike the way gmail or facebook can tell you about events even though you have not reloaded the page
13:22justin_smithmethod call?
13:22jtackettso in the view
13:23jtacketthtml page. …. <p> … blah blah (get-text “input”) … blah blah
13:23justin_smithjtackett: I don't know what you mean by view. In my professional experience the view is javascript / html / css that runs in the browser, but you use the word view to refer to things in clojure.
13:23jtackettyes think of the view as html
13:24justin_smithbut there is an essential barrier here
13:24justin_smiththings either execute on the client or server
13:24jtacketti am just using hiccup to render the html
13:24justin_smiththe rendering that happens in clojure (in hiccup) is part of the server, so it is not part of the view
13:24justin_smithit is generating data for the view layer
13:25jtackettfor me, the handler
13:25justin_smithin order to do AJAX you need javascript code that makes a request back to the server, with a callback that updates the DOM
13:25jtacketthas routes, that call views (html code rendered by hiccup)
13:25justin_smithOK so in your model the browser doesn't even exist
13:26jtacketti don’t think so
13:27Rhainurjtackett: what are you trying to do again? why do you need to "wrap" a method call in AJAX?
13:27justin_smithYou may need to adopt a different model of the architecture if you want a long running process to display results. With AJAX, the view is javascript running in the browser, and it polls for expected updates from the server (controller)
13:27justin_smithRhainur: he has a long running process, and wants the results to show up to the browser, but the process takes so long the request times out
13:28jtackettI would like a long running process to return text thta would be displayed in the html
13:29dgrnbrgI want to give my library a name—it lets you use core.async with Ring: https://github.com/dgrnbrg/async-ring
13:29dgrnbrghowever, Ring isn’t a name I can use
13:29Rhainurjtackett: do you know how long the process takes roughly?
13:29jtackettRhainur: it varies based on the user input
13:30jtackettmore than 30 secs though because that’s all heroku allows
13:30Rhainuroh hmmm
13:30Rhainurthat's a different issue entirely
13:31Rhainurmaybe you want to shift this to a background task
13:31jtacketttricky isn’t it
13:31Rhainurand poll for results
13:31jtackettI could do that
13:31jtacketthow would I go about setting that up?
13:31Rhainurlet's shift this to PM because this isn't really clojure related
13:31justin_smithif you are doing it all yourself, you may want to use clojurescript and core.async
13:33dbaschjtackett: what you’re trying to do it’s pretty standard, you just have to learn the tools. Have you checked out sente yet?
13:33noonianyeah, i was recommending chord for a slightly simpler introduction
13:34jtackettI have, but I am getting very confused since my project is set up with compojure and hiccup
13:34jtackettaka a view and a handler
13:34jtackettview for html
13:34jtacketthandler for routes
13:39justin_smithas I said before, to really use things like long runnint processes and polling, your "view" has to conceptually be in the browser, not on the server
13:40jtackettthe view is in the browser, it is html
13:40amalloydgrnbrg: i just read your readme for async-ring, and i didn't see any mention of what looks like the most important feature: that you can return a channel from your handler function
13:40dgrnbrgWell, you actually create one channel per handler, instead of per request
13:40justin_smithjtackett: let me try again: you need logic that runs in the browser
13:40amalloythe whole readme looked like "here's how you can make a small change to your existing ring server and it'll now work with async-ring"
13:41noonianjtackett: you will need to have some javascript code execute from the browser in order to talk to your handler and ask if the process is done, or the server will have to tell the browser the process is done using something like websockets
13:41dgrnbrgamalloy: I think that Beauty in the most compelling thing right no
13:41dgrnbrgnow
13:41amalloydgrnbrg: then say that! i have to read the source to figure out how i would write anything with async-ring, aside from wrapping existing apps, which presumably doesn't buy me as much as drinking the kool-aid and writing async-style
13:43jtackettalright
13:43jtackettlooks like i need to bite the bullet and learn clojure script
13:43jtackettshit....
13:43amalloyanyway, i'm not really a prospective user, so feel free to ignore my advice: i was just providing feedback since you linked to your project
13:44dbaschjtackett: you don’t *need* to learn clojurescript, but you do need to think of the client side of your application and figure something out
13:44gfredericksamalloy: didn't he just ask for a name? In which case obviously ##(format "lib-%04d" (rand-int 10000))
13:44lazybot⇒ "lib-8127"
13:45jtackettalright dbasch: will do
13:45jtackettthank you guys for all the help
13:45jtackettI’ll be back
13:45justin_smithgfredericks: well, it worked for wd-40 and 409
13:45justin_smithmaybe the key is you need to have 40 as a substring
13:46milos_cohagenY'all think it makes sense to keep hacking on this netty+core.async project I created? https://github.com/marsmining/nettyca
13:46amalloygfredericks: he did, but i'm obstreperous and treat linked-to readmes as solicitations for any advice
13:47milos_cohagenWould be interested in if I'm just barking up the wrong tree
13:48dgrnbrgamalloy: I just rewrote the first few features—would you take a look?
13:48Rhainurjtackett: I need to point this out and everyone else will agree, if you don't know JS at all, learn that first before you learn clojurescript
13:49Rhainuryou will really struggle to debug things if you don't understand JS
13:49jtackettgot ya
13:49jtackettthank you
13:49jtacketti first learned java and then clojure
13:49jtackettsimilar concept
13:49hiredmanreiddraper: I've noticed in my (small) usage of test.check I tend to end up writing a little interpreter and have test.check generate programs for that interpreter, and then have a little function that checks each step of the execution
13:50hiredmanreiddraper: is that kind of thing common?
13:50reiddraperhiredman: maybe not 'common', but a great idea i think
13:50amalloyhiredman: that's what i did
13:51amalloyin my (one) usage of t.c
13:51reiddraperi've succesfully used that technique several times
13:51amalloydgrnbrg: it looks more interesting to me now, yes. i don't think you should capitalize "Core.async", though, even at the beginning of a sentence/title
13:51hiredmanso I am not entirely out to lunch with this, which is good to know
13:52dgrnbrgamalloy: I’ll change that
13:52dgrnbrgamalloy: any ideas for a better name?
13:53dgrnbrgwhat do you think of “Rasync HTTP”
13:54amalloy(rand-nth (line-seq (clojure.java.io/reader "/usr/share/dict/words"))) ;; => "ricing"
13:54amalloyas good a strategy as any
13:54dbaschamalloy: sic-granny
13:54amalloywat
13:54amalloythat word is not in my dictionary
13:55TimMcanagram
13:55dbasch(anagram-generator “async ring”)
13:55milos_cohagen> as good a strategy as any
13:55milos_cohagenoops! wierd drag / copy / paste. 'scuse me
13:57amalloydgrnbrg: i think you kinda get three choices: (1) a bland, descriptive name like async-ring; (2) a dictionary word, which you can choose at random or think about for a long time to find something punny; (3) ##(format "lib-%04d" (rand-int 10000))
13:57lazybot⇒ "lib-5842"
13:57dgrnbrgoi
13:57TimMcDictionary word or in my case, taxonomic name of some organism.
13:57amalloywhich one of those appeals to you is a matter of personal taste
13:57TimMcdgrnbrg: torus
13:57technomancyif you're working with ring, the obvious choice is a Wagnerian name
13:58technomancycome on you guys
13:58amalloyyou could name it after a famous character from literature, but that's technomancy's thing
13:58dgrnbrgTimMc: that is amazing
13:58technomancydo I have to spell everything out for you
13:58TimMcWhere does ring's name come from?
13:58dgrnbrgI’m leaning heavily towards Torus, unless there’s a ring-like character in Flatland
13:58amalloyTimMc: actually someone asked that in here just a week or two ago, and there might have been a plausible answer but i don't remember
13:58technomancyTimMc: the request/response cycle -> the ring cycle -> https://en.wikipedia.org/wiki/Der_Ring_des_Nibelungen
13:59TimMcreally
13:59TEttingerdgrnbrg: maru is taken, but it's circle in japanese
13:59amalloyi remember mdeboard being involved in the discussion
13:59TEttingeralso, Maru is the best cat.
14:00TEttingerhttp://imgur.com/gallery/vOZ3t
14:00justin_smithTEttinger: maru would be a good name for a library that gratuitously boxes data
14:00dgrnbrgperhaps Kol’tso, which is ring in russian
14:00TEttingerhttp://www.piumarta.com/software/maru/
14:01TimMc(ring -> torus -> taurus (bull) -> goats) + (http -> web) = spidergoat
14:01TEttinger(inc justin_smith)
14:01lazybot⇒ 76
14:01gfredericksTimMc: waddabout async?
14:01dgrnbrgActually, Nibelung is a pretty nice name—it’s a “cycle” that’s a “ring"
14:01gfredericksasync -> sink -> plumber?
14:01amalloy[13:42:30] mdeboard: sdegutis: It is an homage to the black plague that rampaged through Europe in the dark ages. its hallmark was a rosey, ring-shaped rash.
14:01amalloy[13:43:16] mdeboard: Rich Hickey lost many close friends & relatives in the Black Death and so he vowed that his programming language would have a network adapter library to stand as eternal testament to their memory
14:01amalloy[13:43:34] mdeboard: And now you know... the rest of the story.
14:01TEttingerluigi
14:01TimMcgfredericks: You think a spidergoat can't handle async?
14:02amalloyso no, i guess not a plausible answer
14:02gfredericksTimMc: I think the name applies just as well to ring itself
14:02dgrnbrgand a cycle is like the async state machine
14:02TimMcssshhhh
14:02hiredmantaurine (an incredient in many energy drinks) comes from taurus because it was first isolated in the bile of bulls
14:02TEttingerOroboros is probably taken
14:02hiredman(favorite energy drink/taurus related fact)
14:03TimMcincredient, is that an ingerdient I am incredulous about?
14:03TEttingerhoop maybe?
14:03amalloyTimMc: "ingerdient" makes your sarcastic correction less credible
14:03TimMcNothing like a good ol' timey naming party.
14:03TEttingerballmer, since he's loopy
14:03dgrnbrgTEttinger: I don’t think oroboros is taken
14:03TimMcamalloy: Ha! Muphry's Law strikes again.
14:03milos_cohagenlol @ all these naming shenanigans
14:03hiredmanTimMc: well you would have to be incredulous about something with a misspelling like that
14:03justin_smithspeaking of goats http://www.goat-simulator.com/
14:04amalloymilos_cohagen: naming stuff is one of the two hard things in computer science
14:04TimMcamalloy: Not really a correction -- I think a word with that definition should exist. :-)
14:04TEttingeramalloy, the other being dealing with users/clients?
14:04amalloyTEttinger: caching and off-by-one errors
14:04mikerodcider is not displaying anything I print to *out*
14:05justin_smiththe two hard cs problems: naming, caching, off by one errors
14:05mikerodis it doing something here
14:05TEttingerhahaha
14:05TimMcTEttinger: And if this were in-person, I would have yelled "concurrency" while amalloy was talking.
14:05amalloyhah
14:05TEttingerha!
14:05justin_smithlol
14:05TEttinger(inc TimMc)
14:05lazybot⇒ 67
14:05TimMcbut that would make it an off-by-two error
14:05TEttinger(inc amalloy)
14:05lazybot⇒ 166
14:06amalloyTimMc: i left the joke half-finished on purpose, so someone else could fill it in if they wanted, but then TEttinger asked me specifically, so i had to finish it myself
14:06TEttingerdamn that's a lot of karma
14:06amalloy(inc TimMc)
14:06lazybot⇒ 68
14:06amalloyi like the concurrency addendum
14:06justin_smithinterrjectum?
14:06milos_cohagenamalloy: speaking of naming things this cracked me up recently https://twitter.com/SlexAxton/status/507748452349251584
14:06justin_smithyes, it is excellent
14:07TimMcdgrnbrg: knot
14:07Bronsa(inc TimMc)
14:07lazybot⇒ 69
14:09TimMcdgrnbrg: Oribtal? http://www.gideonweisz.com/album/orbitals/index.html?p=6
14:09TimMc*orbital, ugh
14:09dgrnbrgI think that the winner has come in through the backchannel: Spirl - A Ring that doesn’t block
14:10dgrnbrgSpiral*
14:10gfredericksclojurebot: spirl is a rng that doesn't blck
14:10clojurebotc'est bon!
14:16TEttingerBearhug would be Ring that blocks even more
14:16TEttingeror alternately Octagon
14:17nullptrorbit, saturn, hula ....
15:01arohnerI have the strangest bug. My app works just fine if I 'lein run', but I get Caused by: java.lang.NoClassDefFoundError: com/stuartsierra/component/Lifecycle if I 'lein repl' then (require 'foo.main)
15:03jehow come this: (map Integer. ["2" "5"]) throws "ClassNotFoundException: java.lang.Integer." when this (Integer. "2") gives me 2 ?
15:03arohnerje Integer. isn't a function
15:03arohner,(map #(Integer. %) ["2" "5"])
15:03clojurebot(2 5)
15:04jearohner: thanks makes sense :)
15:04arohnerjava interop uses special forms, so you have to wrap in fns to make map, etc work
15:04dogonthehorizonarohner: Is the constructor not considered a function in this context?
15:05arohnerdogonthehorizon: when I say "isn't a fn", I mean "doesn't inherit from clojure.lang.IFn"
15:05arohnerso by that definition, Integer. is never a fn
15:05arohnerit's a special form
15:05dogonthehorizonAh, that makes sense. Thanks!
15:09amalloyit's funny that Integer. is the example that *everyone* uses when asking this question. i don't quite know why
15:10DaReaper5Hey, I have a question: How do I get a value from a vector when I do not know the index AND the vector is a set of maps?
15:10DaReaper5I was thinking a for with a :when. But I am not sure about the return.
15:11Farewhat do you nkow?
15:12DaReaper5with a traditional language I would have a for loop, have an if, and when found use a break;
15:13amalloylike, someone asked http://stackoverflow.com/questions/25632613/cant-map-integer?lq=1 just a week ago: Integer. again
15:13dbaschDaReaper5: if you need to get a value and you don’t know the index, why is it a vector?
15:13DaReaper5i dont want to use a loop (that uses recur) but it might be the only option i see
15:13DaReaper5dbasch: due to data structure requirements
15:14dogonthehorizon(map String. ["why" "doesn't" "this" "work" "amalloy?"])
15:14amalloyDaReaper5: in general if you want the first item of a collection that satisfies a predicate, that's pretty easy to do in a number of ways, although you should usually consider a better data structure that doesn't require this looping
15:15amalloy(first (filter what-i-want? thingies))
15:15DaReaper5amalloy: i agree,and thanks for the example. That is better than "loop" :)
15:16dbasch&(map str ["but" "this" "does" "dogonthehorizon"])
15:16lazybot⇒ ("but" "this" "does" "dogonthehorizon")
15:16amalloyby the way. DaReaper5's suggestion of using a for-loop with a break reminds me of some pretty absurd code with a similar structure in the example code for kafka: check out "findNewLeader" in https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example, in particular the if/else flow around goToSleep and return
15:17rickhall2000llasram: you around?
15:17dogonthehorizondbasch: It was tongue-in-cheek to amalloy's question of why everyone users Integer. as an example of a Java constructor not working in map
15:19milos_cohagenHey all, for learning purposes I wrote a small library of netty and core.async interop code. Do you think it might be useful to pursue further, or have any suggestions in general? https://github.com/marsmining/nettyca
15:32dagda1if I have an infinite range, what the hell is (drop 10 (range)) taking as its end?
15:32AimHereit doesn't.
15:32ToxicFrogdagda1: it's not? It drops the first 10 elements of range and returns the rest.
15:32dagda1AimHere: so it just spins
15:32AimHereThe trick to laziness is that you never ever ask what the end of (range) is
15:33AimHeredagda1, only if you evaluate it
15:33ToxicFrogIt doesn't need to know what the end of range is to discard the first ten elements from it.
15:34ToxicFrog,(take 10 (drop 10 (range)))
15:34clojurebot(10 11 12 13 14 ...)
15:35dagda1I'm trying to get my head round Lazyness, so if I have (take 5 (expensive-function)) how does lazyness work in this scenario
15:35dagda1a lazy seq's next element is a function and not an actual element
15:35AimHereWell a lazy function is just a data structure that waits until you ask it for a value to give it
15:35AimHere*lazy sequence
15:36AimHeredagda1, there's a good treatment on Laziness in SICP if you're okay with learning a little light scheme
15:37dagda1AimHere: what is SICP, structure and interpetation of computer programs?
15:38AimHereYeah
15:38J_ArcaneLaziness is fun.
15:39mdrogalisSick-P.
15:46irctcI'm looking a working example of core.logic in ClojureScript
15:47irctcanybody knows where I can find this?
15:55dnolen_irctc: in the core.logic repo there are tests/examples
16:14arohneroh fun, I have datomic + leiningen bug
16:14arohnerI have a bug that only appears when doing 'lein repl', but not 'lein run', and only when datomic is required before stuartsierra.component
16:17xeqithat would be a strange bug
16:19arohnerxeqi: tell me about it. It's taken a few hours to run down
16:19arohnerI think something in the middle is mucking with my classloader
16:20arohnerchanging the order of requires definitely fixes it though
16:32J_ArcaneOK, the clojure koans on recursion have completely broken my brain.
16:33noonianthe first step towards self-actualization
16:34J_Arcanelike, I get recursion in general fine, I'm not *that* new to Lisp, it's the sample problem (solving for even recursively) that I think I am too tired to make sense of.
16:37noonianif its the one i'm thinking of, the key is in what happens to an even (or odd) number when you decrement it
16:38J_Arcaneright. Of course. I need a not.
16:39J_Arcane(I should've read ahead to the bigint version)
16:40noonianthen make it tail recursive :)
16:40noonianheh
16:50amalloyeh, if you make it tail-recursive you end up realizing you've just written a while loop
16:51noonianwell, thats worth something right?
16:56dbaschrecurvise even? is quite silly anyway
16:56dbaschrecursive
16:57amalloydbasch: it's an okay introduction to thinking recursively, even if it's a terrible algorithm
16:58dbaschamalloy: at least it could be pow-2?
16:58amalloydbasch: why would that be better?
16:59SagiCZ1is there a clojure way to list all available methods/fields on a java type<
16:59SagiCZ1?
16:59dbaschamalloy: at least the obvious solution is not constant time
16:59amalloySagiCZ1: clojure.java.reflect/reflect
16:59SagiCZ1amalloy: thank you
16:59amalloyor, and i'm sure this will be easier, just look at the javadocs
17:00dagda1is cons the only function that can return a lazy sequence
17:00SagiCZ1amalloy: okay then :(
17:00amalloydagda1: cons is one function that cannot return a lazy sequence
17:01amalloyyou were asking the other day about your stack overflow in a recursive lazy seq with conj, right? and we told you to use cons
17:01amalloycons doesn't return a lazy seq (the thing that does that is called lazy-seq), but it is a good tool to use as *part* of building a lazy seq
17:02dagda1amalloy: yes, I got it workign but I'm trying to get a better understanding of lazy now https://gist.github.com/dagda1/9f6a503a8e35cb8006aa
17:02J_ArcaneWell. I guess I have now learned that Clojure is indeed multithreaded ...
17:03amalloydagda1: looks like a reasonable implementation of reductions
17:04dagda1amalloy: I'm trying to blog about lazyness now to make sure I understand this properly
17:05dagda1amally: so there is no real connection between cons and lazyness
17:08nopromptdnolen_, bbloom: ping
17:09dnolen_noprompt: pong
17:09nopromptdnolen_: small question about resolving symbols with ana/resolve-var
17:09gfredericksdagda1: cons is compatible with laziness in that the second arg can be a lazy seq, and cons will not force it
17:09amalloydagda1: your irc client will tab-complete usernames, so you don't have to spell them wrong
17:09gfredericks,(take 3 (cons :haha (range)))
17:09dnolen_noprompt: what's up?
17:09clojurebot(:haha 0 1)
17:10nopromptdnolen_: why does (resolve-var &env 'reify) return user/reify (assuming i'm in the user ns)?
17:10dagda1amalloy: I am guilty of not using the autocomplete
17:10nopromptdnolen_: well, actually it returns {:ns user, :name user/reify}
17:10dnolen_noprompt: resolve var always returns fully qualified symbols
17:11amalloydnolen_: i'm no expert here, but why wouldn't it return clojure.core/reify?
17:11dagda1gfredericks: so what gets returned is a structure that behaves like a sequence
17:11nopromptdnolen_: but in this case, user/reify would be incorrect. i guess the deeper question would be how could i get it to correctly resolve to clojure.core/reify?
17:12dagda1gfredericks: a bit like an iterator in java
17:12dnolen_noprompt: amalloy: oh hrm right
17:12amalloydagda1: yes, a bit
17:13nopromptdnolen_: i'm sure there's a reason for having symbols that don't exist to resolve like that but i'm some what at a loss for why. for example, (ana/resolve-var &env 'lol) does this same thing even if lol does not exist in the ns.
17:13amalloynoprompt: well, backquote does the same thing
17:13amalloy,`lol
17:13clojurebotsandbox/lol
17:14dnolen_noprompt: yeah that's probably wrong but I guess most people haven't noticed since you can't use resolve-var really outside of macros
17:14thesaskwatchHi .. I have a question about protocols. Why there are supposedly better than adapter pattern in oo? Let's say I have some external not modifiable object. I can wrap it with an adapter object which will have interface I like. Aren't protocols the same? Maybe with added benefit of not having to implement all interface methods.
17:15nopromptdnolen_: that's ok. what should the correct behavior be?
17:15dnolen_noprompt: I suppose unqualified core symbols should probably resolve to core - it's a special case
17:16dnolen_noprompt: as far as the 'lol case you need to use resolve-existing-var
17:16dnolen_noprompt: resolve-var, resolve-existing-var are both a bit strange as they were designed to serve the analyzer/compiler
17:17amalloythesaskwatch: that doesn't sound like protocols at all
17:17nopromptdnolen_: not necessarily. suppose `(:refer-clojure :exclude [reify]) (:require-macros [schema.macros :refer [reify]])` resolving reify in that ns should resolve to schema.macros/reify, no?
17:17amalloya protocol is, if you like, just an interface with the additional feature that you can add implementations for it to already-existing classes
17:17nopromptdnolen_: or is this simply beyond the scope of resolution for purposes of the analyzer?
17:17thesaskwatchamalloy: I can do the same with adapter to new interface
17:17dnolen_noprompt: yes but those kinds of cases should be handled if your analysis environment has that information
17:18dnolen_not env arg
17:18dnolen_but cljs.env/*compiler* dyn var
17:18amalloythesaskwatch: no, you can't. say you want an interface like Printable, which should have an implementation for String. you can create a PrintableString wrapper, which works fine for the Printable interface, but you can't give that to other code and have it act like a string
17:19nopromptdnolen_: ok i can work with that.
17:19amalloyie, instead of a string which is also printable, you end up with an opaque box which is printable but nothing else
17:20thesaskwatchamalloy: true .. string is a special case as it's final. But for extensible types it could be done.
17:20nopromptdnolen_: ugh, i'm just trying to make this tracing library accurate.
17:20amalloythesaskwatch: the point is that you don't have to touch the classes you want to create implementations for. it's just a dispatch mechanism
17:20dnolen_noprompt: I take it you're trying to use the analyzer to do this?
17:21nopromptdnolen_: yes. for thing like protocols, i need it.
17:21nopromptdnolen_: i need to be able to see om.core/IRender and not o/IRender, etc.
17:22thesaskwatchamalloy: ok, I'm starting to understand .. thank you
17:22dnolen_noprompt: right, I think there's probably a bug around that too at the moment - would love to see it get fixed up
17:22noonianthesaskwatch: imagine a library where all the api functions return a type Foo, and you want to release a library that allows Foos to do something. in clojure with protocols someone could include your library and the Foo library and all would be good, with adapters youd have to wrap each api fn or create an abstraction for wrapping the return values from that library
17:22noonianaside from the issues with extending protocols and types you dont own
17:23nopromptdnolen_: i could take a stab at it. i've been playing with that ns a lot more.
17:23thesaskwatchnoonian: in addition wrapper and the thing it wraps is not the same thing, and in case of protocol it's always the original value, right?
17:23nopromptdnolen_: just need to know what the correct behaviour should be.
17:23dnolen_noprompt: you should always get back fully qualified names - no aliases
17:23dnolen_om/IRender -> {:ns 'om.core :name om.core/IRender}
17:23noonianthesaskwatch: right, so you could make a protocol and implement it for Foo's and I could make a different protocol and extend it to Foos and now a Foo would support both of our protocols without our code knowing about each other
17:24thesaskwatchnoonian: ok, it makes sense
17:24dnolen_noprompt: the only special case for unqualified things is core
17:24dnolen_noprompt: though the last clause in resolve-var should have caught reify
17:25J_ArcaneOw. Well, that wasn't fun.
17:25nopromptdnolen_: so it should resolve macro symbols properly?
17:25dnolen_noprompt: yeah, I think that's what's broken - not handling macros
17:25nopromptdnolen_: which is why it's just falling through to the default case and returning {:ns user :name user/reify}?
17:26dnolen_noprompt: well part of the issue is that resolve-var generally doesn't get called until after macroexpansion
17:27dnolen_since macros aren't defined in ClojureScript there are no corresponding entries in the compilation environment
17:30dnolen_noprompt: definitely something to fix in parse 'ns - :refer should popluate :defs
17:31nopromptdnolen_: this oughta be a fun one.
17:31dnolen_noprompt: separate actionable tickets :)
17:31nopromptdnolen_: sure thing.
17:31dnolen_noprompt: by which I just mean, no need to come up w/ a monster patch
17:32dnolen_noprompt: there's small clean fixes to submit here
17:32nopromptdnolen_: tbaldridge has given me similar guidance on better errors in clojure.core
17:34nopromptdnolen_: is the :rename {foo bar} still something that'd we'd wanna add too? i've been pining to get that in.
17:34dnolen_noprompt: sounds reasonable to me
17:34dnolen_noprompt: never use that in Clojure myself
17:35dnolen_but I can see why people want it
17:35nopromptdnolen_: i use on occasion. primarily this would be for consistency, unless there's a plan to deprecate that down the way.
17:36amalloyi used :rename recently, actually. i can't remember why at the moment
17:37amalloy(:require [hiccup.util :refer [escape-html] :rename {escape-html escape}]). apparently i just felt escape-html was a bad name. i'm not really going to hold this one up as a paragon of brilliance
17:40nopromptdnolen_: this tracing lib, aside from the yak shaving and bugs, is pretty awesome. for 90% of the println use cases, this eliminates them.
17:40J_Arcanewelp. Seeing as how I just managed to force a system reboot with that last function, I think it's time I call it a night. :P
17:41amalloyJ_Arcane: did you just fork-bomb yourself for fun?
17:41dnolen_noprompt: it looks really neat from the images - looking forward to hearing more about it
17:41dnolen_noprompt: you're probably pretty far along by now but also this seems like a good use case for tools.analyzer.js as well
17:42J_Arcaneamalloy: Apparently I don't yet understand how to safely make a list-eater in Clojure. My solution to the recursive-reverse koan caused a run-away process instead ...
17:42nopromptdnolen_: general concept => https://github.com/spellhouse/clairvoyant#design
17:42nopromptdnolen_: i don't mind looking into the tools.analyzer.js lib. i was thinking about it this morning, in fact.
17:43nopromptdnolen_: any suggestions design ideas would be helpful. the main goal is to separate transformation of source code and what to do with trace data.
17:45Bronsanoprompt: using tools.analyzer.js for doing code transformations might have some rough cases around protocols/deftypes
17:45thesaskwatchAnother question. Is it possible to add additional methods in defrecord beyond interfaces/protocols it implements?
17:45thesaskwatch(and if possible to make them private) ?
17:46dnolen_noprompt: that sounds like a sound goal to me.
17:46justin_smiththesaskwatch: if they are private, why put them on the record? why not a function private to that ns that acts on that record type?
17:47thesaskwatchjustin_smith: I don't see anything against it .. but was just wondering if some kind of encapsulation is possible
17:48Bronsadnolen_: would you take a patch to change the deftype*/defrecord* special forms signature to take an additional body containing the inline-methods impl? the cljs analyzer uses an ugly hack to handle the deftype closed overs that I cannot use in t.a.js
17:49Bronsawhat I'd like is to make deftype macroexpand into (deftype* type [args] (do inline-methods-impls)) rather than (do (deftype* type [args]) (do inline-methods-impls))
17:50justin_smiththesaskwatch: For the deepest level of encapsulation, you can create an anonymous function local to some other scope, and not expose it outside that scope. All you need for this is a let binding or an argument to a function. For something a little more visible you can create functions that are private to an ns.
17:50thesaskwatchjustin_smith: ok, I know this way, it's how one does it in javascript
17:50thesaskwatchjustin_smith: was just wondering if it's clojure idiomatic
17:50nopromptBronsa: would the analyzer tools help me do tricky stuff like this? https://github.com/spellhouse/clairvoyant/blob/master/src/clairvoyant/core.clj#L213-L220
17:51justin_smiththesaskwatch: information hiding is not very idiomatic - with immutibility, it is often not needed
17:51nopromptBronsa: tl;dr it's rewriting the function so i can see the inputs to the function when a precondition fails.
17:51TimMcHuh, I just saw (pst) drop the top-most exception, leaving a pretty inscrutable error message: https://gist.github.com/timmc/77dd67b6b4af7ab4afb7
17:52thesaskwatchjustin_smith: unfortunately not all code can be pure, with i/o it's becoming more complex
17:52TimMcCan anyone explain this behavior?
17:52justin_smiththesaskwatch: if someone calls a helper function from my ns, they may see their code break because it isn't meant to be used that way, but they cannot break my code, because nothing in my ns is mutible enough for their access to be able to break it
17:52justin_smithi/o has nothing to do with this
17:53justin_smithand i/o effects should not be exposed on an ns level - it should be local to some inner block
17:53hiredmanTimMc: check the class of *e
17:54hiredmanTimMc: likely it is some rx exception that does something on .printStackTrace that it doesn't do on getCause
17:55thesaskwatchjustin_smith: ok, let's say I have irc client. It uses socket connection and data reader/writer. How would you encapsulate this using a set of pure functions?
17:57justin_smiththesaskwatch: the socket connection and reader/writer would be arguments passed in. They belong to the client / end user, not the library.
17:57justin_smithyou provide a factory type function that initializes a connection, and then they pass that back to the relevant code
17:57Bronsanoprompt: ATM it won't work for extend-type/extend-protocol -- that's something that I will address in the next beta but I'll have time to do it only next week
17:58justin_smithnothing needs to be private, or even bound globally - just make sure it belongs to the right entity
17:58Bronsanoprompt: the issue is interaction between the runtime namespaces of t.a.js & cljs.analyzer, there's a cljs-env->env but not the other way around
17:59thesaskwatchjustin_smith: but what I want the library to do is to manage those objects - to read and write messages, to close and reopen it when connection breaks, to notify about errors
17:59thesaskwatchjustin_smith: I don't want to do that outside of the library .. that's what this library is supposed to do
18:00amalloyTimMc: or even just check (.getCause *e), and see if it returns something
18:01amalloyi don't actually use pst, but it seems like it's attempting to find the "root cause" exception and just print that, instead of printing the actual exception in *e
18:03amalloyTimMc: i suspect if you wrote instead (pst *e) you would get something a bit more palatable, and if you wrote (pst *e 1000) you would get the whole thing
18:04justin_smiththesaskwatch: you mentioned methods before. The only reason to hide the methods is if they are hard-coded to mutate a specific object. There can be good reason to isolate a state that you abstract over, but unless you are doing it wrong, there is little reason to hide the functions.
18:06TimMcamalloy: Wait, why would (pst) and (pst *e) be different? I thought that was just a shortcut. :-(
18:06amalloyTimMc: having just read the source of pst, the default behavior strikes me as reprehensible: find the innermost wrapped exception, and print the first 12 lines of its stacktrace, removing those that are obviously just noise from the clojure runtime
18:06TimMcRoot cause it is. Ugh.
18:06nopromptBronsa: yeah, i had to do some janky stuff to get extend-protocol to work with the same code i used for reify, extend-protocol, etc.
18:06thesaskwatchjustin_smith: yes, I get that. However a different problem is that I need to manage some mutable references - readers and writers. I'd like to hide this from api users. That's why I was asking about encapsulation.
18:07thesaskwatchjustin_smith: and the answer with closure variables seems like a solution
18:07TimMchiredman: *e is just a java.lang.IllegalArgumentException. amalloy got it -- pst uses root cause for no apparent reason.
18:07amalloyTimMc: apparent reason: "to be friendly-looking"
18:08amalloyeveryone complains about the "huge" "useless" stacktraces you get from java
18:08amalloypst gets the right answer a lot of the time, and looks friendly to beginners; i wouldn't advocate experts using it
18:09nullptrhttp://imgur.com/jacoj
18:11TimMcThe problem is that it (or something like it) is used to print the exception at the REPL.
18:11TimMclike (pst 0) or similar
18:14dnolen_Bronsa: come up w/ a patch and I will take a look at it
18:15amalloyTimMc: use swank; problem solved?
18:17amalloyanyway, what repl is this? does lein repl really use pst? i thought it just printed (.getMessage *e) or something, and you have to use pst or getStackTrace yourself for details
18:17Bronsadnolen_: ok
18:24technomancyProblem: Clojure stack traces are useless and terrible. Solution: don't print them.
18:24technomancynext!
18:25noprompttechnomancy: are you trying to get my attention? :P
18:26justin_smiththesaskwatch: for your consideration: if you give the client a handle representing a connection, then some functions that act on said connection, you don't need to worry about how those details are stored in your lib, and your client can have as many connections as they like without having to jump through any weird hoops.
18:27thesaskwatchjustin_smith: yes, it makes perfect sense
18:27taliostechnomancy - one of my pet hates is the compiler prints them, rather than just displaying the message - that change alone would make a lot of clojure tooling nicer to deal with.
18:27taliosMind you - that may have changed - been so long since I've actually done any clojure.
18:28technomancytalios: yeah, I'm sure all my jokes are way out of date given that the only clojure I write is on lein.
18:28taliostechnomancy - yeh? whats your main language of the day then these days?
18:29technomancytalios: erlang at work, C and Forth on microcontrollers for fun.
18:29taliosforth! you old schooler
18:29TimMcamalloy: Yeah, lein repl. I think I would prefer .getMeessage.
18:29xemdetia.getMassage
18:30TimMcThe real problem here is that pst is nice and short to type... :-P
18:30TimMcxemdetia: That too.
18:30amalloyTimMc: when i write (/ 100 0) in lein repl, i see just the one-line message
18:30technomancytalios: to escape the tedium of C
18:30TimMcsame here
18:30taliostechnomancy - isn't that what Go is for?
18:30technomancytalios: bahahah
18:30xemdetiaGo doesn't embed nicely
18:30amalloyso, sounds like the behavior you said you would prefer
18:30xemdetiaas far as I've found out
18:32TimMcamalloy: Except in the case of this rx exception, the root cause is bring printed instead of the outermost one.
18:32amalloyoh, i see
18:32TimMc(Exception. "outer" (Exception. "inner")) doesn't replicate this...
18:32amalloyTimMc: i would guess that the async/whatever nature of rx causes the exceptions to be built in a weird order
18:33TimMcoh hmm
18:34technomancytalios: the only reason I'd use a language with as primitive of a type system, bad error system, and missing interactive development system is to do work on a microcontroller, but Google Go doesn't even support that.
18:34TimMcYou're right, that inner exception *should* be the outer one. Shenenigans somewhere around here.
18:34amalloybecause that stacktrace is upside-down compared to what we're used to, with what i'd expect to be the root cause (your attempt to call .map wrong) is allegedly caused by some other problem
18:34danielcomptontechnomancy: javascript's got you covered there
18:35taliosdanielcompton - js on a micro?
18:36danielcomptontalios: yep, along with primitive type system and bad error system
18:36taliosdanielcompton - excellent!
18:36technomancyat least js has a repl
18:39danielcomptontechnomancy: yeah, that is a +
18:39technomancynot that I would use it by choice in any case
18:40taliosdanielcompton - stop currying your sentences, unless you want nann with that.
18:40taliosoh wait - thats not an expression. wheres your ; damnit,.
18:40taliosdarn symbol heavy languages
18:41justin_smithtechnomancy: hell, even forth has an interactive mode
18:41TimMcYet again I have found myself wishing for M-x paredit-reverse sexp
18:41technomancyjustin_smith: that's exactly why I'm using it =)
18:41TimMc*paredit-reverse-sexp
18:41technomancynoninteractive development is the worst
18:42amalloyTimMc: whaaaaaat. like, you wrote (ys xs f map) accidentally?
18:42TimMcamalloy: ->
18:42tadni_technomancy: Don't most work wish non-interactive dev?
18:42xemdetiaRPN-clojure-mode
18:43TimMcalthough you'd also need some unnesting functions as well to turn (baz (bar (foo))) into (-> (foo) (bar) (baz))
18:44amalloyyeah, that's not really reverse-sexp at all anymore. someone wrote arrowize-sexp some time ago
18:45TimMcAnd let's be fair, any time I want to reverse a sexp it's because I really want to invert the -> transform. :-)
18:47TimMctechnomancy: Tell me of this refactorer for emacs...
18:48technomancyTimMc: it's called concatenative programming
18:48TimMc*squints skeptically*
18:49technomancyI have no idea what you're talking about, so I made something up?
18:49microamptechnomancy: just curious, still digging ocaml?
18:50TimMctechnomancy: http://logs.lazybot.org/irc.freenode.net/%23clojure/2011-10-03.txt grep arrowize
18:50technomancymicroamp: I still like it, but I don't have any current projects that are a good fit for it
18:50TimMcThis must be it: https://github.com/clojure-emacs/clj-refactor.el
18:51microamptechnomancy: likely old news to some, but https://github.com/artagnon/rhine
18:51technomancymicroamp: huh, interesting
18:51mearnshthat sounds neat
18:51technomancyI've seen a few attempts at clojure-on-llvm, but implementing in ocaml will undoubtedly give a good head start =)
18:53hiredmanjust looking at the rhine readme for a few moments reveals mistunderstandings of lexical scope
18:53amalloyTimMc: i've just discovered i can avoid having to back up my claims if i can imitate technomancy's style well enough to choose greppable words he would have used to say the same thing three years ago
18:54TimMcNaming consistency is fascinating.
18:54TimMc"What would I have called this file I wrote 5 years ago? Ah, there it is..."
18:54xemdetiaI name all my projects based on TV shows I binge watch
18:54xemdetiaI use my log of those shows to crossrefrence
18:55amalloyxemdetia: technomancy does a classier version of the same thing
18:55xemdetiasorry I am devoid of class
18:55xemdetia:(
18:55technomancyamalloy: I am actually not familiar with Wagner despite allusions otherwise.
18:56amalloywell, i meant your names from literature in general
18:56technomancyah, yes
18:56technomancyI think of it more widely as fiction in general
18:56amalloyhiredman: wow, you're right. i was reading it and everything was making perfect sense, and then POW, what the heck is this dynamic scope
18:57dorkmafiahow do you print to the console with clojure?
18:58technomancyI wonder if the reason no one paid attention to nrepl-discover is that I broke my theme of picking an interesting name.
18:58hiredmanamalloy: I know, and you know what is wild, last I checked no one in the entire hackernews thread mentioned it
18:59hiredmanamalloy: which is how I know it won't go anywhere, no one has actually looked it, just used saw lisp and fired back whatever their knee jerk lisp response is
18:59hiredmanlooked at it
19:04dorkmafiais there a console/log somewhere?
19:05technomancydorkmafia: println
19:07noonianor js/console.log
19:07turbofaili certainly didn't look at rhine. even if it did use proper scope, it would take many years before it could even begin to approach the JVM clojure level of usefulness
19:08amalloyis it a bug or a feature that (js/console.log ...) works? i would expect (.log js/console ...) to be the thing you have to do
19:09turbofailalso i'm just generally skeptical of LLVM stuff
19:10technomancyisn't LLVM a bit like ZeroMQ?
19:10technomancy"Not actually a (virtual machine|message queue) but attracts people who assume it is."
19:11turbofailyeah that seems rather apt
19:11dorkmafiaty technomancy
19:11Bronsaamalloy: according to dnolen_ it's expected behaviour
19:12tbaldrid_technomancy: turbofail: it's really that LLVM uses VM in the literal sense of the word, not in the commonly used way. It really is a Virtual Machine, just a very low level one..
19:12justin_smithtechnomancy: you could add mongodb as a db to that list
19:13technomancyjustin_smith: hehe
19:13mearnshtechnomancy: do you ship atreus outside the us
19:13technomancymearnsh: yeah, I get a lot of international orders. shipping isn't free, but I'll just factor it in.
19:13technomancy"a lot" being relative of course =)
19:13mearnshcool. neat project
19:13technomancythanks
19:15technomancymearnsh: I took down the option for fully-assembled boards in favour of emphasizing kits, but if you open up the web inspector you can un-invisiblize the "additional comments" section and request a fully-assembled board.
19:16mearnshhaha. kit's fine by me
19:54dorkmafiahttp://paste.debian.net/120125/ can someone give me some pointers on how to figure this out
19:55hiredmanyou are passing 2 args to send-message on line 83, it takes more than 2
19:55dorkmafiait says I'm passing two args to the send-message function but I printed out the args and I only see one
19:55dorkmafiaor rather in the code it looks correct
19:55hiredmanthe def for send-message there takes 4 arguments
19:55dorkmafiahiredman: do you see the println of the args though?
19:56amalloydorkmafia: look at line 10 of your paste. you call send-message with two args
19:56amalloyconn, and (create-reply ...)
20:01tadni_So, it appears cider-scratch doesn't jack into a cider repl ... you'd think it'd do so automatically. :^P
20:01tadni_Not a big deal, but still a minor thing I'd think would be automated.
20:01dorkmafiaamalloy doesn't it depend on what the output of (create-reply .. ) is?
20:01amalloyno
20:01tadni_Well I guess a nrepl instance, not a "cider repl". :^P
20:02amalloy(create-reply ...) is exactly one object, no matter what. it can't be three objects. if you pass it, and one other object, to a function expecting four args, then you are passing only two args
20:02dorkmafiaamalloy: https://github.com/dedeibel/xmpp-clj/blob/master/src/xmpp_clj/bot.clj#L70 this code works though all i did was upgrade the underlying jars
20:03hiredmandorkmafia: what makes you think it works?
20:03amalloydorkmafia: the only way that code fails to throw an exception is if nobody runs it
20:03hiredman(that definitely doesn't)
20:04dorkmafiaok
20:04dorkmafiawhich means it's all horribly out of date
20:04dorkmafiathank you guys ;)
20:04dorkmafia:)
20:05hiredmanthat would never have worked on any version of clojure
20:06dorkmafiaah i upgraded the underlying smack jar
20:06hiredmanthat wouldn't change anything
20:06hiredmanthe clojure source code is plain incorrect
20:06hiredmanhas nothing to do with smack
20:06amalloythe xmpp code you linked to is not self-consistent. it can't run ever. i'm guessing it was in the middle of a rewrite that didn't get finished
20:07dorkmafiayah i'm rewriting it now to also have the latest smack jar
20:07dorkmafiai'm going to change the name instead of forking
20:07dorkmafiamy working name for it so far is smackulre
20:08amalloyyeah, the last commit on that file, https://github.com/dedeibel/xmpp-clj/commit/d089da15cfa76d344752d748d93781646ea768e7, looks like it changed from working code to non-working code, and is labeled "cleanup"
20:08dorkmafiabut it's my first time writing clojure so it's a bit rough
20:16hiredmanxmpp as a protocol is pretty terrible, so that is going to be rough too
20:17hiredmanstreaming xml, not exchanging xml documents, but your entire interaction with the server is a single xml document
20:17hiredmaninsane
20:51celwellI'm using a simple "lein ring server", and plaintext responses are sent quickly, but I'm now testing a more involved bootstrap theme and it takes about 15 seconds to load! I can load the page up also instantly off my WAMP server (I'm on Windows), but the ring server is way too slow to develop efficiently. Any ideas? Has anyone experienced this? (I feel a lot of friction with the Clojure workflow, the simplicity of
20:51celwellPHP page reloads is beckoning me back to the mire of imperativity and state.)
20:51beamsoi'm developing off ring and not seeing those types of delays
20:52beamsobut it really depends on how your application is structured
20:52beamsoi'd look at the network tab of the dev tools in chrome to see what is taking so long
20:54justin_smithcelwell: are you testing the transfer times from the server, or total page render time?
20:56justin_smithand yeah, 15 seconds is kind of absurd - I can do complex pages with content from a db, templated using arbitrary clojure code in my template bodies, using partial templates that get combined at runtime, and have a local transfer time under 100ms
20:56justin_smith(this is with smart caching on the db side etc. but still...)
20:57celwelljustin_smith: transfer time, I'm looking at chrome dev tools. I took out enlive templating and it's just the static resources.
20:58justin_smith15 seconds for static resources?
20:58hiredmanlein ring server injects various bits of middleware, so who knows what is happening
20:58amalloydoes your network stack use baling wire for the loopback interface?
20:58akurilinCan someone much smarter than me tell me how you folks deal with email abuse? E.g. I let our users share some stuff with random people on the Internet through email, how do I prevent them from trolling us and abusing the system? Do I just count the # of emails they send in a day?
20:58celwellamalloy: ha i'm running locally
20:59amalloycelwell: right, the loopback interface is localhost. thus the joke
20:59justin_smithcelwell: that's what loopback means
20:59justin_smithmaybe your fs is mounted on a tape drive, and it takes that long for the ring server plugin to check for file changes to reload?
21:00justin_smithnfs over an analog modem?
21:00amalloyjustin_smith: better yet, sshfs
21:00justin_smithover analog modem
21:01amalloyback in my clueless youth i tried working remotely via sshfs, instead of sshing to my work machine. took like...minutes and minutes to start lein repl
21:04celwellI think if I uberjar every change I can upload to aws and run from there all within 13s, saving 2s.
21:06justin_smithcelwell: if you use a tool like yourkit or even jvisualvm (which comes with the jdk) it shouldn't take long to figure out what is making your requests take that long
21:06celwellThe weird thing is that the latency is spread out over the all the resources (it's not like it's a 15s wait and then everything dumps)
21:06justin_smithalso try using lein run instead of lein ring server
21:08justin_smithcelwell: the two times I recall that kind of performance drain with ring were 1) someone put multiple calls to eval in a template renderer and 2) someone tried to use bcrypt for basic auth for each request
21:09celwelljustin_smith: I thought it might be enlive, but when I just pipe it statically through (route/resources "/") it's the same.
21:09amalloyyou're probably doing one stupid thing at the top level of your handler, something you don't need to do at all like writing 10MB of debug output, and that happens for each request the client makes
21:10justin_smithcelwell: profile it - there is a free profiler with the jvm, it's really the best way
21:10justin_smith(it's not an excellent profiler, but it works)
21:10amalloyjustin_smith: guessing is more fun. if you're right, you look like a genius
21:10justin_smithlol
21:11justin_smithcelwell: grep your code for calls to (Thread/sleep 15000)
21:12jtackettanyone know the regex for a double dash?
21:13justin_smith,(re-matches #"--" "--") ; like this?
21:13clojurebot"--"
21:13jtackettya but that woun’t match like the combined one
21:13jtackett
21:14justin_smith,(re-matches #"—" "—")
21:14clojurebot"—"
21:14jtacketthaha ya just realized it when I typed it
21:14justin_smiththat's called EM DASH btw
21:15justin_smithhttps://img.4plebs.org/boards/pol/image/1403/06/1403061838700.png there is no easy regex for this
21:16mearnsh(dec justin_smith)
21:16lazybot⇒ 75
21:16mearnshbad joke penalty :)
21:16justin_smithheh, I earned it
21:17mearnshwasn't sure if dec was implemented
21:17justin_smith$karma so
21:17lazybotso has karma -33.
21:17justin_smithheh
21:17mearnshhaha, i see
21:18xeqi$karma MaxErrmin
21:18lazybotMaxErrmin has karma -1000.0.
21:18justin_smithlol
21:18justin_smith(dec MaxErrmin)
21:18lazybot⇒ -1001.0
21:19justin_smithit's still floating point, of course
21:20mearnshwow what did MaxErrmin do
21:20justin_smithI think amalloy was messing around with the lazybot internals
21:21mearnshoh yeah http://logs.lazybot.org/irc.freenode.net/%23clojure/2014-07-31.txt
21:22amalloyxeqi applied one of the many lazybot security holes he keeps in his back pocket to set it to 1000. i countered by setting it to -1000, but since i did it through the mongodb shell it turned into a float
21:23justin_smiththanks for nothing, javascript
21:23mearnshthat sounds like a lousy shell
21:23justin_smithmearnsh: so unlike the other marvelous properties of mongodb
21:23amalloyit's good practice for people who frequently forget how to type NumberLong
21:24justin_smithhttps://www.youtube.com/watch?v=qjOZtWZ56lc
21:25celwellhmm... I killed all my java processes and then did "lein ring server", and the first load was sub-second; I pressed refresh and then back to 15s loads.
21:26justin_smith"it's time for wangernum, let's rotate the board"
21:30amalloythe first mitchell & webb sketch i saw was "A bigger spoon". it's quite amusing, and i can claim it's on-topic for #clojure because it reminds me of spec/requirements discussions with users: https://www.youtube.com/watch?v=Hu9nhExp5KI
21:31justin_smithdanielcompton: the bag says "NO" on it, right?
21:32danielcomptonjustin_smith: lets rotate the bag!
21:32justin_smithheh
21:32danielcomptonjustin_smith: yes it says NO
21:34akurilinRandom question: say you need to send bulk email. Assuming you don't care about the result right there and then, do you just send them to an agent and have that take care of sending them off asynchronously?
21:34akurilinThe challenge there would be to make sure you're not suddenly failing everything without knowing about it
21:34justin_smithakurilin: you can set the error function for an agent
21:35amalloyakurilin: an agent doesn't make sense to me, unless you want to be careful to send exactly one email at a time, with no parallelism
21:35akurilinright, I'd have to make sure to log and track that
21:35akurilinamalloy: what would you recommend I use?
21:36amalloyi mean, it depends on your requirements, but an executor with its own threadpool (stuff from java.util.concurrent) is rarely far wrong
21:36justin_smithakurilin: what about an array of futures, and then you don't return until all features are completed (and handle all the errors as need be)
21:36amalloy$google raek exectuors in clojure
21:36lazybot[raek: Executors in Clojure] http://blog.raek.se/2011/01/24/executors-in-clojure/
21:37amalloywow, is that really 3 1/2 years old? i'm getting old
21:38akurilinoh cool, thanks for the link
21:41nullptrcelwell: have you tried in multiple browsers? i've seen chrome get weird a few times when its cache is out of sync
21:43celwellnullptr: thanks, but no difference in firefox
21:46nullptrare you accessing your machine by ip address or hostname?
21:47celwelllocalhost:3000
21:47nullptrtry 127.0.0.1 ... just for fun
21:48nullptrlocalhost could map to ::1 and cause some kind of weird delay before reverting to ipv4 #speculation #reaching
21:48arrdemanyone worked with pattern expressions in Clojure?
21:49arrdemI'm aware of core.match but I was wondering if there were other games in twon
21:49arrdem*town
21:49celwellnullptr: no dice. i'm starting to think ring server is just actually that slow (at least on my machine)
21:50nullptrcelwell: doubtful ... smells like networking ... you could try on a VM to confirm
21:50justin_smithcelwell: have you tried profiling yet?
21:55celwelljustin_smith: yes, but not able to discern much (might be my fault). here is the log dump if you care to import it: https://gist.github.com/celwell/eed6a902c26e4bbf36f8
21:55kenrestivoturn ipv6 off.
21:55celwella lot of time is spent on "sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run()" but I'm assume the problem is merely nested in there, not that itself
21:56seabreDoes anyone use midje/lein-midje and environ/lein-environ together? When I run lein midje, my tests use my dev environment variables, not my test ones.
21:56seabreThe workaround is to just to put them in .lein-env, but seems like I shouldn't have to do that.
21:57jtackettdumb question, but what's the best way to convert a lazy seq to a string
21:58amalloycelwell: try turning off the auto-reload feature in lein-ring. there's a lot of stuff in there that looks like searching the classpath for clojure files and checking if they've been modified
21:58holojtackett (apply str my-seq)
21:58celwelljtackett: (holo's answer) but if it's infinite you need to (take) some first
21:59jtackettthat was inefective
21:59jtackettcan’t just apply str
21:59cflemingarrdem: depends what you're doing, have you seen seqex?
21:59seabre(str my-seq) doesn't work either?
21:59jtackettnope
21:59cflemingarrdem: for general matching AFAIK core.match is the only option
21:59celwelljtackett: (doall) first?
21:59jtacketthaha tried that oo
22:00jtacketttoo
22:00arrdemcfleming: mmkay. thanks.
22:00cflemingarrdem: seqex is really great for macro stuff, I use something similar internally in Cursive.
22:01arrdemcfleming: yeah I remember it from the illuminated macros talk
22:01cflemingarrdem: but it's not very general.
22:01jtackettnvm got it
22:02amalloyjtackett: (pr-str my-seq)
22:03arrdemcfleming: ah see what I've done is built essentially a database of decomposed maps and I'm playing with a querry language based on structural pattern matching over maps in the database.
22:03arrdemcfleming: I was wondering if there was other prior art mod core.match which I need to play with anyway.
22:04cflemingarrdem: not that I know of - I think core.match is your option.
22:04cflemingarrdem: if you wanted to do something tricky you could use automata, maybe? Depends how complex your matching language needs to be.
22:05celwellamalloy: wow, that was right on. {:auto-reload? false} is giving me sub-second loads consistently. hmm... but I would like to have auto-reload... does this mean I need to terminate the ring server every change?
22:05amalloycelwell: just run your server from inside nrepl/cider/swank or something, and reload it by hand when you change things
22:06amalloythat's a much better dev setup than lein ring server anyway
22:08beamsoby "reload it by hand when you change things", is there stuff that will automatically get picked up or does it always require that manual operation?
22:09amalloybeamso: if you make a change in foo.clj, then C-c C-k in that buffer (or whatever is equivalent for your editor tooling)
22:10beamsookay
22:10beamsoi'm using cursive
22:11justin_smithcelwell: you are spending a lot of time on file-seq
22:12celwelljustin_smith: is ring's :auto-reload? doing that?
22:12amalloyjustin_smith: already fixed that
22:12justin_smithOK, I didn't see all the scrollback
22:13amalloyjustin_smith: i'm gonna take credit for guessing: "you're probably doing one stupid thing at the top level of your handler, something you don't need to do at all"
22:14justin_smithhah
22:14amalloy(as it turns out, scanning the entirety of your bootstrap resource files to see if any of them are clojure files that need to be reloaded)
22:14justin_smithahh, that would probably have an effect, wouldn't it
22:16celwellamalloy: i see... makes sense. thanks for pinpointing the problem. i owe you a beer or coffee if you want it. i'm five minutes from santa monica
22:17amalloycelwell: hey, any time. i don't do this for the free coffee :)
22:27cddrDo clojure methods have anything like CLOS's eql specializer?
22:30justin_smithcddr: functions are only trivially equal, and methods aren't even first class
22:30technomancycddr: multimethod dispatch uses isa? and associated hierarchies, so they can be customized with derive.
22:30technomancythat said, this is very rarely used
22:30justin_smithtechnomancy: oh yeah, that is probably closer to what is meant here
22:31technomancyclojure gets equality right out of the box for the most part, so you don't have to override it much
22:31justin_smithtechnomancy: the ability to dispatch using an arbitrary function with defmethod is kind of a superset of that feature anyway
22:31technomancyindeed
22:32cddrThanks for the food for thought
22:43AlvaloEvening
23:55jose_leetohello