#clojure log - Jan 06 2014

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

0:11 t3soro: Hello Clojurians

0:11 How can i prevent a (deliver) to a promise from delivering twice during a transaction that might get retry'd?

0:16 bbloom: t3soro: deliver it asynchronously with an agent

0:16 t3soro: sends to agents are held until after a transaction succeeds

0:23 t3soro: thanks bbloom

0:38 arrdem: yarrr

0:39 is there a (ninc) function in someone's snippet library?

0:39 bitemyapp: arrdem: ninc?

0:39 arrdem: bitemyapp: I keep needing an (inc (or 0 val))

0:39 we.. (or val 0)

0:39 bitemyapp: ...

0:39 arrdem: *well

0:40 ninc Nillable Inc

0:40 bitemyapp: seems like you could just write it eh? :)

0:40 seems silly though.

0:40 just embedding the (or ...) is straight-forward.

0:40 arrdem: bitemyapp: the point is that this is the 15th or so time I've done so :P seems like it should exist somewhere for re-use...

0:41 seangrov`: fnil?

0:41 arrdem: seangrov`: what is this form? I don't know of it..

0:42 bitemyapp: arrdem: fnil is a more generic way to do it.

0:42 ninc doesn't seem advisable.

0:42 arrdem: ,(doc fnil)

0:42 clojurebot: "([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."

0:42 arrdem: cute

0:42 seangrov`: ,((fnil + 0) nil 10)

0:42 clojurebot: 10

0:42 seangrov`: \o/

0:43 arrdem: lein new me.arrdem/detritus

2:28 tommo_: can some1 verify if this is valid code? (:gen-class ^{Manifest {:name "clj impl" :author "author" :description "desciption"}})

2:29 i'm trying to add a class-level annotation

2:35 amalloy: that can't be right - metadata has to attach to something

2:35 i don't know how to do annotations, but that ain't it

2:38 tommo_: ah silly me, attached it to class name

2:39 and it looks like it works

2:39 bitemyapp: tommo_: https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/genclass/examples.clj

2:41 tommo_: thanks bitemyapp, amalloy

3:12 seriously_random: how to avoid nesting while using take in a map: http://pastebin.com/kFxjMxdq

3:16 TEttinger: ,(reduce into [] '((1 2 3) (1 2 3) (1 2 3)))

3:16 clojurebot: [1 2 3 1 2 ...]

3:16 TEttinger: seriously_random: ^

3:16 seriously_random: TEttinger, can't I do something inside map function?

3:17 TEttinger, I could also use flatten, but I want map to return non-nested sequence

3:17 vijaykiran: seriously_random: usually map is m -> m

3:17 TEttinger: yeah, if you use map on a 3-element sequence you get back a 3-element sequence

3:18 they may be nested elements

3:18 but still 3

3:21 seriously_random: TEttinger, http://pastebin.com/9w2ntvbn

3:22 TEttinger: the difference between reduce into [], and flatten, is flatten goes through the whole nesting and flattens all of it, reduce into [] removes one layer of nesting

3:23 ,(reduce into [] '((1 2 3 (4 5 6)) (1 2 3 (4 5 6)) (1 2 3 (4 5 6))))

3:23 clojurebot: [1 2 3 (4 5 6) 1 ...]

3:25 seriously_random: TEttinger, or better is to avoid creating nested sequences

3:25 amalloy: (reduce into [] (map f coll)) is a pretty silly way to write (mapcat f coll)

3:26 TEttinger: right, mapcat

3:26 I was thinking of the output

3:45 seriously_random: TEttinger, ended up with apply concat (for instead

3:46 TEttinger: not... mapcat?

3:46 seriously_random: http://pastebin.com/R3Yjim6b

4:45 jazzorn: Hey! Question: probably some of you know http://www.youtube.com/user/jekor and the "Haskell Deconstructed" Tutorials where jekor rebuilds well know applications in haskell. I read trough Programming Clojure and liked the practica alot because they point in the same direction to get better in reading and writing and more important 'good haskell style'. Is there some known source you would recommend to 'get better in reading and writing clojure', like e.g.

4:45 well written clojure code of medium size that makes uses of common patterns, best practices, and so on ... ? Thanks and have a nice day!

4:52 llasram: jazzorn: Leiningen is a generally well-designed, approachable project, which has the big benefit that you'll already actually use if working in Clojure

4:53 hyPiRion: llasram: oh dear lord, Leiningen is not using common patterns and best practices

4:53 fredyr: jazzorn: and clojure source ofc

4:53 llasram: Haha

4:53 hyPiRion: It's worth to have a look at, but don't assume stuff we do in there is something you will do yourself

4:54 andrew__: are all the functions and forms built into the language listed here, or is this only a subset: http://richhickey.github.io/clojure/clojure.core-api.html

4:54 llasram: hyPiRion: You have a better example? :-) I honestly think it's pretty decent

4:55 andrew__: FYI, the official clojure repos are on github, but under the 'clojure' org, so e.g. not under user 'richhickey'

4:55 TEttinger: don't ever look at my code for "good practices"

4:55 hyPiRion: llasram: I'm not sure, but 4clojure and lazybot perhaps?

4:56 TEttinger: nice little snippet from my current project (aget ^"[Lcom.badlogic.gdx.graphics.g2d.TextureAtlas$AtlasSprite;" cleaned idx)

4:56 llasram: andrew__: To answer your question -- most of the lowest-level special forms are implemented in the compiler itself, currently in Java

4:57 TEttinger: jazzorn, I learned a lot hacking on lazybot

4:57 andrew__: llasram: ok, i just wanted to know the actual Clojure forms that make-up the langauge

4:57 TEttinger: it's fairly good source, well-documented but a lot of files. thankfully it's all sandboxed, so if you make a mistake it still launches and prints the error in the console

4:58 hyPiRion: (inc TEttinger)

4:58 lazybot: ⇒ 11

4:59 TEttinger: hooray

4:59 hyPiRion: I usually struggle to find source code recommendations for new clojure programmers, so it's nice to get that one confirmed

4:59 TEttinger: lazybot has a mongodb dependency, which is fairly easy to set up

5:00 I actually had a harder time setting up and maintaining lucene for one of the plugins I wrote

5:00 llasram: TEttinger: I was going to make some snide comment about them (both? I believe) using mongo, and thus not following best practices, but (originally) held my tongue :-)

5:00 TEttinger: is congomongo deprecated?

5:01 llasram: `ring` and `compojure` show signs of being older projects, but may be the most widely-used Clojure projects following clojure itself

5:01 TEttinger: Not that I'm aware of. Just referring to MongoDB itself :-)

5:02 TEttinger: llasram, is datomic preferred these days?

5:02 llasram: TEttinger: You are making it difficult to inject passing database snobbery!

5:03 TEttinger: it's what I do man

5:03 llasram: Heh

5:03 TEttinger: hey it could be worse

5:03 could be Oracle's commercial DB

5:04 llasram: jazzorn: BTW, you'll probably get a wider range of suggestions if you ask on the Clojure mailing list. Especially versus this time of day on IRC -- this is probably maximum US sleepytime

5:06 TEttinger: All I ask of my databases is that they be libre and not lose my data as a design decision. Everything else I'll evaluate on an application-specific basis

5:07 TEttinger: I'm in california... but then again, I'm on Pacific Nonstandard Crazy Time

5:09 llasram: TEttinger: Yeah... Actual maximum might be in another 30-60 minutes, but we do have a number of EST early-risers

5:09 TEttinger: still, bay area and seattle seem to be prime clojure dens

5:10 llasram: Dark caves, filled with slithering parentheses

5:13 jazzorn: well, i'll jump into core-api for a while ... thanks

5:31 andrew__: i'm trying to make sense out of this: http://pastebin.com/iTY30wD0 When doing something like (count) on a very large sequence, is this suggesting that it will throw away values it doesn't need, if it can, and thus avoid memory problems on large seqs?

5:35 llasram: andrew__: Clojure tries to be relatively aggressive about generating code which doesn't unnecessarily hold references to values it no longer needs (i.e. "locals clearing"). Garbage collection and the design of lazy sequences (essentially single-linked lists where the "next" element may be a function to call) does the rest

5:35 * ucb waves

5:36 * llasram waves back

5:36 ucb: hey hey llasram

5:36 llasram: Good <time of day>

5:37 ucb: morning for me, good $TZ_GREETING for you as well

6:10 pepijndevos: Can I do CouchDB-style compare-and-set! in Clojure? That is, compare a revision, not the whole data.

6:11 arcatan: good morning, in the universal greeting time!

6:21 pepijndevos: hrm, there are some java.util.concurent.atomic classes that have a mark or stamp, but they ALSO require the reference.

6:21 andrew__: llasram: so does (count) actually evaluate and remember all the values in a seq? also 2) is just prepeding your name with a colon enough to "message" you on here?

6:22 llasram: andrew__: Just mentioning someone's nick is usually enough to highlight it in most IRC clients

6:23 andrew__: As for `count` -- I'm not really sure how to answer that

6:23 andrew__: the code snippet I provided is confusing

6:23 it suggests that count is by nature not head-retaining, therefore, how are values "remembered" if it evaluates everything at once?

6:25 llasram: Unfortunately I can't quite tell the source of your confusion

6:26 For lazy sequences, `count` just walks it as a single-linked list and counts the number of entries, so it doesn't need to hold on to any earlier references

6:27 andrew__: how can I get 5th element like this without error: (nth (repeatedly 1e6 (rand-int 10)) 5)

6:28 it reports "java.lang.Integer cannot be cast to clojure.lang.IFn "

6:28 llasram: That kind of exception means you provided something else where Clojure expected a function, which is the case for the second argument of `repeatedly`

6:29 (rand-int 10) vs e.g. #(rand-int 10)

6:29 andrew__: oh, i meant a function literal

6:29 llasram: You meant a function literal?

6:33 andrew__: Yes I meant what you wrote, the #() expression. fixed. so my test reveals that using time and nth to access an element in a long lazy seq, indeed it takes longer for the first call, then short for the second. this is even true after (count) has been used to evaluate all elements, thus suggesting count does not actually cause values to be remembered, and the seq remains lazy

6:37 llasram: andrew__: Oh, I see what you are saying. No, that's not correct. Realization of lazy seq each element happens only once for a given concrete instance of a lazy seq

6:37 andrew__: Try creating a seq which needs to e.g. call Thread/sleep to realize each element

6:37 andrew__: llasram so count is not "realizing" the list

6:37 llasram: andrew__: It is

6:38 andrew__: Something else is confounding your empirical results

6:38 andrew__: if it is realizing it, then why is it not "head retaining" -- wouldn't knowing the "head" mean that it was realized?

6:39 llasram: When you walk a single-linked list, you only need to hold on to your "here" reference as you walk each element, you don't need to keep a reference to the first element you started at for each iteration

6:39 andrew__: ok, so keeping a reference to an element is not the same as having it "realized"

6:40 what I don't understand about this code snippet http://pastebin.com/iTY30wD0 is that the 2 (count) calls are separate expressions, so why would one depend on the other as far as retaining a reference to head elements? llasram

6:40 llasram: Because they have an evaluation order imposed by the order in which they appear in the code

6:41 andrew__: but once one of them is evaluated, why would references be held when that expression ends? why does the order of the two count calls affect whether each of them holds onto references to head or not? each one does it count, returns a value, then the next one does the same. why would order matter?

6:42 deadghost: anyone have a good book for java?

6:42 all this multi component factory talk is freaking me out

6:43 http://api.libreoffice.org/examples/examples.html

6:44 I assume if I want to use the api from clojure

6:44 I'd have to understand the java

6:45 llasram: andrew__: Because the two sequences returned by `split-with` are both lazy sequences which close over references to the original sequence. The "head" sequence is short and fits in memory. Causing it to be realizes, realizes the original sequence up through those number of elements.

6:46 Until it is realized, the "tail" sequence holds on to those "head" elements via it's reference to the original sequence. Because the "head" is small, this is fine

6:47 broquaint: deadghost: You mostly need to understand how to call Java from Clojure which isn't too bad if you've got halfway decent API docs.

6:48 llasram: andrew__: Swapping the order of the calls leads to the un-realized "head" sequence holding its reference to the original sequence, which walking the "tail" portion forces to be fully realized, and thus blow the heap

6:48 deadghost: broquaint, I guess I'll try winging it

6:50 andrew__: llasram ...thinking

6:53 pepijndevos: Has anyone tried backporting cljs datastructures to Clojure?

6:53 hyPiRion: pepijndevos: check out Mori by dnolen

6:54 wait what, I read wrongly

6:54 broquaint: Good luck, deadghost :)

6:54 hyPiRion: I thought you meant implementing Clojure data structures in js

6:54 pepijndevos: I was going to say...

6:54 No, I want to mess with the ones already in Clojure.

6:55 But messing with Java is no fun

6:55 So I though I could backport the Cljs ones to Clojure instead

6:55 hyPiRion: Sounds interesting

6:56 pepijndevos: Specifically, I'm interested in making PersistentTreeMap more like a list, and do stuuf like NavigableMap in Java.

