#clojure logs

2013-05-18

01:29nonubyclj-schema looks interesting, but there before that I have to co-erce the data, .e.g imagine a json endpoint, the one of key of the map should have a datetime value, so first step is check that its datetime string, second step is coerce into a datetime or joda instace, third step clj-schema validates the real map. is there anything that covers the first two inclusive of the third
01:47tieTYTis it a good practice to mark all my side-effect functions as dynamic so I can bind them for testing purposes?
01:53nightfly__That sounds like a pretty bad practice
02:01avishaihu
02:01avishaisuppose i need worker threads
02:01avishaiagents can do that, but it doesn't feel natural
02:01avishaishould i just use java executors?
02:31muhoois there some magick required to get lein-cljsbuild to see cljs sources? i'm looking in the jar, the cljs files are there, and yet, i'm getting goog.require errors
02:32muhooauugh, nevermind :-/
02:52tomojavishai: yes
03:56tomojI want a programmer's thesaurus
03:56flu-rosetta code?
03:59tomojthat's cool, but I just mean domain words
03:59tomojbasically I want a book that thinks for me I guess :(
03:59flu-heheh
03:59flu-then we'll all be out of a job
04:02spoon16dependencies resolved via s3-private-wagon do not get cached in ~/.m2
04:04tomojhmm.. my guess is that most programmers will conclude that the chinese room is absurd very soon after encountering it
04:05tomojI'd like to think that's because they understand something searle doesn't.. :/
04:44jjsWow. I just tripled my framerate by switching from `lein run' to `lein trampoline run'
04:58swkstesting from emacs(sorry guys, just testing)
05:02unsymboltesting 1-2-3.
05:02callenjjs: framerate of what?
05:02swksmessaging
05:02swkscan't believe that emacs so powerfull
05:08jjscallen: this OpenGL thing I'm working on. Currently streaming CPU-generated (and CPU-bound!) pixel data to the GPU
05:09tomojodd
05:09tomojwhy should trampoline help?
05:09tomojI thought the only difference was whether another JVM was left sitting around
05:09swks:q
05:11jjsIt could have something to do with how much memory is available to the program, but the memory I'm mapping is directly (and natively) allocated by the GPU driver... so it shouldn't be part of the JVM heap...
05:11callenthat is pretty damn strange
05:11callenstranger still is doing graphics work in the JVM :P
05:12jjsNo, that shouldn't do it, either... top reports resident memory being stable ~480MB
05:13jjscallen: Why not? >:D
06:09tomojI wrote "In reality, a clock never ticks. After a tick there is a new clock."
06:09tomojI think the epochal time model has destroyed my brain
06:15winklol
06:15winkI prefer to exchange my watch every second, this is I why I can't support atomic date times?
06:15wink*not
06:16tomojhah AtomicDate
06:16tomojdon't tell rich
06:32samratRaynes: tried using least.authorize but I'm getting {:error 13, :message "Invalid method signature supplied", :links []}
06:33samratRaynes: I did exactly as the readme says
06:37tomoj"(ns core.async"
06:37tomojwait, what?
06:38tomojoh I guess somebody did `lein new core.async`
07:23clojure-newHello.
07:25naeghi clojure-new
07:25clojure-newI'm trying to make cond wrapper macro, like (defmacro [test body] `(cond (= ~test :predefined) (bla bla) ~@body))
07:26clojure-newI want body in format of (:test (bla bla) and i want expand it to (= test :test) (bla bla)
07:26clojure-newIs it possible?
07:26clojure-new(:test (bla bla))*
07:27clojure-newOh wait, ((:test (bla bla) (:test2 (bla bla)), right.
07:27clojure-new((:test (bla bla)) (:test2 (bla bla))) It's so hard without paredit.
07:28clojure-newLet me write a paste.
07:31clojure-newhttps://www.refheap.com/paste/14726 here it is.
07:31clojure-newThe questions is how can i transform ((:test1 (bla bla)) (:test2 (bla bla))) into cond args?
07:32clojure-new,(map #(list (list '= 'message (first %)) (list (last %))) '((:test1 (bla bla)) (:test2 (bla bla))))
07:32clojurebot(((= message :test1) ((bla bla))) ((= message :test2) ((bla bla))))
07:33clojure-newBut it still wrong format for cond.
07:33clojure-newAfter @ it becames ((= message :test1) ((bla bla))) ((= message :test2) ((bla bla))).
07:33clojure-newI need (= message :test1) (bla bla) (= message :test2) (bla bla)
07:34clojure-new,(map #(list (list '= 'message (first %)) (last %)) '((:test1 (bla bla)) (:test2 (bla bla))))
07:34clojurebot(((= message :test1) (bla bla)) ((= message :test2) (bla bla)))
07:34clojure-newOne step closer.
07:36clojure-new@(((= message :test1) (bla bla)) ((= message :test2) (bla bla))) => ((= message :test1) (bla bla)) ((= message :test2) (bla bla)) => ? => (= message :test1) (bla bla) (= message :test2) (bla bla)
07:36clojure-newCan you tell me what that "?" should be?
07:38naegclojure-new: how about telling us what the actual problem is and giving a concrete example?
07:39naegin like on sentence
07:39naegone*
07:39IamDrowsyclojure-new: are you looking for something like case
07:39IamDrowsy,(doc case)
07:39clojurebot"([e & clauses]); Takes an expression, and a set of clauses. Each clause can take the form of either: test-constant result-expr (test-constant1 ... test-constantN) result-expr The test-constants are not evaluated. They must be compile-time literals, and need not be quoted. If the expression is equal to a test-constant, the corresponding result-expr is returned. A single default expression can foll...
07:39Okasunaeg: https://www.refheap.com/paste/14726 Make wrapper around cond.
07:43clojure-new1naeg: yes, like okasu said, i want to make something like wrawpper aroud cond
07:44clojure-new1IamDrowsy: thanks, i'll take a look.
07:44naegit pretty much looks like case
07:44IamDrowsythe doc string is quite verbose... just look at some examples at clojuredocs
07:45naeghttps://www.refheap.com/paste/14727
07:46clojure-new1thank you guys, its exactly what i wanted.
07:56ddellacostawow, I'm just learning ClojureScript and I've come up against trying to pass object arguments to JS constructors…how do I do this in ClojureScript idiomatically? I'm finding a lot about using .strobj, and then things saying you shouldn't do that...
07:58ddellacostaseems like this was getting discussed a long time ago, so I'm guessing there is a natural way to do it these days...?
08:00ddellacostaah, found it I think, cljs.core/js-obj
08:18jugimasteri'm new to clojure.. can i get by without having to touch maven/leiningen?
08:19llasramIf you're a masochist, sure
08:19jugimaster:p
08:19jugimasterit's just that i come from a java background, and i remember maven being a massive, bloated pain in the butt
08:19llasramThe little I've had to touch it has been pretty bad
08:20jugimastermostly kind of useless too
08:20llasramLeiningen however is hands-down the best build/project tool I've ever used for any language
08:20jugimasteryeah.. so it seems a bit contradictory that something that's a bloated pile of shit in the java world, would suddenly be a vital, lovely part of every project's infrastructure when working with clojure
08:20llasram? Leiningen has nothing to do with Maven
08:21jugimasterwhat about ant?
08:21jugimasterno? hm
08:21jugimasteri thought it was based on maven
08:21llasramIt used to use the dep-resolution parts of Maven, but not even that anymore
08:21jugimasterhm.. well, i guess i should take another look at leiningen.. but iirc, it wants you to work within a set project structure etc.. ?
08:22jugimasterbasically i'm just wondering how.. "necessary" lein is
08:22llasramYes, but it's entirely flexible
08:22llasramWell
08:22llasramClojure is just another Java library, packaged as a JAR
08:22jugimastermmm
08:22llasramIf you'd rather wrangle JARs some other way / by hand
08:22llasramyou can do that
08:22llasramBut you're causing yourself a ton of unnecessary pain
08:23jugimasteryeah so.. lein's main benefit is dep handling?
08:23jugimasterkind of like PIP for python
08:23jugimaster?
08:23jugimasteri'm kind of confused about whether i "should" use clojure or golang
08:24Foxboronjugimaster: depends IMO
08:24llasramThink of it as more like a unified pip+virtualenv+ipython
08:24jugimasterbut somehow i get the feeling that i'd like clojure's syntax better
08:24jugimasterhmm
08:24FoxboronGo is the same old C-syntax. Boring IMO. Clojure got this fancy LISP syntax which is "new" and interesting
08:24jugimastersounds vaguely good :p
08:25jugimasteryeah well.. go's syntax looks just about decent enough.. but some C-likeness is leaking through and it scares me :p
08:25jugimasterfor example some pointer stuff, which i have no clue about
08:25jugimasteri guess Go is more performant than Clojure though?
08:26jugimasterhow reliable/kick-ass/lovely is http-kit?
08:31scottjjugimaster: http-kit is not widely used, yet.
08:31jugimasteryeah but should it be?
08:32jugimasteri mean, is it lovely? :p and "production-quality"?
08:32jugimasteror production-ready, etc
08:33scottjjugimaster: idk. I think the super-fast rewrite is very recent. rss miner, the site by the author, is the only one I know of that uses it but I'm not on the http-kit mailing list.
08:33jugimasterhmm
08:33jugimasterwell, what would clojure people use, if you needed web sockets and asyncy stuff, if not http-kit?
08:35jugimasterit's kind of scary though, that if working with clojure, maybe i'd end up having to haul shitloads of useless JARs around, just so my app would function (or even start)
08:36jugimastera big problem on the java side is whatever actually useful lib you might want to use depending on like a dozen commons-whatever.jar -shit-droplets
08:36jugimastersooo.. is it possible to keep clojure projects "neat"?
08:37jugimasterwith python it's lovely that practically everything i use just get slurped into the environment by pip, and it's all just python source code.. combined with whatever C-libs might get put in place - but i don't really have to mind that
08:38llasramThat's why you use e.g. Leiningen. It pulls all the deps together. Build uberjars to deploy, bundling all your dependencies into one artifact
08:39jugimastermmm
08:40Foxboronjugimaster: depends if you use venv or not. Sometimes you get dependency errors with pip.
08:40jugimastersure, but i haven't run into any trouble yet myself
08:40Foxboronwell really.
08:40decaftry working on an 64 bit windows 7
08:41jugimasterso can i sweep all the bloated bloatjars under the rug somehow, so that they wouldn't bother me with their presence? :p
08:41Foxboronjugimaster: you don't normally mind them at all. they just sit there.
08:41jugimasterhm
08:42jugimasteryeah i know, in a way.. i'd just like to keep them separate from my "actual projects" somehow
08:42jugimasterlike, a project would be only the source code and resources that belong to the app _itself_.. and all deps would be somehow separate
08:42llasramYou never actually see the JARs. The get background downloaded and cached -- usually in ~/.m2/ -- but you rarely need to even think about deps you aren't directly using yourself
08:43llasramYou list your immediate deps, and that's it
08:43llasramEverything else is transparent, and your project only contains your source
08:43jugimasterah right.. maven2.. back when i last used maven on a java project.. that .m2 directory ended up with a total fuckload of useless jars, eagerly gathered by maven
08:43jugimasterit just feels dirty
08:44llasramIt's just a cache. Do you get upset about your OS filling your RAM with "dirty" disk blocks?
08:44jugimasterok, so, without lein/maven hiding all that JAR shit somewhere, it's just a pain to manage the deps of whatever you might want to write?
08:44jugimaster:p
08:45llasramWithout easy dependency management, then dependency management is not easy. Yes
08:45jugimaster:p
08:47jugimasteri keep repeating myself a bit.. but it's just that on python, even if you don't use pip, it's still like, cleaner to work with your deps manually.. mostly because typically one library is just one library, and doesn't have lots of useless deps to be lugged around with it.. basically, i guess my problem boils down to all those useless commons-whatevers that were stuffed into practically every java project i remember
08:48jugimasterin java projects, it was just easier to "include ALL the jars!" and usually just have your app work, without figuring out which jars it _actually_ needs
08:48jugimasteraand i guess as a result of that, something like maven was born
08:49jugimasterit was like an.. "at-least-seemingly-necessary evil" that people just lived with
08:50llasramHere's my take: environments naturally encourage libraries/modules to be of such granularity that the number/complexity of libraries is just below the threshold of pain
08:50llasramThe experience with granularity across environments is not necessarily portable
08:50jugimasterexcept that java didn't.. that shit got way out of hand
08:51llasramMaven/Ivy may put you in XML-hell, but they definitely keep dependencies in order
08:51jugimasterbut i guess.. if clojure apps tended to use some "new standard tools" that didn't have reams of unnecessary dependencies.. then that would be nice
08:51jugimasterfor example, is hibernate a standard tool on the clojure side?
08:52llasramNo
08:52jugimasterok, what's replaced it?
08:52Glenjaminjugimaster: what concerns you about these "unnecessary dependencies" ?
08:52jugimasterGlenjamin: it's annoying to have to have them around
08:52Glenjaminoh, just read up - i think you just had this conversaion :)
08:52jugimaster:P
08:52jugimastermaybe
08:53Glenjamindependencies = code i didn't have to write = good
08:53llasramAFAICT most people using Clojure with relational DBs don't use an ORM
08:53jugimasterGlenjamin: yeah, but "a bunch of commons-turd.jars that nothing in this app _actually needs/uses_" is Bad.. :p
08:54Glenjaminwhy?
08:54clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
08:54jugimasterbecause they shouldn't be there?
08:54Glenjaminif the cost of having them there is greater than the benefit of using whatever depends on them, then sure
08:54Glenjaminbut i don't believe that is the case
08:54jugimasterit makes sense that "code i didn't have to write" would be good.. assuming it's good code, and does exactly what you needed, of course
08:55jugimasteryep
09:18xificurChi, I'm a little puzzled here, if I downloaded and installed leiningen did I also get the lastest version of clojure?
09:19xificurCalso could you point me to the current most used emacs+clojure choice?
09:19llasramxificurC: From the JVM perspective Clojure is just another library. Leiningen will download whatever version of Clojure a project specifies for that project to use
09:20xificurCllasram, ok thanks. What about emacs, do people use slime for clojure?
09:21scottjxificurC: people are moving to nrepl.el
09:21llasramYah
09:21llasramYah on what scottj said, to clarify
09:21llasramUse Emacs 24 and the builtin package manager. You'll need to add Marmalade as a package source, but then you can use `M-x package-list-packages` to install clojure-mode and nrepl.el
09:23xificurCcool I uesd nrepl before so I might be able to install it on this pc too
09:23xificurCthanks!
09:23llasramnp!
09:24xificurCdo you guys recommend these settings to be added https://github.com/kingtim/nrepl.el#configuration
09:25llasramThose are personal decisions you will need to make yourself :-)
09:26xificurCmeh I never liked paredit
09:26llasramThen you are in the minority, sir
09:27llasramIt took me a little getting used to at first, but now I'm not sure how anyone programs in a sexp-based language w/o it
09:27tomojllasram: really? or are we just a very vocal minority :)
09:27tomojI still owe lau a screencast I think.. :/
09:28xificurCllasram, I dont see a problem finishing up my parens right. Maybe editing the code is easier with it?
09:28llasramtomoj: Almost everyone I know who has stuck with Clojure / been successful with it uses structural editing
09:29tomojI should just record myself for a bit, I always wanted to do a nice tutorial screencast
09:29llasramxificurC: Yeah, there's two parts IMHO. (1) You just don't need to ever even worry about mis-matched parens. It never happens, so you stop even thinking about it
09:29tomojjust watch someone skilled use paredit, you'll see :)
09:30llasram(2) You stop editing your code as lines and instead purely as sexps. You can change structure in a way which makes sense for the language syntax with just a small collection of structural primitives
09:30tomojand navigate
09:30xificurCI'd probably need to sit next to a heavy emacs user to learn all the editing tricks
09:31tomojthough I feel like getting good at navigation is a big investment, I still think I'm much clumsier navigating that the ideal paredit user after.. years
09:31scottjxificurC: maybe check this out http://emacsrocks.com/e14.html
09:33xificurCill take a look scottj thanks
09:34jugimasterso what do clojure folks use instead of hibernate?
09:34llasramSQL
09:34jugimasterjdbc?
09:34jugimasteris there anything like SQLAlchemy?
09:34jugimasterit's great
09:35llasramKorma is probably the closest, but it has several detractors as well: https://github.com/korma/Korma
09:36xificurCeven strings close up? I dont remember that happening a couple months ago
09:50dhljugimaster: Have you checked out ClojureQL? http://clojureql.org/
09:53xificurCparedit-splice-sexp-killing-backward <-- lovely name that is
09:57xificurCI dont understand why programmers dislike lisps. I'm no programmer and I love it
09:59r0bglees0nxificurC: i dont have an impression that programmers dislike lisps
10:03xificurCr0bglees0n, I feel like lisps arent popular enough. You see java, c#, python, ruby and such everywhere but not much common lisp, clojure, scheme or the like
10:03hyPiRionr0bglees0n: I have an impression that some programmers disklike the parentheses because there are so many of them
10:05Glenjaminsometimes when i line ends in ))))))) i :(
10:05hyPiRionI'm happy as long as I have my rainbow parens
10:06Glenjamini really need to switch to a better editor
10:07hyPiRionGlenjamin: what are you currently using?
10:07Glenjaminsublime
10:08hyPiRionWell, it does have some plugins, doesn't it?
10:08Glenjaminyeah, but doesn't have anything that does rainbow
10:08Glenjaminit's ok, but i should really try and switch to emacs for clojure
10:09hyPiRionWell, you should give it a try at least
10:10kmicuxificurC: Justin Bieber is popular, does that mean that it is good? #popularenoughsyndrome
10:11jugimasterdhl: that looks promising, thanks!
10:12xificurCkmicu, of course im not saying everything popular is good, im just often frustrated when something good remains unknown or underground
10:12kmicuGlenjamin: https://github.com/masondesu/sublime-paredit
10:12dhljugimaster: :-)
10:12Glenjaminkmicu: i'm using that, it's kinda buggy but better than nothing :)
10:12jugimaster:p
10:20kmicuGlenjamin: You can always try to migrate to https://github.com/fatih/subvim and after that to emacs with evil-mode x]
10:29swkshello there
10:30hyPiRion1hey
10:30swksfeeling frustrating, more than 2 hours trying to figure out what's wrong with my emacs config
10:30swkstrying to set it up ready for clojure development
10:30swkshttp://clojure-doc.org/articles/tutorials/emacs.html
10:31swksdoing everything line by line, but getting symbol doesn't recognized exceptions
10:32hyPiRionOn the configure emacs-part?
10:32swksMaybe it's something wrong with repl
10:34kmicuIf you are a fresh emacs user you should try some OOTB configs like https://github.com/overtone/emacs-live
10:35kmicuAnd you can start coding clojure in emacs in 5 minutes.
10:36swkskmicu: thanks, looks AWESOME!
11:15m0smithhi
11:16m0smithIs it possible to treat am interface (ILookup) as a protocol?
11:16m0smithBasically I have an object I want to be able to treat as a "map"
11:19bbloomm0smith: i'm not sure what you're asking about RE interfaces vs protocols, but it's actually quite a lot of work to provide a correct implementation of all the map interfaces. if you just want ILookup (and not, say, equality and seq and all that) then just read the docs for deftype
11:23Glenjaminyou mean defrecord?
11:32alandipertm0smith: you can't extend-type an interface to your class, sadly. you can implement ILookup with reify and make a function that converts your objects into franken-maps, or you can make a full-blown type as bbloom points out. (http://david-mcneil.com/post/16535755677/clojure-custom-map is handy reference)
11:33alandipertm0smith: generally if i need java objects to be associative i will convert them to maps via reduce, bean, or similar
11:36pppaulanyone in here use emacs live?
11:37pppauli've been using starterkit for a few years, just started playing with live… wondering if anyone in this channels has any thoughts on it
11:46@rhickeythere are now docs for core.async alt and async (but impls still wip) for those following along
11:48bbloomrhickey: cool! just the docstrings right now? or is there a broader overview somewhere? a design doc or something
11:50@rhickeythere are lots of design docs on my machine
11:51@rhickeyI haven't put into a narrative for users yet
11:51@rhickeybut basically its CSP-like channels, with thread blocking and inversion-of-control parking impls
11:52@rhickeythe latter allowing for high-connection count servers on the JVM and use by CLJS wherever it runs
11:53bbloomexcellent. dnolen & i and a few others were already plotting a CLJS port in here yesterday :-)
11:53@rhickeyhopefully the death of callback hell
11:53@rhickeythe team will probably be doing a cljs version, and I hope to jugger the code so a minimal amount of cljs-specifics will be needed
11:53@rhickeyjigger
11:54@rhickeySo you should ping Timothy Baldridge to coordinate for cljs if you want to help out
11:54bbloomok, even better! thanks
11:55@rhickeycljs will be trivial, no locks needed
11:56m0smithalandipert: Thanks. The problem I have is I want to not modify the original object. It implements an interface but I need to keep the original implementation to pass back
11:56@rhickeybut same design and engine, queues of parked callbacks are used even in the blocking version, blocking is just at edges
11:56bbloomyeah, I think that the IOC stuff will be absolutely killer for CLJS
11:56m0smithWhat I really need to to be able to build a protocol from an existing interface
11:57m0smithbut I have not pried openthe protocol black box to see what is inside yet
11:58@rhickeywe'll also move to FJ pools on the parking JVM version
11:58pppaulwhere can i read the docs for core.async?
11:58bbloompppaul: https://github.com/clojure/core.async/commits/master
11:59@rhickeyI saw there were some questions about scheduler etc for cljs, that won't be necesary
11:59@rhickeyy
11:59pppauli guess the tests are the docs
12:00@rhickeypppaul: it's work in progress, not for consumption yet if you don't want to read code
12:00pppauli like reading code
12:00@rhickeytests are not docs, there are doc strings
12:00@rhickeyfeedback for which is welcome
12:06@rhickeyok, gotta run, hopefully in a few days it will be ready for more tire-kicking, including some narrative
12:07pppauldocs seem good, though i still have little idea as to how to use this.
12:07OkasuHi, trying to create table using korma connection but failing, https://www.refheap.com/paste/14733 . Whats wrong there?
12:10bbloompppaul: i think that this golang video is a good intro https://www.youtube.com/watch?v=f6kdp27TYZs
12:10pppaulthanks. watching
12:11juxovechi
12:11juxovecdo any of you use Luminus (Clabango)?
12:11juxovecHave you ever seen: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: context-lookup in this context (tags.clj:67)
12:13winkjuxovec: could you pastebin some code? :)
12:14juxoveci have no clue which part of my application causes this problem
12:14juxovecexception is from clabango 67 https://github.com/danlarkin/clabango/blob/master/src/clabango/tags.clj function from https://github.com/danlarkin/clabango/blob/master/src/clabango/filters.clj
12:14winkjuxovec: looks like if/endif, yea
12:15winkI'd check the templates first
12:15juxovecyes, there is {% if message %} {{message}} {% endif %} in my templates
12:16juxovecthis is only if in my templates at all
12:19winkjuxovec: are you using it any different than by using render in layout?
12:20winkotherwise no clue, sorry
12:22juxovecwhen I remove posted snippet problem disappears
12:22winkmaybe you managed to get a non-default whitespace in there?
12:23winkor it can't do singleline? :P
12:23winkI'm poking in the dark here
12:29tomojhmm.. death of callback hell? OK. but aren't we just in CSP limbo? :)
12:29tomojI still need to read hoare
12:30tomojs/OK./yes!/
12:30dnolenbrainproxy: pushed out mori 0.2.0 to npm
12:33bbloomtomoj: i'm still not sure why you are so negative on CSP
12:33tomojI chose "limbo" in an attempt to not be so negative
12:33bbloomnegative connotation to me :-)
12:34tomojwell, yeah, it ain't heaven
12:34clojurebotHuh?
12:35tomojsuppose you could get a lazy seq of mouse events w/ batik. abuse of lazy seqs?
12:35tomojwell it wouldn't really be lazy huh, but a seq at least
12:36bbloomseqs are defined by two operations: first and next. channels have two DIFFERENT operations: put! and take!
12:36tomojyeah
12:37bbloomchannels are inherently queues, optionally bounded, and inherently mutable
12:37tomojjust hypothetically
12:37tomojthe thing is, I don't want to be forced into exclamation points just because cljs only has one thread
12:37bbloomlazy seqs are "pure" in the sense that successive calls to first or next on the same seq produce the same results
12:37bbloombut "exclamation points" aren't inherently bad if you need to actually have some effect on the outside world
12:38tomojdefinitely, in that case I'm fully on board
12:38bbloomand that "outside world" might very well be just the world outside of your little function if you are modeling your program as communicating sequential processes
12:38tomoj(my s/OK./yes!/ was an attempt to indicate that in some respects I am not negative but quite positive :))
12:38tomojyeah
12:39tomojbut I don't want to be forced into making a small component of a cljs program a CSP just because I can't block
12:39bbloomso you'd rather callback hell?
12:39tomojno, that's why "yes!"
12:39tomojI'd rather heaven
12:40tomoj"limbo" is probably unfair, there's just something else I want _too_ :(
12:40@rhickeybbloom: how would you know what happened w/o labels?
12:41@rhickeygood deck on csp http://www.cs.kent.ac.uk/projects/ofa/jcsp/jcsp.pdf
12:41bbloomrhickey: do you always care what happened? i'm thinking about golang where they don't have labels, but i guess they get around the problem by allowing assignment statements in select clauses
12:42@rhickeyyeah, golang is awfully imperative there
12:42@rhickeyyou can always ignore the lables
12:42@rhickeylabels
12:42@rhickeyjeez, autocorrector
12:42bbloomcan i have duplicate labels? ie if i want to label something :_ just like a _ in let bindings?
12:43@rhickeyyes
12:43bbloomthen i guess it's effectively optional :-)
12:43pppaulwhat is CSP?
12:43@rhickeywell, there must be labels
12:43tomoj$google CSP
12:43lazybot[Communicating sequential processes - Wikipedia, the free ...] http://en.wikipedia.org/wiki/Communicating_sequential_processes
12:45bbloomi know that the labels are *necessary* for some cases, but thinking through the little mini google search engine demo rob pike did. he didn't really care which "search backend" responded. each one just yielded (or didn't) a search result & that got shoved into a result set
12:45@rhickeypppaul: see link I just posted
12:45bbloomrhickey: that pdf isn't loading for me
12:45@rhickeybbloom: I don't see that case worth the complexity of optionality
12:46bbloomrhickey: fair enough. i haven't written a lot of CSP code, just toyed with golang a bit. the labels thing was simply noticeably different from go, so i thought worth analyzing
12:47pppaullooking at it now @rhickey
12:47@rhickeygo is imperative, select is a statement not an expression
12:47tomojrhickey: so are stu's future seqs doomed? or maybe we can build them on top of CSP?
12:47@rhickeyfuture seqs?
12:48tomojthere was a little experiment in cljque called that, just replacing the 'rest' of a seq with an INotify basically
12:51cbp`callen: did the paste help you? Let me know if you need me to do more I have plenty of time this weekend
12:51tomojI probably inappropriately took the disappearance of cljque as a sign that there may be a dead end waiting that way
12:57tomoj"The theory of CSP includes mutually consistent denotational semantics, algebraic semantics, and operational semantics." hooray
12:58bbloomrhickey: you asked for doc feedback: could mention duplicate labels are allowed
13:00bbloomexcept :default, of course
13:02tomojlooks like multiple :default will work, but would be a cruel thing to write
13:02tomojoh, no, the extras will get dropped
13:03bbloom,(case 1 :x 2 :x 3)
13:03clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate case test constant: :x>
13:03bbloomit's nice to catch such errors at macro expansion time. alt could warn about duplicate :default
13:13tomojhuh, it looks like a chan with a nil buf will just keep all its puts forever?
13:17tomojoh no I was just using it wrong
13:18bbloomtomoj: in theory no buffer would block
13:18bbloomhttp://golang.org/doc/effective_go.html#channels talks about buffered & unbuffered channels
13:18bbloomlooks like core.async lets you override the specific buffer type & there are a few choices
13:20bbloomtomoj: http://zguide.zeromq.org/page:all is also worth reading, since 0mq sockets are basically CSP channels. 0mq also has pluggable dropping or blocking or whatever semantics for different socket types
13:23tomojbbloom: what I mean is if the buf is nil, the puts never seem to be dequeued
13:23bbloomtomoj: really? channels.clj line 99
13:24RoxxiHow on earth to you convert a decimal in clojure to an integer... a clojure integer, not a java int or long... ? I've been racking my brain on this for the better part of 2 hours :)
13:24bbloom(and buf …) is false, so the (let [iter ….) code runs
13:24tomojbut where's the dequeue?
13:24tomojit just seems to iterate and leave them there
13:25tomoj... or does a LinkedList iterator remove elements as it goes O_o
13:26tomojI can't figure out how to get a (chan nil) to do anything interesting inside async though
13:27bbloomtomoj: hmm looking
13:28bbloomtomoj: first, it's a java.util.Queue, not a LinkedList
13:28bbloomtomoj: oh no, apparently LinkedList is a queue
13:28bbloomsorry
13:29tomojhttps://www.refheap.com/paste/431be648070c2d028ffe3d499
13:29tomojmust be getting dequeued somewhere
13:29bbloomi dunno, i'm not smart enough to read functions this long, hence i don't write them lol
13:31bbloomtomoj: looks like cleanup calls remove on the iterator
13:32bbloomi'm glad somebody else is writing all this locking code lol
13:32lfranchihi guys... i'm trying to do an unsigned bit shift in clojure (like http://dev.clojure.org/jira/browse/CLJ-827) but wonder if there is an easy way to do so without building my own clojure w/ that patch from source
13:32lfranchiany ideas?
13:33bbloomlfranchi: unfortunately the easiest thing to do is to write the function & java and call it from your clojure code
13:33tomojbut only if the putter is not active
13:33lfranchibbloom: i see
13:33tomojand a fn-handler is always active..
13:33lfranchihaven't written any java in a long time... time to see :)
13:34bbloomlfranchi: it's a trivial static function that simply uses the >>> operator
13:34lfranchibbloom: yeah, i meant i need to work out how to tell lein to compile the java and get all the imports right. doing so atm
13:35bbloomtomoj: i have no idea. my brain hurts trying to read the channel code :-)
13:36pjstadiglfranchi: there is a way to do it in clojure, but it is not as performant as writing a java method would be
13:37pjstadiglfranchi: https://github.com/pjstadig/clojure-clojure/blob/master/src/name/stadig/clojure_clojure.clj#L64-L69
13:37tomojoh, no, they are never dequeued
13:37lfranchipjstadig: ah nice :) that's what i was looking for, to avoid having to figure that out myself :)
13:37bbloomtomoj: can you create a test case or something? i'm sure they'd appreciate the bug report haha
13:37tomojhttps://www.refheap.com/paste/6046b19e48de756fed7ff6f18
13:37lfranchiperformance isn't really important (this is not "real" production code0
13:38tomojdunno if that's a bug..
13:40lfranchipjstadig: thanks! works :)
13:40bbloompjstadig: good call
13:48tomojI wonder if buffer chans break the denotational semantics
13:56lfranchipjstadig: hm actually, either i'm missing some sublety here or it's not working right: https://gist.github.com/lfranchi/5605271
13:56lfranchishouldn't the former be the same as the latter?
14:01dnolenlfranchi: you need to change Long/MAX_VALUE to Integer/MAX_VALUE
14:01dnolenScala Int is 32 bits, but integer type default is 64 bit for Clojure
14:02lfranchiahhh
14:02lfranchiman, i didn't think the hardest part of all of this would have been shifting a few bits around :)
14:02lfranchithanks
14:17tomojthis lock-id/active? stuff looks intriguing
14:17tomojwish I understood it
14:19mrb_bkcore.async looks nice
14:20tomojlock-id vaguely reminds me of lattice-kanren lvars
14:27tomojhmm not really though
14:41muhooi vaguely remember seeing an example in someone's code or a tutorial/blogpost on extending a goofy java object to implement the clojure array map protocol, so that instead of (.data foo "blah") i could do (:blah foo). but now i can't find it.
14:44arrdemgiven that this is rather heritical, but has anyone looked at optimizing immutability out of clojure code?
14:44tomojmuhoo: don't think it's possible
14:44tomojyou can wrap
14:45tomojILookup isn't a protocol on the jvm so :(
14:45mefestodoes extend-type do that?
14:45bbloomarrdem: you mean like haskell & linear types ?
14:46mefesto,(doc extend-type)
14:46clojurebot"([t & specs]); A macro that expands into an extend call. Useful when you are supplying the definitions explicitly inline, extend-type automatically creates the maps required by extend. Propagates the class as a type hint on the first argument of all fns. (extend-type MyType Countable (cnt [c] ...) Foo (bar [x y] ...) (baz ([x] ...) ([x y & zs] ...))) expands into: (extend MyType Countable {:cnt (...
14:47arrdembbloom: maybe. I've just been musing that especially for -> usages it would be more efficient to sequentially and side-effectfully update the mutated object where a proof of side-effect containment is possible.
14:47tomojILookup isn't a protocol so extend doesn't help
14:47mefestotomoj: doesn't it work for both interfaces as well as protocols?
14:47tomojyou can extend a protocol to an interface
14:48tomojyou can't extend an interface to a class or an interface to an interface
14:48bbloomarrdem: transients are there for mutability & performance, but there is no proof system for containment of side effects
14:48bbloomarrdem: as far as i know, there has been no work for automatic optimization of this nature
14:48bbloom(at least in clojure)
14:48arrdemw00t thesis idea get1
14:49bbloomhaha
14:49mefestotomoj: ah i see
14:49tomojarrdem: when you fork clojure and add a type system lemme know
14:49tomoj;)
14:50arrdemtomoj: lol that's been on the todo list for a while :p
14:50arrdemtomoj: I think it's gonna stay there for a while too
14:50tomojor maybe gradual types could help enough someday
14:51muhootomoj: it looks like extend-type ILookup, Associative, and Counted might do it
14:51muhooit was from BP's slides from cljwest 2012, i found it
14:51tomoj.. again, ILookup is not a protocol
14:54muhooah, ok, right in clj it's not. in cljs it is, which is how people extend js things to do (:foo bar)
14:54muhoocrap
14:54r0bglees0nis cljs going to get better at inter-op with JS libraries?
14:55bbloomr0bglees0n: what particular problems do you have?
14:55tomojthat it's a protocol in cljs is nice but also seems.. dangerous
14:55muhoor0bglees0n: what you mean better?
14:55muhooi've been jquerying my ass off in cljs and had no problems.
14:56r0bglees0nbbloom: I wanted to use clojurescript for a toy project i'm working on (to help learn clojure) but I found if i wanted to use something like jquery i had to use a wrapper, and that other JS libraries had issues because the google compiler doesn't export enough information(going off rusty memory now)
14:56tomojmaybe if you put a warning label on your library that says "this library extends A,B,C protocols to X,Y,Z native classes" it's ok
14:56tomojstrictly it would seem only clojurescript core is allowed to extend to those classes
14:57bbloomtomoj: the general rule is that you can only extend a protocol you own or an existing protocol to a type you own
14:57r0bglees0nbbloom: it didn't seem drop-in-and-works like coffeescript but i know its young
14:57bbloomr0bglees0n: you're talking about three different things
14:57muhoocljs is not coffeescript. thankfully.
14:58r0bglees0nyeah i dont like coffeescript
14:58r0bglees0nactually prefer JS
14:58bbloomr0bglees0n: 1) coffeescript IS javascript for all intents and purposes. there is no standard library, no module system, no build process other than the trivial compilation process
14:58tomojyeah, and who owns the native browser classes?
14:58tomojURL comes to mind
14:58muhoocoffeescript seems like javascript for people who prefer ruby.
14:58r0bglees0nmuhoo: yup. i van vouch to that.
14:58r0bglees0ncan*
14:58bbloomr0bglees0n: 2) compatibility with google closure advanced compilation is a separate concern for using external JS libraries. it's pretty easy to adapt libraries to work w/ closure & google provides good docs on how to do that. most popular libraries are already adapted somewhere on the web
14:59tomojer, goog.net.URI or whatever I mean
14:59bbloomr0bglees0n: 3) creating more clojure-idomatic libraries is a separate concern as well. jquery, for example, provides many javascript specific conveniences. wrappers can recover those conveniences at the syntax level, but aren't necessary to call the libraries directly if you don't mind the interop syntax goop
15:00bbloomr0bglees0n: on an unrelated note, i don't think cljs is a really good place to learn clojure. you're much better off learning on the JVM
15:00r0bglees0nah thats interesting
15:01r0bglees0ni thought jquery simply didnt work on cljs without a wrapper
15:02weavejesterDoes anyone know of a good name for a function that does (reduce #(%2 %1) x fs) ?
15:02bbloomcljs, like clj proper, is designed to call host code without any adaptors, proxy objects, or anything like that. you can call ANY javascript code. the only concern is that if you want google advanced compilation (necessary for small code size & good perf) then the library needs to be prepped for that
15:02weavejesterIt seems like something that might have been written before in Haskell or something
15:03r0bglees0nbbloom: makes sense now, thanks
15:03r0bglees0nbbloom: is it much work to prep a library?
15:03bbloomr0bglees0n: read the google closure compiler docs
15:03r0bglees0nalright
15:04r0bglees0nhaha
15:04r0bglees0ninteresting choice of name
15:04r0bglees0nonly caught that now
15:04r0bglees0nok, thanks bbloom
15:05bbloomweavejester: hmm mapf ?
15:05bbloomor no… hmm
15:06bbloomweavejester: i don't even know how to ask hoogle that b/c each function could have a different input/output type
15:07weavejesterI guess it would be: (a -> a) -> [a] -> a
15:07bbloomwouldn't it be a -> [a -> a] -> a
15:08weavejesterUh, right, sorry, I'm confusing myself :)
15:09bbloomweavejester: for all the haskellers' talk of higher order functions, having a list of functions totally fucks with your type system lol
15:10weavejesterbbloom: True, but in this case they're all the same type.
15:10weavejesterHoogle doesn't know...
15:10bbloomweavejester: i think they wouldn't name that function
15:10weavejesterIt's kinda like a backward iterate
15:10bbloommap ($ x) fs
15:10bbloomisn't that what it is really?
15:11amalloybbloom: not at all
15:11weavejesterNo, it's not a map
15:11bbloomer it's a reduce, right...
15:11bbloomum
15:11bbloomhm
15:11weavejesterIt's given a list of changes, apply those changes in order to a value, then return the result.
15:11bbloomamalloy: ?
15:11amalloyfoldr ($) x fs, more or less
15:11bbloomheh, i knew there was a ($) in there somewhere
15:11bbloommy haskell sucks.
15:12amalloymine too
15:12weavejesterYeah, and in Clojure it's just (reduce #{%2 %1) x ys) which doesn't save you a lot over (foo x ys)
15:12weavejesterBut I'm using this so often it seems reasonable to create a function.
15:13amalloyweavejester: isn't it also ((apply comp fs) x)?
15:13amalloyno, i guess that's the wrong order
15:13bbloomyeah, you need a reverse in there
15:14weavejesterThe stream of functions is essentially lazy.
15:14weavejesterActually it's an asynchronous event stream
15:14bbloomamalloy: weren't we just discussing with technomancy how i want a pipe function which is like a reversed comp without the cost of calling reverse ? :-P
15:15bbloomi guess you could write rcomp (i'd call it pipeline or something) pretty easily
15:16tomojis that what lamina's pipeline is, plus a point on top?
15:16tomojwell plus async stuff
15:17tomojweavejester: you seen core.async yet?
15:17tomoj(the new one)
15:17weavejesterNo. I didn't know anything was put in there yet.
15:17tomojhttps://github.com/clojure/core.async
15:18tomojnot usable yet of course
15:20weavejesterI might be able to use some of that.
15:35muhooi cant' do ILookup, but maybe Afn will work
15:36tomojAFn isn't a protocol either..
15:36tomojif you have a goofy java class you're boned
15:36muhooand valAt looks like it's in clojure.lang.PersistentArrayMap
15:37tomojno it's clojure.lang.ILookup
15:37tomojyou're gonna have to wrap
15:39muhooi can't. i'm using a library that gives me this garbage.
15:39muhoothen again, maybe not, maybe i should just scrap the whole thing and use somethign that's already wrapped
15:39tomojyeah, so take the garbage and wrap it
15:40tomojor just convert to a map :)
15:40muhootrue, could write my own wrapper. might do just as an exercise
15:42muhooi continually find myself having to deal with java garbage, and i have to learn to get better at wrapping it idiomatically. i won't escape this as long as i'm using clojure.
15:42muhoo(on JVM)
15:50ysawejhi all, how do I find the cartesian product of a collection of lists?
15:51ysawejso if it is just 2 lists, I can do a (for [ [x y] [list1 list2]] do-something)
15:51tomoj$google clojure cartesian product
15:51lazybot[Creating a cartesian product with to lists (Clojure forum at JavaRanch)] http://www.coderanch.com/t/546161/clojure/Creating-cartesian-product-lists
15:51ysawejbut for a variable number of lists, how can I specify it in for, specifically?
15:51tomojnot what I was hoping for
15:52tomojyou can't https://github.com/clojure/math.combinatorics
15:53ysawejokay, but is there a lazy way to get it?
15:53tomojthe one in math.combinatorics is lazy
15:54ysawejlooks like combinatorics will help, but I was looking for something in "for" itself, but looks like its not possible
15:54tomojindeed
15:57ysawejthanks anyways tomoj
16:33muhoobut... now i'm confused. in Clojure Programming, he's doing a deftype that implements IPersistentSet. i try to run that code and the compiler blows up because i can't implement an interface.
16:33muhoopage 294, if anyone is interested
16:34llasramYou can definitely use deftype to create types implementing interfaces
16:37tomoj(coin -> (choc -> (coin -> (choc -> STOP))))
16:38tomojhow does this map to core.async?
16:39tomojI mean the coins are put! into the machine and the chocs are take!'d, right? but the term there doesn't seem to distinguish
16:40tomojoh, man, looks like I have to read 135 pages before I get to put! and take!
16:50brainproxydnolen: very cool!
16:51jabbso leinengen creates a line with the comment ";; work around dangerous default behaviour in Clojure" but after searching I have no idea what it's supposed to fix
16:51jabbit sets the read-eval global variable to (constantly false)
16:52jabbshould every clojure program have that line?
16:53hiredmanugh, really?
16:53bbloomhiredman: yeah, in the "app" template
16:53hiredmanit's true, never update
16:53hiredmanupgrade
16:54jabbwhat's the "ugh" for? :P
16:54bbloomjabb: you only need that line if you're using clojure.core/read when you should be using clojure.edn/read
16:54jabbI see. What's the default behaviour if I don't have it.
16:55bbloomread-eval is discussed at great length on the mailing lists
16:55bbloomdo a search on google groups
16:56jabbahh, security risk
17:07tomojbrainproxy: what's cool?
17:08brainproxydnolen pushed out v0.2.0 of mori to the npm registry
17:08tomojah
17:08brainproxyI already have some things in mind for v0.2.1
17:08brainproxy:D
17:08brainproxywill send some pull reqs later...
17:37hadronzooIs there an RRB-Tree implementation for ClojureScript? Flexvec doesn't seem to be ported yet.
17:46tomojflexvec is the only rrb-tree impl I know of
17:47hadronzootomoj: Actually, I only need efficient head and tail insertion. Is there a double-linked list library for both Clojure and ClojureScript?
17:51tomojnot that I know of
17:51tomojI think data.finger-tree supports that, but it hasn't been ported either
17:51tomojoh looks like there may be some separate impls for finger trees in cljs though
17:51tomojbut unlike flexvec porting data.finger-tree should be relatively easy I'd think
17:52tomojhttps://github.com/wagjo/data.cljs ?
18:02tomojwhy do core.async Handlers need Locking?
18:02Raynesjabb: What? Really?
18:02RaynesThe default app template does that?
18:03RaynesI'm going to beat the shit out of somebody.
18:03Rayneswho*
18:04amalloyRaynes: bet you a dollar it's technomancy
18:04RaynesIt is.
18:04callen?>":
18:05callencbp`: :)
18:05jabbRaynes: (alter-var-root #'*read-eval* (constantly false))
18:07Rayneshttps://github.com/technomancy/leiningen/commit/3aec2e4de96bb08b2a41e2d444128d08d968f7d9
18:07Raynesamalloy: Your dollar is in the mail.
18:07tomojat least it's not hidden somewhere
18:07tomojnot like you probably weren't going to just delete -main anyway :)
18:08tomojoh the concerns in your comment seem valid to me
18:08RaynesYes, but it just confused the hell out of jabb which is a particularly fair reason to let this come up in other ways.
18:09tomojwhat if it had a link?
18:09RaynesTemplates are not documentation.
18:09tomojI guess the problem is that "other ways" should not include "oh shit we got hacked"
18:09RaynesThey are scaffolding.
18:09cbp`callen: hi what's up
18:10tomojbut how else is a newbie likely to find out about this problem?
18:11callencbp`: being a wastrel. looked at your refheap
18:11callencbp`: is that thread-safe? I think it needs wrapped in a ref or something.
18:11hadronzootomoj: thanks. I'm going to try wagjo's ftree.cljs.
18:11technomancyRaynes: *read-eval* as defaulting to true for versions of clojure that predate read-edn is a horrible idea
18:12cbp`callen: yea probably
18:12Glenjaminis there any other way to add a plugin dependency other than project.clj and profiles.clj?
18:12tomojhadronzoo: even though it's deprecated in favor of data.cljs?
18:13callenproblem is ref means "retry"
18:13callennot really what we want here.
18:13technomancyit's easy to fix if you do care about it and easy to ignore if you don't. and also easy to ignore if you don't care about it but really should because of how easy it is to screw up.
18:13callenprobably more like an atom or something.
18:13Raynestechnomancy: Well how about we change the template to scrape jira and add a link to every open Clojure bug. Maybe we can also add some logic to find ones that are marked as resolved but use natural language processing to find ones marked resolved as the result of unpopular decisions?
18:13technomancyRaynes: I'm fine with changing it back now, but it was the right thing to do at the time
18:13hadronzootomoj: sorry, I meant ftree.cljs in the wagjo/data.cljs repo
18:13RaynesI've already booked a flight to Washington, man.
18:13RaynesWe've gotta settle this like men.
18:14callentechnomancy: the votes are for Seattle over Austin, among the people I've talked to that have lived in either place. Haven't consulted with somebody that's lived in both yet though.
18:14tomojhadronzoo: ah, feel free to report back with your experience with it :)
18:14technomancycallen: are you still shooting for somewhere fairly remote?
18:14cbp`callen: what's the next step
18:14Raynescallen: What is this refheap you're talking about?
18:15technomancyRaynes: you can enjoy some of my home-roasted coffee!
18:15callentechnomancy: if I move to seattle, that's more of a second step, I'll live close to the city initially so that I can take advantage of it and experience it, but when I'm ready to get a house - move further out.
18:15jabbwell, not the "hell out of me" :P
18:15callenRaynes: https://www.refheap.com/paste/14700
18:15RaynesI will drink it with one hand and strike you repeatedly with the other.
18:15callencbp`: I need to stop being lazy, clean it up and make it thread-safe, then start adding inserts and basic queries.
18:16technomancycallen: yeah, you want to get a feel for the lay of the land
18:16callentechnomancy: precisely. That's less relevant in Austin.
18:16tomojcallen: have you talked to an equal number of austin and seattle people?
18:16callentomoj: roughly, but even the Austin people were voting seattle
18:16callensave for a few.
18:17tomojyeah after I wrote that I realized you're not an idiot so..
18:17lazybotjava.lang.RuntimeException: EOF while reading
18:17tomojI vote austin, because I might be there again someday, and we need more clojure people there :)
18:17callentomoj: that's the nicest thing anybody's said to me in awhile, thank you.
18:18technomancytaking the kids to radio shack for robot parts =D
18:18callentechnomancy: niiiice. you must be so proud.
18:18technomancyit's tons of fun
18:18callentechnomancy: my dad and I used to make runs to radio shack for his custom built amplifier, which he let me help out on.
18:18callentechnomancy: he still uses that amp, 20 years later.
18:18technomancyradio shack is kind of the starbucks of electronics hackers, but it's what's nearby
18:18technomancyheh; sweet
18:18callentomoj: Austin wins out in some specific categories. Namely, my desire to eventually have a small ranch with goats :P
18:18jabbalso, is it totally unorthodox to write a game in clojure?
18:19callentechnomancy: whatever works.
18:19technomancythey are starting to stock arduino parts there though, which is encouraging.
18:19callenjabb: We see plenty of people doing it in here, and it can be done, but it's clearly a labor of love.
18:19callenjabb: you make some serious sacrifices doing a game on the JVM.
18:19callenit sets some hard limits on what you can do.
18:19jabbI wouldn't assume the JVM to be the problem.
18:20jabbAt least if I ever plan to port to mobile
18:20callenjabb: it is if you want to chase higher graphics or have an easier time making it responsive.
18:20callenjabb: most serious mobile game engines are C++ for iOS and Android
18:20callenwith only some trimming to integrate it into their respective environments.
18:21jabbMy previous games have been just that. :)
18:21jabbAnd lua
18:24callenjabb: right well I'm not trying to discourage you, just being realistic.
18:24tomojjabb: how do you plan to port to iOS?
18:27jabbtomoj, no plan for that yet :P
18:27jabbbesides, don't even have the money for the license
18:28jabbcallen: so for C/C++ what have people been using as far as libraries? just basic GLES?
18:30hadronzootomoj: I wonder if the clojure-scheme compiler would work for iOS development. Games written in Gambit Scheme will run on iOS.
18:31Raynescallen: https://www.refheap.com/paste/14747 untested changes.
18:32tomojhadronzoo: very interesting
18:32tomojthe scheme in the middle seems likely to cause hassle (for one I don't know scheme) but it's probably less hassle than writing clojure-objc or whatever
18:33hadronzootomoj: Gambit is fairly fast. See: http://jlongster.com/s/jlongster-old/pages/blog/write-apps-iphone-scheme.html
18:34tomojhmm https://github.com/schani/clojurec/tree/master/run/ios
18:35tomojoh sweet gambit has continuations
18:35tomojsold
18:36hadronzootomoj: Gambit is great. I used it and Chicken before I moved to Clojure. Take a look at the benchmarks (FWIW): https://github.com/takeoutweight/clojure-scheme
18:38hadronzooInteractive iOS dev with Gambit: https://www.youtube.com/watch?v=Q7c0rU9Lv28
18:40mefestoI have my tests in ["test/clj"] which breaks C-c C-t in clojure-mode. Is there a way to configure clojure-mode for this?
18:41mefestoC-c C-t => clojure-jump-between-tests-and-code
18:44mefeston/m doesn't look that way. i can live w/out it.
18:44callenRaynes: seems solid
18:44Raynescallen: I did all of that but the diff in refheap btw. I forked then edited. :D
18:44RaynesWhen I add diffing I'm never gonna need an editor again.
18:45callenlol
18:47mefestoRaynes: just curious but why can't private pastes on refheap be forked?
18:48Raynesmefesto: They can't?
18:48mefestolemme double check :-\
18:48Raynesmefesto: Create a private paste and link me to it.
18:48Glenjaminmefesto: https://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L1046
18:49mefestoRaynes: n/m im an idiot :)
18:50mefestoi could have sworn the other day a coworker sent me one (anonymous + private) and i couldn't fork it. perhaps it was just too late in the day and i could no longer read
18:50RaynesPerhaps anonymous + private = unforkable.
18:50RaynesI have been known to have bugs.
18:51mefestoAhh i know what happened
18:51mefestoi was logged out at the time. i viewed the paste. i logged in but did not refresh the page. therefore the fork link never showed.
18:51mefestoa simple refresh shows the `fork` link.
18:51RaynesAha.
18:52RaynesYeah. It'd be nice if it would update the page properly, but blech.
18:58brainproxywin +1
18:58brainproxyderp
19:17Glenjamincan clojure library names be capitalised? I've only ever seen them lowercase, but not sure if that's convention or enforced
19:23amalloyconvention
19:25callenGlenjamin: you could just try it to see if it works, but I for one rather like the convention, it's clean looking.
19:25GlenjaminI'm writing a library that provides gadget for spies
19:25Glenjaminwhich I'm calling q
19:25Glenjaminor Q
19:25Glenjaminnot sure which yet - i like the lowercase convention too =/
19:38callenGlenjamin: gadgets...for spies?
19:38Glenjaminas in test spies
19:38Glenjamingadgets is a bit of a stretch, they're just functions/macros - but naming isn't my strong point
20:11callencbp`: I'm writing some simple coercion stuff
20:11cbp`ok
20:11callencbp`: I'm doing some insanely retarded type dispatch bullshit with cond
20:11callenbecause I'm an idiot and don't use multimethods.
20:12cbp`haha
20:14callenwelp. it works. sorta.
20:15callenI need to work on something that could actually make me money now though.
20:17cbp`aw ok
20:17callencbp`: let me show you what I did
20:18callencbp`: https://www.refheap.com/paste/14751
20:18callenI like the way I divvied things up, but the dispatch is dumb-dumb-dumb.
20:27callencbp`: hey
20:27callencbp`: https://www.refheap.com/paste/14751
20:27callencbp`: thoughts?
20:27callencbp`: the dispatch is super-dumb, but I like the separation.
20:28cbp`Yea
20:28cbp`Just need to add an option for :success-atom i guess
20:29callenwhy?
20:29clojurebotWhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
20:29callencbp`: I rip out the response by default, no need to acknowledge the top-level success-atom.
20:29cbp`ok
20:29cbp`oh i just saw the last function
20:29cbp`I haven't used rethinkdb before so I guess I'll read the docs :P
20:30callencbp`: you probably know more than me. *shrug*
20:32callenyogthos: gleetings.
20:32callencbp`: https://www.refheap.com/paste/14752 this is the whole file with Raynes' improvements.
20:34callencbp`: I'm not sure binding the socket inside of a function is going to work for a library though. Probably going to need a global wrapped in something threadsafe.
20:34cbp`ok
20:36calleneven with macros, I don't think I would make function life-span sockets work because it'd still mean taking it up and down over and over.
20:36callenRaynes: so RethinkDB 1.5 came out
20:36callenRaynes: I about shat myself when I saw the data file migration instructions.
20:38tomojdon't use a global :(
20:38callentomoj: I'm open to alternative suggestions, but I'm not going to chase a religious ideal. It just needs to work.
20:38callenIf it means more LOC and/or more hassle, I'm probably not going to bother.
20:39Raynescallen: Well using a global likely breaks it to shit in lots of cases.
20:39RaynesIf you reload that, the atom is reset.
20:40tomoj(deftype Conn [in out]) (defn get-database-list [conn]) ?
20:40callenRaynes: I can just spit it out and let the caller hold onto the var then.
20:40callenand let it be their problem.
20:41callentomoj: seems fine to me.
20:41callenthat's how i was writing it before.
20:41callenI need to rewrite what cbp did to bring the API back to that.
20:41tomojcool, I thought you meant you were going to go the way of java.jdbc :)
20:41callenno
20:41callenI figured you were going to suggest something loony.
20:41callenLooks like we were closer in mind than either of us expected.
20:41Raynescallen: Whatever. I'm going to eat a 50s themed cafe. Your argument is invalid.
20:42callenRaynes: the whole cafe?
20:42tomojit's weird cus I feel like I'd want encapsulation on the Conn
20:42Raynesat a, even
20:42tomojhence not defrecord
20:42callenRaynes: but seriously, the migration instructions for 1.4->1.5 are horrific.
20:42tomojbut "encapsulation" is a bad word :)
20:42Raynesat an, even
20:43callenRaynes: I integrated your recommended changes as well. Thanks for that.
20:43RaynesThey actually worked? Cool.
20:43tomojdatomic's conns appear to be deftypes that implement ILookup though, so they don't print out all their guts
20:43callenRaynes: worked perfectly the first time. I didn't have to correct anything.
20:44RaynesMy goodness I am underpaid.
20:44callentomoj: seems reasonable. I figured I was going to have a deftype with in/out streams of the original socket.
20:44callenI am not too sure what the lifecycle on the socket will be, I guess I'll have to retain a reference to it.
20:44tomojah yeah
20:45callenI could do request life-cycle db connections in the context of web apps. Should'ish work fine.
20:45callenI actually need to stop fiddling with this library and work on something more valuable though.
20:45tomoj`r.table('users').filter(lambda doc: doc['age'] > 29).run()`
20:45tomojthat's.. interesting
20:46callenI haven't decided how to translate lambdas yet.
20:46tomojoh, that's the same as datomic's filter though, guess I can't complain
20:46callenI might boil it down to dumb filter predicates
20:46callensince they're single-expression objects
20:46callenI don't really mind the API, it's fine.
20:47callenI'm still cranky about the length prefixes.
20:47Raynescallen: I was really excited about using dotimes.
20:47callenluckily cbp` decided to hero all the way through that nonsense.
20:47RaynesI don't think I've had a single valid use for that since I started writing Clojure.
20:47callenhahahaha
20:47RaynesAnd you just throw that shit in my face like HERE, DOTIMES.
20:48callenRaynes: byte arrays will do that for you.
21:00callenhrrrm. magical DB auto-selection. dafuq.
21:19gfrederickshuh; an interesting alternative to checkouts is just opening the file from the other project and evaling it with nrepl.el
21:20callengfredericks: checkouts?
21:20gfredericksan old lein feature for hacking on dependencies
21:20xeqigfredericks: I do that when I want to quickly debug someone else's lib
21:21gfredericksI'm way behind on tooling; perpetually.
21:24ianeslickAnyone want to help me hack up a proper inspect for nrepl.el?
21:24ianeslicks/inspect/inspector
21:24ianeslickI've got a fairly good idea and some tooling; helps to have some dialog to flesh out ideas
21:24ianeslickBasing it on technomancy's javert
21:33gfrederickshuh; the clojure inheritance thing does multiple inheritance doesn't it
21:39callengfredericks: derive has multiple parents, but precedence is an open question.
21:39callengfredericks: you have to do prefer-method manually, which could get laborious.
21:39gfredericksit all good for my purposes
21:39callenjust saying.
21:40callensome people need to be able to specify "this over that"
21:40callenI try to avoid writing code that relies on that.
21:40callenPython used a left-to-right going-upwards tree sweep in the method resolution order
21:41callensounds complicated but was fairly easy for me anyway to retain in my head.
21:41gfredericksthis is the first time I've tried the hierarchy functionality
21:41gfredericksjust never need it
21:42technomancyianeslick: if you're interested in javert you can take the whole thing over
21:42technomancyI don't have the bandwidth to function as a proper maintainer
21:42ianeslicktechnomancy: Sure, I can do that.
23:08ianeslicktechnomancy: Can we just redirect to a new project nrepl-inspector? Easier for folks to find.
23:08ianeslickI can set it up if you want to put in the forwarding Link on Javert
23:11robinkAre nested fors a bad idea?
23:21amalloyrobink: not at all
23:21amalloyalthough often you don't actually want that, but instead a single for with multiple bindings
23:40robinkamalloy: Gotcha. I'd have to have a binding that depended on another, but it might be possible.
23:41robinkam alloy: I'm trying to turn Hiccup-style nested vectors into a hashmap.
23:42robinkSorry about the nick munge, my phone's autocorrect is rather aggressive.
23:43amalloyrobink: a hash looking like what? you might be able to just use clojure.data.xml
23:45robinkamalloy: A hash looking like the first element of each nested subvec with the following data in a single collection bound to the value of that key (optionally turned from string to into or DateTime/utime).
23:47robinkamalloy: Input would be [:PARSETREE [:FROB [:DIGITS "123"] [:DIGITS "456"]]]
23:47robinkamalloy: Output would be {:FROB [123 456]}
23:48robinkam alloy: I'm mostly there, but I do have the nested for.
23:49robinkAgg, sorry about the nick autocorrect.
23:51robinkLemme switch to laptop
23:52amalloylooks like a nested for to me
23:52robinkamalloy: 'k
23:54robinkamalloy: A more accurate input sample would be [:PARSETREE [:FOO [:DIGITS "123"] [:DIGITS "456"]] [:BAR [:DIGITS "789"] [:SPECIALSTRING "Meaningful"]] [:BAZ [:DIGITS "012"] [:SUBRULE [:CHEAPTOKEN "B"] [:ANOTHERSTRING "Rememberme"]]]]
23:54robinkamalloy: Thankfully my real-world example has a fixed level of nesting