#clojure log - Dec 02 2013

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

0:06 mysamdog: How do I create an object in clojurescript? I can't figure it out.

0:06 Like How would I do var folded = new OriDomi(document.getElementsByClassName('paper')[0]); ?

0:06 and then folded.accordian(30);

0:09 justin_smith: (def folded (OriDomi. (nth (js/document getElementsByClassName 'paper') 0))) (.accordian folded 30) iirc

0:09 except for static class data (which used .- ) everything else works the same way it does in clojure for interop

0:10 http://clojure.org/java_interop

0:11 seangrove: Hrm, didn't I answer that same question yesterday?

0:11 justin_smith: I wouldn't be surprised

0:12 seangrove: Looks like it, yeah: http://clojure-log.n01se.net/date/2013-12-01.html

0:12 mysamdog: seangrove: yeah, but I couldn't figure out how to call it's methods

0:12 seangrove: mysamdog: Fair enough, no worries

0:12 mysamdog: And actually, what justin gave me is pretty much what I had, I just forgot to save the file

0:18 seangrove: Damnit. In the nrepl.el/austin cljs repl, if you're using the dommy library and macros, and something you do causes an error, every future use of that macro will cause: clojure.lang.ExceptionInfo: at line 1 {:tag :cljs/analysis-error, :file nil, :line 1, :column 13}

0:18 The only way I've found to fix it is to restart everything

0:18 justin_smith: woah, that sucks

0:20 seangrove: It's taken a long time to track it down to that

0:20 I was just having my cljs repl complain about the clojure.lang.ExceptionInfo and couldn't quite pin down what was causing it, etc.

0:21 Feel better now knowing how to repro it, but it's still a frustrating experience. Will have to open a ticket at some point.

0:21 I wonder if it's for any macro though, or just dommy's

0:23 andyf: Is there any special meaning to the Clojure compiler for args named _, or is it just convention that people use that name to mean "I won't be paying attention to this arg"?

0:24 seangrove: I believe it's just convention

0:24 justin_smith: convention

0:25 abaranosky: andyf: the latter

0:25 andyf: ,((fn [a a a] [a]) 1 2 3)

0:25 clojurebot: [3]

0:25 andyf: How is that for weird?

0:25 abaranosky: neat

0:25 andyf: I guess that is why it can just be convention, but you can use _ multiple times for multiple don't care args

0:26 xpe: i should expect `lein with-profile base pom` to not include dev dependencies, right? or am I expecting the wrong thing?

0:31 amalloy: xpe: might be `base,pom`?

0:31 oh, sorry, pom is the task, not another profile

0:32 xpe: amalloy: i'm seeing dev stuff show up in the generated pom :(

0:32 I'm running lein 2.3.3, about to try 2.3.4 to see if that helps

0:32 amalloy: have you tried `lein with-profile -dev pom`, to be explicit?

0:34 xpe: amalloy: I think I misread the pom

0:35 it is getting some dev dependencies, but as an accident. they are probably also test dependencies

0:37 hmm, that's not right either :(

0:41 amalloy: I realize that I don't really understand something key: when I specify :dependencies at the top-level ... what is that called

0:41 for a while, today, I thought that was :base now I doubt it

0:41 seangrove: Interestingly, refreshing the browser doesn't clear the clojure.lang.ExceptionInfo in the nrepl.el/austin cljs repl, it seems to be an issue in the analyzer/compiler

0:41 * seangrove is leaving notes for future excavators

0:43 xpe: from an August 8, 2013 leiningen commit: "Note that :dev, :test, and :base still belong in the pom, but with

0:43 dependencies/paths scoped as <test>."

0:44 I saw <scope>test</scope> in the POM, which made me think they were coming from a test profile

0:44 maybe I can tell `mvn ... -P -test` now

0:46 noprompt: seangrove: just discovered (js/document.createElement "1") will lock up the cljs repl.

0:46 wei__: anyone know a good way to insert ENUM values in Postgres using java.jdbc?

0:46 seangrove: noprompt: What about (.createElement js/document "1") ?

0:47 Very interesting

0:47 seancorfield: wei__: it doesn't "just work"? it works fine with mysql (and other DBs as far as i know)

0:47 noprompt: seangrove: identical behavior. it should throw a InvalidCharacterError.

0:48 wei__: it's getting interpreted as text and triggers a Postgres type error, unless I use something like 'enum-value'::enum_type in the sql statement. but we all know bashing strings together isn't a good solution..

0:49 http://stackoverflow.com/questions/18631840/how-to-cast-string-value-to-enum

0:49 noprompt: seangrove: if i visit the url where the repl is running and then hit C-c at the repl it will kill it though.

0:49 seancorfield: with ENUM('a','b','c') in MySQL, you can use a plain ol' string in the SQL and it works fine... very surprised Postgres doesn't do that...

0:51 noprompt: seangrove: there was another similar problem i encountered with the dom error's but i can't remember what it was.

0:51 wei__: perhaps there's an explicit cast via "CREATE CAST" that will add that behavior, exploring that angle now

0:52 noprompt: just for the record i'm coining the term "data-bondage."

0:52 seancorfield: wei__: read this http://stackoverflow.com/questions/10571821/inserting-into-custom-sql-types-with-prepared-statements-in-java

0:53 seangrove: noprompt: File a bug!

0:53 seancorfield: the more i read about postgres, the happier i am that i don't use it - it seems to be a very bizarre, non-standard database :(

0:53 seangrove: Definitely one of the big priorities for me, I want the cljs repl to be rock-solid

0:53 noprompt: seancorfield: i recently joined a shop that uses it and i had so many wacky problems with it.

0:54 seangrove: will do.

0:54 seangrove: seancorfield: Really? Wow, that's not my experience whatsoever.

0:54 seancorfield: noprompt: yeah, it seems to be the worst of mysql combined with the worst of oracle :)

0:54 noprompt: seangrove: i'm not sure where to report the issue.

0:55 seangrove: noprompt: http://dev.clojure.org/jira/secure/CreateIssue.jspa?pid=10040&issuetype=1

0:55 Much appreciated, I know it's not a super-smooth process

0:55 wei__: seancorfield: on the plus side it has a ton of features. but anyways, my db of choice is datomic for ease of use (with Clojure, anyway). forced into postgres for compatibility reasons :(

0:55 akhudek: postgres works wonderfully for us

0:56 seancorfield: wei__: at least you can use ?::enum_type and still pass in parameters

0:56 akhudek: yes, i hear that from most postgres users :)

0:57 noprompt: seangrove: are you sure this is a clojurescript bug though?

0:57 wei__: it's also decently stable and performant

0:57 how do I create a prepared statement with java.jdbc?

0:58 seangrove: noprompt: I've never used the brepl before, would be good to confirm the behavior there

0:58 ddellacosta: wei__: by default java.jdbc uses prepared statements

0:58 clojure.java.jdbc I mean

0:59 wei__: also, regarding your previous question, it may be as simple as creating a PostgreSQL custom object

0:59 seancorfield: the prepare-statement function will create a PreparedStatement object, but as ddellacosta says, the library creates prepared statements for every operation

1:01 so (execute! db ["INSERT INTO table ( col ) VALUES ( ?::enum_type )" some-val]) would do what you need

1:01 wei__: ah, what I meant was, how do I get the prepared statement to use "?:enum_type" instead of just "?" I'm using (insert! db :table {:attr 1)

1:01 seancorfield: you can't use insert! in this case

1:01 wei__: seancorfield: oh execute will work

1:02 might end up extending insert! to support custom types. thanks for guys' help!

1:02 (inc seancorfield)

1:02 lazybot: ⇒ 7

1:03 jph-: so in repl, when i execute a method, how do i get it to not print "nil"

1:04 xpe: gggrrraahh. MAVEN!

1:04 jph-: i remember reading how in one of many bookmarks on clojure but i have like 30 bookmarks from last two days

1:04 seancorfield: Sounds like a good opportunity to add a protocol for conversion from Clojure values to SQL values maybe? Like it already has for reading column values...

1:04 xpe: amalloy justin_smith here are the magic invocations to tell Maven to copy the deps I want (I hope),,,

1:04 mvn dependency:copy-dependencies -DincludeScope=runtime -DexcludeScope=provided -DoutputDirectory=target/war/WEB-INF/lib

1:05 ddellacosta: why does lein cljsbuild iterate through my profiles on compilation failure?

1:05 is there a way I can prevent it from doing that?

1:05 seancorfield: jph-: are you calling print explicitly?

1:06 ,42

1:06 clojurebot: 42

1:06 seancorfield: ,(println 42)

1:06 clojurebot: 42\n

1:06 jph-: seanaway: (printf

1:06 yep

1:06 seancorfield: the result of print is nil

1:06 jph-: oh

1:06 gotcha

1:06 seancorfield: you don't need to print the result - the repl will do that for you

1:06 jph-: so use format instead for repl use

1:06 seancorfield: yup

1:06 * jph- doffs hat

1:06 jph-: thank you

1:07 xpe: and, to explain what I just did "The scopes being interpreted are the scopes as maven sees them, not as specified in the pom. So the "test" scope includes everything, runtime includes compile but not provided etc."

1:08 complaining above is probably preaching to the choir

1:08 I mean, is anyone going to step and say, yay! maven! probably not

1:08 wei__: speaking of reading column values, is there any existing protocols to work with postgres json types? or maybe that doesn't belong in the base java.jdbc lib

1:11 seangrove: wei__: I believe gfredericks did something with it, but haven't seen anything idiomatic or easy

1:14 seancorfield: wei__: there's a protocol for reading columns, yes

1:14 IResultSetReadColumn

1:15 you can extend it to whatever custom potsgres type you need

1:17 seangrove: wei__: If you do, please be sure to publish it somewhere and mention it on the ml, would love to see some of postgres' features become much easier to access

1:20 seancorfield: suggestions for a good name for the protocol?

1:21 ISQLWriteColumn? ISQLValue?

1:22 seangrove: seancorfield: I like ISQLValue as a more general term, but I can see the value in mirroring IResultSetReadColumn

1:22 seancorfield: heh, i vote for both? :)

1:22 seangrove: Heh, ISQLValue, I'd say!

1:22 noprompt: seangrove: brepl produces the error as expected.

1:22 wei__: oh, I was just looking at the read protocol for now- planning to extend it to read be able to read json and enum types

1:22 seangrove: noprompt: Sounds like a perfect repro case for JIRA ;)

1:23 Thank you so much for taking the time to check it out

1:23 noprompt: seangrove: sorry, i mean it reports the error message from the browser as expected, ie. it doesn't lock up the repl.

1:23 seangrove: perhaps i should repor this on the austin repo then?

1:24 seangrove: Ah, good to know, sounds like it belongs on the austin repo

1:26 seancorfield: seangrove: wei__: feel free to add comments to http://dev.clojure.org/jira/browse/JDBC-77

1:27 noprompt: seangrove: hmm. it actually looks like this is only a problem when the browser is not connected.

1:27 well. i certainly feel silly now.

1:28 seangrove: noprompt: That's no big deal, at least we've made sure there isn't a lurking unpleasant experience in the cljs repl

1:29 noprompt: seangrove: i guess while i'm at it i should reinvestigate the cljs-node-repl issue i open a while back...

1:40 seancorfield: wei__: there's a possible extension point you could use without the ISQLValue protocol...

1:41 wei__: seancorfield: where?

1:41 seancorfield: in the db-spec, you can provide a :set-parameters key - which should be a function that will replace the built-in set-parameters fn

1:42 it's passed stmt and params and normally just calls .setObject on stmt with the index and value of each param

1:43 it's a bit of a blunt instrument but would let you special case values based on anything you can extract from the PreparedStatement and the param values

1:43 wei__: oh, that actually would be a faster way to get something working right away

1:44 seancorfield: adding the protocol is easy tho' so i'll go ahead and do that... but any code you write for :set-parameters could then be moved to an extension of that protocol

1:45 wei__: i would "inc" you again but isn't there some sort of self-imposed ratelimit :)

2:00 seancorfield: wei__: ok, ISQLValue is committed and pushed... so if you're willing to try a snapshot build from sonatype's repo instead of a full release, you should have access to the shortly.

2:00 wei__: sweet, thanks sean

2:01 seancorfield: seangrove: if you want to take that for a test drive too, it would be appreciated

2:19 noprompt: has anyone read the clojurescript responses on the state of clojure survey?

2:20 it seems like the overwhelming majority want self-hosting, macros, and types.

2:20 this made me laugh: "Useless without lein-cljsbuild, which no one understands."

2:21 "no one" aka that guy.

2:29 coderz: /who

3:10 sveri1: hi there, did anyone try to build a jira plugin using clojure?

4:16 ddellacosta: is it a bad idea to dispatch on type in a CLJS multi-method?

4:18 tatsushiko: Anyone using instaparse? I think I'm running into troubles because of auto-whitespace but I would like to better understand why

4:26 ddellacosta: tatsushiko: I've used it recently on a project, although I'm not an expert EBNF or anything

4:26 *in EBNF

4:26 pyrtsa: When extending a protocol inside (defrecord Foo [field ...] Bar (bar [this] ...)), is it considered idiomatic to favour one of `(:field this)` or `field` over the other in the method definition?

4:27 ddellacosta: but I'd be happy to take a look to see if I can help, if you put up a gist/refheap or something

4:28 amalloy: pyrtsa: field, surely

4:28 pyrtsa: amalloy: Cool, thought so.

4:29 I'm playing with https://github.com/stuartsierra/component, and not quite sure if I like the design or not.

4:30 It's a bit weird to introduce the OOP concepts of construction (start) and destruction (stop) into defrecord.

4:30 tatsushiko: ddellacosta: I'll do as soon as i can, I think using the auto-whitespace feature cause instaparse to just load big chunks of memory and go into a sort of infinite loop. I'm simply following the example and '\\s+' as whitespace so it should not be too hard

4:30 buharin: hello :)

4:31 noprompt: ddellacosta: i typically tend to use protocol/extend-protocol if i'm dispatching on type but it depends on your use case.

4:32 buharin: hey :)

4:32 noprompt: s/protocol\///

4:33 ddellacosta: noprompt: okay, thanks. I'm doing a date conversion, but in some cases I already have a date--so I wrote a multi method to handle the two different cases (along with nil). Seems okay, but wanted to see what best practices were.

4:34 noprompt: ddellacosta: if you only have two cases multimethods/extend-protocol might be overkill.

4:35 ddellacosta: noprompt: yah, true. Just seemed a bit cleaner than a set of cases or something, but maybe that would be more appropriate.

4:35 or cond/condp

4:36 arcatan: pyrtsa: a component is pretty stateful stateful thing, after all, so OOP-style representation for it seems pretty suitable for me

4:36 amalloy: pyrtsa: i haven't used component, but when i read stuart's blog post on his workflow, i was like "hey, i wrote my last two apps this way, and i'm super-glad to hear ss likes it too". having it formalized into a library may well be nice, but as i say i haven't tried it

4:38 pyrtsa: arcatan: Sure. It just feels like the `start` should not be an extra step but the very construction of the record. In Stuart's design, there's nothing preventing you from starting a component multiple times, for example.

4:40 amalloy: The workflow makes a lot of sense. I use it myself as well.

4:40 noprompt: ddellacosta: i might use a multimethod for a small number of cases if the methods are involved and having several functions with more or less similar names makes the code harder to read/understand.

4:41 ddellacosta: ah you lucky people and your greenfield projects

4:41 noprompt: ddellacosta: free time is a greenfield project ;)

4:41 ddellacosta: noprompt: yeah, that makes sense,d efinitely

4:41 *definitely

4:42 amalloy: well, pyrtsa, it does mean that your config is reified, so to speak. if you can create a DatabaseConnection without starting it, you can do clever things like have one default config but then change the port around based on env before you start it

4:42 ddellacosta: noprompt: yah, I'm just bitter 'cause I'm neck-deep in something which requires me to solve a lot of problems based on previous iterations which were not-so-well thought-out in some places. Also, CoffeeScript

4:43 pyrtsa: amalloy: I think that just confuses the configuration with the stateful object itself.

4:43 Configuration is just construction parameters, IMO.

4:43 noprompt: ddellacosta: i hear ya. it happens. i'm currently involved in rewritting a poorly written js client app in clojurescript. it's definitely a field but i'd hardly say it was green.

4:44 ddellacosta: haha

4:44 arcatan: pyrtsa: yeah, now that i think about, i'm not sure why you'd separate starting from construction. (and restartable objects are icky)

4:44 pyrtsa: arcatan: 'xactly!

4:45 noprompt: has anyone written up any tips for testing code using core.async?

