#clojure log - Jan 01 2014

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

0:00 KeithPM: Right...

0:01 justin_smith: there is even this popular sneaky trick: ##(let [a 0 _ (println a) b 1] (* 3 b))

0:01 lazybot: ⇒ 0 3

0:01 justin_smith: _ being a conventional name for a thing you are using in a binding place, but the value is ignored

0:02 that 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

0:05 johnwalkergh: happy new year

0:05 binski: :D

0:07 KeithPM: Let destructuring... Cool stuff!!! I read up the special forms in the docs. Sooo much good stuff :)

0:08 Hey 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

0:08 Thanks everyone... It's a struggle, but I think clojure is so worth the effort!!!!

0:09 justin_smith: destructuring is another thing, works in function args, let bindings, doeseq and for bindings...

0:09 TEttinger: KeithPM 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

0:10 justin_smith: KeithPM: agreed, definitely worth the effort, a marvelous language

0:10 TEttinger: the way you can manipulate data in clojure is really fantastic

0:11 KeithPM: Yes, so empowering, you get so much done with so little

0:12 justin_smith: and 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

0:12 KeithPM: Absolutely. I love that if I can't figure the whole thing out, I could work out little pieces and compose them.

0:13 And 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

0:14 justin_smith: I was thinking of perl

0:14 which is concise and expressive in a much different way

0:16 TEttinger: APL is concise but I wouldn't think of it as expressive

0:17 justin_smith: yeah, maybe not so much the "expressive" part with perl either actually

0:18 KeithPM: Yes, 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.

0:18 justin_smith: agreed, in my experience so far that is true

0:19 as long as you don't need low memory usage or quick start up time, clojure's your guy

0:19 TEttinger: in 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.

0:20 KeithPM: Yes... a matrix of as many dimensions as your brain could keep track of :)

0:20 TEttinger: KeithPM, heh

0:21 I prefer to use 1D arrays in clojure when I need speed, even for 2D data (using the (mod idx width) trick)

0:23 KeithPM: Oh I understand, that's like the C array... A one D that you could shape to your heart's desire

0:25 brandon`: is clojure's macro system closer to common lisps' than scheme's?

0:25 amalloy: yes

0:33 UltimateEyePatch: brandon`, I was asking this today and they refused to answer me

0:33 Because they think I'm troll, they can hunt for I can take it

0:33 As I'm the hero clojure deserive,s but not the one it needs right now

1:22 bitemyapp: ucb: !!!

1:22 ucb: happy new year, have some fucking black metal! http://www.youtube.com/watch?v=aIQgwFcush0

1:23 ucb: http://www.youtube.com/watch?v=hzMeU8tuvNE and something not black metal!

1:24 TEttinger: that's a pretty good trick.

1:24 TEttinger: mod and quot by width man, all you really need

1:25 bitemyapp: TEttinger: is that adaptable to three dimensions?

1:25 TEttinger: I think so. it may be multiple calls

1:25 think of 3d tic-tac-toe

1:31 justin_smith: I was just playing with conch, and it makes it easy to treat an arbitrary shell command as a lazy-seq of lines

1:31 which has some really nice potential

1:32 bitemyapp: Raynes: ^^ he likes your milkshakes.

1:33 abaranosky: mmmm, milkshakes

1:33 bitemyapp: abaranosky: hey man! Happy New Year :)

1:33 abaranosky: bitemyapp: happy new year to you as well :)

1:33 bitemyapp: abaranosky: 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.

1:33 abaranosky: happy new year all of you guys too :)

1:33 justin_smith: (inc Raynes)

1:33 lazybot: ⇒ 40

1:34 abaranosky: just had to google Yesod. Cool. I'm looking forward to making some real application in Haskell sometime

1:35 bitemyapp: abaranosky: been futzing around with a Haskellization of Frak with noprompt.

1:35 abaranosky: I'm tinkering with Simonides at the moment.

1:36 abaranosky: bitemyapp: I'm looking through your public activity on Github at the moment.

1:37 bitemyapp: abaranosky: Simonides isn't public yet :(

1:37 the original Clojure repo was private and I haven't pushed my Haskell experimentations.

1:37 abaranosky: bitemyapp: other than working on a private project of mine, I've been doing abunch of elisp lately

1:38 I'm definitely succombing to the Emacs addiction, severely

1:38 bitemyapp: abaranosky: most of my public activity will probably be Berossus, which is actually a work project.

1:38 abaranosky: making that Yak nice and bald?

1:39 abaranosky: bitemyapp: I'd like to even contrbute to cider and stuff... It's a yak, but a really important one to the community

1:39 justin_smith: is there such thing as yak-electrolysis?

1:39 abaranosky: I've done a little work on clj-refactor too

1:39 justin_smith: there is now!

1:39 bitemyapp: justin_smith: good idea.

1:39 abaranosky: that's intriguing - what's the idea there?

1:39 abaranosky: just add it to the URban Disctionary

1:40 bitemyapp: cider, or clj-refactor?

1:40 bitemyapp: abaranosky: clj-refactor

1:40 abaranosky: how would that even work? heuristics and prayers?

1:41 part 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.

1:41 especially surrounding REST and content negotiation.

1:42 abaranosky: bitemyapp: 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

1:43 To do more interesting things it needs a nrepl conneciton and analyzer.

1:43 bitemyapp: abaranosky: that's still very cool :)

1:43 abaranosky: I really like reading elisp projects like those though, because I'm learning a lot

1:44 For example, trying to setup my erc right now to notify me when I'm mentioned, or get a private message

1:45 bitemyapp: re: Yesod, I'd really need to see some example code to make what you're saying more concrete

1:45 bitemyapp: abaranosky: http://www.yesodweb.com/book/restful-content

1:45 abaranosky: I changed the way I was doing my Ring handlers.

1:45 abaranosky: they all return maps with a template name and the actual data.

1:46 abaranosky: then content negotiation decides whether you get a rendered HTML template with the injected context, a straight-up Clojure map, or JSON.

1:46 abaranosky: makes your handlers highly testable too.

1:46 abaranosky: how were you doing them before?

1:48 bitemyapp: abaranosky: just directly rendering HTML or JSON or something.

1:48 which is how I've seen most other people do it - having separate JSON and HTML handlers. No need for it though.

1:48 your web app is the API.

1:49 abaranosky: 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

1:49 abaranosky: bitemyapp: 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

1:50 if 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

1:53 bitemyapp: abaranosky: it's not just for the various content types

1:54 abaranosky: it's for easy debugging and testing.

1:54 abaranosky: bitemyapp: 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

1:54 bitemyapp: because then I can treat my handlers like vanilla Clojure or Haskell functions.

