#clojure log - May 18 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

1:29 nonuby: clj-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

1:47 tieTYT: is it a good practice to mark all my side-effect functions as dynamic so I can bind them for testing purposes?

1:53 nightfly__: That sounds like a pretty bad practice

2:01 avishai: hu

2:01 suppose i need worker threads

2:01 agents can do that, but it doesn't feel natural

2:01 should i just use java executors?

2:31 muhoo: is 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

2:32 auugh, nevermind :-/

2:32 * muhoo curses file system namespace segmenting grr

2:52 tomoj: avishai: yes

3:56 I want a programmer's thesaurus

3:56 flu-: rosetta code?

3:59 tomoj: that's cool, but I just mean domain words

3:59 basically I want a book that thinks for me I guess :(

3:59 flu-: heheh

3:59 then we'll all be out of a job

4:02 spoon16: dependencies resolved via s3-private-wagon do not get cached in ~/.m2

4:04 tomoj: hmm.. my guess is that most programmers will conclude that the chinese room is absurd very soon after encountering it

4:05 I'd like to think that's because they understand something searle doesn't.. :/

4:44 jjs: Wow. I just tripled my framerate by switching from `lein run' to `lein trampoline run'

4:58 swks: testing from emacs(sorry guys, just testing)

5:02 unsymbol: testing 1-2-3.

5:02 callen: jjs: framerate of what?

5:02 swks: messaging

5:02 can't believe that emacs so powerfull

5:08 jjs: callen: this OpenGL thing I'm working on. Currently streaming CPU-generated (and CPU-bound!) pixel data to the GPU

5:09 tomoj: odd

5:09 why should trampoline help?

5:09 I thought the only difference was whether another JVM was left sitting around

5:09 swks: :q

5:11 jjs: It 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...

5:11 callen: that is pretty damn strange

5:11 stranger still is doing graphics work in the JVM :P

5:12 jjs: No, that shouldn't do it, either... top reports resident memory being stable ~480MB

5:13 callen: Why not? >:D

6:09 tomoj: I wrote "In reality, a clock never ticks. After a tick there is a new clock."

6:09 I think the epochal time model has destroyed my brain

6:15 wink: lol

6:15 I prefer to exchange my watch every second, this is I why I can't support atomic date times?

6:15 *not

6:16 tomoj: hah AtomicDate

6:16 don't tell rich

6:32 samrat: Raynes: tried using least.authorize but I'm getting {:error 13, :message "Invalid method signature supplied", :links []}

6:33 Raynes: I did exactly as the readme says

6:37 tomoj: "(ns core.async"

6:37 wait, what?

6:38 oh I guess somebody did `lein new core.async`

7:23 clojure-new: Hello.

7:25 naeg: hi clojure-new

7:25 clojure-new: I'm trying to make cond wrapper macro, like (defmacro [test body] `(cond (= ~test :predefined) (bla bla) ~@body))

7:26 I want body in format of (:test (bla bla) and i want expand it to (= test :test) (bla bla)

7:26 Is it possible?

7:26 (:test (bla bla))*

7:27 Oh wait, ((:test (bla bla) (:test2 (bla bla)), right.

7:27 ((:test (bla bla)) (:test2 (bla bla))) It's so hard without paredit.

7:28 Let me write a paste.

7:31 https://www.refheap.com/paste/14726 here it is.

7:31 The questions is how can i transform ((:test1 (bla bla)) (:test2 (bla bla))) into cond args?

7:32 ,(map #(list (list '= 'message (first %)) (list (last %))) '((:test1 (bla bla)) (:test2 (bla bla))))

7:32 clojurebot: (((= message :test1) ((bla bla))) ((= message :test2) ((bla bla))))

7:33 clojure-new: But it still wrong format for cond.

7:33 After @ it becames ((= message :test1) ((bla bla))) ((= message :test2) ((bla bla))).

7:33 I need (= message :test1) (bla bla) (= message :test2) (bla bla)

7:34 ,(map #(list (list '= 'message (first %)) (last %)) '((:test1 (bla bla)) (:test2 (bla bla))))

7:34 clojurebot: (((= message :test1) (bla bla)) ((= message :test2) (bla bla)))

7:34 clojure-new: One step closer.

7:36 @(((= message :test1) (bla bla)) ((= message :test2) (bla bla))) => ((= message :test1) (bla bla)) ((= message :test2) (bla bla)) => ? => (= message :test1) (bla bla) (= message :test2) (bla bla)

7:36 Can you tell me what that "?" should be?

7:38 naeg: clojure-new: how about telling us what the actual problem is and giving a concrete example?

7:39 in like on sentence

7:39 one*

7:39 IamDrowsy: clojure-new: are you looking for something like case

7:39 ,(doc case)

7:39 clojurebot: "([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...

7:39 Okasu: naeg: https://www.refheap.com/paste/14726 Make wrapper around cond.

7:43 clojure-new1: naeg: yes, like okasu said, i want to make something like wrawpper aroud cond

7:44 IamDrowsy: thanks, i'll take a look.

7:44 naeg: it pretty much looks like case

7:44 IamDrowsy: the doc string is quite verbose... just look at some examples at clojuredocs

7:45 naeg: https://www.refheap.com/paste/14727

7:46 clojure-new1: thank you guys, its exactly what i wanted.

7:56 ddellacosta: wow, 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...

7:58 seems like this was getting discussed a long time ago, so I'm guessing there is a natural way to do it these days...?

8:00 ah, found it I think, cljs.core/js-obj

8:18 jugimaster: i'm new to clojure.. can i get by without having to touch maven/leiningen?

8:19 llasram: If you're a masochist, sure

8:19 jugimaster: :p

8:19 it's just that i come from a java background, and i remember maven being a massive, bloated pain in the butt

8:19 llasram: The little I've had to touch it has been pretty bad

8:20 jugimaster: mostly kind of useless too

8:20 llasram: Leiningen however is hands-down the best build/project tool I've ever used for any language

8:20 jugimaster: yeah.. 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

8:20 llasram: ? Leiningen has nothing to do with Maven

8:21 jugimaster: what about ant?

8:21 no? hm

8:21 i thought it was based on maven

8:21 llasram: It used to use the dep-resolution parts of Maven, but not even that anymore

8:21 jugimaster: hm.. well, i guess i should take another look at leiningen.. but iirc, it wants you to work within a set project structure etc.. ?

8:22 basically i'm just wondering how.. "necessary" lein is

8:22 llasram: Yes, but it's entirely flexible

8:22 Well

8:22 Clojure is just another Java library, packaged as a JAR

8:22 jugimaster: mmm

8:22 llasram: If you'd rather wrangle JARs some other way / by hand

8:22 you can do that

8:22 But you're causing yourself a ton of unnecessary pain

8:23 jugimaster: yeah so.. lein's main benefit is dep handling?

8:23 kind of like PIP for python

8:23 ?

8:23 i'm kind of confused about whether i "should" use clojure or golang

8:24 Foxboron: jugimaster: depends IMO

8:24 llasram: Think of it as more like a unified pip+virtualenv+ipython

8:24 jugimaster: but somehow i get the feeling that i'd like clojure's syntax better

8:24 hmm

8:24 Foxboron: Go is the same old C-syntax. Boring IMO. Clojure got this fancy LISP syntax which is "new" and interesting

8:24 jugimaster: sounds vaguely good :p

8:25 yeah well.. go's syntax looks just about decent enough.. but some C-likeness is leaking through and it scares me :p

8:25 for example some pointer stuff, which i have no clue about

8:25 i guess Go is more performant than Clojure though?

8:26 how reliable/kick-ass/lovely is http-kit?

8:31 scottj: jugimaster: http-kit is not widely used, yet.

8:31 jugimaster: yeah but should it be?

8:32 i mean, is it lovely? :p and "production-quality"?

8:32 or production-ready, etc

8:33 scottj: jugimaster: 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.

8:33 jugimaster: hmm

8:33 well, what would clojure people use, if you needed web sockets and asyncy stuff, if not http-kit?

8:35 it'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)

8:36 a 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

8:36 sooo.. is it possible to keep clojure projects "neat"?

8:37 with 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

8:38 llasram: That's why you use e.g. Leiningen. It pulls all the deps together. Build uberjars to deploy, bundling all your dependencies into one artifact

8:39 jugimaster: mmm

8:40 Foxboron: jugimaster: depends if you use venv or not. Sometimes you get dependency errors with pip.

8:40 jugimaster: sure, but i haven't run into any trouble yet myself

8:40 Foxboron: well really.

8:40 decaf: try working on an 64 bit windows 7

8:41 jugimaster: so can i sweep all the bloated bloatjars under the rug somehow, so that they wouldn't bother me with their presence? :p

8:41 Foxboron: jugimaster: you don't normally mind them at all. they just sit there.

8:41 jugimaster: hm

8:42 yeah i know, in a way.. i'd just like to keep them separate from my "actual projects" somehow

8:42 like, a project would be only the source code and resources that belong to the app _itself_.. and all deps would be somehow separate

8:42 llasram: You 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

8:43 You list your immediate deps, and that's it

8:43 Everything else is transparent, and your project only contains your source

8:43 jugimaster: ah 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

8:43 it just feels dirty

8:44 llasram: It's just a cache. Do you get upset about your OS filling your RAM with "dirty" disk blocks?

8:44 jugimaster: ok, 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?

8:44 :p

8:45 llasram: Without easy dependency management, then dependency management is not easy. Yes

8:45 jugimaster: :p

8:47 i 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

8:48 in 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

8:48 aand i guess as a result of that, something like maven was born

8:49 it was like an.. "at-least-seemingly-necessary evil" that people just lived with

8:50 llasram: Here'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

8:50 The experience with granularity across environments is not necessarily portable

8:50 jugimaster: except that java didn't.. that shit got way out of hand

8:51 llasram: Maven/Ivy may put you in XML-hell, but they definitely keep dependencies in order

8:51 jugimaster: but 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

8:51 for example, is hibernate a standard tool on the clojure side?

8:52 llasram: No

8:52 jugimaster: ok, what's replaced it?

8:52 Glenjamin: jugimaster: what concerns you about these "unnecessary dependencies" ?

8:52 jugimaster: Glenjamin: it's annoying to have to have them around

8:52 Glenjamin: oh, just read up - i think you just had this conversaion :)

8:52 jugimaster: :P

8:52 maybe

8:53 Glenjamin: dependencies = code i didn't have to write = good

8:53 llasram: AFAICT most people using Clojure with relational DBs don't use an ORM

8:53 jugimaster: Glenjamin: yeah, but "a bunch of commons-turd.jars that nothing in this app _actually needs/uses_" is Bad.. :p

8:54 Glenjamin: why?

8:54 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

8:54 jugimaster: because they shouldn't be there?

8:54 Glenjamin: if the cost of having them there is greater than the benefit of using whatever depends on them, then sure

8:54 but i don't believe that is the case

8:54 jugimaster: it 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

8:55 yep

9:18 xificurC: hi, I'm a little puzzled here, if I downloaded and installed leiningen did I also get the lastest version of clojure?

9:19 also could you point me to the current most used emacs+clojure choice?

9:19 llasram: xificurC: From the JVM perspective Clojure is just another library. Leiningen will download whatever version of Clojure a project specifies for that project to use

9:20 xificurC: llasram, ok thanks. What about emacs, do people use slime for clojure?

9:21 scottj: xificurC: people are moving to nrepl.el

9:21 llasram: Yah

9:21 Yah on what scottj said, to clarify

9:21 Use 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

9:23 xificurC: cool I uesd nrepl before so I might be able to install it on this pc too

9:23 thanks!

9:23 llasram: np!

9:24 xificurC: do you guys recommend these settings to be added https://github.com/kingtim/nrepl.el#configuration

9:25 llasram: Those are personal decisions you will need to make yourself :-)

9:26 xificurC: meh I never liked paredit

9:26 llasram: Then you are in the minority, sir

9:27 It 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

9:27 tomoj: llasram: really? or are we just a very vocal minority :)

9:27 I still owe lau a screencast I think.. :/

9:28 xificurC: llasram, I dont see a problem finishing up my parens right. Maybe editing the code is easier with it?

9:28 llasram: tomoj: Almost everyone I know who has stuck with Clojure / been successful with it uses structural editing

9:29 tomoj: I should just record myself for a bit, I always wanted to do a nice tutorial screencast

9:29 llasram: xificurC: 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

9:29 tomoj: just watch someone skilled use paredit, you'll see :)

9:30 llasram: (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

9:30 tomoj: and navigate

9:30 xificurC: I'd probably need to sit next to a heavy emacs user to learn all the editing tricks

9:31 tomoj: though 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

9:31 scottj: xificurC: maybe check this out http://emacsrocks.com/e14.html

9:33 xificurC: ill take a look scottj thanks

9:34 jugimaster: so what do clojure folks use instead of hibernate?

9:34 llasram: SQL

9:34 jugimaster: jdbc?

9:34 is there anything like SQLAlchemy?

9:34 it's great

9:35 llasram: Korma is probably the closest, but it has several detractors as well: https://github.com/korma/Korma

9:36 xificurC: even strings close up? I dont remember that happening a couple months ago

9:50 dhl: jugimaster: Have you checked out ClojureQL? http://clojureql.org/

9:53 xificurC: paredit-splice-sexp-killing-backward <-- lovely name that is

9:57 I dont understand why programmers dislike lisps. I'm no programmer and I love it

9:59 r0bglees0n: xificurC: i dont have an impression that programmers dislike lisps

10:03 xificurC: r0bglees0n, 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:03 hyPiRion: r0bglees0n: I have an impression that some programmers disklike the parentheses because there are so many of them

10:05 Glenjamin: sometimes when i line ends in ))))))) i :(

10:05 hyPiRion: I'm happy as long as I have my rainbow parens

10:06 Glenjamin: i really need to switch to a better editor

10:07 hyPiRion: Glenjamin: what are you currently using?

10:07 Glenjamin: sublime

10:08 hyPiRion: Well, it does have some plugins, doesn't it?

10:08 Glenjamin: yeah, but doesn't have anything that does rainbow

10:08 it's ok, but i should really try and switch to emacs for clojure

10:09 hyPiRion: Well, you should give it a try at least

10:10 kmicu: xificurC: Justin Bieber is popular, does that mean that it is good? #popularenoughsyndrome

10:11 jugimaster: dhl: that looks promising, thanks!

10:12 xificurC: kmicu, of course im not saying everything popular is good, im just often frustrated when something good remains unknown or underground

10:12 kmicu: Glenjamin: https://github.com/masondesu/sublime-paredit

10:12 dhl: jugimaster: :-)