4:45 glosoli: I have two leiningen project, one of which is front app and other is back app. how could I run them both in nrepl or separate nrepl using Emacs(Cider)

4:47 noprompt: glosoli: i forget how people pull that off. if you find out let me know. :)

4:48 ddellacosta: glosoli: you can start nrepl server from each and connect to each one in a different buffer in cider, I believe

4:48 glosoli: https://github.com/clojure/tools.nrepl#embedding-nrepl-starting-a-server

4:49 glosoli: ddellacosta: how it will decide where to eval hmm ?

4:51 ddellacosta: glosoli: each buffer is mapped to a different project via the port...?

4:51 glosoli: unless I'm misunderstanding what you're asking

4:52 glosoli: also, just talking about cider here, to be clear

4:56 glosoli: dean|away: hmm yeah but I can have many buffers open

4:56 how it will know which is mapped to which nrepl ?

4:59 ddellacosta: glosoli: It will know because you will specify the port when you start the instance of cider for that buffer. Again, tell me if I'm misunderstanding what you're asking because it seems clear to me. I just tried it now, with two repls going separately, and starting cider in two separate buffers in emacs via M-x cider, and it worked fine.

5:02 glosoli: dean|away: Ok lemme explain in more detail. There is project, it consist of two apps, front (lein app with its own project.clj) and back(lein app with its own project.clj). I open that whole project that consist of two apps via Emacs, and intend to code and eval files for the desired app, both are running at the same time

5:03 If I Just connect two instances of NREPL one for front and one for back, it wouldn't know in which nrepl to eval the needed parts of code, would it ?

5:03 ddellacosta: glosoli: name is ddellacosta, btw

5:04 glosoli: if you want to evaluate code for both projects in the same buffer, I think that is not possible

5:04 glosoli: ah sorry, that damn tab :)

5:04 ddellacosta: not in the same

5:04 ddellacosta: glosoli: if you want to open up two different buffers each with a separate connection to an nrepl server from each one, then follow my instructions above

5:04 * ucb waves

5:05 ddellacosta: glosoli: 1) start up nrepl server from each project, with ports you set. 2) connect to each one in a separate buffer using Cider. 3) bam, done.

5:05 * ddellacosta waves back at ucb

5:05 ucb: hey hey

5:06 glosoli: ddellacosta: aa thanks

5:06 ddellacosta: glosoli: and there is a key-command in Cider mode so you can figure out which one you are in--C-c M-d

5:08 glosoli: thanks ! :)

5:08 ddellacosta: glosoli: any time! Hope it works for you. :-)

5:10 sm0ke: lein repl seems to not respect the .incputrc file, anyone elese facing this?

5:10 https://www.refheap.com/21407 thats my .inputrc

5:15 glosoli: ddellacosta: so if I understand correctly I need to C-c M-r each time I want to evalute some buffer in different namespace, otherwise it will eval in the currently active one ?

5:15 ddellacosta: glosoli: ahaha, now I understand what you were asking about--I was assuming you were just eval'ing from the cider buffer itself.

5:16 glosoli: ah sorry for misleading you then

5:16 ddellacosta: glosoli: no, no problem, I had a feeling I was missing something

5:17 glosoli: ddellacosta: so what I want is not possible, is it ?

5:17 for cider to auto detect which file belongs to which nrepl lol

5:17 ddellacosta: glosoli: yeah, I mean, I honestly don't know the answer to that--if I were you I'd just start up cider and see what happens

5:17 glosoli: I suspect it's not as smart as you want it to be, and it's going to ask you with nrepl session you want to send it to each time

5:17 but I don't know

5:18 glosoli: it looks like you can set the namespace of the REPL buffer to the current buffer, so maybe that's a way to do what you want--if each one is set to a different namespace

5:18 glosoli: I'm looking here: https://github.com/clojure-emacs/cider#cider-mode

5:19 glosoli: ah yes setting namespace could work still I need to select buffer, well it's good enough anyway

5:19 thanks

5:19 ddellacosta: glosoli: yeah, I suspect you can do what you want with a bit of monkeying about

5:25 glosoli: ddellacosta: doing cider-jack-in while being in emacs works better in such conditions coz it properly sets app name, so it always shows the app name my nrepl is on

5:25 nice

5:26 ddellacosta: glosoli: cool--so you can do it with jack-in as well? That's pretty slick if so

5:27 glosoli: ddellacosta: yeah works just fine

5:28 using ido buffer search and entering symbols lets me switch instantly

5:30 honza: is it just me or does the -> macro not like partial functions?

5:33 amalloy: man, we need a clojurebot factoid about how -> is a macro, and as such operates on source-code forms, not functions

5:33 TEttinger: ,(-> {:a 1} (partial assoc :b 2)) ; ##(-> {:a 1} (assoc :b 2))

5:33 lazybot: ⇒ {:b 2, :a 1}

5:33 clojurebot: #<core$partial$fn__4194 clojure.core$partial$fn__4194@6b878d>

5:34 amalloy: clojurebot: -> is http://stackoverflow.com/questions/15443320/clojure-partial-in-macro

5:34 clojurebot: Roger.

5:34 amalloy: ~->

5:34 clojurebot: -> is forget ->

5:35 amalloy: okay, i can't teach clojurebot about ->

5:36 TEttinger: ~define -> http://stackoverflow.com/questions/15443320/clojure-partial-in-macro

5:36 clojurebot: Gabh mo leithscéal?

5:41 Fender: good morning and a happy monday

5:42 here's a question

5:42 (take 8 (map vector market-dirs dirs))

5:42 ([-1 1] [-1 1] [1 -1] [-1 -1] [1 -1] [-1 1] [1 1] [-1 1])

5:42 (map #(case (map int %)

5:42 [1 1] :tp

5:42 [1 -1] :fp

5:42 [-1 1] :tn

5:42 [-1 -1] :fn

5:42 :ignored

5:42 ) (take 8 (map vector market-dirs dirs)))

5:42 returns (:ignored :ignored :ignored :ignored :ignored :ignored :tp :ignored)

5:42 ucb: Fender: (map ...) doesn't result in a vector

5:43 Fender: also, you may want to paste the code somewhere for easier reading :)

5:43 Fender: ok I'll gist it next time :)

5:43 well mapv doesnt help either

5:43 ucb: you're int %

5:43 so, you'd be (int [-1 -1])?

5:44 Fender: using (mapv int %) should ensure that we get a vector if ints

5:44 it runs

5:45 but it only detects true positives (:tp)

5:45 obviously [-1 1] as arg (%) doesnt match [-1 1] in the case condition

5:46 ucb: hmm

5:46 mind gisting the code?

5:47 Fender: just a sec

5:47 honza: amalloy: i guess i should have just read the source, huh? :)

5:49 TEttinger: ,(mapv #(condp = %1 [1 1] :tp [1 -1] :fp [-1 1] :tn [-1 -1] :fn :else :ignored) [[-1 1] [-1 1] [1 -1] [-1 -1] [1 -1] [-1 1] [1 1] [-1 1]])

5:49 clojurebot: [:tn :tn :fp :fn :fp ...]

5:50 TEttinger: ##(mapv #(condp = %1 [1 1] :tp [1 -1] :fp [-1 1] :tn [-1 -1] :fn :else :ignored) [[-1 1] [-1 1] [1 -1] [-1 -1] [1 -1] [-1 1] [1 1] [-1 1]])

5:50 lazybot: ⇒ [:tn :tn :fp :fn :fp :tn :tp :tn]

5:53 Fender: https://gist.github.com/anonymous/7747866#file-gistfile1-clj

5:53 yeah, thought about using condp as well

5:53 but I want to understand why it doesnt work

5:54 TEttinger: ,(doc case)

5:54 clojurebot: "([e & clauses]); Takes an expression, and a set of clauses. Each clause can take the form of either: test-constant result-expr (test-constant1 ... test-constantN) result-expr The test-constants are not evaluated. They must be compile-time literals, and need not be quoted. If the expression is equal to a test-constant, the corresponding result-expr is returned. A single default expression can foll...

5:54 TEttinger: so your expression is always true

5:54 err no

5:55 (map int %) will return a lazyseq, but you're testing against vectors, which I am not sure about

5:56 clgv: ,(case (mapv int [1 1]) [1 1] :ha! [1 -1] :ho! :no)

5:56 clojurebot: :ha!

5:57 clgv: `case` uses hashing internally. you'll see when you decompile the class file

5:58 Fender: (case (mapv int [-1 -1])

5:58 [-1 -1] :yeeha

5:58 :oh-noes)

5:58 :oh-noes

5:59 ,(case (mapv int [1 -1]) [1 1] :ha! [1 -1] :ho! :no)

5:59 clojurebot: :no

6:00 Fender: no ho!

6:00 time for a clj bug report or are we missing something?

6:01 or did the doc change in 1.5? (I use clojuredocs which IMO still has 1.3)

6:02 ,(case [1 -1] [1 1] :ha! [1 -1] :ho! :no)

6:02 clojurebot: :ho!

6:02 Fender: hmmm

6:02 ok

6:03 ,(map type [-1 1])

6:03 clojurebot: (java.lang.Long java.lang.Long)

6:03 Fender: ,(map type (mapv int [-1 1]))

6:03 clojurebot: (java.lang.Integer java.lang.Integer)

6:03 amalloy: Fender: what version of clojure are you trying to run this on?

6:03 Fender: 1.5.1

6:03 but I think its the type that causes the probs

6:03 TEttinger: yeah, agreed

6:03 amalloy: since 1.4, int and long hash the same

6:03 what's a simple case expression that exhibits behavior you don't expect

6:04 TEttinger: ,(case (int 1) 1 :yes :no)

6:04 clojurebot: :yes

6:04 TEttinger: ,(case (int -1) -1 :yes :no)

6:04 clojurebot: :yes

6:04 Fender: ,(case [(int 1)] [1] :yes :no)

6:04 clojurebot: :yes

6:05 Fender: ,(case [(int -1)] [-1] :yes :no)

6:05 clojurebot: :no

6:05 TEttinger: now that's interesting

6:05 Fender: ok only positive ints and longs hash to the same

6:05 (value)

6:05 clojurebot: Gabh mo leithscéal?

6:05 amalloy: &(map hash [(int -1) -1])

6:05 lazybot: ⇒ (0 0)

6:05 amalloy: &(apply = [(int -1) -1])

6:05 lazybot: ⇒ true

6:05 amalloy: looks like a bug in case to me

6:06 TEttinger: ,(map hash [(int -1) -1])

6:06 clojurebot: (0 0)

6:06 TEttinger: ,(map hash [[(int -1)] [-1]])

6:06 clojurebot: (31 31)

6:06 Fender: wtf

6:06 amalloy: probably the macro that generates the case-branching decision tree wasn't updated when hashing of ints and longs was fixed

6:06 TEttinger: to the source code!

6:06 Fender: hmm, I'll use condp then for a while

6:07 amalloy: TEttinger: good luck, man. case is not easy to read

6:07 clgv: amalloy: it is using Util/hash in the generated class file

6:07 amalloy: and not Util/hasheq?

6:07 clgv: no

6:07 amalloy: that's the problem then, right?

6:08 clgv: I am not sure. was that the change with regard to numbers?

6:09 Fender: sorry guys, my lunch is being served

6:10 thanks for the help

6:10 I'll come back later

6:10 afk

6:11 amalloy: clgv: i mean, ##(map hash [-1 (int -1)]) vs ##(map #(.hashCode %) [-1 (int -1)])

6:11 lazybot: (map hash [-1 (int -1)]) ⇒ (0 0)

6:11 (map (fn* [p1__39689#] (.hashCode p1... ⇒ (0 -1)

6:12 amalloy: Util/hash calls the second of those

6:12 TEttinger: hooray! bug discovered!

6:12 clgv: seems like it: ##(println (clojure.lang.Util/hash [(int -1) (int -1)]) (clojure.lang.Util/hasheq [(int -1) (int -1)]))

6:12 lazybot: ⇒ 929 961 nil

6:12 amalloy: i don't quite know why a call to Util/hash is generated, but presumably someone familiar with case* can find that

6:13 clgv: 961 is the correct hash used in the class file

6:13 since ##(hash [-1 -1])

6:13 lazybot: ⇒ 961

6:14 philandstuff: interesting bug

6:32 * clgv searches code base for `case` on vector

6:35 TEttinger: $title http://xn--njb.com

6:35 lazybot: "ڑ.com"

6:35 TEttinger: does that line appear oddly for anyone? lazybot's reply

6:36 arcatan: should slamhound.el work with nrepl.el 0.2.0?

6:39 amalloy: TEttinger: it's converted the url using whatever weird mapping there is for non-ascii characters in urls

6:39 TEttinger: yes. punicode

6:39 but on some clients the datestamp is reversed due to RTL stuff

6:40 I'm wondering if lazybot should by default escape RTL chars?

6:40 if it doesn't show up on many clients, who cares

6:41 *if the rendering problem from RTL doesn't show up

6:41 it displays fine in Floe on windows

6:41 but Floe also can display multiline messages

6:46 Fender: thx guys for helping

6:46 I suppose you already submitted the bug somewhere or directly changed the code?!

6:58 clgv: Fender: no one can change the code directly ;)

6:59 Fender: seems like Andy Fingerhut already discovered that bug last week http://dev.clojure.org/jira/browse/CLJ-1301

7:00 Fender: you can create a jira account and vote that bu up to increase its chances to get fixed in 1.6

7:01 "vote that bug up"

7:01 Fender: I don't know who the repo maintainer is but he should be able to change the code, no?

7:02 clgv: Fender: there is a development process setup that involves jira for bug reports and patches.

7:04 Fender: I know, just thought that maybe Rich is following and thought "wow this is so obvious, I'll change it rightaway"

7:05 that's what I'd call "fast moving" ;)

7:05 but I am aware that this is not easy if a community participates

7:05 clgv: nope, that is never going to happen in the current process

7:06 it might be that a ticket for a bug quickly gets a patch and is screened and included fast. but not without a ticket ;)

7:07 Fender: ok

7:07 well, thx again

7:07 and see you

7:27 glosoli: how does one set content expire dates in Ring ?

7:40 logic_prog: https://gist.github.com/anonymous/7748882 <-- how do I even begin to debug this? I'm tring to use core.async . The problem is: I'm unable to see what line the stack overflow starts with

7:42 sm0ke: whoa! clojure is notorius with stak traces for sure

7:44 logic_prog: clojure is fine

7:44 it's clojure.core.async that's scaring me

7:44 sm0ke: well if its core.async why dont i see so!

7:45 are you using macros?

7:46 looks like there is a overflow due to recursion

7:47 recursion inside a multivariate function maybe?

7:47 logic_prog: I am using macros.

7:47 fuck. debugging a distributed system + macros + core.async

7:47 this is going to be "fun"

7:50 oh fuck

7:50 I think I found it

7:50 I have atoms

7:50 that are circular (one atoms refers to another)

7:50 then I println one of them

7:50 and bam .... println recursion

7:51 clgv: logic_prog: build up from small functions that are testable each

7:51 sm0ke: hmm atom refering to each other!

7:51 that makes sense?

7:51 logic_prog: yeah, but this bug only appears during a running system

7:53 sm0ke: one thing which bothers me is clojure does not catches wrong arity during function call while compiling

7:53 if clojure had implicit support for currying it would have made sense

7:53 logic_prog: over the past few years

7:54 nothing in clojure bothers me anymore, I end up realiainzing that clojure is right and I'm wrong

7:54 woot, bug fixed!

7:55 wink: lol

7:56 sm0ke: you mean like.. if there's no [& args]?

7:56 clgv: sm0ke: that's due to rebindable vars. the function at the var might be exchanged at runtime compared to compile time

7:56 si14: how do you deploy your clojure stuff? chef and puppet look so overbloated that it's painful even to think about using them

7:56 sm0ke: wink: yes if the func has signature like (defn foo [a b c])

7:57 clgv: sm0ke: although there could be contracts on the arity for vars. but maybe that has other consequences that are not easy to handle

7:57 sm0ke: does (foo a) makes sense to you?

7:57 si14: I'm currently using Ansible, but thinking about Pallet. Anyone using it?

7:57 wink: si14: don't use puppet for deployment. I've been there and gone back to anything that works, i.e. capistrano, fabric, .deb, plain ssh

7:57 clgv: si14: yes, I use it for distribution of jars and starting them up

7:58 sm0ke: clgv: i do not understand your point

7:58 si14: clgv: how do you like it? can you compare it to another systems?

7:58 glosoli: how does one set content expire dates in Ring ?

7:58 clgv: si14: you can't check (foo a) on arity since you do not know what some.ns/foo resolves to at runtime

7:58 sm0ke: can you make a call to function which take 3 arguments with just one argument?

7:58 without using partial of coure

7:59 clgv: si14: I cant compare it. I needed some trial and error to find out how I get my tasks done

7:59 si14: wink: and what do you use now?

7:59 clgv: sm0ke: no you can't, but at compile time you have (defn foo [a b c] ...) and then at runtime someone rebinds (defn foo [a] ...)

8:00 wink: si14: as I said. after the failed tries with puppet.. current company: capistrano and .deb

8:00 si14: oh, and another thing: how do you ensure that your jars are started on server startup? init scripts? upstart? if the latter, how is it better than plain init scripts?

8:00 wink: I see, thank you.

8:00 wink: what somehow works is: make puppet pull a defined version from some form of repo

8:00 sm0ke: clgv: does that makes sense for a code i have written in a file?

8:00 clgv: si14: pallet does administration stuff via sudo

8:00 wink: that might be. ensure => version X.Y via .deb.

8:01 clgv: sm0ke: I only explain how clojure's vars work ;)

8:01 wink: but puppet + pulling from git is meh

8:02 clgv: sm0ke: a (runtime) change of the arities of a function probably does not make much sense.

8:02 si14: clgv: yeah, it's similar to Ansible in this.

8:03 sm0ke: i agree to some extend to your point though

8:03 with functions being a first class values

8:21 sveri1: hi, is there a way to generate junit test reports with leiningen?

8:25 sw1nn: hiredman: Hi, do you run clojurebot in this channel?

8:34 jarodzz: hi. everyone

8:35 mdrogalis: Morning.

8:35 jarodzz: anybody up? i'm reading some clojure code. and met 1 function name "list*"

8:35 morning, mdr~

8:35 it's 9pm for me. i'm from china

8:35 the star at the end doesn't matter. right?

8:36 mdrogalis: 8 AM on east coast, morning after major holiday weekend. Everyone's exhausted over here :)

8:36 Just use normal 'list'

8:36 jarodzz: oh..thanks giving

8:36 that's a big one.

8:36 mdrogalis: Looking at the docs, I can't immediately tell what the difference is. But I've never seen anyone use list*

8:38 augustl: ,(list 1 2 3)

8:38 clojurebot: (1 2 3)

8:38 augustl: ,(list* 1 2 [3])

8:38 clojurebot: (1 2 3)

8:38 augustl: ,(list 1 2 [3])

8:38 clojurebot: (1 2 [3])

8:39 augustl: mdrogalis: ^^

8:39 err, jarodzz

8:39 mdrogalis: That seems like a pretty reasonable thing to use. I wonder why I've never seen it used before.

8:41 jarodzz: so it's like (list* 1 2 3(3)) -> (list* 1 (list* 2 (3))) ?

8:42 august1, got it. thanks

8:43 mdrogalis, thanks, man. i know how it works, now i need to understand when i should use it

8:43 ,(= 1 1))