1:54 abaranosky: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj#L32-L51

1:55 abaranosky: bitemyapp: cool, I just learned you can do #L32-L51 in github

1:55 bitemyapp: abaranosky: 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.

1:55 abaranosky: bitemyapp: nice, great minds think alike they say

1:55 bitemyapp: grump grump grump

1:56 abaranosky: 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.

1:56 abaranosky: basically, keep everything as data as long as possible... it's the best way to do everything in Clojure

1:56 frameworks stink

1:56 bitemyapp: I'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.

1:56 abaranosky: I haven't messed with liberator enough

1:57 bitemyapp: abaranosky: 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.

1:57 abaranosky: the solution might just be that liberator needs to have its design put to the decoupling / flexibility challenge

1:57 bitemyapp: abaranosky: and I know many experienced Haskell users who are happy using Yesod and Snap (also a framework)

1:57 abaranosky: 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.

1:58 abaranosky: bitemyapp: oh, I"m all for copying the patterns that seem to work "ok" when learning the ropes... It's the only way really.

1:58 bitemyapp: AOP / alter-var-root / robert.hooke - that sort of thing.

1:58 abaranosky: That's why I'd like to hack in Haskell with someone who knows better, like yourself

1:58 bitemyapp: abaranosky: well it's that or make a lot of silly mistakes while groping blindly around in WAI land.

1:58 WAI is roughly equivalent to Ring.

1:58 the reason I'm using Yesod is that Snap and Happstack haven't fully embraced WAI yet.

1:59 they're older, which is part of the reason.

1:59 abaranosky: these are all very new and funny words to me

1:59 ;)

1:59 there is one Ring to rul them all.... don't need those other ones

1:59 bitemyapp: abaranosky: 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.

2:00 abaranosky: good, then you won't know so much that my relative ignorance drives you nuts

2:00 bitemyapp: Also I am wired for fucking sound. Perhaps drinking a whole pot of moka espresso wasn't a good idea.

2:00 abaranosky: I've written one 100 line Haskell application to read files and sort and output them to txt files.

2:00 bitemyapp: abaranosky: Haskell happens to be exceptional at unixy things like that.

2:00 abaranosky: ... its a code puule from from an old job of mine

2:01 bitemyapp: puule?

2:01 abaranosky: oh, sorry. "puzzle"

2:02 bitemyapp: ah okay.

2:05 abaranosky: 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.

2:05 abaranosky: the templates get type-checked as part of the build. lol.

2:05 the 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.

2:05 so I'm trying to get a feel for whether or not the added hotness is worth using the framework atm.

2:06 abaranosky: bitemyapp: 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

2:06 ... not saying one way or the other... just not sure if it will legitimately make me more productive

2:06 bitemyapp: abaranosky: it's pretty lightweight from what I'm experiencing so far.

2:06 abaranosky: at the end of the day I want my programmign language to make me faster

2:07 bitemyapp: or at least on the template/URLs side it is.

2:07 but he's using macros and other things to hide the boilerplate :)

2:07 abaranosky: yeah, not so sure about macros in Haskell :\

2:07 bitemyapp: abaranosky: http://www.yesodweb.com/book/shakespearean-templates

2:07 abaranosky: the macros in Haskell are similar to the ones in Lisp. You get an AST and return an AST.

2:07 abaranosky: I need more experience.

2:08 bitemyapp: abaranosky: take a quick look at the examples in that link.

2:08 abaranosky: interesting, so they're not horrific

2:08 bitemyapp: yeah, I can smell color now. That was too much coffee.

2:08 TEttinger: I want to smell color

2:09 abaranosky: bitemyapp: any good links on haskell's macros?

2:10 bitemyapp: abaranosky: just the Template Haskell tutorials.

2:10 I don't know of a particularly good one, the ones I found through googling seemed fine to me.

2:11 ucb: annnnd uhhhh http://morthylla.bandcamp.com/album/morthylla

2:11 also R is an obnoxious language.

2:12 abaranosky: an obnoxious language for those obnoxious, smug Data Science weenies

2:12 ^^^ I"m kidding ;)

2:12 ... seriously, the machine learning guys at work make good use of R

2:13 bitemyapp: abaranosky: 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.

2:13 abaranosky: but as a developer, I don't like it so much

2:13 bitemyapp: I get that R is effective, but it's really not superior to Clojure or Haskell for me.

2:13 it's also got a filthy and terrible notion of how package management should work.

2:13 abaranosky: Haskell isn't your ideal ML language is it? I have yet to meet a data guy who mentioned using Haskell for their work

2:14 bitemyapp: you are correct R is *not* a good langueg imo... just an easy/convenient one

2:14 bitemyapp: yeah, good way of putting it.

2:14 abaranosky: uh, depends on the problem. Clojure has nice tools for some things, Haskell has better ones for others.

2:14 abaranosky: "it has a lot odf good libraries" is something I've heard a billion times

2:14 same thing about Python

2:14 bitemyapp: abaranosky: 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.

2:18 abaranosky: bitemyapp: I'm excited to learn more Haskell for the new year

2:22 bitemyapp: was just looking at frak... I wonder when a library like that becomes something you need to use?

2:22 bitemyapp: abaranosky: noprompt is one of those people that harness regex for eldritch purposes.

2:22 abaranosky: 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.

2:23 now he just uses it as a command line application.

3:16 ddellacosta: bitemyapp: Happy New Year!

3:18 bitemyapp: ddellacosta: happy new year! I found an excellent interactive course written by a prominent Haskeller.

3:18 ddellacosta: let me know if you'd like to pair up on it :)

3:18 ddellacosta: bitemyapp: definitely interested...is there a link?

3:19 bitemyapp: ddellacosta: https://github.com/NICTA/course

3:19 I'm doing some preliminary exploration of it right now.

3:21 abaranosky: bitemyapp: 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

3:22 bitemyapp: abaranosky: anything Clojure, Python, or Haskell related is used pretty regularly.

3:23 abaranosky: is alembic working for you? Last time I tried to use it it didn't work. But I'm going to try it again.

3:23 bitemyapp: abaranosky: it worked fine for me the last time I used it.

3:23 it's pretty critical when I'm beginning to hammer out a new project.

3:23 I used it when I started getting berossus rolling.

3:24 abaranosky: bitemyapp: yeah it is really annoying to keep calling cider-restart

3:24 ddellacosta: bitemyapp: 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.

3:25 bitemyapp: my goal for tonight is simple breadth-first search in Haskell. I might try it in Clojure too to compare and contrast..

3:25 bitemyapp: ddellacosta: laff @ the people recommending RWH and R. jesus christ.