10:12 Glenjamin: kmicu: i'm using that, it's kinda buggy but better than nothing :)

10:12 jugimaster: :p

10:20 kmicu: Glenjamin: You can always try to migrate to https://github.com/fatih/subvim and after that to emacs with evil-mode x]

10:29 swks: hello there

10:30 hyPiRion: 1hey

10:30 swks: feeling frustrating, more than 2 hours trying to figure out what's wrong with my emacs config

10:30 trying to set it up ready for clojure development

10:30 http://clojure-doc.org/articles/tutorials/emacs.html

10:31 doing everything line by line, but getting symbol doesn't recognized exceptions

10:32 hyPiRion: On the configure emacs-part?

10:32 swks: Maybe it's something wrong with repl

10:34 kmicu: If you are a fresh emacs user you should try some OOTB configs like https://github.com/overtone/emacs-live

10:35 And you can start coding clojure in emacs in 5 minutes.

10:36 swks: kmicu: thanks, looks AWESOME!

11:15 m0smith: hi

11:16 Is it possible to treat am interface (ILookup) as a protocol?

11:16 Basically I have an object I want to be able to treat as a "map"

11:19 bbloom: m0smith: 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:23 Glenjamin: you mean defrecord?

11:32 alandipert: m0smith: 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:33 m0smith: generally if i need java objects to be associative i will convert them to maps via reduce, bean, or similar