8:43 clojurebot: true

8:43 jarodzz: ,(> 2 1)

8:44 clojurebot: true

8:45 mdrogalis: I always derped around with concat when I needed something akin to that.

8:46 justin_smith: ,(> 5 4 3 2 1)

8:46 clojurebot: true

8:48 jarodzz: do you use clojure at work?

8:48 xcthulhu: yes?

8:48 clojurebot: yes isn't is

8:48 jarodzz: no?

8:48 clojurebot: no is tufflax: there was a question somewhere in there, the answer

8:48 teslanick: where?

8:48 clojurebot: see logs

8:49 mdrogalis: jarodzz: Yes.

8:50 xcthulhu: It's a pretty nice language for getting work done.

8:50 jarodzz: sounds great.

8:51 i'm looking for a chance to get some of my work done by clojure

8:51 and sell to me team members

8:52 yes it is. some times too expressive. 1 line of clojure contains too much info

8:52 it takes me minutes to figure it out

8:53 xcthulhu: It's just a practice thing

8:54 poppingtonic: jarodzz: when you learn how the data structures work, you'll understand enough to write your own (albeit, simple) code

8:55 At least, you'll know how to read code beyond the basic "form" structure.

8:56 tbaldridge: jarodzz: I felt the same way. But then I realized that my C# code was just so verbose that my logic was spread over an entire page of code, instead of 3 lines of Clojure. Then I thought "how long would it take me to understand a page of C# code". Once I learned clojure I found that reading the 3 line clojure code was faster.

9:38 justin_smith: http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/ LOL

9:42 wink: justin_smith: interesting, thanks

9:44 justin_smith: mostly I linked it here for the snarky pullquote at the top :)

9:45 tbaldridge: http://i.imgur.com/tESIX.gif

9:48 justin_smith: lol, reading further "types for every known http header"

9:50 wink: justin_smith: sadly it's a mix of true facts and a little whining

9:51 justin_smith: Oh. Fair enough.

9:51 wink: and I'm not really a fan of scala and found it overy whining ;)

10:07 pdurbin: wink: too strict?

10:09 silasdavis: what function can I use to call a function with no arguments?

10:10 as in (map (comp my-fn apply) list-of-fns)

10:10 but apply doesn't work because it wants at least 2 args

10:11 justin_smith: (map #(%) [println println println])

10:11 ,(map #(%) [println println println])

10:11 clojurebot: (\n\n\nnil nil nil)

10:11 justin_smith: I keep forgetting the comma

10:12 hoeck1: silasdavis: or apply and the empty list for no-args

10:12 philandstuff: you probably want doseq rather than map if you're calling a fn for side effects

10:12 silasdavis: hoeck1, yeah I'm an idiot

10:12 justin_smith: or if you want to be more verbose, (fn [f] (f))

10:12 same thing

10:12 silasdavis: I was thinking apply took a list of args

10:12 which would kind of defeat its purpose

10:12 justin_smith: you don't need apply

10:12 that's useless overhead

10:13 hoeck1: justin_smith: but it sometimes looks nice to use 'reader-macro-free' style :)

10:14 tbaldridge: justin_smith: or perhaps #(%) if you want people to not understand your code :-P

10:14 justin_smith: quoting me: <justin_smith> or if you want to be more verbose, (fn [f] (f))

10:15 apply does some extra stuff that you don't need if you have no args

10:15 silasdavis: I sort of wanted to do it without an anoymous function

10:16 but I'll just do that

10:16 justin_smith: for example if you look at the source for map, there is a reason that they have special cases for everything up to four args, and only with five args do they use apply

10:21 and is #(%) really that much worse than #(apply % []) ?

10:30 TimMc: &(map trampoline [+ *])

10:30 lazybot: ⇒ (0 1)

10:30 TimMc: (Don't do that.)

10:34 arrdem: tbaldridge: nice reaction

10:37 gfredericks: (letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 42))

10:37 ,(letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 42))

10:37 clojurebot: 42

10:38 TimMc: ,(letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 0))

10:38 clojurebot: 0

10:38 TimMc: Oh right, yes.

10:38 &(repeat 3.4 nil)

10:38 lazybot: ⇒ (nil nil nil nil)

10:39 TimMc: &(repeat Double/NaN nil)

10:39 lazybot: ⇒ ()

10:40 justin_smith: ,(= Double/NaN Double/NaN)

10:40 clojurebot: false

10:40 TimMc: (I think that could be either an infinite seq or zero-length, depending on how it is coded.)

10:40 ,(<= 5 Double/NaN)

10:40 clojurebot: false

10:40 TimMc: ,(<= Double/NaN 5)

10:40 clojurebot: false

10:41 TimMc: (Well, flip the comparator, but you know what I mean.)

10:49 clgv: ,(= Double/NaN Double/NaN)

10:49 clojurebot: false

10:49 clgv: ;)

10:49 oh it was alreay there above

10:50 TimMc: repeat should throw on that ;)

10:50 justin_smith: "

10:50 err "Double/NaN cannot be cast to number"

10:51 clgv: but that would mean a check in all valid cases which is probably not desirable

10:51 philandstuff: IEEE 754 is fun

10:51 dalemcbane: join #pedestal

10:52 tbaldridge: dalemcbane: yes, please do!

10:52 dalemcbane: oops...

10:52 clgv: tbaldridge: is it too lonely overthere? ;)

10:52 tbaldridge: nah, I'm just pointing out other people's failures.

10:53 it makes me feel better about myself.

10:53 clgv: you evil person ;)

11:01 jcromartie_: so, CQRS in Clojure

11:03 justin_smith: jcromartie_ I think immutible data mostly gets you that for free

11:03 clojure has very few "commands"

11:03 and a lot of queries

11:03 clgv: jcromartie_: is that a new buzzword we need to learn for manager-speak?

11:04 justin_smith: http://en.wikipedia.org/wiki/Command%E2%80%93query_separation

11:04 clgv: it is about not letting "get" have side effects

11:05 philandstuff: CQS is about interface design; CQRS goes slightly further into architectural design http://martinfowler.com/bliki/CQRS.html

11:07 clgv: ah ok

11:08 I found an article in an IT magazine

11:08 tbaldridge: IMO, Datomic's model is very close to CQRS

11:12 commands are sent to the transactor as :db/add or :db/retract. Results are queried via a completely different (cached) api.

11:13 philandstuff: through a different communication pathway too

11:13 mdrogalis: Commands as data/keywords/EDN whatever blew my mind when I first "got" it.

11:33 TimMc: clgv: Not a *new* buzzword, at least; Wikpedia dates it to the mid-80s.

11:34 clgv: TimMc: ahok. that renew-cycle again ;)

11:34 TimMc: "More formally, methods should return a value only if they are referentially transparent and hence possess no side effects."

11:34 That's pants, how are you supposed to tell someone what the ID is of a newly created object?

11:35 clgv: :D

11:35 justin_smith: TimMc: by making a lucky guess, of course

11:35 zerokarmaleft: via query

11:36 clgv: TimMc: newly created objects always get 42 as temporary id, don't they? ;)

11:36 TimMc: "Drawbacks: CQS can make it more difficult to implement re-entrant and multi-threaded software correctly."

11:36 tbaldridge: hrm....I can't see how that would be the case.

11:36 TimMc: I see, so it's useful if you're programming in the 1980s.

11:37 philandstuff: I think that refers to the stack popping problem

11:38 with CQS, you can't atomically retrieve-and-remove the top item in a stack

11:38 tbaldridge: which may not matter if you can always get the full history of the stack

11:38 philandstuff: agreed

11:39 TimMc: You still need to know which insert you were responsible for.

11:39 philandstuff: do you? why?

11:40 tbaldridge: I'm not sure how well this maps to CQS, but yes, even Datomic "commands" return data. The data is simply "tempid x = actual id y"

11:40 as well as to pointers to the old and new dbs.

11:41 TimMc: This is very common in SQL. You INSERT into the DB, and then you ask what the last inserted ID was. Those *appear* to be separate command + query, but that's just a property of the interface library (I think).

11:41 jcromartie_: I'm glad I could "fire and forget" a conversation :)

11:41 sorry about that

11:41 TimMc: It is generally quite useful to know the ID of the record you just inserted. :-)

11:41 jcromartie_: was discussion with actual coworker

11:41 mdrogalis: Hah

11:42 philandstuff: http://xkcd.com/356/

11:42 tbaldridge: TimMc: that's normally handled as a global variable on the server attached to the connection object.

11:43 Bronsa: is there a name for a function f that has the property f·f = id?

11:44 clgv: Bronsa: a function that is inverse to itself

11:44 justin_smith: Bronsa: well, one of them is id

11:44 TimMc: heh

11:44 Bronsa: clgv: yeah, I was wondering if that property had a specific name :)

11:45 philandstuff: http://en.wikipedia.org/wiki/Involution_%28mathematics%29

11:45 clgv: Bronsa: involution it seems

11:45 Bronsa: thanks!

11:46 TimMc: What about f·f·f = id?

11:46 justin_smith: there are (pathological?) functions that are not self inverses but meet the criteria - (fn maybe-id [arg] (get {maybe-id identity} arg))

11:47 TimMc: I was surprised to not find a generalization on the Wikipedia page.

11:48 clgv: the "telephone numbers" - that certainly has a ring to it

11:48 gfredericks: TimMc: this reminds me of cyclic groups

11:49 jcromartie_: Tim: wouldn't f necessarily have to be an identity function itself?

11:50 justin_smith: jcromartie_: or some perverse thing like my maybe-id above

11:50 arcatan: jcromartie_: consider function from {1,2,3} to {1,2,3}: f(1) = 2; f(2) = 3; f(3) = 1; f . f . f = id

11:50 philandstuff: no, a 1/3 rotation in the complex plane would have f != id but f.f.f = id

11:51 similarly, f(x) = i*x has the property f.f.f.f = id

11:51 clgv: I like the non-trivial existence proof for f from arcatan ^^

11:52 TimMc: justin_smith: maybe-id is self-inverse over a very small domain.

11:53 philandstuff: justin_smith: are you thinking of f(f) rather than f(f(x))?

11:54 justin_smith: maybe

11:54 philandstuff: or, in clojure syntax, (f f) rather than (comp f f)

11:54 justin_smith: yeah, I was confused

11:55 jcromartie_: arcatan: good point

11:55 justin_smith: (fn maybe-id [arg] (get {maybe-id identity} arg maybe-id))

11:56 for args other than itself, returns itself, for arg of itself it returns identity

11:56 philandstuff: (comp maybe-id maybe-id) is not the identity fn though

11:56 jcromartie_: can somebody help me write a function (or macro) to test if two functions are equal i.e. having the same output for any input?

11:57 rkz: anyone working on/thinking about a cljs reducers drop-in replacement that uses webworkers?

11:57 philandstuff: jcromartie_: sounds like what test.generative is for?

11:58 tbaldridge: any input? even images and jdbc connections? :-P

11:59 justin_smith: it's a turing complete problem

12:00 TimMc: &(letfn [(updown [n] (if (odd? n) (inc n) (dec n)))] (map (comp updown updown) [1 2 3 4 5]))

12:00 lazybot: ⇒ (1 2 3 4 5)

12:00 philandstuff: well if both functions always terminate and are over finite domains, it's a simple matter of enumeration

12:00 gfredericks: by which I think justin_smith means it's equivalent to the halting problem

12:01 TimMc: ^ That's an involution over integers.

12:01 justin_smith: gfredericks: right, that's what I meant

12:01 TimMc: I don't know where I was going with that, actually.

12:04 gfredericks: (fns-equal? (constantly true) twin-primes-larger-than?)

12:04 ^ which of course you can use to solve unsolved math problems

12:18 TimMc: Oh I remember, I was going for an order-3 cycle.

12:18 &(letfn [(tri [n] (if (zero? (mod n 3)) (- n 2) (inc n)))] (map (comp tri tri tri) (range -4 4)))

12:18 lazybot: ⇒ (-4 -3 -2 -1 0 1 2 3)

12:21 gfredericks: TimMc: easily generalizable in that direction

12:21 hey we could do this for arbitrary objects

12:25 TimMc: What do you have in mind?

12:30 ystael: TimMc: well, first partition the set of all Clojure data objects into cells of size n, where n is a positive integer. :)

12:30 gfredericks: TimMc: um

12:30 make a sentinel object

12:31 and a function that wraps things in [o o o x]

12:31 and if it sees a vector with N o's, returns x

12:31 otherwise prepend an o

12:31 or something

12:31 I was going to do it myself but I think I might be busier than I'd like to admit

12:35 {:orig x, :type my-sentinel, :decs-left 5}

12:36 ^ a bit more compact

12:39 dxtr_: hi

12:39 silasdavis: I'm currently using carica for config

12:39 how do people handle multiple environments?

12:39 all in the same file, and decide at runtime?

12:39 dxtr_: how do i pronounce clojure? like closure or more like clo-you're or clo-jew-re or .. ?

12:40 silasdavis: closure

12:40 technomancy: silasdavis: just by adjusting your classpath

12:40 dxtr_: ok..

12:40 hiredman: silasdavis: we have chef write out the configuration to a place that overrides the existing config because of where it ends up on the classpath

12:41 silasdavis: so the default config goes in the jar, and chef writes anything that needs to be overriden to the filesystem in a place our launcher scripts put in the right order on the classpath