3:26 TEttinger: ddellacosta, is that dijkstra's algo?

3:26 bitemyapp: ddellacosta: 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.

3:27 ddellacosta: http://en.m.wikibooks.org/wiki/Haskell this is pretty good too.

3:27 the only reason I don't recommend WYaSi48H is it's only fun for a certain sort of person.

3:27 TEttinger: https://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

3:28 bitemyapp: and not at all, "to the point" of what makes Haskell different to somebody who has used a Lisp/Scheme before.

3:28 that's my opinion though, I'm sure some disagree.

3:28 ered: i've been meaning to do the yann esposito one

3:28 TEttinger: I'd like to see your version of a breadth-first search, ddellacosta

3:28 bitemyapp: ered: it's brief. You should just do it.

3:28 ddellacosta: bitemyapp: 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.

3:29 TEttinger: okay, will let you know when I'm done!

3:29 TEttinger: also, mine is in the link, highlighted

3:29 bitemyapp: ddellacosta: that's exactly how I feel about LYAH. Verbose, but has good explanations - works well as a reference.

3:29 TEttinger: I'm sure ours will diverge just based on my usage of arrays for performance reasons

3:30 ered: i just can't get through LYAH

3:30 it feels way too slow for me

3:30 ddellacosta: ered: yeah, that was part of my problem too.

3:30 bitemyapp: ered: that's why I recommend the Esposito tutorial...

3:31 ddellacosta: ered: 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.

3:32 bitemyapp: ddellacosta: 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.

3:32 ddellacosta: yeah, exactly

3:32 bitemyapp: no 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.

3:33 abaranosky: ered: speed reading :)

3:33 ddellacosta: bitemyapp: yeah. For anyone coming from Clojure (or any other functional language I imagine) it's needlessly verbose.

3:35 bitemyapp: abaranosky: LYAH is pretty content-sparse, even speed reading isn't enough.

3:35 I 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

3:35 reading a bunch of stuff they vaguely understand won't go very far.

3:36 ddellacosta: 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.

3:36 ddellacosta: bitemyapp: cool.

3:52 TEttinger: I didn't realize you were linking to a graph algo above, cool...

3:53 TEttinger: haha sorry

3:53 I use it for pathfinding

3:53 it actually operates on an array of doubles

3:53 1d, emulating 2d

3:54 abaranosky: testing abaranosky

3:54 TEttinger: I'm actually going to modify it to find choke points on maps

3:54 abaranosky: can someone plz mention me? I'm testing my elisp erc hacking :)

3:54 TEttinger: abaranosky

3:54 abaranosky: ping ping

3:54 ddellacosta: abaranosky: it works...?

3:55 abaranosky: thanks comrades. that helped

3:55 ddellacosta: TEttinger: cool, will check it out, just learning dijkstra's algorithm now, so very useful.

3:55 abaranosky: anyt ime

3:55 *any time

3:58 TEttinger: bitemyapp: learn the story behind the shibe http://www.theverge.com/2013/12/31/5248762/doge-meme-rescue-dog-wow

3:58 cheesus: ugh

3:59 awful meme

3:59 TEttinger: such envy. much fan doge. wow.

3:59 bitemyapp: TEttinger: awesome, thanks :)

4:06 TEttinger: so is there an equivalent to reset! for transients?

4:06 I'm rewriting some relatively inefficient atom-based code

4:06 (yes it's what ddellacosta is reading...)

4:07 abaranosky: ddellacosta: I think I got my erc notification hook working. :) I'll know if I get you to mention me again.

4:07 TEttinger: abaranosky!

4:07 abaranosky: can you put some text in there?

4:07 TEttinger: any luck, abaranosky?

4:07 bitemyapp: abaranosky: blahhhhh

4:07 amalloy: abaranosky, i usually just ask lazybot to mention me if i need to test something

4:07 abaranosky: nice

4:07 amalloy: ,'amalloy

4:07 clojurebot: amalloy

4:08 TEttinger: ,"abaranosky is the baron of sky"

4:08 clojurebot: "abaranosky is the baron of sky"

4:08 ddellacosta: abaranosky: okay. :-)

4:08 abaranosky: that is very regal sounding

4:11 TEttinger: so can I use set!

4:16 sm0ke: how do you compare characters in clojure? ## (filter #(< 'A' % 'B') "AbCdEfGh") ; doesnt works

4:16 lazybot: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number

4:16 TEttinger: gah, it isn't reset, it isn't set...

4:17 '' is not a string or char

4:17 chars are \A

4:17 sm0ke: oooh

4:17 ## (filter #(< \A % \B) "AbCdEfGh")

4:17 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number

4:18 TEttinger: what are you trying to do there?

4:18 that wouldn't find any letters anyway

4:18 abaranosky: I think you can (int \A)

4:18 ,(int \A)

4:18 clojurebot: 65

4:18 TEttinger: or compare

4:18 sm0ke: ## (filter #(< (int \A) % (int \B)) "AbCdEfGh")

4:18 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number

4:18 TEttinger: ,(compare \A \C)

4:18 clojurebot: -2

4:18 TEttinger: A comes before C

4:19 abaranosky: sm0ke: in Clojure < and > only work with numbers

4:19 TEttinger: int the % as well

4:19 sm0ke: ## (filter #(< (int \A) % (int \Z)) "AbCdEfGh")

4:19 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number

4:19 sm0ke: ## (filter #(< (int \A) (int %) (int \Z)) "AbCdEfGh")

4:19 TEttinger: ## (filter #(< (int \A) (int %) (int \B)) "AbCdEfGh")

4:19 lazybot: ⇒ (\C \E \G)

4:19 ⇒ ()

4:19 TEttinger: heyyy

4:19 sm0ke: ## (filter #(< (int \A) (int %) (int \Z)) "AbCdEfGh")

4:19 lazybot: ⇒ (\C \E \G)

4:19 sm0ke: yes!!

4:19 abaranosky: sm0ke TEttinger I'd use compare over the (int \A) approach. Less wonky imo.

4:19 TEttinger: yep

4:20 also, there's .isUpper or a regex

4:20 sm0ke: yes there is regex

4:20 but why cant i compare chars!

4:20 TEttinger: because encoding

4:20 sm0ke: ,(< "A" "B")

4:20 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>

4:21 TEttinger: some chars are (this is crazy) two ints

4:21 sm0ke: ,(comapre "A" "B")

4:21 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: comapre in this context, compiling:(NO_SOURCE_PATH:0:0)>

4:21 sm0ke: ,(compare "A" "B")

4:21 clojurebot: -1

4:21 TEttinger: which is correct, the -1