11:36 pppaul: anyone in here use emacs live?

11:37 i'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:41 * kmicu has good thoughts

11:46 rhickey: there are now docs for core.async alt and async (but impls still wip) for those following along

11:48 bbloom: rhickey: cool! just the docstrings right now? or is there a broader overview somewhere? a design doc or something

11:50 rhickey: there are lots of design docs on my machine

11:51 I haven't put into a narrative for users yet

11:51 but basically its CSP-like channels, with thread blocking and inversion-of-control parking impls

11:52 the latter allowing for high-connection count servers on the JVM and use by CLJS wherever it runs

11:53 bbloom: excellent. dnolen & i and a few others were already plotting a CLJS port in here yesterday :-)

11:53 rhickey: hopefully the death of callback hell

11:53 the 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 jigger

11:54 So you should ping Timothy Baldridge to coordinate for cljs if you want to help out

11:54 bbloom: ok, even better! thanks

11:55 rhickey: cljs will be trivial, no locks needed

11:56 m0smith: alandipert: 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 rhickey: but same design and engine, queues of parked callbacks are used even in the blocking version, blocking is just at edges

11:56 bbloom: yeah, I think that the IOC stuff will be absolutely killer for CLJS

11:56 m0smith: What I really need to to be able to build a protocol from an existing interface

11:57 but I have not pried openthe protocol black box to see what is inside yet

11:58 rhickey: we'll also move to FJ pools on the parking JVM version

11:58 pppaul: where can i read the docs for core.async?

11:58 bbloom: pppaul: https://github.com/clojure/core.async/commits/master

11:59 rhickey: I saw there were some questions about scheduler etc for cljs, that won't be necesary

11:59 y

11:59 pppaul: i guess the tests are the docs

12:00 rhickey: pppaul: it's work in progress, not for consumption yet if you don't want to read code

12:00 pppaul: i like reading code

12:00 rhickey: tests are not docs, there are doc strings

12:00 feedback for which is welcome

12:06 ok, gotta run, hopefully in a few days it will be ready for more tire-kicking, including some narrative

12:07 pppaul: docs seem good, though i still have little idea as to how to use this.

12:07 Okasu: Hi, trying to create table using korma connection but failing, https://www.refheap.com/paste/14733 . Whats wrong there?

12:10 bbloom: pppaul: i think that this golang video is a good intro https://www.youtube.com/watch?v=f6kdp27TYZs

12:10 pppaul: thanks. watching

12:11 juxovec: hi

12:11 do any of you use Luminus (Clabango)?

12:11 Have you ever seen: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: context-lookup in this context (tags.clj:67)

12:13 wink: juxovec: could you pastebin some code? :)

12:14 juxovec: i have no clue which part of my application causes this problem

12:14 exception 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:14 wink: juxovec: looks like if/endif, yea

12:15 I'd check the templates first

12:15 juxovec: yes, there is {% if message %} {{message}} {% endif %} in my templates

12:16 this is only if in my templates at all

12:19 wink: juxovec: are you using it any different than by using render in layout?

12:20 otherwise no clue, sorry

12:22 juxovec: when I remove posted snippet problem disappears

12:22 wink: maybe you managed to get a non-default whitespace in there?

12:23 or it can't do singleline? :P

12:23 I'm poking in the dark here

12:29 tomoj: hmm.. death of callback hell? OK. but aren't we just in CSP limbo? :)

12:29 I still need to read hoare

12:30 s/OK./yes!/

12:30 dnolen: brainproxy: pushed out mori 0.2.0 to npm

12:33 bbloom: tomoj: i'm still not sure why you are so negative on CSP

12:33 tomoj: I chose "limbo" in an attempt to not be so negative