12:41 dxtr_: which of the recomennded books (http://clojure.org/books) should i look into, if i'm already familiar with java/scheme/erlang?

12:42 seangrove: Hrm, what was the clojurescript response to the state of clojure?

12:42 silasdavis: hiredman, ok thanks that's relevant as I probably moving to chef

12:42 currently I'm using lein beanstalk

12:42 nDuff: dxtr_: the two I recommend are O'Reilley's Clojure Programming and Joy of Clojure

12:42 silasdavis: wonder what the most appropriate way would be to manipulate classpath through that

12:42 dxtr_: ok, thanks nDuff

12:43 nDuff: dxtr_: ...you might be able to skip directly to JoC, but it has a reputation for being hard for beginners.

12:43 dxtr_: ...also, you might want to try to get the second edition.

12:44 TimMc: gfredericks: Sentinals feel like cheating.

12:47 dxtr_: nDuff: is the joy of clojure something along the lines of "effective clojure", or is it still an introductory book?

12:48 dnolen: seangrove: ?

12:49 nDuff: dxtr_: JoC is focused on teaching idiom and best-practice.

12:49 seangrove: dnolen: Ah, I misunderstood, noprompt was asking if anyone had read the clojurescript response*s* on the state of clojure survey.

12:49 dxtr_: ok

12:49 nDuff: dxtr_: ...it assumes that basic knowledge of the language is coming from elsewhere. Personally, I find that that works fine for me.

12:49 dnolen: seangrove: I looked at bunch of them though I didn't take the time to do any extended analysis - it was mostly expect stuff

12:50 s/expect/expected stuff

12:50 dxtr_: but the 2nd edition isn't out yet .. says amazon

12:50 nDuff: dxtr_: I'm not sure of the "Effective" book. The "In Action" one didn't work for me at all -- too much focus on specific, chosen trees; no forest at all.

12:50 dxtr_: you can get it as an ebook from the publisher.

12:50 dxtr_: ...with a print copy shipped when it prints, which AFAIK should be soon.

12:50 dxtr_: ohh, wow

12:51 nDuff: ...huh, currently estimated for February; I actually was thinking sooner than that. *shrug*.

12:55 silasdavis: to answer my own question, seems leiningen conveniently adds dev-resources ahead of resources in the classpath, and carica merges giving precendence to configs ealier in the classpath

13:07 aconbere: hey folks, I'm trying to get up to speed on core.async but there doesn't appear to be any documentation. Is my best bet just ... reading the source?

13:08 cmiles74: aconbere: There's a walkthrough that goes through a lot of stuff, let me find a link...

13:08 maravillas: aconbere: there are some examples at https://github.com/clojure/core.async/tree/master/examples

13:08 aconbere: yeah I mean I've been reading the walkthrough and the examples

13:09 cmiles74: Right now, that's the best I could find.

13:09 aconbere: unfortunately they're not particularly illuminating beyond relatively simple use cases

13:09 * aconbere nods

13:09 cmiles74: aconbere: Is there anything in particular troubling you?

13:09 nDuff: There's been some quite good third-party material written.

13:10 mdrogalis: IMHO, docs seem to be Cognitect's weakest point from the things they open source.

13:10 nDuff: I've liked the dots-game walkthrough (and subsequent refactor) at http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html and http://rigsomelight.com/2013/08/22/channels-of-channels-dots-game-refactor.html

13:11 alandipert: aconbere: maybe a good place to start: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html

13:11 aconbere: cmiles74: I think probably some of my confusion is that I'm relatively new to clojure, so many of my questions are probably answered with regards to understanding more idiomatic clojure.

13:11 cmiles74: aconbere: fair enough. :-) Dave Nolan has a good talk, he works on code throughout the presentation. http://www.youtube.com/watch?v=AhxcGGeh5ho

13:12 aconbere: cmiles74: rad

13:12 cmiles74: I think I just answered my question as well

13:12 cmiles74: ALSO It feels like a lot of the material assumes familiarity with go

13:12 :)

13:12 which I don't have

13:12 BobSchack: aconbere: here is a good post on core.async as well http://swannodette.github.io/2013/08/17/comparative/

13:13 aconbere: cmiles74: basically I need to produce a future that waits on the results of a few other channels

13:13 nDuff: aconbere: I've had no problems starting with core.async and leveraging that knowledge in using go, so it ports both ways. :)

13:13 aconbere: and I think the answer is that I merge the channels all together

13:13 and then read items off of the new channel

13:13 nDuff: aconbere: ...the dots-game thing I pointed out earlier actually might be applicable to that use case, then.

13:13 aconbere: ...particularly if you follow through the refactor as well.

13:15 tbaldridge: aconbere: this might help as well. It's the code I used in my core.async talk at the Conj https://github.com/halgari/clojure-conj-2013-core.async-examples

13:15 jcromartie_: I keep getting this when I try to compile from CIDER: Unable to resolve symbol: t

13:15 on the first line of a file

13:15 which has no symbol "t" in it

13:15 aconbere: tbaldridge: thanks

13:15 nDuff: reading thanks

13:15 tbaldridge: aconbere: might make more sense once the video is up, but still there's a few comments in there that might help.

13:15 aconbere: nDuff: I think that I also tend to dismiss stuff focused on web uses of core.async

13:15 jcromartie_: and the file requires no other libs

13:16 aconbere: nDuff: I'm relatively uninterested in diving into clojure script

13:16 * seangrove gasps

13:16 aconbere: even though I suspect the fundementals are the same

13:16 nDuff: aconbere: one of the things that's useful about the design given there is that it refactors away almost all of the platform-specific bits

13:16 stuartsierra: Keep in mind, core.async is still alpha. More docs/examples will come in the future.

13:16 aconbere: stuartsierra: understood! It just solves a specific problem I have so I'm diving in

13:17 stuartsierra: in particular I'm very very happy with ztellman's aleph, but the callbacks are forcing me to do some weird bindings

13:17 cmiles74: I've been using core.async with my Swing (seesaw) code without issue. The core ideas translate pretty well.

13:17 aconbere: stuartsierra: so I'm bridging lamina's channels to core.async to get a more imperative code style

13:17 jcromartie_: blergh, there was a stray "t" somewhere down in the file

13:17 instilled1: do you guys use smartparens with emacs? I've started the mode but fail to know how to delete an outer pair of parens. can anyone help?

13:17 jcromartie_: why did it throw the error on line 1?

13:18 instilled1: ^^…started using the mode …

13:18 technomancy: jcromartie_: because stack traces are hard =(

13:18 jcromartie_: the stack trace didn't indicate the source line

13:18 nDuff: instilled1: M-s

13:19 technomancy: jcromartie_: tell me about it. drives me nuts.

13:19 nDuff: instilled1: ...in paredit, anyhow. Dunno about this "smart-parens" thing.

13:19 instilled1: nDuff: that was it. cheers a lot!

13:19 technomancy: jcromartie_: never trust a stack trace

13:19 jcromartie_: technomancy: I wasn't sure if you were saying "stack traces are hard and you (jcromartie) don't understand them" :)

13:19 technomancy: yeah

13:19 technomancy: hehe; nope

13:20 jcromartie_: not really much less infuriating than troubleshooting Ruby syntax errors

13:20 seangrove: technomancy: I assume you mean stacktraces are hard to generate properly?

13:20 instilled1: it takes some time to get used to this auto whatever paren mode...

13:20 technomancy: jcromartie_: huh; do you get errors that contain actual lies from Ruby?

13:20 seangrove: hahaha

13:20 jcromartie_: not actual lies, no

13:21 but finding the missing "end" somewhere in the next hundred lines is about as much fun

13:21 maravillas: all of the roehl tickets on that spreadsheet should end up in the release-1.1 branch (android)?

13:22 technomancy: eh; those are pretty easy to spot with auto-reindent

13:22 seangrove: I wonder if human heuristics could be encoded. "You have 10 defns inside of another defn starting at line 10, did you mean to do that?"

13:22 maravillas: whoops

13:22 technomancy: which is one of those things I just want to yell about when people suggest whitespace-sensitive lisp syntax

13:23 seangrove: You'd have to catch the EOF error or "unexpected delimiter )" error and return as much of a complete datastructure as you could though.

13:23 dnolen: jcromartie_: tools.reader is a lot better at reporting error location than Clojure's reader for mistakes like that

13:23 technomancy: seangrove: at least puredanger said they're likely to switch to ex-info soon

13:24 so getting useful info out of them and building suggestions on top of that might become feasible

13:24 seangrove: technomancy: Ah, yes, that's true.

13:24 That could be a huge frustration-saver, for new and old users alike.

13:24 technomancy: the world would have been a better place if ex-info had landed in 1.1 or 1.2 instead of 1.4 =)

13:26 that's one of those changes it just takes a long time for the rest of the ecosystem to catch up to

13:27 jcromartie_: dnolen: so I'd just load tools.reader and read the trouble file independently of require'ing it

13:27 ?

13:29 dnolen: jcromartie_: worth a try anyway

13:40 andyf: seangrove: Latest unreleased version of Eastwood issues warnings for defs inside of other defs. Should be released in a week or two

13:42 seangrove: andyf: But that needs to be combined with catching a missing or extraneous ') somewhere in the source file

13:42 Pupeno_w: Where's the list of the clojure primitives? those that cannot be implemented in clojure itself. I remember seeing it somewhere.

13:42 andyf: But Eastwood is targeted at only working on syntactically correct code right now

13:42 seangrove: If you have that it's probably enough to track down the missing delimiter location

13:42 andyf: Yeah, and that seems fair :)

13:46 andyf: technomancy: It won't have anyhhing done until after 1.6, but you can tell all your friends to vote on clj-1280, which may help in the better error msg dept

13:47 seangrove: andyf: technomancy doesn't have friends.

13:47 He has a posse.

13:47 technomancy: oh, do people actually watch the votes?

13:47 Raynes: He has me. :(

13:47 technomancy: I thought that was just an opinionfest =)

13:47 Raynes: I'm his friend, obviously.

13:47 seangrove: Raynes: You're clearly in the posse category.

13:47 Raynes: technomancy: Oh oh oh! My test-vars patch finally got in.

13:48 seangrove: "posse: a body of men, typically armed, summoned by a sheriff to enforce the law."

13:48 Sounds right to me.

13:48 andyf: Technomancy: alex miller does. He isn't the final decision maker, but he is doing a lot of jira wrangling these days

13:48 hiredman: technomancy: andyf actually generates this weighted report thing

13:48 Raynes: Quick, maybe a bunch of clojure.test patches! I've figured out the wait time is like two years.

13:48 s/maybe/make/

13:49 technomancy: fancy

13:49 pjstadig`: wow

13:49 i had basically decided that clojure.test would never ever get a patch applied to it

13:49 ever

13:49 andyf: Raynes: (in ghost Obi-Wan voice). Use alter-var-root, Luke .... Let go, Luke

13:49 technomancy: pjstadig`: yeah, I've just resigned myself to constantly monkeypatching