4:21 ,(sort ["A" " " "B"] )

4:21 clojurebot: (" " "A" "B")

4:22 sm0ke: i see no reason why comparing is limited to ints

4:22 TEttinger: well <> are

4:22 sm0ke: i mean by < >

4:22 TEttinger: it is odd. I think it's likely a performance thing

4:22 sm0ke: how does this doesnt makes sense ? ##(< \A \B \C)

4:22 lazybot: java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number

4:23 TEttinger: compare is probably much slower than < for numbers

4:23 amalloy: you say you see no reason, as if that means there is no reason

4:23 TEttinger: sm0ke, here's where it gets tricky

4:23 sm0ke: bleh

4:24 amalloy: clojure works hard to give you access to the speed and power of the underlying platform

4:24 sm0ke: i dont think clojures aim is to be the fastest language on planet

4:24 but rather being expressive

4:24 amalloy: if < did the slow-slow-slow thing that compare does, numeric algorithms in clojure would be much slower

4:24 TEttinger: ,\😸

4:24 clojurebot: #<RuntimeException java.lang.RuntimeException: Unsupported character: \??>

4:24 TEttinger: ,"😸"

4:24 clojurebot: "??"

4:24 TEttinger: it seems like one char, but clojurebot shows 2

4:25 that's part of the whole mess of string comparisons

4:25 sm0ke: wth! unicode support is something without which a language is usless imo

4:26 TEttinger: sm0ke, try it on lazybot

4:26 what's more, some encodings put e with hook accent in the first 256 chars. other put it a thousand+ codepoints later

4:26 VISCII is still in use

4:27 &"😸"

4:27 lazybot: ⇒ "😸"

4:27 TEttinger: lazybot can handle the unicode, but it won't treat it as one char. because it kinda is kinda isn't

4:27 &(map int "😸")

4:27 lazybot: ⇒ (55357 56888)

4:28 TEttinger: string handling, especially in java's style of unicode, is very very challenging to do right

4:29 I think clojure's ability to treat strings as special kinds of seqs is the right way

4:29 however, if you want to do < > comparisons on strings, you can do something like

4:31 err well actually this method is probably terrible, nvm

4:31 but it does result in alphabetized order...

4:36 ,(let [<c #(apply < (mapv int %&))] (filter #(<c \A % \Z) "AbCdEfGh"))

4:36 clojurebot: (\C \E \G)

4:37 abaranosky: bitemyapp: 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.

4:38 TEttinger: oh yeah, my question still stands. bitemyapp, do you know an equivalent to reset! for transients instead of atoms?

4:39 bitemyapp: abaranosky: :) good!

4:40 abaranosky: bitemyapp: lein-ancient is a nice convenicen to not have to probe clojars manually

4:40 bitemyapp: abaranosky: yap.

4:41 abaranosky: anyone tried troncle? https://github.com/coventry/troncle

4:41 and does anyone use ritz ?

4:43 bitemyapp: I talked to coventry about Troncle, it's pretty nice but I still use my Emacs macros.

4:45 abaranosky: bitemyapp: seems like the kind of thing I use my print-foo library for

4:47 coventry2: that's annoying troncle.el just sucked down nrepl.el, when I'm on cider

4:49 TEttinger: I'm just... I have no idea how I should do this. set! and reset! both need things that a transient is not

4:50 I could maybe use let to rebind it?

4:52 https://gist.github.com/tommyettinger/8206530#file-gistfile1-clj-L22 this line is what needs changing

4:55 abaranosky: TEttinger: doseq - https://gist.github.com/tommyettinger/8206530#file-gistfile1-clj-L11

4:56 TEttinger: right, this is old code, just looking at that line now, cringed

4:57 amalloy: TEttinger: 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

4:57 this whole thing looks like a loop/recur on open, instead of this while/mutation malarkey

4:58 TEttinger: yeah, I should probably do that

4:58 when I wrote this I didn't really grasp loop/recur

5:11 amalloy, good eye, I rewrote as a loop and it seems fine

5:16 amalloy: TEttinger: 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

5:16 happy 2014, by the way, #clojure

5:19 bitemyapp: amalloy: happy new year!

5:22 abaranosky: happy new years 2 u as well

5:31 ddellacosta: amalloy: Happy New Year!

5:36 TEttinger: amalloy, thank you clojure jeebus. you are the savior of my code.

5:37 (inc amalloy)

5:37 lazybot: ⇒ 81

5:37 amalloy: i was close then, TEttinger?

5:37 TEttinger: very

5:37 there were some references to n that needed to be changed to dir

5:37 amalloy: ah

5:38 TEttinger: other than that, it runs faster and seems not to have the issues of "not going where it should" the other version had

5:38 I'll put it through its paces now

5:38 amalloy: also the other version didn't work at all? on account of trying to reset! a transient?

5:39 TEttinger: yeah

5:39 that's why I highlighted that line

5:39 I rewrote my own loop/recur

5:39 that was the other version that was behaving oddly

5:39 amalloy: oh, the version that you just wrote. right

5:40 incidentally 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

5:42 TEttinger: and oh well. there's still a logic bug... I think I found an infinite loop

5:56 oh my god.

5:56 doing this dijkstra debugging was handy

5:57 because 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

5:57 ddellacosta: TEttinger: nice.

5:57 TEttinger: it happened so rarely that I thought it was a memory issue or something

5:57 but I knew that the game would lock up forever on rare occasions

6:53 Jarda: how do I transform a record to map?

8:13 gfredericks: (into {} the-rec)

8:15 hyPiRion: A record is a map of sorts already, though

8:16 gfredericks: clojurebot: A record is a map of sorts already, though

8:16 clojurebot: c'est bon!

8:21 bitemyapp: ddellacosta: do you have a moment?

8:23 ddellacosta: bitemyapp: sure, what's up?

8:24 bitemyapp: ddellacosta: want to show you something really clever the type system caught, a mistake I was making.

8:24 ddellacosta: I'm going through the course I linked you.

8:53 daGrevis: ,(= '(1 2 3) `(1 2 ~(+ 1 2)))

8:53 clojurebot: true

8:53 daGrevis: just learned about macros. guys, i'm blown-away

8:54 TEttinger: daGrevis, haha that's a fun snippet

8:55 &(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"])])))))

8:55 lazybot: ⇒ "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

9:02 mnvesdfkl20: Hi 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

9:03 * mongodb connections

9:04 mullr: mnvesdfkl20: I know nothing about mongodb, but I'd start by firing up JVisualVM to see what's going on and go from there

9:08 mnvesdfkl20: mullr: thanks for the pointer, i'll see what JVisualVM shows

9:08 shock_one: Hi. 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))

9:27 blackbear: ?

9:28 exit

9:28 quit

9:33 justin_smith: I was going to thell shock_one yeah that is how macros work, but he is gone

9:48 mnvesdfkl20: mullr: it looks like there's no problem having too many connections. it looks likekons 'lein cljsbuild auto'

9:50 ,might be the problem, it starts multiple processes

9:50 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: might in this context, compiling:(NO_SOURCE_PATH:0:0)>

9:53 dimsuz: hey 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

9:55 AimHere: dimsuz, when you pass a variable parameter in like [& args] then args is mapped to a list of all the arguments

9:56 So you have (assoc atom args) when what you want is (assoc atom arg1 arg2)

9:58 There'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

9:58 dimsuz: AimHere: 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? :)