6:57 There is a TreeMap in Java as well, which supports NavgiableMap stuff. But I also want to be able to look up by index.

6:59 philandstuff: you could crib ideas from core.rrb-vector and data.avl

6:59 * pepijndevos googles

6:59 andrew__: llasram i guess the fundamental source of my confusion is with regards to how references are getting held based on two different function calls. behind the scenes, Clojure must try to optimize by saying "oh, he needs to look at the head of this sequence in the next function call, so I won't throw away any values while I walk this list." is that right?

6:59 Clojure determines how to handle a lazy seq based on just on a sequence function being called (like count), but also based on what other function calls neighbor it

7:00 *based not on just a sequence function (typo above)

7:00 pepijndevos: philandstuff, avl doesn;t look bad at all! hmmm

7:03 llasram: andrew__: Maybe it would help to think of lazy sequences as closures over whatever they need to compute the next element

7:04 andrew__: The immediate return values of `split-with` haven't evaluated anything yet, and so both are closures over the original sequence

7:05 philandstuff: pepijndevos: yeah anything by michalmarczyk is generally worth a peruse

7:05 llasram: Clojure doesn't do anything at the semantic level you're describing -- it just tries to be aggressive about clearing local references which are no longer necessary, and the rest of the resulting behavior follows from GC

7:06 pepijndevos: philandstuff, maybe I can persuade him to implement NavigableMap. It provides all the other things I want.

7:07 amalloy: andrew__: (1) lazy sequences are never realized twice (they are always saved). (2) iterating over a lazy sequence releases references to the walked-over elements. (3) the GC can only collect elements to which there are no pointers. (4) as a necessary result of 1, 2, and 3, if you call an iterating function f on a collection c, and then call another function g on c, then c cannot be GCed during f

7:07 llasram: andrew__: Anyway, I've got to go, but I hope it becomes clear to you :-)

7:07 seangrove: Weird. Seems like the body for POST requests to my ring server are not coming in at all, even though I'm sending it through cURL or the browser. Anything obvious to check?

7:07 amalloy: seangrove: some middleware has already read the body

7:07 andrew__: llasram perhaps my confusion is that this is a let form, the result of which has nothing to do with specific values inside the sequences, but rather just with their counted size. The let form only needs to know those values for the purpose of counting them and then those values are thrown away, since nothing is getting stored

7:07 amalloy: and since it's a stateful stream, you can't re-read

7:07 seangrove: Ah, that could be, yeah

7:08 andrew__: llasram therefore the evaluation of the let form needs to remember head in order to fulfill its task

7:09 seangrove: amalloy: Yeah, looks like it. I had removed most middleware, just not enough, heh.

7:11 andrew__: llasram here is another test that suggests I'm understanding this better:

7:12 I can do this fine, because no values are being remembered, only counted items: (count (range 1e8)) -- but, I cannot do this: (def v (split-with #(< % 12) (range 1e8))) followed by (def v (split-with #(< % 12) (range 1e8)))

7:12 llasram that was supposed to say followed by (count (v 1))

7:13 the only difference is that values are remembered in one, not the other. just as in the first let form.

7:20 dsrx: is there a way to write a 0-arity fn with #() ?

7:20 hyPiRion: yeah, skip %'s inside them

7:20 ,(repeatedly 10 #(rand-int 10))

7:20 clojurebot: (6 1 3 5 7 ...)

7:21 dsrx: hmm...

7:21 weird. getting a cljs "Invalid arity: 1" error when I use #([]), but not when I use (fn [] [])

7:22 hyPiRion: that's because #([]) is (fn [] ([]))

7:22 dsrx: ohh

7:22 hyPiRion: ,'#([])

7:22 clojurebot: (fn* [] ([]))

7:22 dsrx: of course

7:24 thanks

7:24 hyPiRion: np

7:27 seangrove: Hrm, another oddity. If I add (ring.middleware.json/wrap-json-params) to my ring routes, it causes a 404...

7:28 Seems like ring-middlewares can be pretty tricky to compose

8:13 augustl: seangrove: I found running middlewares before method/path matching to be a problem..

8:14 seangrove: I use a routing lib that wraps the middleware around the individual post-routing FNs so that you don't run into problesm with middlewares that redirects or reads the read-once body

8:21 pepijndevos: Is there a way to serialize clojure data, maintaining structural sharing?

8:26 mdrogalis: pepijndevos: I wonder if Fressian does that under the hood.

8:26 Probably not though.

8:27 augustl: pepijndevos: as in compose two serialized blobs, or to encode the internal in-memory structural sharing your current mem has?

8:27 seriously_random: is map here doing just mod 3? http://pastebin.com/7Bt2DHDY

8:28 pepijndevos: hmm. I don't know. I just want to avoid exploding memory by serializing and then deserializing map sharing structure.

8:29 So I gues the latter

8:29 Alternatively, I could maybe use data.diff to store just the difference and recreate the structural sharing uplon load,

8:30 augustl: pepijndevos: storing facts/events and deriving the map from that might make sense yeah

8:33 arcatan: seriously_random: it calculates the nearest integer towards zero that is divisible by 3

8:34 seriously_random: arcatan, where can I read more about (map # %?

8:35 augustl: seriously_random: #(foo %) compiles to (fn [arg1] (foo arg1))

8:36 so % is the argument passed to the fn

9:02 TEttinger: seriously_random: ##(str "compare the output of " (#(+ % %) 5) " and " ((fn [n] (+ n n)) 5) )

9:02 lazybot: ⇒ "compare the output of 10 and 10"

9:02 TEttinger: seriously_random: ##(str "then, compare the output of " (#(+ %1 %2) 5 7) " and " ((fn [x y] (+ x y)) 5 7) )

9:02 lazybot: ⇒ "then, compare the output of 12 and 12"

9:06 pepijndevos: What is the namespace magic required to look up a function by name and call it?

9:07 (like ((lookup "assoc" clojure.core) {} :foo 1)

9:07 TEttinger: I think it's resolve

9:07 ,(doc resolve)

9:07 clojurebot: "([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"

9:08 TEttinger: ,(resolve assoc)

9:08 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.core$assoc cannot be cast to clojure.lang.Symbol>

9:08 TEttinger: ,(resolve 'assoc)

9:08 clojurebot: #'clojure.core/assoc

9:09 TEttinger: ,(resolve (symbol "assoc"))

9:09 clojurebot: #'clojure.core/assoc

9:09 TEttinger: there you go

9:09 pepijndevos: &(#'clojure.core/assoc {} :a 1) ; is a var callable.. can;t remember

9:09 lazybot: ⇒ {:a 1}

9:10 TEttinger: how's your afternoon going, pepijndevos?

9:11 pepijndevos: good, getting a database together :D

9:24 rurumate_: (type (char \newline))

9:24 ,(type (char \newline))

9:24 clojurebot: java.lang.Character

9:24 rurumate_: why can type not tell me if it's a primitive?

9:25 teslanick: Is anything in Clojure a primitive?

9:25 pepijndevos: yea

9:25 TEttinger: yes, contents of arrays

9:25 rurumate_: I would think so

9:25 TEttinger: I think type is autoboxing it because there's no class for char that doesn't promote to Character

9:26 rurumate_: is there something like type which doesn't do autoboxing?

9:27 TEttinger: I wonder that myself.

9:30 pjstadig: primitive types are compile-time types, you can't inspect them at runtime without autoboxing

9:31 you know you have them, or not, by looking at the source code

9:31 TEttinger: so (type x) calls (class x), and that calls a method on Object

9:31 pjstadig: ,(type type)

9:31 clojurebot: clojure.core$type

9:32 pjstadig: i believe type (and class?) are functions, so their arguments get boxed when they are called

9:32 or they desugar into a call to some RT method that take Objects or something

9:33 ~source type

9:33 ~source class

9:36 CookedGryphon: Hey, I'm having an issue with core.async - No implementation of method: :emit-instruction of protocol: #'clojure.core.async.impl.ioc-macros/IEmittableInstruction found for class: clojure.core.async.impl.ioc_macros.Jmp

9:37 TEttinger: pjstadig, did it send those in a notice?

9:37 CookedGryphon: does anyone know what that means?

9:37 pjstadig: TEttinger: do those not show publically?

9:37 http://is.gd/UfrUwQ

9:37 TEttinger: CookedGryphon, more people should be awake soon, lots of them use async

9:39 ,(type (into-array [(char \newline)]))

9:39 clojurebot: [Ljava.lang.Character;

9:39 TEttinger: wow

9:40 oh, generics can't have primitives, they need to be objets inside

9:40 so that vector is making it a Character not a char

9:40 hyPiRion: ,(type (into-array Character/TYPE [\newline]))

9:40 clojurebot: [C

9:41 hyPiRion: That's probably what you want

9:41 TEttinger: no, my goal was to find the type

9:41 hyPiRion: ah, alright

9:41 Yeah, an Object can't be a primitive

9:41 TEttinger: Character/Type means I know it already, unless I can call that without knowing it?

9:41 hyPiRion: or the other way around: A primitive can't be an object

9:59 rurumate_: ,(type (aget (into-array Character/TYPE [\newline]) 0))

9:59 clojurebot: java.lang.Character

9:59 pepijndevos: How do I "apply" the result from clojure.data/diff?

10:01 For added entries I could maybe do (fn recursive-merge [& maps] (apply merge-with recursive-merge maps))

10:24 hcumberdale: Hi :)

10:25 hyPiRion: hello

10:25 hcumberdale: I'm trying to insert multiple rows like in https://github.com/clojure/java.jdbc "Example Usage" but this does not work if I generate the maps with (map ...) because of the result is a '({ } ... {} )

10:26 how to transform '({} {}) to {} {} ? macro needed?

10:27 hyPiRion: either macro or apply

10:27 augustl: hcumberdale: (apply the-fn (map ..))

10:28 hyPiRion: yeah, (apply mysql-db :fruit '({} {})) also works

10:29 (apply j/insert! mysql-db :fruit '({} {})) I mean

10:29 hcumberdale: IllegalArgumentException insert called with columns but no values

10:30 sorry missed a (

10:32 worked, thx

10:35 is this also possible for update! ?

10:35 multiple updates with one call?

10:35 augustl: hcumberdale: "apply" is generic to any function

10:36 hcumberdale: I meant the api clojure jdbc

10:36 can't find an example for multiple updates

10:57 jjl`_: how on earth does midje autotest manage to run my test suite without me even noticing? it's BLAZING fast

11:13 kes_: Can someone suggest a way to refactor https://gist.github.com/7d063b410e1b4c5bfdd5 ? Seems like that should all be one thing.

11:18 broquaint: kes_: Wants another function? https://www.refheap.com/22515

11:20 augustl: kes_: I wouldn't write functions like that. I would maybe have written a get-factor function and then just done the key lookup as needed

11:20 kes_: data is an abstraction in and of itself, no need to wrap it even more in a function :)

11:20 jjl`_: and i just commented another approach on the gist

11:21 augustl: kes_: so, (:city (factor-by-zipcode zipcode factors-table))

11:21 jjl`_: not sure what the point is of getter fns :)

11:22 jjl`_: augustl: likewise, but without seeing more code, i'm not going to tell someone they're wrong :)

11:22 augustl: jjl`_: I like to issue a word of warning when I see someone abstracting data in getter fns and the like, based on personal experience in seeing java devs do that when they learn clojure

11:23 jjl`_: augustl: i haven't had that experience, but i get it

11:24 augustl: Get it. Get it?

11:26 kes_: fyi, (defn get-factor [factors-table zipcode] (first (filter #(= (:zip %) zipcode) factors-table)))

11:27 hcumberdale: whats the best way to re-order a vector for jdbc processing?

11:27 augustl: hcumberdale: got an example?

11:32 kes_: augustl: Thanks, sorry for the delay in response. :)

11:34 ToBeReplaced: hcumberdale: maybe https://github.com/ToBeReplaced/jdbc-format ?

11:35 pepijndevos: $findfn {:a 1 :b 2 :c 3} :a :b [1 2]

11:35 lazybot: []

11:36 pepijndevos: $findfn {:a 1 :b 2 :c 3} [:a :b] [1 2]

11:36 lazybot: [clojure.core/mapv clojure.core/map clojure.core/replace clojure.core/pmap clojure.core/keep]

11:37 pepijndevos: Since assoc can take many keys, I kind of epected there would be a way to get many keys as well.

11:38 joegallo: That would be a very easy thing to write, if you want it.

11:39 CookedGryphon: hi, I think I'm having some bad interactions between core.async and core.match

11:39 No method in multimethod 'to-source' for dispatch value: class clojure.core.match.OrPattern

11:41 actually, it might be to do with aot compilation, not core.async at all...

11:52 does anybody have any clues as to what No implementation of method: :emit-instruction of protocol: #'clojure.core.async.impl.ioc-macros/IEmittableInstruction found for class: clojure.core.async.impl.ioc_macros.Jmp means?L

11:52 justin_smith: sounds like a bug in core.async that an error like that would even show up

11:54 maybe an aot / library version mixup? see if stopping clojure, lein clean, restarting helps. That's my first goto when I get errors that don't even make any sense in terms of the code in my app.

11:54 CookedGryphon: i've done that, no joy

12:16 katox: Hey, been fighting Om lately but I'm still unclear about some state/props intents. Cut out of app init here: https://www.refheap.com/22520

12:16 dnolen: katox: can you be more specific?

12:17 katox: tried to keep the semantics more/less in line with React

12:17 seangrove: dnolen: Just pushed our first om app to production today

12:17 katox: I wanted to init the app with state and put there a chan to of events

12:18 so I expected this to belong into state

12:18 if I'm not mistaken re-render should occur after a state change

12:18 dnolen: seangrove: whoa awesome!

12:19 katox: yes re-render will occur eventually on a state change.

12:19 katox: dnolen: the problem is that the definition in the bin is somehow incomplete

12:19 tbaldridge: seangrove: "DEPLOY ALL THE ALPHA CODE!!" :-P

12:19 arcatan: \o/

12:19 tbaldridge: seangrove: "DEPLOY ALL THE ALPHA CODE!!" :-P

12:19 bleh wrong window, sorry for the report

12:19 katox: dnolen: I'm not sure what's missing, the .-props are not yet there

12:19 tbaldridge: *repost

12:20 seangrove: tbaldridge: heh, presumably the second time was to fix a bug with the alpha code ;)

12:20 tbaldridge: lol, nice

12:20 arcatan: wait, there's a jar on clojars, it can't be alpha

12:20 dnolen: katox: the first agument to the life-cycle protocols is *NOT* the owner

12:20 katox: it's the reify instance

12:20 seangrove: React is pretty sound though, it's what we were looking to build towards anyway. Om has some sharp edges and we lost ~1 day to some things, but it's definitely a net +

12:20 dnolen: katox: that's why you're code isn't working

12:21 katox: dnolen: ah!

12:24 CookedGryphon: with core.async, can you recur from the result-expr of at alt! ?

12:28 katox: dnolen: so disregarding this bug, is it okay to setup a channel in pre-render will-mount, save it into state and process it pre-render as well

12:28 pepijndevos: Huh... *ns* is clojure.core in a different namespace.

12:29 Or... I guess *ns* is not lexical...

12:29 Bronsa: pepijndevos: it is not indeed.

12:29 katox: dnolen: accummulating more changes that'll be reflected on next render

12:29 Bronsa: pepijndevos: (let [cur-ns *ns*] (defn ..)) will do what you want

12:29 pepijndevos: lol, ok

12:30 rurumate_: Help, I'm getting java.lang.ClassNotFoundException: clojure.tools.logging.impl.LoggerFactory in all :aot namespaces

12:30 what seems to be the problem here?

12:30 dnolen: katox: seems ok to me, but note if you set-state! before/during IWillUpdate phase, then all phases after it will see it

12:30 rurumate_: this used to work, just made some changes to dependencies in project.clj

12:31 hiredman: rurumate_: delete ./target and try again

12:32 jballanc: core.logic question...why doesn't this return (1)? (cl/run* [q] (cl/membero 1 '(q 2 3)))

12:33 rurumate_: jballanc: I dunno, looks like it should

12:33 hiredman: because 'q is not q

12:33 dnolen: jballanc: what hiredman said

12:33 jballanc: huh...but this does? (cl/run* [q] (cl/membero 1 [q 2 3]))

12:33 rurumate_: oh

12:33 jballanc: d'oh

12:33 yeah, ok...guess I need a refill on the coffee

12:33 :P

12:33 rurumate_: hiredman: it worked, thanks

12:34 + hiredman

12:35 maybe #clojure should get karma points

12:36 bbloom: (inc #clojure)

12:36 lazybot: ⇒ 7

12:36 bbloom: done.

12:37 S11001001: bbloom: my thought exactly

12:40 katox: dnolen: thanks, makes sense

12:40 dnolen: katox: yeah we used to pass the owner to life-cycle implementations, but it was tedious

12:41 katox: in the future Om component constructor fns may stop taking cursors as it's a potential source of confusion

12:41 katox: instead IRender would take it, and everyone else would need to get it via om/get-props

12:42 katox: dnolen: sounds more straightforward

12:42 dnolen: the bug above must have crept in when refactoring to a newer version

12:43 dnolen: somehow I couldn't find it ;) - parameter blindness

12:43 rasmusto: ,;)

12:43 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

12:43 rasmusto: ,:)

12:43 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: :>

12:44 jballanc: hmm...ok, another one -- why doesn't this terminate? (cl/run* [q] (cl/membero 2 q) (fd/bounded-listo q 2))

12:46 hiredman: what do you mean by not terminate?

12:50 dnolen: jballanc: bounded-listo isn't really relational, it needs to come first

12:51 jballanc: it a simple hack to prevent some basic bad scenarios not a real solution.

12:51 jballanc: perhaps jim duey's Arrow based work can provide more termination but I haven't had time to think about it.

12:52 hansel-han: Can anyone that's written an ebook recommend an input format? I'd like to translate my Pages.app book into something compatible with Pandoc.

12:54 technomancy: people seem to like asciidoc

12:54 that's what they used for the clojure cookbook

12:55 CookedGryphon: does anybody here understand alt!, I've been banging my head on this one line of code all day: https://www.refheap.com/0e98bf67f7a20db53acc85d6f

12:55 tbaldrid_: technomancy: I think that's mostly because the publisher only allows asciidoc. But rkneufeld would know more.

12:56 technomancy: tbaldrid_: huh. I know cemerick is always singing its praises and bemoaning markdown

12:56 which is reasonable; markdown is terrible

12:56 tbaldrid_: CookedGryphon: the event-stream should only have a single argument in the handler (val, not val ch)

12:57 CookedGryphon: I tried that too iirc, one second I'll try

12:57 hiredman: CookedGryphon: you can't recur from a non-tail position

12:57 technomancy: hansel-han: what's the book?

12:57 hansel-han: CookedGryphon: does that code actually work? alt! takes a vector of channels in that form and i don't see how alt! in that example would do anything other than hang indefinitely.

12:57 CookedGryphon: hansel-han: don't know yet, it's yet to compile

12:58 hansel-han: it's meant to wait until it's able to push to the other loop just above it

12:58 hiredman: given the result of the alt! is let bound, the bodies of the alt! are not in tail position

12:58 hansel-han: technomancy: it's not clojure or dev related. i just imagine that someone here might have some experience. i'm checking out asciidoc.

12:59 rkneufeld: technomancy: hello! We use asciidoc solely because that is what O'Reilly dictated to us.

12:59 hansel-han: rkneufeld: if you werent' constrained, would you have another preference?

13:00 jballanc: dnolen: ah, indeed...thanks for the tip!

13:00 rkneufeld: hansel-han: I like asciidoc for the features it provides, but editor integration is not great, and the tooling is klunky. I *might* try constraining myself to write a shorter book using just Markdown (a la "The Senior Software Engineer"), but that comes with some serious limitations (specifically layout)

13:01 jballanc: dnolen: I'll have to look into Arrows some more

13:01 technomancy: rkneufeld: is it accurate that asciidoc has most of the features of docbook?

13:02 hansel-han: yeah, i couldn't really see an endgame with vanilla markdown in regard to images. someone just recommended http://www.literatureandlatte.com/scrivener.php to me

13:02 rkneufeld: technomancy: I think so, I don't know for certain. I do know that in production O'Reilly staff converts the book to docbook and works with it in that format over asciidoc.

13:02 hyPiRion: If I were serious, I'd do LaTeX even for ebooks. Although you should be very comfortable in LaTeX before you go down that road.

13:02 s/were/was/

13:03 technomancy: were is actually right for that

13:03 rasmusto: what's wrong w/ LaTeX? Most of it is plain text

13:03 technomancy: fwiw

13:03 rkneufeld: I think in general, if you're new to the tools and writing, I'd start with simple Markdown and get the content down first.

13:03 rasmusto: unless you're doing tables and eqns and things

13:03 rkneufeld: A complex toolchain is a surefire way to burn tons of time avoiding the task at hand (writing a book)

13:04 hansel-han: rkneufeld: agreed. i made sure to write almost all of the content before i began looking for answers to this question. i know me. i would've let this decision blockade the book for years

13:04 technomancy: what you really need to do is invent a sexp-based publishing format and use that

13:05 hansel-han: technomancy: it took a lot of effort to not yak shave down that path when i was trying to write chapter 1!

13:06 technomancy: protip: you can use the Computer Modern font without using LaTex and everyone will still think you used LaTex so you look smart

13:06 rkneufeld: technomancy: Ha!

13:06 * kzar takes notes

13:07 * rasmusto tried taking dsp notes in latex once

13:07 bitemyapp: technomancy: spent an hour yesterday poring over neighborhoods in Seattle with a native from the city. She was another strong vote in favor of the PNW.

13:07 S11001001: technomancy: I enjoy texinfo, which gives cmr output by default

13:08 rasmusto: s/poring/pouring amirite? (pnw joke)

13:08 hansel-han: CookedGryphon: what's your intention with `[[predict-data event-history]] (recur [])`?

13:08 bitemyapp: rasmusto: it doesn't rain on the west coast, it drizzles and mists.

13:08 rasmusto: bitemyapp: we call it rain though

13:08 bitemyapp: rasmusto: I'm from Ohio, there is no rain here, just mild sneezes.

13:08 hiredman: why would you not want to use latex?

13:08 bitemyapp: in Ohio, rain means you'd get soaked in 30 seconds.

13:09 rasmusto: I just find the moaning about the rain silly given how flaccid it is :P

13:09 a light mist is refreshing :)

13:09 CookedGryphon: hansel-han: I want to accumulate events, while the long running prediction function is running, and then when that loop is in a position to accept new data, push it there

13:09 rasmusto: for sure, especially at the coast

13:09 bitemyapp: rasmusto: where are you in the PNW?

13:09 CookedGryphon: and process all the events it received in the meantime

13:09 rasmusto: bitemyapp: portland

13:09 technomancy: bitemyapp: nice; hope it works out

13:10 bitemyapp: rasmusto: cool. Paying Seattle a visit sometime in the next month or two.

13:10 rasmusto: sweet

13:10 dnolen: a pretty significant CLJS enhancement, http://dev.clojure.org/jira/browse/CLJS-615, if someone wants to apply and test that would be awesome

13:10 bitemyapp: technomancy: I was initially put off by how expensive Seattle was compared to Austin, but after running the numbers, I don't think it makes nearly as much of a difference as simply leaving the bay area will.

13:11 technomancy: bitemyapp: especially if you want to be outside the city

13:11 dnolen: also namespaced keyword destructuring appears likely for 1.6, would be nice to get this in CLJS http://dev.clojure.org/jira/browse/CLJS-745

13:11 if it happens

13:12 hiredman: CookedGryphon: have you considered a buffered channel?

13:12 bitemyapp: technomancy: eventually. I'll probably live around capitol hill initially. I won't move out of the city until I'm ready to get a house - want to soak up the area until then.

13:12 CookedGryphon: hiredman: yep, I don't think that'll give the behaviour I want though

13:12 I want predict to be doing as much work as it can

13:13 without blocking new events

13:14 I don't really know how many events to consume with a buffered channel

13:14 before I set predict off

13:14 as i want to batch as many events as I can, without waiting for idle time or anything like that

13:16 gdev: dnolen, where do I send the results of my test runs?

13:16 dnolen: gdev: ?

13:16 arrdem: whelp hackernews is still screwed... guess I'm gonna have a productive day.

13:17 gdev: dnolen, or did you just mean test it out for ourselves?

13:17 kzar: arrdem: It's been screwed all day uk time :(

13:17 (Interestingly it was displaying a cloudfare error for a while, didn't realise they were using that.)

13:17 dnolen: gdev: apply the patch, run script/build, try the installed CLJS in an existing project

13:17 arrdem: kzar: US-CENTRAL here, it's been down since about 2000HRS yesterday

13:17 dnolen: gdev: if everything works ok please say so on the ticket

13:18 TimMc: There's a lot of tech fail today. Anything systemic?

13:18 dnolen: gdev: the patch need to be reviewed, but it's helpful to know it doesn't break everything before especially for a large patch like this

13:18 kzar: TimMc: Everyone's hungover post christmas?

13:19 TimMc: Plausible.

13:19 gdev: dnolen, okay will do, sorry I forgot that I had a username on jira

13:19 arrdem: kzar: it's been more than a week man... nobody should be hung over that long

13:19 rasmusto: arrdem: you forget new years eve

13:19 kzar: my old housemates are probably still drunk now

13:20 bitemyapp: kzar: russian?

13:20 rasmusto: arrdem: oshi, it has been a week though ;o

13:20 arrdem: I mean I'm on vacation and still drinking, but that's not the point :P

13:20 TimMc: arrdem: I would ascribe it more to post-vacation knowledge loss.

13:20 bitemyapp: arrdem: you're still on vacation?!

13:20 kzar: heh

13:20 TimMc: "What's this button do again? Let's find out."

13:20 arrdem: bitemyapp: yeah. school resumes the 13th

13:21 kzar: bitemyapp: I got them some north korean rice (whiskey?) recently and they didn't waste any time

13:21 bitemyapp: kzar: I was right, wasn't I?

13:22 kzar: No, they're English / Welsh but they can drink

13:22 bitemyapp: oh that'll do it.

13:22 TimMc: I believe that conforms to stereotype as well.

13:27 stuartsierra: Peter Seibel invented his own markup format for "Practical Common Lisp"

13:28 bitemyapp: stuartsierra: are you our new "#catfacts!" person?

13:28 stuartsierra: also, done any Haskell? I'm tinkering with module parameterization there.

13:28 stuartsierra: Referencing earlier discussion with hansel-han.

13:29 bitemyapp: No, I have not used Haskell.

13:29 bitemyapp: stuartsierra: well that explains why you use Clojure I guess. Thanks anyway.

13:30 xnil: that's insulting

13:30 bvecchi: I recommend Pandoc for anything Markdown related. It can output epub among other formats.

13:30 bitemyapp: xnil: not really. Clojure's quite nice.

13:31 Cr8: I use pandoc mostly because I type in "regular" markdown, but occasionally use tools that expect "github" markdown

13:31 xnil: i'm not offended :P

13:31 i don't even use clojure, i'm just here because it's a lisp

13:31 Cr8: and pandoc can translate for me

13:32 though usually if I can choose I render w/ multimarkdown

13:32 "a lisp"

13:32 bitemyapp: xnil: have you used Shen? I've been trying to find somebody that's actually tried it.

13:32 logic_prog: bitemyapp: I bought the shen book

13:33 I also read a few chapters.

13:33 hyPiRion: bitemyapp: have you? I'm sort of tempted to.

13:33 xnil: bitemyapp: i'm having a look at it

13:33 llasram: If only the license weren't so insane...

13:33 logic_prog: overall impression: many nice ideas, but the cllojure port doesn't seem stable enough to do anything with it

13:34 technomancy: I'd be surprised if anyone invested a lot in shen with a license like that

13:34 bitemyapp: hyPiRion: I'm only curious enough to inquire, the type system isn't good enough to be worth personally investigating.

13:34 hyPiRion: if you want types, FP, and to live in the future...

13:34 hyPiRion: oh man, license

13:34 * bitemyapp pantomimes the letter H

13:34 hyPiRion: =(

13:34 xnil: bitemyapp: i've only used clojure/scheme/racket/CL/elisp myself

13:35 * arrdem needs to play with Racket sometime

13:35 bitemyapp: arrdem: Racket is kinda nice for implementing programming languages.

13:35 xnil: racket and scheme being the only ones i have any decent experience in

13:45 TimMc: OK, I just looked through the Shen spec. What's so horrible about it?

13:45 hyPiRion: TimMc: the nonfree license?

13:45 arrdem: hyPiRion: agreed.

13:46 TimMc: I mean in practical terms.

13:46 arrdem: TimMc: Shen is really cute, but the license is assinine and disuades me from using it at all

13:46 hyPiRion: Isn't the license a practical issue? :p

13:46 TimMc: Like, what's a practical scenario where this becomes a problem?

13:47 arrdem: TimMc: I don't see that I need one. I object to not being able to hack on the language core if I want to, and thus choose not to use Mark's latest creation elegant as it may be.

13:47 xnil: when you try to distribute your software, TimMc

13:47 arrdem: xnil: no read the license. you can use shen inside another project, you just can't change shen at all ever.

13:47 xnil: it's a read but don't touch "open" license

13:48 xnil: oi

13:48 bitemyapp: arrdem: it's actually impressive that somebody found a way to be more obnoxious than Clojure's CA.

13:48 xnil: how morbid

13:48 bitemyapp: almost like it was competition among Lispers to see who could attract the fewest contributors.

13:48 arrdem: bitemyapp: eh... I think the CA is entirely reasonable but w/e

13:48 bitemyapp: as if that was ever a problem for a Lisp, too many contributors.

13:48 technomancy: he's got a bit of a chip on his shoulder because he wasn't able to make a living with OSS and thinks he can blame that on the license

13:49 bitemyapp: arrdem: taken in isolation, yes, but seeing other lang communities are run, I'm not seeing it.

13:49 technomancy: need to have a knack for sales, marketing, and drumming up contract work if you want to make a living off OSS.

13:49 arrdem: bitemyapp: shrug. legal isolation is kina the first thing that I'd worry about in this case.

13:49 hyPiRion: The problem isn't really the CA itself, it is the "Please send a printed version with your signature"-issue

13:49 bitemyapp: arrdem: that's not what I said.

13:50 arrdem: 0.o

13:50 TimMc: arrdem: So if you wanted to use Shen as one component of a redistributable larger project, you couldn't tweak your copy of Shen?

13:50 technomancy: the CA is just emblematic of deeper-seated "we're not interested in your help" issues

13:50 bitemyapp: arrdem: what I said meant, "if you analyze it isolated from all counter-examples seems okay"

13:50 arrdem: TimMc: that's my understanding yes

13:50 TimMc: Huh. That *is* weird.

13:50 arrdem: exactly.

13:50 TimMc: I guess I'm not too bothered by that, though.

13:51 How many people ship an altered version of Clojure?

13:51 bitemyapp: technomancy: it's particularly offensive how it locks out people from countries with less than reliable/practical mail delivery.

13:51 arrdem: Mark actually has an essay somewhere in which he defends this model...

13:51 xnil: bitemyapp: CA?

13:51 hyPiRion: TimMc: I do all time, sort of

13:51 bitemyapp: tl;dr I want somebody else to sacrifice their time so I can hear about Shen.

13:51 arrdem: xnil: Contributor Agreement

13:51 technomancy: TimMc: it was really common in the pre-1.2 days

13:51 TimMc: I can see doing that for an internal project, of course, but who'd do that with a redistributable?

13:51 hyPiRion: I use cl-format and there's this bug

13:51 technomancy: we patched it to fix locas-clearing bugs

13:51 bbloom: *shrug* it would be nice to have an electronic CA, but sheesh people, it literally takes ~120 seconds and a stamp to submit. Given the amount of time invested in a quality patch, a physical CA is such a silly thing to complain about

13:52 arrdem: bbloom: haha. took me an hour, but only because I included a letter with it :P

13:52 TimMc: bbloom: I don't have a printer. Some people don't live in the US. I want to contribute *now*.

13:52 ^ Three main reasons.

13:53 arrdem: TimMc: so sign the bloody thing, photograph it, email it to me and I'll mail it for you

13:53 TimMc: heh

13:53 Does that pass the lawyer test?

13:53 technomancy: just bribe someone with a CA to submit it under their own name

13:53 problem solved

13:54 hyPiRion: bbloom: I had to buy an envelope, figure out how many stamps for overseas mail, buy said stamps, then do those steps you mentioned. Also wait 2 weeks.

13:54 It's not really about time though, it's about lowering the barrier

13:55 bbloom: TimMc: i don't know how any modern geek survives without a printer. i hate printing shit and avoid it often, but sometimes you gotta friggin do paperwork here on planet earth. the non-US thing is the only real issue for some folks, and even that it's not a big issue. the contribute "now" thing is silly because your patch isn't even going to get looked at for weeks/months, so why the rush?

13:55 TimMc: bbloom: Most patches aren't all that complicated. You want to lower the barrier for simple, initial participation so that the same people can then go on to submit bigger and better patches later.

13:55 bbloom: Because I don't want to spend time/effort on a patch until I know it will matter.

13:56 technomancy: I only got a printer recently when we started homeschooling

13:56 everyone reasonable accepts things signed on a tablet

13:56 bbloom: TimMc: so email the list & ask if such a patch would be considered/accepted

13:56 TimMc: bbloom: It's all fine and dandy that this isn't a barrier for you, but I think you should listen when other people say it's a barrier for them.

13:56 pmonks: +1 - DocuSign etc. aren't that hard to use...

13:57 bbloom: TimMc: i understand it's a barrier for some folks & think it's silly it hasn't been addressed yet, but everybody acts like it's the end of the world

13:57 pjstadig: yay! The semi-whatever CA rant

13:57 TimMc: *shrug* It is part of why I have given up on contributing to Clojure.

13:58 pjstadig: Monthly, I think.

13:58 bbloom: TimMc: my view on this changed when i started getting a few PR from folks on some github projects

13:58 reviewing a patch is A FUCKLOAD OF WORK

14:00 it's a crappy filter, but if the activation energy of buying some stamps is too high, then i'm probably not interested in your contributions. at this point, there are enough contributors & users that major issues will be fixed immediately if discovered & anything else is not in any rush what so ever

14:00 there are clearly much better filters

14:00 and i'd prefer clojure used a better filter :-P

14:01 TimMc: The larger issue is the general hostility towards patches.

14:01 bbloom: so that's the much more interesting topic, IMHO

14:02 like i said: patches are a lot of work

14:02 TimMc: Sometimes I think Core's preference is to remain bug-compatible instead of fixing bugs. And that way lies Win32.

14:03 bbloom: eh, Win32 only happens when you keep moving forward at 200MPH and maintain bug compatibility. clojure is moving much much much much slower than windows ever did

14:03 mdrogalis: bbloom: I'm reading this conversations backwards for funsies, but for non-Americans, the price to get a CA is extraordinarily high.

14:04 Something on the order of $300 for some places in EU.

14:04 bbloom: $300 to mail a letter to the US!?

14:04 hyPiRion: mdrogalis: @_@

14:04 bbloom: i don't believe that

14:04 mdrogalis: Yeah, I was stunned too. Let me find the tweet chain.

14:05 https://twitter.com/michaelklishin/status/398168946194780161

14:05 $153. Kinda of off, but not totally.

14:06 bbloom: i still don't believe this

14:06 koreth__: You don't have to use FedEx. Regular mail is not $153 even from Russia.

14:06 mdrogalis: koreth__: I assume you signed it from Russia?

14:06 bbloom: yeah, seriously

14:07 koreth__: No, but I have been to Russia and sent stuff from there to the USA for less than that.

14:07 bbloom: people send postcards from all over the world for a buck or two each

14:07 mdrogalis: I kind of sway back and forth on this topic because I never know how much it *actually* costs. I never tried to mail something internationally.

14:07 arrdem: I wonder if a CA microdotted onto a postcard would count...

14:08 mdrogalis: lived in the UK for three years, international mail gets silly fast

14:08 bbloom: mdrogalis: USPS for a letter form US to Russia is $1.10

14:08 mdrogalis: i dunno about the other way

14:08 i can't imagine it's dramatically more

14:08 mdrogalis: Perhaps someone should tell Klishin that.

14:08 pjstadig: i think the reason that people might use FedEx is because otherwise you don't get reliable delivery or something

14:09 mdrogalis: Ah

14:09 technomancy: send ten copies of a CA using cheap mail

14:09 mdrogalis: Flooded Durham

14:09 technomancy: that's totally not ridiculous, yeap

14:09 bbloom: technomancy: lol was literally going to suggest TCP mailing

14:11 katox: dnolen: I just caught myself in the bug you mentioned

14:11 dnolen: katox: yes, props will only be what you think it is in render, it could be something different elsewhere

14:12 katox: dnolen: created (om/build component app-state opts) and defined component as (fn [app opts])

14:12 dnolen: the arity checker is fine with that but it is super easy to slip this in

14:14 dnolen: katox: oh that's different problem really, Om might get more runtime validation during development to catch simple errors

14:15 koreth__: To beat a dead horse, I was curious and went to the Russian post office's web site. The cost to mail a *registered* letter via air mail to the USA is the equivalent of US$2.50. http://www.russianpost.ru/autotarif/Autotarif.aspx?viewPost=13&countryCode=840&typePost=2&viewPostName=Registered%20letter&countryCodeName=USA&typePostName=AVIATION&weight=5&value1=1&postOfficeId=0

14:16 bbloom: koreth__: well there you have it :-)

14:16 katox: dnolen: yeah, I should have written similar not the same

14:16 bbloom: mdrogalis: you're in charge of telling Klishin

14:16 pmonks: Writing and contributing patches can be hard work. Reviewing patches can be (usually is) hard work. There's enough hard work in the contribution process already that it seems rather silly to add more incidental effort by requiring CAs in dead tree format.

14:17 katox: dnolen: the cause the var/param containing something different than one'd expect

14:17 technomancy: pmonks: well if you drive people away, there's less work for you as amaintainer

14:17 pmonks: Are you really a maintainer then?

14:17 mdrogalis: bbloom: *Huge sigh* I have to *do* something?

14:17 TimMc: bbloom: I assume the guy knows what he's doing re: mail.

14:17 mdrogalis: Knew I should have just lurked.

14:18 pjstadig: pmonks: sure, you maintain status quo

14:18 technomancy: pmonks: no comment

14:18 bbloom: TimMc: apparently not

14:18 pmonks: :-D

14:18 tbaldrid_: bbloom: technomancy: while we're on the subject of OSS community structure I found this talk interesting: http://vimeo.com/82175816

14:18 TimMc: bbloom: I remember this conversation. He specifically said that regular mail was just not reliable enough.

14:19 tbaldrid_: it's basically a 40min talk about distributed "lock-free" teams of people maintaining code via github.

14:19 bbloom: TimMc: i'm skeptical

14:19 pmonks: I'll shut up now - I'm too dumb to ever be likely to contribute to Clojure (though both maintain and contribute to other OSS).

14:19 TimMc: I mean, he lives in Russia, I don't. It seems silly to me, but I don't have enough information.

14:19 pjstadig: "YOUR PERSONAL EXPERIENCE IS INVALID!"

14:19 insamniac: ,(partition 2 '(+ 4 * 3 - 7))

14:19 clojurebot: ((+ 4) (* 3) (- 7))

14:20 insamniac: ,(-> 2 (+ 4) (* 3) (- 7))

14:20 clojurebot: 11

14:20 insamniac: but how do i make this do that:

14:20 ,(-> 2 (partition 2 '(+ 4 * 3 - 7)))

14:20 clojurebot: ((+ 4) (* 3) (- 7))

14:20 insamniac: :(

14:21 mdrogalis: Alright, I told him.

14:21 Now we wait.

14:21 bbloom: TimMc: my GF is a flight attendant. her nephew in Tennessee had a class project to get postcards from family members. the nephew won by a landslide b/c she sent post cards from all over the world. i just texted her, she said she sent a postcard from saint petersburg for a few bucks & it got there in about a week

14:21 TimMc: insamniac: What is the intended result there?

14:21 insamniac: i want to thread 2 through the results of the partition

14:21 instead of threading it into the form that starts with partition

14:21 mdrogalis: Reply: https://twitter.com/michaelklishin/status/420273418433740800

14:21 TimMc: bbloom: The two complaints were latency and reliability.

14:22 (and the variability of that latency)

14:22 TEttinger: ,(map #(-> 2 %) (partition 2 '(+ 4 * 3 - 7)))

14:22 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn>

14:22 insamniac: zoinks

14:22 bbloom: TimMc: ok, so cost is not a significant barrier. latency for a postcard was about a week, but yes, can vary to many weeks, and i just don't believe that reliability is that big an issue

14:23 TimMc: My point isn't that you *can't* get a letter from point A to point B, it's that telling someone they may have to wait up to 3 month and send 10 copies is not particularly friendly.

14:23 TEttinger: ,(map (fn [[f arg]] (f 2 arg)) (partition 2 '(+ 4 * 3 - 7)))

14:23 clojurebot: (4 3 7)

14:23 bbloom: i'm saying that it's more like up to 6 weeks and it's not 10 copies, it's 1.02 on average

14:23 TimMc: insamniac: -> is a macro, it's modifying the call to partition

14:24 ##(macroexpand-1 `(-> 2 (partition 2 '(+ 4 * 3 - 7))))

14:24 lazybot: ⇒ (clojure.core/partition 2 2 (quote (clojure.core/+ 4 clojure.core/* 3 clojure.core/- 7)))

14:24 bbloom: TimMc: and if you'll recall what i said at the beginning, i agree that the CA should be electronic & that the international complain is the only legitimate one

14:24 TimMc: OK.

14:24 bbloom: complaint*

14:25 mdrogalis: bbloom: Klishin says he's gonna beat you

14:25 .. That didn't actually happen

14:25 TEttinger: ,(map (fn [[f arg]] (f 2 arg)) (partition 2 [+ 4 * 3 - 7]))

14:25 clojurebot: (6 6 -5)

14:25 insamniac: yeah, so instead i want to use the macro to thread the value 2 through the result of partition

14:25 ,(-> 2 (+ 4) (* 3) (- 7))

14:25 TEttinger: ok, the problem was it remained quoted

14:25 clojurebot: 11

14:25 insamniac: is there a pretty way to do that?

14:25 pjstadig: insamniac: right, but the result of partition isn't available until runtime, and macros happen at compile time

14:25 TEttinger: oh you want reduce

14:26 ,(reduce (fn [base [f arg]] (f base arg)) 2 (partition 2 [+ 4 * 3 - 7]))

14:26 clojurebot: 11

14:27 TimMc: insamniac: (-> FOO (partition BAR BAZ)) is (partition FOO BAR BAZ)

14:27 insamniac: there we go

14:27 thanks

14:27 TEttinger: no prob

14:31 oh, insamniac, I don't think it will work on a quoted list. a list may need to be converted to vector first

14:31 ,(reduce (fn [base [f arg]] (f base arg)) 2 (partition 2 '(+ 4 * 3 - 7)))

14:31 clojurebot: 7

14:31 TEttinger: yeah, just the last element in the list

14:32 pjstadig: with a vector + * and - are actually evaluated to vars, which can be called to invoke their functions

14:32 with a quoted list you are calling the symbol '+ or '* or '- which will return its second argument because the first isn't a map (i think)

14:33 ,(+ 2 7)

14:33 clojurebot: 9

14:33 pjstadig: ,('+ 2 7)

14:33 clojurebot: 7

14:33 pjstadig: ,('+ {'+ :foo} 7)

14:33 clojurebot: :foo

14:33 TEttinger: I'm actually not sure how to unquote in clojure, I almost never use quotes

14:33 pjstadig: ,((eval '+) 2 7)

14:33 clojurebot: 9

14:33 pjstadig: TEttinger: eval

14:33 xnil: ,`(,+ 2 7)

14:33 clojurebot: (clojure.core/+ 2 7)

14:34 pjstadig: or you could resolve-var

14:34 TEttinger: yeah, that's why I guess. my lazybot forbids eval

14:34 clojurebot: Titim gan éirí ort.

14:34 xnil: or quasiquote.

14:34 justin_smith: ,(resolve '+)

14:34 clojurebot: #'clojure.core/+

14:34 technomancy: ,(doc resolve-var)

14:34 clojurebot: excusez-moi

14:34 llasram: xnil: Your common lisp is showing :-)

14:34 pjstadig: fine...resolve then

14:34 llasram: ,`(~+ 1 2)

14:34 clojurebot: (#<core$_PLUS_ clojure.core$_PLUS_@cf767d> 1 2)

14:34 llasram: But you never see that in practice

14:35 technomancy: pjstadig: I thought it was something I didn't know about, heh

14:35 xnil: lol

14:35 justin_smith: resolve is probably the most lightweight / idiomatic way to go from symbol to fn via var

14:35 ,((resolve '+) 1 2)

14:35 clojurebot: 3

14:35 TimMc: Nonsense, what you *really* want to do is spit to disk with some wrappings and then load-file.

14:35 Clearly superior.

14:35 justin_smith: heh

14:36 pjstadig: or just write a compiler

14:40 dhkl: #node

15:07 gtrak: is there an overview of om-cursors and the 'build' fn anywhere yet? trying to figure out how that works :-).

15:10 noonian: i've just started with om, but my understanding is you call build passing a component, a cursor to be passed to that component, and a map, and anything you put in a map for the :opts key in that map will be passed to the component as a third argument

15:11 the cursor is your app's state, but it also has info about the path from the root of that state, you can treat it like a map inside your components

15:13 so if your state is (atom {:m {:foo 17}}) and passed to your root component as 'app', then if you passed a sub-component (:m app) it would get a cursor that acts like {:foo 17} but you update it using om/transact! or om/update! and it can be passed as a cursor to other components

15:14 gtrak: hmm, the cursor is the state, then?

15:14 right, there's the get-props function to get it back out

15:15 err, hmm. get-state returns __om_state, get props is __om_cursor

15:15 clojurebot: You don't have to tell me twice.

15:16 gtrak: it doesn't seem like om-cursor contains state that we're supposed to rely on

15:16 but rather framework bookkeeping

15:17 noonian: uh, it depends on which state you want

15:17 get-state returns the state of the component, which I haven't been using really

15:18 the cursor is the state of your app at any given moment with info about how to get to it's position relative to the root app's state

15:20 you could modify the simple example on the github page like this to see an example of using the data in the cursor: https://www.refheap.com/22526

15:21 if you wanted the data to change you would wrap it in an atom

15:22 gtrak: ah, so that map {:name "Jim"} get merged in with whatever it takes to be a cursor.

15:22 noonian: but still treat the cursor like a map

15:22 right, it will be a cursor when the component gets it, but you can read from it like a normal map

15:22 gtrak: since you never actually call to-cursor yourself

15:22 I see..

15:22 noonian: i don't think so

15:23 gtrak: so, when the examples use 'build', they're passing along the cursor that's passed into the top-level component

15:23 noonian: if you used (atom {:name "Jim"}) and you wanted to update it in the component you could do (om/update! data assoc :name "Bob")

15:23 right

15:23 gtrak: that makes more sense :-)

15:24 noonian: in the todo example he passes sub-trees of the top-level state, but you can still use update! on it and things because as a cursor it knows how to find that sub-tree in the root state

15:24 this is totally just my understanding btw and I might be off on a few points

15:25 gtrak: yea, np, pre-alpha, at our own risk and all that :-).

15:25 fredyr: noonian: just a small thing, in your update example

15:25 noonian: you need to specify the path

15:26 (om/update! data [] assoc :name "bob")

15:26 noonian: i don't think update! expects the path, isn't that for om/transact! ?

15:27 fredyr: well, it did at least

15:27 i might have changed since

15:28 dnolen: noonian: both use cursor path information, it's just that transact! can take additional path information

15:29 gtrak: cursors are just wrappers around CLJS collections that tracks path information

15:29 gtrak: kind of like a weak form of zippers

15:29 noonian: right, update! just uses the path of the cursor you give it and gives the data at that cursor's path to your update fn

15:30 dnolen: gtrak: cursors also represent a kind of weak policy, because applications will be concurrent you can't manipulate cursors outside of the render phase, you can only use them to update app state.

15:31 gtrak: what's it mean to manipulate a cursor?

15:31 dnolen: gtrak: any operation at all beyond updating the app state

15:31 gtrak: printing, collection operations, all invalid

15:32 gtrak: say, re-rooting a component?

15:32 in the dom?

15:32 just trying to think of a use-case

15:32 dnolen: gtrak: there's no such thing in React as re-rooting

15:33 gtrak: you will destroy something in one location in the DOM and just recreate it somewhere else.

15:35 bbloom: which is not ideal, but probably not a problem in practice unless your app is 100% focused on drag/drop of excessively complex components :-)

15:38 dnolen: this is a pretty awesome write up on Om which pretty much "gets it" http://adamsolove.com/js/2014/01/06/om-experience-report.html

15:39 gtrak: ah, great

15:41 bbloom: nice

15:43 noonian: thanks

15:44 bbloom: dnolen: heh i like this line in the conceptual overview: "While it may not seem so at first, it's useful to preserve something like React's component local state for two reasons"

15:44 :-P

15:45 avshalom: is there the equivalent of (progn ...) in clojure? I noticed this in emacs lisp, but haven't seen it in clojure

15:45 bbloom: avshalom: do

15:45 avshalom: many constructs have implicit dos however, like fn and let bodies

15:45 avshalom: bbloom: ah, thank you

15:45 gfredericks: bbloom: holy smokes you're right (about removing cons from ISeq)

15:46 dnolen: bbloom: heh yeah I totally didn't get what you were saying before, totally get it now

15:46 gfredericks: I would've bet upwards of five imperial dollars that wouldn't have compiled

15:46 dnolen: bbloom: React's setState decoupled from rendering is a rock solid idea

15:46 bbloom: always being able to detect state transitions is *rocking*

15:47 jergason: do i need to declare functions before I can use them?

15:47 or does that all get worked out at compile time?

15:47 bbloom: jergason: generally, declare before use

15:47 jergason: there is a "declare" function for late binding, but it's recommended that you only use it for mutual recursion

15:48 jergason: man im coming from LOOSY GOOSY javascript where everything gets hoisted for you

15:48 bbloom: dnolen: i'm really enjoying the evolution of your thinking on this b/c it's a deep lesson in how two super smart people in the same field can just talk right past each other :-)

15:48 jergason: and then running stuff in the repl convinces me it is all in scope at the same time

15:50 bbloom: jergason: yeah, can be misleading that way. sometimes i restart my repl just to make sure i got my declaration order right. i know that dnolen just slaps some extra declare statements in there & patches it up later, which is also a totally valid approach

15:50 logic_prog: dnolen: one of the main thesis of facebook react is "dom updates are expensive, so let's batch them together, opengl-rendering-style, in a requestAnimationFrame" to reduce # of re-flows

15:50 dnolen: is this logic still true if I only manipulate svg nodes, and no css/html nodes?

15:50 bbloom: logic_prog: yes

15:50 logic_prog: dnolen: i.e. my entire webpage is just one gigantic SVG element

15:50 dnolen: logic_prog: yes they are still in the DOM

15:50 logic_prog: bbloom: why? why would an svg element trigger a reflow

15:50 jergason: logic_prog: when you say it like that it is weird that more people aren't doing this

15:50 bbloom: logic_prog: reflows are probably the biggest issue, but not the only one

15:51 schaefer: re Om/React - is there a way to incorporate third-party (non-react) JS widgets?

15:51 bbloom: logic_prog: consider styles too. anything that gets computed by flowing data through dom relationships must be computed on read

15:51 gfredericks: bbloom: so I think removing it prevents programs such as: ISeq x = PersistentList.EMPTY; ISeq y = x.cons(42);

15:51 logic_prog: jergason: yeah, at some point I was like css: absolute, static, relative -- this shit sucks. I just want to say "you, go put yousefl at 50,50

15:51 gfredericks: apparently clojure's java source just doesn't ever do that

15:51 dnolen: schaefer: I think integrating React components is simple

15:51 bbloom: schaefer: yes, see the "refs" in the react docs

15:51 schaefer: http://facebook.github.io/react/docs/working-with-the-browser.html

15:52 dnolen: schaefer: any solution for doing that in React probably valid for Om too.

15:52 logic_prog: bbloom, dnolen: noted, thanks for clarifications

15:52 gtrak: dnolen: I can almost make something useful after ~1 hour of looking at it, so it's not *that* bad :-). I did some game programming in school, it feels like the update/render loops of a scene-graph. One of the exercises we had to do was to make update and render run in separate threads.

15:52 bbloom: gfredericks: something like that :-)

15:52 gtrak: but that was C#.. clojure's way better at this :-)

15:52 seangrove: I think it might be good to give a talk at the first SF cljs meetup on Om

15:52 Seems fitting

15:53 schaefer: bbloom dnolen : thanks! i'm primarily a server-side guy building a UI (almost) for the first time. i'm familiar with JS frameworks like Vaadin and RAP but I don't really understand their underpinnings

15:54 bbloom: dnolen: adam's comment about FRP/Rx dataflows rings so true to me

15:54 dnolen: bbloom: 100% agree

15:54 bbloom: dnolen: "yeah, it looks nice now. but you played compiler in your head, manually represented a dataflow... then changed some shit & need to recompile manually too!"

16:16 kschrader: dnolen: Any talks scheduled in NYC about Om?

16:17 dnolen: kschrader: yes I think when it's a bit more fully baked

16:17 kschrader: cool, will watch my giant flood of Meetup emails for something

16:18 petehunt: seangrove: if there's an sf om meetup i'd be happy to represent team react

16:26 tommo: i'm using clojure as a scripting language for my game and i'm trying to load a clojure class at runtime

16:26 but when i try to instantiate it with newinstance

16:26 i get this exception: Caused by: java.io.FileNotFoundException: Could not locate cljscript__init.class or cljscript.clj on classpath

16:26 the compiler doesn't seemto be outputting a __init suffix on any of the output classes

16:27 technomancy: tommo: are you using gen-class?

16:27 tommo: actually scratch that apparently it does

16:27 i see it right here, and yes

16:27 so it literally just isnt on the classpath for some weird reason then...

16:27 gtrak: tommo: seems like you should use the clojure runtime itself to require and load namespaces, any reason why not?

16:28 tommo: simply because i already had a scripting api which used java and loaded scripts from classes so i thought it would be a simple impl

16:28 so i should go for that instead gtrak ?

16:28 gtrak: yea

16:29 you don't want to be subject to load-order issues

16:29 tommo: thanks

16:30 gtrak: here's an example: http://en.wikibooks.org/wiki/Clojure_Programming/Tutorials_and_Tips#Invoking_Clojure_from_Java

16:30 1.6 (not released yet) has a new api for this though

16:31 tommo: cool, will keep my eyes open

16:31 gtrak: might be informative: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/api/API.java

16:32 oh huh, I thought that had more in it

16:38 stuartsierra: The Java API is new in Clojure 1.6.

16:39 oh, someone already said that. nevermind.

16:46 gfredericks: somehow it wouldn't have even ocurred to me to try to fix that problem; but now that clojure.api exists it seems obvious that it had to be fixed :)

16:47 stuartsierra: The "unofficial" API has always been RT.var and Var.invoke.

16:47 gfredericks: which made sense to me since I understand what vars are

16:49 but anybody who doesn't has to conclude that calling clojure from java is hard/weird

16:50 wait it didn't actually get any easier did it?

16:50 * gfredericks goes back to look

16:51 hiredman: *shrug* it still is an ffi, clojure is not java

16:53 gfredericks: I think it was just the fact that it takes two calls to call something; but I guess one call would be a perf antipattern

16:53 tbaldrid_: gfredericks: two callse?

16:53 *calls?

16:53 gfredericks: tbaldrid_: one to look up the var, the other to call it

16:54 bbloom: the var lookup is static at compile time in clojure

16:54 hiredman: gfredericks: but the lookup should be in a static init anyway

16:54 tbaldridge: gfredericks: right, the correct way is to look up the var once, and cache it, then call it whenever needed

16:54 akhudek: is there a better way to build specialized namespaces than https://github.com/Prismatic/hiphip/blob/master/src/hiphip/double.clj ?

16:54 gfredericks: tbaldridge: bbloom: hiredman: yep that's what I meant by "perf antipattern"

16:54 bbloom: akhudek: hiredman surely has a macro for you :-)

16:54 hiredman: http://dev.clojure.org/jira/browse/CLJ-1188 http://dev.clojure.org/display/design/Improvements+to+interop+from+Java

16:56 akhudek: I took a pass at changing how hiphip does it https://github.com/hiredman/hiphip/blob/foo/src/hiphip/impl.clj

16:56 the macro isn't very generic and could be better

16:56 tbaldridge: gfredericks: at any rate, it's better than it would be in something like Python. There you'd have to lookup the fn from the module every time you want to call it, that is if you want it to respond to redefs. That's something I see as a major plus in Clojure. Vars are first class, not a entry in a hashmap.

16:57 hiredman: part of the complication is due to the reader qualifying symbols based on *ns* at read time and resolving classes that way to

16:57 vars are super!

16:57 gfredericks: tbaldridge: that's an interesting point

16:59 akhudek: hiredman: is there an advantage to doing it this way?

17:00 stuartsierra: tbaldridge: Yeah, hadn't thought of it that way. There's a performance cost to deref'ing the Var, but that's better than a hash lookup.

17:00 hiredman: akhudek: way less gross in my opion than the read-string thing

17:02 bbloom: stuartsierra: yup, it's just an extra pointer indirection, which the JVM chews through like nobody's business

17:03 hiredman: another alternative might be some using load or load-file directly, which would make the existing approach more palatable to me

17:03 akhudek: hiredman: what are the issues with the load-string approach?

17:04 hiredman: akhudek: the macro approach in generally will play nicer with clojure's compilation model

17:05 with the macro approach once the code has been compiled you don't need the compiler any more, with load-string you need the compiler twice

17:06 e.g. once to compile the call to load-string, then once when load-string is actually executed

17:06 akhudek: hm, maybe there is a smarter way to accomplish what I'm attempting than specializing namespaces

17:07 I'm trying to extract schema's from sql databases into clojure code, then having a set of functions/macros be sepcialized to each extracted schema

17:07 hiredman: statically parameterizable namespaces would be nice

17:07 with the macro approach you get real line numbers in errors too

17:08 (as real as you ever get from clojure)

17:08 akhudek: that would be very helpful

17:10 hiredman: there was a neat haskell(based?) module system released recently

17:10 http://plv.mpi-sws.org/backpack/

17:11 it would be interesting to build something like that for clojure as a replacement for the ns macro

17:12 akhudek: this also reminds me of c++ templates

17:12 hiredman: oh sure

17:12 very similar with the same code explosion

17:13 the load-string approach is the same

17:13 akhudek: yeah

17:13 an inherits the same "where the hell did that error come from?" I suppse

17:13 hiredman: maybe? I dunnoo

17:21 akhudek: the basic design problem I have is https://www.refheap.com/22535

17:34 bitemyapp: arrdem: http://i.imgur.com/97juRl7.gif

17:44 hiredman: akhudek: how fluid do you expect the schema to be? e.g. do you need to generate the code for the schema everytime?

17:46 akhudek: hiredman: no, it will be updated rarely. The prototype code I have actually generates a file for it as a preprocessing step. But it could also be done using a memoized call every time the app is compiled.

17:47 Not sure which approach is better. Probably the latter as it saves having an extra lein plugin and would also catch differences between production and dev schemas.

17:48 Well, assuming you don't aot compile I guess. So maybe not much of a difference.

17:49 hiredman: akhudek: you could also just generate the clojure code once and check it in

17:49 (some people seem to be allergic to this approach though)

17:51 akhudek: hiredman: yeah, though I prefer regenerating it as part of the build process. A big motivation for this is to catch errors in user code that talks about database objects. So if your database changes in a bad way (e.g. remove a needed column), then the app code will fail to compile. If you generate once you lose this.

17:51 generate the schema once, that is

17:52 [Neurotic]: Quick stupid question - easiest way to do a boolean check if one string is in another? re-find?

17:52 hyPiRion: .contains

17:52 Raynes: &(.contains "foo bar baz" "bar")

17:52 lazybot: ⇒ true

17:52 hiredman: akhudek: use core.typed, generate the clojure code once, regenerate the type information everytime and see if it type checks :)

17:52 [Neurotic]: ah just use the interop

17:52 fair enough. Cool, will do that then. tag

17:52 tha*

17:53 tah* :/

17:56 hiredman: http://research.microsoft.com/pubs/173076/information-rich-themes-v4.pdf

17:56 akhudek: hiredman: That would be cool, but how would it handle multiple schemas? E.g. using multiple databases? I need to look into core.typed more deeply. Are you thinking of an approach where you have a 'column' type? Can you define a set of keywords as belonging to a type?

17:58 seangrove: petehunt: Well, a CLJS meetup with a talk on Om

17:58 But maybe we'll just do lightning talks and put Om off until next month, give it a little time to settle

17:58 akhudek: hiredman: thanks, that looks very interesting, will read through it

17:58 bitemyapp: seangrove: when is this happening?

17:59 hiredman: akhudek: I dunno, I was sort of joking, it depends on how far you want to push it to what extend that would be useful and how much type annotating you would need to do

17:59 seangrove: bitemyapp: 27th, I think

17:59 Waiting for confirmation from Etsy in SF

18:00 They're being awesome about hosting it

18:00 bitemyapp: seangrove: is it reasonable to assume CLJS'ers would be interested in the wider scope of functional ->JS languages?

18:00 seangrove: Probably a good fit for a lightning talk

18:00 bitemyapp: that's what I intended

18:00 seangrove: the 27th would be enough time for me to present on Fay and what kind idioms arise there for things like DOM interaction.

18:00 seangrove: I'd like to see that as well

18:01 hiredman: if you want some kind of tool to catch errors at build time core.typed seems reasonable

18:01 bitemyapp: seangrove: okay, I'll pencil in hammering out a lightning talk for Fay as my co-project alongside the ElasticSearch stuff I'm doing for Simonides.

18:02 seangrove: With all that extra "free time" you have ;)

18:02 bitemyapp: oh yes, tons. I'm positively swimming in free time while trying to get cantankerous half-assed parsers working. :)

18:02 actually, the most recent one has been pretty great.

18:02 and the author is very communicative.

18:02 seangrove: been to Chaya SF yet?

18:03 akhudek: hiredman: I'm not entirely sure where I'm going with this. The current prototype stuff is really quite simple, it just synthesizes some common sql queries. The macro provides checking on column and table names and automatic retrieval by primary key. Our code base has a lot of this sort of boring boilerplate. Something more clever using types could be useful though. Either way, seems like an interesting paper worth reading through.

18:03 seangrove: bitemyapp: By the way, thanks for the tip on ansible. Marissa had it up and running super smoothly in 1.5 days, never doing any sysadmin stuff before

18:03 bitemyapp: I think I might have meet someone there a few years ago, not sure...

18:03 bitemyapp: seangrove: yeah ansible is probably the best choice for anybody who hasn't developed any bad habits already.

18:04 seangrove: ansible is a bit harder for me to swallow because I'm sitting on a massive stockpile of idempotent Python code, haha.

18:04 it's like trying to get a Common Lisp user to give up their micro-language ecosystem built on the back of sacrificed goats and macros.

18:05 sshack: So what are people using for SQL schema migrations these days? Lobos is missing quite a few of PG datatypes I'd like to use.

18:05 bitemyapp: sshack: use Migratus.

18:05 akhudek: sshack: we use flyway

18:05 bitemyapp: sshack: it's practical, lets you write straight-up sql files, and handles merges intelligently.

18:05 sshack: Will look at both

18:05 bitemyapp: sshack: downers? it's a bit pissy about filenames and timestamp formats.

18:06 akhudek: flyway is similar

18:06 sshack: flyway is java. Recommendations for a clojure based solution?

18:06 bitemyapp: Also, I'm pretty sure the author of Migratus is a crypto-fan of Max Headroom. neutral on that one.

18:06 sshack: Migratus is Clojure.

18:07 sshack: it's a leiningen plugin.

18:07 akhudek: sshack: flyway has a command line app and there is a lein plugin, though we don't use the lein plugin.

18:07 sshack: bitemyapp: Currently maintained?

18:07 bitemyapp: sshack: as maintained as it needs to be.

18:07 sshack: akI shall look into it some more then.

18:07 bitemyapp: there's only so many things you can do with executing SQL files based on migration history.

18:07 sshack: bitemyapp: Point.

18:08 bitemyapp: sshack: Clojure projects tend to become "done" faster than those in languages like Java

18:08 this can sometimes make it hard to tell what's "unmaintained" vs. merely "done"

18:08 rasmusto: how can something that's "infinitely extensible" ever be done?

18:08 :P

18:09 bbloom: rasmusto: just put the extensions outside the radius of the done core & you're good :-)

18:09 sshack: bitemyapp: Have you used migrates with heroku? I don't think there would be any gotcha's, but it never hurts to ask.

18:10 bitemyapp: sshack: hum. I dunno. Only thing is getting the URL syntax right?

18:10 sshack: That shouldn't be a problem.

18:10 bitemyapp: sshack: I generally used a local or production postgres instance with migratus.

18:10 rasmusto: bbloom: ah, ok. speaking of which, is there a good code analysis tool that'll tell me what fns I'm using and which I can deprecate? All of my stuff is contained in a single project

18:10 sshack: Well, I'll have to give it a try.

18:11 bitemyapp: sshack: best way to roll. And seriously though, it's pissy about the filenames. Find a filename example and work off of that.

18:11 rasmusto: kibit/bikeshed?

18:11 sshack: bitemyapp: Thanks for the hint.

18:13 bitemyapp: sshack: I mention this because the last time I used migratus I raged for like an hour trying to remember the fucking format. It's a goddamn death-trap.

18:13 but once I got it working with my own little migration file generator, I was in heaven.

18:14 sshack: Why did you write a migration generator?

18:15 bitemyapp: it's not a migration generator

18:15 it's an empty file maker that injects the format into the filename that migratus expects

18:15 because it wants a migration name and timestamp.

18:16 sshack: That format makes perfect sense to me

18:16 It's exactly how I'd do it.

18:17 bitemyapp: sshack: well you'll probably jive with pjdstadpidfgjdkgahhhhconsonantsfndig's way of thinking then

18:19 devn: tbaldridge: hola

18:19 tbaldridge: you around?

18:19 tbaldridge: devn: yeah

18:19 devn: ah sweet!

18:19 i was going to try and goad you into taking a moment to weigh in on an overtone thread

18:20 tbaldridge: https://groups.google.com/forum/#!topic/overtone/RmhlMQJL6-k

18:20 sshack: bitemyapp: Who is pjd...?

18:20 devn: see the post at the bottom: sam's questions related to replacing the event system in overtone with core.async

18:21 bitemyapp: sshack: look at migratus' github.

18:22 sshack: ahh.

18:22 devn: tbaldridge: with some guidance, i think sam and company could be convinced, but i simply cannot speak to some of the questions he's raising at the moment

18:24 tbaldridge: devn: I think the main problem would be with the way concurrency is handled in the two systems. Overtone likes to have "hard eventing" I'll call it.

18:24 That is to say, you can say "run this event at this ms, not one ms sooner or later".

18:25 Core.async uses alot of queues, and each time an event/go gets scheduled it gets thrown into a thread pool, the exact time that events are run is undefined.

18:25 devn: more "scheduling" than eventing

18:25 sshack: bitemyapp: Ahh I see you wrote a little scaffold generator for migrates id-name-dir-timestamp.sql

18:25 tbaldridge: yeah

18:25 devn: tbaldridge: surely there's some disgusting hack to make that happen in core.async 3:)

18:26 sshack: What -;; separator requirement is annoying. it'd be nice to just have raw sql files.

18:26 devn: s/in/with

18:26 tbaldridge: for some of the stuff he's talking about, i agree with you, it's all about scheduling

18:26 but for other things, the current "at this ms" thing doesn't really map 1:1 with what a user of overtone is trying to do

18:29 tbaldridge: if you're making a sequence of notes that are to be played according to a particular bpm, time signature, etc. i agree we're talking more about scheduling than "eventing", but if you have a sampled piano and want to pass the note value you played to 3 other instruments, i could see core.async being a good fit

18:29 forming connections between fx, insts, etc.

18:30 tbaldridge: devn: agreed, so perhaps using core.async at a higher level is a good idea. But I wouldn't want to build the guts of a synth on it. The interface perhaps.

18:31 devn: like [my guitar] ->> [fx1]+-+[fx2]+-+[fx3]

18:31 tbaldridge: yeah, that might be the ticket

18:32 tbaldridge: in any event, if you feel the urge to weigh in on that thread, it'd be cool to see what comes out of the discussion with sam.

18:32 tbaldridge: sure

18:33 we talked at CodeMesh in Dec, not about this exactly but we're not strangers at least :-)

18:33 devn: i think for sending notes and what-not from external instruments, core.async is a big win

18:34 the (at) macro can be funky. you specify (now) as an arg to at. I think having that be core.async might be a better fit

18:35 but as i state in that thread, im not an overtone expert and haven't contributed to the core of it, so i might be way off base to suggest that

18:48 arrdem: bitemyapp: har ahr

18:48 bitemyapp: level 11.5, grinding der dotaz 'cause toothpick is giving me shit

18:49 bitemyapp: arrdem: <3

18:50 arrdem: thinking of which. is there a favored way to structure assertions and condition checking? I saw dire but haven't played with it yet.

18:53 bitemyapp: arrdem: dire is more for AOP wackos like me.

18:53 arrdem: especially people that write a lot of services and stuff.

18:54 arrdem: most people I see using pre-conditions and post-conditions, but that can get out of hand quickly and isn't very composable/clean - which is why I favor dire.

18:54 there's a better way to do things like AOP/dire (cough monads) but that's for another day.

18:58 alew: so with AOP, you collect all functionality relating to some logical unit (like logging, or authorization) into one module that gets called into and dispatched based on who is calling?

19:00 arrdem: aaand drow fed puck

19:01 tommo_: as suggested earlier i'm now trying to load a clojure file into java through the runtime

19:01 but when i call compiler.loadfile i get a nullpointer

19:01 which originates from class.getclassloader line

19:01 bitemyapp: arrdem: I am going to positively die when you hit 13 from happiness.

19:01 tommo_: do i need to somehow initialise the runtime before loading anything?

19:01 the wiki says it should automatically setup the runtime

19:01 arrdem: bitemyapp: good then I'll get to stop listneing to you talk about monads

19:01 hiredman: don't do that

19:02 RT.var("clojure.core","load-file").invoke(...);

19:02 (or the java api if you have that)

19:02 tommo_: the files are not on the classpath, btw

19:05 bitemyapp: arrdem: hahahaha. as if.

19:05 sshack: bitemyapp: What behaviour did migratus exhibit when it took issue with your migration filenames?

19:05 bitemyapp: arrdem: I'll be the Tupac of Monads. You'll get my lessons from the GRAAAAAVE

19:05 sshack: you're going further back in history than my hedonistically ravaged mind can reach.

19:06 sshack: I'm getting an exception here, but it's not clear what's causing it.

19:06 bitemyapp: lancepantz: welcome stranger.

19:06 sshack: sounds like the clock on your hour of raging just started. Good luck!

19:06 sshack: bitemyapp: Alright. Cheers anyways. Thanks for the heads up one the filename issue.

19:07 tommo_: thanks hiredman, worked

19:07 bitemyapp: sshack: I've got some betting squares going on the over/under for that ~60 minutes, let me know how long it takes in the ed.

19:07 end*

19:07 sshack: sensible error messages appear to be foreign to most Clojure libraries/tools

19:08 tommo_: small problem though, originally it was loaded as a class file so i had class level runtime annotations for script metadata

19:08 sshack: Seems to be. Annoying thing is, that'd probably make people overall 4x more productive.

19:08 tommo_: any ideas for a simple way to do a similar thing with the rt?

19:09 arrdem: bitemyapp: I'd tend to agree...

19:09 bitemyapp: sshack: well if they cared about sensible errors and catching things at the right time, it'd have a type system.

19:09 sshack: but here we are.

19:09 sshack: My solution is to spread the suffering around and then roll around in it like a dog in mud. Your results may vary.

19:09 sshack: I'd use haskell, but the tooling there is horrible. And no one believes in relational databases (they're not academically interesting anymore)

19:10 bitemyapp: sshack: oh, you gotta pull from the more practical people to find that kind of tooling, like Snoyman's stuff.

19:10 sshack: what you're thinking of is persistent + postgres bindings + esqueleto.

19:11 sshack: nothing wrong with Haskell, just the libraries you were aware of. See here: http://hackage.haskell.org/package/esqueleto

19:11 sshack: idea being, use persistent as a generic backend, specialize query semantics as needed with things like esqueleto.

19:12 sshack: I'm gonna leave haskell alone for a while.

19:12 bitemyapp: sshack: I've found the tooling to be generally better and more reliable than clj so far, with non-overlapping gaps in library coverage (between clj and hs) compared to Python.

19:13 e.g. Clojure has a bad and unreliable library for ElasticSearch, Haskell has no library beyond simply using the HTTP + JSON stuff.

19:13 sshack: Also, there are many things with absolutely zero library coverage. Like payment processors or mail services (mail gun, postmark, etc)

19:13 bitemyapp: given my druthers, I'd not get fooled and go with the latter scenario.

19:13 sshack: languages like Haskell and Clojure are for people brave enough to write a library/tool.

19:14 sshack: For now, it seems to be true.

19:14 arrdem: bitemyapp: which is why we like the :D

19:14 bitemyapp: and have done the ROI calculation to determine that they're willing to make the things they want to get the language they want.

19:14 sshack: I've no problem with writing libraries. Just being forced to.

19:14 technomancy: you mean with enough free time?

19:14 sshack: technomancy: Bingo.

19:14 bitemyapp: technomancy: it's just an ROI calculation whose neutral point shifts over time as the library ecosystem matures.

19:14 hiredman: time is always in short supply

19:15 bitemyapp: if you're not going to get a lot of leverage out of a better language then you'd probably be most productive in Rails/Django anyway.

19:15 copy-pasta your way to nirvana and all that.

19:16 Jarda: user=> (clojure.string/join ":" (split-at 2 "1122"))

19:16 "clojure.lang.LazySeq@9e1:clojure.lang.LazySeq@a01"

19:16 is this expected?

19:16 or I guess it is

19:16 but how can I accomplish what I'm trying to do, to get "1122" -> "11:22"

19:16 arrdem: Jarda: interpose may be more useful....

19:16 amalloy: &((juxt str pr-str) (range 3))

19:16 lazybot: ⇒ ["clojure.lang.LazySeq@7480" "(0 1 2)"]

19:17 amalloy: ie, don't use str to turn sequences into strings

19:18 but you can, say, ##(clojure.stinrg/join ":" (map (partial apply str) (split-at 2 "1122")))

19:18 lazybot: java.lang.ClassNotFoundException: clojure.stinrg

19:18 amalloy: &(clojure.string/join ":" (map (partial apply str) (split-at 2 "1122")))

19:18 lazybot: ⇒ "11:22"

19:19 Jarda: amalloy: ok thanks

19:20 alew: bitemyapp: what's wrong with Elastisch?

19:20 arrdem: god I swear I'm gonna start instalocking Drow so that nobody else does....

19:21 bitemyapp: alew: *holds face in hand and weeps*

19:21 arrdem: you've turned into a real pubbie now. You've embraced fear and hatred. Let it flow through it, use it as a weapon!

19:22 arrdem: bitemyapp: the rage compells me...

19:22 bitemyapp: arrdem: the hate is swelling in you now. Take your drow bow. Use it. Tiny is unarmed. Strike him down with it. Give in to your anger.

19:27 arrdem: bitemyapp: more like I reach the state of zen beyond trolling and rage

19:28 bitemyapp: arrdem: that's the ticket.

19:28 arrdem: that's how you go 25-4 in a game your team lost. the zen.

19:30 koreth_: ,(apply format (cons "%c%c:%c%c" "1122"))

19:30 clojurebot: "11:22"

19:31 sshack: Is there an easy way to see what class path a leineingens plugin is getting? I'm trying migrates migrations here and missing clojure/java.jdbc

19:32 arrdem: instalock drow here we go.,..

19:32 noonian_: i've found i also get that error sometimes when using aot compilation and i need to lein clean

19:32 specifically with java.jdbc

19:34 technomancy: sshack: don't run migrations in a plugin

19:35 akurilin: Anybody else got pinged by Hickey's sister?

19:35 sshack: Why not?

19:35 technomancy: sshack: it just doesn't make sense

19:35 it should happen in a project namespace

19:36 sshack: My thoughts are it does. I can have migrations run as a hook during deployment.

19:36 technomancy: you don't need a plugin for that

19:36 just use lein run

19:46 bitemyapp: akurilin: ...what?

19:46 akurilin: https://groups.google.com/forum/#!topic/clojure/-PoYv8wUpwE

19:47 akurilin: forward me the email please.

19:48 akurilin: bitemyapp: your cma@ account?

19:49 bitemyapp: akurilin: https://www.mail-archive.com/clojure@googlegroups.com/msg76604.html

19:49 akurilin: son of a...she apparently *is* Hickey's sister, if rplevy is to be believed.

19:49 akurilin: yeah why not. I know somebody (not me) that is looking for a Clojure gig and I could toss the hookup over the fence.

19:49 Raynes: I thought we had already established that she was indeed his sister.

19:50 bitemyapp: Raynes: I don't get the mailing list firehose.

19:50 Raynes: No, I mean we talked about this personally when she sent me a recruitment email. Or so I thought.

19:50 I mentioned that I had gotten an email from Rich Hickey's sister.

19:50 bitemyapp: Raynes: no, you didn't tell me :(

19:50 or you talked to otherMe instead of meMe

19:51 Raynes: Perhaps it was someone else I talked about it with...

19:52 bitemyapp: akurilin: danke schön. email forwarded. :)

19:52 akurilin: Anyway, it's cool that clojure is a family business ;)

19:52 bitemyapp: haha, I think his brother did some Clojure here and there too.

19:53 technomancy: he did a bunch of the logos

19:53 (and some coding too)

19:54 akurilin: Did he make those $50 tshirts?

19:54 Those things better be bespoke ;)

20:04 devn: how do I require cljs.reader in script/repljs?

20:11 dnolen: devn: there still no require REPL special case, would love a patch for that.

20:11 devn: there is in-ns, load-file, and a load-namespace special REPL cases

20:24 devn: dnolen: yeah, figured out i had to do it through (ns ...)

20:25 dnolen: could you give me a clue? is the state of the art to turn "{\"foo\": \"bar\"}" into {:foo "bar"} still js*?

20:26 dnolen: cljs.reader/read-string should work

20:26 devn: dnolen: with #js, you mean?

20:26 dnolen: devn: oh are you trying to convert JSON into CLJS data?

20:26 devn: yes

20:27 dnolen: devn: (js->clj (js/JSON.parse ...))

20:28 devn: dnolen: much obliged. it's been awhile since i've clojurescripted and js->clj used to be something hand-rolled

20:28 i didn't know if that's what the cool folks were using

20:30 dnolen: also, i noticed all the tests for #js were on (... "#js ..." ...) and not (... #js ...)

20:31 but that totally doesn't matter. my bad.

20:31 :)

21:06 bitemyapp: arrdem: mumbur?

21:14 deadghost: until now in my mind it was "rick" hickey

21:14 rich hickey is kind of a funny name

21:15 gfredericks: ,(set "rich hickey")

21:15 clojurebot: #{\space \c \e \h \i ...}

21:16 gfredericks: ,(set "richhickey")

21:16 clojurebot: #{\c \e \h \i \k ...}

21:17 deadghost: ,(reverse "rich hickey")

21:17 clojurebot: (\y \e \k \c \i ...)

21:17 darthdeus: hey guys, anyone here using lighttable?

21:18 noonian: yeah, i use it

21:18 it's purty

21:19 darthdeus: are you using the paredit plugin?

21:20 noonian: hmm, it seems to exhibit paredit like behavior but i didn't do anything to set it up

21:21 i didn't think the plugin system had been release yet

21:21 darthdeus: paredit like behavior? :o

21:21 i've tried this https://groups.google.com/forum/#!topic/light-table-discussion/BIyWHnRcoWc but some thing don't seem to work

21:21 noonian: i have paredit commands in my command pane

21:22 what isn't working?

21:22 darthdeus: ah there's a typo, he spelled "shift" as "shit" :D

21:22 noonian: yeah lol i read that in the thread

21:24 darthdeus: i'm kinda noob at paredit thingy, is there a way that i can easily change something like (foo 1) into (bar (foo 1)) ?

21:26 andrew__: llasram: it finally clicked for me, and I get it now. thanks for help.

21:30 noonian: darthdeus: just figured it out, start with (foo 1), then put cursor on the left side of the paren and type '(bar ', then bring up the command pane (or use hotkey) and run "Paredit: Grow Right"

21:31 sorry, should be '(bar)' then grow right

21:32 darthdeus: perfect, thanks :)

21:32 tommo_: how can i access an instance variable from a java class i'm proxying?

21:34 ahh got it

21:34 didnt notice the implit this argument

21:35 noonian: do you just use .varname?

21:36 (.varname obj)?

21:37 tommo_: yep

21:37 noonian: cool

21:37 tommo_: (.varname this)

22:02 andrew__: if into-array creates a Java array (not a Clojure literal of any type), then is there any purpose to using it if your code base is entirely in Clojure and you do not interact with java in any way?

22:04 Raynes: Well, if you need array-like performance.

22:04 noonian: probably not for most programs

22:04 Raynes: But you usually don't.

22:04 And if you do, you'll be acutely aware of it.

22:06 dnolen has an interesting post about using Java arrays for performance sensitive code in Clojure, but I can't find it since he moved blogs.

22:08 dnolen: andrew__: all the array support in Clojure(Script) is for doing performance sensitive work, if you don't need it don't use it

22:08 Raynes: dnolen: Where is that blog post?

22:08 :(

22:08 dnolen: Raynes: posterous

22:08 Raynes: Anything pre-2013 seems to have vanished off the face of the interwebs.

22:08 dnolen: Raynes: I'll never write another blog again on anything that isn't backed by Git that I don't have copies of on my local machine

22:09 Raynes: Oh.

22:09 Oh dear. So all of those posts are just lost!?!?!

22:09 dnolen: Raynes: yep

22:09 Raynes: Goodness.

22:09 dnolen: Raynes: hmm actually looks like way back machines archived some of it

22:10 er waybackmachine

22:16 myfriend: If I downloaded leiningen, I do not have to manually download the clojure zip from the website right?

22:16 my understanding is that clojure is centrally hosted and lein will always pull from the central servers?

22:16 akhudek: myfriend: right

22:17 myfriend: the specific version that it pulls is in your project.clj

22:17 myfriend: akhudek, so what about when I don't have an internet connection

22:18 akhudek: myfriend: if you've pulled it at least once in the past it will be cached in your local maven repository under ~/.m2

22:18 hiredman: if you are familiar with maven, that is what lein does

22:18 andrew__: thanks guys, i was wondering what the array support was for

22:18 i can feel your pain about lost blog posts.

22:18 myfriend: alright, thank you akhudek

22:41 darthdeus: can i somehow stop lighttable when it's processing stuck in a loop?

22:42 Raynes: kill -9 :p

22:44 lsdafjklsd: dnolen: hey man, is there an issue with updates not being propagated down into build-all components?

22:44 dnolen: lsdafjklsd: not that I'm aware of

22:45 lsdafjklsd: dnolen: maybe I'm just doing something wrong, buy I'm trying to pass owner state from the root, to a UL component, and then into the children li elements that are built through build-all

22:45 dnolen: when I updated the node state, the re-render happens and refreshes properties on the ul component, but code that uses it in the li does not update for some reason

22:46 R_Macy: has anyone had any problems using core.typed with cursive?

22:46 dnolen: lsdafjklsd: did the value actually change for those components?

22:47 lsdafjklsd: dnolen: I'm basically comparing the changed 'current-id' to the id of the li element to set a class

22:47 dnolen: and if it's the same, set the class. so for one I would assume that would eval to true

22:48 dnolen: lsdafjklsd: would need to see a minimal example

22:48 lsdafjklsd: ok

22:55 tommo_: whats the easiest way to convert a variadic arg (arrayseq) into a java array of primitive ints

22:55 i tried (ints (into-array Integer args)) but it doesnt work

22:55 S11001001: tommo_: into-array.

22:56 tommo_: ints is a type hint, not a coercion function

22:56 tommo_: oh

22:56 S11001001: and Integer is not the primitive int type, it's the class java.lang.Integer

22:56 lsdafjklsd: dnolen: Here is a gist... if you could take a look at it real quick that would be amazing. https://gist.github.com/lsdafjklsd/8294408

22:57 dnolen: It's just a list titles, and when you click an item in the sidebar that becomes active below. simple master child

22:58 dnolen: lsdafjklsd: what version of Om are you on, 0.1.4?

22:58 lsdafjklsd: dnolen: ya

22:58 S11001001: ,(into-array Long/TYPE [1,2,3])

22:58 clojurebot: #<long[] [J@c007bd>

22:58 tommo_: and S11001001 the exception is because the values im passing in are actually longs

22:58 S11001001: ^ tommo_

22:59 tommo_: yeah, :p

22:59 thanks

22:59 S11001001: yeah they are at that

22:59 ,(into-array Integer/TYPE [1,2,3])

22:59 clojurebot: #<int[] [I@d81e23>

22:59 S11001001: ,(into-array Long [1,2,3])

22:59 clojurebot: #<Long[] [Ljava.lang.Long;@14dd6be>

22:59 S11001001: note the type printed

23:00 dnolen: lsdafjklsd: oh are you trying to set the state of a parent from a child?

23:00 tommo_: yeah i thought it was the other way around

23:00 lsdafjklsd: dnolen: ya

23:00 S11001001: ,Object/TYPE

23:00 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: TYPE in class java.lang.Object, compiling:(NO_SOURCE_PATH:0:0)>

23:00 dnolen: lsdafjklsd: yeah not going to work and don't plan on supporting that

23:00 lsdafjklsd: dnolen: yea it felt bad

23:01 dnolen: what's the idomatic way? refs?

23:01 dnolen: lsdafjklsd: oh so I see what you're having trouble w/, communicating between parents and children

23:02 lsdafjklsd: dnolen: ya

23:02 dnolen: lsdafjklsd: you could do this a couple of ways, I prefer to use core.async for this

23:02 lsdafjklsd: I think passing an atom to the child could also work, and the parent could have a watcher fn on it.

23:03 lsdafjklsd: you could also just do it with callbacks too

23:03 lsdafjklsd: dnolen: so the list items would be passed a channel where an active id gets pushed on to, and if it matches their ID add the class?

23:03 dnolen: that's what the React folks do

23:04 lsdafjklsd: dnolen: i'd like to go the core.async route

23:04 dnolen: lsdafjklsd: the parent will get the id and render the children, adding that information to that particular child

23:04 lsdafjklsd: dnolen: ok

23:04 andrew__: why does (compare 10 5) return 1 ? The docs for compare don't really explain this

23:04 `1

23:04 lsdafjklsd: dnolen: I tried that here, like in the {:opts {fn, but the child wouldn't refresh, or update

23:05 dnolen: even though the parent UL is firing

23:05 dnolen: lsdafjklsd: because the parent needs to modify the child

23:05 lsdafjklsd: it takes some getting used to but you basically always need to flow information down

23:05 lsdafjklsd: dnolen: like doing assoc on the e right?

23:05 dnolen: lsdafjklsd: yep associng some data onto the child

23:06 lsdafjklsd: hmm I'll try that again, that seems good

23:06 dnolen: good info, still learning the ropes. really appreciate you taking a look at it

23:06 dnolen: lsdafjklsd: no problem

23:06 lsdafjklsd: the TodoMVC has to do this exact same thing for which child is being edited

23:07 lsdafjklsd: worth taking a look at

23:07 lsdafjklsd: dnolen: ok

23:07 dnolen: and while I have you, when I use build, what is the owner in the component?

23:07 dnolen: itself?

23:07 dnolen: lsdafjklsd: https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L58

23:08 lsdafjklsd: owner is the real backing React component

23:09 lsdafjklsd: dnolen: so if I build something from the root render fn, that built items 'owner' arg is the react component of itself, not the root?

23:09 dnolen: lsdafjklsd: not the reify instance, that why the first argument to all the life cycle methods are ignored unless you need to implement some other stuff for some reason

23:09 mtndew4brkfst: andrew__: looks like compare functions similarly to < and > and goes left to right, and left (10) is greater than right (5) so it returns a positive int

23:09 andrew__: ah, thanks, that makes sense

23:09 dnolen: lsdafjklsd: yes, only the function you pass to om/root can get at the root React backing component

23:10 lsdafjklsd: dnolen: gotcha

23:10 dnolen: it's not inject itself into the child component as the owner argument

23:10 dnolen: lsdafjklsd: no it does not

23:10 lsdafjklsd: dnolen: awesome, thanks again man

23:11 dnolen: lsdafjklsd: every time you call build you're constructing a React component behind the scenes

23:11 lsdafjklsd: dnolen: that sortable example is a gift too, holy cow

23:11 dnolen: lsdafjklsd: that delegates to your reify instance

23:11 lsdafjklsd: yeah that was fun to do, very impressed w/ React.

23:11 lsdafjklsd: dnolen: perfect, that's what I thought

23:13 andrew__: there is an arity for sort-by that looks like this: (sort-by keyfn comp coll) but the docs do not say what "comp" represents, can anyone advise?

23:14 mtndew4brkfst: comparitor function, maybe?

23:15 andrew__: actually, now I get it, I see comp is the optional comparator function

23:15 i tend to need docs to be more explicit, i'll have to get used to that

Logging service provided by n01se.net