12:33 bbloom: negative connotation to me :-)

12:34 tomoj: well, yeah, it ain't heaven

12:34 clojurebot: Huh?

12:35 tomoj: suppose you could get a lazy seq of mouse events w/ batik. abuse of lazy seqs?

12:35 well it wouldn't really be lazy huh, but a seq at least

12:36 bbloom: seqs are defined by two operations: first and next. channels have two DIFFERENT operations: put! and take!

12:36 tomoj: yeah

12:37 bbloom: channels are inherently queues, optionally bounded, and inherently mutable

12:37 tomoj: just hypothetically

12:37 the thing is, I don't want to be forced into exclamation points just because cljs only has one thread

12:37 bbloom: lazy seqs are "pure" in the sense that successive calls to first or next on the same seq produce the same results

12:37 but "exclamation points" aren't inherently bad if you need to actually have some effect on the outside world

12:38 tomoj: definitely, in that case I'm fully on board

12:38 bbloom: and 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:38 tomoj: (my s/OK./yes!/ was an attempt to indicate that in some respects I am not negative but quite positive :))

12:38 yeah

12:39 but 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:39 bbloom: so you'd rather callback hell?

12:39 tomoj: no, that's why "yes!"

12:39 I'd rather heaven

12:40 "limbo" is probably unfair, there's just something else I want _too_ :(

12:40 rhickey: bbloom: how would you know what happened w/o labels?

12:41 good deck on csp http://www.cs.kent.ac.uk/projects/ofa/jcsp/jcsp.pdf

12:41 bbloom: rhickey: 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 rhickey: yeah, golang is awfully imperative there

12:42 you can always ignore the lables

12:42 labels

12:42 jeez, autocorrector

12:42 bbloom: can i have duplicate labels? ie if i want to label something :_ just like a _ in let bindings?

12:43 rhickey: yes

12:43 bbloom: then i guess it's effectively optional :-)

12:43 pppaul: what is CSP?

12:43 rhickey: well, there must be labels

12:43 tomoj: $google CSP

12:43 lazybot: [Communicating sequential processes - Wikipedia, the free ...] http://en.wikipedia.org/wiki/Communicating_sequential_processes

12:45 bbloom: i 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 rhickey: pppaul: see link I just posted

12:45 bbloom: rhickey: that pdf isn't loading for me

12:45 rhickey: bbloom: I don't see that case worth the complexity of optionality

12:46 bbloom: rhickey: 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:47 pppaul: looking at it now @rhickey

12:47 rhickey: go is imperative, select is a statement not an expression

12:47 tomoj: rhickey: so are stu's future seqs doomed? or maybe we can build them on top of CSP?

12:47 rhickey: future seqs?

12:48 tomoj: there was a little experiment in cljque called that, just replacing the 'rest' of a seq with an INotify basically