9:59 yeah, i would like to find a solution which does not rely on how many items is in 'args'

10:00 gfredericks: dimsuz: you want (apply swap! state assoc args)

10:01 mnvesdfkl20: mullr: 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:02 AimHere: gfredericks, does apply take more than two arguments?

10:02 dimsuz: gfredericks: hurray. thanks! that thought floated around, but never touched my mind fully :)

10:08 Fatalnix: Anyone happen to know how I would implement the annotations provided here: http://pastebin.com/n5qKKHxL into clojure?

10:10 nmeum: is it possible to execute a function n times?

10:11 or to be more specific: I want to read from stdin n times using (read) and get the result as a list

10:13 lumafi: ,(doc repeatedly)

10:13 clojurebot: "([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:16 nmeum: thanks

10:21 gfredericks: AimHere: sure does; works great for cases like this one :)

10:32 ,(* 2 19 53)

10:32 clojurebot: 2014

11:10 logic_prog: is there anyway to write an OSX (desktop, not ipad) app in javascript/HTML, using Chrome (rather than safari) as the browser?

11:12 wrong channel

11:12 sorry

11:22 dnolen: logic_prog: have you seen node-webkit?

11:22 logic_prog: dnolen: no

11:22 can I build things that go into the mac app store with node-webkit ?

11:26 dnolen: logic_prog: no idea, I would look around there's a mailing list

11:26 logic_prog: dnolen: yeah, https://groups.google.com/forum/#!topic/node-webkit/qP_x9Z0lEO4 seems to suggest "it's doable"

11:27 masondesu: happy new year, all

11:43 daGrevis: ,(vec nil)

11:43 clojurebot: []

11:43 daGrevis: ,(vec nil nil)

11:43 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/vec>

11:43 daGrevis: ,(vec '(nil))

11:43 clojurebot: [nil]

12:03 augustl: semi on-topic.. Anyone know if there are any C implementations of persistent vectors, sets, hashmaps, etc?

12:06 levinm: I 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:06 Bodil: augustl: https://github.com/chaelim/HAMT if C++ counts.

12:12 jkax: I'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:25 augustl: Bodil: guess it does, tnx :)

12:30 ToxicFrog: Argh what the hell is this

12:30 lein run --a --bunch --of --arguments: works perfectly

12:30 lein clean && lein uberjar

12:30 java -jar target/...jar --a --bunch --of --arguments: silently does nothing

12:31 philll: Do the lein profiles specify different 'main' classes?

12:31 ToxicFrog: I have no profiles, just a single :main entry

12:31 Also, it looks like some of the features work in the jar

12:32 But this specific one does nothing

12:33 No error messages or anything, just exits with no output

12:33 I am baffles

12:34 justin_smith: ToxicFrog: does lein run with the production profile work?

12:34 ToxicFrog: I'm not sure if I should be blaming lein or java or my code here

12:34 justin_smith: how do I check that? I've never used lein profiles for anything.

12:34 justin_smith: it could be something does not work without your dev dependencies

12:34 lein with-profile ...

12:34 ToxicFrog: I don't have seperate dev and production dependencies, just :dependencies

12:35 justin_smith: lein profile -dev run --arg --arg

12:35 no dev profile in your profiles.clj?

12:35 make that lein with-profile above of course

12:35 ToxicFrog: Where would I find profiles.clj? There's none in the project directory.

12:36 justin_smith: it is your universal profile for lein projects ~/.lein/profiles.clj

12:36 ToxicFrog: Aha.

12:36 justin_smith: usually used for things that you want in every repl but not in projects

12:36 ToxicFrog: No profiles, just the lein-droid plugin.

12:36 lein with-profile -dev run ... says "performing task 'run' with profile 'default'" and then works fine.

12:36 justin_smith: try lein with-profile -dev run ...

12:37 oh o

12:37 k

12:37 ToxicFrog: Maybe I should see if there's a more recent lein before spending too much time on this.

12:41 Latest lein. It's still not working.

12:42 justin_smith: is -main starting a bunch of agents or threads?

12:42 ToxicFrog: No. Singlethreaded program.

12:46 Hmm

12:46 Upon further investigation, it's generating the right output files

12:46 What it's not doing is generating any sort of terminal output

12:55 Aha!

12:55 justin_smith: so, in the uberjar, (println) works, (printf) does not.

12:55 justin_smith: weird

12:57 try adding calls to (flush)

12:58 println calls prn which calls flush

12:58 printf calls print, which calls pr, which does not call flush

13:04 ToxicFrog: justin_smith: all the printfs end with \n, I'm used to this stuff being line buffered

13:05 I 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:06 lsdafjklsd: is 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:07 justin_smith: absolutely not

13:07 philll: but (:require [app.header :refer [header]])

13:08 hyPiRion: lsdafjklsd: what do you mean by "imported automatically"?

13:08 justin_smith: lsdafjklsd: 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:09 hyPiRion: you could probably do (:require [app.header :refer [my-func] :rename {my-func header}]), but I'm not sure what it would give you

13:09 lsdafjklsd: hyPiRion: Just thinking of node.js where I can export one function and require it like 'header = require('./header')'

13:09 hyPiRion: Hm, not used node.js, so I'm not sure if there's any equivalent in Clojure

13:10 lsdafjklsd: it's no biggie, was just wondering.

13:10 thanks :)

13:10 ToxicFrog: justin_smith: ok, if I explicitly (flush) just before program exit, all the output appears.

13:10 justin_smith: ToxicFrog: cool

13:11 ToxicFrog: 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:13 ToxicFrog: justin_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:14 pyrtsa: ,(doc *flush-on-newline*)

13:14 clojurebot: "; When set to true, output will be flushed whenever a newline is printed. Defaults to true."

13:15 justin_smith: pyrtsa: that is used by prn

13:15 but it is not even referenced by pr

13:15 so printf does not hit that var