13:50 pjstadig`: it should just get split out

13:54 technomancy: indeed

13:59 dnolen: high resolution profiling in Chrome Canary - definitely useful for optimizing CLJS code, http://www.html5rocks.com/en/tutorials/developertools/novdigest/

14:00 seangrove: dnolen: Thanks for that, just about to the point where I need to do profiling. Have multi-second delays when crunching some medium-ish sized data.

14:02 dnolen: seangrove: if there's a particular combo of operations that is strangely slow, please open a ticket - or add more info to an existing more (like the locals clearing one)

14:02 s/existing more/existing one

14:02 seangrove: dnolen: Will definitely do so whenever I dive into it. Still getting correctness and features down before profiling and speeding up.

14:24 expez: Any difference between hash-set and set? Is hash-set only there so you can make sure you actually get a set based on HashSet?

14:24 jcromartie_: you mean the function clojure.core/set ?

14:25 expez: the source says PersistentHashSet/create for set and /createWithCheck for hash-set, but they seem to be doing the same.

14:25 jcromartie_: yes

14:25 jcromartie_: clojure.core/set returns a set from the given collection

14:25 clojure.core/hash-set returns a set of its arguments

14:25 the difference is really in the arity

14:26 ,(set [1 2 3])

14:26 clojurebot: #{1 2 3}

14:26 jcromartie_: ,(hash-set 1 2 3)

14:26 clojurebot: #{1 2 3}

14:26 llasram: Well, and `set`'s contract is just that it returns some sort of set

14:26 jcromartie_: yes

14:26 expez: aight, thanks

14:26 llasram: expez: There's also `sorted-set`

14:27 jcromartie_: which is pretty darn nice

14:27 technomancy: it's like the difference between vec and vector

14:28 llasram: Or `map` and `hash-map`

14:28 technomancy: >_<

14:28 llasram: :-D

14:31 expez: Any of the libraries for generative testing (a la quickcheck) a clear favorite in the community?

14:31 tbaldridge: expez: simplecheck and test.generative are really the only two

14:32 expez: clojurecheck is no more?

14:33 hiredman: and simplecheck does shrinking

14:34 expez: nice

14:35 seangrove: Damnit. Is the :foreign-libs field in cljsbuild only for closure-compatible libs?

14:36 It's so nice to have the file prepended before any code dependent on it, has cleaned up a lot of logic for us.

14:38 gfredericks: TimMc: I wonder why the feel like cheating. Is there something gross about them? they're not exactly not-functional

14:40 TimMc: gfredericks: They can't participate in a total order.

14:40 Almost as bad as NaN.

14:41 bitemyapp: technomancy: clojure.test getting split out to a maintainer on github would be the best Christmas present ever.

14:41 technomancy: bitemyapp: weeeeeellll https://github.com/pjstadig/conjecture

14:41 dnolen: seangrove: they have to closure compatible in the sense that Closure will rename stuff - but no they don't need to goog.provide anything

14:42 seangrove: for example to use React.js, you would use :foreign-libs + :externs

14:42 seangrove: dnolen: Ah, I didn't add :externs, let me try with that.

14:42 * TimMc cancels his gift order to bitemyapp of a Cloak of +3 Smiting

14:43 llasram: They make those in +3? You stop following magic items for a few months...

14:45 bitemyapp: TimMc: whoa, smiting? A creepy cloak? you know me so well...

14:45 do want

14:45 arrdem: TimMc: make it purple and I'll chip in a few BTC

14:45 TimMc: No, no, a separated clojure.test will be a better present, I'm sure.

14:47 llasram: You found me out! I've never played a game with such constructs.

14:47 seangrove: dnolen: hrm, I think if you add a file to :foreign-libs you may not be able to also add it to :externs. Presumably it's automatically added as an extern for itself?

14:48 TimMc: arrdem: I've been teaching myself electrical circuits; there has to be a place for inductors in an artifact of smiting.

14:48 dnolen: seangrove: hmm, seems like someone else figured this out https://github.com/piranha/pump/blob/master/project.clj, haven't tried it myself

14:48 TimMc: (THere's a very simple prank circuit you can make that doesn't zap you until you let go of it.)

14:51 Jarda: hmm..

14:53 I created a jar of my ring app

14:53 with lein ring uberjar

14:54 seangrove: So much conflicting information on cljsbuild.

14:54 Jarda: one of my api calls now responses with 500

14:54 but no error log anywhere

14:55 does the jar-stuff end up stderr not being outputted

14:55 hiredman: did you setup logging?

14:55 Jarda: hiredman: no I didn't, I haven't found any info about it

14:55 hiredman: how are you running the uberjar?

14:56 Jarda: hiredman: java -jar my.jar

14:56 sveri1: hi, when i execute lein jar, is there a way to add a specific build version to the jar name?

14:56 hiredman: Jarda: is it actually starting ring?

14:56 err

14:57 I should say, is it starting jetty?

14:57 Jarda: hiredman: yeah the service works great

14:57 hiredman: Jarda: what does that mean?

14:57 Jarda: hiredman: there's just one route that is erroring

14:57 one request that doesn't work

14:57 and I can't find the exception anywhere

14:58 hiredman: Jarda: is there an exception?

14:58 Jarda: hiredman: well of course there is, otherwise the service wouldn't be sending 500 internal server error..

14:58 hiredman: Jarda: that depends

14:58 Jarda: well I'm not sending it myself either

14:58 llasram: sveri1: The project.clj `:jar-name` entry lets you specify the JAR filename. You can add something like ~(System/getenv "BUILD_NUMBER") to splice in a build version from the environment

14:59 gfredericks: TimMc: NaN can totally participate in a total order

14:59 hiredman: Jarda: anyway, unless you setup logging, there is none

14:59 Jarda: hiredman: yeah, can you point me to resources on how to enable loggin

14:59 sveri1: llasram: thank you, i try to find an example. do you know if there is a way to add that as an argument to lein?

15:00 TimMc: gfredericks: True, so in that way, sentinals are even worse.

15:00 gfredericks: TimMc: they can be ordered if you don't mind calling .hashcode :)

15:00 hiredman: Jarda: logging is a big thing, I like logback + clojure.tools.logging, but getting that setup is annoying

15:00 TimMc: gfredericks: Blorf.

15:00 Jarda: IMO error logging is something that should be built-in..

15:01 gfredericks: TimMc: we haven't even touched mutability though!

15:01 TimMc: *nod*

15:01 I was only considering immutable things.

15:01 hiredman: Jarda: ok

15:01 gfredericks: I'm just trying to figure out why this is gross

15:01 llasram: sveri1: Well. You could use the `update-in` task to set `:jar-file` from the command-line.

15:01 Jarda: ok, I'll try to enable some logs

15:02 very little info about that on google

15:02 hiredman: ~google ring request logging

15:02 clojurebot: First, out of 89100000 results is:

15:02 duelinmarkers/ring-request-logging · GitHub

15:02 https://github.com/duelinmarkers/ring-request-logging

15:02 hiredman: not entirely fare, because I have tried to use that project and didn't like it / it didn't seem to work

15:03 so I replaced it with my own little ring middleware

15:03 but there are other hits for that google search

15:03 zilti: What's currently state-of-the-art of debugging with cider? Ritz seems to be somewhat dead.

15:03 sveri1: llasram: that sounds good, do you have a quick example? if not its ok, i will try to figure it out by myself

15:03 Jarda: hiredman: yeah, a lot of outdated / not working solutions it seems

15:03 and nothing like "log to a file called error.log all unhandled exceptions"

15:04 seangrove: I think source map generation must not be compatible with :foreign-libs.

15:04 Jarda: a huge dissapointment for me

15:04 llasram: sveri1: just the help in `lein help update-in`

15:04 hiredman: Jarda: because once you have logging via something like clojure.tools.logging, that is a one liner ring middleware

15:04 sveri1: llasram: ok, thank you very much :-)

15:05 zilti: More exactly what I'm looking for is a tool working with cider with which I can set breakpoints

15:05 * seangrove is getting so angry he may make his own cljs graphing library.

15:06 bitemyapp: seangrove: don't get angry.

15:06 technomancy: anger leeds to hate; hate leads to software; software leads to suffering.

15:06 bitemyapp: seangrove: c2 not suit your needs?

15:11 seangrove: bitemyapp: Looking at c2, maybe it could. I don't see much in the documentation though, I just need to draw a basic line graph.

15:12 bitemyapp: seangrove: well the idea is to avoid re-treading at least the parts of your problem c2 solves even if it isn't prebaked to draw a line graph.

15:12 seangrove: I've been using flotr2 and everything works, but it blows up in advanced compilation mode. I may pull it out and try including it as a separate <script> tag and add a namespace to handle loading order, etc.

15:13 bitemyapp: that would probably be more productive.

15:13 dnolen: seangrove: based on http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html, :foreign-libs and :externs seem like they should be compatible

15:13 seangrove: Maybe flotr2 has a closure-compatible unminified file...

15:14 dnolen: Yeah, that's what I thought, but it causes a "JSC_DUPLICATE_INPUT" error if you reference the same file as a foreign-lib and its own extern.

15:14 I'll continue trying various permutations.

15:14 dnolen: seangrove: sounds like a bung on our end if that's true

15:14 ha s/bung/bug

15:18 seangrove: dnolen: Yeah, this works: https://www.refheap.com/6e89561fc059cf56371201997

15:18 dnolen: seangrove: wait, what wasn't working?

15:18 seangrove: flotr2-2.js is just a copy of flotr2.js. They can be identical inputs and it'll compile and work (names nor improperly munged), but they can't be the same file

15:19 Probably a limitation of the closure compiler, but I'm not sure

15:19 dnolen: seangrove: oh you don't have a real extern file

15:19 seangrove: Yeah, trying to use the file itself as an extern file

15:20 dnolen: seangrove: maybe that supposed to work? but seems weird to me

15:21 seangrove: dnolen: I think it's been suggested a few times to just use the file itself as its own intern. You don't get typing information, but you avoid incorrect munging.

15:22 dnolen: seangrove: I haven't heard that anywhere - seems like it would be too inconsistent to work.

15:22 seangrove: the real solution to this problem is of course to automatically generate the extern.js file for you when using :foreign-lib or js/

15:23 seangrove: dnolen: That sounds like the most pleasant/maintainable approach

15:26 dnolen: Doesn't seem to be super straightforward though. I'll possibly come back to this, but I'm likely to just migrate to something nicer for the cljs experience... not the right thing for cljs long-term, but need to get this out first.

15:27 Javascript just doesn't provide enough metadata for useful tools to be built properly around it :P

15:27 noprompt: any tips for testing core.async code in cljs?

15:28 i was thinking i could probably just borrow the runner from core.async itself

15:28 err the repo.

15:30 bitemyapp: noprompt: speaking more generically, I have some strategies for testing core.async if you need them.

15:30 Mostly to do with forcing a terminal state so that I can evaluate what happened and to see if it matches expectations.

15:30 noprompt: bitemyapp: client side tho?

15:30 or should it even matter.

15:30 bitemyapp: obviously not but I'm not sure how that'd make a difference, the stategies I speak to are generic.

15:31 noprompt: sure, i'd love to hear your take on it.

15:31 dnolen: seangrove: it actually shouldn't be very hard to do, just a new analyzer pass that collects data for emission.

15:31 bitemyapp: well let me know when you need it.

15:31 noprompt: bitemyapp: now

15:31 :)

15:31 bitemyapp: is it me or would *-to-JS compilers benefit from some standardized tooling?

15:32 dnolen: seangrove: if you have a :dot form or :invoke form via js/ or :foreign-lib that'll go into the automatically generated extern.

15:32 bitemyapp: noprompt: well basically it depends on what you need, a scalar value or a collection.

15:32 TEttinger: bitemyapp, there's some tools listed at http://altjs.org at the bottom

15:32 but nothing standard

15:33 bitemyapp: TEttinger: the problem is that most people want to write the tools in their source language, not JS itself.

15:33 TEttinger: yeah... so how would there be standardized tooling?

15:34 to be fair, if you're writing a *-to-JS translator, you better know JS

15:34 bitemyapp: noprompt: if it's just a scalar, then you could do something like having a go block deliver a promise that your test blocks on. If it's a collection you do something Writer monad'ish and log all the input or output data to a collection.

15:34 noprompt: bitemyapp: i want to verify that databinding is working.

15:34 seangrove: dnolen: This is essentially our wrapper around flotr https://www.refheap.com/e9a205e5559cd265f5a13a28c

15:34 noprompt: bitemyapp: ie. i put! a value on a channel and textNode.data is appropriately changed.

15:34 bitemyapp: noprompt: smash the DOM, see if the model changed. Vice versa.

15:36 seangrove: dnolen: I don't think there's enough there for the analyzer to know what the external invocations are

15:36 At least, there's no linkage between js/Flotr and [flotr] the namespace/foreign-lib

15:37 noprompt: dnolen: what do you think? should i just borrow code from the core.async repl and run the tests traditionally in a browser?

15:39 zilti: What's the state-of-the-art for debugging / setting breakpoints with cider?

15:42 dnolen: seangrove: I don't see why there needs to be to calculate the external invokes

15:43 technomancy: zilti: ritz is the only stepping debugger. there's debug-repl stuff like limit-break, and there's ways to trigger tools.trace over cider.

15:44 bitemyapp: ritz is...not really a stepping debugger.

15:44 dnolen: noprompt: yeah borrowing from core.async tests is not a bad idea - but this is something that clojurescript.test just needs to support cemerick is aware - but he's offline for 2 weeks

15:44 bitemyapp: ~zergling

15:44 clojurebot: zergling is https://github.com/prismofeverything/schmetterling

15:44 bitemyapp: zilti: ^^

15:44 seangrove: dnolen: Ah, I see what you mean then. Keep track of any references to external ns, use that as the externs. could be good, yeah.

15:44 bitemyapp: zilti: http://clojurewiki.com/Tracing

15:44 technomancy: zilti: if you want to do nrepl-backed tooling, please consider making it editor-agnostic instead of hard-coding against cider: https://github.com/technomancy/nrepl-discover

15:44 bitemyapp: ~tracing is http://clojurewiki.com/Tracing

15:44 clojurebot: Roger.

15:44 zilti: bitemyapp: Umm. From the... browser. ??

15:44 lazybot: zilti: Uh, no. Why would you even ask?

15:45 technomancy: bitemyapp: there's no cider support in zergling tho

15:45 bitemyapp: technomancy: I am harassing the shit out of him about that *right now*

15:45 * technomancy nods

15:45 zilti: technomancy: Will keep that in mind, but I don't currently have the capacity to create any tooling stuff.

15:46 technomancy: oh, misread your comment above

15:47 bitemyapp: zilti: use zergling's silly browser bullshit until nrepl protocol support is straightened out.

15:47 technomancy: zilti: toggling tracing on a defn with a single emacs command is pretty handy, but nrepl-discover is still kind of immature

15:47 bitemyapp: zilti: tracing is usually enough and is often faster/more productive than manually stepping.

15:47 technomancy: and just pray you never hit a bug bad enough to need a stepping debugger

15:47 bitemyapp: zilti: I would strongly encourage you to try tracing first.

15:47 zilti: Thanks, I will take a closer look at that zergling / butterfly stuff

15:47 justin_smith: as I mentioned in the thread on the schmetterling repo, I like the idea of sending schmetterling events via the nrepl protocol, but someone would have to make the UI for any editor that wanted to support it

15:47 bitemyapp: zilti: no no, try *tracing* first!

15:48 zilti: it's simpler and often better in Clojure than stepping debuggers.

15:48 technomancy: oh, also I found this the other day: https://github.com/clojure-emacs/cider-tracing

15:48 bitemyapp: technomancy: sigh, goddammit, coventry was already working on Troncle.

15:48 technomancy: I think it's a bad idea in the long run, but it's there and it probably works better than the right idea

15:48 oh right, of course

15:48 bbloom: dnolen: i'm so glad you're finally paying attention to reactjs

15:48 zilti: technomancy, bitemyapp: Is it like tools.tracing? I got some weird bugs and it seems like it only could be used in a quite limited manner. (Or I used it wrong)

15:49 dnolen: bbloom: yes watching the talk and poking around the source has got me interested

15:49 guns: immutable datastructures have greatly diminished my desire for stepping debuggers; the add-watch function on refs takes care of the few times I need it

15:50 bbloom: guns: clojure.core/reductions <- best "stepping" debugger ever

15:50 bitemyapp: zilti: you probably used it wrong. immutable datastructures and referential transparency make tracing enough to follow what your program is doing 98% of the time.

15:50 guns: bbloom: yes, I remember spitting out my coffee when I found that one

15:51 bitemyapp: zilti: it's extremely unlikely that your problem is so complicated as to need an actual debugger.

15:51 zilti: bitemyapp: I'm not saying that. But the last time I used the tracing macro, some things stopped working.

15:51 bitemyapp: technomancy: https://github.com/clojure-emacs/cider-tracing/issues/3 so apparently today is "bitemyapp is angrily herding cats" day.

15:51 zilti: well. that's strange. try deftrace again.

15:51 zilti: bitemyapp: IIRC it started to have problems if a certain wrapped whatever got loaded multiple times into the repl.

15:51 bitemyapp: zilti: check out Troncle too, it has nice Emacs integration (if you use Emacs)

15:52 zilti: so use deftrace

15:52 technomancy: bitemyapp: it's not actually part of cider, but I agree.

15:52 bitemyapp: reloading things in the REPL has weird semantics if you don't know what you're doing.

15:52 technomancy: it has the cider-* label slapped on it.

15:53 technomancy: bitemyapp: https://github.com/technomancy/nrepl-discover

15:53 justin_smith: zilti: that likely means the namespace has side effects in the top level code

15:54 guns: ++nrepl-discover ; sorry I didn't mention it in the slamhound release, technomancy. I thought it might confuse people

15:54 technomancy: guns: no, it's still too experimental

15:55 at this point I would like to have tooling people look at it, but not end users

15:55 noprompt: dnolen: yeah i've been using cljs.test and that's where i ran in to trouble. i'll go the other route for my async tests now and then move them over once cljs.test has support.

15:55 bitemyapp: technomancy: my main battle is getting people to understand that nrepl is a protocol, not just a REPL.

15:55 guns: okay, I thought I made the right decision. Seeing the issues that have popped up since reinforces this

15:55 seangrove: bbloom: What's caught your attention around reactjs?

15:56 bitemyapp: ~frp is a comonad

15:56 clojurebot: Ik begrijp

15:56 bitemyapp: ~reactjs is a poorly implemented comonad

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

15:58 technomancy: bitemyapp: right; so part of the point of that whole project is to propose changes to nrepl itself, so I guess it's not really parallel

16:00 bbloom: seangrove: ignore bitemyapp as usual :-P

16:00 noprompt: bitemyapp: there are good ideas in reactjs. honestly i've thought for awhile the separation of html and javascript code that manipulates it is nothing more than popular superstition.

16:01 it's separated in the sense that it is in two files and that's pretty much it.

16:01 bbloom: seangrove: i've discussed reactjs at length in here before. not a lot of time to chat at the moment tho, sorry

16:02 seangrove: bbloom: No worries, I'll try to remember to search the logs, I'm very curious to hear about ui approaches right now

16:02 noprompt: i actually think it should go one step further an package specific CSS in the component as well. a stylesheet can be dynamically editted at run time.

16:03 bbloom: noprompt: i believe the react guys have been considering css isolation for a while now, but i dunno of any meaningful attempts at it

16:03 noprompt: this sort of thing should be very possible with good protocols.

16:06 bbloom: i've expiremented with the closure api's for manipulating the CSSOM and it seems very doable.

16:07 brainproxy: dnolen: seems like source map generation results in non-linear increases in compile time as the amount of source code in a project increases (even modestly)

16:07 noprompt: bitemyapp: wtf is a comonad?

16:07 brainproxy: and I mean w.r.t. incremental compile time

16:08 w/o source maps, I have incremental build times ~0.6s, w/ sourcce maps incremental build time is around ~40s

16:11 seangrove: brainproxy: dnolen's stance on that is to not use any optimizations when doing dev work

16:12 brainproxy: seangrove: i have optims at :whitespace

16:13 dnolen: brainproxy: I've seen little evidence that this something we can control - generating source maps for CLJS is very fast, I suspect most of the time is spent in Closure

16:13 seangrove: brainproxy: Yeah, you'll need to use :none. I do it the same way as you, I haven't switched over yet

16:13 brainproxy: alright, I can try setting to :none and see if that helps

16:13 dnolen: brainproxy: also source maps use more of memory, you may need to bump the amount of memory you give to the JVM when building w/ source maps enabled.

16:13 seangrove: brainproxy: You'll need to update the html file including the javascript

16:15 brainproxy: seangrove: yeah, just realizing that

16:15 and it's a lot of stuff... :-/

16:15 seangrove: brainproxy: *should* be easy, one second...

16:17 brainproxy: I can't find the link right now, but apparently you can just put <javascript>goog.require('you-entry-ns.name')</script> and closure will require all the individual files for you

16:18 So you just replace your existing [:script {:type "text/javascript" :src "/js/bin/main.js"}] with [:script {:type "text/javascript"} "goog.require('my-ns.name')"]

16:19 brainproxy: seangrove: awesome

16:20 seangrove: brainproxy: Please let me know if that works for you, I may switch over at some point :)

16:22 Looks like a lot of the performance damage is coming from pushing a lot through clj->js

16:23 brainproxy: seangrove: bumping to `:jvm-opts ["-Xmx2g"]` in project.clj made a huge difference

16:24 seangrove: brainproxy: Still using :whitespace?

16:24 brainproxy: nvm I'm stupid

16:24 rechecking

16:28 zerokarmaleft: haha, macroshka is the best namespace name I've seen this year

16:30 bitemyapp: zerokarmaleft: that's pretty good :)

16:30 coventry: we like your namespaces.

16:32 dnolen: seangrove: clj->js is not going to be cheap, I honestly don't know why people use it for anything but the simplest interop

16:32 seangrove: dnolen: I'm just using it at the interop line with the graphing lib, not sure I could get away with using it less. But drilling down still.

16:33 bitemyapp: seangrove: abaranosky gave a talk where he mentioned walking your data structures was a performance no-no :)

16:33 seangrove: you can replace clj->js with macros that translate your mappy operations to object-compatible ones.

16:34 dnolen: seangrove: yes but if your data is something nested or larger than small, clj->js is likely to be a bottleneck

16:35 seangrove: dnolen: Yeah, but it is a bummer. I'm doing a ton of filtering/slicing/dicing of the cljs data, and that's obvious not going to work as well on javascript objects

16:36 I'll have to think about this... maybe doing a cljs-only graphing lib would get around the issue, or maybe I just have to give up most of the cljs data structures if I want to get them back into the dom/canvas at some point

16:37 writing some nice macros on top like bitemyapp suggests

16:38 redalastor: I have code that calls web API which I'd like to validate against schemas at compile time (easy enough with macros). But I'd like to cache every schema after it has been access once to avoid redownloding uselessly and get rid of them all after the compilation is over. Is there an easy way to do that?

16:39 * seangrove cringes

16:40 seangrove: It's pretty cruel, to realize how much client-sode development is made easier by having cljs data structures and clojure's loanguage semantics, and then to realize that you can't use it not because it's too slow, but just because of the interop layer.

16:41 Might be able to size the data structures down a bit before shipping them off to js-land

16:41 bitemyapp: (づ ◕‿‿◕ )づ gib macro

16:42 dnolen: seangrove: I hacked up a thing with JS Proxy, could work - but it's not widely available - is this your Chrome extension project?

16:42 seangrove: dnolen: No, this is a new product, stand-alone

16:43 bitemyapp: ☬

16:45 I can also cut down on the size of the data for the time being, and that with advanced compilation and no logging is probably enough

16:45 dnolen: What is the JS Proxy thing?

16:46 dnolen: seangrove: ES6 proxy, they support intercession

16:47 seangrove: so you can wrap an object and make it work transparently like some other object/array

16:47 justin_smith: seangrove: that's a sikh symbol, right?

16:48 dnolen: seangrove: needs runtime support though, you can't shim it in

16:48 seangrove: dnolen: Wow, sounds very interesting. Looking forward to that making its way into the browser.

16:48 justin_smith: Hindu, I thought

16:48 dnolen: seangrove: works pretty well in Node, very experimental support for it in master

16:49 seangrove: mori master

16:49 seangrove: https://github.com/swannodette/mori/blob/master/src/mori.cljs#L172

16:50 seangrove: dnolen: Yeah, looks like it's not even enabled in Canary yet

16:50 dnolen: seangrove: it's definitely available there

16:50 seangrove: But that's pretty brilliant, means a significantly lighter overhead, seems like

16:51 dnolen: Enabled by default, or with a flag?

16:51 dnolen: seangrove: oh right, yeah it's a flag

16:52 seangrove: Anyway, looks very cool. I'll cut the data size down for the time being and move on

16:53 brainproxy: seangrove: I can't get goog to actually load stuff

16:53 though after some fiddling I no longer have errors in the console

16:53 seangrove: brainproxy: https://github.com/swannodette/mies/blob/master/src/leiningen/new/mies/index.html#L5

16:53 Does it look like that?

16:55 dnolen: seangrove: CLJ story here is way better as there are standard collections interfaces to actually implement in Java

17:00 seangrove: dnolen: aka "Javascript strikes again"

17:02 bitemyapp: I'm really glad I managed to shift into doing more backend work at my company.

17:04 dnolen: seangrove: hum clj->js iplementation for coll? is pretty bad

17:04 seangrove: bitemyapp: I do what I do not for me, but for those who come after me, that they may have better patterns and understandings, and thus be able to more rapidly and concisely express their intentions.

17:04 dnolen: seangrove: at least 2X slower than it should be if not worse

17:04 * seangrove gazes off into the distance

17:04 dnolen: for arrays

17:04 seangrove: dnolen: Yeah, the array bit is taking up the biggest chunks in the firechart

17:05 dnolen: seangrove: effectively two array clone operations happening

17:05 seangrove: If I *really* have to I can push it back onto the server side and do it there, but it's just a delight being able to make these complex apps happen client-side in a way that would be terrifying if written in Javascript

17:06 dnolen: seangrove: http://dev.clojure.org/jira/browse/CLJS-709

17:06 seangrove: this would probably be huge perf boost for you.

17:06 seangrove: might want to try that locally and see if it helps

17:07 seangrove: dnolen: Looks like you got the same profile info I did

17:07 dnolen: seangrove: no I just looked at the code

17:07 seangrove: dnolen: Well then, good job with intuition ;)

17:08 matches my profiling pretty well

17:08 dnolen: I'll check it out later, gotta get the first version out the door this week and I'll cheat with the size of the data first.

17:11 m0g: I'm trying to use a java enum's `of ` method from Clojure but am getting nowhere. Any hint onthe syntax? The enum is Character.UnicodeScript if it can help

17:11 akurilin: bitemyapp, gratz! :)

17:11 bitemyapp: akurilin: what?

17:11 akurilin: Regarding the backend thing.

17:11 bitemyapp: Oh, uh, thanks

17:11 akurilin: it's where the fun is

17:12 I'm going to be porting our iOS client to a web MVC for the next month, so I'm jealous of you right now :)

17:12 bitemyapp: it's not to say that I'm not thinking about frontend, (FRP, Elm, Polymer, etc), but I don't really have to actually do anything about it right now.

17:12 mattmoss: ,(Character.UnicodeScript/of 13)

17:12 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: Character.UnicodeScript>

17:13 akurilin: bitemyapp, is FRP a significant and meaningful step forward in your opinion?

17:13 bitemyapp: akurilin: yes, but it works better with types.

17:13 seangrove: ~frp

17:13 clojurebot: frp is the language of choice of octopodes

17:13 bitemyapp: ~reactjs

17:13 clojurebot: reactjs is a poorly implemented comonad

17:13 bitemyapp: ~frp

17:13 clojurebot: frp is a comonad

17:13 bitemyapp: ~botsnack

17:13 clojurebot: Thanks, but I prefer chocolate

17:13 akurilin: seangrove, think I saw your post on HN job postings and you were talking about FRP there, right?

17:14 I'm trying to figure out if I should nut up and do this upcoming month-long project in cljs rather than js

17:14 bitemyapp: akurilin: I'm indirectly competing with one of the companies in the HN job posts.

17:14 devn: DO ITTT

17:14 akurilin: What's the inflection point where cljs starts to pay off?

17:14 bitemyapp: devn: easy there killer.

17:15 akurilin: does it have to do with codebase size, or type of work being done in the client?

17:15 devn: akurilin: when you want to work on it

17:15 bitemyapp: akurilin: depends on the hacker, codebase size, type of work, etc.

17:15 akurilin: I'd say cljs pays for itself just by being more pleasurable.

17:15 leads to less mental friction when hacking.

17:15 * technomancy is still intimidated by lein-cljsbuild

17:16 akurilin: bitemyapp, does the fact that a lot of MVC work ends up being fairly OO-flavored make cljs uglier to use?

17:16 bitemyapp: technomancy: I'm intimidated by the compiler itself.

17:16 akurilin: no, and that's brain-damage specific to a design problem. It doesn't affect CLJS.

17:16 akurilin: bitemyapp, to be more precise, a lot of MVC work with certain frameworks.

17:16 noprompt: i hate the web.

17:16 bitemyapp: akurilin: you can model your problem however you like in CLJS.

17:16 noprompt: there i said it.

17:16 lol

17:17 bitemyapp: noprompt: I should stop describing myself as full-stack just so I can stop exit-stage-right'ing out of frontend work.

17:17 noprompt: bitemyapp: the frontend is the worst place on earth.

17:17 bitemyapp: noprompt: it's one of them. I hear North Korea has terrible winter weather.

17:17 akurilin: I was actually going to completely forgo requirejs, coffeescript, minimization etc this time until the thing is up and running for a while and I start caring enough.

17:17 brainproxy: seangrove: yep, exactly like that

17:17 technomancy: bitemyapp: that won't stop your friends from pranking you by endorsing you in those skills on linkedin

17:17 brainproxy: I keep getting "Uncaught Error: Undefined nameToPath for goog.string "

17:18 technomancy: "friends"

17:18 bitemyapp: technomancy: I've had enough of getting endorsed in Python and SQL as it is.

17:18 brainproxy: when I try to require 'my.test'

17:18 technomancy: foes, whatever

17:18 bitemyapp: akurilin: well that's just it, requirejs etc etc is just a piecewise attempt at getting what cljs and the associated tools will give you.

17:18 akurilin: everybody endorse bitemyapp for bower, grunt, backbone

17:18 bitemyapp: akurilin: might as well win the leverage of cljs itself in the process.

17:18 of those, I've only used backbone, and I fucking hated it.

17:19 ~backbone is awful

17:19 clojurebot: Roger.

17:19 devn: angular isn't so bad

17:19 backbone is what you make of it

17:19 bitemyapp: I liked angular, but the CLJS integration sucks.

17:19 devn: i've had a good experience

17:19 akurilin: I'm a backbone believer. Hate me.

17:19 devn: (with backbone i mean)

17:19 brainproxy: akurilin: I like bower and grunt

17:19 m0g: Still stuck on this simple thingy of calling CharacterUnicode.of from clojure if anyone feels like dropping a hint :o]

17:20 brainproxy: but am gunning for clojurescript and polymer

17:20 bitemyapp: wow, two Clojure programmers that both got dropped on their heads. what are the odds?

17:20 devn: im just telling you based on experience, which is one huge codebase with a large distributed team

17:20 it's worked out well, but it was all more or less hand-rolled

17:21 akurilin: bitemyapp, I agree about leverage. I really enjoyed the result of your endorsement of instaparse's leverage, so it might be a good idea to give this a shot as well.

17:21 TimMc: m0g: UnicodeBlock, you mean?

17:21 bitemyapp: the last time I used backbone I pissed blood and went into a fugue state.

17:21 devn: everyone writing code has gotten more and more functional in their style, which has brought them around to clojure and clojurescript

17:21 m0g: TimMc: oh sorry, Character.UnicodeScript.of

17:21 devn: we're using google closure on it for require/provide

17:21 TimMc: m0g: I don't see a Unicode*Script*.

17:21 devn: it could be better, but it's not bad

17:21 TimMc: Just making sure we're looking at the same thing.

17:22 m0g: TimMc: are you looking at java >= 7?

17:22 TimMc: Hmm, no.

17:22 m0g: I think it appeared in java 7

17:22 bitemyapp: akurilin: the equivalent'ish to Instaparse (insofar as it's a GLL parser combinator library) in Haskell is Parsec. Parsec is the original industrial-use exemplar of this kind of parsing library. Super-nice.

17:22 TimMc: m0g: Anyway, $ for inner classes.

17:22 m0g: nice, I'll try that :)

17:22 thanks7

17:22 -7*

17:23 bitemyapp: technomancy: doesn't Racket have a Parsec equivalent?

17:23 akurilin: bitemyapp, I'm still not sure if there's something obvious I'm missing by not needing a lexer in there, and if it's just because my project was so minuscule. I know Mark has been pondering supporting tokens for a while.

17:23 TimMc: m0g: (I still don't see UnicodeScript in Java 7)

17:23 m0g: it's an enum

17:24 technomancy: bitemyapp: hm; wouldn't surprise me

17:24 akurilin: regarding cljs, when people occasionally say it's still "in alpha/beta", what does that actually mean from the perspective of someone considering this for production?

17:24 m0g: http://docs.oracle.com/javase/7/docs/api/java/lang/Character.UnicodeScript.html

17:24 technomancy: I saw a strangeloop talk (last year?) on another clojure port of instaparse

17:24 I think the author got distracted though

17:24 TimMc: m0g: Oh, that's an irritating interface, I see.

17:24 m0g: TimMc: yup, quite painful

17:25 akurilin: bitemyapp, what's cool is that you said that something like Parsec is by itself enough of a killer app that people will learn Haskell just for that.

17:25 bitemyapp, says quite a bit about how useful that library is.

17:25 TimMc: Looks like neither evalbot is on Java 7 yet.

17:26 bitemyapp: akurilin: Parsec is partly why some people really like writing compilers and interpreters in Haskell.

17:27 akurilin: Perl 6's primary implementation was Haskell for many years. I don't know if that's changed or not since.

17:27 devn: yeah, parsec is basically it

17:27 akurilin: Wow, that's interesting.

17:27 bitemyapp: How Perl programmers thought to use Haskell is beyond me, but you know, whatever.

17:27 devn: i learned haskell for xmonad and parsec

17:27 bitemyapp: there are other really great libraries, but Parsec is one of those libraries that changes how you think.

17:27 akurilin: devn, xmonad has some seriously devout followers.

17:27 bitemyapp: akurilin: I'm one of 'em.

17:27 devn: it rocks

17:28 m0g: TimMc: I'm still getting an error after importing the class and calling (.of Character$UnicodeScript 13). Any idea of what is going on?

17:28 bitemyapp: Haskell: come for the xmonad, GPU-acceleration, and Parsec - stay for the types.

17:28 akurilin: I never got tiling managers, I talked to people about it, and they say that if I'm already on tmux + vim, I'm getting most of the benefits already.

17:28 TimMc: m0g: (Character$UnicodeScript/of 13), since it's a static method

17:29 devn: akurilin: it was the speed for me.

17:29 bitemyapp: akurilin: I would disagree with that strongly.

17:29 akurilin: Emacs has its own windowing, but I still use Xmonad.

17:29 devn: the speed and having custom workspaces for specific tasks

17:29 bitemyapp: ^^ yep.

17:29 m0g: TimMc: it works indeed. Thanks a ton :)

17:29 bitemyapp: the workspaces in a multi-monitor setup in particular are <3

17:29 grncdr: the workspaces are indeed the big thing IMO

17:30 even on a single monitor

17:30 devn: because the switching is so fast you don't feel the pain of workspaces like you do in other OSs

17:30 bitemyapp: yeah, even in a single monitor.

17:30 akurilin: my dotfiles have an Xmonad config btw.

17:31 akurilin: workspace = you can preset what windows you want to have open where?

17:31 devn: i had one for "communication" which was email, work chat, and irc -- start writing an email, realize it's about something on my code workspace, send the email compose window over to that workspace, write a bit, send it back

17:31 akurilin: yeah, you can do that

17:31 you can also set the custom layout for that window

17:31 so your chat window will always align left along the side of the screen

17:31 etc.

17:32 akurilin: yeah tmux has something like that too, but it's restricted to just what's in the terminal.

17:32 bitemyapp: akurilin: well that's the point, everything is in Xmonad so you're not constrained.

17:32 akurilin: you don't have to try to shove everything into the terminal.

17:33 wink: akurilin: vim in split mode in tmux in split mode in terminator in xmonad (split) - welcome to recursion

17:33 akurilin: bitemyapp, got it.

17:33 I'll need to experiment with it at some point

17:33 wink: but seriously, and I have no clue why - but I keep my terminals in terminator and don't split them with xmonad

17:33 trinary: are there any even kind-of decent tiling WMs in OSX? I use Divvy but it's pretty limited.

17:33 wink: somehow I am faster with the mouse probably

17:34 grncdr: trinary: there's another one that a friend of mine was using that looked reasonable...

17:34 sorry, he's offline :|

17:34 akurilin: So what was the issue with lein-cljsbuild? Why was it "scary"?

17:35 trinary: grncdr: no worries :)

17:35 technomancy: akurilin: this is one file from the template to try to clean up the cljsbuild boilerplate to make it more accessible: https://github.com/magomimmo/cljs-start/blob/master/src/leiningen/new/cljs_start/profiles.clj

17:36 that's ha hell of a hello-world

17:37 akurilin: technomancy, yeah that's not immediately accessible, I'll give you that

17:38 Where do you cry if something related to that is breaking/not working and you have no idea? #clojurescript ?

17:39 bitemyapp: akurilin: I see plenty of people ask here.

17:42 akurilin: Cool.

17:44 Anybody else composing integration test scenarios from little blocks? Seems like you could easily setup complex test cases from small building blocks and still have it look very elegant in the test code itself.

17:44 Perhaps have the scenario setup function return the context of everything that has been created in the system

17:48 So cljs namespacing everything is pretty much the answer to JS's AMD?

17:49 dnolen: akurilin: also the mailing list is pretty active

17:50 akurilin: namespacing in CLJS isn't significantly different from namespacing in CLJ

17:50 bitemyapp: I don't think there was much intent regarding what the JS ecosystem was doing there.

17:51 akurilin: dnolen, sounds good!

17:53 dnolen: akurilin: CLJS design is pretty anti-AMD, it's expected that all the code for an application get compiled together.

17:53 coventry: Can I get a quick survey of who's using nrepl vs cider?

17:54 akurilin: dnolen, fair enough, I'm not thoroughly familiar with that part of AMD. I was referring more to the namespacing through modules part of it.

17:54 That part always felt a bit clunky, the define syntax etc.

17:54 bitemyapp: coventry: nrepl for now, I'll switch later.

17:54 akurilin: the shims.

17:55 dnolen: akurilin: right yeah, and there are competing systems, and I'm not sure what the story is as far as ES 6 modules and the things in the wild

17:56 bitemyapp: given it's JS, I'd expect them to settle on something half-assed for 6 months, then change again.

17:57 akurilin: bitemyapp, good one.

17:58 Is that the unfortunate reality of consensus by committee?

17:58 and if so, is cljs avoiding that by having a benevolent dictator?

17:58 dnolen: akurilin: in anycase, it's one of the nice things about CLJS, modules today, and a good dependency management system courtesy of lein

17:58 akurilin: in JS you gotta cobble that together yourself.

17:59 akurilin: dnolen, that sounds pretty exciting, thanks for clarifying!

18:00 dnolen: akurilin: the downside is that there aren't a zillion CLJS libs to use o' course - but it's coming along and Google Closure helps a lot for many things

18:07 akurilin: dnolen, is integrating into the build existing popular .js libraries generally problematic?

18:08 dnolen: akurilin: if you're targeting web browsers, yes it requires configuration because of Closure minification

18:09 akurilin: integrating libs not written for Closure is kinda lame as you don't get the magical minification properties that Google Closure libs and all of ClojureScript enjoys

18:11 akurilin: dnolen, are the big popular libraries all moving towards supporting Closure?

18:12 bitemyapp: akurilin: Not especially from what I can tell, but it doesn't matter.

18:12 dnolen: akurilin: what big popular libraries besides jQuery, which no doesn't work w/ GClosure, but there's little need, GClosure provides much of that functionality anyhow

18:13 akurilin: what's more annoying is that it's hard to integrate small/medium libs that provide some useful functionality

18:16 akurilin: dnolen, what do people currently do if they run into that scenario? Do they fork those libs and rewrite them for Closure?

18:16 dnolen: akurilin: no, there are knobs for this

18:19 bitemyapp: akurilin: lightning talks at Clojure meetup this Thursday.

18:20 akurilin: should I talk about Brambling or something else?

18:24 akurilin: bitemyapp, I don't know how ubiquitous datomic usage is at this point, that'd make a difference.

18:24 bitemyapp, and for people who don't use datomic yet, is this something they can relate to?

18:26 bitemyapp: akurilin: I can explain brambling in terms of any historical/immutable/event sourced database

18:26 akurilin: it's also just Clojure code and I wanted to talk about the code.

18:26 brainproxy: so it seems that goog.require does not want to be friends with the HTML Imports polyfill from the Polymer folks ... so it's a problem trying to goog.require an :optimizations :none compiled lib from w/in a .html that's being imported

18:31 akurilin: bitemyapp, sure.

18:34 bitemyapp: akurilin: I'm trying to think of other things I could talk about.

18:37 ,(reductions (fn [x y] ([:a :b :c :d :e :f :g :h :i :j :k :l] y)) (range 10))

18:37 clojurebot: (0 :b :c :d :e ...)

18:40 m0g: is there an idiomatic way to deconstruct an argument to a function? i.e., if my function takes a vector of three elements, can I assing those three elements directly like in Haskell or Prolog for example?

18:40 through some unification mechanism

18:40 bitemyapp: m0g: what?

18:41 Apage43: ,((fn [[a b c]] {:a a :b b :c c}) [1 2 3])

18:41 clojurebot: {:a 1, :b 2, :c 3}

18:41 m0g: good enough, dunno why I had any problem :]

18:41 thanks

18:41 bitemyapp: straight up destructuring? You made it sound like something else.

18:41 pdk: clojure supports destructuring argument lists

18:42 bitemyapp: m0g: that's called pattern-matching in Haskell.

18:42 Apage43: yeah, that's very much *not* prolog-y unification

18:42 or even haskell pattern matching

18:42 bitemyapp: such a weird way to describe it.

18:42 beppu: http://blog.jayfields.com/2010/07/clojure-destructuring.html

18:42 Apage43: there's some overlap, but both of those allow you to do things you can't with just destructuring

18:42 m0g: yeah sure

18:43 danielsz`: How do you guys/gals like to do string interpolation?