12:51 cbp`: callen: did the paste help you? Let me know if you need me to do more I have plenty of time this weekend

12:51 tomoj: I probably inappropriately took the disappearance of cljque as a sign that there may be a dead end waiting that way

12:57 "The theory of CSP includes mutually consistent denotational semantics, algebraic semantics, and operational semantics." hooray

12:58 bbloom: rhickey: you asked for doc feedback: could mention duplicate labels are allowed

13:00 except :default, of course

13:02 tomoj: looks like multiple :default will work, but would be a cruel thing to write

13:02 oh, no, the extras will get dropped

13:03 bbloom: ,(case 1 :x 2 :x 3)

13:03 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate case test constant: :x>

13:03 bbloom: it's nice to catch such errors at macro expansion time. alt could warn about duplicate :default

13:13 tomoj: huh, it looks like a chan with a nil buf will just keep all its puts forever?

13:17 oh no I was just using it wrong

13:18 bbloom: tomoj: in theory no buffer would block

13:18 http://golang.org/doc/effective_go.html#channels talks about buffered & unbuffered channels

13:18 looks like core.async lets you override the specific buffer type & there are a few choices

13:20 tomoj: 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:23 tomoj: bbloom: what I mean is if the buf is nil, the puts never seem to be dequeued

13:23 bbloom: tomoj: really? channels.clj line 99

13:24 Roxxi: How 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:24 bbloom: (and buf …) is false, so the (let [iter ….) code runs

13:24 tomoj: but where's the dequeue?

13:24 it just seems to iterate and leave them there

13:25 ... or does a LinkedList iterator remove elements as it goes O_o

13:26 I can't figure out how to get a (chan nil) to do anything interesting inside async though

13:27 bbloom: tomoj: hmm looking

13:28 tomoj: first, it's a java.util.Queue, not a LinkedList

13:28 tomoj: oh no, apparently LinkedList is a queue

13:28 sorry

13:29 tomoj: https://www.refheap.com/paste/431be648070c2d028ffe3d499

13:29 must be getting dequeued somewhere

13:29 bbloom: i dunno, i'm not smart enough to read functions this long, hence i don't write them lol

13:31 tomoj: looks like cleanup calls remove on the iterator

13:32 i'm glad somebody else is writing all this locking code lol

13:32 lfranchi: hi 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:32 any ideas?

13:33 bbloom: lfranchi: unfortunately the easiest thing to do is to write the function & java and call it from your clojure code

13:33 tomoj: but only if the putter is not active

13:33 lfranchi: bbloom: i see

13:33 tomoj: and a fn-handler is always active..

13:33 lfranchi: haven't written any java in a long time... time to see :)

13:34 bbloom: lfranchi: it's a trivial static function that simply uses the >>> operator

13:34 lfranchi: bbloom: 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:35 bbloom: tomoj: i have no idea. my brain hurts trying to read the channel code :-)

13:36 pjstadig: lfranchi: there is a way to do it in clojure, but it is not as performant as writing a java method would be

13:37 lfranchi: https://github.com/pjstadig/clojure-clojure/blob/master/src/name/stadig/clojure_clojure.clj#L64-L69

13:37 tomoj: oh, no, they are never dequeued

13:37 lfranchi: pjstadig: ah nice :) that's what i was looking for, to avoid having to figure that out myself :)

13:37 bbloom: tomoj: can you create a test case or something? i'm sure they'd appreciate the bug report haha

13:37 tomoj: https://www.refheap.com/paste/6046b19e48de756fed7ff6f18

13:37 lfranchi: performance isn't really important (this is not "real" production code0

13:38 tomoj: dunno if that's a bug..

13:40 lfranchi: pjstadig: thanks! works :)

13:40 bbloom: pjstadig: good call

13:48 tomoj: I wonder if buffer chans break the denotational semantics

13:56 lfranchi: pjstadig: hm actually, either i'm missing some sublety here or it's not working right: https://gist.github.com/lfranchi/5605271

13:56 shouldn't the former be the same as the latter?

14:01 dnolen: lfranchi: you need to change Long/MAX_VALUE to Integer/MAX_VALUE

14:01 Scala Int is 32 bits, but integer type default is 64 bit for Clojure

14:02 lfranchi: ahhh

14:02 man, i didn't think the hardest part of all of this would have been shifting a few bits around :)

14:02 thanks

14:17 tomoj: this lock-id/active? stuff looks intriguing

14:17 wish I understood it

14:19 mrb_bk: core.async looks nice

14:20 tomoj: lock-id vaguely reminds me of lattice-kanren lvars

14:27 hmm not really though

14:41 muhoo: i 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:44 arrdem: given that this is rather heritical, but has anyone looked at optimizing immutability out of clojure code?

14:44 tomoj: muhoo: don't think it's possible

14:44 you can wrap

14:45 ILookup isn't a protocol on the jvm so :(

14:45 mefesto: does extend-type do that?

14:45 bbloom: arrdem: you mean like haskell & linear types ?

14:46 mefesto: ,(doc extend-type)

14:46 clojurebot: "([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:47 arrdem: bbloom: 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:47 tomoj: ILookup isn't a protocol so extend doesn't help

14:47 mefesto: tomoj: doesn't it work for both interfaces as well as protocols?

14:47 tomoj: you can extend a protocol to an interface

14:48 you can't extend an interface to a class or an interface to an interface

14:48 bbloom: arrdem: transients are there for mutability & performance, but there is no proof system for containment of side effects

14:48 arrdem: as far as i know, there has been no work for automatic optimization of this nature

14:48 (at least in clojure)

14:48 arrdem: w00t thesis idea get1

14:49 bbloom: haha

14:49 mefesto: tomoj: ah i see

14:49 tomoj: arrdem: when you fork clojure and add a type system lemme know

14:49 ;)

14:50 arrdem: tomoj: lol that's been on the todo list for a while :p

14:50 tomoj: I think it's gonna stay there for a while too

14:50 tomoj: or maybe gradual types could help enough someday

14:50 * arrdem is reading frenchy64's thesis atm

14:51 muhoo: tomoj: it looks like extend-type ILookup, Associative, and Counted might do it

14:51 it was from BP's slides from cljwest 2012, i found it

14:51 tomoj: .. again, ILookup is not a protocol

14:54 muhoo: ah, ok, right in clj it's not. in cljs it is, which is how people extend js things to do (:foo bar)

14:54 crap

14:54 r0bglees0n: is cljs going to get better at inter-op with JS libraries?

14:55 bbloom: r0bglees0n: what particular problems do you have?

14:55 tomoj: that it's a protocol in cljs is nice but also seems.. dangerous

14:55 muhoo: r0bglees0n: what you mean better?

14:55 i've been jquerying my ass off in cljs and had no problems.

14:56 r0bglees0n: bbloom: 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:56 tomoj: maybe 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:56 strictly it would seem only clojurescript core is allowed to extend to those classes

14:57 bbloom: tomoj: the general rule is that you can only extend a protocol you own or an existing protocol to a type you own

14:57 r0bglees0n: bbloom: it didn't seem drop-in-and-works like coffeescript but i know its young

14:57 bbloom: r0bglees0n: you're talking about three different things

14:57 muhoo: cljs is not coffeescript. thankfully.

14:58 r0bglees0n: yeah i dont like coffeescript

14:58 actually prefer JS

14:58 bbloom: r0bglees0n: 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:58 tomoj: yeah, and who owns the native browser classes?

14:58 URL comes to mind

14:58 muhoo: coffeescript seems like javascript for people who prefer ruby.

14:58 r0bglees0n: muhoo: yup. i van vouch to that.

14:58 can*

14:58 bbloom: r0bglees0n: 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:59 tomoj: er, goog.net.URI or whatever I mean

14:59 bbloom: r0bglees0n: 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:00 r0bglees0n: 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:00 r0bglees0n: ah thats interesting

15:01 i thought jquery simply didnt work on cljs without a wrapper

15:02 weavejester: Does anyone know of a good name for a function that does (reduce #(%2 %1) x fs) ?

15:02 bbloom: cljs, 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:02 weavejester: It seems like something that might have been written before in Haskell or something

15:03 r0bglees0n: bbloom: makes sense now, thanks

15:03 bbloom: is it much work to prep a library?

15:03 bbloom: r0bglees0n: read the google closure compiler docs

15:03 r0bglees0n: alright

15:04 haha

15:04 interesting choice of name

15:04 only caught that now

15:04 ok, thanks bbloom

15:05 bbloom: weavejester: hmm mapf ?

15:05 or no… hmm

15:06 weavejester: i don't even know how to ask hoogle that b/c each function could have a different input/output type

15:07 weavejester: I guess it would be: (a -> a) -> [a] -> a

15:07 bbloom: wouldn't it be a -> [a -> a] -> a

15:08 weavejester: Uh, right, sorry, I'm confusing myself :)

15:09 bbloom: weavejester: for all the haskellers' talk of higher order functions, having a list of functions totally fucks with your type system lol

15:10 weavejester: bbloom: True, but in this case they're all the same type.

15:10 Hoogle doesn't know...

15:10 bbloom: weavejester: i think they wouldn't name that function

15:10 weavejester: It's kinda like a backward iterate

15:10 bbloom: map ($ x) fs

15:10 isn't that what it is really?

15:11 amalloy: bbloom: not at all

15:11 weavejester: No, it's not a map

15:11 bbloom: er it's a reduce, right...

15:11 um

15:11 hm

15:11 weavejester: It's given a list of changes, apply those changes in order to a value, then return the result.

15:11 bbloom: amalloy: ?

15:11 amalloy: foldr ($) x fs, more or less

15:11 bbloom: heh, i knew there was a ($) in there somewhere

15:11 my haskell sucks.

15:12 amalloy: mine too

15:12 weavejester: Yeah, and in Clojure it's just (reduce #{%2 %1) x ys) which doesn't save you a lot over (foo x ys)

15:12 But I'm using this so often it seems reasonable to create a function.

15:13 amalloy: weavejester: isn't it also ((apply comp fs) x)?

15:13 no, i guess that's the wrong order

15:13 bbloom: yeah, you need a reverse in there

15:14 weavejester: The stream of functions is essentially lazy.

15:14 Actually it's an asynchronous event stream

15:14 bbloom: amalloy: 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:15 i guess you could write rcomp (i'd call it pipeline or something) pretty easily

15:16 tomoj: is that what lamina's pipeline is, plus a point on top?

15:16 well plus async stuff

15:17 weavejester: you seen core.async yet?

15:17 (the new one)

15:17 weavejester: No. I didn't know anything was put in there yet.

15:17 tomoj: https://github.com/clojure/core.async

15:18 not usable yet of course

15:20 weavejester: I might be able to use some of that.

15:35 muhoo: i cant' do ILookup, but maybe Afn will work

15:36 tomoj: AFn isn't a protocol either..

15:36 if you have a goofy java class you're boned

15:36 muhoo: and valAt looks like it's in clojure.lang.PersistentArrayMap

15:37 tomoj: no it's clojure.lang.ILookup

15:37 * muhoo commences shaving this particular yak

15:37 tomoj: you're gonna have to wrap

15:39 muhoo: i can't. i'm using a library that gives me this garbage.

15:39 then again, maybe not, maybe i should just scrap the whole thing and use somethign that's already wrapped

15:39 tomoj: yeah, so take the garbage and wrap it

15:40 or just convert to a map :)

15:40 muhoo: true, could write my own wrapper. might do just as an exercise

15:42 i 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:42 (on JVM)

15:50 ysawej: hi all, how do I find the cartesian product of a collection of lists?

15:51 so if it is just 2 lists, I can do a (for [ [x y] [list1 list2]] do-something)

15:51 tomoj: $google clojure cartesian product

15:51 lazybot: [Creating a cartesian product with to lists (Clojure forum at JavaRanch)] http://www.coderanch.com/t/546161/clojure/Creating-cartesian-product-lists

15:51 ysawej: but for a variable number of lists, how can I specify it in for, specifically?

15:51 tomoj: not what I was hoping for

15:52 you can't https://github.com/clojure/math.combinatorics

15:53 ysawej: okay, but is there a lazy way to get it?

15:53 tomoj: the one in math.combinatorics is lazy

15:54 ysawej: looks like combinatorics will help, but I was looking for something in "for" itself, but looks like its not possible

15:54 tomoj: indeed

15:57 ysawej: thanks anyways tomoj

16:33 muhoo: but... 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:33 page 294, if anyone is interested

16:34 llasram: You can definitely use deftype to create types implementing interfaces

16:37 tomoj: (coin -> (choc -> (coin -> (choc -> STOP))))

16:38 how does this map to core.async?

16:39 I 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:40 oh, man, looks like I have to read 135 pages before I get to put! and take!

16:50 brainproxy: dnolen: very cool!

16:51 jabb: so 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:51 it sets the read-eval global variable to (constantly false)

16:52 should every clojure program have that line?

16:53 hiredman: ugh, really?

16:53 bbloom: hiredman: yeah, in the "app" template

16:53 hiredman: it's true, never update

16:53 upgrade

16:54 jabb: what's the "ugh" for? :P

16:54 bbloom: jabb: you only need that line if you're using clojure.core/read when you should be using clojure.edn/read

16:54 jabb: I see. What's the default behaviour if I don't have it.

16:55 bbloom: read-eval is discussed at great length on the mailing lists

16:55 do a search on google groups

16:56 jabb: ahh, security risk

17:07 tomoj: brainproxy: what's cool?

17:08 brainproxy: dnolen pushed out v0.2.0 of mori to the npm registry

17:08 tomoj: ah

17:08 brainproxy: I already have some things in mind for v0.2.1

17:08 :D

17:08 will send some pull reqs later...

17:37 hadronzoo: Is there an RRB-Tree implementation for ClojureScript? Flexvec doesn't seem to be ported yet.

17:46 tomoj: flexvec is the only rrb-tree impl I know of

17:47 hadronzoo: tomoj: Actually, I only need efficient head and tail insertion. Is there a double-linked list library for both Clojure and ClojureScript?

17:51 tomoj: not that I know of

17:51 I think data.finger-tree supports that, but it hasn't been ported either

17:51 oh looks like there may be some separate impls for finger trees in cljs though

17:51 but unlike flexvec porting data.finger-tree should be relatively easy I'd think

17:52 https://github.com/wagjo/data.cljs ?

18:02 why do core.async Handlers need Locking?

18:02 Raynes: jabb: What? Really?

18:02 The default app template does that?

18:03 I'm going to beat the shit out of somebody.

18:03 * Raynes runs git blame to find out wbo

18:03 Raynes: who*

18:04 amalloy: Raynes: bet you a dollar it's technomancy

18:04 Raynes: It is.

18:04 callen: ?>":

18:05 cbp`: :)