13:15 pyrtsa: Ah, right. So printf ignores it. Never mind. :)

13:17 ToxicFrog: Blargh.

13:17 I'm going to have to wrap printf or something.

13:18 I do want these messages flushed as soon as they're written, since they're progress reports for a long-running operation

13:19 pyrtsa: Why not just something like (defn writef [& args] (apply printf args) (flush))?

13:19 ToxicFrog: Well, yes, that's what I'm going to end up doing most likely

13:19 A shame that it's necessary, though

13:20 pyrtsa: I'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:21 ToxicFrog: Historically, the behaviour for stuff connected to a terminal has been to line buffer

13:22 Aggravatingly, the autoflush property on System.out can only be set at creation time

13:37 jajaja: Newb question. What is approx. JVM memory footprint for a basic Clojure web app?

13:37 Single-threaded

13:45 seangrove: dnolen: 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:50 dnolen: seangrove: if you give om.core/root an atom then you can build multiple React root components off it that will stay in sync.

13:50 seangrove: om.core/transact! and om.core/update! should generally be called from event handlers, i.e. stuff outside the render phase.

13:50 seangrove: updating the app-state from inside the render phrase doesn't make sense

13:53 seangrove: dnolen: 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:54 dnolen: seangrove: yes existing issue for that, there should be a way to read the pending state.

13:55 seangrove: dnolen: 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:56 dnolen: seangrove: yes because that's done before IWillUpdate when pending state gets merged in

13:56 seangrove: I really recommend just reading the source for Pure in om.core

13:57 seangrove: there's not much there and it clarifies when things happen.

13:57 seangrove: dnolen: I have several tabs open on the om source, definitely going through it

13:57 I'll check out Pure specifically

13:59 bitemyapp: seangrove: exciting stuff eh?

13:59 seangrove: bitemyapp: Yeah, has a lot of potential

14:00 bitemyapp: seangrove: 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:00 seangrove: Wow, that could be pretty cool indeed

14:07 bitemyapp: seangrove: of particular interest to me is that registering callbacks could be respun as monadic binds.

14:07 seangrove: http://www.yesodweb.com/blog/2012/10/yesod-fay-js Skip down to the Fay section.

14:07 Purdy *_*

14:32 gfredericks: I did not know about this new clojure.api.API

14:40 justin_smith: gfredericks: got a link? not finding it in the github repo for clojure/clojure

14:40 never mind, just found it

14:41 gfredericks: justin_smith: I was reading the 1.6 changelog, which has a lot of examples

14:41 justin_smith: cool, yeah, I should have expected it to be a java file