18:43 ,(format "string interpolation %s" (+ 1 2))

18:43 clojurebot: "string interpolation 3"

18:43 m0g: but destructuring is given for free by unification in Prolog

18:43 danielsz`: That's one way

18:43 m0g: and by pattern matching in haskell

18:43 sorry if the question was weirdly turned

18:43 danielsz`: Kinda lame, no?

18:44 m0g: beppu: thanks for the link

18:44 Apage43: danielsz`: there's https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/strint.clj

18:45 danielsz`: ,(<< "string interpolation ~(+ 1 2)")

18:45 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: << in this context, compiling:(NO_SOURCE_PATH:0:0)>

18:45 danielsz`: yes, it's in the incubator namespace

18:45 Is anyone using it?

18:45 Apage43: well incubator is a separate library you need to toss in your project.clj if you want it

18:45 but no, I've not heard of anyone using that

18:45 danielsz`: I bet nobody bothers, right?

18:46 Alan Dipert wrote the ruby style interpolation

18:46 "this is a string #{foo}"

18:46 for clojure: https://github.com/alandipert/interpol8

18:47 But it's too limited.

18:47 As far as I can see it's not doing evaluation of forms.

18:47 bitemyapp: is string interpolation that important to you?

18:48 danielsz`: bitemyapp: probably not, but it's been bothering me and I wanted to survey others.

18:49 If strint was in the core I would use it.

18:49 Apage43: you could write your own and it'd be exactly the flavor you prefer :)

18:50 danielsz`: Apage43: :-)