18:05 jabb: Raynes: (alter-var-root #'*read-eval* (constantly false))

18:07 Raynes: https://github.com/technomancy/leiningen/commit/3aec2e4de96bb08b2a41e2d444128d08d968f7d9

18:07 amalloy: Your dollar is in the mail.

18:07 tomoj: at least it's not hidden somewhere

18:07 not like you probably weren't going to just delete -main anyway :)

18:08 oh the concerns in your comment seem valid to me

18:08 Raynes: Yes, but it just confused the hell out of jabb which is a particularly fair reason to let this come up in other ways.

18:09 tomoj: what if it had a link?

18:09 Raynes: Templates are not documentation.

18:09 tomoj: I guess the problem is that "other ways" should not include "oh shit we got hacked"

18:09 Raynes: They are scaffolding.

18:09 cbp`: callen: hi what's up

18:10 tomoj: but how else is a newbie likely to find out about this problem?

18:11 callen: cbp`: being a wastrel. looked at your refheap

18:11 cbp`: is that thread-safe? I think it needs wrapped in a ref or something.

18:11 hadronzoo: tomoj: thanks. I'm going to try wagjo's ftree.cljs.

18:11 technomancy: Raynes: *read-eval* as defaulting to true for versions of clojure that predate read-edn is a horrible idea

18:12 cbp`: callen: yea probably

18:12 Glenjamin: is there any other way to add a plugin dependency other than project.clj and profiles.clj?

18:12 tomoj: hadronzoo: even though it's deprecated in favor of data.cljs?

18:13 callen: problem is ref means "retry"

18:13 not really what we want here.

18:13 technomancy: it'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:13 callen: probably more like an atom or something.

18:13 Raynes: technomancy: 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:13 technomancy: Raynes: I'm fine with changing it back now, but it was the right thing to do at the time

18:13 hadronzoo: tomoj: sorry, I meant ftree.cljs in the wagjo/data.cljs repo

18:13 Raynes: I've already booked a flight to Washington, man.

18:13 We've gotta settle this like men.

18:14 callen: technomancy: 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:14 tomoj: hadronzoo: ah, feel free to report back with your experience with it :)

