#clojure log - Oct 29 2013

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

0:18 kendallbuchanan: Anyone know why "(let [my-atom (atom {})] (-> :my-atom name symbol deref))" doesn't work?

0:18 Basically, I'm trying to deref an atom by converting a keyword into a symbol representing the atom.

0:20 rhg135: deref doesnt take a symbol

0:20 i think it takes an object implementing IDeref

0:21 kendallbuchanan: Ah, okay.

0:21 rhg135: might need to resolve the symbol

0:21 kendallbuchanan: Makes sense.

0:22 Thank you!

0:22 rhg135: np

0:24 right1: does anyone have spare time to waste? im working on some project euler problems for fun but i have a pretty terrible solution

0:25 oh good! i got a solution in 2 min runtime

0:42 bitemyapp: `cbp: yeah, (run query connection)

0:42 `cbp: roger

0:42 bitemyapp: `cbp: that returns a promise which you deref.

0:43 `cbp: yea :)

0:45 bitemyapp: `cbp: incidentally, the promise-based async API is as much a convenience as anything.

0:46 `cbp: when the underlying semantics are asynchronous (core.async or agents) it's easier to just use a promise to synch up the results. If the API defaulted to blocking I'd just be deref'ing the promise for the user (why?) or doing something worse and more complicated to make it "blocking"