18:51 It's really a small thing, alright.

18:51 Apage43: i mean, it's a bit yak-shavey but it's an excuse to play with macros in a way that isn't as.. superfluous as some other common uses of macros

18:52 danielsz`: Apage43: True

19:02 noprompt: when using the listen w/ core.async is it necissary to check if the element still exists in the go-loop. ie. if it gets removed from the dom or deleted somehow wouldn't it be a good idea to close the channel?

19:10 xeqi: dnolen: is there an estimate for the next cljs release?

19:10 want to make sure I have some piggieback/austin forks ready

19:13 dnolen: xeqi: could probably cut another one at the end of the week

19:19 noprompt: dnolen: should i worry about something like that?

19:24 dnolen: noprompt: it should just get collected, but you should try it to see what happens.

19:48 devn: dnolen: one thing that nada and will left out in their presentation about tips for reading academic papers: If you want access to a lot of stuff, what should you pay for? What's free, etc.?

19:49 I find lots of interesting papers to read...behind a giant paywall.

19:50 dnolen: devn: oh right, I usually find the author's academic web site

19:50 devn: Google Scholar some times works

19:50 devn: Failing that?

19:50 Do you pay for access to anything?

19:50 dnolen: devn: if I absolutely have to have something I don't mind paying for it

19:50 devn: I used to have an ACM account.

19:50 dnolen: devn: but that's *extremely* rare

19:50 devn: also useful to ask around on the InterWebs

19:51 devn: I've been trying to find good papers on computer modeling of the cochlea, and I found ~5 papers I want to read, but which are behind paywalls. I'm new to this field in general and don't really know if these are what I'm looking for, though.

19:51 So I'm hesitant to pay up front.

19:52 Which, BTW -- the cochlea. We have two of them. They're pretty great.

19:52 As in difficult to model. :)

19:52 patchwork: devn: I find the paper on the author's site pretty much every time

19:53 devn: patchwork: good to know. I need to just google better.

19:53 patchwork: At least, some kind of pre-published version

19:53 devn: When I do a broad search I find the right papers, and then I get disheartened by the paywall and don't google the author.

19:53 Good advice dnolen && patchwork. Thank you.

19:53 garhdez: devn: if you have access to a public library, it's possible that they have a subscription to a journal database such as JSTOR

19:54 devn: garhdez: I used my girlfriend's JSTOR, Ebsco, etc. access for every last minute she was still in school. :)

19:54 but I haven't been to the public library in awhile. I should check that out.

19:54 garhdez: heh

19:55 devn: Then I subscribed to ACM, with mixed results.

19:55 It seemed difficult to find what I was looking for most of the time.

19:56 Lots of categories. Difficult to discern between them.

19:58 rkneufeld: Theory question: Are only ISeq objects a part of the sequence abstraction, or are is being Seqable the only necessary condition?

20:01 mysamdog: I have yet another question about clojurescript

20:02 My code is (ns foldup)

20:02 (def folded (OriDomi. (first (getElementsByClassName js/document 'response.1'))))

20:02 (.accordian folded 30)

20:03 And lein cljsbuild once compiles it with this WARNING: Use of undeclared Var foldup/OriDomi at line 3 src-cljs/foldup.cljs two times

20:03 The javascript console in my web browser says Uncaught TypeError: Property 'document' of object [object Object] is not a function

20:04 But when I do var folded = new OriDomi(document.getElementsByClassName('response.1')[0]); and folded.accordian(30); everything works fine

20:04 Why doesn't it work when I write it in clojurescript

20:04 ?

20:09 nDuff: mysamdog: do you have an externs.js?

20:10 mysamdog: ...basically, the Closure Compiler needs to know about external libraries you're using.

20:11 amalloy: mysamdog: the code you pasted wouldn't even compile ('foo' is not a string in clojure). i recommend pasting your actual code

20:11 additionally you're missing the . in front of getElementsByClassName, and it's impossible to know whether that's your actual problem or just a transcription error

20:13 mysamdog: amalloy: That is my actual code, I'll add the . and replace the 's with "s.

20:13 My externs file is:

20:13 var OriDomi = {};

20:13 OriDomi.accordian = function() {};

20:14 seangrove: mysamdog: Also, it's (js/OriDomi. ...)

20:14 OriDomi essentially exists in the 'js' namespace

20:14 amalloy: mysamdog: does oridomi really mispell accordion? a quick google search suggests that they spell it correctly (accordion)

20:15 seangrove: mysamdog: Also, ' is different from ", they're not interchangeable in cljs

20:15 mysamdog: aaaaaaand I misspelled accordion.

20:15 seangrove: (def folded (js/OriDomi. (first (.getElementsByClassName js/document "response.1"))))

20:16 amalloy: seangrove: going for the hat trick on this answer, huh?

20:16 seangrove: amalloy: Let me find one more 'also'....

20:16 I like the idea of giving that kind of example and seeing who tears it apart, and how quickly

20:17 Use it as a kind of nerd-sniping sport

20:17 amalloy: *chuckle*

20:18 * seangrove sighs, and gets back to perusing OpenID options...

20:18 amalloy: seangrove: using "perusing" wrong is another good way to distract nerds

20:19 (in this context i can't be sure you're using it wrong, but it's very hard to actually peruse multiple things at once)

20:19 seangrove: amalloy: Should have had an "about" in there

20:19 amalloy: seangrove: that...makes it worse?

20:19 the point is that peruse is an antonym of browse, but it's very often used as if it were a synonym

20:20 seangrove: Could be - meant it in the sense that I'm endlessly reading through documents on OpenID options

20:20 amalloy: well, fair enough

20:20 seangrove: heh, I'll keep that trick in mind though, makes it easy enough

20:20 mysamdog: Well, all the warnings I was getting during compilation are gone, but I'm still getting Uncaught TypeError: Property 'document' of object [object Object] is not a function

20:20 * seangrove is already momentarily paralyzed when differentiating between fewer and less

20:23 seangrove: mysamdog: It's pretty difficult to help you with this stuff, I can't be sure it's being copied faithfully

20:23 mysamdog: Well, my code is:

20:23 (ns foldup)

20:23 (def folded (js/OriDomi. (first (.getElementsByClassName js/document "response.1"))))

20:23 (.accordion folded 30)

20:23 Sorry for asking so many questions, clojurescript just confuses me somewhat

20:24 amalloy: that error reads very much like you have (js/document) in there somewhere

20:24 i mean, i believe you've copied your actual code this time, but that's what the js runtime is upset about

20:26 seangrove: mysamdog: Yeah, paste the javascript output on refheap.

20:28 mysamdog: https://www.refheap.com/21442

20:29 Great. Now it's giving me a different error: Uncaught Error: [object NodeList]is not ISeqable

20:31 seangrove: mysamdog: Don't use advanced optimizations while developing.

20:31 mysamdog: Should I use whitespace or simple?

20:32 seangrove: mysamdog: whitespace to start with. I can see some transformations here that already could make tracking down the bug in dev difficult

20:33 amalloy: mysamdog: that error message is promising, at least. it means you've managed to get an oridomi node list, and it's just not a clojure sequence

20:34 seangrove: amalloy: Have you considered merging map-keys and map-vals into clojure.core?

20:35 amalloy: Just do it when no one is looking. We'll all thank you.

20:35 amalloy: ha ha

20:35 seangrove: ninjudd is a bigger fan of that idea than i am. i don't use useful.map very much

20:35 mysamdog: Here's my new js: https://www.refheap.com/21443

20:35 seangrove: amalloy: Any reason why not?

20:36 mysamdog: I think it's cut off, paste the `tail -n 500 output.js` of it

20:37 amalloy: well, often when map-keys or map-vals would be tempting, it's because i have a map when i should just have a seq of pairs

20:37 seangrove: amalloy: That's an interesting idea.

20:38 amalloy: it's rather expensive to call map-keys and then rebuild a map, if i'm about to just tear it apart again to build a non-map; and it's not much more readable than just using into/for

20:38 mysamdog: https://www.refheap.com/21445

20:38 amalloy: i mean, i really shouldn't worry about that expense; it's super-premature optimization

20:39 but it bothers me and is easy to avoid

20:39 seangrove: mysamdog: That's looking good

20:39 And what's the error? Still the nodelist?

20:39 amalloy: whoa, are DOM NodeLists not seqable?

20:40 ddellacosta: amalloy: DOM NodeLists are a weird beast

20:40 seangrove: I think they might have to be wrapped in prim-seq

20:40 amalloy: like, you could replace (first x) with (aget x 0)

20:40 mysamdog: Now it's

20:40 OriDomi: First argument must be a DOM element OriDomi.js:407

20:40 Uncaught TypeError: Cannot read property 'anchor' of undefined

20:41 amalloy: mysamdog: that sounds like there's no element with class response.1 on the page

20:41 seangrove: mysamdog: 1.) is the page fully loaded when this code runs 2.) Do you have an element with a class of "response.1"?

20:41 mysamdog: Yes to 2, no to 1

20:44 seangrove: You'll need to wrap the .getElementsByClassName in prim-seq

20:44 (first (prim-seq (.getElementsByClassName js/document "tab")))

20:44 mysamdog: It works!

20:45 Thank you all so much

20:45 seangrove: No problem, sorry that was pretty rough.

20:48 devn: who is the main person behind caribou?

20:48 seangrove: Isn't it justin_smith?

20:48 devn: when someone referred me to him, he told me he'd let the team know

20:50 patchwork: devn: It is me

20:50 justin_smith and I work together

20:50 devn: patchwork: oh, cool

20:50 * devn waves

20:50 * patchwork waves back

20:50 devn: any chance that there will be easy drop-in storage options in the future?

20:50 besides mysql, postgres, and h2

20:50 patchwork: devn: There is already a protocol adapting over the data store

20:51 Those are just the ones we have at the moment

20:51 devn: oh, cool

20:51 patchwork: What were you looking for?

20:51 devn: a friend was asking me about the options

20:51 we were talking about riak and datomic mostly

20:52 patchwork: one thought I've had is: It would be nice to let the user specify an option to boot schmetterling when running leing ring server in the development profile

20:53 having it be a separate thing is fine and all, but it would be nice to just have it baked it, because schmetterling is really cool

20:53 patchwork: devn: Ah, are you using it?

20:53 devn: patchwork: schmetterling?

20:53 patchwork: Somehow word has gotten out, I haven't even officially released it yet

20:53 Yeah

20:53 devn: yeah, it's really rad

20:54 patchwork: Awesome! Glad to hear it

20:54 devn: it's like better errors, or binding.pry or whatever

20:54 super helpful stuff

20:54 patchwork: Yeah it is a simple concept, but somehow it hasn't happened for clojure yet

20:54 glad to hear people find it useful

20:54 So are you using caribou as well?

20:54 devn: /sort of/ :)

20:54 patchwork: Open to any feedback there

20:55 Ah right : )

20:55 devn: I've tried damn near every framework-ey thing since clojure was a few months old

20:55 patchwork: I will look into adding an option for booting schmetterling in dev mode, it needs to be running in a separate jvm for debugging purposes

20:55 devn: One thing I was really confused by was how the admin panel...well...works

20:55 patchwork: devn: How so?

20:56 devn: I was expecting to see generated code or something

20:56 when I added a new page, for instance

20:56 justin_smith: devn: in caribou?

20:56 patchwork: Aha right, yeah it is all in the db

20:56 devn: patchwork: yeah, i guess im just not used to seeing those things be stored off in the DB

20:56 justin_smith: it is all data driven, yeah

20:57 devn: in case I wanted to fiddle with it in my repl, or in a file

20:57 patchwork: devn: You can also specify routes as code (in routes.clj)

20:57 The admin is really just a convenience in that regard

20:57 justin_smith: by specifying the same data in edn form

20:57 devn: but in general I should say: it's an interesting interface

20:57 im just not used to the idea of it

20:58 oh, here is a smidge of feedback

20:58 patchwork: Right, it is kind of new. I haven't seen anything that has the models represented as data like that

20:58 devn: the default generated config: It would be nice to provide comments above each k/v pair to explain what that section does, etc.

20:58 similar to a generated rails project

20:59 justin_smith: devn that is a great idea

20:59 patchwork: Ah interesting… that could be helpful

20:59 devn: like :actions (atom {})

20:59 justin_smith: right, that is pretty opaque

21:00 devn: 'nother nitpick for you

21:01 add an obvious TOC link on the individual doc pages

21:01 the teepee looks like a home, but it takes you off site

21:01 patchwork: Hmm… yeah. Part of that is the config is sort of a "state of the world", so things like :action are actually for internally tracked things and probably don't need to be messed with by someone building an app

21:02 devn: patchwork: could that just be moved out into the config which gets merged?

21:02 the default config

21:02 justin_smith: patchwork: I was making some notes on the conflating config and state thing, when working on the avout integration

21:02 patchwork: Ah, if you click on the header "Documentation" it leads to the TOC

21:02 devn: you guys are working with avout on this?

21:02 patchwork: devn: Yeah that is probably what should happen

21:02 justin_smith: I think it would be better to have separate config/state

21:02 or one atom with config and state entries

21:03 devn: I made an adaptor, may not be ready for production

21:03 patchwork: devn: We just started looking into using avout to coordinate things on clusters like beanstalk etc

21:03 devn: how do you intend to use it?

21:03 gotcha

21:03 justin_smith: the size of the distributedatom objects may be too large

21:03 devn: i haven't seen many people using avout

21:03 patchwork: devn: Have you heard issues with it or something?

21:03 justin_smith: we would use it to coordinate state between instances (things like the set of models / pages defined)

21:03 devn: no, just saw the big reveal and then didn't hear much about it

21:04 patchwork: in some ways i think datomic stole some of the limelight

21:04 patchwork: I saw someone presenting at euroclojure that used it successfully, that is what turned me on to it

21:04 devn: How would datomic replace avout functionality?

21:04 justin_smith: I think if we switch from the zookeeper backend of avout to the mongodb backend, we can use the current design

21:04 and use zookeeper for lighter weight lower latency type stuff

21:04 devn: stop mongodb before mongodb stops you

21:05 ;)

21:05 patchwork: Yeah I'm not sure about mongo

21:05 justin_smith: ok, we could make another backend for neo4j

21:05 or some other more reliable nosql

21:05 jared314: etcd?

21:05 patchwork: neo4j looks awesome, though it is java 7 only

21:06 which I guess we should all be using (but some people don't have it)

21:06 justin_smith: I am fine with java 7 only, there is an open source java 7

21:06 devn: riak

21:06 patchwork: devn: We haven't used datomic because of the license so far

21:06 devn: patchwork: you know about pro starter now, right?

21:07 justin_smith: anyway, after using it, I like the distributedatom aproach a lot - duplicating the existing semantics and even protocols for remote objects

21:08 patchwork: devn: I saw something about it, but I haven't really looked into it

21:09 devn: justin_smith: patchwork: im not sure where i was going with avout vs datomic

21:09 patchwork: ^

21:09 justin_smith: just that datomic stole avout's thunder timing wise?

21:09 so fewer people tried it

21:09 devn: mostly -- i guess i wonder if you could model similar things using datomic

21:10 since joining across multiple dbs isn't a PITA

21:10 patchwork: devn: Maybe you just use a single datomic db rather than coordinating state through distributed refs?

21:10 justin_smith: probably

21:10 devn: patchwork: there's that too

21:10 patchwork: That is at least what I took you to mean, but I have no idea what you actually intended ; )

21:10 justin_smith: well hell we could already be syncing via db if not for the overhead

21:10 is datomic really that low overhead?

21:10 the idea with avout was something with faster update and read times than sql for root level stuff

21:11 the integration with clojure protocols was a bonus

21:11 devn: so you're saying something like: you have a central server which might add a page or something

21:11 patchwork: devn: So… datomic pro starter is still not redistributable

21:12 justin_smith: devn: not central

21:12 devn: and then you have clients who want to pick that info up

21:12 justin_smith: devn: at dev time any of the peers may add a page

21:12 it is not centralized

21:12 devn: i see, sort of like a distributed content management system

21:12 justin_smith: right

21:12 patchwork: So we could use it, but anyone who used it with caribou would still have to register themselves etc

21:13 justin_smith: but just for the core stuff like the model definitions that are needed for constructing queries, and for page definitions

21:13 devn: patchwork: gotcha yeah, makes sense

21:13 bitemyapp: justin_smith: yeah, should've used Datomic >:)

21:13 devn: aw don't make me that guy

21:13 justin_smith: patchwork: we could integrate it if we did the storage protocols dependency injection style

21:14 devn: i've just been on a datomic kick the past few weeks

21:14 it is damned powerful

21:14 justin_smith: hell, take all the dbs out of caribou-core, and let users insert them as injected dependencies that fulfil the protocols

21:14 bitemyapp: justin_smith: eggscellent idea.

21:14 patchwork: I have messed with it, I love it

21:14 bitemyapp: devn: needed to migrate anything yet?

21:14 devn: no

21:14 im just toying

21:14 bitemyapp: devn: pity. I want feedback on brambling.

21:15 seangrove: sritchie: You do any frontend/ui work at all?

21:15 sritchie: seangrove: these days I do

21:15 bitemyapp: seangrove: he has been lately, previously not so much.

21:15 beat me to the punch.

21:15 sritchie: :)

21:17 devn: bitemyapp: i will check it out

21:26 could some convention for maintaining migration order be better than having users maintain that order thingy?

21:27 for instance, generating a file with a timestamp on it?

21:27 im imagining working with a bigger team and people feeling some pain trying to figure out which migration goes where, and then making sure there weren't any left out, etc.

21:28 during a merge for instance

21:28 justin_smith: really then you want to duplicate the git featureset

21:28 devn: nono, rails does something like this -- generate a migration with a timestamp, assuming that the migration you're working with comes /next/

21:29 assume that unless it's simply not true, in which case you can manually rename that file or change the timestamp to go back in time

21:29 bbloom: devn: rails' convention is only marginally less busted than it's prior convention of an incrementing counter

21:29 devn: bbloom: no argument here.

21:30 bbloom: devn: actually, i preferred the incrementing counter approach b/c then you had an annoying merge confict

21:30 devn: heh, you like the pain?

21:30 bbloom: devn: an obviously annoying merge conflict is clearly superior to a subtle bug

21:30 devn: i can agree there

21:30 what i tend to do is check the schema timestamp against the most recent migration

21:31 if those match things are good

21:31 bbloom: devn: the issue is when dev A makes migraiton 5 and dev B makes migration 5 at the same time, then one of the two devs needs to revert their database to time 4 and then reply the new 5' and 6'

21:32 devn: use of a timestamp permits commutative migrations

21:32 however, it also permits non-commutative migrations that consist of non-interfering database transforms

21:32 ie bugs

21:33 devn: bbloom: so do you prefer adding them manually to a list?

21:33 bbloom: yes

21:34 what i've done in the past is to have a directory of migrations where the names have no impact on the order

21:34 basically just a bunch of add_whatever.sql

21:34 or frob_the_foo.sql

21:34 then the build system would pgdump the schema to a sql file and then shasum that file

21:35 then i had a tab-delimited file where each line was the migration to run in what order and two columns: 1st column = shasum and 2nd column = path/to/whatever.sql

21:36 to figure out how to run your migrations, you dump & hash the schema, drop lines from the data file up to and including that sha1, then run the remaining scripts

21:36 when you're done, your sha1 should match, if it doesn't, then something horrible happened

21:36 seangrov`: o_O