15:19 gfredericks: ,(map #(/ 1.0 %) [0.0 -0.0])

15:19 clojurebot: (Infinity -Infinity)

15:43 coventry: What should I read to get a rough idea of what an om cursor represents?

15:44 seangrove: coventry: Best I can tell, this line: https://github.com/swannodette/om/blob/master/src/om/core.cljs#L274

15:47 coventry: Thanks, so roughly speaking it's the DOM tree and a pointer to a path down that tree?

15:48 s/a pointer to// I guess.

16:31 seangrove: dnolen: 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:34 pandeiro: i tried to output marginalia docs for om today, didn't work, but fortunately the fix was easy

16:34 i sent in a pr; hopefully om will be `lein marg`able soon, b/c the src is well documented

16:57 theseb: does 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:58 justin_smith: theseb: interop is so easy that we have a huge number of documented libraries, that are written in java

16:59 theseb: justin_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:00 lsdafjklsd: dnolen: 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:00 justin_smith: theseb: no, they don't appear to be written in clojure, but they are very easy to use from clojure

17:01 ,(.length "hello")

17:01 theseb: justin_smith: thanks..is there no way to somehow wrap the java libraries so they appear to be clojure libraries?

17:01 clojurebot: 5

17:01 justin_smith: theseb: if you really want to, usually there is no need

17:01 but it is done

17:01 ,(Object.)

17:01 clojurebot: #<Object java.lang.Object@1d6aae>

17:02 justin_smith: interop is mostly very easy

17:02 theseb: justin_smith: ok thanks

17:04 danlentz: Does AutoDoc actually still work? Is there a current howto that might help me get it going?

17:06 or, more specifically, does anyone have any pointers on the errer Error: Could not find or load main class autodoc.autodoc

17:06 is it something I'm being stiupid not to know?

17:07 justin_smith: danlentz: how are you resolving the autodoc dependency?

17:07 danlentz: well i did mvn install

17:07 is that not the weay?

17:07 justin_smith: OK, how did you tell clojure where that was?

17:08 danlentz: clearly not i guess

17:08 justin_smith: are you using lein? I think you should be if you aren't

17:08 danlentz: yes i normally do

17:08 justin_smith: if so, you can add autodoc as a dep in project.clj, and lein takes care of the rest

17:08 danlentz: so lein autodoc should do it?

17:08 justin_smith: mvn install makes things available to lein without a download, but does not automatically make them visible to a project

17:08 no

17:09 you add autodoc to your dependencies

17:09 danlentz: ok

17:09 figured it was something stupid

17:09 thks

17:09 justin_smith: not stupid, it is a common entry level mistake

17:10 other languages don't handle dependencies / libraries the way clojure does, nothing to be ashamed of not knowing

17:10 danlentz: y there every so often occurs a situation where it would be quite helpful if I had better Java exp

17:12 gdev: danlentz, that may be true, but the tradeoff is you would've had to spend all that time using Java =/

17:12 stubbing your toes every now and then is way less painful than trying to get Java exp

17:13 justin_smith: danlentz: looking again, you should be able to use autodoc as a standalone

17:13 danlentz: 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:14 http://tomfaulhaber.github.io/autodoc/ Now I see

17:14 go to the above link, search for lein-autodoc

17:14 it shows how to get the lein-autodoc plugin and run it

17:34 lsdafjklsd: anyone else run into issues with clojure.browser.repl breaking client side routing?

17:38 pandeiro: lsdafjklsd: i was having issues w/ that too, didn't investigate yet

17:38 seems weird that browser.repl would interfere though

17:38 lsdafjklsd: yea, im debating weather to open an issue on austin

17:38 trying vanilla js

17:39 instead of the good history

17:39 pandeiro: lsdafjklsd: do you know where to find externs for react 0.8.0?

17:41 lsdafjklsd: pandeiro: hmm no I had them at some point... just working with no optimization

17:43 pandeiro: actually, just go to the .m2 directory

17:44 pandeiro: com/facebook and unzip the jar, there is an externs file in there

17:44 marcopolo`: anyone have any jclouds experience? I think it's silly I need core.incubator to run one of their examples

17:45 lsdafjklsd: what browser are you using?

17:45 lsdafjklsd: marcopolo`: chrome

17:45 marcopolo`: lsdafjklsd: do you have a minimal project that reproduces that?

17:45 I wonder why that would happen

17:45 does it happen in ff?

17:46 lsdafjklsd: marcopolo`: I'm not sure, does austin work with FF?

17:46 marcopolo`: I can put the thing im working on in git if you're curious

17:48 pandeiro: lsdafjklsd: nice one thanks

17:48 danlentz: justin_smith: got it. much appreciated

17:48 pandeiro: i noticed om is pulling react in as a jar, but the examples don't use it...

17:48 justin_smith: danlentz: cool

17:49 marcopolo`: lsdafjklsd: It should work with ff; I've always had better luck with the brepl on ff

17:49 pandeiro: Om, I believe, is built on top of react

17:50 lsdafjklsd: marcopolo`: here is the code if you want to take a quick look https://github.com/lsdafjklsd/puree

17:50 marcopolo`: it's basically nothing except a playground

17:50 how do I use it with FF?

17:51 I'd much rather develop in chrome though :(

17:52 pandeiro: lsdafjklsd: where are you connecting in your cljs code?

17:53 lsdafjklsd: pandeiro: huh?

17:53 pandeiro: you pulled clojure.browser.repl into your core ns right?

17:53 lsdafjklsd: ya

17:53 in src/cljs

17:53 pandeiro: right, and where are you connecting?

17:54 lsdafjklsd: well, some work get's done in src/clj/puree.core

17:54 then I launch lein repl, (run)

17:54 juxovec: hi 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:54 pandeiro: you need to (clojure.browser.repl/connect "http://localhost:9000/repl") somewhere, is what i am saying

17:54 marcopolo`: pandeiro: austin is being injected in src/clj/puree.core

17:55 lsdafjklsd: ty marc

17:55 marcopolo`: pandeiro: here: https://github.com/lsdafjklsd/puree/blob/master/src/clj/puree/core.clj#L18

17:55 pandeiro: lsdafjklsd: (the above sexp is cljs, obviously)

17:55 cljs

17:55 the client needs to connect to the browser repl server

17:56 lsdafjklsd: yea, enlive appends the script tag in the index.html

17:56 (enlive/html [:script (browser-connected-repl-js)])

17:56 marcopolo`: juxovec: I think lein checkouts might be what you are looking for

17:57 juxovec: thanks I will check it out :)

17:57 lsdafjklsd: pandeiro: is this not how you do it?

17:57 pandeiro: I just followed the austin example

17:57 marcopolo`: lsdafjklsd: That's how you would normally do it without austing

17:58 you can still do it that way, but austin changes ports more frequently. So you'd have to update your code accordingly

17:58 I'm not a fan of having a webserver just to tell the client how to connect to the brepl though :/

17:58 pandeiro: lsdafjklsd: sorry i don't know austin, i just normally connect manually in the cljs code itself

17:58 it seems like what you are doing would work, if austin is set up correctly

17:59 does it make the xhr request to localhost:9000/repl? in the browser console?

17:59 marcopolo`: lsdafjklsd: have you been able to connect to the brepl at all?

17:59 lsdafjklsd: yea it all works fine

17:59 just breaks routing

18:00 https://github.com/cemerick/austin/tree/master/browser-connected-repl-sample

18:00 I just modified this... :P

18:03 marcopolo`: so routing works without the brepl?

18:07 lsdafjklsd: yea when I comment out [clojure.browser.repl] it all works

18:09 marcopolo`: I don't think you need to require clojure.browser.repl, do you?

18:13 lsdafjklsd: yea, but I don tknow why

18:13 what's this I hear about CLJS having it's own brepl?

18:13 is austin even necessary

18:13 coventry: Is `(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:16 bbloom: coventry: 1) i wouldn't assume that's intentional

18:18 coventry: 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:20 coventry: Ah, OK. Thanks.

18:20 pandeiro: lsdafjklsd: 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:20 lsdafjklsd: pandeiro: cool, i'll look into that

18:21 pandeiro: lsdafjklsd: fwict using austin would be mostly if you wanted to connect to the browser repl via nrepl

18:22 which did not work in the original browser repl

18:22 lsdafjklsd: pandeiro: the pro there being editor support?

18:22 pandeiro: I just use the repl from the command line

18:27 justin_smith: lsdafjklsd: how barbaric! I bet you eat with your hands too

18:27 :)

18:27 lsdafjklsd: holy crap

18:27 lol

18:28 justin_smith: just kidding

18:28 lsdafjklsd: I know, I laughed haha

18:28 need to look into fireside though

18:28 fireplace*

18:30 coventry: Wow the om todomvc git repository is enormous (33 MB).

18:32 pandeiro: lsdafjklsd: yeah basically editor support imo; dunno, maybe there are other reasons

18:33 marcopolo`: fireside sounds a little nicer

18:34 come, sit, let's chat for a bit... fireside

18:34 justin_smith: marcopolo`: do you know the history of the name?

18:35 https://github.com/tpope/vim-foreplay

18:37 coventry: Where should I look to understand clojurescript's #js? I roughly get what it's doing, just want to nail it down.

18:38 pandeiro: coventry: cljs.tagged-literals

18:38 coventry: pandeiro: Thanks.

18:39 pandeiro: np

