#clojure logs

2013-12-02

00:06mysamdogHow do I create an object in clojurescript? I can't figure it out.
00:06mysamdogLike How would I do var folded = new OriDomi(document.getElementsByClassName('paper')[0]); ?
00:06mysamdogand then folded.accordian(30);
00:09justin_smith(def folded (OriDomi. (nth (js/document getElementsByClassName 'paper') 0))) (.accordian folded 30) iirc
00:09justin_smithexcept for static class data (which used .- ) everything else works the same way it does in clojure for interop
00:10justin_smithhttp://clojure.org/java_interop
00:11seangroveHrm, didn't I answer that same question yesterday?
00:11justin_smithI wouldn't be surprised
00:12seangroveLooks like it, yeah: http://clojure-log.n01se.net/date/2013-12-01.html
00:12mysamdogseangrove: yeah, but I couldn't figure out how to call it's methods
00:12seangrovemysamdog: Fair enough, no worries
00:12mysamdogAnd actually, what justin gave me is pretty much what I had, I just forgot to save the file
00:18seangroveDamnit. 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}
00:18seangroveThe only way I've found to fix it is to restart everything
00:18justin_smithwoah, that sucks
00:20seangroveIt's taken a long time to track it down to that
00:20seangroveI was just having my cljs repl complain about the clojure.lang.ExceptionInfo and couldn't quite pin down what was causing it, etc.
00:21seangroveFeel better now knowing how to repro it, but it's still a frustrating experience. Will have to open a ticket at some point.
00:21seangroveI wonder if it's for any macro though, or just dommy's
00:23andyfIs 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"?
00:24seangroveI believe it's just convention
00:24justin_smithconvention
00:25abaranoskyandyf: the latter
00:25andyf,((fn [a a a] [a]) 1 2 3)
00:25clojurebot[3]
00:25andyfHow is that for weird?
00:25abaranoskyneat
00:25andyfI guess that is why it can just be convention, but you can use _ multiple times for multiple don't care args
00:26xpei should expect `lein with-profile base pom` to not include dev dependencies, right? or am I expecting the wrong thing?
00:31amalloyxpe: might be `base,pom`?
00:31amalloyoh, sorry, pom is the task, not another profile
00:32xpeamalloy: i'm seeing dev stuff show up in the generated pom :(
00:32xpeI'm running lein 2.3.3, about to try 2.3.4 to see if that helps
00:32amalloyhave you tried `lein with-profile -dev pom`, to be explicit?
00:34xpeamalloy: I think I misread the pom
00:35xpeit is getting some dev dependencies, but as an accident. they are probably also test dependencies
00:37xpehmm, that's not right either :(
00:41xpeamalloy: I realize that I don't really understand something key: when I specify :dependencies at the top-level ... what is that called
00:41xpefor a while, today, I thought that was :base now I doubt it
00:41seangroveInterestingly, 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
00:43xpefrom an August 8, 2013 leiningen commit: "Note that :dev, :test, and :base still belong in the pom, but with
00:43xpedependencies/paths scoped as <test>."
00:44xpeI saw <scope>test</scope> in the POM, which made me think they were coming from a test profile
00:44xpemaybe I can tell `mvn ... -P -test` now
00:46nopromptseangrove: just discovered (js/document.createElement "1") will lock up the cljs repl.
00:46wei__anyone know a good way to insert ENUM values in Postgres using java.jdbc?
00:46seangrovenoprompt: What about (.createElement js/document "1") ?
00:47seangroveVery interesting
00:47seancorfieldwei__: it doesn't "just work"? it works fine with mysql (and other DBs as far as i know)
00:47nopromptseangrove: identical behavior. it should throw a InvalidCharacterError.
00:48wei__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..
00:49wei__http://stackoverflow.com/questions/18631840/how-to-cast-string-value-to-enum
00:49nopromptseangrove: if i visit the url where the repl is running and then hit C-c at the repl it will kill it though.
00:49seancorfieldwith 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...
00:51nopromptseangrove: there was another similar problem i encountered with the dom error's but i can't remember what it was.
00:51wei__perhaps there's an explicit cast via "CREATE CAST" that will add that behavior, exploring that angle now
00:52nopromptjust for the record i'm coining the term "data-bondage."
00:52seancorfieldwei__: read this http://stackoverflow.com/questions/10571821/inserting-into-custom-sql-types-with-prepared-statements-in-java
00:53seangrovenoprompt: File a bug!
00:53seancorfieldthe 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 :(
00:53seangroveDefinitely one of the big priorities for me, I want the cljs repl to be rock-solid
00:53nopromptseancorfield: i recently joined a shop that uses it and i had so many wacky problems with it.
00:54nopromptseangrove: will do.
00:54seangroveseancorfield: Really? Wow, that's not my experience whatsoever.
00:54seancorfieldnoprompt: yeah, it seems to be the worst of mysql combined with the worst of oracle :)
00:54nopromptseangrove: i'm not sure where to report the issue.
00:55seangrovenoprompt: http://dev.clojure.org/jira/secure/CreateIssue.jspa?pid=10040&amp;issuetype=1
00:55seangroveMuch appreciated, I know it's not a super-smooth process
00:55wei__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 :(
00:55akhudekpostgres works wonderfully for us
00:56seancorfieldwei__: at least you can use ?::enum_type and still pass in parameters
00:56seancorfieldakhudek: yes, i hear that from most postgres users :)
00:57nopromptseangrove: are you sure this is a clojurescript bug though?
00:57wei__it's also decently stable and performant
00:57wei__how do I create a prepared statement with java.jdbc?
00:58seangrovenoprompt: I've never used the brepl before, would be good to confirm the behavior there
00:58ddellacostawei__: by default java.jdbc uses prepared statements
00:58ddellacostaclojure.java.jdbc I mean
00:59ddellacostawei__: also, regarding your previous question, it may be as simple as creating a PostgreSQL custom object
00:59seancorfieldthe prepare-statement function will create a PreparedStatement object, but as ddellacosta says, the library creates prepared statements for every operation
01:01seancorfieldso (execute! db ["INSERT INTO table ( col ) VALUES ( ?::enum_type )" some-val]) would do what you need
01:01wei__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)
01:01seancorfieldyou can't use insert! in this case
01:01wei__seancorfield: oh execute will work
01:02wei__might end up extending insert! to support custom types. thanks for guys' help!
01:02wei__(inc seancorfield)
01:02lazybot⇒ 7
01:03jph-so in repl, when i execute a method, how do i get it to not print "nil"
01:04xpegggrrraahh. MAVEN!
01:04jph-i remember reading how in one of many bookmarks on clojure but i have like 30 bookmarks from last two days
01:04seancorfieldSounds 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...
01:04xpeamalloy justin_smith here are the magic invocations to tell Maven to copy the deps I want (I hope),,,
01:04xpemvn dependency:copy-dependencies -DincludeScope=runtime -DexcludeScope=provided -DoutputDirectory=target/war/WEB-INF/lib
01:05ddellacostawhy does lein cljsbuild iterate through my profiles on compilation failure?
01:05ddellacostais there a way I can prevent it from doing that?
01:05seancorfieldjph-: are you calling print explicitly?
01:06seancorfield,42
01:06clojurebot42
01:06seancorfield,(println 42)
01:06clojurebot42\n
01:06jph-seanaway: (printf
01:06jph-yep
01:06seancorfieldthe result of print is nil
01:06jph-oh
01:06jph-gotcha
01:06seancorfieldyou don't need to print the result - the repl will do that for you
01:06jph-so use format instead for repl use
01:06seancorfieldyup
01:06jph-thank you
01:07xpeand, 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."
01:08xpecomplaining above is probably preaching to the choir
01:08xpeI mean, is anyone going to step and say, yay! maven! probably not
01:08wei__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
01:11seangrovewei__: I believe gfredericks did something with it, but haven't seen anything idiomatic or easy
01:14seancorfieldwei__: there's a protocol for reading columns, yes
01:14seancorfieldIResultSetReadColumn
01:15seancorfieldyou can extend it to whatever custom potsgres type you need
01:17seangrovewei__: 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
01:20seancorfieldsuggestions for a good name for the protocol?
01:21seancorfieldISQLWriteColumn? ISQLValue?
01:22seangroveseancorfield: I like ISQLValue as a more general term, but I can see the value in mirroring IResultSetReadColumn
01:22seancorfieldheh, i vote for both? :)
01:22seangroveHeh, ISQLValue, I'd say!
01:22nopromptseangrove: brepl produces the error as expected.
01:22wei__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
01:22seangrovenoprompt: Sounds like a perfect repro case for JIRA ;)
01:23seangroveThank you so much for taking the time to check it out
01:23nopromptseangrove: sorry, i mean it reports the error message from the browser as expected, ie. it doesn't lock up the repl.
01:23nopromptseangrove: perhaps i should repor this on the austin repo then?
01:24seangroveAh, good to know, sounds like it belongs on the austin repo
01:26seancorfieldseangrove: wei__: feel free to add comments to http://dev.clojure.org/jira/browse/JDBC-77
01:27nopromptseangrove: hmm. it actually looks like this is only a problem when the browser is not connected.
01:27nopromptwell. i certainly feel silly now.
01:28seangrovenoprompt: That's no big deal, at least we've made sure there isn't a lurking unpleasant experience in the cljs repl
01:29nopromptseangrove: i guess while i'm at it i should reinvestigate the cljs-node-repl issue i open a while back...
01:40seancorfieldwei__: there's a possible extension point you could use without the ISQLValue protocol...
01:41wei__seancorfield: where?
01:41seancorfieldin the db-spec, you can provide a :set-parameters key - which should be a function that will replace the built-in set-parameters fn
01:42seancorfieldit's passed stmt and params and normally just calls .setObject on stmt with the index and value of each param
01:43seancorfieldit'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
01:43wei__oh, that actually would be a faster way to get something working right away
01:44seancorfieldadding 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
01:45wei__i would "inc" you again but isn't there some sort of self-imposed ratelimit :)
02:00seancorfieldwei__: 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.
02:00wei__sweet, thanks sean
02:01seancorfieldseangrove: if you want to take that for a test drive too, it would be appreciated
02:19noprompthas anyone read the clojurescript responses on the state of clojure survey?
02:20nopromptit seems like the overwhelming majority want self-hosting, macros, and types.
02:20nopromptthis made me laugh: "Useless without lein-cljsbuild, which no one understands."
02:21noprompt"no one" aka that guy.
02:29coderz/who
03:10sveri1hi there, did anyone try to build a jira plugin using clojure?
04:16ddellacostais it a bad idea to dispatch on type in a CLJS multi-method?
04:18tatsushikoAnyone using instaparse? I think I'm running into troubles because of auto-whitespace but I would like to better understand why
04:26ddellacostatatsushiko: I've used it recently on a project, although I'm not an expert EBNF or anything
04:26ddellacosta*in EBNF
04:26pyrtsaWhen 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?
04:27ddellacostabut I'd be happy to take a look to see if I can help, if you put up a gist/refheap or something
04:28amalloypyrtsa: field, surely
04:28pyrtsaamalloy: Cool, thought so.
04:29pyrtsaI'm playing with https://github.com/stuartsierra/component, and not quite sure if I like the design or not.
04:30pyrtsaIt's a bit weird to introduce the OOP concepts of construction (start) and destruction (stop) into defrecord.
04:30tatsushikoddellacosta: 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
04:30buharinhello :)
04:31nopromptddellacosta: i typically tend to use protocol/extend-protocol if i'm dispatching on type but it depends on your use case.
04:32buharinhey :)
04:32noprompts/protocol\///
04:33ddellacostanoprompt: 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.
04:34nopromptddellacosta: if you only have two cases multimethods/extend-protocol might be overkill.
04:35ddellacostanoprompt: yah, true. Just seemed a bit cleaner than a set of cases or something, but maybe that would be more appropriate.
04:35ddellacostaor cond/condp
04:36arcatanpyrtsa: a component is pretty stateful stateful thing, after all, so OOP-style representation for it seems pretty suitable for me
04:36amalloypyrtsa: 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
04:38pyrtsaarcatan: 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.
04:40pyrtsaamalloy: The workflow makes a lot of sense. I use it myself as well.
04:40nopromptddellacosta: 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.
04:41ddellacosta ah you lucky people and your greenfield projects
04:41nopromptddellacosta: free time is a greenfield project ;)
04:41ddellacostanoprompt: yeah, that makes sense,d efinitely
04:41ddellacosta*definitely
04:42amalloywell, 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
04:42ddellacostanoprompt: 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
04:43pyrtsaamalloy: I think that just confuses the configuration with the stateful object itself.
04:43pyrtsaConfiguration is just construction parameters, IMO.
04:43nopromptddellacosta: 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.
04:44ddellacostahaha
04:44arcatanpyrtsa: yeah, now that i think about, i'm not sure why you'd separate starting from construction. (and restartable objects are icky)
04:44pyrtsaarcatan: 'xactly!
04:45noprompthas anyone written up any tips for testing code using core.async?
04:45glosoliI 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)
04:47nopromptglosoli: i forget how people pull that off. if you find out let me know. :)
04:48ddellacostaglosoli: you can start nrepl server from each and connect to each one in a different buffer in cider, I believe
04:48ddellacostaglosoli: https://github.com/clojure/tools.nrepl#embedding-nrepl-starting-a-server
04:49glosoliddellacosta: how it will decide where to eval hmm ?
04:51ddellacostaglosoli: each buffer is mapped to a different project via the port...?
04:51ddellacostaglosoli: unless I'm misunderstanding what you're asking
04:52ddellacostaglosoli: also, just talking about cider here, to be clear
04:56glosolidean|away: hmm yeah but I can have many buffers open
04:56glosolihow it will know which is mapped to which nrepl ?
04:59ddellacostaglosoli: 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.
05:02glosolidean|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
05:03glosoliIf 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 ?
05:03ddellacostaglosoli: name is ddellacosta, btw
05:04ddellacostaglosoli: if you want to evaluate code for both projects in the same buffer, I think that is not possible
05:04glosoliah sorry, that damn tab :)
05:04glosoliddellacosta: not in the same
05:04ddellacostaglosoli: 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
05:05ddellacostaglosoli: 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.
05:05ucbhey hey
05:06glosoliddellacosta: aa thanks
05:06ddellacostaglosoli: and there is a key-command in Cider mode so you can figure out which one you are in--C-c M-d
05:08glosolithanks ! :)
05:08ddellacostaglosoli: any time! Hope it works for you. :-)
05:10sm0kelein repl seems to not respect the .incputrc file, anyone elese facing this?
05:10sm0kehttps://www.refheap.com/21407 thats my .inputrc
05:15glosoliddellacosta: 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 ?
05:15ddellacostaglosoli: ahaha, now I understand what you were asking about--I was assuming you were just eval'ing from the cider buffer itself.
05:16glosoliah sorry for misleading you then
05:16ddellacostaglosoli: no, no problem, I had a feeling I was missing something
05:17glosoliddellacosta: so what I want is not possible, is it ?
05:17glosolifor cider to auto detect which file belongs to which nrepl lol
05:17ddellacostaglosoli: 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
05:17ddellacostaglosoli: 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
05:17ddellacostabut I don't know
05:18ddellacostaglosoli: 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
05:18ddellacostaglosoli: I'm looking here: https://github.com/clojure-emacs/cider#cider-mode
05:19glosoliah yes setting namespace could work still I need to select buffer, well it's good enough anyway
05:19glosolithanks
05:19ddellacostaglosoli: yeah, I suspect you can do what you want with a bit of monkeying about
05:25glosoliddellacosta: 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
05:25glosolinice
05:26ddellacostaglosoli: cool--so you can do it with jack-in as well? That's pretty slick if so
05:27glosoliddellacosta: yeah works just fine
05:28glosoliusing ido buffer search and entering symbols lets me switch instantly
05:30honzais it just me or does the -> macro not like partial functions?
05:33amalloyman, we need a clojurebot factoid about how -> is a macro, and as such operates on source-code forms, not functions
05:33TEttinger,(-> {:a 1} (partial assoc :b 2)) ; ##(-> {:a 1} (assoc :b 2))
05:33lazybot⇒ {:b 2, :a 1}
05:33clojurebot#<core$partial$fn__4194 clojure.core$partial$fn__4194@6b878d>
05:34amalloyclojurebot: -> is http://stackoverflow.com/questions/15443320/clojure-partial-in-macro
05:34clojurebotRoger.
05:34amalloy~->
05:34clojurebot-> is forget ->
05:35amalloyokay, i can't teach clojurebot about ->
05:36TEttinger~define -> http://stackoverflow.com/questions/15443320/clojure-partial-in-macro
05:36clojurebotGabh mo leithscéal?
05:41Fendergood morning and a happy monday
05:42Fenderhere's a question
05:42Fender(take 8 (map vector market-dirs dirs))
05:42Fender([-1 1] [-1 1] [1 -1] [-1 -1] [1 -1] [-1 1] [1 1] [-1 1])
05:42Fender(map #(case (map int %)
05:42Fender [1 1] :tp
05:42Fender [1 -1] :fp
05:42Fender [-1 1] :tn
05:42Fender [-1 -1] :fn
05:42Fender :ignored
05:42Fender ) (take 8 (map vector market-dirs dirs)))
05:42Fenderreturns (:ignored :ignored :ignored :ignored :ignored :ignored :tp :ignored)
05:42ucbFender: (map ...) doesn't result in a vector
05:43ucbFender: also, you may want to paste the code somewhere for easier reading :)
05:43Fenderok I'll gist it next time :)
05:43Fenderwell mapv doesnt help either
05:43ucbyou're int %
05:43ucbso, you'd be (int [-1 -1])?
05:44Fenderusing (mapv int %) should ensure that we get a vector if ints
05:44Fenderit runs
05:45Fenderbut it only detects true positives (:tp)
05:45Fenderobviously [-1 1] as arg (%) doesnt match [-1 1] in the case condition
05:46ucbhmm
05:46ucbmind gisting the code?
05:47Fenderjust a sec
05:47honzaamalloy: i guess i should have just read the source, huh? :)
05:49TEttinger,(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]])
05:49clojurebot[:tn :tn :fp :fn :fp ...]
05:50TEttinger##(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]])
05:50lazybot⇒ [:tn :tn :fp :fn :fp :tn :tp :tn]
05:53Fenderhttps://gist.github.com/anonymous/7747866#file-gistfile1-clj
05:53Fenderyeah, thought about using condp as well
05:53Fenderbut I want to understand why it doesnt work
05:54TEttinger,(doc case)
05:54clojurebot"([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...
05:54TEttingerso your expression is always true
05:54TEttingererr no
05:55TEttinger(map int %) will return a lazyseq, but you're testing against vectors, which I am not sure about
05:56clgv,(case (mapv int [1 1]) [1 1] :ha! [1 -1] :ho! :no)
05:56clojurebot:ha!
05:57clgv`case` uses hashing internally. you'll see when you decompile the class file
05:58Fender(case (mapv int [-1 -1])
05:58Fender [-1 -1] :yeeha
05:58Fender :oh-noes)
05:58Fender:oh-noes
05:59Fender ,(case (mapv int [1 -1]) [1 1] :ha! [1 -1] :ho! :no)
05:59clojurebot:no
06:00Fenderno ho!
06:00Fendertime for a clj bug report or are we missing something?
06:01Fenderor did the doc change in 1.5? (I use clojuredocs which IMO still has 1.3)
06:02Fender,(case [1 -1] [1 1] :ha! [1 -1] :ho! :no)
06:02clojurebot:ho!
06:02Fenderhmmm
06:02Fenderok
06:03Fender,(map type [-1 1])
06:03clojurebot(java.lang.Long java.lang.Long)
06:03Fender,(map type (mapv int [-1 1]))
06:03clojurebot(java.lang.Integer java.lang.Integer)
06:03amalloyFender: what version of clojure are you trying to run this on?
06:03Fender1.5.1
06:03Fenderbut I think its the type that causes the probs
06:03TEttingeryeah, agreed
06:03amalloysince 1.4, int and long hash the same
06:03amalloywhat's a simple case expression that exhibits behavior you don't expect
06:04TEttinger,(case (int 1) 1 :yes :no)
06:04clojurebot:yes
06:04TEttinger,(case (int -1) -1 :yes :no)
06:04clojurebot:yes
06:04Fender,(case [(int 1)] [1] :yes :no)
06:04clojurebot:yes
06:05Fender,(case [(int -1)] [-1] :yes :no)
06:05clojurebot:no
06:05TEttingernow that's interesting
06:05Fenderok only positive ints and longs hash to the same
06:05Fender(value)
06:05clojurebotGabh mo leithscéal?
06:05amalloy&(map hash [(int -1) -1])
06:05lazybot⇒ (0 0)
06:05amalloy&(apply = [(int -1) -1])
06:05lazybot⇒ true
06:05amalloylooks like a bug in case to me
06:06TEttinger,(map hash [(int -1) -1])
06:06clojurebot(0 0)
06:06TEttinger,(map hash [[(int -1)] [-1]])
06:06clojurebot(31 31)
06:06Fenderwtf
06:06amalloyprobably the macro that generates the case-branching decision tree wasn't updated when hashing of ints and longs was fixed
06:06TEttingerto the source code!
06:06Fenderhmm, I'll use condp then for a while
06:07amalloyTEttinger: good luck, man. case is not easy to read
06:07clgvamalloy: it is using Util/hash in the generated class file
06:07amalloyand not Util/hasheq?
06:07clgvno
06:07amalloythat's the problem then, right?
06:08clgvI am not sure. was that the change with regard to numbers?
06:09Fendersorry guys, my lunch is being served
06:10Fenderthanks for the help
06:10FenderI'll come back later
06:10Fenderafk
06:11amalloyclgv: i mean, ##(map hash [-1 (int -1)]) vs ##(map #(.hashCode %) [-1 (int -1)])
06:11lazybot(map hash [-1 (int -1)]) ⇒ (0 0)
06:11lazybot(map (fn* [p1__39689#] (.hashCode p1... ⇒ (0 -1)
06:12amalloyUtil/hash calls the second of those
06:12TEttingerhooray! bug discovered!
06:12clgvseems like it: ##(println (clojure.lang.Util/hash [(int -1) (int -1)]) (clojure.lang.Util/hasheq [(int -1) (int -1)]))
06:12lazybot⇒ 929 961 nil
06:12amalloyi don't quite know why a call to Util/hash is generated, but presumably someone familiar with case* can find that
06:13clgv961 is the correct hash used in the class file
06:13clgvsince ##(hash [-1 -1])
06:13lazybot⇒ 961
06:14philandstuffinteresting bug
06:35TEttinger$title http://xn--njb.com
06:35lazybot"ڑ.com"
06:35TEttingerdoes that line appear oddly for anyone? lazybot's reply
06:36arcatanshould slamhound.el work with nrepl.el 0.2.0?
06:39amalloyTEttinger: it's converted the url using whatever weird mapping there is for non-ascii characters in urls
06:39TEttingeryes. punicode
06:39TEttingerbut on some clients the datestamp is reversed due to RTL stuff
06:40TEttingerI'm wondering if lazybot should by default escape RTL chars?
06:40TEttingerif it doesn't show up on many clients, who cares
06:41TEttinger*if the rendering problem from RTL doesn't show up
06:41TEttingerit displays fine in Floe on windows
06:41TEttingerbut Floe also can display multiline messages
06:46Fenderthx guys for helping
06:46FenderI suppose you already submitted the bug somewhere or directly changed the code?!
06:58clgvFender: no one can change the code directly ;)
06:59clgvFender: seems like Andy Fingerhut already discovered that bug last week http://dev.clojure.org/jira/browse/CLJ-1301
07:00clgvFender: you can create a jira account and vote that bu up to increase its chances to get fixed in 1.6
07:01clgv"vote that bug up"
07:01FenderI don't know who the repo maintainer is but he should be able to change the code, no?
07:02clgvFender: there is a development process setup that involves jira for bug reports and patches.
07:04FenderI know, just thought that maybe Rich is following and thought "wow this is so obvious, I'll change it rightaway"
07:05Fenderthat's what I'd call "fast moving" ;)
07:05Fenderbut I am aware that this is not easy if a community participates
07:05clgvnope, that is never going to happen in the current process
07:06clgvit might be that a ticket for a bug quickly gets a patch and is screened and included fast. but not without a ticket ;)
07:07Fenderok
07:07Fenderwell, thx again
07:07Fenderand see you
07:27glosolihow does one set content expire dates in Ring ?
07:40logic_proghttps://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
07:42sm0kewhoa! clojure is notorius with stak traces for sure
07:44logic_progclojure is fine
07:44logic_progit's clojure.core.async that's scaring me
07:44sm0kewell if its core.async why dont i see so!
07:45sm0keare you using macros?
07:46sm0kelooks like there is a overflow due to recursion
07:47sm0kerecursion inside a multivariate function maybe?
07:47logic_progI am using macros.
07:47logic_progfuck. debugging a distributed system + macros + core.async
07:47logic_progthis is going to be "fun"
07:50logic_progoh fuck
07:50logic_progI think I found it
07:50logic_progI have atoms
07:50logic_progthat are circular (one atoms refers to another)
07:50logic_progthen I println one of them
07:50logic_progand bam .... println recursion
07:51clgvlogic_prog: build up from small functions that are testable each
07:51sm0kehmm atom refering to each other!
07:51sm0kethat makes sense?
07:51logic_progyeah, but this bug only appears during a running system
07:53sm0keone thing which bothers me is clojure does not catches wrong arity during function call while compiling
07:53sm0keif clojure had implicit support for currying it would have made sense
07:53logic_progover the past few years
07:54logic_prognothing in clojure bothers me anymore, I end up realiainzing that clojure is right and I'm wrong
07:54logic_progwoot, bug fixed!
07:55winklol
07:56winksm0ke: you mean like.. if there's no [& args]?
07:56clgvsm0ke: that's due to rebindable vars. the function at the var might be exchanged at runtime compared to compile time
07:56si14how do you deploy your clojure stuff? chef and puppet look so overbloated that it's painful even to think about using them
07:56sm0kewink: yes if the func has signature like (defn foo [a b c])
07:57clgvsm0ke: although there could be contracts on the arity for vars. but maybe that has other consequences that are not easy to handle
07:57sm0kedoes (foo a) makes sense to you?
07:57si14I'm currently using Ansible, but thinking about Pallet. Anyone using it?
07:57winksi14: don't use puppet for deployment. I've been there and gone back to anything that works, i.e. capistrano, fabric, .deb, plain ssh
07:57clgvsi14: yes, I use it for distribution of jars and starting them up
07:58sm0keclgv: i do not understand your point
07:58si14clgv: how do you like it? can you compare it to another systems?
07:58glosolihow does one set content expire dates in Ring ?
07:58clgvsi14: you can't check (foo a) on arity since you do not know what some.ns/foo resolves to at runtime
07:58sm0kecan you make a call to function which take 3 arguments with just one argument?
07:58sm0kewithout using partial of coure
07:59clgvsi14: I cant compare it. I needed some trial and error to find out how I get my tasks done
07:59si14wink: and what do you use now?
07:59clgvsm0ke: no you can't, but at compile time you have (defn foo [a b c] ...) and then at runtime someone rebinds (defn foo [a] ...)
08:00winksi14: as I said. after the failed tries with puppet.. current company: capistrano and .deb
08:00si14oh, 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?
08:00si14wink: I see, thank you.
08:00winkwhat somehow works is: make puppet pull a defined version from some form of repo
08:00sm0keclgv: does that makes sense for a code i have written in a file?
08:00clgvsi14: pallet does administration stuff via sudo
08:00winkthat might be. ensure => version X.Y via .deb.
08:01clgvsm0ke: I only explain how clojure's vars work ;)
08:01winkbut puppet + pulling from git is meh
08:02clgvsm0ke: a (runtime) change of the arities of a function probably does not make much sense.
08:02si14clgv: yeah, it's similar to Ansible in this.
08:03sm0kei agree to some extend to your point though
08:03sm0kewith functions being a first class values
08:21sveri1hi, is there a way to generate junit test reports with leiningen?
08:25sw1nnhiredman: Hi, do you run clojurebot in this channel?
08:34jarodzzhi. everyone
08:35mdrogalisMorning.
08:35jarodzzanybody up? i'm reading some clojure code. and met 1 function name "list*"
08:35jarodzzmorning, mdr~
08:35jarodzzit's 9pm for me. i'm from china
08:35jarodzzthe star at the end doesn't matter. right?
08:36mdrogalis8 AM on east coast, morning after major holiday weekend. Everyone's exhausted over here :)
08:36mdrogalisJust use normal 'list'
08:36jarodzzoh..thanks giving
08:36jarodzzthat's a big one.
08:36mdrogalisLooking at the docs, I can't immediately tell what the difference is. But I've never seen anyone use list*
08:38augustl,(list 1 2 3)
08:38clojurebot(1 2 3)
08:38augustl,(list* 1 2 [3])
08:38clojurebot(1 2 3)
08:38augustl,(list 1 2 [3])
08:38clojurebot(1 2 [3])
08:39augustlmdrogalis: ^^
08:39augustlerr, jarodzz
08:39mdrogalisThat seems like a pretty reasonable thing to use. I wonder why I've never seen it used before.
08:41jarodzzso it's like (list* 1 2 3(3)) -> (list* 1 (list* 2 (3))) ?
08:42jarodzzaugust1, got it. thanks
08:43jarodzzmdrogalis, thanks, man. i know how it works, now i need to understand when i should use it
08:43jarodzz,(= 1 1))
08:43clojurebottrue
08:43jarodzz,(> 2 1)
08:44clojurebottrue
08:45mdrogalisI always derped around with concat when I needed something akin to that.
08:46justin_smith,(> 5 4 3 2 1)
08:46clojurebottrue
08:48jarodzzdo you use clojure at work?
08:48xcthulhuyes?
08:48clojurebotyes isn't is
08:48jarodzzno?
08:48clojurebotno is tufflax: there was a question somewhere in there, the answer
08:48teslanickwhere?
08:48clojurebotsee logs
08:49mdrogalisjarodzz: Yes.
08:50xcthulhuIt's a pretty nice language for getting work done.
08:50jarodzzsounds great.
08:51jarodzzi'm looking for a chance to get some of my work done by clojure
08:51jarodzzand sell to me team members
08:52jarodzzyes it is. some times too expressive. 1 line of clojure contains too much info
08:52jarodzzit takes me minutes to figure it out
08:53xcthulhuIt's just a practice thing
08:54poppingtonicjarodzz: when you learn how the data structures work, you'll understand enough to write your own (albeit, simple) code
08:55poppingtonicAt least, you'll know how to read code beyond the basic "form" structure.
08:56tbaldridgejarodzz: 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.
09:38justin_smithhttp://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/ LOL
09:42winkjustin_smith: interesting, thanks
09:44justin_smithmostly I linked it here for the snarky pullquote at the top :)
09:45tbaldridgehttp://i.imgur.com/tESIX.gif
09:48justin_smithlol, reading further "types for every known http header"
09:50winkjustin_smith: sadly it's a mix of true facts and a little whining
09:51justin_smithOh. Fair enough.
09:51winkand I'm not really a fan of scala and found it overy whining ;)
10:07pdurbinwink: too strict?
10:09silasdaviswhat function can I use to call a function with no arguments?
10:10silasdavisas in (map (comp my-fn apply) list-of-fns)
10:10silasdavisbut apply doesn't work because it wants at least 2 args
10:11justin_smith(map #(%) [println println println])
10:11justin_smith,(map #(%) [println println println])
10:11clojurebot(\n\n\nnil nil nil)
10:11justin_smithI keep forgetting the comma
10:12hoeck1silasdavis: or apply and the empty list for no-args
10:12philandstuffyou probably want doseq rather than map if you're calling a fn for side effects
10:12silasdavishoeck1, yeah I'm an idiot
10:12justin_smithor if you want to be more verbose, (fn [f] (f))
10:12justin_smithsame thing
10:12silasdavisI was thinking apply took a list of args
10:12silasdaviswhich would kind of defeat its purpose
10:12justin_smithyou don't need apply
10:12justin_smiththat's useless overhead
10:13hoeck1justin_smith: but it sometimes looks nice to use 'reader-macro-free' style :)
10:14tbaldridgejustin_smith: or perhaps #(%) if you want people to not understand your code :-P
10:14justin_smithquoting me: <justin_smith> or if you want to be more verbose, (fn [f] (f))
10:15justin_smithapply does some extra stuff that you don't need if you have no args
10:15silasdavisI sort of wanted to do it without an anoymous function
10:16silasdavisbut I'll just do that
10:16justin_smithfor 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:21justin_smithand is #(%) really that much worse than #(apply % []) ?
10:30TimMc&(map trampoline [+ *])
10:30lazybot⇒ (0 1)
10:30TimMc(Don't do that.)
10:34arrdemtbaldridge: nice reaction
10:37gfredericks(letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 42))
10:37gfredericks,(letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 42))
10:37clojurebot42
10:38TimMc,(letfn [(identity [n] (->> (repeat n *) (map trampoline) (reduce +)))] (identity 0))
10:38clojurebot0
10:38TimMcOh right, yes.
10:38TimMc&(repeat 3.4 nil)
10:38lazybot⇒ (nil nil nil nil)
10:39TimMc&(repeat Double/NaN nil)
10:39lazybot⇒ ()
10:40justin_smith,(= Double/NaN Double/NaN)
10:40clojurebotfalse
10:40TimMc(I think that could be either an infinite seq or zero-length, depending on how it is coded.)
10:40TimMc,(<= 5 Double/NaN)
10:40clojurebotfalse
10:40TimMc,(<= Double/NaN 5)
10:40clojurebotfalse
10:41TimMc(Well, flip the comparator, but you know what I mean.)
10:49clgv,(= Double/NaN Double/NaN)
10:49clojurebotfalse
10:49clgv;)
10:49clgvoh it was alreay there above
10:50clgvTimMc: repeat should throw on that ;)
10:50justin_smith"
10:50justin_smitherr "Double/NaN cannot be cast to number"
10:51clgvbut that would mean a check in all valid cases which is probably not desirable
10:51philandstuffIEEE 754 is fun
10:51dalemcbanejoin #pedestal
10:52tbaldridgedalemcbane: yes, please do!
10:52dalemcbaneoops...
10:52clgvtbaldridge: is it too lonely overthere? ;)
10:52tbaldridgenah, I'm just pointing out other people's failures.
10:53tbaldridgeit makes me feel better about myself.
10:53clgvyou evil person ;)
11:01jcromartie_so, CQRS in Clojure
11:03justin_smithjcromartie_ I think immutible data mostly gets you that for free
11:03justin_smithclojure has very few "commands"
11:03justin_smithand a lot of queries
11:03clgvjcromartie_: is that a new buzzword we need to learn for manager-speak?
11:04justin_smithhttp://en.wikipedia.org/wiki/Command%E2%80%93query_separation
11:04justin_smithclgv: it is about not letting "get" have side effects
11:05philandstuffCQS is about interface design; CQRS goes slightly further into architectural design http://martinfowler.com/bliki/CQRS.html
11:07clgvah ok
11:08clgvI found an article in an IT magazine
11:08tbaldridgeIMO, Datomic's model is very close to CQRS
11:12tbaldridgecommands are sent to the transactor as :db/add or :db/retract. Results are queried via a completely different (cached) api.
11:13philandstuffthrough a different communication pathway too
11:13mdrogalisCommands as data/keywords/EDN whatever blew my mind when I first "got" it.
11:33TimMcclgv: Not a *new* buzzword, at least; Wikpedia dates it to the mid-80s.
11:34clgvTimMc: ahok. that renew-cycle again ;)
11:34TimMc"More formally, methods should return a value only if they are referentially transparent and hence possess no side effects."
11:34TimMcThat's pants, how are you supposed to tell someone what the ID is of a newly created object?
11:35clgv:D
11:35justin_smithTimMc: by making a lucky guess, of course
11:35zerokarmaleftvia query
11:36clgvTimMc: newly created objects always get 42 as temporary id, don't they? ;)
11:36TimMc"Drawbacks: CQS can make it more difficult to implement re-entrant and multi-threaded software correctly."
11:36tbaldridgehrm....I can't see how that would be the case.
11:36TimMcI see, so it's useful if you're programming in the 1980s.
11:37philandstuffI think that refers to the stack popping problem
11:38philandstuffwith CQS, you can't atomically retrieve-and-remove the top item in a stack
11:38tbaldridgewhich may not matter if you can always get the full history of the stack
11:38philandstuffagreed
11:39TimMcYou still need to know which insert you were responsible for.
11:39philandstuffdo you? why?
11:40tbaldridgeI'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:40tbaldridgeas well as to pointers to the old and new dbs.
11:41TimMcThis 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:41jcromartie_I'm glad I could "fire and forget" a conversation :)
11:41jcromartie_sorry about that
11:41TimMcIt is generally quite useful to know the ID of the record you just inserted. :-)
11:41jcromartie_was discussion with actual coworker
11:41mdrogalisHah
11:42philandstuffhttp://xkcd.com/356/
11:42tbaldridgeTimMc: that's normally handled as a global variable on the server attached to the connection object.
11:43Bronsais there a name for a function f that has the property f·f = id?
11:44clgvBronsa: a function that is inverse to itself
11:44justin_smithBronsa: well, one of them is id
11:44TimMcheh
11:44Bronsaclgv: yeah, I was wondering if that property had a specific name :)
11:45philandstuffhttp://en.wikipedia.org/wiki/Involution_%28mathematics%29
11:45clgvBronsa: involution it seems
11:45Bronsathanks!
11:46TimMcWhat about f·f·f = id?
11:46justin_smiththere are (pathological?) functions that are not self inverses but meet the criteria - (fn maybe-id [arg] (get {maybe-id identity} arg))
11:47TimMcI was surprised to not find a generalization on the Wikipedia page.
11:48clgvthe "telephone numbers" - that certainly has a ring to it
11:48gfredericksTimMc: this reminds me of cyclic groups
11:49jcromartie_Tim: wouldn't f necessarily have to be an identity function itself?
11:50justin_smithjcromartie_: or some perverse thing like my maybe-id above
11:50arcatanjcromartie_: consider function from {1,2,3} to {1,2,3}: f(1) = 2; f(2) = 3; f(3) = 1; f . f . f = id
11:50philandstuffno, a 1/3 rotation in the complex plane would have f != id but f.f.f = id
11:51philandstuffsimilarly, f(x) = i*x has the property f.f.f.f = id
11:51clgvI like the non-trivial existence proof for f from arcatan ^^
11:52TimMcjustin_smith: maybe-id is self-inverse over a very small domain.
11:53philandstuffjustin_smith: are you thinking of f(f) rather than f(f(x))?
11:54justin_smithmaybe
11:54philandstuffor, in clojure syntax, (f f) rather than (comp f f)
11:54justin_smithyeah, I was confused
11:55jcromartie_arcatan: good point
11:55justin_smith(fn maybe-id [arg] (get {maybe-id identity} arg maybe-id))
11:56justin_smithfor args other than itself, returns itself, for arg of itself it returns identity
11:56philandstuff(comp maybe-id maybe-id) is not the identity fn though
11:56jcromartie_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:57rkzanyone working on/thinking about a cljs reducers drop-in replacement that uses webworkers?
11:57philandstuffjcromartie_: sounds like what test.generative is for?
11:58tbaldridgeany input? even images and jdbc connections? :-P
11:59justin_smith it's a turing complete problem
12:00TimMc&(letfn [(updown [n] (if (odd? n) (inc n) (dec n)))] (map (comp updown updown) [1 2 3 4 5]))
12:00lazybot⇒ (1 2 3 4 5)
12:00philandstuffwell if both functions always terminate and are over finite domains, it's a simple matter of enumeration
12:00gfredericksby which I think justin_smith means it's equivalent to the halting problem
12:01TimMc^ That's an involution over integers.
12:01justin_smithgfredericks: right, that's what I meant
12:01TimMcI don't know where I was going with that, actually.
12:04gfredericks(fns-equal? (constantly true) twin-primes-larger-than?)
12:04gfredericks^ which of course you can use to solve unsolved math problems
12:18TimMcOh I remember, I was going for an order-3 cycle.
12:18TimMc&(letfn [(tri [n] (if (zero? (mod n 3)) (- n 2) (inc n)))] (map (comp tri tri tri) (range -4 4)))
12:18lazybot⇒ (-4 -3 -2 -1 0 1 2 3)
12:21gfredericksTimMc: easily generalizable in that direction
12:21gfrederickshey we could do this for arbitrary objects
12:25TimMcWhat do you have in mind?
12:30ystaelTimMc: well, first partition the set of all Clojure data objects into cells of size n, where n is a positive integer. :)
12:30gfredericksTimMc: um
12:30gfredericksmake a sentinel object
12:31gfredericksand a function that wraps things in [o o o x]
12:31gfredericksand if it sees a vector with N o's, returns x
12:31gfredericksotherwise prepend an o
12:31gfredericksor something
12:31gfredericksI was going to do it myself but I think I might be busier than I'd like to admit
12:35gfredericks{:orig x, :type my-sentinel, :decs-left 5}
12:36gfredericks^ a bit more compact
12:39dxtr_hi
12:39silasdavisI'm currently using carica for config
12:39silasdavishow do people handle multiple environments?
12:39silasdavisall in the same file, and decide at runtime?
12:39dxtr_how do i pronounce clojure? like closure or more like clo-you're or clo-jew-re or .. ?
12:40silasdavisclosure
12:40technomancysilasdavis: just by adjusting your classpath
12:40dxtr_ok..
12:40hiredmansilasdavis: 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:41hiredmansilasdavis: 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:41dxtr_which of the recomennded books (http://clojure.org/books) should i look into, if i'm already familiar with java/scheme/erlang?
12:42seangroveHrm, what was the clojurescript response to the state of clojure?
12:42silasdavishiredman, ok thanks that's relevant as I probably moving to chef
12:42silasdaviscurrently I'm using lein beanstalk
12:42nDuffdxtr_: the two I recommend are O'Reilley's Clojure Programming and Joy of Clojure
12:42silasdaviswonder what the most appropriate way would be to manipulate classpath through that
12:42dxtr_ok, thanks nDuff
12:43nDuffdxtr_: ...you might be able to skip directly to JoC, but it has a reputation for being hard for beginners.
12:43nDuffdxtr_: ...also, you might want to try to get the second edition.
12:44TimMcgfredericks: Sentinals feel like cheating.
12:47dxtr_nDuff: is the joy of clojure something along the lines of "effective clojure", or is it still an introductory book?
12:48dnolenseangrove: ?
12:49nDuffdxtr_: JoC is focused on teaching idiom and best-practice.
12:49seangrovednolen: Ah, I misunderstood, noprompt was asking if anyone had read the clojurescript response*s* on the state of clojure survey.
12:49dxtr_ok
12:49nDuffdxtr_: ...it assumes that basic knowledge of the language is coming from elsewhere. Personally, I find that that works fine for me.
12:49dnolenseangrove: I looked at bunch of them though I didn't take the time to do any extended analysis - it was mostly expect stuff
12:50dnolens/expect/expected stuff
12:50dxtr_but the 2nd edition isn't out yet .. says amazon
12:50nDuffdxtr_: 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:50nDuffdxtr_: you can get it as an ebook from the publisher.
12:50nDuffdxtr_: ...with a print copy shipped when it prints, which AFAIK should be soon.
12:50dxtr_ohh, wow
12:51nDuff...huh, currently estimated for February; I actually was thinking sooner than that. *shrug*.
12:55silasdavisto 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:07aconberehey 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:08cmiles74aconbere: There's a walkthrough that goes through a lot of stuff, let me find a link...
13:08maravillasaconbere: there are some examples at https://github.com/clojure/core.async/tree/master/examples
13:08aconbereyeah I mean I've been reading the walkthrough and the examples
13:09cmiles74Right now, that's the best I could find.
13:09aconbereunfortunately they're not particularly illuminating beyond relatively simple use cases
13:09cmiles74aconbere: Is there anything in particular troubling you?
13:09nDuffThere's been some quite good third-party material written.
13:10mdrogalisIMHO, docs seem to be Cognitect's weakest point from the things they open source.
13:10nDuffI'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:11alandipertaconbere: maybe a good place to start: http://clojure.com/blog/2013/06/28/clojure-core-async-channels.html
13:11aconberecmiles74: 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:11cmiles74aconbere: fair enough. :-) Dave Nolan has a good talk, he works on code throughout the presentation. http://www.youtube.com/watch?v=AhxcGGeh5ho
13:12aconberecmiles74: rad
13:12aconberecmiles74: I think I just answered my question as well
13:12aconberecmiles74: ALSO It feels like a lot of the material assumes familiarity with go
13:12aconbere:)
13:12aconberewhich I don't have
13:12BobSchackaconbere: here is a good post on core.async as well http://swannodette.github.io/2013/08/17/comparative/
13:13aconberecmiles74: basically I need to produce a future that waits on the results of a few other channels
13:13nDuffaconbere: I've had no problems starting with core.async and leveraging that knowledge in using go, so it ports both ways. :)
13:13aconbereand I think the answer is that I merge the channels all together
13:13aconbereand then read items off of the new channel
13:13nDuffaconbere: ...the dots-game thing I pointed out earlier actually might be applicable to that use case, then.
13:13nDuffaconbere: ...particularly if you follow through the refactor as well.
13:15tbaldridgeaconbere: 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:15jcromartie_I keep getting this when I try to compile from CIDER: Unable to resolve symbol: t
13:15jcromartie_on the first line of a file
13:15jcromartie_which has no symbol "t" in it
13:15aconberetbaldridge: thanks
13:15aconberenDuff: reading thanks
13:15tbaldridgeaconbere: might make more sense once the video is up, but still there's a few comments in there that might help.
13:15aconberenDuff: I think that I also tend to dismiss stuff focused on web uses of core.async
13:15jcromartie_and the file requires no other libs
13:16aconberenDuff: I'm relatively uninterested in diving into clojure script
13:16aconbereeven though I suspect the fundementals are the same
13:16nDuffaconbere: 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:16stuartsierraKeep in mind, core.async is still alpha. More docs/examples will come in the future.
13:16aconberestuartsierra: understood! It just solves a specific problem I have so I'm diving in
13:17aconberestuartsierra: in particular I'm very very happy with ztellman's aleph, but the callbacks are forcing me to do some weird bindings
13:17cmiles74I've been using core.async with my Swing (seesaw) code without issue. The core ideas translate pretty well.
13:17aconberestuartsierra: so I'm bridging lamina's channels to core.async to get a more imperative code style
13:17jcromartie_blergh, there was a stray "t" somewhere down in the file
13:17instilled1do 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:17jcromartie_why did it throw the error on line 1?
13:18instilled1^^…started using the mode …
13:18technomancyjcromartie_: because stack traces are hard =(
13:18jcromartie_the stack trace didn't indicate the source line
13:18nDuffinstilled1: M-s
13:19technomancyjcromartie_: tell me about it. drives me nuts.
13:19nDuffinstilled1: ...in paredit, anyhow. Dunno about this "smart-parens" thing.
13:19instilled1nDuff: that was it. cheers a lot!
13:19technomancyjcromartie_: never trust a stack trace
13:19jcromartie_technomancy: I wasn't sure if you were saying "stack traces are hard and you (jcromartie) don't understand them" :)
13:19jcromartie_technomancy: yeah
13:19technomancyhehe; nope
13:20jcromartie_not really much less infuriating than troubleshooting Ruby syntax errors
13:20seangrovetechnomancy: I assume you mean stacktraces are hard to generate properly?
13:20instilled1it takes some time to get used to this auto whatever paren mode...
13:20technomancyjcromartie_: huh; do you get errors that contain actual lies from Ruby?
13:20seangrovehahaha
13:20jcromartie_not actual lies, no
13:21jcromartie_but finding the missing "end" somewhere in the next hundred lines is about as much fun
13:21maravillasall of the roehl tickets on that spreadsheet should end up in the release-1.1 branch (android)?
13:22technomancyeh; those are pretty easy to spot with auto-reindent
13:22seangroveI 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:22maravillaswhoops
13:22technomancywhich is one of those things I just want to yell about when people suggest whitespace-sensitive lisp syntax
13:23seangroveYou'd have to catch the EOF error or "unexpected delimiter )" error and return as much of a complete datastructure as you could though.
13:23dnolenjcromartie_: tools.reader is a lot better at reporting error location than Clojure's reader for mistakes like that
13:23technomancyseangrove: at least puredanger said they're likely to switch to ex-info soon
13:24technomancyso getting useful info out of them and building suggestions on top of that might become feasible
13:24seangrovetechnomancy: Ah, yes, that's true.
13:24seangroveThat could be a huge frustration-saver, for new and old users alike.
13:24technomancythe world would have been a better place if ex-info had landed in 1.1 or 1.2 instead of 1.4 =)
13:26technomancythat's one of those changes it just takes a long time for the rest of the ecosystem to catch up to
13:27jcromartie_dnolen: so I'd just load tools.reader and read the trouble file independently of require'ing it
13:27jcromartie_?
13:29dnolenjcromartie_: worth a try anyway
13:40andyfseangrove: Latest unreleased version of Eastwood issues warnings for defs inside of other defs. Should be released in a week or two
13:42seangroveandyf: But that needs to be combined with catching a missing or extraneous ') somewhere in the source file
13:42Pupeno_wWhere's the list of the clojure primitives? those that cannot be implemented in clojure itself. I remember seeing it somewhere.
13:42andyfBut Eastwood is targeted at only working on syntactically correct code right now
13:42seangroveIf you have that it's probably enough to track down the missing delimiter location
13:42seangroveandyf: Yeah, and that seems fair :)
13:46andyftechnomancy: 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:47seangroveandyf: technomancy doesn't have friends.
13:47seangroveHe has a posse.
13:47technomancyoh, do people actually watch the votes?
13:47RaynesHe has me. :(
13:47technomancyI thought that was just an opinionfest =)
13:47RaynesI'm his friend, obviously.
13:47seangroveRaynes: You're clearly in the posse category.
13:47Raynestechnomancy: Oh oh oh! My test-vars patch finally got in.
13:48seangrove"posse: a body of men, typically armed, summoned by a sheriff to enforce the law."
13:48seangroveSounds right to me.
13:48andyfTechnomancy: alex miller does. He isn't the final decision maker, but he is doing a lot of jira wrangling these days
13:48hiredmantechnomancy: andyf actually generates this weighted report thing
13:48RaynesQuick, maybe a bunch of clojure.test patches! I've figured out the wait time is like two years.
13:48Rayness/maybe/make/
13:49technomancyfancy
13:49pjstadig`wow
13:49pjstadig`i had basically decided that clojure.test would never ever get a patch applied to it
13:49pjstadig`ever
13:49andyfRaynes: (in ghost Obi-Wan voice). Use alter-var-root, Luke .... Let go, Luke
13:49technomancypjstadig`: yeah, I've just resigned myself to constantly monkeypatching
13:50pjstadig`it should just get split out
13:54technomancyindeed
13:59dnolenhigh resolution profiling in Chrome Canary - definitely useful for optimizing CLJS code, http://www.html5rocks.com/en/tutorials/developertools/novdigest/
14:00seangrovednolen: 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:02dnolenseangrove: 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:02dnolens/existing more/existing one
14:02seangrovednolen: Will definitely do so whenever I dive into it. Still getting correctness and features down before profiling and speeding up.
14:24expezAny 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:24jcromartie_you mean the function clojure.core/set ?
14:25expezthe source says PersistentHashSet/create for set and /createWithCheck for hash-set, but they seem to be doing the same.
14:25expezjcromartie_: yes
14:25jcromartie_clojure.core/set returns a set from the given collection
14:25jcromartie_clojure.core/hash-set returns a set of its arguments
14:25jcromartie_the difference is really in the arity
14:26jcromartie_,(set [1 2 3])
14:26clojurebot#{1 2 3}
14:26jcromartie_,(hash-set 1 2 3)
14:26clojurebot#{1 2 3}
14:26llasramWell, and `set`'s contract is just that it returns some sort of set
14:26jcromartie_yes
14:26expezaight, thanks
14:26llasramexpez: There's also `sorted-set`
14:27jcromartie_which is pretty darn nice
14:27technomancyit's like the difference between vec and vector
14:28llasramOr `map` and `hash-map`
14:28technomancy>_<
14:28llasram:-D
14:31expezAny of the libraries for generative testing (a la quickcheck) a clear favorite in the community?
14:31tbaldridgeexpez: simplecheck and test.generative are really the only two
14:32expezclojurecheck is no more?
14:33hiredmanand simplecheck does shrinking
14:34expeznice
14:35seangroveDamnit. Is the :foreign-libs field in cljsbuild only for closure-compatible libs?
14:36seangroveIt's so nice to have the file prepended before any code dependent on it, has cleaned up a lot of logic for us.
14:38gfredericksTimMc: I wonder why the feel like cheating. Is there something gross about them? they're not exactly not-functional
14:40TimMcgfredericks: They can't participate in a total order.
14:40TimMcAlmost as bad as NaN.
14:41bitemyapptechnomancy: clojure.test getting split out to a maintainer on github would be the best Christmas present ever.
14:41technomancybitemyapp: weeeeeellll https://github.com/pjstadig/conjecture
14:41dnolenseangrove: they have to closure compatible in the sense that Closure will rename stuff - but no they don't need to goog.provide anything
14:42dnolenseangrove: for example to use React.js, you would use :foreign-libs + :externs
14:42seangrovednolen: Ah, I didn't add :externs, let me try with that.
14:43llasramThey make those in +3? You stop following magic items for a few months...
14:45bitemyappTimMc: whoa, smiting? A creepy cloak? you know me so well...
14:45bitemyappdo want
14:45arrdemTimMc: make it purple and I'll chip in a few BTC
14:45TimMcNo, no, a separated clojure.test will be a better present, I'm sure.
14:47TimMcllasram: You found me out! I've never played a game with such constructs.
14:47seangrovednolen: 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:48TimMcarrdem: I've been teaching myself electrical circuits; there has to be a place for inductors in an artifact of smiting.
14:48dnolenseangrove: hmm, seems like someone else figured this out https://github.com/piranha/pump/blob/master/project.clj, haven't tried it myself
14:48TimMc(THere's a very simple prank circuit you can make that doesn't zap you until you let go of it.)
14:51Jardahmm..
14:53JardaI created a jar of my ring app
14:53Jardawith lein ring uberjar
14:54seangroveSo much conflicting information on cljsbuild.
14:54Jardaone of my api calls now responses with 500
14:54Jardabut no error log anywhere
14:55Jardadoes the jar-stuff end up stderr not being outputted
14:55hiredmandid you setup logging?
14:55Jardahiredman: no I didn't, I haven't found any info about it
14:55hiredmanhow are you running the uberjar?
14:56Jardahiredman: java -jar my.jar
14:56sveri1hi, when i execute lein jar, is there a way to add a specific build version to the jar name?
14:56hiredmanJarda: is it actually starting ring?
14:56hiredmanerr
14:57hiredmanI should say, is it starting jetty?
14:57Jardahiredman: yeah the service works great
14:57hiredmanJarda: what does that mean?
14:57Jardahiredman: there's just one route that is erroring
14:57Jardaone request that doesn't work
14:57Jardaand I can't find the exception anywhere
14:58hiredmanJarda: is there an exception?
14:58Jardahiredman: well of course there is, otherwise the service wouldn't be sending 500 internal server error..
14:58hiredmanJarda: that depends
14:58Jardawell I'm not sending it myself either
14:58llasramsveri1: 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:59gfredericksTimMc: NaN can totally participate in a total order
14:59hiredmanJarda: anyway, unless you setup logging, there is none
14:59Jardahiredman: yeah, can you point me to resources on how to enable loggin
14:59sveri1llasram: 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:00TimMcgfredericks: True, so in that way, sentinals are even worse.
15:00gfredericksTimMc: they can be ordered if you don't mind calling .hashcode :)
15:00hiredmanJarda: logging is a big thing, I like logback + clojure.tools.logging, but getting that setup is annoying
15:00TimMcgfredericks: Blorf.
15:00JardaIMO error logging is something that should be built-in..
15:01gfredericksTimMc: we haven't even touched mutability though!
15:01TimMc*nod*
15:01TimMcI was only considering immutable things.
15:01hiredmanJarda: ok
15:01gfredericksI'm just trying to figure out why this is gross
15:01llasramsveri1: Well. You could use the `update-in` task to set `:jar-file` from the command-line.
15:01Jardaok, I'll try to enable some logs
15:02Jardavery little info about that on google
15:02hiredman~google ring request logging
15:02clojurebotFirst, out of 89100000 results is:
15:02clojurebotduelinmarkers/ring-request-logging · GitHub
15:02clojurebothttps://github.com/duelinmarkers/ring-request-logging
15:02hiredmannot entirely fare, because I have tried to use that project and didn't like it / it didn't seem to work
15:03hiredmanso I replaced it with my own little ring middleware
15:03hiredmanbut there are other hits for that google search
15:03ziltiWhat's currently state-of-the-art of debugging with cider? Ritz seems to be somewhat dead.
15:03sveri1llasram: that sounds good, do you have a quick example? if not its ok, i will try to figure it out by myself
15:03Jardahiredman: yeah, a lot of outdated / not working solutions it seems
15:03Jardaand nothing like "log to a file called error.log all unhandled exceptions"
15:04seangroveI think source map generation must not be compatible with :foreign-libs.
15:04Jardaa huge dissapointment for me
15:04llasramsveri1: just the help in `lein help update-in`
15:04hiredmanJarda: because once you have logging via something like clojure.tools.logging, that is a one liner ring middleware
15:04sveri1llasram: ok, thank you very much :-)
15:05ziltiMore exactly what I'm looking for is a tool working with cider with which I can set breakpoints
15:06bitemyappseangrove: don't get angry.
15:06technomancyanger leeds to hate; hate leads to software; software leads to suffering.
15:06bitemyappseangrove: c2 not suit your needs?
15:11seangrovebitemyapp: 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:12bitemyappseangrove: 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:12seangroveI'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:13bitemyappthat would probably be more productive.
15:13dnolenseangrove: based on http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html, :foreign-libs and :externs seem like they should be compatible
15:13seangroveMaybe flotr2 has a closure-compatible unminified file...
15:14seangrovednolen: 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:14seangroveI'll continue trying various permutations.
15:14dnolenseangrove: sounds like a bung on our end if that's true
15:14dnolenha s/bung/bug
15:18seangrovednolen: Yeah, this works: https://www.refheap.com/6e89561fc059cf56371201997
15:18dnolenseangrove: wait, what wasn't working?
15:18seangroveflotr2-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:19seangroveProbably a limitation of the closure compiler, but I'm not sure
15:19dnolenseangrove: oh you don't have a real extern file
15:19seangroveYeah, trying to use the file itself as an extern file
15:20dnolenseangrove: maybe that supposed to work? but seems weird to me
15:21seangrovednolen: 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:22dnolenseangrove: I haven't heard that anywhere - seems like it would be too inconsistent to work.
15:22dnolenseangrove: 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:23seangrovednolen: That sounds like the most pleasant/maintainable approach
15:26seangrovednolen: 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:27seangroveJavascript just doesn't provide enough metadata for useful tools to be built properly around it :P
15:27nopromptany tips for testing core.async code in cljs?
15:28noprompti was thinking i could probably just borrow the runner from core.async itself
15:28noprompterr the repo.
15:30bitemyappnoprompt: speaking more generically, I have some strategies for testing core.async if you need them.
15:30bitemyappMostly to do with forcing a terminal state so that I can evaluate what happened and to see if it matches expectations.
15:30nopromptbitemyapp: client side tho?
15:30nopromptor should it even matter.
15:30bitemyappobviously not but I'm not sure how that'd make a difference, the stategies I speak to are generic.
15:31nopromptsure, i'd love to hear your take on it.
15:31dnolenseangrove: it actually shouldn't be very hard to do, just a new analyzer pass that collects data for emission.
15:31bitemyappwell let me know when you need it.
15:31nopromptbitemyapp: now
15:31noprompt:)
15:31bitemyappis it me or would *-to-JS compilers benefit from some standardized tooling?
15:32dnolenseangrove: if you have a :dot form or :invoke form via js/ or :foreign-lib that'll go into the automatically generated extern.
15:32bitemyappnoprompt: well basically it depends on what you need, a scalar value or a collection.
15:32TEttingerbitemyapp, there's some tools listed at http://altjs.org at the bottom
15:32TEttingerbut nothing standard
15:33bitemyappTEttinger: the problem is that most people want to write the tools in their source language, not JS itself.
15:33TEttingeryeah... so how would there be standardized tooling?
15:34TEttingerto be fair, if you're writing a *-to-JS translator, you better know JS
15:34bitemyappnoprompt: 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:34nopromptbitemyapp: i want to verify that databinding is working.
15:34seangrovednolen: This is essentially our wrapper around flotr https://www.refheap.com/e9a205e5559cd265f5a13a28c
15:34nopromptbitemyapp: ie. i put! a value on a channel and textNode.data is appropriately changed.
15:34bitemyappnoprompt: smash the DOM, see if the model changed. Vice versa.
15:36seangrovednolen: I don't think there's enough there for the analyzer to know what the external invocations are
15:36seangroveAt least, there's no linkage between js/Flotr and [flotr] the namespace/foreign-lib
15:37nopromptdnolen: what do you think? should i just borrow code from the core.async repl and run the tests traditionally in a browser?
15:39ziltiWhat's the state-of-the-art for debugging / setting breakpoints with cider?
15:42dnolenseangrove: I don't see why there needs to be to calculate the external invokes
15:43technomancyzilti: 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:44bitemyappritz is...not really a stepping debugger.
15:44dnolennoprompt: 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:44bitemyapp~zergling
15:44clojurebotzergling is https://github.com/prismofeverything/schmetterling
15:44bitemyappzilti: ^^
15:44seangrovednolen: 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:44bitemyappzilti: http://clojurewiki.com/Tracing
15:44technomancyzilti: 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:44bitemyapp~tracing is http://clojurewiki.com/Tracing
15:44clojurebotRoger.
15:44ziltibitemyapp: Umm. From the... browser. ??
15:44lazybotzilti: Uh, no. Why would you even ask?
15:45technomancybitemyapp: there's no cider support in zergling tho
15:45bitemyapptechnomancy: I am harassing the shit out of him about that *right now*
15:45ziltitechnomancy: Will keep that in mind, but I don't currently have the capacity to create any tooling stuff.
15:46technomancyoh, misread your comment above
15:47bitemyappzilti: use zergling's silly browser bullshit until nrepl protocol support is straightened out.
15:47technomancyzilti: toggling tracing on a defn with a single emacs command is pretty handy, but nrepl-discover is still kind of immature
15:47bitemyappzilti: tracing is usually enough and is often faster/more productive than manually stepping.
15:47technomancyand just pray you never hit a bug bad enough to need a stepping debugger
15:47bitemyappzilti: I would strongly encourage you to try tracing first.
15:47ziltiThanks, I will take a closer look at that zergling / butterfly stuff
15:47justin_smithas 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:47bitemyappzilti: no no, try *tracing* first!
15:48bitemyappzilti: it's simpler and often better in Clojure than stepping debuggers.
15:48technomancyoh, also I found this the other day: https://github.com/clojure-emacs/cider-tracing
15:48bitemyapptechnomancy: sigh, goddammit, coventry was already working on Troncle.
15:48technomancyI think it's a bad idea in the long run, but it's there and it probably works better than the right idea
15:48technomancyoh right, of course
15:48bbloomdnolen: i'm so glad you're finally paying attention to reactjs
15:48ziltitechnomancy, 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:49dnolenbbloom: yes watching the talk and poking around the source has got me interested
15:49gunsimmutable 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:50bbloomguns: clojure.core/reductions <- best "stepping" debugger ever
15:50bitemyappzilti: 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:50gunsbbloom: yes, I remember spitting out my coffee when I found that one
15:51bitemyappzilti: it's extremely unlikely that your problem is so complicated as to need an actual debugger.
15:51ziltibitemyapp: I'm not saying that. But the last time I used the tracing macro, some things stopped working.
15:51bitemyapptechnomancy: https://github.com/clojure-emacs/cider-tracing/issues/3 so apparently today is "bitemyapp is angrily herding cats" day.
15:51bitemyappzilti: well. that's strange. try deftrace again.
15:51ziltibitemyapp: IIRC it started to have problems if a certain wrapped whatever got loaded multiple times into the repl.
15:51bitemyappzilti: check out Troncle too, it has nice Emacs integration (if you use Emacs)
15:52bitemyappzilti: so use deftrace
15:52technomancybitemyapp: it's not actually part of cider, but I agree.
15:52bitemyappreloading things in the REPL has weird semantics if you don't know what you're doing.
15:52bitemyapptechnomancy: it has the cider-* label slapped on it.
15:53technomancybitemyapp: https://github.com/technomancy/nrepl-discover
15:53justin_smithzilti: that likely means the namespace has side effects in the top level code
15:54guns++nrepl-discover ; sorry I didn't mention it in the slamhound release, technomancy. I thought it might confuse people
15:54technomancyguns: no, it's still too experimental
15:55technomancyat this point I would like to have tooling people look at it, but not end users
15:55nopromptdnolen: 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:55bitemyapptechnomancy: my main battle is getting people to understand that nrepl is a protocol, not just a REPL.
15:55gunsokay, I thought I made the right decision. Seeing the issues that have popped up since reinforces this
15:55seangrovebbloom: What's caught your attention around reactjs?
15:56bitemyapp~frp is a comonad
15:56clojurebotIk begrijp
15:56bitemyapp~reactjs is a poorly implemented comonad
15:56clojurebotYou don't have to tell me twice.
15:58technomancybitemyapp: 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:00bbloomseangrove: ignore bitemyapp as usual :-P
16:00nopromptbitemyapp: 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:01nopromptit's separated in the sense that it is in two files and that's pretty much it.
16:01bbloomseangrove: i've discussed reactjs at length in here before. not a lot of time to chat at the moment tho, sorry
16:02seangrovebbloom: No worries, I'll try to remember to search the logs, I'm very curious to hear about ui approaches right now
16:02noprompti 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:03bbloomnoprompt: i believe the react guys have been considering css isolation for a while now, but i dunno of any meaningful attempts at it
16:03nopromptthis sort of thing should be very possible with good protocols.
16:06nopromptbbloom: i've expiremented with the closure api's for manipulating the CSSOM and it seems very doable.
16:07brainproxydnolen: 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:07nopromptbitemyapp: wtf is a comonad?
16:07brainproxyand I mean w.r.t. incremental compile time
16:08brainproxyw/o source maps, I have incremental build times ~0.6s, w/ sourcce maps incremental build time is around ~40s
16:11seangrovebrainproxy: dnolen's stance on that is to not use any optimizations when doing dev work
16:12brainproxyseangrove: i have optims at :whitespace
16:13dnolenbrainproxy: 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:13seangrovebrainproxy: Yeah, you'll need to use :none. I do it the same way as you, I haven't switched over yet
16:13brainproxyalright, I can try setting to :none and see if that helps
16:13dnolenbrainproxy: 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:13seangrovebrainproxy: You'll need to update the html file including the javascript
16:15brainproxyseangrove: yeah, just realizing that
16:15brainproxyand it's a lot of stuff... :-/
16:15seangrovebrainproxy: *should* be easy, one second...
16:17seangrovebrainproxy: 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:18seangroveSo 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:19brainproxyseangrove: awesome
16:20seangrovebrainproxy: Please let me know if that works for you, I may switch over at some point :)
16:22seangroveLooks like a lot of the performance damage is coming from pushing a lot through clj->js
16:23brainproxyseangrove: bumping to `:jvm-opts ["-Xmx2g"]` in project.clj made a huge difference
16:24seangrovebrainproxy: Still using :whitespace?
16:24brainproxynvm I'm stupid
16:24brainproxyrechecking
16:28zerokarmalefthaha, macroshka is the best namespace name I've seen this year
16:30bitemyappzerokarmaleft: that's pretty good :)
16:30bitemyappcoventry: we like your namespaces.
16:32dnolenseangrove: clj->js is not going to be cheap, I honestly don't know why people use it for anything but the simplest interop
16:32seangrovednolen: 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:33bitemyappseangrove: abaranosky gave a talk where he mentioned walking your data structures was a performance no-no :)
16:33bitemyappseangrove: you can replace clj->js with macros that translate your mappy operations to object-compatible ones.
16:34dnolenseangrove: yes but if your data is something nested or larger than small, clj->js is likely to be a bottleneck
16:35seangrovednolen: 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:36seangroveI'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:37seangrovewriting some nice macros on top like bitemyapp suggests
16:38redalastorI 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:40seangroveIt'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:41seangroveMight be able to size the data structures down a bit before shipping them off to js-land
16:41bitemyapp(づ ◕‿‿◕ )づ gib macro
16:42dnolenseangrove: I hacked up a thing with JS Proxy, could work - but it's not widely available - is this your Chrome extension project?
16:42seangrovednolen: No, this is a new product, stand-alone
16:43seangrovebitemyapp: ☬
16:45seangroveI 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:45seangrovednolen: What is the JS Proxy thing?
16:46dnolenseangrove: ES6 proxy, they support intercession
16:47dnolenseangrove: so you can wrap an object and make it work transparently like some other object/array
16:47justin_smithseangrove: that's a sikh symbol, right?
16:48dnolenseangrove: needs runtime support though, you can't shim it in
16:48seangrovednolen: Wow, sounds very interesting. Looking forward to that making its way into the browser.
16:48seangrovejustin_smith: Hindu, I thought
16:48dnolenseangrove: works pretty well in Node, very experimental support for it in master
16:49dnolenseangrove: mori master
16:49dnolenseangrove: https://github.com/swannodette/mori/blob/master/src/mori.cljs#L172
16:50seangrovednolen: Yeah, looks like it's not even enabled in Canary yet
16:50dnolenseangrove: it's definitely available there
16:50seangroveBut that's pretty brilliant, means a significantly lighter overhead, seems like
16:51seangrovednolen: Enabled by default, or with a flag?
16:51dnolenseangrove: oh right, yeah it's a flag
16:52seangroveAnyway, looks very cool. I'll cut the data size down for the time being and move on
16:53brainproxyseangrove: I can't get goog to actually load stuff
16:53brainproxythough after some fiddling I no longer have errors in the console
16:53seangrovebrainproxy: https://github.com/swannodette/mies/blob/master/src/leiningen/new/mies/index.html#L5
16:53seangroveDoes it look like that?
16:55dnolenseangrove: CLJ story here is way better as there are standard collections interfaces to actually implement in Java
17:00seangrovednolen: aka "Javascript strikes again"
17:02bitemyappI'm really glad I managed to shift into doing more backend work at my company.
17:04dnolenseangrove: hum clj->js iplementation for coll? is pretty bad
17:04seangrovebitemyapp: 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:04dnolenseangrove: at least 2X slower than it should be if not worse
17:04dnolenfor arrays
17:04seangrovednolen: Yeah, the array bit is taking up the biggest chunks in the firechart
17:05dnolenseangrove: effectively two array clone operations happening
17:05seangroveIf 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:06dnolenseangrove: http://dev.clojure.org/jira/browse/CLJS-709
17:06dnolenseangrove: this would probably be huge perf boost for you.
17:06dnolenseangrove: might want to try that locally and see if it helps
17:07seangrovednolen: Looks like you got the same profile info I did
17:07dnolenseangrove: no I just looked at the code
17:07seangrovednolen: Well then, good job with intuition ;)
17:08seangrovematches my profiling pretty well
17:08seangrovednolen: 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:11m0gI'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:11akurilinbitemyapp, gratz! :)
17:11bitemyappakurilin: what?
17:11akurilinRegarding the backend thing.
17:11bitemyappOh, uh, thanks
17:11akurilinit's where the fun is
17:12akurilinI'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:12bitemyappit'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:12mattmoss,(Character.UnicodeScript/of 13)
17:12clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: Character.UnicodeScript>
17:13akurilinbitemyapp, is FRP a significant and meaningful step forward in your opinion?
17:13bitemyappakurilin: yes, but it works better with types.
17:13seangrove~frp
17:13clojurebotfrp is the language of choice of octopodes
17:13bitemyapp~reactjs
17:13clojurebotreactjs is a poorly implemented comonad
17:13bitemyapp~frp
17:13clojurebotfrp is a comonad
17:13bitemyapp~botsnack
17:13clojurebotThanks, but I prefer chocolate
17:13akurilinseangrove, think I saw your post on HN job postings and you were talking about FRP there, right?
17:14akurilinI'm trying to figure out if I should nut up and do this upcoming month-long project in cljs rather than js
17:14bitemyappakurilin: I'm indirectly competing with one of the companies in the HN job posts.
17:14devnDO ITTT
17:14akurilinWhat's the inflection point where cljs starts to pay off?
17:14bitemyappdevn: easy there killer.
17:15akurilindoes it have to do with codebase size, or type of work being done in the client?
17:15devnakurilin: when you want to work on it
17:15bitemyappakurilin: depends on the hacker, codebase size, type of work, etc.
17:15bitemyappakurilin: I'd say cljs pays for itself just by being more pleasurable.
17:15bitemyappleads to less mental friction when hacking.
17:16akurilinbitemyapp, does the fact that a lot of MVC work ends up being fairly OO-flavored make cljs uglier to use?
17:16bitemyapptechnomancy: I'm intimidated by the compiler itself.
17:16bitemyappakurilin: no, and that's brain-damage specific to a design problem. It doesn't affect CLJS.
17:16akurilinbitemyapp, to be more precise, a lot of MVC work with certain frameworks.
17:16noprompti hate the web.
17:16bitemyappakurilin: you can model your problem however you like in CLJS.
17:16nopromptthere i said it.
17:16nopromptlol
17:17bitemyappnoprompt: I should stop describing myself as full-stack just so I can stop exit-stage-right'ing out of frontend work.
17:17nopromptbitemyapp: the frontend is the worst place on earth.
17:17bitemyappnoprompt: it's one of them. I hear North Korea has terrible winter weather.
17:17akurilinI 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:17brainproxyseangrove: yep, exactly like that
17:17technomancybitemyapp: that won't stop your friends from pranking you by endorsing you in those skills on linkedin
17:17brainproxyI keep getting "Uncaught Error: Undefined nameToPath for goog.string "
17:18technomancy"friends"
17:18bitemyapptechnomancy: I've had enough of getting endorsed in Python and SQL as it is.
17:18brainproxywhen I try to require 'my.test'
17:18technomancyfoes, whatever
17:18bitemyappakurilin: 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:18akurilineverybody endorse bitemyapp for bower, grunt, backbone
17:18bitemyappakurilin: might as well win the leverage of cljs itself in the process.
17:18bitemyappof those, I've only used backbone, and I fucking hated it.
17:19bitemyapp~backbone is awful
17:19clojurebotRoger.
17:19devnangular isn't so bad
17:19devnbackbone is what you make of it
17:19bitemyappI liked angular, but the CLJS integration sucks.
17:19devni've had a good experience
17:19akurilinI'm a backbone believer. Hate me.
17:19devn(with backbone i mean)
17:19brainproxyakurilin: I like bower and grunt
17:19m0gStill stuck on this simple thingy of calling CharacterUnicode.of from clojure if anyone feels like dropping a hint :o]
17:20brainproxybut am gunning for clojurescript and polymer
17:20bitemyappwow, two Clojure programmers that both got dropped on their heads. what are the odds?
17:20devnim just telling you based on experience, which is one huge codebase with a large distributed team
17:20devnit's worked out well, but it was all more or less hand-rolled
17:21akurilinbitemyapp, 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:21TimMcm0g: UnicodeBlock, you mean?
17:21bitemyappthe last time I used backbone I pissed blood and went into a fugue state.
17:21devneveryone writing code has gotten more and more functional in their style, which has brought them around to clojure and clojurescript
17:21m0gTimMc: oh sorry, Character.UnicodeScript.of
17:21devnwe're using google closure on it for require/provide
17:21TimMcm0g: I don't see a Unicode*Script*.
17:21devnit could be better, but it's not bad
17:21TimMcJust making sure we're looking at the same thing.
17:22m0gTimMc: are you looking at java >= 7?
17:22TimMcHmm, no.
17:22m0gI think it appeared in java 7
17:22bitemyappakurilin: 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:22TimMcm0g: Anyway, $ for inner classes.
17:22m0gnice, I'll try that :)
17:22m0gthanks7
17:22m0g-7*
17:23bitemyapptechnomancy: doesn't Racket have a Parsec equivalent?
17:23akurilinbitemyapp, 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:23TimMcm0g: (I still don't see UnicodeScript in Java 7)
17:23m0git's an enum
17:24technomancybitemyapp: hm; wouldn't surprise me
17:24akurilinregarding 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:24m0ghttp://docs.oracle.com/javase/7/docs/api/java/lang/Character.UnicodeScript.html
17:24technomancyI saw a strangeloop talk (last year?) on another clojure port of instaparse
17:24technomancyI think the author got distracted though
17:24TimMcm0g: Oh, that's an irritating interface, I see.
17:24m0gTimMc: yup, quite painful
17:25akurilinbitemyapp, 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:25akurilinbitemyapp, says quite a bit about how useful that library is.
17:25TimMcLooks like neither evalbot is on Java 7 yet.
17:26bitemyappakurilin: Parsec is partly why some people really like writing compilers and interpreters in Haskell.
17:27bitemyappakurilin: Perl 6's primary implementation was Haskell for many years. I don't know if that's changed or not since.
17:27devnyeah, parsec is basically it
17:27akurilinWow, that's interesting.
17:27bitemyappHow Perl programmers thought to use Haskell is beyond me, but you know, whatever.
17:27devni learned haskell for xmonad and parsec
17:27bitemyappthere are other really great libraries, but Parsec is one of those libraries that changes how you think.
17:27akurilindevn, xmonad has some seriously devout followers.
17:27bitemyappakurilin: I'm one of 'em.
17:27devnit rocks
17:28m0gTimMc: I'm still getting an error after importing the class and calling (.of Character$UnicodeScript 13). Any idea of what is going on?
17:28bitemyappHaskell: come for the xmonad, GPU-acceleration, and Parsec - stay for the types.
17:28akurilinI 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:28TimMcm0g: (Character$UnicodeScript/of 13), since it's a static method
17:29devnakurilin: it was the speed for me.
17:29bitemyappakurilin: I would disagree with that strongly.
17:29bitemyappakurilin: Emacs has its own windowing, but I still use Xmonad.
17:29devnthe speed and having custom workspaces for specific tasks
17:29bitemyapp^^ yep.
17:29m0gTimMc: it works indeed. Thanks a ton :)
17:29bitemyappthe workspaces in a multi-monitor setup in particular are <3
17:29grncdrthe workspaces are indeed the big thing IMO
17:30grncdreven on a single monitor
17:30devnbecause the switching is so fast you don't feel the pain of workspaces like you do in other OSs
17:30bitemyappyeah, even in a single monitor.
17:30bitemyappakurilin: my dotfiles have an Xmonad config btw.
17:31akurilinworkspace = you can preset what windows you want to have open where?
17:31devni 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:31devnakurilin: yeah, you can do that
17:31devnyou can also set the custom layout for that window
17:31devnso your chat window will always align left along the side of the screen
17:31devnetc.
17:32akurilinyeah tmux has something like that too, but it's restricted to just what's in the terminal.
17:32bitemyappakurilin: well that's the point, everything is in Xmonad so you're not constrained.
17:32bitemyappakurilin: you don't have to try to shove everything into the terminal.
17:33winkakurilin: vim in split mode in tmux in split mode in terminator in xmonad (split) - welcome to recursion
17:33akurilinbitemyapp, got it.
17:33akurilinI'll need to experiment with it at some point
17:33winkbut seriously, and I have no clue why - but I keep my terminals in terminator and don't split them with xmonad
17:33trinaryare there any even kind-of decent tiling WMs in OSX? I use Divvy but it's pretty limited.
17:33winksomehow I am faster with the mouse probably
17:34grncdrtrinary: there's another one that a friend of mine was using that looked reasonable...
17:34grncdrsorry, he's offline :|
17:34akurilinSo what was the issue with lein-cljsbuild? Why was it "scary"?
17:35trinarygrncdr: no worries :)
17:35technomancyakurilin: 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:36technomancythat's ha hell of a hello-world
17:37akurilintechnomancy, yeah that's not immediately accessible, I'll give you that
17:38akurilinWhere do you cry if something related to that is breaking/not working and you have no idea? #clojurescript ?
17:39bitemyappakurilin: I see plenty of people ask here.
17:42akurilinCool.
17:44akurilinAnybody 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:44akurilinPerhaps have the scenario setup function return the context of everything that has been created in the system
17:48akurilinSo cljs namespacing everything is pretty much the answer to JS's AMD?
17:49dnolenakurilin: also the mailing list is pretty active
17:50dnolenakurilin: namespacing in CLJS isn't significantly different from namespacing in CLJ
17:50bitemyappI don't think there was much intent regarding what the JS ecosystem was doing there.
17:51akurilindnolen, sounds good!
17:53dnolenakurilin: CLJS design is pretty anti-AMD, it's expected that all the code for an application get compiled together.
17:53coventry Can I get a quick survey of who's using nrepl vs cider?
17:54akurilindnolen, 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:54akurilinThat part always felt a bit clunky, the define syntax etc.
17:54bitemyappcoventry: nrepl for now, I'll switch later.
17:54akurilinthe shims.
17:55dnolenakurilin: 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:56bitemyappgiven it's JS, I'd expect them to settle on something half-assed for 6 months, then change again.
17:57akurilinbitemyapp, good one.
17:58akurilinIs that the unfortunate reality of consensus by committee?
17:58akurilinand if so, is cljs avoiding that by having a benevolent dictator?
17:58dnolenakurilin: in anycase, it's one of the nice things about CLJS, modules today, and a good dependency management system courtesy of lein
17:58dnolenakurilin: in JS you gotta cobble that together yourself.
17:59akurilindnolen, that sounds pretty exciting, thanks for clarifying!
18:00dnolenakurilin: 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:07akurilindnolen, is integrating into the build existing popular .js libraries generally problematic?
18:08dnolenakurilin: if you're targeting web browsers, yes it requires configuration because of Closure minification
18:09dnolenakurilin: 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:11akurilindnolen, are the big popular libraries all moving towards supporting Closure?
18:12bitemyappakurilin: Not especially from what I can tell, but it doesn't matter.
18:12dnolenakurilin: 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:13dnolenakurilin: what's more annoying is that it's hard to integrate small/medium libs that provide some useful functionality
18:16akurilindnolen, what do people currently do if they run into that scenario? Do they fork those libs and rewrite them for Closure?
18:16dnolenakurilin: no, there are knobs for this
18:19bitemyappakurilin: lightning talks at Clojure meetup this Thursday.
18:20bitemyappakurilin: should I talk about Brambling or something else?
18:24akurilinbitemyapp, I don't know how ubiquitous datomic usage is at this point, that'd make a difference.
18:24akurilinbitemyapp, and for people who don't use datomic yet, is this something they can relate to?
18:26bitemyappakurilin: I can explain brambling in terms of any historical/immutable/event sourced database
18:26bitemyappakurilin: it's also just Clojure code and I wanted to talk about the code.
18:26brainproxyso 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:31akurilinbitemyapp, sure.
18:34bitemyappakurilin: I'm trying to think of other things I could talk about.
18:37bitemyapp,(reductions (fn [x y] ([:a :b :c :d :e :f :g :h :i :j :k :l] y)) (range 10))
18:37clojurebot(0 :b :c :d :e ...)
18:40m0gis 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:40m0gthrough some unification mechanism
18:40bitemyappm0g: what?
18:41Apage43,((fn [[a b c]] {:a a :b b :c c}) [1 2 3])
18:41clojurebot{:a 1, :b 2, :c 3}
18:41m0ggood enough, dunno why I had any problem :]
18:41m0gthanks
18:41bitemyappstraight up destructuring? You made it sound like something else.
18:41pdkclojure supports destructuring argument lists
18:42bitemyappm0g: that's called pattern-matching in Haskell.
18:42Apage43yeah, that's very much *not* prolog-y unification
18:42Apage43or even haskell pattern matching
18:42bitemyappsuch a weird way to describe it.
18:42beppuhttp://blog.jayfields.com/2010/07/clojure-destructuring.html
18:42Apage43there's some overlap, but both of those allow you to do things you can't with just destructuring
18:42m0gyeah sure
18:43danielsz` How do you guys/gals like to do string interpolation?
18:43danielsz`,(format "string interpolation %s" (+ 1 2))
18:43clojurebot"string interpolation 3"
18:43m0gbut destructuring is given for free by unification in Prolog
18:43danielsz`That's one way
18:43m0gand by pattern matching in haskell
18:43m0gsorry if the question was weirdly turned
18:43danielsz`Kinda lame, no?
18:44m0gbeppu: thanks for the link
18:44Apage43danielsz`: there's https://github.com/clojure/core.incubator/blob/master/src/main/clojure/clojure/core/strint.clj
18:45danielsz`,(<< "string interpolation ~(+ 1 2)")
18:45clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: << in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:45danielsz`yes, it's in the incubator namespace
18:45danielsz`Is anyone using it?
18:45Apage43well incubator is a separate library you need to toss in your project.clj if you want it
18:45Apage43but no, I've not heard of anyone using that
18:45danielsz`I bet nobody bothers, right?
18:46danielsz`Alan Dipert wrote the ruby style interpolation
18:46danielsz`"this is a string #{foo}"
18:46danielsz`for clojure: https://github.com/alandipert/interpol8
18:47danielsz`But it's too limited.
18:47danielsz`As far as I can see it's not doing evaluation of forms.
18:47bitemyappis string interpolation that important to you?
18:48danielsz`bitemyapp: probably not, but it's been bothering me and I wanted to survey others.
18:49danielsz`If strint was in the core I would use it.
18:49Apage43you could write your own and it'd be exactly the flavor you prefer :)
18:50danielsz`Apage43: :-)
18:51danielsz`It's really a small thing, alright.
18:51Apage43i 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:52danielsz`Apage43: True
19:02nopromptwhen 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:10xeqidnolen: is there an estimate for the next cljs release?
19:10xeqiwant to make sure I have some piggieback/austin forks ready
19:13dnolenxeqi: could probably cut another one at the end of the week
19:19nopromptdnolen: should i worry about something like that?
19:24dnolennoprompt: it should just get collected, but you should try it to see what happens.
19:48devndnolen: 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:49devnI find lots of interesting papers to read...behind a giant paywall.
19:50dnolendevn: oh right, I usually find the author's academic web site
19:50dnolendevn: Google Scholar some times works
19:50devnFailing that?
19:50devnDo you pay for access to anything?
19:50dnolendevn: if I absolutely have to have something I don't mind paying for it
19:50devnI used to have an ACM account.
19:50dnolendevn: but that's *extremely* rare
19:50dnolendevn: also useful to ask around on the InterWebs
19:51devnI'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:51devnSo I'm hesitant to pay up front.
19:52devnWhich, BTW -- the cochlea. We have two of them. They're pretty great.
19:52devnAs in difficult to model. :)
19:52patchworkdevn: I find the paper on the author's site pretty much every time
19:53devnpatchwork: good to know. I need to just google better.
19:53patchworkAt least, some kind of pre-published version
19:53devnWhen 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:53devnGood advice dnolen && patchwork. Thank you.
19:53garhdezdevn: if you have access to a public library, it's possible that they have a subscription to a journal database such as JSTOR
19:54devngarhdez: I used my girlfriend's JSTOR, Ebsco, etc. access for every last minute she was still in school. :)
19:54devnbut I haven't been to the public library in awhile. I should check that out.
19:54garhdezheh
19:55devnThen I subscribed to ACM, with mixed results.
19:55devnIt seemed difficult to find what I was looking for most of the time.
19:56devnLots of categories. Difficult to discern between them.
19:58rkneufeldTheory question: Are only ISeq objects a part of the sequence abstraction, or are is being Seqable the only necessary condition?
20:01mysamdogI have yet another question about clojurescript
20:02mysamdogMy code is (ns foldup)
20:02mysamdog(def folded (OriDomi. (first (getElementsByClassName js/document 'response.1'))))
20:02mysamdog(.accordian folded 30)
20:03mysamdogAnd lein cljsbuild once compiles it with this WARNING: Use of undeclared Var foldup/OriDomi at line 3 src-cljs/foldup.cljs two times
20:03mysamdogThe javascript console in my web browser says Uncaught TypeError: Property 'document' of object [object Object] is not a function
20:04mysamdogBut when I do var folded = new OriDomi(document.getElementsByClassName('response.1')[0]); and folded.accordian(30); everything works fine
20:04mysamdogWhy doesn't it work when I write it in clojurescript
20:04mysamdog?
20:09nDuffmysamdog: do you have an externs.js?
20:10nDuffmysamdog: ...basically, the Closure Compiler needs to know about external libraries you're using.
20:11amalloymysamdog: the code you pasted wouldn't even compile ('foo' is not a string in clojure). i recommend pasting your actual code
20:11amalloyadditionally 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:13mysamdogamalloy: That is my actual code, I'll add the . and replace the 's with "s.
20:13mysamdogMy externs file is:
20:13mysamdogvar OriDomi = {};
20:13mysamdogOriDomi.accordian = function() {};
20:14seangrovemysamdog: Also, it's (js/OriDomi. ...)
20:14seangroveOriDomi essentially exists in the 'js' namespace
20:14amalloymysamdog: does oridomi really mispell accordion? a quick google search suggests that they spell it correctly (accordion)
20:15seangrovemysamdog: Also, ' is different from ", they're not interchangeable in cljs
20:15mysamdogaaaaaaand I misspelled accordion.
20:15seangrove(def folded (js/OriDomi. (first (.getElementsByClassName js/document "response.1"))))
20:16amalloyseangrove: going for the hat trick on this answer, huh?
20:16seangroveamalloy: Let me find one more 'also'....
20:16seangroveI like the idea of giving that kind of example and seeing who tears it apart, and how quickly
20:17seangroveUse it as a kind of nerd-sniping sport
20:17amalloy*chuckle*
20:18amalloyseangrove: using "perusing" wrong is another good way to distract nerds
20:19amalloy(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:19seangroveamalloy: Should have had an "about" in there
20:19amalloyseangrove: that...makes it worse?
20:19amalloythe point is that peruse is an antonym of browse, but it's very often used as if it were a synonym
20:20seangroveCould be - meant it in the sense that I'm endlessly reading through documents on OpenID options
20:20amalloywell, fair enough
20:20seangroveheh, I'll keep that trick in mind though, makes it easy enough
20:20mysamdogWell, 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:23seangrovemysamdog: It's pretty difficult to help you with this stuff, I can't be sure it's being copied faithfully
20:23mysamdogWell, my code is:
20:23mysamdog(ns foldup)
20:23mysamdog(def folded (js/OriDomi. (first (.getElementsByClassName js/document "response.1"))))
20:23mysamdog(.accordion folded 30)
20:23mysamdogSorry for asking so many questions, clojurescript just confuses me somewhat
20:24amalloythat error reads very much like you have (js/document) in there somewhere
20:24amalloyi mean, i believe you've copied your actual code this time, but that's what the js runtime is upset about
20:26seangrovemysamdog: Yeah, paste the javascript output on refheap.
20:28mysamdoghttps://www.refheap.com/21442
20:29mysamdogGreat. Now it's giving me a different error: Uncaught Error: [object NodeList]is not ISeqable
20:31seangrovemysamdog: Don't use advanced optimizations while developing.
20:31mysamdogShould I use whitespace or simple?
20:32seangrovemysamdog: whitespace to start with. I can see some transformations here that already could make tracking down the bug in dev difficult
20:33amalloymysamdog: 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:34seangroveamalloy: Have you considered merging map-keys and map-vals into clojure.core?
20:35seangroveamalloy: Just do it when no one is looking. We'll all thank you.
20:35amalloyha ha
20:35amalloyseangrove: ninjudd is a bigger fan of that idea than i am. i don't use useful.map very much
20:35mysamdogHere's my new js: https://www.refheap.com/21443
20:35seangroveamalloy: Any reason why not?
20:36seangrovemysamdog: I think it's cut off, paste the `tail -n 500 output.js` of it
20:37amalloywell, 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:37seangroveamalloy: That's an interesting idea.
20:38amalloyit'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:38mysamdoghttps://www.refheap.com/21445
20:38amalloyi mean, i really shouldn't worry about that expense; it's super-premature optimization
20:39amalloybut it bothers me and is easy to avoid
20:39seangrovemysamdog: That's looking good
20:39seangroveAnd what's the error? Still the nodelist?
20:39amalloywhoa, are DOM NodeLists not seqable?
20:40ddellacostaamalloy: DOM NodeLists are a weird beast
20:40seangroveI think they might have to be wrapped in prim-seq
20:40amalloylike, you could replace (first x) with (aget x 0)
20:40mysamdogNow it's
20:40mysamdogOriDomi: First argument must be a DOM element OriDomi.js:407
20:40mysamdogUncaught TypeError: Cannot read property 'anchor' of undefined
20:41amalloymysamdog: that sounds like there's no element with class response.1 on the page
20:41seangrovemysamdog: 1.) is the page fully loaded when this code runs 2.) Do you have an element with a class of "response.1"?
20:41mysamdogYes to 2, no to 1
20:44seangroveYou'll need to wrap the .getElementsByClassName in prim-seq
20:44seangrove(first (prim-seq (.getElementsByClassName js/document "tab")))
20:44mysamdogIt works!
20:45mysamdogThank you all so much
20:45seangroveNo problem, sorry that was pretty rough.
20:48devnwho is the main person behind caribou?
20:48seangroveIsn't it justin_smith?
20:48devnwhen someone referred me to him, he told me he'd let the team know
20:50patchworkdevn: It is me
20:50patchworkjustin_smith and I work together
20:50devnpatchwork: oh, cool
20:50devnany chance that there will be easy drop-in storage options in the future?
20:50devnbesides mysql, postgres, and h2
20:50patchworkdevn: There is already a protocol adapting over the data store
20:51patchworkThose are just the ones we have at the moment
20:51devnoh, cool
20:51patchworkWhat were you looking for?
20:51devna friend was asking me about the options
20:51devnwe were talking about riak and datomic mostly
20:52devnpatchwork: 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:53devnhaving 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:53patchworkdevn: Ah, are you using it?
20:53devnpatchwork: schmetterling?
20:53patchworkSomehow word has gotten out, I haven't even officially released it yet
20:53patchworkYeah
20:53devnyeah, it's really rad
20:54patchworkAwesome! Glad to hear it
20:54devnit's like better errors, or binding.pry or whatever
20:54devnsuper helpful stuff
20:54patchworkYeah it is a simple concept, but somehow it hasn't happened for clojure yet
20:54patchworkglad to hear people find it useful
20:54patchworkSo are you using caribou as well?
20:54devn /sort of/ :)
20:54patchworkOpen to any feedback there
20:55patchworkAh right : )
20:55devnI've tried damn near every framework-ey thing since clojure was a few months old
20:55patchworkI 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:55devnOne thing I was really confused by was how the admin panel...well...works
20:55patchworkdevn: How so?
20:56devnI was expecting to see generated code or something
20:56devnwhen I added a new page, for instance
20:56justin_smithdevn: in caribou?
20:56patchworkAha right, yeah it is all in the db
20:56devnpatchwork: yeah, i guess im just not used to seeing those things be stored off in the DB
20:56justin_smithit is all data driven, yeah
20:57devnin case I wanted to fiddle with it in my repl, or in a file
20:57patchworkdevn: You can also specify routes as code (in routes.clj)
20:57patchworkThe admin is really just a convenience in that regard
20:57justin_smithby specifying the same data in edn form
20:57devnbut in general I should say: it's an interesting interface
20:57devnim just not used to the idea of it
20:58devnoh, here is a smidge of feedback
20:58patchworkRight, it is kind of new. I haven't seen anything that has the models represented as data like that
20:58devnthe default generated config: It would be nice to provide comments above each k/v pair to explain what that section does, etc.
20:58devnsimilar to a generated rails project
20:59justin_smithdevn that is a great idea
20:59patchworkAh interesting… that could be helpful
20:59devnlike :actions (atom {})
20:59justin_smithright, that is pretty opaque
21:00devn'nother nitpick for you
21:01devnadd an obvious TOC link on the individual doc pages
21:01devnthe teepee looks like a home, but it takes you off site
21:01patchworkHmm… 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:02devnpatchwork: could that just be moved out into the config which gets merged?
21:02devnthe default config
21:02justin_smithpatchwork: I was making some notes on the conflating config and state thing, when working on the avout integration
21:02patchworkAh, if you click on the header "Documentation" it leads to the TOC
21:02devnyou guys are working with avout on this?
21:02patchworkdevn: Yeah that is probably what should happen
21:02justin_smithI think it would be better to have separate config/state
21:02justin_smithor one atom with config and state entries
21:03justin_smithdevn: I made an adaptor, may not be ready for production
21:03patchworkdevn: We just started looking into using avout to coordinate things on clusters like beanstalk etc
21:03devnhow do you intend to use it?
21:03devngotcha
21:03justin_smiththe size of the distributedatom objects may be too large
21:03devni haven't seen many people using avout
21:03patchworkdevn: Have you heard issues with it or something?
21:03justin_smithwe would use it to coordinate state between instances (things like the set of models / pages defined)
21:03devnno, just saw the big reveal and then didn't hear much about it
21:04devnpatchwork: in some ways i think datomic stole some of the limelight
21:04patchworkI saw someone presenting at euroclojure that used it successfully, that is what turned me on to it
21:04patchworkdevn: How would datomic replace avout functionality?
21:04justin_smithI think if we switch from the zookeeper backend of avout to the mongodb backend, we can use the current design
21:04justin_smithand use zookeeper for lighter weight lower latency type stuff
21:04devnstop mongodb before mongodb stops you
21:05devn;)
21:05patchworkYeah I'm not sure about mongo
21:05justin_smithok, we could make another backend for neo4j
21:05justin_smithor some other more reliable nosql
21:05jared314etcd?
21:05patchworkneo4j looks awesome, though it is java 7 only
21:06patchworkwhich I guess we should all be using (but some people don't have it)
21:06justin_smithI am fine with java 7 only, there is an open source java 7
21:06devnriak
21:06patchworkdevn: We haven't used datomic because of the license so far
21:06devnpatchwork: you know about pro starter now, right?
21:07justin_smithanyway, after using it, I like the distributedatom aproach a lot - duplicating the existing semantics and even protocols for remote objects
21:08patchworkdevn: I saw something about it, but I haven't really looked into it
21:09devnjustin_smith: patchwork: im not sure where i was going with avout vs datomic
21:09devnpatchwork: ^
21:09justin_smithjust that datomic stole avout's thunder timing wise?
21:09justin_smithso fewer people tried it
21:09devnmostly -- i guess i wonder if you could model similar things using datomic
21:10devnsince joining across multiple dbs isn't a PITA
21:10patchworkdevn: Maybe you just use a single datomic db rather than coordinating state through distributed refs?
21:10justin_smithprobably
21:10devnpatchwork: there's that too
21:10patchworkThat is at least what I took you to mean, but I have no idea what you actually intended ; )
21:10justin_smithwell hell we could already be syncing via db if not for the overhead
21:10justin_smithis datomic really that low overhead?
21:10justin_smiththe idea with avout was something with faster update and read times than sql for root level stuff
21:11justin_smiththe integration with clojure protocols was a bonus
21:11devnso you're saying something like: you have a central server which might add a page or something
21:11patchworkdevn: So… datomic pro starter is still not redistributable
21:12justin_smithdevn: not central
21:12devnand then you have clients who want to pick that info up
21:12justin_smithdevn: at dev time any of the peers may add a page
21:12justin_smithit is not centralized
21:12devni see, sort of like a distributed content management system
21:12justin_smithright
21:12patchworkSo we could use it, but anyone who used it with caribou would still have to register themselves etc
21:13justin_smithbut just for the core stuff like the model definitions that are needed for constructing queries, and for page definitions
21:13devnpatchwork: gotcha yeah, makes sense
21:13bitemyappjustin_smith: yeah, should've used Datomic >:)
21:13devnaw don't make me that guy
21:13justin_smithpatchwork: we could integrate it if we did the storage protocols dependency injection style
21:14devni've just been on a datomic kick the past few weeks
21:14devnit is damned powerful
21:14justin_smithhell, take all the dbs out of caribou-core, and let users insert them as injected dependencies that fulfil the protocols
21:14bitemyappjustin_smith: eggscellent idea.
21:14patchworkI have messed with it, I love it
21:14bitemyappdevn: needed to migrate anything yet?
21:14devnno
21:14devnim just toying
21:14bitemyappdevn: pity. I want feedback on brambling.
21:15seangrovesritchie: You do any frontend/ui work at all?
21:15sritchieseangrove: these days I do
21:15bitemyappseangrove: he has been lately, previously not so much.
21:15bitemyappbeat me to the punch.
21:15sritchie:)
21:17devnbitemyapp: i will check it out
21:26devncould some convention for maintaining migration order be better than having users maintain that order thingy?
21:27devnfor instance, generating a file with a timestamp on it?
21:27devnim 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:28devnduring a merge for instance
21:28justin_smithreally then you want to duplicate the git featureset
21:28devnnono, rails does something like this -- generate a migration with a timestamp, assuming that the migration you're working with comes /next/
21:29devnassume 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:29bbloomdevn: rails' convention is only marginally less busted than it's prior convention of an incrementing counter
21:29devnbbloom: no argument here.
21:30bbloomdevn: actually, i preferred the incrementing counter approach b/c then you had an annoying merge confict
21:30devnheh, you like the pain?
21:30bbloomdevn: an obviously annoying merge conflict is clearly superior to a subtle bug
21:30devni can agree there
21:30devnwhat i tend to do is check the schema timestamp against the most recent migration
21:31devnif those match things are good
21:31bbloomdevn: 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:32bbloomdevn: use of a timestamp permits commutative migrations
21:32bbloomhowever, it also permits non-commutative migrations that consist of non-interfering database transforms
21:32bbloomie bugs
21:33devnbbloom: so do you prefer adding them manually to a list?
21:33bbloomyes
21:34bbloomwhat i've done in the past is to have a directory of migrations where the names have no impact on the order
21:34bbloombasically just a bunch of add_whatever.sql
21:34bbloomor frob_the_foo.sql
21:34bbloomthen the build system would pgdump the schema to a sql file and then shasum that file
21:35bbloomthen 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:36bbloomto 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:36bbloomwhen you're done, your sha1 should match, if it doesn't, then something horrible happened
21:36seangrov`o_O
21:36seangrov`I'm sure there's some wisdom in what you're proposing bbloom, but it sounds like madness
21:36bbloomit's like ~20 lines of bash. works great
21:37bbloominstead of that stupid schema.rb file that doesn't cover all the subtlties of your indexes
21:39akhudekbbloom: sounds similar to flyway, but flyway doesn't checksum your schema
21:40devnbbloom: 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:40bbloomfor sure
21:41bbloombut for that case, just run a script in your repl & be sure to have a backup :-P
21:41devnon bigger projects i've seen similar techniques employed, and i ain't mad at that
21:41technomancybbloom: google cache is a pretty good backup these days
21:42devnbut to the extent you're not on a ridiculously bad team, people stay in sync with master, some simple tests are written, etc.
21:42technomancy(assuming that was an antirez joke)
21:42bbloomtechnomancy: not familiar w/ the context
21:42bbloomdevn: `drop table schema_migrations` was my favorite migration ever
21:42technomancyoh I thought you were talking about http://antirez.com/news/65
21:43bbloomlol
21:44devnhaha
21:44seangrov`"No, just kidding." Phew.
21:45devnbitemyapp: was i using brambling without knowing it?
21:45devnI made a migration.
21:53seangrov`UI sync done, OpenID integration ~60% of the way through. Time to drinks.
21:57gfredericksdoes anybody have any good introductions/references for jvm bytecode?
21:58gfredericks(i.e., for becoming familiar with it, not solving any particular problem)
21:58justin_smithgfredericks: one of those questions I wish I had an answer to. I guess I want to know what that book is too.
22:00hiredmangfredericks: what do you want to know about it?
22:00hiredmanthe class file format?
22:00hiredmanhttps://github.com/hiredman/bc/blob/master/src/bc/core.clj#L1-L3 are 3 links about jvm bytecode
22:01gfrederickshiredman: formats are good; semantics of the language is more what I was imagining I suppose
22:01gfrederickshiredman: I'll check these out, thanks
22:02hiredmanthere is always http://docs.oracle.com/javase/specs/jvms/se7/html/
22:03gfredericksI don't think that will be unhelpful
22:23coventryI 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:29gfrederickscoventry: this is indeed informative-looking
22:31bitemyappdevn: uhhh, I don't think so?
22:31bitemyappdevn: are you sure you made a migration?
22:32jared314coventry: what version of asm does clojure use?
22:32bitemyappdevn: you have to reduce the transaction log, retain identities, etc etc
22:38coventryjared314: I saw a bug in jira talking about updating that. I think it is a very early version.
22:38coventry(at the moment.)
22:48dnolenadded CLJS support for *print-level* http://github.com/clojure/clojurescript/commit/13d49ec0180dc5199b580a3c9e46c0eba171cfe4
22:50bitemyappdevn: are you sure you don't mean that you were simply transacting entities into the schema?
22:52jarodzz,(= 1 1)
22:52clojurebottrue
22:53wxqy,(+ 1 1)
22:53clojurebot2
22:53wxqy,((fn [x] (x x)) (fn [x] (x x)))
22:53clojurebot#<StackOverflowError java.lang.StackOverflowError>
23:01justin_smith,((fn boom [] (boom)))
23:01clojurebot#<StackOverflowError java.lang.StackOverflowError>
23:02coventry,(recur) :-)
23:02clojurebotExecution Timed Out
23:04logic_progI need to file a bug vs clojurescript.
23:04logic_progFor 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:09andyfIntroducing syntax errors into your ~/.lein/profiles.clj can really mess with your mind.
23:19ddellacostalogic_prog: he's doing pretty well, in my opinion--are your talking about this? http://swannodette.github.io
23:19logic_progyeah
23:19logic_progI only count 12 entries
23:19logic_progthere's more wisdom in one of those blog posts then the front page of news.yc
23:20logic_progyet news.yc has 30 new entries daily
23:33dnolenjust pushed React.js 0.5.1 to clojars
23:34dnolenthis is what your project.clj needs to look like - http://gist.github.com/swannodette/7763911
23:35nopromptdnolen: does it work well with cljs?
23:35nopromptdnolen: cause, and i'll be honest, working with angular from cljs is the worst shit ever.
23:36dnolennoprompt: 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:36dnolennoprompt: of the JS libs I've seen this honestly the first time I've ever cared to integrate anything
23:36dnolennoprompt: the DOM diffing stuff is to slick, and they've already dumped so much time into - seems pointless to recreate
23:37dnolennoprompt: React.js + including a persistent hash map (which pulls in a lot of CLJS), 47k gzipped, so not bad
23:37dnolensmaller then Ember.js ;)
23:37khaledhi all
23:38nopromptdnolen: 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:39dnolennoprompt: 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:40nopromptdnolen: since you've done a little leg work with the project.clj, i think i might join you on that adventure. ;)
23:40halorgiumhey all
23:41halorgiumi'm wondering if anyone has tips for attaching clojure source into intellij idea
23:41nopromptdnolen: 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:42dnolennoprompt: 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:44nopromptdnolen: you mean wrt web applications? afaik two-way data bondage is what's commonly used in desktop ui's, no?
23:44dnolennoprompt: yeah it's a rat's nest there too
23:44nopromptdnolen: i'm probably to youge of a developer but why?
23:45dnolennoprompt: two way data binding and trying to make it work for all cases inevitably adds a lot of complexity
23:45dnolennoprompt: fundamental react model is very functional, every state has a corresponding DOM representation
23:45dnolennoprompt: new state, new UI
23:45dnolenthat's dead simple
23:45khaledhalorgium: add the folder where your clj as a sources root folder, and by the way there is a clojure plugin in intellij
23:46halorgiumkhaled: yer, clo-jet?
23:46dnolennoprompt: no Cocoa/Ember.js model array controller messes
23:46halorgiumkhaled: do you know if it can use it from a jar? or should i extract it myself?
23:46nopromptdnolen: yeah, i never got into that. angularjs was about the only form of "controller" i could actually tolerate.
23:47dnolennoprompt: I know this may seem like implementation details, but this stuff leaks bad IME
23:47dnolennoprompt: I'd rather start from a simpler model
23:47dnolennoprompt: 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:48khaledhalorgium: 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:48halorgiumkhaled: sorry, i meant if i can use the .clj files from inside a jar
23:48halorgiumi'm building against storm (from java)
23:49nopromptdnolen: 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:49nopromptdnolen: if css could somehow get plugged into the picture that'd be great.
23:50khaledhalorgium: i'm pretty newbie in clojure at the begining of "clojure in action", never heard about storm
23:50halorgiumkhaled: ah, ok ;)
23:50halorgiumthanks! :D
23:51nopromptdnolen: i'll take a stab at it here in a bit.
23:58dnolenupdated React gist that actually might work for someone else - https://gist.github.com/swannodette/7763911