0:48 * `cbp nods

0:48 bitemyapp: this also lends to my growing yet already very great respect for the concurrency primitives in Clojure.

0:48 Anything less nice or less composable would've made it considerably more difficult.

4:09 shoshin: ping what is exactly wrong with the implementation of this function?

4:09 (defn sample

4:09 [x {:keys [load?]

4:09 :or {:load? false}}]

4:09 (when load?

4:09 (println "load? is true"))

4:09 (println x))

4:09 i call (sample "12) it returns an arity exception.

4:09 * (sample "12")

4:10 i've been trying to figure it out for quite sometime.

4:13 akrajan: shoshin: sample definition takes 2 arguments

4:13 x and the destructured second param

4:13 shoshin: akrajan but i want the second one to be optional.

4:16 akrajan: (defn sample [x & [{:keys [load?] :or {:load? false}}]]

4:16 (println "load? - " load?)

4:16 (println x))

4:16 shoshin: in the version i just pasted, the second argument is optional

4:17 shoshin: akrajan thanks! got the mistake!

4:17 akrajan: :-)

4:32 abaranosky: hello

5:04 mythz: does 'for' and 'doseq' evaluate the entire collection before iterating it? I'm getting odd results from use of atom, e.g:

5:04 (def i (atom 0)) (def q (map (fn [x] (swap! i inc)) (range 10)))

5:05 that creates a lazy map, but whenever I try to iterate over it with either 'for' or 'doseq' @i always evaluates to '10', e.g:

5:05 (for [v q] (println "v =" v ", i =" @i))

5:06 Is there way to iterate over the map so it only evaluates it one at a time? i.e. so i prints out: 1 2 3...

5:32 broquaint: I'm don't think it's possible, mythz, but I should imagine there's an equivalent way of doing what you want.

5:32 s/don't//

5:33 mythz: ok that's interesting, surprised by the current behavior, I just assumed it would loop lazily

5:34 broquaint: Presumably one of the reasons it ought to be side-effect free :)

5:38 ,(def i (atom 0)) (let [q (map (fn [n] (swap! i inc)) (range))] (str (clojure.string/join " " (take 3 q)) ", @i = " @i))

5:38 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

5:38 broquaint: If you run that you can see the first 32 items are consumed.

5:57 mythz: yeah strange, so it must be reading it in chunks?

6:53 glosoli: I have two maps :a {} :b {} is there some nice way to remove from :a contents that were found in :b ?

6:58 scottj: glosoli: clojure.set/difference

6:58 glosoli: it's meant to work on sets only, isn't it ?

7:00 scottj: by contents do you mean keys?

7:00 glosoli: scottj: by contents I mean other maps can be inside too

7:01 hmm It was incorrect of me, by contents I mean, maps

7:03 Two maps like this i.e. {{:a 1} {:b 2} {:c 3}} {{:a 2} {:b 2} {:c 3}}

7:03 scottj: glosoli: I think you mean {:a 1 :b 2 :c 3} no?

7:04 glosoli: yeah probably, got confused myself

7:05 scottj: glosoli: what result do you want?

7:10 glosoli: come up with really simple input and result maps and then maybe someone can help you

7:11 glosoli: sec, gonna pastebin it :)

7:14 scottj: the whole idea behind, is I have in memory session, which has map like this: https://www.refheap.com/20249 in some cases there might be ~15 entries in the uploaded fields (maps with file data). So the idea is, I filter out some of them (by client id). and intend to dissoc the filtered ones from

7:14 scottj: is this more clear ?

7:17 scottj: glosoli: irc has a character limit, your message was cut at "filtered ones from"

7:18 glosoli: scottj: filtered ones from the original map of :uploaded-files

7:18 clojurebot: Huh?

7:27 pyr: hola

7:27 does lein 2.2.0 => 2.3.3 reportedly incur slower operations ?

7:29 mercwithamouth: just curious...i saw this on stackoverflow.. '(defn plus [[^double x1 ^double y1] [^double x2 ^double y2]]

7:29 what's the deal with the ^ ?!

7:31 scottj: mercwithamouth: type hints, it's a performance optimization

7:31 terom: glosoli: so you have a list of maps in a map. maybe start first with a filtering function for your list of maps, then (remove your-filter list-of-maps) perhaps...?

7:31 glosoli: terom: hmm

7:31 terom: As stupid as it sounds, I never heard of remove

7:32 thanks

7:34 scottj: glosoli: if you want to remove based on what's come earlier in the list then I don't think remove will help you.

7:34 glosoli: does this accurately describe your problem, particularly the :c 1 at the end, input {:a ({:b 1} {:b 2 :c 1} {:b 2 :c 2})}} ouput {:a ({:b 1} {:b 2 :c 1})}

7:35 glosoli: looks about right

7:36 scottj: glosoli: so you want to first entry for each :client-id? Does the resulting order matter?

7:37 glosoli: nah result order does not matter

7:38 but if the same client-id with desired id for a file was filtered out, I am intended to dissoc it

7:48 mercwithamouth: scottj: ahh! thanks man

7:50 uruviel: /join #zeromq

7:50 ... sorry about that!

9:36 clgv: mercwithamouth: in the example you menationes the type hints for primitive tyes are use less because of destructuring

10:29 rafaelferreira: Hey guys

10:30 Quick question: is there a lib to convert from Java org.w3c.com.Node to clojure maps?

10:31 BobSchack: are you reading in HTML or the Node java object?

10:32 Because there are many good libraries for reading in HTML / XML in clojure

10:34 rafaelferreira: BobSchack I'm dealing with SOAP

10:34 I'm actually using SAAJ, a low-level API to avoid codegen cruft

10:34 My idea was to transform a DOM tree to clean clojure maps

10:36 aturley: does anyone have a good suggestion for generating a clojure s-expression from a simple php data structure (maps, lists, strings, and numbers)?

10:36 BobSchack: Ah unfortunately I don't have any experience with Java and Soap, sorry

10:37 bja: with the change in CLJS-1933 to remove / property access, do I need to thus access the window object as js/window?

10:37 rafaelferreira: Thanks BobSchack

10:38 SOAP is kind of immaterial to the problem. If any of the XML libs is able to convert from java's DOM I would be set.

10:38 BobSchack: https://github.com/nathell/clj-tagsoup

10:38 rafaelferreira: I'll google form Clojure XML libraries.

10:38 clojurebot: Excuse me?

10:38 BobSchack: ?

10:38 rafaelferreira: Thanks

10:39 BobSchack: NP

10:55 bjl7: Is it possible to use a zipper with post order traversal? clojure.zip/next seems to use preorder traversal. The only relevant stackoverflow says to use clojure.walk instead (not really a solution)

11:02 uruviel: Does core.async have the notion of a "priority channel", i.e. what's the equivalent of a priority queue?

11:03 BobSchack: I believe you can set priority using alts

11:03 but nothing on the channel itself

11:04 uruviel: Right so when I have a conceptual stream of messages with a priority I can't really use core.async to get them off in that order?

11:05 stuartsierra: uruviel: Not as such, no. But you could have multiple channels, one for each level of priority, and `alts!` on them in priority order.

11:05 clgv: bjl7: I thought the traversal is entirely up to you depending on how you use next, prev, left, right ...

11:06 uruviel: stuartsierra: ah yes, that might be sensible I guess

11:09 eigenlicht: what's the difference between clojure's lazy-seq and python's iterators?

11:10 I know, Clojure uses lazy seqs basically everywhere, wheras python doesn't have such a focus on iterators - but still it seems to me iterators can perfectly implement lazy seqs

11:13 mikerod: How do I get a primitive boolean type in Clojure? Some reason I'm not finding something that works.

11:14 ,(type (.booleanValue true))

11:14 clojurebot: java.lang.Boolean

11:14 mikerod: (type ^boolean (.booleanValue true))

11:14 ,(type ^boolean (.booleanValue true))

11:14 clojurebot: java.lang.Boolean

11:14 bjl7: clgv: you're probably right. I'm just going through a loop with "zip/next" at the recur and it seems to be preorder

11:14 mikerod: that's not right obviously :P

11:15 uvtc: ,(class (boolean 1))

11:15 clojurebot: java.lang.Boolean

11:15 mdrogalis: Wow. One of my EC2 nodes just disappeared out of thin air.

11:16 Has that ever happened to anyone? Running instance shutdown and deleted.

11:16 xuser: you got pawned ;)

11:16 llasram: mikerod: `type` and `class` take reference types, so you'll never get them return a primitive type -- it'll always autobox

11:17 mikerod: llasram: oh... dang

11:17 mdrogalis: xuser: I'd think AWS burped more than that.

11:17 llasram: mikerod: What are you trying to do?

11:18 mikerod: I have a boxed Boolean from a clojure literal, I'd like to use the primitive boolean instead in its place in one particular place

11:18 for a sort of interop

11:20 llasram: Is the issue that you're calling a method which has overloads for both `boolean` and `Boolean` (or `Object`), and you want to make sure the `boolean` version gets invoked?

11:36 jtoy: in a clojure function, so it is an implicit do if i do something like (defn hi [] (println "test") 2) ? I see that that works

11:36 ?

11:37 coventry: jtoy: Yes.

11:37 If you mean that the forms in the defn body get executed in series...

11:42 uvtc: jtoy, you also get an implicit `do` inside a `let`.

11:44 dav: where does lein deps save the jar files?

11:44 coventry: dav: ~/.m2/repository

11:46 dav: coventry: ah, thanks.

11:47 Does anyone know if core.typed supports type classes?

11:47 dnolen: dav: that wouldn't make sense, Clojure has protocols

11:49 bbloom: https://github.com/clojure/core.typed/wiki/User-Guide#datatypes-and-protocols

11:51 dav: is there a protocol for operations on numeric types like + - * etc?

11:51 arrdem: dav: not normally. there are libraries that provide one.

12:01 wakeup: Hi

12:01 How do I sort a list of strings in alphanumerical order?

12:02 llasram: wakeup: not just with `sort`?

12:02 coventry: ,(sort '("zxyw" "abcd"))

12:02 justin_smith: llasram: that is ascii order

12:02 clojurebot: ("abcd" "zxyw")

12:02 justin_smith: not alnum

12:02 wakeup: hmm

12:02 justin_smith: ,(sort ["a1" "0a" "zx" "Zy" "A0"])

12:02 clojurebot: ("0a" "A0" "Zy" "a1" "zx")

12:03 justin_smith: not alnum

12:03 znDuff: wakeup: What, *exactly*, does "alphanumerical" mean to you? Locale-specific collation order?

12:03 wakeup: No byte order would suffice

12:03 dav: dnolen / arrdem - so what would be the type of sort ?

12:04 hopefully not [Any]->[Any]

12:04 znDuff: wakeup: ...uhh, byte order *is* ASCII order, at least for ASCII-encoded bytes.

12:04 wakeup: ascii order is fine, thanks.

12:04 justin_smith: wakeup: if you are OK with Z coming before a, regular sort works, otherwise you can pass in a custom sorting function to sort

12:05 also note that "11" will come before "2"

12:05 bbloom: dav: clojure's standard library is not typable with haskell's type system :-P

12:06 dav: try this in your repl: (source sort)

12:06 dav: a closer approximation would be Seqable -> Seq

12:16 dav: bbloom: :(

12:16 bbloom: dav: what's the sad face about?

12:16 dav: bbloom: "clojure's standard library is not typable with haskell's type system"

12:16 bbloom: I kinda love the haskell typesystem :/

12:17 bbloom: dav: sure, but haskell's type system is for typing... wait for it.... haskell programs

12:17 dav: if you're new to Clojure, I recommend you avoid core.typed (as cool as it is) and take some time to learn what makes Clojure unique.

12:18 dav: you might have to unlearn some stuff about haskell, but there are many former or current haskell programmers in here who would be happy to compare/contrast & shed light on things

12:19 dav: I had learned some lisp before haskell but I find lisp/clojure less readable than haskell and I get to aberations at runtime which I suspect 99% of which would be eliminated by a typecheck..

12:20 bbloom: so what makes clojure unique?

12:21 bbloom: dav: start here clojure.org/rationale

12:21 clgv: "less readable than haskell" :D

12:21 bbloom: then check out some of Rich's stuff on InfoQ, and maybe pick up a book

12:22 phalphalak: dav: I think performance bottlenecks caused by reflection or other type related issues are rather rare… of course, it depends on the problem you are working on

12:22 coventry: Yeah, Rich Hickey cares more about keeping things flexible so that you can get the design right (minimal and easy to follow) rather than tools. See his criticism of TDD in "Simple Made Easy" and his complete disinterest in fixing mystifying compiler errors in "Design, Composition, Performance."

12:22 muhoo: i'm using clojure.tools.trace on a function that trampolines, but i'm getting output that ends like this https://www.refheap.com/20253

12:23 indigo: coventry: Oh lame... I thought people were working on those errors ;P

12:23 muhoo: does trace really turn it into a huge stack? or is that just the output?

12:23 dav: coventry: I don't see how an optional type checker removes any flexibility since it's optional..

12:24 coventry: indigo: They are working on it, but it is not a huge priority. Read through a few of http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=labels+%3D+errormsgs

12:25 dav: I was saying that in support of bbloom's suggestion that you steer clear of core.typed for a while.

12:26 xuser: can lein run a single clj file? like when you java -cp clojure-1.5.1.jar clojure.main test.clj

12:27 coventry: muhoo: It doesn't track the full stack, just the depth.

12:27 dav: coventry: gonna watch simple made easy now.

12:28 pepijndevos: I have so far failed misserable at installing Fedora on my iMac

12:28 oops

12:28 xuser: +do

12:28 bbloom: dav: some portion of what rich is saying will be obvious to you as a haskell programmer, but remember the audience & try to parse out the bits that are different from haskell's philosphy

12:31 justin_smith: phalphalak: he doesn't mean performance problems when he says runtime abberations, he means errors - ie. ones that in a static type system would be caught before runtime

12:31 phalphalak: justin_smith: i see, thanks for clarifying

12:32 uvtc: coventry, can you summarize the issue around disinterest in fixing mystifying compiler errors?

12:33 coventry: uvtc: It's just a throwaway line in that talk about what to prioritize in the development of clojure. I don't remember where in the talk he says it, I'm afraid.

12:34 dnolen: dav: there's a #typed-clojure if you have Typed Clojure specific questions, sort is going to have pretty complicated signature. In general Clojure code is more flexible than typical Haskell code and thus the signatures tend to be somewhat sophisticated.

12:34 phalphalak: i was kinda shocked about what steward halloway said about static typing at euroclojure after I realized that he maybe wasn't being sarcastic anymore

12:34 uvtc: coventry, Ok. Thanks.

12:34 clgv: phalphalak: what did he say?

12:35 coventry: uvtc: There's like a 5% probability that I have the wrong talk, too.

12:35 phalphalak: clgv: "Static Typing is an academical experiment only suitable for small projects."

12:35 dnolen: dav: as far Haskell vs. Clojure ... they share the same deep principles about how to write good software - immutability, functional programming. Things start diverging pretty quickly after that.

12:35 bbloom: phalphalak: are you talking about his tongue-in-cheek "how to increase job security" talk?

12:35 coventry: uvtc: (But I know he said it, because mystifying compiler errors have been a pain point for me, so it stood out. :-)

12:35 phalphalak: bbloom: we were not sure if he was still being sarcastic or not

12:35 bbloom: but yeah, this talk

12:36 indigo: coventry: I think it's a pain point for everyone

12:37 bbloom: indigo: *shrug* i'm not saying the errors couldn't be better... all i'm saying is that i've seen worse :-P

12:37 indigo: Haha

12:37 uvtc: coventry, the "Design, Composition and Performance" talk is the one where I take a break mid-way through to hear what this "Coltrane" is all about. :)

12:37 indigo: Same here... PHP... *shakes fist*

12:37 coventry: indigo: Some of them are hard to fix while preserving the value of keeping clojure simple. See the patches and discussion in http://dev.clojure.org/jira/browse/CLJ-1279 for instance. (Maybe less hard for someone more experienced than me.)

12:38 indigo: Ah

12:38 Basically, compilers are hard

12:39 bbloom: compilers are hard for many of the same reasons that type systems are complex ;-)

12:39 compilers are about exploiting static properties to perform translations which achieve fast performing, correct code without breaking operational semantics or dev workflows

12:39 indigo: Lots and lots of edge cases

12:39 bbloom: indeed

12:40 justin_smith: indigo: I found the perfect metaphor for PHP today, it's a German idiom: teh wooly egg-laying milkable pig http://commons.wikimedia.org/wiki/File:Wollmilchsau.jpg

12:40 bbloom: especially with an unwilling host

12:40 justin_smith: lol, i'm not sure how that applies, but it's awesome

12:40 wakeup: justin_smith: No that means many uses

12:40 justin_smith: too many :)

12:40 ball of mud

12:40 indigo: Meh... PHP doesn't have many uses

12:40 wakeup: justin_smith: PHP is just a shitstorm of legendary proportions

12:40 indigo: (outside of webdev)

12:41 justin_smith: maybe ruby was the right example - I just saw the thing and it made me think of a poorly designed programming language (throw a little of everything in there...)

12:41 wakeup: I thought ruby was php6?

12:41 indigo: Ruby is Perl6

12:41 Node.js is php6

12:41 wakeup: haha

12:42 but you guys

12:42 clojure is kind of the PHP of lisps ;)

12:42 coventry: perl6 is perl6, but the iron is no longer hot. :-)

12:43 uvtc: indigo, Perl 6 is Perl 6. Ruby seems pretty Perlish though.

12:43 justin_smith: wakeup: php doesn't even have a parser, it just evaluates line by line

12:43 I think clojure hits a slightly higher standard than that

12:43 teslanick: That's not really fair to node: php has a sprawling, inconsistent API. Node is tight and fairly consistent.

12:44 indigo: Haha I guess

12:44 And also Node is designed to run for a long time

12:44 If you run a PHP process for a while you will get memory leaks

12:44 teslanick: And it's unreasonably hard to write HTML in node. :)

12:44 In PHP it's just a ?> away.

12:45 indigo: wakeup: CL is the PHP of lisps

12:46 TimMc: justin_smith: "Ovogena lano-lakto-porko" in Esperanto :-D

12:46 phalphalak: indigo: if CL is the PHP of lisps then I can't wait to get my hands on the ruby of lisps

12:46 wink: teslanick: it's only semi-inconsistent. It's consistent with the c libs below

12:47 indigo: phalphalak: That's probably going to be Clojure

12:47 coventry: I guess hy is the de facto python of lisps.

12:47 teslanick: wink: There's such a thing as semi-inconsistent? Wouldn't semi-inconsistency actually be meta-inconsistency? It's inconsistent about being inconsistent.

12:48 wink: justin_smith: not sure if you're just trolling, but have you seen http://git.php.net/?p=php-src.git;a=blob_plain;f=Zend/zend_language_parser.y;hb=HEAD ?

12:48 justin_smith: wink: perhaps I was misinformed, not trying to troll at all

12:48 wink: teslanick: interesting question :) I was just refuting a "seemingly random" API, it's not consistent in itself, but consistent towards its abstractions

12:49 teslanick: like the needle/haystack argument. all string funcs are consistent, and all array ones as well - but reversed order when compared between each other

12:49 justin_smith: wink: what about the naming and arg order conventions - or is that all reflecting the c apis?

12:50 wink: justin_smith: mostly from the c apis, yes

12:50 ToxicFrog: coventry: in principle, it seems like you could get 90% of the way there by having the compiler throw ClojureCompilerError instead of whatever it throws now, and at catch time handling that differently from a "normal" exception (i.e. don't vomit the compiler's entire stack to the terminal)

12:50 wink: I am not saying there are NO inconsistencies, I really don't know if.

12:50 ToxicFrog: The hard part is fixing all the existing throws.

12:51 teslanick: wink: I was mostly making a joke. It's been so long since I've programmed in PHP that I've forgotten most of the horrors contained within.

12:52 wink: teslanick: PHP has enough real problems, so I try to dismantle the false ones :)

12:52 coventry: ToxicFrog: The difficulty is that at the time the ArityException is thrown, you're in a function call and have no way of determining whether the function is being called as a macro.

12:53 ToxicFrog: You can catch it in macroexpand1 and re-wrap it in a CompilerException, and just ignore the fact that the reported arity will be wrong in many circumstances. I have been thinking of submitting a patch like that.

12:53 ToxicFrog: You could just add a warning to the exception message "The arity may be off by two", I guess. :-)

12:55 wink: I was playing around with DrRacket last weekend, somehow it's neat

12:56 muhoo: keep having to go back to the well on that: http://perevodik.net/en/posts/39/

12:57 xuser: wink: the repl in DrRacket is great and easy to start with

12:58 teslanick: muhoo: So mean to javascript

12:58 ToxicFrog: coventry: personally, I would consider the occasional incorrect arity acceptable (it's not like compilers for other languages don't often have off-by-n errors on which line the error occurred on!) if it meant the output was [location: error] rather than [location: error, 50+ lines of stack trace]

12:58 wink: xuser: actually I started implementing a web app, as usual :P

12:58 ToxicFrog: That said, I'm speaking about compiler exceptions in general, not the macroexpand ArityException in specific.

13:00 xuser: wink: cool, you following the web application tutorial on racket's website?

13:02 wink: xuser: yeah, started with that and then expanded. it was only some sort of reading HTTP Headers from EVE Online's ingame browser.

13:02 technomancy: wink: the racket guys bend over backwards for usability; it's really commendable

13:05 xuser: technomancy: can lein run standalone clj files? like in 'java -cp clojure-1.5.1.jar clojure.main test.clj'

13:05 makkalot: hi, is there a way to get string name of an atom, (def t (atom 1)) ?

13:05 technomancy: xuser: sure; `lein run -m clojure.main/main -i test.clj`

13:06 xuser: you can set up an alias for that in your user profile if you use it a lot

13:06 makkalot: atoms don't have names; vars do

13:06 makkalot: technomancy, ok what is the way to do for vars ?

13:07 xuser: technomancy: great, gonna check out how to set up the alias cause that's not any shorter than the java version ;)

13:07 technomancy: ,(-> #'clojure.core/reduce meta :name) ; <- makkalot

13:07 clojurebot: reduce

13:08 technomancy: xuser: it's shorter if you need the project classpath

13:08 makkalot: technomancy, great thanks

13:13 muhoo: oh, dr. racket used to be dr. scheme, i remember that

13:20 makkalot: it seems #'obj doesn't work in clojurescript ?

13:20 technomancy: makkalot: correct; clojurescript lacks vars

13:20 part of the reason I don't use it

13:20 bbloom: lol

13:20 oh technomancy...

13:20 makkalot: i see :)

13:21 bbloom: i've been pushing dnolen for vars, even half-assed vars that would let #' work for the extra indirection during development

13:21 but no luck yet

13:21 technomancy: bbloom: well not the main reason, but vars are my favourite clojure feature more or less

13:21 bbloom: technomancy: i've heard you say something to that effect before, but i'm not quite sure i've heard your justification

13:22 can i prompt a rant?

13:22 * arrdem grabs a chair

13:22 arrdem: dis gon b gud

13:22 technomancy: well, philosophically the whole point vars exist is to support interactive development and reloading, which is the most important thing I look for in a language

13:23 I know clojurescript supports this now, but it wasn't designed that way from the start, which rubs me the wrong way

13:23 clgv: are there any threading macro implementations with a fork-join-metaphor?

13:23 bbloom: clojurescript accomplishes the same goal with a different technique

13:23 namely: it always looks up vars by fully qualified dotted paths to mutable objects that act as namespaces

13:24 technomancy: I also like the neat insane hacks you can do with vars like robert-hooke

13:24 bbloom: haha, fair enough

13:24 technomancy: and the fact that they can contain metadata is huge for tooling

13:24 dnolen: technomancy: what you're saying barely makes sense. the only thing you can't do w/o vars is convenient namespace level metaprogramming. 90% of which you can accomplish via the macro + analyzer.

13:24 clgv: starting with the same value, splitting up into n code paths manipulating the data differently and finally joining it with a given function/expression

13:24 bbloom: i've spent some time thinking about what live programming looks like with static name resolution, if it's at all even possible

13:25 dnolen: technomancy: an in fact meta programming in CLJS can be even more convenient since you can get the entire compilation environment as a MAP

13:25 bbloom: dnolen had the seed of a great idea when talking about session w/ kovas over some drinks

13:25 technomancy: dnolen: I took bbloom's question as a request to cover what I like about clojure vars, not a request to rant about clojurescript, which I know little about

13:25 bbloom: the idea of a "notebook" being in "draft mode" is similar in many ways to the notion of compile vs run time

13:25 dnolen: technomancy: yes but most of what you said just sounds inaccurate

13:26 technomancy: bbloom: test selectors and nrepl-discover are both built on var metadata

13:26 bbloom: technomancy: cljs can do that with the namespaces atom, it holds the same metadata

13:27 technomancy: bbloom: also I come from elisp with its weird symbol-table that's kind of a no-mans-land; the fact that vars are very first-class and act in ways you expect if you're familiar with other c.l.IDerefs is great

13:27 bbloom: technomancy: it's just decoupled from the objects themselves, b/c it's only available on one side of the environment stratification boundary

13:32 TimMc: Does CLJS have dynamic scope for vars?

13:33 dnolen: TimMc: for those declared ^:dynamic

13:34 mdrogalis: Ricon is on live if anyone is interested.

13:35 bbloom: TimMc: but you can't capture the dynamic scope with bound-fn, etc

13:43 coventry: What is Ricon?

13:44 NM, http://ricon.io/east.html I guess.

13:46 makkalot: is there a way i can write unittests for my clojurescript code ?

13:47 dnolen: makkalot: https://github.com/cemerick/clojurescript.test

13:47 makkalot: dnolen, great thanks

13:48 uvtc: What is the purpose of the `num` function? What exactly does it coerce into a number? (I notice, for example, that it won't convert a string to a number.)

13:48 mdrogalis: First Ricon talk is pretty funny.

13:49 makkalot: http://ricon.io/live.html

13:52 joegallo: uvtc: looks like it coerces numeric primitives to java.lang.Number, and such like

13:53 justin_smith: ,(num (/ 4 3))

13:53 clojurebot: 4/3

13:53 justin_smith: (doc num)

13:53 clojurebot: "([x]); Coerce to Number"

13:55 uvtc: justin_smith, but `(/ 4 3)`already gives me that ratio of 4/3... I'm squinting at that docstring... I guess I don't see where you'd need to use `num`.

13:55 justin_smith: yeah, I am trying to figure that out myself

13:55 ,(source num)

13:55 clojurebot: #<SecurityException java.lang.SecurityException: denied>

13:56 justin_smith: meh

13:56 the source is not very revealing either

13:56 "The num coercion function boxes primitives to force generic arithmetic"

13:57 it can be used when you have an unboxed input and need to guerantee you have the general boxed version

13:57 http://clojure.org/java_interop

13:57 uvtc: justin_smith, Mm. Thanks.

13:58 justin_smith: so it is the oposite of int / long etc. (which create unboxed)

13:58 mdrogalis: This speaker is so intense.

13:58 uvtc: mdrogalis, turn down the volume.

13:58 ;)

13:58 bja: is there a way to verify the version of some library that is being used beyond lein classpath and lein deps :tree

13:58 mdrogalis: It's in his voice, it ain't going away! uvtc

13:58 coventry: mdrogalis: It sounds a lot like datomic, actually. :-)

13:58 clojurebot: It's greek to me.

13:59 mdrogalis: Indeed. I can't give my complete concentration to it, but vaguely it does.

13:59 Bronsa: uvtc: justin_smith ##(double (/ 2 3))

13:59 lazybot: ⇒ 0.6666666666666667

14:00 llasram: bja: What more confirmation would you want?

14:00 Bronsa: uvtc: nevermind, I thought you were asking something else

14:00 llasram: You could dump the classpath from inside your JVM

14:01 bja: well, I'm trying to use clojurescript 1978, which depends on tools.reader 0.7.10

14:01 justin_smith: Bronsa: yeah, I was just experimenting with num, ratio behavior was an acid test

14:01 bja: it needs a var called *alias-map*

14:01 but I can't find it

14:01 justin_smith: but now that I know it is for boxing it all makes sense

14:01 bja: in my repl and clojurescript complains about not having it

14:01 but clearly tools.reader 0.7.10 is the only thing on my classpath and the only thing mentioned in my deps :tree

14:02 so I'm wondering if lein deps :tree is missing some transitive dependency

14:04 Bronsa: bja: tried a lein clean?

14:07 bja: Bronsa: I have. I also tried killing my .m2 directory

14:07 to make sure I had no random deps lying around

14:08 after rerunning something that triggers lein deps, I do see a 0.7.10 entry in my .m2

14:08 but clojure.core/ns-publics tells me that I'm missing things from clojure.tools.reader

14:09 Bronsa: bja: can you paste your project.clj?

14:10 bja: hmm

14:10 makkalot: is it possible sometimes not to call waches on an atom ?

14:11 bja: well, I isolated the issue, and it is a transitive dependency problem. in a non-public library, we reference tools.reader

14:11 when I was removing that line to make a gist

14:11 I found my *alias-map*

14:12 shaungilchrist: hah just have to say cljs source maps are a thing of real beauty!

14:13 coventry: makkalot: What are you trying to do?

14:13 konr: just a curiosity: what do you use at work? Scrum, Kanban, PMF?

14:13 apricots: hi, what's the most like a Datomic but open source?

14:13 mdrogalis: Anyone watching Ricon: This guy's life seems *so* hard o.o

14:14 makkalot: coventry, i change a value of atom and notify some other parts of application, but sometimes i don't want to notify

14:14 pisketti: konr: what's PMF?

14:14 konr: pisketti: http://programming-motherfucker.com/ :)

14:15 coventry: makkalot: Compose the notification fn with something which decides when to notify.

14:15 pisketti: konr: aah, ok 8)

14:15 That would be optimal

14:15 I saw a great t-shirt on an agile conference last year..

14:15 mdrogalis: apricots: Apparently what's being talked about at Ricon right now, heh

14:15 pisketti: It said: "I code while you Agile"

14:16 mdrogalis: Actually it's not open source. But they're similar.

14:16 konr: pisketti: awesome :)

14:17 apricots: Raik 2.0?

14:18 mdrogalis: Something called Keystone.

14:18 makkalot: coventry, but is there a way to pass some extra info to notify fn so i can tell it not to send the notification ?

14:22 coventry: makkalot: Not via the add-watch mechanism. What are you really trying to do?

14:22 makkalot: coventry, i have 2 systems that notify each others, so trying to escape from infinite loop notification

14:23 probably direct atom operations are not good fit for that

14:24 coventry, when a changes i want to change b and when b changes want to change a

14:30 coventry: makkalot: Rather than using watches, I would put responsibility for changing a and b in straight functions which update both states according to your rules.

14:31 makkalot: coventry, yeah probably that is better way

14:36 mmitchell: technomancy: Hi. Is it possible to create a leiningen "alias" that includes a "do" for running multiple tasks? I can't get it to work, so maybe it's not support or I'm doing it wrong?

14:36 hyPiRion: mmitchell: sure. :aliases {"alias" ["do" "task1," "task2"]}

14:37 mmitchell: ahh, the comma!

14:37 technomancy: mmitchell: relevant: https://github.com/technomancy/leiningen/issues/1359

14:37 coming in 2.3.4

14:37 will make that less confusing

14:37 mmitchell: technomancy: awesome

14:40 gtrak: are cljs macros cljs-namespace aware? If-not, I'm wondering if I could do symbol resolution hacks on bbloom's backtick lib to make it so :-).

14:42 dnolen: gtrak: they are not cljs-namespace aware. Would be a nice enhancement for CLJS to have it's own macro expander to fix this wart.

14:43 gtrak: eventually it'll have to happen anyway

14:44 gtrak: yea, I'm wondering if there's any quick-hits to be made. I miss the ability to decompose macros into functions and wrappers.

14:45 but cljs can't call the function-version in the clj, and the clj-macro can't easily see functions in the cljs, so it would just be terribly awkward.

14:47 looking at the design page, though ;-)

14:47 dnolen: gtrak: cljs not being able to call the function version is not particularly important, and the second issue is trivial, the macro can see anything the compiler has seen

14:47 gtrak: if you fully-qualify it?

14:47 bitemyapp: technomancy: good news: chrishouser: @bitemyapp You can use the name with my blessing iff the stack trace is entirely converted to edn before any processing. :-)

14:48 technomancy: bitemyapp: ahaha

14:48 doesn't it do that already?

14:48 dnolen: gtrak: no, the macro can just take the namespace atom from the analyzer and look it + whatever namespace you are currently in to properly resolve everything at expansion time just like Clojure

14:48 technomancy: surely he doesn't mean serialized to edn and then read back in again

14:48 bitemyapp: technomancy: it's so strange to me that somebody like Houser has to get permission to release code, yet I'm trusted implicitly to know what I can and cannot open source at my company.

14:49 technomancy: bitemyapp: I will never understand The Enterprise

14:49 gtrak: dnolen: gotcha, I knew there had to be some accessible state, somewhere.

14:49 technomancy: (other than NCC1701[-az])

14:49 regex fail; oops

14:49 arunkn: Just noticed something strange

14:49 (println "keyword = " (str (keyword "hello")) "- kkword:" (str (keyword (keyword "hello"))))

14:50 prints

14:50 keyword = :hello - kkword: :hello

14:50 bitemyapp: ,(println "keyword = " (str (keyword "hello")) "- kkword:" (str (keyword (keyword "hello"))))

14:50 clojurebot: keyword = :hello - kkword: :hello\n

14:50 arunkn: in clojure

14:50 bitemyapp: if you'd just provided a comma at the beginning we wouldn't have to take your word for it on what it prints.

14:50 arunkn: :hello - kkword: ::hello

14:50 technomancy: bitemyapp: though I'm not sure how to justify a rename without putting a ton of work into it

14:50 arunkn: in clojurescript

14:50 bitemyapp: thanks for the tip

14:51 bitemyapp: technomancy: Me either, but I found a nice stack trace prettification (not elision, just chunking and organizing) library so there's some material that could be integrated together.

14:51 I'm mostly musing on it, my active project right now is Revise, anything OSS that I do will have to follow that.

14:51 arunkn: ,(keyword (keyword "hello"))

14:51 clojurebot: :hello

14:51 arrdem: bitemyapp: longbottom. really.

14:52 bitemyapp: arrdem: Really.

14:52 technomancy: bitemyapp: the one that assumes you have a 30-inch display and don't use a window manager?

14:52 arunkn: in clojure and it returns

14:52 ::hello in clojurescript

14:52 arrdem: (inc bitemyapp)

14:52 lazybot: ⇒ 8

14:52 arunkn: any reason?

14:52 bitemyapp: technomancy: I didn't plan to use width in the same manner, just draw inspiration from the "separation"

14:52 arunkn: the bot is for explaining things, but please don't use it as a personal REPL.

14:53 arunkn: no, i am not. just trying to point out the weirdness I am seeing

14:53 technomancy: bitemyapp: cool. if something happens I'll be happy to point to it from the clj-stacktrace readme

14:53 bitemyapp: technomancy: I'm hoping to get a co-author on this one too, in case anybody else is equally inspired by easier to read stacktraces.

14:54 I'm with Houser and Sierra that elision isn't a good idea, but emphasis and organization can go a long way.

14:54 technomancy: bitemyapp: pluggable elision seems like a pretty obvious win

14:54 bitemyapp: as long as it's optional, yeah.

14:54 technomancy: defaults will undoubtedly be contentious

14:55 wouldn't be horrible to default to "I'm actively working on the clojure compiler" mode as long as "application developer" mode is just a one-liner.

14:55 * bitemyapp nods

14:55 bitemyapp: I think elision can be pulled off successfully for most application development.

14:56 technomancy: of course you'd have to be able to swap it out at runtime

14:56 bitemyapp: stacktrace retention and "replay" would be nice, because if you get an elided stacktrace that you think is missing something, you can just request a full replay of it.

14:56 technomancy: I haven't found a great solution for configuring small libs like that. the temptation is to put it in the user profile of lein, but that's pretty clearly wrong

14:56 proliferating tiny config files isn't great either

14:57 so far I have punted on slamhound

14:57 but it has the same problem

14:57 bitemyapp: technomancy: I have a pretty good pattern (imho) for this in bulwark that I have some ideas for improving upon.

14:57 (closures || atom) ++ environment variables

14:58 technomancy: env vars are super annoying for development tho

14:58 since they're immutable

14:58 bitemyapp: technomancy: precedence. env vars are lowest precedence.

14:58 muhoo: weavejester's environs lib is nic3

14:58 bitemyapp: technomancy: closures override atoms override env

14:59 technomancy: when I use env vars I typically end up hard-coding the default dev-appropriate values into the codebase so I can change them with reloads

14:59 bitemyapp: muhoo: environ* - I'm a massive fan of it.

14:59 technomancy: even with environ

14:59 bitemyapp: it's more pliable than I think you're imagining.

15:00 justin_smith: I don't like environ because I find it helpful to run two different configs in parallel and environ uses the fs so it isn't reentrant

15:00 technomancy: bitemyapp: I know I can go in an edit the .lein-env file and trigger a reload of environ, but it's cumbersome and error-prone

15:00 justin_smith: which means what, check out my repo twice?

15:00 gtrak: dnolen: looking at the macros design page, it seems the issues for a complete solution are &form and &env, and hacking the clojure-reader? Plus backends for repls?

15:00 bitemyapp: that's...not how you're supposed to use it :|

15:00 you're missing that I said env vars were lowest precedence.

15:00 uvtc: Regarding stacktraces, would love to see nicely aligned and color-coded stacktraces...

15:01 dnolen: gtrak: link?

15:01 gtrak: http://dev.clojure.org/display/design/Macros

15:01 technomancy: bitemyapp: sure; I haven't used your system; just saying this is a problem with environ

15:01 bitemyapp: you're supposed to configure behavior by either changing the atom or creating new instances from closures.

15:01 technomancy: bitemyapp: this is something nrepl-discover would be nice for

15:01 bitemyapp: the env vars are just a way to set/override defaults from the outside world.

15:02 but the code is king, so to speak.

15:02 technomancy: M-x nrepl-config-set instead of hunting around for an atom somewhere with tab completion

15:02 sritchie: when you guys build apps w/ cljsbuild and generate js,

15:02 is best practice to generate smaller js targets, rather than 1 big one?

15:02 this isn't a single page app -

15:02 technomancy: bitemyapp: but having an override atom is a lot better than raw environ

15:03 sritchie: rather, I'd have a javascript embed on one page, and a chat-like page on another html page… that sort of pattern

15:03 bitemyapp: sritchie: I think most people do one big target + routing for nice caching, but it can make sense to split it up. It just usually isn't worth bothering with.

15:03 sritchie: I think people don't really want to have to change their templates much.

15:03 sritchie: gotcha

15:03 what do you mean by routing?

15:03 dnolen: gtrak: that design page is awful, I would not refer to it

15:03 bitemyapp: technomancy: and having closures is better than only being allowed singleton global config.

15:03 sritchie: bitemyapp: wrt the generated js files

15:03 bitemyapp: sritchie: client-side apps use routing to determine what logic gets triggered where.

15:04 technomancy: bitemyapp: sounds better, but in my limited experience I haven't felt that particular pain point yet =)

15:04 bitemyapp: sritchie: routing is how you handle having the logic for multiple pages in one file.

15:04 technomancy: it's amazing for testing.

15:04 sritchie: gotcha

15:04 okay, cool

15:04 bitemyapp: it's a brave new world here on the front end :)

15:04 bitemyapp: technomancy: it's just cleaner/more FP, and I don't really like singleton libraries even if there are constraints making it so anyway.

15:05 I try not to presume I can imagine every possible use-case and try to provide for non-singleton use-cases modulo simplicity of the code.

15:05 technomancy: conceptually I am on board =)

15:05 bitemyapp: Cool.

15:05 I'll try to meditate on what sort of behavior is desirable/doable.

15:05 technomancy: what's the typical width of your terminals?

15:06 technomancy: bitemyapp: 78 in X, 87 in a terminal

15:07 bitemyapp: damned close to 80. I wonder what my width was in Xmonad. More than that I think because I use honkin' big monitors.

15:07 I need to get one o' them 4k thing-joggers so I can pretend I live in the Matrix.

15:07 technomancy: yeah, that's my minimum when I'm away from home

15:07 which is ~twice a week

15:08 I got to try an oculous over th eweekend

15:08 bitemyapp: sritchie: with lein cljsbuild, did you run into this error perchance? Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context

15:08 technomancy: oh cool, how was that?

15:08 sritchie: I haven't seen that one before

15:08 technomancy: trippy stuff. makes me wonder how long till we have WMs with free-floating workspaces rather than fixed 1-9.

15:09 bitemyapp: it doesn't work that well with existing 3D exploration input

15:09 justin_smith: technomancy: map workspace to the actual architecture of your house

15:09 technomancy: since the mouse overlaps with te functionality of the turn sensors

15:09 * musicalchair can't wait for 3D workspaces

15:09 justin_smith: reddit in the bathroom workspace, youtube in the kitchen workspace, work related stuff in the office workspace

15:09 tbaldridge: technomancy: I've heard the older models of the oculous was too low res for working with text/code. Is it any better now?

15:10 technomancy: justin_smith: https://mobile.twitter.com/HardSciFiMovies/status/395187189492903936?p

15:10 rasmusto: tbaldridge: the new one isn't available yet, is it?

15:10 bitemyapp: tbaldridge: I think they're still on the same revision.

15:10 technomancy: tbaldridge: it's too low-res for code if you don't have a free-floating WM

15:10 rasmusto: tbaldridge: first gen is definitely not suited for text

15:11 tbaldridge: ah, I thought they had released the new version.

15:11 technomancy: tbaldridge: if you were able to pan around your single huge workspace by moving your head, I think the current res could be suitable

15:11 bitemyapp: It amuses me that the 3d file explorer

15:11 rasmusto: they're showing it off now, but you can't get it

15:11 bitemyapp: in Jurassic Park is ridiculed as an example of silly Hollywood, but it was a real Unix app/

15:11 shaungilchrist: I think you could use computercraft with it and that is good enough for me

15:11 wink: silly as in: not really usable maybe?

15:11 tbaldridge: bitemyapp: yep, and it ran on SGI workstations, the most awesome machines ever made by man, IMO.

15:12 rasmusto: technomancy: oculus rift can replace wobbly windows and 3d desktop cube imo

15:12 technomancy: tbaldridge: better than symbolics machines? *gasp*

15:12 rasmusto: exactly; if it were a free plane rather than distinct workspaces

15:13 bitemyapp: if the free-floating could be made to work efficiently (minimum of motion) that could be neat

15:13 sritchie: bitemyapp: so, quick follow up

15:13 bitemyapp: but I have a hard time imagining how it could be made more efficient than Xmonad.

15:13 sritchie: so if everyone has some JS business,

15:13 technomancy: bitemyapp: right; like a binding to toggle "locking" to a specific position

15:13 sritchie: bitemyapp: then you just need to be disciplined about your divs, I suppose?

15:13 rasmusto: technomancy: i guess one of the weird things about current workspaces is that they're max-resolution at all points, and don't dynamically change based on what you're looking at

15:13 technomancy: bitemyapp: the advantage is it could have a much larger effective surface area

15:14 rasmusto: I could see them using head-tracking to sort of give you a "resolution fisheye lens" for looking at details/text

15:14 bitemyapp: sritchie: 'ish. The simplest thing to do is to have a universal singleton "content" div into whom each page is injected.

15:14 technomancy: rasmusto: since your brain already does that with color/detail =)

15:14 sritchie: bitemyapp: so, say, in form validation, you don't grab hold of some form on the wrong page

15:14 bitemyapp: sritchie: Example of a router, I know of it from the author: https://github.com/gf3/secretary

15:14 sritchie: you use routing to avoid mis-applied logic.

15:14 rasmusto: technomancy: make the technology match the brain

15:14 bitemyapp: the DOM only needs to be consistent insofar as you maintain an injectable container.

15:14 technomancy: rasmusto: you can't do that with head position alone though; you need eye tracking

15:15 difficult to do both at the same time

15:15 bitemyapp: you do not rely on a universal DOM structure and shouldn't be misfiring logic.

15:15 rasmusto: technomancy: I think carmack is shooting lasers into his eyes as we speak to try and make thing a reality

15:15 technomancy: rasmusto: I believe it =)

15:16 rasmusto: pretty sure I skipped a few words in that last sentence

15:16 * technomancy will be OK waiting half a decade for free drivers anyway but has fun idly discussing it

15:17 bitemyapp: if I have :source-paths ["src" "src/clj"] in my Leiningen, and I have a namespace like src/clj/blah/woot/baz then blah.woot.baz without clj in front of it should work right?

15:17 gf3: bitemyapp, sritchie: Example of using the router with HTML5 history: https://gist.github.com/noprompt/6775563

15:17 bitemyapp: sritchie: did you see my question about the error? I can't lein cljsbuild to work.

15:17 technomancy: huh; source is available, but it only builds with visual studio: https://github.com/cybereality/Perception

15:17 bitemyapp: gf3: thank you

15:17 technomancy: better than I expected actually

15:17 sritchie: bitemyapp: yeah, I haven't seen that error before -

15:17 bitemyapp: gf3: what's the Google Closure way to trigger the routing on page load?

15:17 sritchie: I'm on lein 2.3.3, using :plugins [[lein-cljsbuild "0.3.4"]]

15:17 rasmusto: technomancy: ah, this is that game wrapper, right?

15:18 technomancy: rasmusto: uh no idea; I just searched and clicked on the top hit

15:18 bitemyapp: sritchie: what version of clojurescript?

15:18 technomancy: =)

15:18 bitemyapp: gf3: and have you seen this error when running lein cljsbuild? - Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: reader/*alias-map* in this context

15:18 sritchie: [org.clojure/clojurescript "0.0-1934"]

15:18 rasmusto: technomancy: there's a file called apihijack.cpp, I think this wraps directx

15:18 sritchie: [org.clojure/clojure "1.5.1"]

15:18 bitemyapp: okay, I'll go absorb the routing business -

15:18 bitemyapp: 1934 seems to work, 1978 broke my stuff.

15:19 sritchie: thanks!

15:19 clojurebot: I don't understand.

15:19 technomancy: rasmusto: so probably not useful from the perspective of a WM

15:19 gf3: bitemyapp: I haven't seen that before, no

15:19 technomancy: since it probably assumes the hardware drivers are present

15:19 gf3: bitemyapp: re: Google Closure, is it just (.setEnabled)?

15:19 rasmusto: yeah, I think this is suited for wrapping existing dx games

15:19 sritchie: bitemyapp: so, it seems like the short of it is that the routing allows the JS to stop certain side effects from registering callbacks before certain URIs load

15:19 bitemyapp: gf3: I dunno, I've only done pure JS.

15:19 sritchie: (and unregisters them when you leave those URIs)

15:19 bitemyapp: and very little Closure.

15:19 Bronsa: bitemyapp: make sure you are using tools.reader 0.7.10

15:20 gf3: bitemyapp: Yes, just confirmed, it's .setEnabled

15:20 http://docs.closure-library.googlecode.com/git/class_goog_history_Html5History.html

15:20 bitemyapp: gf3: oh no, I'm asking a more generic question than that, what's the page load trigger for fire off routing?

15:20 gf3: you know, like jQuery's $.ready

15:21 rasmusto: technomancy: leave it up to the community: http://hwahba.com/ibex/files/ibex-video-two.png

15:21 technomancy: https://bitbucket.org/druidsbane/ibex/overview

15:21 gf3: bitemyapp: Oh shit, I dunno, I just throw stuff at the end of where I need it (e.g.: body end)

15:22 rasmusto: now I can watch blender demos inside of vr in a quake 3 deathmatch arena

15:22 bitemyapp: gf3: errr. like you just call the cljs function at the end of the body in a script block to start the app?

15:23 technomancy: rasmusto: http://openhmd.net/

15:23 gf3: bitemyapp: Yeah, right at the top of your "core" module

15:24 bitemyapp: Bronsa: that fixed it, thank you!

15:28 rasmusto: technomancy: ah cool. It has quaternion math in it so I assume it works well

15:42 sritchie: bitemyapp: did you see that last Q I had? just want to make sure I've got this down -

15:43 I'm thinking of if, say, I generate similar forms in two different parts of the app

15:43 but I want to apply different validation logic to each

15:44 bitemyapp: it sounds like you're suggesting using routing to basically namespace the registered callback functions I use

15:44 bitemyapp: alternatively, if there were some token (or if I could get at the URI somehow), I could stick both the URI AND the event data onto my core.async channel

15:45 bitemyapp: and then have each local core.async event loop filter out events that it cares about

15:45 bitemyapp: is that off base?

15:50 I just got this error with cljsbuild, strangely: clojure.lang.ArityException: Wrong number of args (3) passed to: reader-types$indexing-push-back-reader

15:55 Bronsa: sritchie: *sigh*, cljs requires tools.reader 0.7.10, you have an older version on your classpath

15:56 staafl: say I have a bunch of helper functions, what's a good way to nest them inside the driver func?

15:57 sritchie: Bronsa: saw your note and updated

15:57 thanks!

15:58 Bronsa: np

15:59 gtrak: staafl: let, letfn, if you need to pass them around, a map maybe?

16:00 staafl: gtrak, thanks :-) letfn seems a bit unreadable to me, but maybe i'm just a rookie

16:01 and it's a bit of a chore to paste the helper definitions into the binding vector

16:01 gtrak: letfn's got a specific use-case that isn't obvious at first glance. fn can take a symbol to refer to itself, and letfn will make those visible to every function in the scope.

16:01 staafl: since I tend to write them separately for REPL testing, before merging into a the final function

16:02 amalloy: staafl: you can also just choose to not make the functions local, but put them into the namespace (private, if you like)

16:02 gtrak: staafl: with let, you simply remove the de and leave the fn :-)

16:02 yeoj___: if i start a development web server with lein ring server should i be able to connect to it with vim-fireplace? Is there a repl there?

16:03 gtrak: though you have to move the name araound

16:03 yeoj___: i'm having problems connecting

16:03 staafl: amalloy, hmm... is there an analogy to the revealing module pattern?

16:03 i.e. you surround a bunch of definitions in a scope, and only export some of them

16:05 gtrak: staafl: JS has a module pattern because JS doesn't have modules. Namespaces and defn- are enough for anything.

16:06 and they're required for niceties like autocompletion. I haven't ever really passed a bag of functions around in clojure.

16:07 staafl: gtrak, got it, thanks

16:08 noncom: hi, anyone familiar with graphics2d in seesaw ?

16:10 if i have a BufferedImage, the screenshot taken with Robot , how do I cut a rectangle from it and paste it into a Graphics2D on my apps frame?

16:10 i mean, what is the best seesaw way?

16:10 mdrogalis: You know what would be a great Twitter acount? @IrrelevantRichHickeyQuotes

16:16 xeqi: "Does anyone know how to make a line connect to a thing and stick?"

16:19 mdrogalis: Heh.

16:21 gfredericks: is there a name for (fn [f & gs] (fn [arg] (apply f (map #(% arg) gs))))?

16:22 justin_smith: make the map a mapv and then it has a hidden juxt in there

16:22 dobry-den: ztellman: In Gloss, I have a `header` that correctly encodes the body when the header byte is 0xfd, 0xfe, and 0xff. But is there a way to use the header itself as the body if it's not one of those 3 values?

16:22 stuartsierra: gfredericks: juxt

16:22 ztellman: dobry-den: header->body is a function, so you can have the body be whatever you want

16:22 including a static value

16:23 justin_smith: gfredericks: (fn [f & gs] (fn [arg] (apply f ((apply juxt gs) arg))))

16:37 uvtc: noncom, Sorry, no idea. Maybe post to the seesaw ML?

16:40 rhg135: has anybody here ever used cljs on node?

16:40 noncom: uvtc: well, i already figured it out :) I just use one java method call, (.drawImage ...) and seesaw example on canvas does such things too, so i think it is ok. at least if it would be smthing like (draw-image ...), it would not change much :D

16:40 justin_smith: noncom: not sure what is best, but the cropping can be done with the methods of BufferedImage

16:41 noncom: yeah, i know java side well, i think i'll just go with it, since seesaw does not look like it has much to image editing... but i'll go look docs and source more

16:41 dnolen: rhg135: ohpauleez has, Bodil, and a few others - CLJS Node support in general could use some love though

16:41 rhg135: i'm wondering if it's possible to run a repl

16:42 i already have the logic down but cba to write an ui

16:43 dnolen: rhg135: Bodil maintains a node-repl, https://github.com/bodil/cljs-noderepl

16:43 gf3: technomancy: A word of warning, I tweet mostly BS and ill-thought out jokes

16:43 rhg135: i saw that but i don't see how to load my code in that repl

16:44 coventry: Shocking. I go to twitter for the solid, well-considered content. I'm saddened to see it dragged down like that.

16:44 technomancy: gf3: I mostly take that as a given on twitter.

16:46 dnolen: rhg135: what do you mean load code?

16:46 rhg135: dnolen, i already have some code in clojurescript that works

16:47 dnolen: rhg135: I just don't know what you're asking.

16:47 staafl: how can I pinpoint the compilation error in the REPL?

16:47 "Don't know how to create ISeq from: clojure.lang.Symbol" doesn't tell me much

16:48 rhg135: i basically want to run a repl from my code

16:49 amalloy: staafl: that's what the line numbers are for. although, the most common cause of that particular exception is probably using (:require [foo.bar :refer baz]) instead of (:require [foo.bar :refer [baz]])

16:49 staafl: amalloy, thanks. the line numbers increase every time i paste a snippet and are impossible to follow

16:50 dnolen: rhg135: run a CLJS REPL from the CLJS code itself? not possible.

16:51 rhg135: dnolen, well in the broser you can emulate it by listening for connections

16:51 Jarda: dnolen: hi! May I disturb you a bit

16:52 dnolen: Jarda: just ask your question if you have one :)

16:52 bitemyapp: gf3: btw your halloween costume was a scream.

16:53 gf3: bitemyapp: Haaaah

16:53 Jarda: dnolen: I tried to add source map compilation to my cljsbuild configuration, but am having problems with the paths

16:53 bitemyapp: gf3: I loved the Fifth Element, the multi-pass thing made me giggle.

16:53 gf3: bitemyapp: My favourite shot: http://instagram.com/p/f-pD6TCauX/

16:53 bitemyapp: good lord LOL

16:54 gf3: Ahahahahhaa

16:55 Jarda: dnolen: I addes :ouput-to "resources/public/js/app.js", :source-map "resources/public/js/app.js.map" and it generated the comment to app.js with resources/public/js.. in the path

16:55 rhg135: dnolen, also i guess running a repl would work, but could i require my file?

16:55 Jarda: dnolen: so the browser of course didn't find as the http path would be /js/app.js.map

16:55 dnolen: rhg135: don't know but I would think cljs-node-repl can require files just like the Rhino one

16:56 Jarda: don't specify a path for :source-map, just the name of the file.

16:56 Jarda: dnolen: I thought I did that too, then the file got generated to project root

16:57 rhg135: ah

16:57 lemme try

16:57 dnolen: Jarda: feel free to file a ticket then, patch welcome - I got a pretty long list of things on my plate at this point as far as patches.

16:58 Jarda: dnolen: yeah I just saw your tweet about a new cljsbuild release so I thought I would ask if it's something I've misunderstood or a possible bug

16:58 I'll come up with a demo-project to attach to the issue

16:58 dnolen: Jarda: bugs most likely, there's a lot of new stuff around source maps and people are just now seriously trying to use it.

16:58 Jarda: sure, but seriously look at the source code, fix it submit a patch.

16:58 CLJS is not rocket science, the source maps path stuff is simple stuff.

16:59 Jarda: dnolen: ok, I'll promise to look at it (tomorrow)

16:59 bitemyapp: dnolen: the preferred terminology is "rocket surgery"

16:59 dnolen: Jarda: thanks, much appreciated and I'll apply it quickly if I get something.

16:59 bitemyapp: ever taken a scalpel to a warhead? Nerve-wracking.

16:59 Jarda: dnolen: so the correct place to look is in cljsbuild I guess?

16:59 or clojurescript core

17:00 justin_smith: ever try to troubleshoot the detonator on a brainstem?

17:00 dnolen: Jarda: no it's a CLJS compiler issue, look into closure.clj, we'll also need to fix compiler.clj, just grep for sourceMappingURL, there are two places to change the logic.

17:01 Jarda: dnolen: ok cool, I'll do it

17:10 rhg135: nope :c

17:11 i may have to redo this in jvm clojure

17:11 which im fine with but the startup delay is a problem for client apps

17:12 also the ram usage

17:19 hlship_: where's the best place to discuss multi-module lein projects?

17:27 stuartsierra: hlship_: #despair

17:27 hlship_: ... well, that's why I use Gradle for my big, big project.

17:28 llasram: geez

17:28 technomancy: afaik, "multi-module" is not a well-defined term. can you be more specific?

17:28 llasram: hlship_: Have you tried lein-sub? https://github.com/kumarshantanu/lein-sub

17:29 hlship_: well we have (with tests) about 1400 source files, 280K lines of code, in about 47 (mostly, small) modules

17:29 technomancy: in a single codebase?

17:30 hlship_: yes

17:30 that is, builds with a single command

17:30 hyPiRion: Of Clojure?

17:30 hlship_: each module is AOT compiled individually, and has own dependencies

17:30 yes this is 99% Clojure

17:30 technomancy: well lein might be able to provide some support, but at that point it's going to be a band-aid for deeper architectural issues

17:30 hlship_: perhaps the biggest Clojure project around

17:30 llasram: hlship_: Let me guess -- a starship?

17:30 hlship_: Part of my job now is to remove and simplify a lot of unnecessary code

17:30 It's a credit card switch

17:31 hyPiRion: Ah, I was about to guess that it was the healthcare.gov system rewritten in Clojure.

17:32 technomancy: hyPiRion: ahaha

17:32 tbaldridge: hyPiRion: nah....that'd only be about 10K lines of code.

17:32 hlship_: No, there's necessary complexity here. A switch has to be able to freely translate between all kinds of binary data formats used by various banks.

17:32 I'm actually in the middle of reworking the internals of it to use core.async.

17:32 And in fact, we'll probably stick with Gradle for the meantime.

17:32 hyPiRion: hlship_: yeah, that was more of a joke about healthcare.gov, not your system

17:32 technomancy: hlship_: lein-sub, private mvn repos, and checkouts are typically the building blocks upon which you structure systems which span multiple project.clj files

17:33 hlship_: But I'm also spinning off some of the code as open-source and for those parts I use lein.

17:33 technomancy: difficult to say more without knowing specifics about what you're finding tricky

17:33 hlship_: But Twixt, for example, should be a number of "al la carte" modules that I'd prefer to build, version, and deploy as a unit.

17:33 tbaldridge: yeah, I've worked on projects that break the software into 20 different project.clj modules that each have their own release numbers, I was pretty happy with that.

17:34 sritchie: any austin users?

17:34 I'm seeing stackoverflowerror at (cemerick.austin/repl-env)

17:34 StackOverflowError java.lang.ClassLoader.getResource (ClassLoader.java:1134)

17:34 justin_smith: tbaldridge: all in one repo?

17:34 hlship_: talbridge: I think you forgot your <sarcasm> tag

17:34 tbaldridge: nope, 1 repo per project

17:34 justin_smith: tbaldridge: I bet a lot of work went into keeping the apis between them stable then>?

17:35 tbaldridge: true modules should be modular enough that a release of one module shouldn't take a massive rewrite of all the other modules.

17:35 hlship_: Part of what I'm looking for in multiple projects is information sharing between the parent project.clj and the individual modules.

17:35 technomancy: hlship_: for a long time there was no good programmatic way to manipulate defproject forms (preserving comments, etc) making automated version bumps difficult

17:35 hiredman: a project object model

17:35 technomancy: now we have sjacket, but no one's done the plumbing to apply it to version bumps yet

17:35 * znDuff is actually a substantial fan of Maven for larger projects.

17:35 technomancy: I don't expect it would be difficult

17:36 hlship_: Generally not a massive rewrite, but I want to avoid the Hibernate style versioning where you need a complex chart to guess at which versions form a compatible whole.

17:36 In the Tapestry world, I'm quite happy to change the version number across all modules, including ones that have not in any way changed, just so I can use a single verison number for a consistent system.

17:36 uvtc: Is there a standard function to print to stderr? Or do I do: `(binding [*out* *err*] (println ...)`?

17:36 hlship_: And identify that all of them were built and tested together.

17:36 * znDuff hates, hates, *hates* Gradle; a lot of that comes down to its decision to heavily leverage misfeatures of Groovy.

17:36 technomancy: znDuff: "if you have to get kicked in the shins, moccasins are great for that"

17:37 hlship_: Gradle has a kind of search path mechanism, where configuration data from a parent build script is accessible in the children.

17:37 So I specify the version number in exactly one place.

17:37 I also can do a lot of the shared dependency configuration at the master project level.

17:38 technomancy: hlship_: you can do that with shared project middleware; I think pallet uses that

17:38 hiredman: hlship_: I'm not sure I follow that, if you are deploying a service the output of the build is a tarball with all dependencies ready to run, if you are building a library you depend on a bit and get what you need from maven repos dependency wise, what do you need the chart for?

17:38 hlship_: Interesting; I'll take a peek at their source then. Good examples are enough.

17:40 hiredman: In the Hibernate world (as a terrific anti-example) when you upgrade one piece, say hibernate-search, you have to do a lot of hunting around to determine what other mix of dependencies actually work together. It's a mess.

17:40 technomancy: searching up for the version number sounds very iffy once it crosses git repo boundaries

17:41 I would hate to encourage projects that can't be built from a fresh checkout

17:41 hlship_: znDuff: I hate Maven with a passion and love Gradle, though it can be occasionally infuriating.

17:42 technomancy: You are correct; I would not want to coordinate version numbers across Git repos; but if I'm developing several closely related layers (such as Twixt, for example) I would prefer to have a single Git repo and single version number for the different layers that can be composed.

17:43 hiredman: hlship_: well hibernate is just horrible, a lot of old style java stuff is pretty bad about versions

17:43 technomancy: if you are asking for project info to come from somewhere other than the codebase you're going to have to give up determinism or that

17:43 hiredman: I can never figure out versions on jboss projects

17:43 technomancy: but inside one big repo seems reasonable

17:43 hiredman: but if it is your project you can do better

17:43 hlship_: technomancy: I think we're in agreement there.

17:44 znDuff: hlship_: I would need to spend a significant amount of time learning Groovy before I could give Gradle a genuinely fair shake.

17:44 hlship_: znDuff: That's a discussion for some other time/place.

17:44 znDuff: hlship_: ...in trying to use it thus far, it's been completely full of spooky action at a distance, where it wasn't clear from reading the code what given action a line would have.

17:45 technomancy: a central tenet of lein is that task execution should be a basically-pure function of the codebase, the (hopefully append-only) state of the referenced repositories, and CLI input

17:45 hlship_: I've done everything from GNU Makefiles, Ant, Maven 1 - 3, Rake, Lein and Gradle.

17:45 znDuff: (and reading the bytecode Gradle generated... *shudder*)

17:45 technomancy: the more you diverge from pure functions, the more hidden gotchas are going to come back to bite you eventually

17:45 ToBeReplaced: fwiw i found that :pedantic? :abort and every-subproject-gets-its-own-project-clj to be a smooth combination

17:46 hlship_: For most Clojure projects, Lein is perfect. But past a certain point, Gradle is my go-to choice.

17:46 ToBeReplaced: that plus lein ancient makes it easy to see when a subproject has been updated and when i've got a potentially breaking dependency mismatch

17:47 technomancy: this is a big controversy at work where some people want to introduce build config that would result in breaking the functional aspect of input -> artifacts

17:47 (mostly due to rails)

17:47 znDuff: hlship_: My title is "release engineer"; I've worked on a comparable number of build systems, and gradle is actually the only one that gets me quite -that- frustrated (though I'm pretty thoroughly unhappy with Ivy right this minute).

17:48 ...but yes, not the place and time.

17:48 * znDuff 's unhappiness with Ivy has rather a lot to do with the absentee maintainership; bloody impossible to get a patch through these days.

17:48 hlship_: Well, to each his own. I find Gradle lets me do what I need and largely gets out of the way. Also, it is actively maintained by non-lunatics, which puts it way ahead of Maven. And they eat their own dogfood.

17:50 technomancy: hlship_: would be interested in hearing whether you find project middleware suitable for your purposes

17:50 hlship_: Anyway, the thing for me to consider is if I really need coordinated version numbers. I prefer them.

17:50 AlienCat: hello

17:50 znDuff: hlship_: *shrug*. Compared to Ivy, Maven is -extremely- actively maintained. They've merged a few patches I submitted just over the last few weeks.

17:50 AlienCat: the counterclockwise thing

17:50 technomancy: it would certainly be easier with programmatic modifications to project.clj

17:50 AlienCat: is it supposed to work?

17:50 znDuff: hlship_: (...mind you, the need for those was unfortunate -- one of them was a fix for a shell injection vulnerability; *sigh*)

17:51 hiredman: hlship_: so how many common lisps are in 280k of clojure?

17:51 technomancy: been hoping someone would bash that out in a plugin, but maybe it's time to think about putting that into lein proper

17:51 AlienCat: no, it's a trap designed to trick IDE users into using scala

17:51 of course it's supposed to work

17:52 ~anyone

17:52 clojurebot: Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."

17:53 technomancy: znDuff: how do you have a shell injection vulnerability in a tool designed for arbitrary code execution?

17:53 genuine curiosity =)

17:53 znDuff: technomancy: it could execute code embedded in filenames.

17:54 technomancy: huh, interesting

17:55 difficult to imagine a scenario in which an attacker could control filenames but not bytecode to run, but better safe than sorry

17:55 AlienCat: well, "Waiting for new REPL process ack timed out" does not tell you much right? I roll with that example project and debugged it and all I got was that message

17:55 Just a plain "Clojure project"

17:55 technomancy: AlienCat: perhaps it is a Zen message designed to communicate your lack of patience

17:57 given that the primary maintainer resides in France, the mailing list would probably be more fruitful than IRC

17:57 AlienCat: I do not like mailing lists :'(

17:58 technomancy: you could try again at a more UTC-friendly time

17:59 znDuff: technomancy: I can certainly think of cases where an attacker could control code that would be run at execution-time but not at build-time absent the vulnerability.

17:59 technomancy: ...and if you're building code to be run in a sandbox...

18:00 AlienCat: I live in the UTC zone, well I might give google groups a shot

18:00 well actually, I even think counterclockwice have an own google group

18:01 clows: AlienCat: http://bit.ly/16Ifijx (google groups) maybe? seems a bit old but who knows

18:01 sritchie: bitemyapp: what are your thoughts on distinguishing dev mode from prod with a global atom?

18:02 hiredman: gross

18:02 sritchie: what's the best way to do this?

18:02 hiredman: here's my goal - cljsbuild is generating either gen-debug.js or gen.js

18:02 and I want to include the proper one

18:02 coventry: znDuff: What kind of problems are you working on? Sounds interesting.

18:02 technomancy: sritchie: prod vs dev is like browser-sniffing. check for specific feature config, not for one wide setting.

18:03 AlienCat: wait a minute, isn't google groups mailing lists? damn I tricked myself

18:03 hiredman: sritchie: carica is the config library we use at work, and I like how it works

18:03 technomancy: carica is great; check in dev defaults into dev-resources/config.clj and prod settings into resources/config.clj

18:03 hiredman: you have some set of default configs, which then your deployment can override by writing other configs to the classpath

18:03 sritchie: oh, wait, what am I doing, I've already got environ in here

18:03 nice

18:05 cemerick: sritchie: taking off, feel free to file an issue if you're still seeing the stackoverflow

18:05 sritchie: cemerick: yeah, it happens when I try to reconnect

18:05 got a NPE in a diff setting -

18:05 I can't figure out where it's coming from

18:05 but I'll keep pushing

18:06 technomancy: okay, awesome, carica is good. do you use carica and environ together?

18:06 bitemyapp: sritchie: very gross.

18:06 sritchie: haha, okay

18:06 bitemyapp: sritchie: I use environ, no carica.

18:06 znDuff: coventry: I'm at Indeed -- the job search engine. Big picture re: things we have going on, there's a blog at https://engineering.indeed.com/blog/

18:06 bitemyapp: sritchie: configuration is actually something I've spent a lot of time perfecting, let me put together a sanitized gist so you can see what I do.

18:07 sritchie: nice! thanks, bitemyapp

18:07 coventry: znDuff: Thanks.

18:08 technomancy: sritchie: I haven't worked on anything needing more than a handful of config vars in a while; so far just environ.

18:09 environ is obviously bad if you need anything more complicated than a single level of string->string mapping

18:09 sritchie: technomancy: but it seems clean to, say, use environ to flag PROD or DEV, and then have "prod" and "dev" maps w/ settings in carica, for example

18:10 ToBeReplaced: hm, carica is interesting -- idk when i'd use it though tbh

18:10 technomancy: sritchie: no, I would advise against that

18:10 sritchie: yeah?

18:10 technomancy: sritchie: if you use uberjars you don't need to do anything to flag prod

18:10 the fact of being an uberjar means that it can't see dev-resources

18:10 bitemyapp: sritchie: now I want you to keep in mind that this is a fairly "evolved" config that has grown organically, so it's not as simple as something in a freshly made application

18:10 sritchie: https://gist.github.com/bitemyapp/7223007

18:11 technomancy: if you use lein in production, you should use profiles

18:11 ToBeReplaced: i pass through jvm-opts to the :dev and :test profiles and pass them through on command line in production

18:11 sritchie: does lein load dev-resources after resources, always?

18:11 hiredman: ToBeReplaced: it is pulled out of a largish clojure app at work, it is all we use for configuration, but it is sort of of tied to how we deploy stuff using chef

18:11 bitemyapp: sritchie: a few things to note, they're not defs, they're all functions.

18:11 technomancy: sritchie: `lein with-profiles production trampoline run ...`

18:11 sritchie: yes

18:11 hiredman: but we have lots and lots and lots of configuration

18:11 bitemyapp: sritchie: it's just a config namespace with a primary function, "get-config"

18:11 technomancy: sritchie: dev-resources always "wins" if the dev profile is active

18:11 hiredman: "constants" all tend to end up in config

18:11 sritchie: and dev is active by default

18:11 okay

18:12 bitemyapp: sritchie: most of the fallbacks "(and ...)" are for standard dev environment stuff.

18:12 sritchie: technomancy: I'm on Heroku now, and using that method

18:12 bitemyapp: taking a look

18:12 technomancy: sritchie: cool. I recently made it a lot easier to use uberjars on heroku, so check that out if you start anything new or need to futz with it.

18:12 there aer a lot fewer ways to screw things up with uberjars

18:13 sritchie: technomancy: interesting, checking out the getting started now

18:13 bitemyapp: sritchie: https://gist.github.com/bitemyapp/7223050

18:13 sritchie: that's the environment file that gets sourced in the upstart init before running the jar, and the init script itself.

18:14 ToBeReplaced: hiredman: are the constants unique to each app/machine pair? i'm wondering when that approach is better than picking up values from a db

18:14 our deployment is small, so we basically just pass things like where are the logs, where is the database, etc.

18:14 sritchie: technomancy: so the default script now runs uberjar

18:14 hiredman: ToBeReplaced: it depends, I think you could pull it form a db, but they are static, so why?

18:14 bitemyapp: sritchie: the java -jar is a vanilla lein uberjar.

18:15 anybody interested in deploying Clojure apps really should look at those two gists I just posted.

18:15 sritchie: sure, but I see Running: lein uberjar in the heroku example,

18:15 bitemyapp: that's a lot of how I do it.

18:15 hiredman: we've actually talked very briefly about some kind of zookeeper backend for carica

18:15 bitemyapp: hiredman: if I used zookeeper, it would just replace the dev.env/prod.env files.

18:16 hiredman: very briefly and I doubt it will go anywhere

18:16 bitemyapp: and then I'd add a signal to trip the memoized data and re-load.

18:16 technomancy: sritchie: it runs uberjar if :uberjar-name is present

18:16 sritchie: okay, nice

18:17 ToBeReplaced: hiredman: yeah, we talked about using zookeeper and decided to delay b/c we don't need it, but that certainly influenced the decision to do lookup via database instead of passing in the config

18:17 technomancy: because you don't want the default uberjar name (which contains the version) since that would mean changing your Procfile for every version bump

18:17 sritchie: yup

18:17 ToBeReplaced: on the flipside it kinda sucks that our whole infrastructure has a db dep on startup

18:19 sritchie: for creating a production env, if you're relying on environment variables,

18:19 technomancy: is the preferred Heroku Way to keep a script in resources and source that?

18:19 before calling java -jar

18:20 technomancy: sritchie: not sure what you're asking

18:20 don't check production config into your repo

18:20 sritchie: but isn't that the carica stlye/

18:20 style*?

18:20 hiredman: no

18:21 technomancy: sritchie: oh yeah, you can't really use carica sensibly on heroku

18:21 ToBeReplaced: hiredman: maybe add a note in the "Mind the Classpath" section stating that resource dirs in the :dev profile will match before resources?

18:21 hiredman: with carica we have dev/defaults checked in, and chef writes production stuff on servers in the right plae on the classpath to override defaults

18:21 sritchie: okay

18:21 technomancy: okay, so the idea is to set the production env variable by variable using heroku config:add,

18:21 technomancy: well, I mean you maybe could rig something up, but you lose the benefits of carica if everything's sourced from the env

18:22 sritchie: and then keep the dev environment variables on some local script that everyone sources on their dev machines

18:22 hiredman: ToBeReplaced: the style technomancy mentioned isn't really the style we use it in, we don't have config in :dev-resources and :resources, we just have config in :resources

18:23 technomancy: hiredman: but you would if you used uberjars, right? you just do that because you have a fancy tarball deploy pipeline.

18:23 hiredman: production stuff is written by chef to a place that our launcher scripts put in the right place on the classpath to override whatever is built in to the jar

18:23 technomancy: oh right; actual prod secrets wouldn't go in resources/

18:23 hiredman: technomancy: speaking of fancy tarballs, danlarkin is working on a lein template which gives you a lot of safe style stuff out of the box

18:23 technomancy: cool

18:24 justin_smith: I just saw this danlarkin project today: https://github.com/danlarkin/clojuredongs

18:24 sritchie: bitemyapp: the config looks great, thanks for the gists

18:24 one more Q, for anyone using cljsbuild… if one enables the cljsbuild hooks,

18:25 it's unclear how to signal which cljsbuild profile should be built

18:25 on "lein compile", say

18:25 bitemyapp: I haven't figured out how the cljsbuild profile ids work either.

18:25 sritchie: probably makes more sense to just call "lein cljsbuild once prod" on heroku before java -jar

18:26 technomancy: the hooks are pretty "magic"; I think they're going to start documeting a more explicit approach

18:26 sritchie: but you can add cljsbuild to :prep-tasks to get it to run for every jar run

18:26 if you don't use hooks

18:27 sritchie: oh, nice

18:27 :prep-tasks [["cljsbuild" "once" "prod"]], for example

18:27 technomancy: the hooks are just "here are a bunch of common things you can add if you want to trade transparency for previty"

18:27 brevity

18:30 tbaldridge: dnolen: ping

18:31 dnolen: tbaldridge: pong

18:31 tbaldridge: I'm using reify inside a function in CLJS, if I name my namespace "main", CLJS tries to write code that does this: typeof main.main.t15920

18:31 That then fails do to main.main not existing.

18:32 this is with 1978

18:32 dnolen: tbaldridge: sounds a variant of the ns/shadowing issues we've had in the past

18:34 tbaldridge: or maybe not, looking at the reify macro I don't see anything obvious that would cause that.

18:35 tbaldridge: gist?

18:36 tbaldridge: I even get a console warning "Use of undeclared VAR main/main"

18:36 gist inbound...

18:36 dnolen: tbaldridge: thx

18:37 muhoo: justin_smith: well at least that demonstrates the reader literal api

18:39 tbaldridge: dnolen: https://gist.github.com/halgari/7223421

18:40 justin_smith: muhoo: yeah, it actually does a good job of that

18:41 dnolen: tbaldridge: k seems like a single segment namespace issue

18:42 tbaldridge: dnolen: yep, changed it to main-ns.baz and it works now

18:43 muhoo: justin_smith: "Truly, this is what the new reader literals were for. The uuid and date stuff was just to sell it to a gullible public." <-- best comment

18:43 dnolen: tbaldridge: http://dev.clojure.org/jira/browse/CLJS-646

18:43 muhoo: i was surprised to look and see it's just one line of code to create a reader literal.

18:44 tbaldridge: dnolen: lol, thanks! I'll send you all my bug reports in the future, and make you fill out the JIRA stuff :-P

18:44 dnolen: tbaldridge: heh, lots of bugs reports in the past two of days ... the danger of making of things easy!

18:45 justin_smith: muhoo: iirc where it gets messy is shadowing of that resource, making it hard for a library to provide reader literals maybe?

18:46 some kind of merging mechanism would make it easier

18:47 hiredman: justin_smith: the reader literal already reads all the data_reader.clj's on the classpath and merges the maps

18:47 reader literal bits

18:48 https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6910-L6955

18:51 derfury: Hey guys, so am I mistaken or do functions need to be defined "before/above" the calling function?

18:51 That seems a little strange considering it's compiled

18:51 znDuff: derfury: it's single-pass compilation

18:51 coventry: ,(doc declare)

18:51 clojurebot: "([& names]); defs the supplied var names with no bindings, useful for making forward declarations."

18:51 derfury: ahhhh

18:51 znDuff: derfury: if it weren't that way, you wouldn't have parity between REPL usage and AOT.

18:52 derfury: ...ie. things would work fine in AOT compilation and fail in the REPL. That's no fun for anyone.

18:52 derfury: but I can use delare to setup the function name, and then defn the same name later on?

18:52 I guess like C and .H files?

18:52 znDuff: derfury: Yup.

18:52 derfury: kk

18:52 hiredman: it depends how you use the name

18:52 derfury: hiredman, how so?

18:53 hiredman: if you don't try and take the value of the name between declartion and definition you'll be fine

18:53 derfury: sick!

18:53 hiredman: (declare f) (def x f) (defn f [] 1) ;; not good

18:54 (def x f) is taking the value f and giving the name x, but you have not given f a value yet

18:54 derfury: hmmm

18:54 hiredman: (declare f) (def g [] f) (defn f [] 1) ;; fine

18:55 when the function named by g is run, it will take the value of f, but by the time (g) is run, (defn f [] 1) should have run

18:56 TEttinger: hiredman: defn g

18:56 hiredman: right

18:56 derfury: so really, there is no good way to basically keep it indifferent to the order functions are defined in ?

18:57 hiredman: correct

18:57 TEttinger: functions will kinda work

18:57 functions won't check the body until called

18:57 coventry: derfury: Why do you want to?

18:57 hiredman: defing is side effectually, mutating what is effectivelly a a big map

18:57 derfury: It's mostly me hating having to keep track of what is defined first

18:58 too used to scala

18:58 hiredman: right, scala/java/etc are very different because they have very distinct compilation / runtime phases

18:58 derfury: I also prefer to organize my files based on things other than sequence of reference

18:58 hiredman: and the compilation unit is large

18:58 derfury: true

18:58 sritchie: bitemyapp: typo in benv, btw

18:59 hiredman: in clojure the compilation unit is a single toplevel expression

18:59 derfury: I understand the trade-offs, I'm mostly just double checking, and then whining unecessarily :P

18:59 sritchie: bitemyapp: benv is calling into kenv

18:59 not sure if that's just a byproduct of the transfer-to-gist

18:59 hiredman: (def x 1) is a hope compilation unit

18:59 whole

18:59 bitemyapp: sritchie: nah that was legit. Thanks.

19:00 sritchie: t'was an unused code path, I never fail to provide a fallback.

19:00 which raises the question of whether I should've even offered that code path to begin with.

19:00 This is where I mutter darkly about type systems.

19:09 sritchie: :)

19:17 bpr: does anyone else have issues with the cljs compiler running out of memory when generating source maps?

19:19 dnolen: bpr: wouldn't be surprised - but how much memory are you giving the process?

19:20 bpr: i have :jvm-opts ["-Xmx8g"] in my project.clj

19:20 though i'm not sure if that affects the lein process doing the building or my code's process

19:21 or both

19:21 i would think that 8g would be enough?

19:21 btw, i'm using [org.clojure/clojurescript "0.0-1978"]

19:23 justin_smith: bpr: one gotcha is running out of permgen rather than heap space - just a shot in the dark, but if heap is 8g and permgen is only 32m it is still easy to run out of space because of how clojure uses classes

19:24 bpr: ah, good point

19:24 justin_smith: but you should be able to see from the message whether it is permgen or heap that ran out

19:24 bpr: it's claiming heap space is the issue

19:24 java.lang.OutOfMemoryError: Java heap space

19:25 justin_smith: I spent way too long trying to figure out why my app was crashing and dying despite high mem limits until I figured out that permgen thing

19:25 OK, so its not that then

19:26 dnolen: bpr: do you have stack trace showing where it failed?

19:26 bpr: also some information like how big your project is would be useful to know.

19:27 bpr: dnolen: sure: https://www.refheap.com/20272

19:27 it's pretty small. I'll get a line count for you

19:29 dnolen: bpr: seems unusual for a small project

19:29 bpr: also those :jvm-opts probably need a ^:replace

19:30 hyPiRion: no, not with latest leiningen

19:30 bpr: dnolen: i've tried with and w/o ^:replace

19:30 hyPiRion: although it's smart to stick it in there

19:30 dnolen: bpr: you should also try with explicit JVM opts

19:30 bpr: line count is 164

19:31 dnolen: bpr: best to watch the process to confirm that memory usage is actually exploding.

19:31 coventry: bpr: You should be able to figure out if whether any java process is taking 8g before it dies by looking at the output of top.

19:31 dnolen: bpr: the number of dependencies also matter of course

19:31 bpr: as well as the level of optimizations

19:31 bpr: true true

19:31 it's just enlivee 2.0

19:31 whitespace

19:31 lambda-stu: bpr: enfocus

19:31 bpr: yes

19:32 enfocus, lambda-stu thanks

19:32 dnolen: bpr: well from the stack trace it's obviously choking on source maps.

19:32 bpr: dnolen: ok

19:33 dnolen: bpr: just need more information, is your project available anywhere?

19:33 bpr: dnolen: i'll paste it

19:33 fyi, it does build w/o source maps

19:34 dnolen: bpr: it simpler for me if you just publish the project to github other wise too may possibilities for mistakes

19:34 bpr: dnolen: https://www.refheap.com/20273

19:34 saddly, the project is closed source :(

19:35 dnolen: bpr: gotcha, then not much I can do other then tell you take a look at source_map.clj, fire up YourKit and give me some ideas.

19:35 bpr: ok

19:36 thanks. I'll post to the google group then

19:36 I'm going to punt for now and work towards some other goals

19:36 thanks for your time though!

19:36 dnolen: bpr: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/source_map.clj#L155

19:40 bpr: based on the stack trace it seems like the vectors gotten extremely large somehow - this seems unlikely to me, but maybe your dependencies are actually quite large?

19:41 bpr: dnolen: the only cljs dependency is enfocus 2.0.0

19:41 i'll check the dep tree on that

19:41 dnolen: bpr: other option would be to have the compiler report the size of the vector

19:41 bpr: enfocus just depends on domina and jsoup

19:42 dnolen: bpr: also wouldn't rule out that your lein memory settings are taking

19:42 lambda-stu: dnolen: another source map q if you don't mind - the links to clojurescript files in Chrome inspector seem to be missing the file:// protocol. am I missing a configuration setting maybe?

19:42 dnolen: lambda-stu: as far as I can tell not needed

19:42 lambda-stu: i.e. it looks for the cljs file in in localhost:3000/Users/...

19:43 dnolen: lambda-stu: this is because you are using a webserver? if so we need a patch for that.

19:43 lambda-stu: a ticket already exists

19:44 bpr: I just don't believe that the source map is generating a 8gig vector

19:44 bpr: yeah, it would be fairly shocking

19:47 lambda-stu: dnolen: yep, I see it now. thanks!

19:48 logic_prog: anyone here use clojure with hbase?

19:49 dnolen: bpr: building core.async now with source map with advanced, it's bigger than enfocus+domina

19:50 bpr: yeah i would imagine it is

19:50 dnolen: bpr: built fine

19:50 e/ 1978

19:51 with 1978

19:53 bpr: and core.async generates a ridiculous amount of code, so I dunno.

19:53 bpr: k

19:53 thanks for looking into this for me

19:53 i appreciate it

19:53 dnolen: bpr: np

19:53 bpr: i'll get more data and post it to the google group

19:54 dnolen: bpr: thx much

19:54 sritchie: bitemyapp: okay, working great: https://gist.github.com/sritchie/8e425184bd226f510425

19:54 added that too for testing

19:55 dnolen: bpr: just for kicks, also building with whitespace and pretty-printing, guaranteed to builded the largest source map

19:55 s/builded/build

19:56 bpr: worked fine

19:56 bpr: the final source map is 688k

19:58 muhoo: sritchie: what's the use case for that?

19:59 sritchie: muhoo: I wanted to test that (with-env {:ring-env "prod"} (dev?) => false)

19:59 muhoo: and I can't set environment properties from my emacs repl,

19:59 muhoo: ah

19:59 sritchie: so this was my solution/hack

20:00 muhoo: i've been just changing .lein-env and reloading environs.core ns

20:00 which causes it to be re-read

20:01 dnolen: tbaldridge: fixed in master http://github.com/clojure/clojurescript/commit/85ac96e3e2de4a3598c1658f7c1de6cf88734d93

20:03 sritchie: bitemyapp: is that a timbre logging config?

20:03 muhoo: that's what this does

20:03 muhoo: I just wanted it to reset afterware

20:03 afterward

20:03 muhoo: oh, ok, so that's why it's wrapped in a function

20:03 sritchie: yup

20:13 iwilcox: I have a really simple clojure script I'm running just as "clojure foo.clj". It does thready stuff and I'd like to add a watchdog that restarts it, ideally from within. Am I going to get into trouble if I make the watchdog's action (load-file *file*) ?

20:18 The script produces output which I'm writing to a file, and the UNIXy way would probably be to use monit to check the file's timestamp and restart, but it seems ugly to restart the JVM.

20:25 bpr: (= "foo")

20:31 sritchie: technomancy, I did have one Q for you -

20:32 on Heroku, my app's slug size is pretty huge

20:32 dpetrovics has the numbers, but it was a couple hundred MB, I think? with a far, far smaller uberjar size

20:33 technomancy: sritchie: it's possible ~/.m2 snuck in?

20:33 can you check with `heroku run bash`?

20:33 sritchie: ah, interesting

20:33 checking

20:34 dpetrovics: uberjar size was 35.6MB, slug size 149.1MB

20:34 technomancy: so the slug also includes a jdk

20:34 but that's still too big

20:37 dpetrovics: just checked with heroku run bash, m2 IS in there, looks like the size is 98MB

20:37 technomancy: ah crap, ok

20:37 I will take a look

20:38 dpetrovics: ok thanks!

20:38 ztellman: if a method with the same name is defined in two different interfaces, is there a way in deftype to denote which one I prefer?

20:38 type-hinting the return method doesn't seem to work

20:41 amalloy: ztellman: "which one"? if it's the same name and the same type signature, they are the same method. i don't quite understand what construct you're talking about

20:41 ztellman: amalloy: cons in IPersistentCollection and cons in ISeq

20:41 they have different return types

20:41 as far as I can tell, which is being chosen at random

20:42 which means that my tests fail sometimes

20:42 amalloy: ztellman: "chosen", as in...when you call it? like, your deftype impl contains code like (.cons this x)

20:42 if so, you can (.cons ^ISeq this x)

20:42 ztellman: amalloy: chosen as in (deftype Foo [] ISeq IPersistentCollection (cons [_ x] ...))

20:43 which interface is 'cons' implementing

20:44 patchwork: I have a lein template, and when it gets expanded all my pngs have been modified!

20:44 amalloy: ztellman: i think the jvm only lets it choose the most-specific one. is this really deftype, or one of the deftype-family macros in potemkin or something?

20:44 patchwork: They are all almost twice as large and corrupted (won't open)

20:44 ztellman: amalloy: really deftype

20:44 patchwork: But I am not calling the renderer on them

20:44 anyone know why that would be happening?

20:44 ztellman: and IPersistentCollection and ISeq are dijoint

20:45 the former is Seqable, not ISeq

20:45 disjoint*

20:45 patchwork: looking through the source it doesn't seem like anything would be doing that

20:45 technomancy: patchwork: they are probably being turned into strings and written out as utf16 or something

20:45 amalloy: ztellman: obviously not disjoint, because ISeq extends IPC

20:45 ztellman: amalloy: ugh, missed that

20:45 patchwork: technomancy: Any way to just copy them straight over?

20:45 amalloy: just remove IPC from your deftype entirely

20:46 patchwork: it seems like that should be a simple operation in a template, but it seems everything passes through the renderer...

20:46 hyPiRion: patchwork: I think you have to jump down to java Files for that

20:48 ztellman: amalloy: the issue is that the deftype implements ISeq, and in some cases returns a vector from cons

20:48 which apparently will throw an exception in a subset of JVMs

20:49 technomancy: patchwork: be sure c.j.io/copy is being run on a File or InputStream

20:49 not a string or reader

20:49 ztellman: openjdk 7, but not oracle jdk 7

20:49 which is maddening

20:49 amalloy: so you're implementing a seq, which when you conj onto it gives you back a non-seq? i'm not surprised that breaks

20:50 ISeq's interface narrows the contract of cons in order to promise that what you get back will be a seq

20:50 ztellman: amalloy: yes, granted, but that's apparently undefined behavior

20:50 because the behavior changed between minor updates on my jdk

20:52 amalloy: well, i certainly don't know where to find that in the jvm spec. i know javac wouldn't let you compile your deftype

20:52 (if it were written in java, of course)

20:53 technomancy: sritchie: do you have a custom bin/build script?

20:54 ztellman: amalloy: yeah, chalk it up to me not thinking it through carefully enough, it just caught me by surprise when it stopped working all of a sudden

20:54 sritchie: technomancy:

20:54 web: lein with-profile production trampoline run prod remote -m paddleguru.server $PORT

20:54 that's it

20:55 technomancy: sritchie: I thought you were using an uberjar?

20:55 sritchie: no, after your rec I'm converting over to an uberjar

20:56 technomancy: oh right, but not yet

20:56 sritchie: not yet

20:56 technomancy: ok, so if you're still using lein run then you have to have m2 in your slug

20:56 sritchie: ah, okay, yeah, of course, since lein is referencing all of those jars

20:56 boom

20:56 makes sense

20:59 technomancy: it threw me off because I had an uberjar app with an m2, but I realized it was pushed with an old rev of the buildpack

21:01 sritchie: gotcha

21:01 yeah, this is great

21:01 it's fun coming back to clojure and seeing all of the wonderful new libraries everyone's been working on

21:02 ravals: is there a good way to get multiple values out of a vector given their indices? like a variadic get?

21:02 technomancy: ,(map [1 4 2 343 4235 22] [0 3 2])

21:02 clojurebot: (1 343 2)

21:02 sritchie: ,(map ["a" "b" "c" "d"] [2 0 1])

21:02 clojurebot: ("c" "a" "b")

21:02 technomancy: ravals: ^

21:02 mercwithamouth: does anyone else have an issue with instarepl not starting up with light table? is there just something that i do wrong when i try to start it with new projects created with lein?

21:02 ravals: oh, right, they are functions too

21:03 great, thanks!

21:35 bitemyapp: ahh, clojurescript project stymied. Damn.

21:35 ddellacosta: bitemyapp: ?

21:42 bitemyapp: ddellacosta: I was going to work on a clojurescript app but got shanghai'd by a higher priority.

21:42 a wee bit disappointed as that means I won't get to do some serious cljs for awhile yet.

21:44 ddellacosta: bitemyapp: ah, gotcha, bummer. :-(

21:44 bitemyapp: ddellacosta: partly me own fault. If I make time to work on Simonides I'll get to do cljs, since that's what the frontend for that is.

21:44 Too busy :(

21:45 ddellacosta: ah, I see. Yeah, I know what it's like...I always have more projects brewing than I have time for. *sigh*

22:25 bjl7: Could not locate clojure/tools — any idea where I can get it?

22:27 jared314: bjl7: there are many clojure.tools projects. which one?

22:28 marcopolo2: Client UrlCache MMF Ver 5.2

22:28 @

22:28 €

22:28 (

22:28 €

22:28 ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ

22:29 mtp: wath

22:29 bjl7: jared314: complete beginner, so all/any of them. Only just worked out that lein installs them for you if you add them as a dependency.

22:30 jared314: bjl7: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.clojure%22%20tools

22:31 bjl7: the sources are on github

22:54 coventry: /join crypto

22:55 Heh.

22:55 jared314: not very secret

22:57 danlentz: does anyone have handy the cl-format incantation to left pad a [binary] number with 0's?

22:57 can't for the life of me ever remember it (or remember where I last wrote it down)

22:57 jared314: danlentz: do you want a string result?

22:58 danlentz: um don't care, but sure

22:59 i have (cl-format *out* "~&[~66b]~%" x)

22:59 coventry: clj-format is just java String/format. http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#syntax

22:59 danlentz: y i mean dl-format

22:59 amalloy: coventry: not close

22:59 danlentz: fl-format rather

22:59 amalloy: he wants cl-format

22:59 jared314: ~5,'0d

22:59 clojurebot: Titim gan éirí ort.

22:59 amalloy: not clojure's format, which just delegates to String/format

23:00 danlentz: cl-format auto incorrect is going to kill me

23:00 coventry: Oh, I see.

23:00 danlentz: jared314: that looks right, thanks

23:00 jared314: danlentz: ~5,'0b

23:00 danlentz: i don't remember which one it is

23:02 danlentz: (cl-format *out* "~&[~64,'0b]~%" num) works perfect. tis very much

23:03 tks rather

23:05 i don't remember why i gave up on getting it to print a 64 bit binary number using clojure.core/format but I did so there must haver been a reason. I see that I used (format "[%1$016X] " x) for the hex representation

23:12 bitwise ops are not defined for bigints?

23:13 this is yet another failure in my ongoing quixotic struggle to emulate unsigned 64bit arithmetic with clojure

23:14 it just seems like there is no possible way to do it with any semblance of efficiency

23:16 AimHere: Is that doable in Java even?

23:16 With the semblance of efficiency, that is...

23:16 danlentz: easily the most frustrating thing I've come across in clojure

23:16 sorry colloquy is apparently buggy after mavericks upgrade

23:16 brehaut: danlentz: maybe calls for some of the sun unsafe packages?

23:16 tbaldridge: danlentz: yeah, that's a limit of the JVM, not Clojure

23:17 danlentz: brehaut: i didn't know about them but they sound promising!

23:17 brehaut: sun.misc.unsafe

23:17 i dont know specifics

23:17 danlentz: are they in j2se16?

23:17 clojurebot: Excuse me?

23:17 brehaut: your guess is as good as mine

23:18 yedi: has anyone used the devop? (https://thedevop.com/) is it any good?

23:18 danlentz: I need to do unsigned 64bit manipulations to get my uuid library to produce results equal to those produced on other platforms

23:19 brehaut: http://mishadoff.github.io/blog/java-magic-part-4-sun-dot-misc-dot-unsafe/

23:19 cmajor7: core.async: what would be a pattern to "collect events", and apply a fn (e.g. flush them to DB) on either timeout or when a certain batch size is reached?

23:19 (whichever comes first)

23:20 brehaut: danlentz: basically theres a direct memory access api in there

23:22 danlentz: yeesh. Its really ugly

23:22 dear lord

23:22 brehaut: danlentz: thats hardly a surpruse though :/

23:25 danlentz: Still not certain how to even do this though. using toAddress, and getUnsafe().allocateMemory(size) and getUnsafe.putLong it seems?

23:25 jesus

23:25 brehaut: danlentz: unsigned math in jvm is just a giant ball of hurt nomatter how you skin it

23:29 danlentz: ok to hell with colloqy

23:30 brehaut: danlentz: bit odd. its been running just fine for me under mavericks (as much as colloquay is ever fine)

23:31 danlentz: I've gotten close with the likes of:

23:31 (if (and (not (zero? offset)) (= (+ offset width) 64))

23:31 (unchecked-negate (bit-shift-left (bit-and-not x 1) (dec offset)))

23:31 (bit-shift-left x offset))

23:31 or some such

23:32 but it always winds up being useless in some edge case or whatever

23:33 when actually attempting to use whatever bitwise representation I've concocted

23:36 other than with longs it works fine to just roll over to next size primitive ie byte-short, short->int, int->long. But the strategy breaks down of course with long as I have just realized bitwise ops on bigint are undefined

23:36 brehaut: danlentz: personally, id go looking for a java implementation of whatever it is you are trying to do, and just use that. let someone else rummage about in the bag of hurt

23:39 danlentz: heh. I think that sounds very wise... I do feal a bit defeated though as this has been my first clojure expedition (coming from common-lisp, which has 3 entirely orthogonal subsystems and complete families of operations by which one may manipulate numeric representations)

23:41 brehaut: understandable

23:41 danlentz: logical-bitwise, boolean-algebraic, and an unbelievably cool primitive type called "bit-vector"

23:42 brehaut: its just unfortunate that you chose one of the few areas where the JVM is a real albatrose

23:42 danlentz: yeah

23:43 i really want a decent uuid facility though (ie type 1, 3, 4, 5 etc)

23:43 the built in jvm UUID is from hunger

23:45 The reason I want them is that there are many ways to employ UUIDs as a kind of "computational data-structure" (as opposed to a pointer/address type)

23:45 amalloy: danlentz: i think there's an apache project with decent UUIDs

23:46 but it's been a while, plus i may not know what counts as decent for you

23:46 danlentz: which is extremely useful in the area of graph database

23:47 Y I saw the apache; wasn't thrilled + the idea was to learn some clojure by writing exactly the library I wanted... :)

23:48 but you're right I'm not sure if I could have picked a more frustrating project to start with

23:50 the whole thing is kind of surprising to me as there arew so many networking protocols implemented on the jvm

23:50 tbaldridge: that's kindof a reflection of what the JVM is used for.

23:51 brehaut: tbaldridge: i think the JVM is used for many of those things in spite of it

23:51 tbaldridge: unsigned bytes etc are pretty important for all things networked

23:51 danlentz: y one would think this ground might have been trodden before..

23:52 brehaut: danlentz: like most quagmires it doesnt retain footprints well

23:52 danlentz: the standard solution is use the next size thing up

23:52 works until you run out of sizes up

23:52 `cbp: bitemyapp: now we have the best documented rdb community driver :-). Although it still has a long way to go to get close to the official ones :-(

23:53 danlentz: I saw a quote somewhere that JVM made the consious decision not to implement unsigned arithmetic brecause it was deemed to make things TOO COMPLICATED

23:53 brehaut: yup.

23:53 thats what irony tastes like

23:54 danlentz: i think it might finally be coming in java8

23:54 danlentz: jvm seems to be one of the gratest strengths and greatest weaknesses of clojure

23:55 brehaut: its largely the former, but theres certainly some latter

23:56 jared314: danlentz: that depends on when clj-in-clj happens

23:57 danlentz: is there a viable clj-in-clj effort undereway?

23:57 brehaut: yes-ish

23:58 its progressing but its not a usable target yet

23:58 tbaldridge: danlentz: often more of a strength than a weakness, I find it funny that Clojure has gotten this far in what, 5 years? Ruby took a decade for people to even hear about it.

23:58 clj-in-clj will probably never target a platform besides JVM and JS.

23:58 danlentz: i assume the idea is to bootstrap it along the lines of CMUCL or CCL in the common-lisp world?

23:59 brehaut: https://github.com/Bronsa/CinC

23:59 tbaldridge: right now it's only aiming at one thing: making the compiler more approachable and easier to maintain.

23:59 brehaut: that's been replaced by the official clojure projects: https://github.com/clojure/tools.emitter.jvm

Logging service provided by n01se.net