18:14 technomancy: callen: are you still shooting for somewhere fairly remote?

18:14 cbp`: callen: what's the next step

18:14 Raynes: callen: What is this refheap you're talking about?

18:15 technomancy: Raynes: you can enjoy some of my home-roasted coffee!

18:15 callen: technomancy: 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:15 jabb: well, not the "hell out of me" :P

18:15 callen: Raynes: https://www.refheap.com/paste/14700

18:15 Raynes: I will drink it with one hand and strike you repeatedly with the other.

18:15 callen: cbp`: I need to stop being lazy, clean it up and make it thread-safe, then start adding inserts and basic queries.

18:16 technomancy: callen: yeah, you want to get a feel for the lay of the land

18:16 callen: technomancy: precisely. That's less relevant in Austin.

18:16 tomoj: callen: have you talked to an equal number of austin and seattle people?

18:16 callen: tomoj: roughly, but even the Austin people were voting seattle

18:16 save for a few.

18:17 tomoj: yeah after I wrote that I realized you're not an idiot so..

18:17 * technomancy &

18:17 lazybot: java.lang.RuntimeException: EOF while reading

18:17 tomoj: I vote austin, because I might be there again someday, and we need more clojure people there :)

18:17 callen: tomoj: that's the nicest thing anybody's said to me in awhile, thank you.

18:18 technomancy: taking the kids to radio shack for robot parts =D

18:18 callen: technomancy: niiiice. you must be so proud.

18:18 technomancy: it's tons of fun

18:18 callen: technomancy: my dad and I used to make runs to radio shack for his custom built amplifier, which he let me help out on.

18:18 technomancy: he still uses that amp, 20 years later.

18:18 technomancy: radio shack is kind of the starbucks of electronics hackers, but it's what's nearby

18:18 heh; sweet

18:18 callen: tomoj: Austin wins out in some specific categories. Namely, my desire to eventually have a small ranch with goats :P

18:18 jabb: also, is it totally unorthodox to write a game in clojure?

18:19 callen: technomancy: whatever works.

18:19 technomancy: they are starting to stock arduino parts there though, which is encouraging.

18:19 callen: jabb: We see plenty of people doing it in here, and it can be done, but it's clearly a labor of love.

18:19 jabb: you make some serious sacrifices doing a game on the JVM.

18:19 it sets some hard limits on what you can do.

18:19 jabb: I wouldn't assume the JVM to be the problem.

18:20 At least if I ever plan to port to mobile

18:20 callen: jabb: it is if you want to chase higher graphics or have an easier time making it responsive.

18:20 jabb: most serious mobile game engines are C++ for iOS and Android

18:20 with only some trimming to integrate it into their respective environments.

18:21 jabb: My previous games have been just that. :)

18:21 And lua

18:24 callen: jabb: right well I'm not trying to discourage you, just being realistic.

18:24 tomoj: jabb: how do you plan to port to iOS?

18:27 jabb: tomoj, no plan for that yet :P

18:27 besides, don't even have the money for the license

18:28 callen: so for C/C++ what have people been using as far as libraries? just basic GLES?

18:30 hadronzoo: tomoj: I wonder if the clojure-scheme compiler would work for iOS development. Games written in Gambit Scheme will run on iOS.

18:31 Raynes: callen: https://www.refheap.com/paste/14747 untested changes.

18:32 tomoj: hadronzoo: very interesting

18:32 the 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:33 hadronzoo: tomoj: Gambit is fairly fast. See: http://jlongster.com/s/jlongster-old/pages/blog/write-apps-iphone-scheme.html

18:34 tomoj: hmm https://github.com/schani/clojurec/tree/master/run/ios

18:35 oh sweet gambit has continuations

18:35 sold

18:36 hadronzoo: tomoj: 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:38 Interactive iOS dev with Gambit: https://www.youtube.com/watch?v=Q7c0rU9Lv28

18:40 mefesto: I 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:41 C-c C-t => clojure-jump-between-tests-and-code

18:44 n/m doesn't look that way. i can live w/out it.

18:44 callen: Raynes: seems solid

18:44 Raynes: callen: I did all of that but the diff in refheap btw. I forked then edited. :D

18:44 When I add diffing I'm never gonna need an editor again.

18:45 callen: lol

18:47 mefesto: Raynes: just curious but why can't private pastes on refheap be forked?

18:48 Raynes: mefesto: They can't?

18:48 mefesto: lemme double check :-\

18:48 Raynes: mefesto: Create a private paste and link me to it.

18:48 Glenjamin: mefesto: https://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L1046

18:49 mefesto: Raynes: n/m im an idiot :)

18:50 i 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:50 Raynes: Perhaps anonymous + private = unforkable.

18:50 I have been known to have bugs.

18:51 mefesto: Ahh i know what happened

18:51 i 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:51 a simple refresh shows the `fork` link.

18:51 Raynes: Aha.

18:52 Yeah. It'd be nice if it would update the page properly, but blech.

18:58 brainproxy: win +1

18:58 derp

19:17 Glenjamin: can clojure library names be capitalised? I've only ever seen them lowercase, but not sure if that's convention or enforced

19:23 amalloy: convention

19:25 callen: Glenjamin: you could just try it to see if it works, but I for one rather like the convention, it's clean looking.

19:25 Glenjamin: I'm writing a library that provides gadget for spies

19:25 which I'm calling q

19:25 or Q

19:25 not sure which yet - i like the lowercase convention too =/

19:38 callen: Glenjamin: gadgets...for spies?

19:38 Glenjamin: as in test spies

19:38 gadgets is a bit of a stretch, they're just functions/macros - but naming isn't my strong point

20:11 callen: cbp`: I'm writing some simple coercion stuff

20:11 cbp`: ok

20:11 callen: cbp`: I'm doing some insanely retarded type dispatch bullshit with cond

20:11 because I'm an idiot and don't use multimethods.

20:12 cbp`: haha

20:14 callen: welp. it works. sorta.

20:15 I need to work on something that could actually make me money now though.

20:17 cbp`: aw ok

20:17 callen: cbp`: let me show you what I did

20:18 cbp`: https://www.refheap.com/paste/14751

20:18 I like the way I divvied things up, but the dispatch is dumb-dumb-dumb.

20:27 cbp`: hey

20:27 cbp`: https://www.refheap.com/paste/14751

20:27 cbp`: thoughts?

20:27 cbp`: the dispatch is super-dumb, but I like the separation.

20:28 cbp`: Yea

20:28 Just need to add an option for :success-atom i guess

20:29 callen: why?

20:29 clojurebot: Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

