#clojure logs

2014-01-01

00:00KeithPMRight...
00:01justin_smiththere is even this popular sneaky trick: ##(let [a 0 _ (println a) b 1] (* 3 b))
00:01lazybot⇒ 0 3
00:01justin_smith_ being a conventional name for a thing you are using in a binding place, but the value is ignored
00:02justin_smiththat comes up when you have stateful stuff in the let bindings, and you want to print out what is happening in the middle of a series of bindings
00:05johnwalkerghhappy new year
00:05binski:D
00:07KeithPMLet destructuring... Cool stuff!!! I read up the special forms in the docs. Sooo much good stuff :)
00:08KeithPMHey Justin, thanks a lot, I finally got the recursion method to work. I bound the result of the update to a new variable and used that in the recursive call
00:08KeithPMThanks everyone... It's a struggle, but I think clojure is so worth the effort!!!!
00:09justin_smithdestructuring is another thing, works in function args, let bindings, doeseq and for bindings...
00:09TEttingerKeithPM heh indeed. it took me about a year of on-and-off clojure use before it kinda clicked. using it more would have made it faster heh
00:10justin_smithKeithPM: agreed, definitely worth the effort, a marvelous language
00:10TEttingerthe way you can manipulate data in clojure is really fantastic
00:11KeithPMYes, so empowering, you get so much done with so little
00:12justin_smithand instead of it being so little thanks to cryptic sigils, it is so little because you have composible operations that do the things you need to your data
00:12KeithPMAbsolutely. I love that if I can't figure the whole thing out, I could work out little pieces and compose them.
00:13KeithPMAnd I think what you were referring to, is the absemce of squiggles in the language. I feel that the scarcity of syntax is so helpful to clear thinking
00:14justin_smithI was thinking of perl
00:14justin_smithwhich is concise and expressive in a much different way
00:16TEttingerAPL is concise but I wouldn't think of it as expressive
00:17justin_smithyeah, maybe not so much the "expressive" part with perl either actually
00:18KeithPMYes, I missed the perl boat, I am from the awk days :) . I like APL but the problem with many of these they tended to be incomplete. I feel I could do anything with clojure, from the data base to the web page to the calculation... That is what makes it worth my time and effort.
00:18justin_smithagreed, in my experience so far that is true
00:19justin_smithas long as you don't need low memory usage or quick start up time, clojure's your guy
00:19TEttingerin clojure, unless your task involves pretty heavy mutable state, you can use your choice of solutions rather than contorting your code to fit the language's patterns. APL, everything's an array.
00:20KeithPMYes... a matrix of as many dimensions as your brain could keep track of :)
00:20TEttingerKeithPM, heh
00:21TEttingerI prefer to use 1D arrays in clojure when I need speed, even for 2D data (using the (mod idx width) trick)
00:23KeithPMOh I understand, that's like the C array... A one D that you could shape to your heart's desire
00:25brandon`is clojure's macro system closer to common lisps' than scheme's?
00:25amalloyyes
00:33UltimateEyePatchbrandon`, I was asking this today and they refused to answer me
00:33UltimateEyePatchBecause they think I'm troll, they can hunt for I can take it
00:33UltimateEyePatchAs I'm the hero clojure deserive,s but not the one it needs right now
01:22bitemyappucb: !!!
01:22bitemyappucb: happy new year, have some fucking black metal! http://www.youtube.com/watch?v=aIQgwFcush0
01:23bitemyappucb: http://www.youtube.com/watch?v=hzMeU8tuvNE and something not black metal!
01:24bitemyappTEttinger: that's a pretty good trick.
01:24TEttingermod and quot by width man, all you really need
01:25bitemyappTEttinger: is that adaptable to three dimensions?
01:25TEttingerI think so. it may be multiple calls
01:25TEttingerthink of 3d tic-tac-toe
01:31justin_smithI was just playing with conch, and it makes it easy to treat an arbitrary shell command as a lazy-seq of lines
01:31justin_smithwhich has some really nice potential
01:32bitemyappRaynes: ^^ he likes your milkshakes.
01:33abaranoskymmmm, milkshakes
01:33bitemyappabaranosky: hey man! Happy New Year :)
01:33abaranoskybitemyapp: happy new year to you as well :)
01:33bitemyappabaranosky: I'm reading the Yesod book right now, funny to see the patterns/ideas I was using in Ring pop up in their neck of the woods.
01:33abaranoskyhappy new year all of you guys too :)
01:33justin_smith(inc Raynes)
01:33lazybot⇒ 40
01:34abaranoskyjust had to google Yesod. Cool. I'm looking forward to making some real application in Haskell sometime
01:35bitemyappabaranosky: been futzing around with a Haskellization of Frak with noprompt.
01:35bitemyappabaranosky: I'm tinkering with Simonides at the moment.
01:36abaranoskybitemyapp: I'm looking through your public activity on Github at the moment.
01:37bitemyappabaranosky: Simonides isn't public yet :(
01:37bitemyappthe original Clojure repo was private and I haven't pushed my Haskell experimentations.
01:37abaranoskybitemyapp: other than working on a private project of mine, I've been doing abunch of elisp lately
01:38abaranoskyI'm definitely succombing to the Emacs addiction, severely
01:38bitemyappabaranosky: most of my public activity will probably be Berossus, which is actually a work project.
01:38bitemyappabaranosky: making that Yak nice and bald?
01:39abaranoskybitemyapp: I'd like to even contrbute to cider and stuff... It's a yak, but a really important one to the community
01:39justin_smithis there such thing as yak-electrolysis?
01:39abaranoskyI've done a little work on clj-refactor too
01:39abaranoskyjustin_smith: there is now!
01:39bitemyappjustin_smith: good idea.
01:39bitemyappabaranosky: that's intriguing - what's the idea there?
01:39abaranoskyjust add it to the URban Disctionary
01:40abaranoskybitemyapp: cider, or clj-refactor?
01:40bitemyappabaranosky: clj-refactor
01:40bitemyappabaranosky: how would that even work? heuristics and prayers?
01:41bitemyapppart of what was interesting for me in comparing my approaches in Ring to what the Yesod people are doing is that they're basically taking what I was doing via maps and implicit coercions and making it into an explicit Type.
01:41bitemyappespecially surrounding REST and content negotiation.
01:42abaranoskybitemyapp: it can't do that much.. but some things are useful. IT can rename files, and replace the usages in ns statements throughout the project. It can thread and unthread, and can add ns form to the top of each new cfile I make
01:43abaranoskyTo do more interesting things it needs a nrepl conneciton and analyzer.
01:43bitemyappabaranosky: that's still very cool :)
01:43abaranoskyI really like reading elisp projects like those though, because I'm learning a lot
01:44abaranoskyFor example, trying to setup my erc right now to notify me when I'm mentioned, or get a private message
01:45abaranoskybitemyapp: re: Yesod, I'd really need to see some example code to make what you're saying more concrete
01:45bitemyappabaranosky: http://www.yesodweb.com/book/restful-content
01:45bitemyappabaranosky: I changed the way I was doing my Ring handlers.
01:45bitemyappabaranosky: they all return maps with a template name and the actual data.
01:46bitemyappabaranosky: then content negotiation decides whether you get a rendered HTML template with the injected context, a straight-up Clojure map, or JSON.
01:46bitemyappabaranosky: makes your handlers highly testable too.
01:46abaranoskyhow were you doing them before?
01:48bitemyappabaranosky: just directly rendering HTML or JSON or something.
01:48bitemyappwhich is how I've seen most other people do it - having separate JSON and HTML handlers. No need for it though.
01:48bitemyappyour web app is the API.
01:49bitemyappabaranosky: it's a little ghetto but you can see an example here: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/api.clj
01:49abaranoskybitemyapp: that makes sense. I never get to that level of decoupling because for the crappy APIs I work with we're not serving various content-types... pretty much every routes serves one content-type per route
01:50abaranoskyif I wanted to accept various content-types per route I'd want there to be a canonical data shape, that coudl then be rendered to JSON/XML/EDN/CSV/etcetc
01:53bitemyappabaranosky: it's not just for the various content types
01:54bitemyappabaranosky: it's for easy debugging and testing.
01:54abaranoskybitemyapp: looking at yoru link... In some more ivory tower universe, it'd be nice to have a map from content-type to serializer-fn, and then the route would compute the data and switching on the content-type pick a serialization
01:54bitemyappbecause then I can treat my handlers like vanilla Clojure or Haskell functions.
01:54bitemyappabaranosky: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj#L32-L51
01:55abaranoskybitemyapp: cool, I just learned you can do #L32-L51 in github
01:55bitemyappabaranosky: I do this partly because I had some pretty serious issues with getting Liberator to do what I wanted, so I did what I always do...and wrote my own fucking Ring middleware.
01:55abaranoskybitemyapp: nice, great minds think alike they say
01:55bitemyappgrump grump grump
01:56bitemyappabaranosky: this is why I'm suspicious of things like Liberator - it invariably becomes easier for me to write my own Ring middleware than futz around with their pseudo-framework.
01:56abaranoskybasically, keep everything as data as long as possible... it's the best way to do everything in Clojure
01:56abaranoskyframeworks stink
01:56bitemyappI'm willing to play in Yesod land (a framework) because I don't fully know the lay of the land in Haskell web dev yet and want to learn the patterns from them first before I do everything myself in WAI.
01:56abaranoskyI haven't messed with liberator enough
01:57bitemyappabaranosky: well, for experienced users they can sometimes. But I needed to learn how Haskell people were doing it and learning from frameworks initially seemed and okay way to do that.
01:57abaranoskythe solution might just be that liberator needs to have its design put to the decoupling / flexibility challenge
01:57bitemyappabaranosky: and I know many experienced Haskell users who are happy using Yesod and Snap (also a framework)
01:57bitemyappabaranosky: that's part of the problem. You basically can't change the content negotiation behavior / dispatch easily in Liberator without resorting to the sort of evil hacks I am notorious for.
01:58abaranoskybitemyapp: oh, I"m all for copying the patterns that seem to work "ok" when learning the ropes... It's the only way really.
01:58bitemyappAOP / alter-var-root / robert.hooke - that sort of thing.
01:58abaranoskyThat's why I'd like to hack in Haskell with someone who knows better, like yourself
01:58bitemyappabaranosky: well it's that or make a lot of silly mistakes while groping blindly around in WAI land.
01:58bitemyappWAI is roughly equivalent to Ring.
01:58bitemyappthe reason I'm using Yesod is that Snap and Happstack haven't fully embraced WAI yet.
01:59bitemyappthey're older, which is part of the reason.
01:59abaranoskythese are all very new and funny words to me
01:59abaranosky;)
01:59abaranoskythere is one Ring to rul them all.... don't need those other ones
01:59bitemyappabaranosky: I really don't know that much, I've got a knack for explaining some of the more basic concepts like monads and I'm good at reading documentation.
02:00abaranoskygood, then you won't know so much that my relative ignorance drives you nuts
02:00bitemyappAlso I am wired for fucking sound. Perhaps drinking a whole pot of moka espresso wasn't a good idea.
02:00abaranoskyI've written one 100 line Haskell application to read files and sort and output them to txt files.
02:00bitemyappabaranosky: Haskell happens to be exceptional at unixy things like that.
02:00abaranosky... its a code puule from from an old job of mine
02:01bitemyapppuule?
02:01abaranoskyoh, sorry. "puzzle"
02:02bitemyappah okay.
02:05bitemyappabaranosky: part of the Yesod rabbit-hole and a lot of why it had to be done as a framework is that Snoyman extended the concept of "type-safe" beyond just the controllers and persistence layer. It covers URLs and templates too.
02:05bitemyappabaranosky: the templates get type-checked as part of the build. lol.
02:05bitemyappthe individual components are library-ized, you can use any part of it you want individually, but you won't benefit from the build process as much unless you use it in the way prescribed.
02:05bitemyappso I'm trying to get a feel for whether or not the added hotness is worth using the framework atm.
02:06abaranoskybitemyapp: that's the stuff I want to get real-world-hands-on-experience with... because I don't know if I think it rocks, or instead is over-restrictive feeling to have the type system involved in the urls and templates like that
02:06abaranosky... not saying one way or the other... just not sure if it will legitimately make me more productive
02:06bitemyappabaranosky: it's pretty lightweight from what I'm experiencing so far.
02:06abaranoskyat the end of the day I want my programmign language to make me faster
02:07bitemyappor at least on the template/URLs side it is.
02:07bitemyappbut he's using macros and other things to hide the boilerplate :)
02:07abaranoskyyeah, not so sure about macros in Haskell :\
02:07bitemyappabaranosky: http://www.yesodweb.com/book/shakespearean-templates
02:07bitemyappabaranosky: the macros in Haskell are similar to the ones in Lisp. You get an AST and return an AST.
02:07abaranoskyI need more experience.
02:08bitemyappabaranosky: take a quick look at the examples in that link.
02:08abaranoskyinteresting, so they're not horrific
02:08bitemyappyeah, I can smell color now. That was too much coffee.
02:08TEttingerI want to smell color
02:09abaranoskybitemyapp: any good links on haskell's macros?
02:10bitemyappabaranosky: just the Template Haskell tutorials.
02:10bitemyappI don't know of a particularly good one, the ones I found through googling seemed fine to me.
02:11bitemyappucb: annnnd uhhhh http://morthylla.bandcamp.com/album/morthylla
02:11bitemyappalso R is an obnoxious language.
02:12abaranoskyan obnoxious language for those obnoxious, smug Data Science weenies
02:12abaranosky^^^ I"m kidding ;)
02:12abaranosky... seriously, the machine learning guys at work make good use of R
02:13bitemyappabaranosky: I'm trying to decide if I want to continue reading through this Machine Learning for Hackers book just by reading the examples or by translating the code to Haskell.
02:13abaranoskybut as a developer, I don't like it so much
02:13bitemyappI get that R is effective, but it's really not superior to Clojure or Haskell for me.
02:13bitemyappit's also got a filthy and terrible notion of how package management should work.
02:13abaranoskyHaskell isn't your ideal ML language is it? I have yet to meet a data guy who mentioned using Haskell for their work
02:14abaranoskybitemyapp: you are correct R is *not* a good langueg imo... just an easy/convenient one
02:14bitemyappyeah, good way of putting it.
02:14bitemyappabaranosky: uh, depends on the problem. Clojure has nice tools for some things, Haskell has better ones for others.
02:14abaranosky"it has a lot odf good libraries" is something I've heard a billion times
02:14abaranoskysame thing about Python
02:14bitemyappabaranosky: if I was performance constrained or I had to write something larger than a 100 line program I'd lean towards Haskell to keep me sane.
02:18abaranoskybitemyapp: I'm excited to learn more Haskell for the new year
02:22abaranoskybitemyapp: was just looking at frak... I wonder when a library like that becomes something you need to use?
02:22bitemyappabaranosky: noprompt is one of those people that harness regex for eldritch purposes.
02:22bitemyappabaranosky: I think the original use-case was improving the syntax highlighting in vim-clojure and they wanted something close to the ideal (performance) regex from a list of inputs.
02:23bitemyappnow he just uses it as a command line application.
03:16ddellacostabitemyapp: Happy New Year!
03:18bitemyappddellacosta: happy new year! I found an excellent interactive course written by a prominent Haskeller.
03:18bitemyappddellacosta: let me know if you'd like to pair up on it :)
03:18ddellacostabitemyapp: definitely interested...is there a link?
03:19bitemyappddellacosta: https://github.com/NICTA/course
03:19bitemyappI'm doing some preliminary exploration of it right now.
03:21abaranoskybitemyapp: how much of the stuff in your emacs.d on github do you use regularly? I'm always interested in seeing how people use Emacs to rock
03:22bitemyappabaranosky: anything Clojure, Python, or Haskell related is used pretty regularly.
03:23abaranoskyis alembic working for you? Last time I tried to use it it didn't work. But I'm going to try it again.
03:23bitemyappabaranosky: it worked fine for me the last time I used it.
03:23bitemyappit's pretty critical when I'm beginning to hammer out a new project.
03:23bitemyappI used it when I started getting berossus rolling.
03:24abaranoskybitemyapp: yeah it is really annoying to keep calling cider-restart
03:24ddellacostabitemyapp: also, Fogus linked to this: http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours in this twitter thread: https://twitter.com/bodil/status/418037143014227968 ...seemed pretty interesting.
03:25ddellacostabitemyapp: my goal for tonight is simple breadth-first search in Haskell. I might try it in Clojure too to compare and contrast..
03:25bitemyappddellacosta: laff @ the people recommending RWH and R. jesus christ.
03:26TEttingerddellacosta, is that dijkstra's algo?
03:26bitemyappddellacosta: Write Yourself a Scheme in 48 Hours is how I originally got going with Haskell. It's pretty good but I'd still recommend doing Yann Esposito's tutorial first.
03:27bitemyappddellacosta: http://en.m.wikibooks.org/wiki/Haskell this is pretty good too.
03:27bitemyappthe only reason I don't recommend WYaSi48H is it's only fun for a certain sort of person.
03:27TEttingerhttps://github.com/tommyettinger/dungeon-kingpin/blob/master/src/dk/core.clj#L170-L225 there's some improvements to be made, like the piece of global state I use
03:28bitemyappand not at all, "to the point" of what makes Haskell different to somebody who has used a Lisp/Scheme before.
03:28bitemyappthat's my opinion though, I'm sure some disagree.
03:28eredi've been meaning to do the yann esposito one
03:28TEttingerI'd like to see your version of a breadth-first search, ddellacosta
03:28bitemyappered: it's brief. You should just do it.
03:28ddellacostabitemyapp: yeah, I'm mostly through learn haskell the hard way, which I've been augmenting with the book you linked too, with occasional forays into "learn you a haskell..." I find that last one kind of overly verbose but there are some good explanations and examples here and there.
03:29ddellacostaTEttinger: okay, will let you know when I'm done!
03:29TEttingeralso, mine is in the link, highlighted
03:29bitemyappddellacosta: that's exactly how I feel about LYAH. Verbose, but has good explanations - works well as a reference.
03:29TEttingerI'm sure ours will diverge just based on my usage of arrays for performance reasons
03:30eredi just can't get through LYAH
03:30eredit feels way too slow for me
03:30ddellacostaered: yeah, that was part of my problem too.
03:30bitemyappered: that's why I recommend the Esposito tutorial...
03:31ddellacostaered: conversely, I find the Esposito one to gloss over some things too much at times, but if you augment it it's great--when I need to I just look something up in one of the many other tutorials or references, and it's perfect.
03:32bitemyappddellacosta: that's a good way of putting it. Haskell Hard & Fast lays out the map, if you need to zoom in - divert to the other resources temporarily.
03:32ddellacostayeah, exactly
03:32bitemyappno reason to plod all the way through LYAH though. It's so stretched thin it's hard to remember what the point of something is.
03:33abaranoskyered: speed reading :)
03:33ddellacostabitemyapp: yeah. For anyone coming from Clojure (or any other functional language I imagine) it's needlessly verbose.
03:35bitemyappabaranosky: LYAH is pretty content-sparse, even speed reading isn't enough.
03:35bitemyappI find people learn Haskell best when they're promptly confronted with what they don't know, and then investigate and probe that thing they don't understand
03:35bitemyappreading a bunch of stuff they vaguely understand won't go very far.
03:36bitemyappddellacosta: now that you've gotten the IoC explanation of monads, I'd like to reel it back and take a more type-oriented approach next time we learn together.
03:36ddellacostabitemyapp: cool.
03:52ddellacostaTEttinger: I didn't realize you were linking to a graph algo above, cool...
03:53TEttingerhaha sorry
03:53TEttingerI use it for pathfinding
03:53TEttingerit actually operates on an array of doubles
03:53TEttinger1d, emulating 2d
03:54abaranoskytesting abaranosky
03:54TEttingerI'm actually going to modify it to find choke points on maps
03:54abaranoskycan someone plz mention me? I'm testing my elisp erc hacking :)
03:54TEttingerabaranosky
03:54TEttingerabaranosky: ping ping
03:54ddellacostaabaranosky: it works...?
03:55abaranoskythanks comrades. that helped
03:55ddellacostaTEttinger: cool, will check it out, just learning dijkstra's algorithm now, so very useful.
03:55ddellacostaabaranosky: anyt ime
03:55ddellacosta*any time
03:58TEttingerbitemyapp: learn the story behind the shibe http://www.theverge.com/2013/12/31/5248762/doge-meme-rescue-dog-wow
03:58cheesusugh
03:59cheesusawful meme
03:59TEttingersuch envy. much fan doge. wow.
03:59bitemyappTEttinger: awesome, thanks :)
04:06TEttingerso is there an equivalent to reset! for transients?
04:06TEttingerI'm rewriting some relatively inefficient atom-based code
04:06TEttinger(yes it's what ddellacosta is reading...)
04:07abaranoskyddellacosta: I think I got my erc notification hook working. :) I'll know if I get you to mention me again.
04:07TEttingerabaranosky!
04:07abaranoskycan you put some text in there?
04:07TEttingerany luck, abaranosky?
04:07bitemyappabaranosky: blahhhhh
04:07amalloyabaranosky, i usually just ask lazybot to mention me if i need to test something
04:07abaranoskynice
04:07amalloy,'amalloy
04:07clojurebotamalloy
04:08TEttinger,"abaranosky is the baron of sky"
04:08clojurebot"abaranosky is the baron of sky"
04:08ddellacostaabaranosky: okay. :-)
04:08abaranoskythat is very regal sounding
04:11TEttingerso can I use set!
04:16sm0kehow do you compare characters in clojure? ## (filter #(< 'A' % 'B') "AbCdEfGh") ; doesnt works
04:16lazybotjava.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number
04:16TEttingergah, it isn't reset, it isn't set...
04:17TEttinger'' is not a string or char
04:17TEttingerchars are \A
04:17sm0keoooh
04:17sm0ke## (filter #(< \A % \B) "AbCdEfGh")
04:17lazybotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number
04:18TEttingerwhat are you trying to do there?
04:18TEttingerthat wouldn't find any letters anyway
04:18abaranoskyI think you can (int \A)
04:18abaranosky,(int \A)
04:18clojurebot65
04:18TEttingeror compare
04:18sm0ke## (filter #(< (int \A) % (int \B)) "AbCdEfGh")
04:18lazybotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number
04:18TEttinger,(compare \A \C)
04:18clojurebot-2
04:18TEttingerA comes before C
04:19abaranoskysm0ke: in Clojure < and > only work with numbers
04:19TEttingerint the % as well
04:19sm0ke## (filter #(< (int \A) % (int \Z)) "AbCdEfGh")
04:19lazybotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number
04:19sm0ke## (filter #(< (int \A) (int %) (int \Z)) "AbCdEfGh")
04:19TEttinger## (filter #(< (int \A) (int %) (int \B)) "AbCdEfGh")
04:19lazybot⇒ (\C \E \G)
04:19lazybot⇒ ()
04:19TEttingerheyyy
04:19sm0ke## (filter #(< (int \A) (int %) (int \Z)) "AbCdEfGh")
04:19lazybot⇒ (\C \E \G)
04:19sm0keyes!!
04:19abaranoskysm0ke TEttinger I'd use compare over the (int \A) approach. Less wonky imo.
04:19TEttingeryep
04:20TEttingeralso, there's .isUpper or a regex
04:20sm0keyes there is regex
04:20sm0kebut why cant i compare chars!
04:20TEttingerbecause encoding
04:20sm0ke,(< "A" "B")
04:20clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>
04:21TEttingersome chars are (this is crazy) two ints
04:21sm0ke,(comapre "A" "B")
04:21clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: comapre in this context, compiling:(NO_SOURCE_PATH:0:0)>
04:21sm0ke,(compare "A" "B")
04:21clojurebot-1
04:21TEttingerwhich is correct, the -1
04:21TEttinger,(sort ["A" " " "B"] )
04:21clojurebot(" " "A" "B")
04:22sm0kei see no reason why comparing is limited to ints
04:22TEttingerwell <> are
04:22sm0kei mean by < >
04:22TEttingerit is odd. I think it's likely a performance thing
04:22sm0kehow does this doesnt makes sense ? ##(< \A \B \C)
04:22lazybotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number
04:23TEttingercompare is probably much slower than < for numbers
04:23amalloyyou say you see no reason, as if that means there is no reason
04:23TEttingersm0ke, here's where it gets tricky
04:23sm0kebleh
04:24amalloyclojure works hard to give you access to the speed and power of the underlying platform
04:24sm0kei dont think clojures aim is to be the fastest language on planet
04:24sm0kebut rather being expressive
04:24amalloyif < did the slow-slow-slow thing that compare does, numeric algorithms in clojure would be much slower
04:24TEttinger,\😸
04:24clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported character: \??>
04:24TEttinger,"😸"
04:24clojurebot"??"
04:24TEttingerit seems like one char, but clojurebot shows 2
04:25TEttingerthat's part of the whole mess of string comparisons
04:25sm0kewth! unicode support is something without which a language is usless imo
04:26TEttingersm0ke, try it on lazybot
04:26TEttingerwhat's more, some encodings put e with hook accent in the first 256 chars. other put it a thousand+ codepoints later
04:26TEttingerVISCII is still in use
04:27TEttinger&"😸"
04:27lazybot⇒ "😸"
04:27TEttingerlazybot can handle the unicode, but it won't treat it as one char. because it kinda is kinda isn't
04:27TEttinger&(map int "😸")
04:27lazybot⇒ (55357 56888)
04:28TEttingerstring handling, especially in java's style of unicode, is very very challenging to do right
04:29TEttingerI think clojure's ability to treat strings as special kinds of seqs is the right way
04:29TEttingerhowever, if you want to do < > comparisons on strings, you can do something like
04:31TEttingererr well actually this method is probably terrible, nvm
04:31TEttingerbut it does result in alphabetized order...
04:36TEttinger,(let [<c #(apply < (mapv int %&))] (filter #(<c \A % \Z) "AbCdEfGh"))
04:36clojurebot(\C \E \G)
04:37abaranoskybitemyapp: I haven't been using my profiles.clj! Reading your setup gave me the kick in the pants to set it up. Should be nice playing with all these libs.
04:38TEttingeroh yeah, my question still stands. bitemyapp, do you know an equivalent to reset! for transients instead of atoms?
04:39bitemyappabaranosky: :) good!
04:40abaranoskybitemyapp: lein-ancient is a nice convenicen to not have to probe clojars manually
04:40bitemyappabaranosky: yap.
04:41abaranoskyanyone tried troncle? https://github.com/coventry/troncle
04:41abaranoskyand does anyone use ritz ?
04:43bitemyappI talked to coventry about Troncle, it's pretty nice but I still use my Emacs macros.
04:45abaranoskybitemyapp: seems like the kind of thing I use my print-foo library for
04:47abaranoskycoventry2: that's annoying troncle.el just sucked down nrepl.el, when I'm on cider
04:49TEttingerI'm just... I have no idea how I should do this. set! and reset! both need things that a transient is not
04:50TEttingerI could maybe use let to rebind it?
04:52TEttingerhttps://gist.github.com/tommyettinger/8206530#file-gistfile1-clj-L22 this line is what needs changing
04:55abaranoskyTEttinger: doseq - https://gist.github.com/tommyettinger/8206530#file-gistfile1-clj-L11
04:56TEttingerright, this is old code, just looking at that line now, cringed
04:57amalloyTEttinger: a transient is "just" a data structure that is allowed to perform mutation for performance reasons; there are no operations that let you perform mutation on it
04:57amalloythis whole thing looks like a loop/recur on open, instead of this while/mutation malarkey
04:58TEttingeryeah, I should probably do that
04:58TEttingerwhen I wrote this I didn't really grasp loop/recur
05:11TEttingeramalloy, good eye, I rewrote as a loop and it seems fine
05:16amalloyTEttinger: i don't know what the algorithm is doing, but https://gist.github.com/amalloy/8206664 seems like more or less what you meant. i suspect it's not quite a perfect translation, though - too much meddling in things i don't understand
05:16amalloyhappy 2014, by the way, #clojure
05:19bitemyappamalloy: happy new year!
05:22abaranoskyhappy new years 2 u as well
05:31ddellacostaamalloy: Happy New Year!
05:36TEttingeramalloy, thank you clojure jeebus. you are the savior of my code.
05:37TEttinger(inc amalloy)
05:37lazybot⇒ 81
05:37amalloyi was close then, TEttinger?
05:37TEttingervery
05:37TEttingerthere were some references to n that needed to be changed to dir
05:37amalloyah
05:38TEttingerother than that, it runs faster and seems not to have the issues of "not going where it should" the other version had
05:38TEttingerI'll put it through its paces now
05:38amalloyalso the other version didn't work at all? on account of trying to reset! a transient?
05:39TEttingeryeah
05:39TEttingerthat's why I highlighted that line
05:39TEttingerI rewrote my own loop/recur
05:39TEttingerthat was the other version that was behaving oddly
05:39amalloyoh, the version that you just wrote. right
05:40amalloyincidentally i suspect my version will be more readable if some of the inner lambdas are lifted out and given names. they don't close over anything important iirc
05:42TEttingerand oh well. there's still a logic bug... I think I found an infinite loop
05:56TEttingeroh my god.
05:56TEttingerdoing this dijkstra debugging was handy
05:57TEttingerbecause it let me track down an infinite loop in an unrelated area, related to dungeon re-gen in case of bad generation the first time
05:57ddellacostaTEttinger: nice.
05:57TEttingerit happened so rarely that I thought it was a memory issue or something
05:57TEttingerbut I knew that the game would lock up forever on rare occasions
06:53Jardahow do I transform a record to map?
08:13gfredericks(into {} the-rec)
08:15hyPiRionA record is a map of sorts already, though
08:16gfredericksclojurebot: A record is a map of sorts already, though
08:16clojurebotc'est bon!
08:21bitemyappddellacosta: do you have a moment?
08:23ddellacostabitemyapp: sure, what's up?
08:24bitemyappddellacosta: want to show you something really clever the type system caught, a mistake I was making.
08:24bitemyappddellacosta: I'm going through the course I linked you.
08:53daGrevis,(= '(1 2 3) `(1 2 ~(+ 1 2)))
08:53clojurebottrue
08:53daGrevisjust learned about macros. guys, i'm blown-away
08:54TEttingerdaGrevis, haha that's a fun snippet
08:55TEttinger&(clojure.string/join " "(repeatedly 2000(fn [](apply str(concat[(rand-nth ["rh""s""z""t""k""ch""n""th""m""p""b""l""g""phth"])](take(+ 2(* 2(rand-int 2)))(interleave(repeatedly #(rand-nth ["a""a""o""e""i""o""au""oi""ou""eo"]))(repeatedly #(rand-nth ["s""p""t""ch""n""m""b""g""st""rst""rt""sp""rk""f""x""sh""ng"]))))[(rand-nth ["os""is""us""um""eum""ium""iam""us""um""es""anes""eros""or""ophon""on""otron"])])))))
08:55lazybot⇒ "motus sirstipanes thoutus thaupouxus loufum boicheotiam leoneorkiam thogoitor souspes boustes berstaurstium zamefis koifobeum kaufum morkoushis seomum mouteros larkiam neosaurkanes meopochanes chitium zoumonum mortoirkum baumes tochotron torstauxus choitaufanes soim... https://www.refheap.com/22367
09:02mnvesdfkl20Hi everyone. I have a question about db connections, does having too many open MongoDB(with the monger lib) lead to too much memory usage? I'm running 3 processes 1."lein ring server" 2."lein repl" and 3."lein cljsbuild auto" and my computer slows to a crawl
09:03mnvesdfkl20* mongodb connections
09:04mullrmnvesdfkl20: I know nothing about mongodb, but I'd start by firing up JVisualVM to see what's going on and go from there
09:08mnvesdfkl20mullr: thanks for the pointer, i'll see what JVisualVM shows
09:08shock_oneHi. Is there a way to put a macro inside another macro call and have the inner one expanded first? Like (macro arg (inner-macro-expanded-first))
09:27blackbear?
09:28blackbearexit
09:28blackbearquit
09:33justin_smithI was going to thell shock_one yeah that is how macros work, but he is gone
09:48mnvesdfkl20mullr: it looks like there's no problem having too many connections. it looks likekons 'lein cljsbuild auto'
09:50mnvesdfkl20,might be the problem, it starts multiple processes
09:50clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: might in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:53dimsuzhey guys. still learining, I can't understand why this code gives 'wrong number of arguments (2) to assoc', can anyone explain? docs say that swap will do 'apply f atom args', so it should be ok, why it isnt? :) http://pastebin.com/iwLHbfKn
09:55AimHeredimsuz, when you pass a variable parameter in like [& args] then args is mapped to a list of all the arguments
09:56AimHereSo you have (assoc atom args) when what you want is (assoc atom arg1 arg2)
09:58AimHereThere's a few ways of dealing with it, One obvious way is to replace assoc with something like #(assoc %1 (first %2) (first %3)) but there are likely neater ways still of doing that
09:58dimsuzAimHere: ah, so 'args' is list. apply expects a vector there and would work (just checked). any way I could convert or unroll that 'args' list? :)
09:59dimsuzyeah, i would like to find a solution which does not rely on how many items is in 'args'
10:00gfredericksdimsuz: you want (apply swap! state assoc args)
10:01mnvesdfkl20mullr: after some experimentation, iv'e found that there's nothing wrong with the processes, only that I need to upgrade my ram, courtesy the jvm
10:02AimHeregfredericks, does apply take more than two arguments?
10:02dimsuzgfredericks: hurray. thanks! that thought floated around, but never touched my mind fully :)
10:08FatalnixAnyone happen to know how I would implement the annotations provided here: http://pastebin.com/n5qKKHxL into clojure?
10:10nmeumis it possible to execute a function n times?
10:11nmeumor to be more specific: I want to read from stdin n times using (read) and get the result as a list
10:13lumafi,(doc repeatedly)
10:13clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
10:16nmeumthanks
10:21gfredericksAimHere: sure does; works great for cases like this one :)
10:32gfredericks,(* 2 19 53)
10:32clojurebot2014
11:10logic_progis there anyway to write an OSX (desktop, not ipad) app in javascript/HTML, using Chrome (rather than safari) as the browser?
11:12logic_progwrong channel
11:12logic_progsorry
11:22dnolenlogic_prog: have you seen node-webkit?
11:22logic_progdnolen: no
11:22logic_progcan I build things that go into the mac app store with node-webkit ?
11:26dnolenlogic_prog: no idea, I would look around there's a mailing list
11:26logic_progdnolen: yeah, https://groups.google.com/forum/#!topic/node-webkit/qP_x9Z0lEO4 seems to suggest "it's doable"
11:27masondesuhappy new year, all
11:43daGrevis,(vec nil)
11:43clojurebot[]
11:43daGrevis,(vec nil nil)
11:43clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/vec>
11:43daGrevis,(vec '(nil))
11:43clojurebot[nil]
12:03augustlsemi on-topic.. Anyone know if there are any C implementations of persistent vectors, sets, hashmaps, etc?
12:06levinmI have [vlad "1.1.0"] in my project.clj. (https://github.com/logaan/vlad). I interpret the documentation at github to say vlad.core is what I should (require). When I do: (require 'vlad.core), I get "FileNotFoundException Could not locate vlad/core__init.class...". However if I do (require 'vlad) that works. Is documentation wrong or am I using it wrong?
12:06Bodilaugustl: https://github.com/chaelim/HAMT if C++ counts.
12:12jkaxI'm trying to extend clojure vectors to build a richer datatype and I find myself writing lots of boilerplate implemenations of the protocols vector already supports. Is there a way to inherit?
12:25augustlBodil: guess it does, tnx :)
12:30ToxicFrogArgh what the hell is this
12:30ToxicFroglein run --a --bunch --of --arguments: works perfectly
12:30ToxicFroglein clean && lein uberjar
12:30ToxicFrogjava -jar target/...jar --a --bunch --of --arguments: silently does nothing
12:31philllDo the lein profiles specify different 'main' classes?
12:31ToxicFrogI have no profiles, just a single :main entry
12:31ToxicFrogAlso, it looks like some of the features work in the jar
12:32ToxicFrogBut this specific one does nothing
12:33ToxicFrogNo error messages or anything, just exits with no output
12:33ToxicFrogI am baffles
12:34justin_smithToxicFrog: does lein run with the production profile work?
12:34ToxicFrogI'm not sure if I should be blaming lein or java or my code here
12:34ToxicFrogjustin_smith: how do I check that? I've never used lein profiles for anything.
12:34justin_smithit could be something does not work without your dev dependencies
12:34justin_smithlein with-profile ...
12:34ToxicFrogI don't have seperate dev and production dependencies, just :dependencies
12:35justin_smithlein profile -dev run --arg --arg
12:35justin_smithno dev profile in your profiles.clj?
12:35justin_smithmake that lein with-profile above of course
12:35ToxicFrogWhere would I find profiles.clj? There's none in the project directory.
12:36justin_smithit is your universal profile for lein projects ~/.lein/profiles.clj
12:36ToxicFrogAha.
12:36justin_smithusually used for things that you want in every repl but not in projects
12:36ToxicFrogNo profiles, just the lein-droid plugin.
12:36ToxicFroglein with-profile -dev run ... says "performing task 'run' with profile 'default'" and then works fine.
12:36justin_smithtry lein with-profile -dev run ...
12:37justin_smithoh o
12:37justin_smithk
12:37ToxicFrogMaybe I should see if there's a more recent lein before spending too much time on this.
12:41ToxicFrogLatest lein. It's still not working.
12:42justin_smithis -main starting a bunch of agents or threads?
12:42ToxicFrogNo. Singlethreaded program.
12:46ToxicFrogHmm
12:46ToxicFrogUpon further investigation, it's generating the right output files
12:46ToxicFrogWhat it's not doing is generating any sort of terminal output
12:55ToxicFrogAha!
12:55ToxicFrogjustin_smith: so, in the uberjar, (println) works, (printf) does not.
12:55justin_smithweird
12:57justin_smithtry adding calls to (flush)
12:58justin_smithprintln calls prn which calls flush
12:58justin_smithprintf calls print, which calls pr, which does not call flush
13:04ToxicFrogjustin_smith: all the printfs end with \n, I'm used to this stuff being line buffered
13:05ToxicFrogI have had issues in the past with stuff on the JVM not flushing when it should (or in some cases not flushing at all ever and the buffers being silently discarded at program exit!)
13:06lsdafjklsdis there something in clojure where I want a namespace to export just 1 function, and it is imported automatically when I require it? Like (:require [app.header :as header]), and then in my code I can run the fn like (header) ?
13:07justin_smithabsolutely not
13:07philllbut (:require [app.header :refer [header]])
13:08hyPiRionlsdafjklsd: what do you mean by "imported automatically"?
13:08justin_smithlsdafjklsd: one of the central ideas behind namespaces is that you don't get anything inserted into the requiring namespace that you did not explicitly ask for in the requiring namespace
13:09hyPiRionyou could probably do (:require [app.header :refer [my-func] :rename {my-func header}]), but I'm not sure what it would give you
13:09lsdafjklsdhyPiRion: Just thinking of node.js where I can export one function and require it like 'header = require('./header')'
13:09hyPiRionHm, not used node.js, so I'm not sure if there's any equivalent in Clojure
13:10lsdafjklsdit's no biggie, was just wondering.
13:10lsdafjklsdthanks :)
13:10ToxicFrogjustin_smith: ok, if I explicitly (flush) just before program exit, all the output appears.
13:10justin_smithToxicFrog: cool
13:11justin_smithToxicFrog: for future reference I figured it out by looking at (source printf) (source println) and then looking at source of the things they each called
13:13ToxicFrogjustin_smith: it looks like System.out can be created either with autoflushing enabled or disabled. I wonder if 'lein' creates it with it enabled and 'java' creates it with it disabled or something.
13:14pyrtsa,(doc *flush-on-newline*)
13:14clojurebot"; When set to true, output will be flushed whenever a newline is printed. Defaults to true."
13:15justin_smithpyrtsa: that is used by prn
13:15justin_smithbut it is not even referenced by pr
13:15justin_smithso printf does not hit that var
13:15pyrtsaAh, right. So printf ignores it. Never mind. :)
13:17ToxicFrogBlargh.
13:17ToxicFrogI'm going to have to wrap printf or something.
13:18ToxicFrogI do want these messages flushed as soon as they're written, since they're progress reports for a long-running operation
13:19pyrtsaWhy not just something like (defn writef [& args] (apply printf args) (flush))?
13:19ToxicFrogWell, yes, that's what I'm going to end up doing most likely
13:19ToxicFrogA shame that it's necessary, though
13:20pyrtsaI'd say buffering by default is a win in the bigger perspective. It's not always that you want to flush every 30 characters or so.
13:21ToxicFrogHistorically, the behaviour for stuff connected to a terminal has been to line buffer
13:22ToxicFrogAggravatingly, the autoflush property on System.out can only be set at creation time
13:37jajajaNewb question. What is approx. JVM memory footprint for a basic Clojure web app?
13:37jajajaSingle-threaded
13:45seangrovednolen: Working with om, few questions. Typically, where should om/transact!, om/update! happen? Also, does it matter if the initial app-state is passed in as an atom or an immutable data-structure? It seems both are wrapped in a Cursor anyway.
13:50dnolenseangrove: if you give om.core/root an atom then you can build multiple React root components off it that will stay in sync.
13:50dnolenseangrove: om.core/transact! and om.core/update! should generally be called from event handlers, i.e. stuff outside the render phase.
13:50dnolenseangrove: updating the app-state from inside the render phrase doesn't make sense
13:53seangrovednolen: And it loots like (om/set-state! owner :key val) doesn't immediately set the state - it's presumably slated as a pending state value?
13:54dnolenseangrove: yes existing issue for that, there should be a way to read the pending state.
13:55seangrovednolen: So when you set :comm here https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L133, will render see it on the first render call here https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L152 ?
13:56dnolenseangrove: yes because that's done before IWillUpdate when pending state gets merged in
13:56dnolenseangrove: I really recommend just reading the source for Pure in om.core
13:57dnolenseangrove: there's not much there and it clarifies when things happen.
13:57seangrovednolen: I have several tabs open on the om source, definitely going through it
13:57seangroveI'll check out Pure specifically
13:59bitemyappseangrove: exciting stuff eh?
13:59seangrovebitemyapp: Yeah, has a lot of potential
14:00bitemyappseangrove: I'm neck-deep in some Haskell. Been thinking about tinkering with a Fay wrapper for React if I find occasion to do frontend.
14:00seangroveWow, that could be pretty cool indeed
14:07bitemyappseangrove: of particular interest to me is that registering callbacks could be respun as monadic binds.
14:07bitemyappseangrove: http://www.yesodweb.com/blog/2012/10/yesod-fay-js Skip down to the Fay section.
14:07bitemyappPurdy *_*
14:32gfredericksI did not know about this new clojure.api.API
14:40justin_smithgfredericks: got a link? not finding it in the github repo for clojure/clojure
14:40justin_smithnever mind, just found it
14:41gfredericksjustin_smith: I was reading the 1.6 changelog, which has a lot of examples
14:41justin_smithcool, yeah, I should have expected it to be a java file
15:19gfredericks,(map #(/ 1.0 %) [0.0 -0.0])
15:19clojurebot(Infinity -Infinity)
15:43coventryWhat should I read to get a rough idea of what an om cursor represents?
15:44seangrovecoventry: Best I can tell, this line: https://github.com/swannodette/om/blob/master/src/om/core.cljs#L274
15:47coventryThanks, so roughly speaking it's the DOM tree and a pointer to a path down that tree?
15:48coventrys/a pointer to// I guess.
16:31seangrovednolen: https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L128 app should be a MapCursor, but will todos just be a normal vector, or a vector wrapped in a cursor as well?
16:34pandeiroi tried to output marginalia docs for om today, didn't work, but fortunately the fix was easy
16:34pandeiroi sent in a pr; hopefully om will be `lein marg`able soon, b/c the src is well documented
16:57thesebdoes targeting the JVM automatically solve the age old problem of new languages not having decent documented libraries?...seems that's a HUGE advantage for clojure and scala
16:58justin_smiththeseb: interop is so easy that we have a huge number of documented libraries, that are written in java
16:59thesebjustin_smith: is it so transparent that they appear to be written in clojure? if so that is amazing...the only downside i can see is you are forced to have all same APIs as Java stdlib....assuming that is pretty good clojure is all set
17:00lsdafjklsddnolen: hey man, I'm trying to get routing to work with secretary, but the route only fires on page load, not when the hash changes but I can't figure out why... Following the code on todo MVC, does anything stand out? https://gist.github.com/lsdafjklsd/8211908
17:00justin_smiththeseb: no, they don't appear to be written in clojure, but they are very easy to use from clojure
17:01justin_smith,(.length "hello")
17:01thesebjustin_smith: thanks..is there no way to somehow wrap the java libraries so they appear to be clojure libraries?
17:01clojurebot5
17:01justin_smiththeseb: if you really want to, usually there is no need
17:01justin_smithbut it is done
17:01justin_smith,(Object.)
17:01clojurebot#<Object java.lang.Object@1d6aae>
17:02justin_smithinterop is mostly very easy
17:02thesebjustin_smith: ok thanks
17:04danlentzDoes AutoDoc actually still work? Is there a current howto that might help me get it going?
17:06danlentzor, more specifically, does anyone have any pointers on the errer Error: Could not find or load main class autodoc.autodoc
17:06danlentzis it something I'm being stiupid not to know?
17:07justin_smithdanlentz: how are you resolving the autodoc dependency?
17:07danlentzwell i did mvn install
17:07danlentzis that not the weay?
17:07justin_smithOK, how did you tell clojure where that was?
17:08danlentzclearly not i guess
17:08justin_smithare you using lein? I think you should be if you aren't
17:08danlentzyes i normally do
17:08justin_smithif so, you can add autodoc as a dep in project.clj, and lein takes care of the rest
17:08danlentzso lein autodoc should do it?
17:08justin_smithmvn install makes things available to lein without a download, but does not automatically make them visible to a project
17:08justin_smithno
17:09justin_smithyou add autodoc to your dependencies
17:09danlentzok
17:09danlentzfigured it was something stupid
17:09danlentzthks
17:09justin_smithnot stupid, it is a common entry level mistake
17:10justin_smithother languages don't handle dependencies / libraries the way clojure does, nothing to be ashamed of not knowing
17:10danlentzy there every so often occurs a situation where it would be quite helpful if I had better Java exp
17:12gdevdanlentz, that may be true, but the tradeoff is you would've had to spend all that time using Java =/
17:12gdevstubbing your toes every now and then is way less painful than trying to get Java exp
17:13justin_smithdanlentz: looking again, you should be able to use autodoc as a standalone
17:13justin_smithdanlentz: I thought it was a library you would use in your project, but it looks more like a tool you run against your repo
17:14justin_smithhttp://tomfaulhaber.github.io/autodoc/ Now I see
17:14justin_smithgo to the above link, search for lein-autodoc
17:14justin_smithit shows how to get the lein-autodoc plugin and run it
17:34lsdafjklsdanyone else run into issues with clojure.browser.repl breaking client side routing?
17:38pandeirolsdafjklsd: i was having issues w/ that too, didn't investigate yet
17:38pandeiroseems weird that browser.repl would interfere though
17:38lsdafjklsdyea, im debating weather to open an issue on austin
17:38lsdafjklsdtrying vanilla js
17:39lsdafjklsdinstead of the good history
17:39pandeirolsdafjklsd: do you know where to find externs for react 0.8.0?
17:41lsdafjklsdpandeiro: hmm no I had them at some point... just working with no optimization
17:43lsdafjklsdpandeiro: actually, just go to the .m2 directory
17:44lsdafjklsdpandeiro: com/facebook and unzip the jar, there is an externs file in there
17:44marcopolo`anyone have any jclouds experience? I think it's silly I need core.incubator to run one of their examples
17:45marcopolo`lsdafjklsd: what browser are you using?
17:45lsdafjklsdmarcopolo`: chrome
17:45marcopolo`lsdafjklsd: do you have a minimal project that reproduces that?
17:45marcopolo`I wonder why that would happen
17:45marcopolo`does it happen in ff?
17:46lsdafjklsdmarcopolo`: I'm not sure, does austin work with FF?
17:46lsdafjklsdmarcopolo`: I can put the thing im working on in git if you're curious
17:48pandeirolsdafjklsd: nice one thanks
17:48danlentzjustin_smith: got it. much appreciated
17:48pandeiroi noticed om is pulling react in as a jar, but the examples don't use it...
17:48justin_smithdanlentz: cool
17:49marcopolo`lsdafjklsd: It should work with ff; I've always had better luck with the brepl on ff
17:49marcopolo`pandeiro: Om, I believe, is built on top of react
17:50lsdafjklsdmarcopolo`: here is the code if you want to take a quick look https://github.com/lsdafjklsd/puree
17:50lsdafjklsdmarcopolo`: it's basically nothing except a playground
17:50lsdafjklsdhow do I use it with FF?
17:51lsdafjklsdI'd much rather develop in chrome though :(
17:52pandeirolsdafjklsd: where are you connecting in your cljs code?
17:53lsdafjklsdpandeiro: huh?
17:53pandeiroyou pulled clojure.browser.repl into your core ns right?
17:53lsdafjklsdya
17:53lsdafjklsdin src/cljs
17:53pandeiroright, and where are you connecting?
17:54lsdafjklsdwell, some work get's done in src/clj/puree.core
17:54lsdafjklsdthen I launch lein repl, (run)
17:54juxovechi there, I have a dilemma. I develop small library usable in 2 projects. now I sync source codes between projects. of course it would be much better to put clojar to project.clj file. but how can I edit source code of my shared library directly in project folder?
17:54pandeiroyou need to (clojure.browser.repl/connect "http://localhost:9000/repl&quot;) somewhere, is what i am saying
17:54marcopolo`pandeiro: austin is being injected in src/clj/puree.core
17:55lsdafjklsdty marc
17:55marcopolo`pandeiro: here: https://github.com/lsdafjklsd/puree/blob/master/src/clj/puree/core.clj#L18
17:55pandeirolsdafjklsd: (the above sexp is cljs, obviously)
17:55pandeirocljs
17:55pandeirothe client needs to connect to the browser repl server
17:56lsdafjklsdyea, enlive appends the script tag in the index.html
17:56lsdafjklsd (enlive/html [:script (browser-connected-repl-js)])
17:56marcopolo`juxovec: I think lein checkouts might be what you are looking for
17:57juxovecthanks I will check it out :)
17:57lsdafjklsdpandeiro: is this not how you do it?
17:57lsdafjklsdpandeiro: I just followed the austin example
17:57marcopolo`lsdafjklsd: That's how you would normally do it without austing
17:58marcopolo`you can still do it that way, but austin changes ports more frequently. So you'd have to update your code accordingly
17:58marcopolo`I'm not a fan of having a webserver just to tell the client how to connect to the brepl though :/
17:58pandeirolsdafjklsd: sorry i don't know austin, i just normally connect manually in the cljs code itself
17:58pandeiroit seems like what you are doing would work, if austin is set up correctly
17:59pandeirodoes it make the xhr request to localhost:9000/repl? in the browser console?
17:59marcopolo`lsdafjklsd: have you been able to connect to the brepl at all?
17:59lsdafjklsdyea it all works fine
17:59lsdafjklsdjust breaks routing
18:00lsdafjklsdhttps://github.com/cemerick/austin/tree/master/browser-connected-repl-sample
18:00lsdafjklsdI just modified this... :P
18:03marcopolo`so routing works without the brepl?
18:07lsdafjklsdyea when I comment out [clojure.browser.repl] it all works
18:09marcopolo`I don't think you need to require clojure.browser.repl, do you?
18:13lsdafjklsdyea, but I don tknow why
18:13lsdafjklsdwhat's this I hear about CLJS having it's own brepl?
18:13lsdafjklsdis austin even necessary
18:13coventryIs `(swap! state# #(~f % ~@args)) faster in clojurescript than `(swap! state# ~f ~@args)? (Wondering about this: https://github.com/swannodette/om/blob/master/src/om/core.clj#L40)
18:16bbloomcoventry: 1) i wouldn't assume that's intentional
18:18bbloomcoventry: 2) the presence of the function actually changes the semantics of that macro slightly... if the path is empty, then the args will be evaluated during the swap, rather than before it. which probably doesn't matter in cljs, b/c there are no threads to synchronize atoms with, nor any reason to retry a swap or anything like that
18:20coventryAh, OK. Thanks.
18:20pandeirolsdafjklsd: i don't think you need to worry about austin if you just use `lein trampoline cljsbuild repl-listen` and then include clojure.browser.repl/connect call somewhere in your cljs
18:20lsdafjklsdpandeiro: cool, i'll look into that
18:21pandeirolsdafjklsd: fwict using austin would be mostly if you wanted to connect to the browser repl via nrepl
18:22pandeirowhich did not work in the original browser repl
18:22lsdafjklsdpandeiro: the pro there being editor support?
18:22lsdafjklsdpandeiro: I just use the repl from the command line
18:27justin_smithlsdafjklsd: how barbaric! I bet you eat with your hands too
18:27justin_smith:)
18:27lsdafjklsdholy crap
18:27lsdafjklsdlol
18:28justin_smithjust kidding
18:28lsdafjklsdI know, I laughed haha
18:28lsdafjklsdneed to look into fireside though
18:28lsdafjklsdfireplace*
18:30coventryWow the om todomvc git repository is enormous (33 MB).
18:32pandeirolsdafjklsd: yeah basically editor support imo; dunno, maybe there are other reasons
18:33marcopolo`fireside sounds a little nicer
18:34marcopolo`come, sit, let's chat for a bit... fireside
18:34justin_smithmarcopolo`: do you know the history of the name?
18:35justin_smithhttps://github.com/tpope/vim-foreplay
18:37coventryWhere should I look to understand clojurescript's #js? I roughly get what it's doing, just want to nail it down.
18:38pandeirocoventry: cljs.tagged-literals
18:38coventrypandeiro: Thanks.
18:39pandeironp
19:18marcopolo`justin_smith: yeah :)
19:19radsdnolen: with the new om that has the cursor checks in it, is it possible to pass a child map from a cursor to an event handler as raw data, not a cursor?
19:20radsbefore the update I had a child map that would change as a whole, so there's no need for it to throw an error when checking one of its properties. it seems like the simplest workaround would be to make a new defrecord for the child
19:25radslooks like (into {} cursor) works as long as the map is only one level
19:40radsmy workaround using a defrecord instead of a regular map doesn't work since (map? (MyRecord.)) is true
19:43radsit seems like there should be a way to say "this is an opaque data structure, not part of the reactive stuff", otherwise you have to create new maps every time you want to use the data structure stored as part of the ui state
20:28necronianlmao
20:53devnhi everyone
20:55justin_smithhello
21:00jleclancheany advice on a good clojure book for someone with a strong python/lua/c++ background?
21:00justin_smiththe orielly clojure programming book
21:00justin_smithhttp://shop.oreilly.com/product/0636920013754.do
21:01jleclancheaight
21:07devnjleclanche: you can also check out tbaldridge's https://github.com/halgari/clojure-py
21:07devnit's not a book, just source, but it might help you reason about the more java-ey things
21:10coventryDo you know anyone who's taken that approach to learning clojure? It sounds really inefficient.
21:13seangrovecoventry: Yeah, I think the traditional 4clojure/hack on projects is probably a better way to go
21:16akurilinMan, does anybody else miss a composable if statement in other languages?
21:17akurilinFeeling pretty spoiled by clojure.
21:17justin_smithakurilin: clearly because what they wanted was a composible if *expression
21:18justin_smithand they don't understand expressions I guess?
21:19coventryA lot of languages have ternary expressions, which is what I think of when I think about the composability of (if). http://en.wikipedia.org/wiki/%3F:
21:19akurilinIt's surprisingly hard to imagine a better world if you've never got a taste of something like Clojure
21:21akurilincoventry: that's true, I guess that covers 80% of the cases where you need only two branches.
21:22akurilinI think you should be able to compose the ternary operator arbitrarily deep, not that it would be at all readable.
21:24devncoventry: are you talking to me?
21:24coventryI was, yeah.
21:24devnRE: "anyone who has taken that approach"
21:25devni have used things like that to help me here and there. i didn't have a lot of java experience. i remember feeling like reading clojure-py was a little bit easier for me to grok initially
21:26devnactually what i should say is that, when it came around, it was a nice way for me to A/B between java and python. having an additional perspective was nice. same thing goes for clojurescript.
21:27devndifferent perspectives, implementations, not always feature complete, but at least another way of looking at what is /mostly/ the same thing
21:28devncoventry: so to answer your question, i don't know anyone who has picked up clojure-py alone, but it is enlightening and a fair bit better to read than Java
21:28devnclojure by using clojure-py*
21:28coventryOh, I bet it's better than reading the clojure java sources, yeah. :-)
21:29coventry(Actually, they're not hard to read, just messily formatted.)
21:37bitemyappakurilin: I miss being able to write conditions without macros when I use Clojure :P
21:38bitemyappconditionals*
21:43ksauaIs there a function that takes n sequences which are all m long and returns m sequences which are n long where the first sequence contains the first elements from each sequence? (this-func [1 2 3] [4 5 6] [7 8 9]) => [[1 4 7] [2 5 8] [3 6 9]] ?
21:43mullrksaua: like a matrix transpose?
21:44ksauasure, that'd work
21:44mullrdon't know if it would work, but http://stackoverflow.com/questions/10347315/matrix-transposition-in-clojure
21:44justin_smith,(map vector [1 2 3] [4 5 6] [7 8 9])
21:44clojurebot([1 4 7] [2 5 8] [3 6 9])
21:44justin_smith,(mapv vector [1 2 3] [4 5 6] [7 8 9])
21:44clojurebot[[1 4 7] [2 5 8] [3 6 9]]
21:45ksauanice, thanks, that works
21:45justin_smith(the latter if you needed the enclosing thing to be a non-lazy vector too)
21:48akurilinbitemyapp: please explain.
22:10bitemyappakurilin: non-strict languages eliminate the necessity of macros where you just want a function that doesn't force eval of its arguments.
22:11bitemyapp$seen noprompt
22:11lazybotnoprompt was last seen quitting 5 days and 18 hours ago.
22:24arrdembitemyapp: http://i.imgur.com/KNltlZW.jpg
22:34bitemyapparrdem: :)
22:34coventry"Stay testy, my friends."
22:35bitemyapp(inc coventry)
22:35lazybot⇒ 6
22:35bitemyapparrdem: cntext>
22:36zerokarmalefthow are constructors for static inner classes invoked via interop?
22:37zerokarmaleft(SomeClass$InnerClass. args)?
22:41coventryzerokarmaleft: http://stackoverflow.com/a/7140967/1941213
22:43zerokarmaleftcoventry: thanks, that covers it
22:46arrdembitemyapp: writing tests for my processor simulators
22:46TEttinger$karma zerokarmaleft
22:46lazybotzerokarmaleft has karma 0.
22:46TEttingerindeed
22:46arrdembitemyapp: the single cycle simulator is blatantly correct, but the other more interesting sims (some of which I still have to write) have interesting internal issues
22:52akurilinbitemyapp: ah interesting, never heard that term before, had to wikipedia for it.
22:52akurilinbitemyapp: does that actually make a big difference in practice in everyday work? I don't quite know how to relate to that since I've never worked in that paradigm.
22:55marcopolo`(karma zerokarmaleft)
22:56justin_smith$karma zerokarmaleft
22:56lazybotzerokarmaleft has karma 0.
22:56marcopolo`(inc zerokarmaleft)
22:56lazybot⇒ 1
22:56marcopolo`not anymore :P
22:57arrdem(dec zerokarmaleft) ;; ballance must be maintained
22:57lazybot⇒ 0
23:00bitemyappakurilin: non-strictness makes me so happy on a regular basis. and TCO.
23:01bitemyappakurilin: about half of the Haskellers I know would react to a "Haskell goes strict" announcement by hoisting the black flag and slitting throats.
23:02akurilinInteresting.
23:02coventryI had no idea Haskellers could be such a nasty bunch. :-)
23:02akurilinEvery interesting tech person I know seems to either already know Haskell or has had Haskell on their todo list for a while :P
23:03arrdembitemyapp: haha haskell mod lazy would be just a typechecked lisp :/
23:04bitemyapparrdem: it'd be better than that you bastard.
23:05arrdembitemyapp: still not doing work? it's duck dynasty time again and I'm hiding
23:05bitemyapparrdem: frick.
23:05bitemyapparrdem: doters?
23:05arrdembitemyapp: anything that isn't this :P
23:05bitemyappOkay.
23:08devnhaskellites
23:10devni love 'em, but i grow tired. typed urls! yeah! the solution to all of my problems!
23:10gtrakthe hindley-milner internet
23:11seancorfieldhmm, who did a presentation recently that said H-M was one of the worst things ever?
23:12scottjseancorfield: gilad bracha
23:12seancorfieldah yes, that was it!
23:14coventryThe only possible explanation for that is that he's a willful ignoramus with no understanding of programming language design. :-)
23:15danlentzsomebody talking about me? :)
23:16seancorfield"Deconstructing Functional Programming"... that was the talk...
23:16seancorfieldhttp://www.infoq.com/presentations/functional-pros-cons
23:17danlentzbecause anyone can see i'm not a will full ignoramus. i am just an ignoramus byn default
23:21danlentzis anyone aware of a means to limit the scope ofautodoc to only a set of public api?
23:21danlentzor at least separate the public from internal symbols?
23:22danlentzby namespace only i think
23:23devndanlentz: i thought it only showed publics by default?
23:33seancorfieldyeah, there's some metadata you can add to tell it to ignore vars
23:34seancorfieldcan't remember off the top of my head
23:34seancorfieldskip-wiki
23:34seancorfieldhttp://tomfaulhaber.github.io/autodoc/
23:35rlbdid clojure.java.shell/sh change its behavior from 1.2 to 1.5?
23:35rlbIn a project I'm getting 'No value supplied for key: {"LD_LIBRARY_PATH" "..."}', but from a 1.5 prompt, it's fine
23:35rlb.
23:36rlb(the same command is fine)
23:36rlbThe project I'm poking at was on 1.2 (hence my suspicion).
23:36rlbsorry -- was on "1.4.0" rather
23:45marcopolo`Clojure just blew my mind... again
23:45gtrakseancorfield: fun bracha talk
23:45marcopolo`I found the proxy macro thing
23:48TEttingerproxy is neat
23:49gtrak'Once you understand monads, you immediately become incapable of explaining them to anyone else'
23:50TEttingercomonoid endofunctor category of *head explodes*
23:56marcopolo`Here's a question: let's say the class I'm using doesn't have a public constructor. Instead it has a method that calls it's private constr. How can make that work with proxy?
23:58warzno public constructor?
23:58marcopolo`nope, just a public method that calls the public constructor
23:59TEttingerlike a factory?