21:36 I'm sure there's some wisdom in what you're proposing bbloom, but it sounds like madness

21:36 bbloom: it's like ~20 lines of bash. works great

21:37 instead of that stupid schema.rb file that doesn't cover all the subtlties of your indexes

21:39 akhudek: bbloom: sounds similar to flyway, but flyway doesn't checksum your schema

21:40 devn: bbloom: to each their own. i don't think that sounds all that crazy, but it is definitely not what most people who just want to dink around and make a blog need, y'know?

21:40 bbloom: for sure

21:41 but for that case, just run a script in your repl & be sure to have a backup :-P

21:41 devn: on bigger projects i've seen similar techniques employed, and i ain't mad at that

21:41 technomancy: bbloom: google cache is a pretty good backup these days

21:42 devn: but to the extent you're not on a ridiculously bad team, people stay in sync with master, some simple tests are written, etc.

21:42 technomancy: (assuming that was an antirez joke)

21:42 bbloom: technomancy: not familiar w/ the context

21:42 devn: `drop table schema_migrations` was my favorite migration ever

21:42 technomancy: oh I thought you were talking about http://antirez.com/news/65

21:43 bbloom: lol

21:44 devn: haha

21:44 seangrov`: "No, just kidding." Phew.

21:45 devn: bitemyapp: was i using brambling without knowing it?

21:45 I made a migration.

21:53 seangrov`: UI sync done, OpenID integration ~60% of the way through. Time to drinks.

21:57 gfredericks: does anybody have any good introductions/references for jvm bytecode?

21:58 (i.e., for becoming familiar with it, not solving any particular problem)

21:58 justin_smith: gfredericks: one of those questions I wish I had an answer to. I guess I want to know what that book is too.

22:00 hiredman: gfredericks: what do you want to know about it?

22:00 the class file format?

22:00 https://github.com/hiredman/bc/blob/master/src/bc/core.clj#L1-L3 are 3 links about jvm bytecode

22:01 gfredericks: hiredman: formats are good; semantics of the language is more what I was imagining I suppose

22:01 hiredman: I'll check these out, thanks

22:02 hiredman: there is always http://docs.oracle.com/javase/specs/jvms/se7/html/

22:03 gfredericks: I don't think that will be unhelpful

22:23 coventry: I haven't done much of anything with java bytecode, but I noticed there are a lot of informative looking examples in the ASM guide. http://download.forge.objectweb.org/asm/asm4-guide.pdf

22:29 gfredericks: coventry: this is indeed informative-looking

22:31 bitemyapp: devn: uhhh, I don't think so?

22:31 devn: are you sure you made a migration?

22:32 jared314: coventry: what version of asm does clojure use?

22:32 bitemyapp: devn: you have to reduce the transaction log, retain identities, etc etc

22:38 coventry: jared314: I saw a bug in jira talking about updating that. I think it is a very early version.

22:38 (at the moment.)

22:48 dnolen: added CLJS support for *print-level* http://github.com/clojure/clojurescript/commit/13d49ec0180dc5199b580a3c9e46c0eba171cfe4

22:50 bitemyapp: devn: are you sure you don't mean that you were simply transacting entities into the schema?

22:52 jarodzz: ,(= 1 1)

22:52 clojurebot: true

22:53 wxqy: ,(+ 1 1)

22:53 clojurebot: 2

22:53 wxqy: ,((fn [x] (x x)) (fn [x] (x x)))

22:53 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

23:01 justin_smith: ,((fn boom [] (boom)))

23:01 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

23:02 coventry: ,(recur) :-)

23:02 clojurebot: Execution Timed Out

23:04 logic_prog: I need to file a bug vs clojurescript.

23:04 For the good of humanity, swannodette needs to blog more. https://github.com/swannodette/swannodette.github.com/tree/master/code/blog is highly informative, but needs more entries.

23:09 andyf: Introducing syntax errors into your ~/.lein/profiles.clj can really mess with your mind.

23:19 ddellacosta: logic_prog: he's doing pretty well, in my opinion--are your talking about this? http://swannodette.github.io

23:19 logic_prog: yeah

23:19 I only count 12 entries

23:19 there's more wisdom in one of those blog posts then the front page of news.yc

23:20 yet news.yc has 30 new entries daily

23:33 dnolen: just pushed React.js 0.5.1 to clojars

23:34 this is what your project.clj needs to look like - http://gist.github.com/swannodette/7763911

23:35 noprompt: dnolen: does it work well with cljs?

23:35 dnolen: cause, and i'll be honest, working with angular from cljs is the worst shit ever.

23:36 dnolen: noprompt: it's not a small lib, but it seems worth given the power therein - I can't say till I I've had a lot more time to play with it

23:36 noprompt: of the JS libs I've seen this honestly the first time I've ever cared to integrate anything

23:36 noprompt: the DOM diffing stuff is to slick, and they've already dumped so much time into - seems pointless to recreate

23:37 noprompt: React.js + including a persistent hash map (which pulls in a lot of CLJS), 47k gzipped, so not bad

23:37 smaller then Ember.js ;)

23:37 khaled: hi all

23:38 noprompt: dnolen: my gut tells me wrapping frameworks is a bad idea but since react is only interested in a single area, the view, it might not be too bad.

23:39 dnolen: noprompt: will have to play around w/ it to figure out what the pain points are, but there's good stuff in there - perhaps we can influence the direction of project if using it from CLJS seems worthwhile

23:40 noprompt: dnolen: since you've done a little leg work with the project.clj, i think i might join you on that adventure. ;)

23:40 halorgium: hey all

23:41 i'm wondering if anyone has tips for attaching clojure source into intellij idea

23:41 noprompt: dnolen: it kinda makes me wonder if i should continue hacking on the channel based two-way data-binding library i've been working on. :/

23:42 dnolen: noprompt: two data binding seems like a rats nest to me - there's something nice and simple about react, probably some cool design/approach opportunities to explore here

23:44 noprompt: dnolen: you mean wrt web applications? afaik two-way data bondage is what's commonly used in desktop ui's, no?

23:44 dnolen: noprompt: yeah it's a rat's nest there too

23:44 noprompt: dnolen: i'm probably to youge of a developer but why?

23:45 dnolen: noprompt: two way data binding and trying to make it work for all cases inevitably adds a lot of complexity

23:45 noprompt: fundamental react model is very functional, every state has a corresponding DOM representation

23:45 noprompt: new state, new UI

23:45 that's dead simple

23:45 khaled: halorgium: add the folder where your clj as a sources root folder, and by the way there is a clojure plugin in intellij

23:46 halorgium: khaled: yer, clo-jet?

23:46 dnolen: noprompt: no Cocoa/Ember.js model array controller messes

23:46 halorgium: khaled: do you know if it can use it from a jar? or should i extract it myself?

23:46 noprompt: dnolen: yeah, i never got into that. angularjs was about the only form of "controller" i could actually tolerate.

23:47 dnolen: noprompt: I know this may seem like implementation details, but this stuff leaks bad IME

23:47 noprompt: I'd rather start from a simpler model

23:47 noprompt: which isn't to say React.js is going to be all roses, but it's an approach I haven't seriously tried before so I'm witholding judgement for now

23:48 khaled: halorgium: i dont have it in memory about the name, and the ij plugin is in idea plugin repository, no need to special repository, or downloaded

23:48 halorgium: khaled: sorry, i meant if i can use the .clj files from inside a jar

23:48 i'm building against storm (from java)

23:49 noprompt: dnolen: it's actually kind of good timing for me to have a look at this too. i'm working on a rewrite of a heavy client-side application that might benefite from this sort of thing.

23:49 dnolen: if css could somehow get plugged into the picture that'd be great.

23:50 khaled: halorgium: i'm pretty newbie in clojure at the begining of "clojure in action", never heard about storm

23:50 halorgium: khaled: ah, ok ;)

23:50 thanks! :D

23:51 noprompt: dnolen: i'll take a stab at it here in a bit.

23:58 dnolen: updated React gist that actually might work for someone else - https://gist.github.com/swannodette/7763911

Logging service provided by n01se.net