20:29 callen: cbp`: I rip out the response by default, no need to acknowledge the top-level success-atom.

20:29 cbp`: ok

20:29 oh i just saw the last function

20:29 I haven't used rethinkdb before so I guess I'll read the docs :P

20:30 callen: cbp`: you probably know more than me. *shrug*

20:32 yogthos: gleetings.

20:32 cbp`: https://www.refheap.com/paste/14752 this is the whole file with Raynes' improvements.

20:34 cbp`: 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:34 cbp`: ok

20:36 callen: even 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:36 Raynes: so RethinkDB 1.5 came out

20:36 Raynes: I about shat myself when I saw the data file migration instructions.

20:38 tomoj: don't use a global :(

20:38 callen: tomoj: I'm open to alternative suggestions, but I'm not going to chase a religious ideal. It just needs to work.

20:38 If it means more LOC and/or more hassle, I'm probably not going to bother.

20:39 Raynes: callen: Well using a global likely breaks it to shit in lots of cases.

20:39 If you reload that, the atom is reset.

20:40 tomoj: (deftype Conn [in out]) (defn get-database-list [conn]) ?

20:40 callen: Raynes: I can just spit it out and let the caller hold onto the var then.

20:40 and let it be their problem.

20:41 tomoj: seems fine to me.

20:41 that's how i was writing it before.

20:41 I need to rewrite what cbp did to bring the API back to that.

20:41 tomoj: cool, I thought you meant you were going to go the way of java.jdbc :)

20:41 callen: no

20:41 I figured you were going to suggest something loony.

20:41 Looks like we were closer in mind than either of us expected.

20:41 Raynes: callen: Whatever. I'm going to eat a 50s themed cafe. Your argument is invalid.

20:42 callen: Raynes: the whole cafe?

20:42 tomoj: it's weird cus I feel like I'd want encapsulation on the Conn

20:42 Raynes: at a, even

20:42 tomoj: hence not defrecord

20:42 callen: Raynes: but seriously, the migration instructions for 1.4->1.5 are horrific.

20:42 tomoj: but "encapsulation" is a bad word :)

20:42 Raynes: at an, even

20:43 callen: Raynes: I integrated your recommended changes as well. Thanks for that.

20:43 Raynes: They actually worked? Cool.

20:43 tomoj: datomic's conns appear to be deftypes that implement ILookup though, so they don't print out all their guts

20:43 callen: Raynes: worked perfectly the first time. I didn't have to correct anything.

20:44 Raynes: My goodness I am underpaid.

20:44 * Raynes files his fingernails.

20:44 callen: tomoj: seems reasonable. I figured I was going to have a deftype with in/out streams of the original socket.

20:44 I am not too sure what the lifecycle on the socket will be, I guess I'll have to retain a reference to it.

20:44 tomoj: ah yeah

20:45 callen: I could do request life-cycle db connections in the context of web apps. Should'ish work fine.

20:45 I actually need to stop fiddling with this library and work on something more valuable though.

20:45 tomoj: `r.table('users').filter(lambda doc: doc['age'] > 29).run()`

20:45 that's.. interesting

20:46 callen: I haven't decided how to translate lambdas yet.

20:46 tomoj: oh, that's the same as datomic's filter though, guess I can't complain

20:46 callen: I might boil it down to dumb filter predicates

20:46 since they're single-expression objects

20:46 I don't really mind the API, it's fine.

20:47 I'm still cranky about the length prefixes.

20:47 Raynes: callen: I was really excited about using dotimes.

20:47 callen: luckily cbp` decided to hero all the way through that nonsense.

20:47 Raynes: I don't think I've had a single valid use for that since I started writing Clojure.

20:47 callen: hahahaha

20:47 Raynes: And you just throw that shit in my face like HERE, DOTIMES.

20:48 callen: Raynes: byte arrays will do that for you.

21:00 hrrrm. magical DB auto-selection. dafuq.

21:19 gfredericks: huh; an interesting alternative to checkouts is just opening the file from the other project and evaling it with nrepl.el

21:20 callen: gfredericks: checkouts?

21:20 gfredericks: an old lein feature for hacking on dependencies

21:20 xeqi: gfredericks: I do that when I want to quickly debug someone else's lib

21:21 gfredericks: I'm way behind on tooling; perpetually.

21:24 ianeslick: Anyone want to help me hack up a proper inspect for nrepl.el?

21:24 s/inspect/inspector

21:24 I've got a fairly good idea and some tooling; helps to have some dialog to flesh out ideas

21:24 Basing it on technomancy's javert

21:33 gfredericks: huh; the clojure inheritance thing does multiple inheritance doesn't it

21:39 callen: gfredericks: derive has multiple parents, but precedence is an open question.

21:39 gfredericks: you have to do prefer-method manually, which could get laborious.

21:39 gfredericks: it all good for my purposes

21:39 callen: just saying.

21:40 some people need to be able to specify "this over that"

21:40 I try to avoid writing code that relies on that.

21:40 Python used a left-to-right going-upwards tree sweep in the method resolution order

21:41 sounds complicated but was fairly easy for me anyway to retain in my head.

21:41 gfredericks: this is the first time I've tried the hierarchy functionality

21:41 just never need it

21:42 technomancy: ianeslick: if you're interested in javert you can take the whole thing over

21:42 I don't have the bandwidth to function as a proper maintainer

21:42 ianeslick: technomancy: Sure, I can do that.

23:08 technomancy: Can we just redirect to a new project nrepl-inspector? Easier for folks to find.

23:08 I can set it up if you want to put in the forwarding Link on Javert

23:11 robink: Are nested fors a bad idea?

23:21 amalloy: robink: not at all

23:21 although often you don't actually want that, but instead a single for with multiple bindings

23:40 robink: amalloy: Gotcha. I'd have to have a binding that depended on another, but it might be possible.

23:41 am alloy: I'm trying to turn Hiccup-style nested vectors into a hashmap.

23:42 Sorry about the nick munge, my phone's autocorrect is rather aggressive.

23:43 amalloy: robink: a hash looking like what? you might be able to just use clojure.data.xml

23:45 robink: amalloy: 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:47 amalloy: Input would be [:PARSETREE [:FROB [:DIGITS "123"] [:DIGITS "456"]]]

23:47 amalloy: Output would be {:FROB [123 456]}

23:48 am alloy: I'm mostly there, but I do have the nested for.

23:49 Agg, sorry about the nick autocorrect.

23:51 Lemme switch to laptop

23:52 amalloy: looks like a nested for to me

23:52 robink: amalloy: 'k

23:54 amalloy: 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:54 amalloy: Thankfully my real-world example has a fixed level of nesting

Logging service provided by n01se.net