19:18 marcopolo`: justin_smith: yeah :)

19:19 rads: dnolen: 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:20 before 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:25 looks like (into {} cursor) works as long as the map is only one level

19:40 my workaround using a defrecord instead of a regular map doesn't work since (map? (MyRecord.)) is true

19:43 it 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:28 necronian: lmao

20:53 devn: hi everyone

20:55 justin_smith: hello

21:00 jleclanche: any advice on a good clojure book for someone with a strong python/lua/c++ background?

21:00 justin_smith: the orielly clojure programming book

21:00 http://shop.oreilly.com/product/0636920013754.do

21:01 jleclanche: aight

21:07 devn: jleclanche: you can also check out tbaldridge's https://github.com/halgari/clojure-py

21:07 it's not a book, just source, but it might help you reason about the more java-ey things

21:10 coventry: Do you know anyone who's taken that approach to learning clojure? It sounds really inefficient.

21:13 seangrove: coventry: Yeah, I think the traditional 4clojure/hack on projects is probably a better way to go

21:16 akurilin: Man, does anybody else miss a composable if statement in other languages?

21:17 Feeling pretty spoiled by clojure.

21:17 justin_smith: akurilin: clearly because what they wanted was a composible if *expression

21:18 and they don't understand expressions I guess?

21:19 coventry: A 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:19 akurilin: It's surprisingly hard to imagine a better world if you've never got a taste of something like Clojure

21:21 coventry: that's true, I guess that covers 80% of the cases where you need only two branches.

21:22 I think you should be able to compose the ternary operator arbitrarily deep, not that it would be at all readable.

21:24 devn: coventry: are you talking to me?

21:24 coventry: I was, yeah.

21:24 devn: RE: "anyone who has taken that approach"

21:25 i 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:26 actually 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:27 different perspectives, implementations, not always feature complete, but at least another way of looking at what is /mostly/ the same thing

21:28 coventry: 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:28 clojure by using clojure-py*

21:28 coventry: Oh, I bet it's better than reading the clojure java sources, yeah. :-)

21:29 (Actually, they're not hard to read, just messily formatted.)

21:37 bitemyapp: akurilin: I miss being able to write conditions without macros when I use Clojure :P

21:38 conditionals*

21:43 ksaua: Is 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:43 mullr: ksaua: like a matrix transpose?

21:44 ksaua: sure, that'd work

21:44 mullr: don't know if it would work, but http://stackoverflow.com/questions/10347315/matrix-transposition-in-clojure

21:44 justin_smith: ,(map vector [1 2 3] [4 5 6] [7 8 9])

21:44 clojurebot: ([1 4 7] [2 5 8] [3 6 9])

21:44 justin_smith: ,(mapv vector [1 2 3] [4 5 6] [7 8 9])

21:44 clojurebot: [[1 4 7] [2 5 8] [3 6 9]]

21:45 ksaua: nice, thanks, that works

21:45 justin_smith: (the latter if you needed the enclosing thing to be a non-lazy vector too)

21:48 akurilin: bitemyapp: please explain.

22:10 bitemyapp: akurilin: non-strict languages eliminate the necessity of macros where you just want a function that doesn't force eval of its arguments.

22:11 $seen noprompt

22:11 lazybot: noprompt was last seen quitting 5 days and 18 hours ago.

22:24 arrdem: bitemyapp: http://i.imgur.com/KNltlZW.jpg

22:34 bitemyapp: arrdem: :)

22:34 coventry: "Stay testy, my friends."

22:35 bitemyapp: (inc coventry)

22:35 lazybot: ⇒ 6

22:35 bitemyapp: arrdem: cntext>

22:36 zerokarmaleft: how are constructors for static inner classes invoked via interop?

22:37 (SomeClass$InnerClass. args)?

22:41 coventry: zerokarmaleft: http://stackoverflow.com/a/7140967/1941213

22:43 zerokarmaleft: coventry: thanks, that covers it

22:46 arrdem: bitemyapp: writing tests for my processor simulators

22:46 TEttinger: $karma zerokarmaleft

22:46 lazybot: zerokarmaleft has karma 0.

22:46 TEttinger: indeed

22:46 arrdem: bitemyapp: 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:52 akurilin: bitemyapp: ah interesting, never heard that term before, had to wikipedia for it.

22:52 bitemyapp: 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:55 marcopolo`: (karma zerokarmaleft)

22:56 justin_smith: $karma zerokarmaleft

22:56 lazybot: zerokarmaleft has karma 0.

22:56 marcopolo`: (inc zerokarmaleft)

22:56 lazybot: ⇒ 1

22:56 marcopolo`: not anymore :P

22:57 arrdem: (dec zerokarmaleft) ;; ballance must be maintained

22:57 lazybot: ⇒ 0

23:00 bitemyapp: akurilin: non-strictness makes me so happy on a regular basis. and TCO.

23:01 akurilin: about half of the Haskellers I know would react to a "Haskell goes strict" announcement by hoisting the black flag and slitting throats.

23:02 akurilin: Interesting.

23:02 coventry: I had no idea Haskellers could be such a nasty bunch. :-)

23:02 akurilin: Every interesting tech person I know seems to either already know Haskell or has had Haskell on their todo list for a while :P

23:03 arrdem: bitemyapp: haha haskell mod lazy would be just a typechecked lisp :/

23:04 bitemyapp: arrdem: it'd be better than that you bastard.

23:04 * arrdem cackles evily

23:05 arrdem: bitemyapp: still not doing work? it's duck dynasty time again and I'm hiding

23:05 bitemyapp: arrdem: frick.

23:05 arrdem: doters?

23:05 arrdem: bitemyapp: anything that isn't this :P

23:05 bitemyapp: Okay.

23:08 devn: haskellites

23:10 i love 'em, but i grow tired. typed urls! yeah! the solution to all of my problems!

23:10 gtrak: the hindley-milner internet

23:11 seancorfield: hmm, who did a presentation recently that said H-M was one of the worst things ever?

23:12 scottj: seancorfield: gilad bracha

23:12 seancorfield: ah yes, that was it!

23:14 coventry: The only possible explanation for that is that he's a willful ignoramus with no understanding of programming language design. :-)

23:15 danlentz: somebody talking about me? :)

23:16 seancorfield: "Deconstructing Functional Programming"... that was the talk...

23:16 http://www.infoq.com/presentations/functional-pros-cons

23:17 danlentz: because anyone can see i'm not a will full ignoramus. i am just an ignoramus byn default

23:21 is anyone aware of a means to limit the scope ofautodoc to only a set of public api?

23:21 or at least separate the public from internal symbols?

23:22 by namespace only i think

23:23 devn: danlentz: i thought it only showed publics by default?

23:33 seancorfield: yeah, there's some metadata you can add to tell it to ignore vars

23:34 can't remember off the top of my head

23:34 skip-wiki

23:34 http://tomfaulhaber.github.io/autodoc/

23:35 rlb: did clojure.java.shell/sh change its behavior from 1.2 to 1.5?

23:35 In a project I'm getting 'No value supplied for key: {"LD_LIBRARY_PATH" "..."}', but from a 1.5 prompt, it's fine

23:35 .

23:36 (the same command is fine)

23:36 The project I'm poking at was on 1.2 (hence my suspicion).

23:36 sorry -- was on "1.4.0" rather

23:45 marcopolo`: Clojure just blew my mind... again

23:45 gtrak: seancorfield: fun bracha talk

23:45 marcopolo`: I found the proxy macro thing

23:48 TEttinger: proxy is neat

23:49 gtrak: 'Once you understand monads, you immediately become incapable of explaining them to anyone else'

23:50 TEttinger: comonoid endofunctor category of *head explodes*

23:56 marcopolo`: 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:58 warz: no public constructor?

23:58 marcopolo`: nope, just a public method that calls the public constructor

23:59 TEttinger: like a factory?

Logging service provided by n01se.net