#clojure log - Dec 22 2012

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

0:00 technomancy: TimMc: I wonder how many json parsers would just be completely cool if you threw them commented json

0:00 callen: rking: why would an "end user" be configuring something like lazybot?

0:00 Raynes: rking: Since when are we talking about end-user configuration? I was talking about configuration languages.

0:00 rking: callen: Almost none. I've typed a few lines into lein. I just saw the config-lang discussion, which is a topic I have a few thoughts about.

0:00 callen: technomancy: none of the standards compliant ones.

0:00 technomancy: callen: the standard sucks, in this particular area =)

0:00 callen: rking: what config languages and systems do you have experience with?

0:00 technomancy: I know that, jus' sayin'

0:00 technomancy: completely stupid

0:00 Raynes: rking: You can also put any code in that configuration file as long as it evaluates to a map. It's a real configuration language, dude.

0:00 rking: The example was of the faux XML like Apache, no?

0:00 ibdknox: has anyone tried doing a comment preserving version of the reader?

0:01 technomancy: callen: actually, does the standard actually specify what you're required to reject?

0:01 TimMc: technomancy: He was not friendly when I told him he shouldn't describe JSON as a proper subset of JS -- it doesn't handle some nonprinting chars the same way.

0:01 rking: callen: I generally like YAML config languages, perhaps processed through ERb if it's really necessary.

0:01 Raynes: He just in general isn't friendly. I'm damn offended. I'm going to have to leave now to cool off.

0:01 seangrove: technomancy: eh? I might have missed something...

0:01 callen: rking: yeah I have a hard time believing you'd have any issue with clojure configs then.

0:01 technomancy: seangrove: oh, I thought your "dec" comment was re: not writing in C =)

0:02 seangrove: Ah, sorry, hah

0:02 I thought we were affecting the ether

0:02 Raynes: Whoa, callen and I might agree on something. Maybe the Mayans were right.

0:02 callen: technomancy: I don't think so, but the default behavior seems to be to reject anything and everything that isn't an explicit part of the JSON spec.

0:02 Raynes: we agreed on grove.io too. Don't act so shocked.

0:03 rking: callen: It's not the end of the world or anything to use something like this, but I don't see it fitting the role of an apache config lang.

0:03 amalloy: ibdknox: i heard the guy who works on light table might be working on that

0:03 callen: rking: that's not what anyone said.

0:03 amalloy: on what?

0:03 TimMc: Comment-preserving reader.

0:03 callen: oh, cool.

0:03 rking: <Raynes> technomancy: The problem is using software with custom configuration languages.

0:04 TimMc: Ideally, a reader that preserves whitespace and reader suager too...

0:04 Raynes: I stand by that. I've used nginx.

0:04 amalloy: ibdknox: seriously though, i think sjacket is the current state of the art

0:04 callen: rking: most projects don't merit it. Apache being written the way it is has little choice.

0:04 seangrove: Really? Clojure data structures (ignoring the language) seem far more straight-forward than apache config

0:04 TimMc: rking: The basic principles here are tool and skill transferability.

0:04 callen: rking: however, that doesn't excuse how awful Apache's config language is.

0:04 seangrove: But it's been several years since I even looked at an apache conf file, could be wrong now... I suppose...

0:04 amalloy: but i don't know how polished/transparent it is

0:05 rking: callen: Fair enough.

0:05 callen: rking: for pretty much all Clojure projects, a Clojure config lang makes a ton of sense.

0:05 Most of the "end users" are clojure users and you don't win anything by not using Clojure.

0:05 rking: callen: Unless somebody who doesn't know Clojure is going to modify them.

0:05 callen: rking: that's a totally different scenario.

0:06 rking: nobody proposed non-programmer end-users editing clojure configs.

0:06 TimMc: But a valid one.

0:06 callen: rking: we're talking about our own needs and day-to-day problems as work-a-day programmers. That's all.

0:06 TimMc: callen: I don't think that was excluded.

0:06 rking: callen: OK.

0:06 callen: rking: it was stated before that for a "true" end user you'd need to make an interface

0:06 rking: I just saw that line, "problem is using software with custom configuration languages." and pounced.

0:06 callen: but you could still be reading/writing Clojure data structures for convenience's sake if you really wanted. More likely, an embedded database or something.

0:07 rking: callen: I don't buy that. A text editor is plenty interface enough for most things.

0:07 technomancy: if you want to use something that isn't a programming language, use yaml or json

0:07 callen: rking: is it really that ahrd to edit strings?

0:07 rking: One reason being that the config tool would have its own support issues.

0:07 technomancy: even XML would be better than inventing your own faux-xml

0:07 callen: most Clojure configs are considerably simpler than say, Xmonad's configs, and Xmonad is used by a LOT of non-programmers.

0:08 rking: Now I can call BS on that one for sure.

0:08 technomancy: if you use .ini files I won't hate you, but I do reserve the right to snicker

0:08 callen: Raynes: oh by the way, went to Hiccup.

0:08 rking: I use XMonad, and when I have a problem, it takes like 3 guys on #xmonad or #haskell to sketch out a solution.

0:08 callen: rking: that's because an Xmonad config is like actual programming

0:08 rking: I had one issue in particular that took about 4 different IRC sessions, and it was such a simple task.

0:08 * technomancy cargo-cults vociferously when it comes to xmonad config

0:08 rking: Yes

0:08 callen: rking: that clojure config is just a flat data structure effectively, and is equivalent to JSON or YAML

0:09 I've done my share of battling with Xmonad. Knowing Haskell helps. Knowing Xmonad helps more.

0:09 rking: Except that it isn't optimized for such things, the way YAML is

0:09 seangrove: I haven't used xmonad, but have been really, really wanting something like it for osx

0:09 It seems amazing from this end

0:09 technomancy: though now my config is only 4 settings interspersed with derogatory comments at how crazy it is that these aren't default

0:09 rking: seangrove: There is osxmonad, but one limitation is that it only manages X11 apps.

0:09 technomancy: which is also a lot like what my gnome config looks like

0:09 seangrove: rking: Yeah, I don't use any x11 apps, sadly

0:10 TimMc: technomancy: You're using Debian something, yeah?

0:10 callen: Raynes: I'm starting to understand you.

0:10 technomancy: TimMc: yeah, about to make the jump to wheezy now that it's been frozen for a while

0:10 TimMc: I would like to subscribe to your get-off-my-lawn newsletter.

0:10 ibdknox: amalloy: I haven't really gotten sjacket to work :(

0:10 Raynes: callen: Isn't Hiccup the antithesis of what you wanted?

0:10 rking: seangrove: Well, if I was on OS X, I'd use urxvt as a terminal under osxmonad.

0:10 TimMc: Ubuntu is pissing me the hell off.

0:10 technomancy: TimMc: I actually considered starting to document my dotfiles the other day WHAT IS WRONG WITH ME

0:10 ibdknox: amalloy: I think it won't be hard to hack it into blind, I was just wondering if there was some prior art I shoulc look at :)

0:10 callen: Raynes: yes. frontend guy wanted to learn backend anyway. He's going to learn the fun way.

0:11 Raynes: he's been mumbling about clojurescript for some time now.

0:11 amalloy: if there is, nobody's told me about it

0:11 rking: seangrove: That plus an X11 web browser would get me almost the same setup as I have now on Linux.

0:11 seangrove: rking: Meh, I use emacs

0:11 callen: Raynes: to its credit, Hiccup is more compact than actual HTML by a fair bit.

0:11 seangrove: Looks roughly equivalent

0:11 callen: Raynes: Hiccup has the benefit of not being insane like Enlive though.

0:11 technomancy: TimMc: https://github.com/technomancy/dotfiles/blob/master/.gripes.org and https://github.com/technomancy/dotfiles/tree/master/bin/init

0:11 TimMc: callen: Oh no. We're NOT going there.

0:11 ibdknox: lol

0:11 seangrove: TimMc: Yes, please stop him

0:12 * ibdknox get popcorn

0:12 rking: URL for Hiccup?

0:12 TimMc: not when I should be gong to bed

0:12 technomancy: oh dear; look at the time

0:12 squidz: technomancy: do you prefer enlive or hiccup?

0:12 callen: TimMc: I said I was sated and no longer had an issue.

0:12 squidz: he doesn't do a lot of web dev.

0:12 technomancy: squidz: I find hiccup to be much more maintainable

0:12 Raynes: callen: Have you looked at Laser?

0:12 ibdknox: all of LT is in hiccup!

0:12 TimMc: technomancy: "adding a keyboard doesn’t honor caps->ctrl mod" BAIL BAIL BAIL

0:12 technomancy: but I don't want to get into a discussion right now with callen around =)

0:12 ibdknox: sort of

0:12 Raynes: callen: I'd hope you wouldn't think it totally insane.

0:12 seangrove: I feel like whenever the channel is too quite, we jsut need to mention python, Java, templating, or some combination thereof to have callen going for 45 minutes non-stop

0:12 squidz: so who is our webdev on #clojure?

0:12 Raynes: callen: It has exactly one bug that I know if at the moment.

0:12 technomancy: TimMc: welllll I'm not sure why that is

0:13 callen: Raynes: I don't believe in server-side whole-document transformation like that if it can be avoided.

0:13 TimMc: Wait, that's additional keyboards? nvm

0:13 Raynes: squidz: Well, ibdknox and I recently deprecated a web framework. I think we own this shit.

0:13 technomancy: TimMc: maybe because I fix caps lock in ~/.xsession instead of system-wide in /etc/?

0:13 Raynes: callen: Oh, sure, but I meant insane as in like code insane.

0:13 squidz: Raynes: I see, so what is the pros preference? hiccup or enlive?

0:13 technomancy: squidz: oh yeah, don't look at me for web dev advice. I have done a total of one web app in Clojure and it was 700 lines

0:13 ibdknox: squidz: depends on the situation

0:13 Raynes: squidz: Neither. I wrote my own templating library.

0:13 callen: squidz: they're used in equal measure. Depends on how you think about documents.

0:14 technomancy: TimMc: FWIW gripes.org is fairly comprehensive =)

0:14 callen: Raynes: are you being sarcastic? I'm surprised you are asking for my opinion about code.

0:14 Raynes: squidz: https://github.com/Raynes/laser :D <plug>

0:14 squidz: ibdknox: yeah I should have expected that answer

0:14 TimMc: technomancy: I appreciate this, thanks.

0:14 clojurebot: We live to serve.

0:14 squidz: Raynes: oh, sounds dangerous

0:14 technomancy: TimMc: have you tried wicd?

0:15 TimMc: Nope. What is?

0:15 technomancy: network-manager replacement

0:15 I was looking at how network-manager stores credentials, and it's horrible horrible horrible

0:15 callen: you know, I've tried to use wicd on at least 6 different occasions.

0:15 * TimMc squints distructfully

0:15 callen: it ended in my losing internet access and being unable to reinstall nm-applet each time.

0:15 TimMc: *distrustfully

0:15 technomancy: NM mostly works fine from a user perspective, but once you get to trying to automate it it's pretty gross

0:15 Raynes: You people are talking too fast.

0:15 callen: Raynes: I'm looking at the code but I'm still baffled you asked for my opinion.

0:15 Raynes: callen: I was just curious if you thought my approach was as insane as enlive.

0:16 TimMc: I mean, I keep a screen session open to restart network-manager and nm-applet every 3 hours, but still... I KNOW those bugs.

0:16 technomancy: callen: good to have additional data points; thanks =)

0:16 callen: Raynes: you should benchmark it against Enlive, Enlive is pretty slow.

0:16 Raynes: callen: I did, it's faster for the tests I ran (from viewbenchmarks)

0:16 TimMc: Raynes: It's because many of us are northerners.

0:16 technomancy: TimMc: my main complaint is I can't use dmenu to select new wifi access points, only known ones

0:16 Raynes: Significantly faster.

0:16 ibdknox: TWO HUNDRED MIRRION FASTER

0:16 technomancy: but that's fairly high on Maslow's Linux hierarchy compared to periodic network-manager restarts =)

0:16 Raynes: callen: See the bottom of the readme

0:17 callen: ibdknox: DATS RACIST

0:17 Raynes: there's something amiss about the benchmarks btw

0:17 Raynes: But yeah, one more small bug (there is an issue for it) and I'll recommend it to peoples.

0:17 callen: Raynes: usually hiccup is close to (str ...) in performance (2x at most)

0:18 Raynes: in your test it's the worst, worse than Enlive, which I've never seen before.

0:18 technomancy: TimMc: what the hell, pushed it: https://github.com/technomancy/dotfiles/blob/master/README.md

0:18 TimMc: Raynes: Does Laser escape node contents by default?

0:18 Raynes: callen: I didn't really care about benchmarks. I just used what was in viewbenchmarks and posted what it said.

0:18 callen: Raynes: sure I'm just saying that the numbers are highly irregular.

0:18 TimMc: Answer carefully.

0:18 callen: anyway, back to the code.

0:19 Raynes: TimMc: The library underneath it, Hickory, escapes all text nodes.

0:19 TimMc: Good.

0:19 callen: Raynes: why'd you write your own escape-html?

0:19 * TimMc puts away flamethrower

0:19 * ibdknox steals TimMc's flamethrower

0:19 Raynes: callen: It's from an earlier version. Pretty sure I don't use it anymore and it should be removed.

0:19 clojurebot: version ranges are nothing but trouble: http://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html

0:19 ibdknox: this will be useful later.

0:19 TimMc: shit

0:20 callen: Raynes: you use it in the content function.

0:20 TimMc: clojurebot: YOU are nothing but trouble.

0:20 clojurebot: @ has nothing to do with whether sth is evaluated or not

0:20 Raynes: callen: Okay, in that case it's because it's from an earlier version of *hickory* where things were not escaped automatically.

0:20 callen: I think clojurebot would make an excellent experiment in how to passively percolate information into a community.

0:20 Raynes: Still redundant.

0:20 And should be removed.

0:21 callen: Raynes: just being accurate as I troll through the code.

0:21 TimMc: callen: What makes you think it isn't? ;-)

0:21 squidz: clojurebot: you so silly

0:21 clojurebot: Gabh mo leithscéal?

0:21 Raynes: callen: In fact, given that fact, html-content and content can both do the same thing so content probably shouldn't exist and html-content should be renamed.

0:21 callen: Raynes: why is enlive so big anyway?

0:21 Raynes: So thanks for pointing that out and I'll put it on my todo list.

0:22 callen: Because it does direct interop with a unbelievably shitty HTML library and does stuff that I can't even begin to want to know about.

0:22 callen: raynes@dasouth:$ echo "Overthrow Enlive, set myself up as the dictator of whole HTML document transformation-landia" >> TODO.md

0:22 TimMc: technomancy: Seriously, this is great. I'm going to buy an SSD and try installing Debian on it.

0:22 ibdknox: Enlive is the most obtuse clojure I've seen I think

0:22 Raynes: I use todoist, so it's more like "click type click"

0:22 technomancy: TimMc: yessssss

0:23 callen: Raynes: leave the joke alone.

0:23 TimMc: http://github.com/bitemyapp/dotfiles/

0:23 technomancy: Raynes: at least pretend to use org; geez

0:23 callen: technomancy: if it comforts you, I too use org.

0:23 Raynes: technomancy: I used org once. It did not work.

0:23 callen: mostly for internal company documents.

0:23 technomancy: our due-diligence paperwork was all Org getting exported into LaTeX.

0:24 TimMc: Nice.

0:24 callen: TimMc: there are 400,000 lines of Emacs Lisp in my dotfiles repo.

0:24 TimMc: in the current checkout.

0:24 TimMc: That's terrifying.

0:24 callen: My name is Ozymandias, king of kings:

0:24 Look on my works, ye Mighty, and despair!

0:24 * Raynes gasp

0:25 Raynes: callen: I'm taking off, so if you respond with any more comments I probably won't see them for a while. Just don't think I'm ignoring you.

0:25 technomancy: callen: hah nice

0:25 callen: I only know one guy with more Lisp code in his Emacs install than me, and he's a batty Haskell user.

0:25 Raynes: thanks for the heads up. I'll be poking through.

0:25 ivan: is half of that org-mode?

0:25 callen: org-mode is part of the Emacs site el, so no.

0:26 it's all stuff I added manually. I don't believe in package managers for Emacs, although I use it for a couple things.

0:26 so everytime I add a package, I integrate it manually and test it on Mac and Linux, then push the new version to github

0:27 I should renick myself, "KingYakShaver"

0:27 * callen goes back to poking at Raynes' code

0:27 technomancy: package.el changed my life

0:27 callen: technomancy: I'm the pig rolling in the mud, happy as all get out.

0:28 technomancy: I like my artisanally crafted Emacs install.

0:28 technomancy: shade-grown parens

0:28 callen: technomancy: believe it or not, my dotfiles repo is so stable and reliable that an SF Clojure meetup ended up using it for teaching people how to use Emacs with Clojure.

0:28 technomancy: I was the only one who had something that worked 99.999% of the time on Mac and Linux.

0:28 so there's clearly something to be said there.

0:28 technomancy: my dotfiles repo is the starter kit =)

0:29 callen: technomancy: that's cheating dammit.

0:29 technomancy: I know =)

0:29 TimMc: You and your toolbar-hiding, pretty-fn-showing config...

0:29 technomancy: I don't actively encourage its use these days for anything other than pillaging

0:29 but pillaging is an important Emacs tradition

0:30 callen: technomancy: my dotfiles repo is actually shake-n-bake ready for Python, Clojure, Haskell, Scala, J, Java, JavaScript, web dev (HTML/CSS/JS), etc....

0:30 technomancy: callen: I tried to do the per-language modularity thing with the starter kit

0:30 callen: technomancy: you seen how I do it in mine?

0:30 technomancy: but I basically ignored all non-clojure stuff soon after =)

0:31 * technomancy loks

0:31 technomancy: looks

0:31 callen: I lift the subdirs into the elisp search path, then load the configs.

0:31 to disable the language, just comment out the config load.

0:31 easy-cheesy.

0:32 technomancy: how many mail clients do you have configured here?

0:32 callen: technomancy: I don't want to talk about that.

0:32 * technomancy just switched to mu4e

0:32 callen: the mail clients situation has been an ongoing canker-sore for me.

0:32 technomancy: was mostly happy with gnus until I started reading mail on my phone; the gnus model does *not* play well with others

0:33 callen: technomancy: anyway, not a terrible per-language module system if you ask me.

0:33 technomancy: apart from the reliance on offlineimap, mu4e is niiiiice

0:33 callen: the per language config/init file system did a lot to clean up my .emacs

0:33 technomancy: yeah, makes sense to leverage the load-path for that

0:33 callen: technomancy: well previously everything in the configs was inside the .emacs

0:34 technomancy: and not necessarily grouped together intelligently

0:34 the restructuring saved my sanity.

0:34 so I used to have a big .emacs

0:34 technomancy: do you do your own autoloads though?

0:34 that sounds like a lot of work

0:34 callen: technomancy: autoloads? no.

0:34 what sounds like a lot of work? the restructuring or maintaining the stygian-horror .emacs file?

0:35 technomancy: keeping autoloads for that

0:35 callen: because after I did the restructuring, it's been pretty smooth sailing.

0:35 I don't keep autoloads for anything.

0:35 seangrove: Ah, damn

0:35 technomancy: oh so you just bite the bullet with slow boot times?

0:35 seangrove: Ended up with a cons instead of a vector

0:36 callen: technomancy: yes. it's like leiningen man.

0:36 technomancy: I fire up Emacs like once a month.

0:36 technomancy: I try not to optimize problems that I don't have :P

0:36 I abhor premature optimization.

0:36 seangrove: callen: You're my archetype for premature optimization in this channel

0:37 technomancy: I keep all my projects segregated by emacs instance, so that would never work for me

0:37 callen: seangrove: what.

0:37 technomancy: huh. not totally sure what you mean there. emacs-project-mode?

0:38 technomancy: callen: no I mean like I have one emacs instance for leiningen, a couple for different work projects, one for ERC, one for mail, one for IM, etc

0:39 callen: technomancy: ah yeah. I see what you mean there.

0:39 technomancy: I've tried to avoid having that problem

0:39 technomancy: a habit I picked up from gnus blocking behaviour

0:39 callen: I assumed that if it did become a problem, I'd start using a buffer grouping library.

0:40 technomancy: but now I like it because I use different themes depending on the context

0:40 callen: technomancy: makes sense. I'd end up making the Google Chrome of Emacs instead. (one process per tab)

0:40 technomancy: heh

0:41 well if you have to run on OS X you're a lot more limited

0:41 callen: how so?

0:41 technomancy: you don't have xmonad to help you out =)

0:41 callen: technomancy: oh yeah, that's a part of the problem.

0:41 technomancy: plus IIRC the cocoa version makes it difficult to launch multiple instances

0:41 callen: technomancy: I use Xmonad when I'm in Linux.

0:42 technomancy: like you have to make duplicates of the .app dir or something silly

0:42 dunno; it's been a while

0:42 callen: yes, you do.

0:42 no that's right.

0:42 * technomancy suppresses a snicker

0:42 callen: technomancy: most Mac users I know who have that problem usually launch it from the command line or run it in the terminal

0:42 seangrove: technomancy: I use the terminal version of emacs

0:42 callen: technomancy: then let each terminal tab be an emacs instance.

0:42 seangrove: But I always connect them via emacs-client

0:43 I prefere to have lots of windows into one monstrous emacs process

1:16 muhoo: Raynes: where da laser at, yo?

1:16 did you release it?

1:18 callen: muhoo: he's not here right now. I happen to be the 2nd most qualified person to talk about it in this IRC channel though.

1:18 muhoo: I promise everything I say will be a lie.

1:20 muhoo: including that?

1:20 callen: muhoo: hello Kretan.

1:20 muhoo: ah, a transformation library with build in logical paradox

1:20 callen: muhoo: I'll say this about laser, nothing is stopping you from using it in an app.

1:20 muhoo: it is however not as !PRODUCTION! grade as say, Stencil. But few things are.

1:21 muhoo: i just googled it and yes, it appears to be released, yay.

1:21 callen: muhoo: it's about 250 lines of code. I'd say just read the code and roll with it.

1:22 muhoo: yeah, it's funny how in clojure land 800 lines is "huge". i've been doing java for months and 800 lines is setup and hello world

1:23 callen: muhoo: I'm pretty sure ~800 lines is Enlive, and that's considered to be a bit complex.

1:23 muhoo: callen: cloning now, thanks.

1:23 callen: muhoo: thank github, not me.

1:26 muhoo: +1 for working "ermahgerd" into the readme

1:36 arrdem: what's the most idiomatic way to put a fn in a map?

1:36 callen: muhoo: was there something about enlive that wasn't working for you?

1:37 arrdem: ,((:foo {:foo (fn [x] (* x 2))}) 2)

1:37 clojurebot: 4

1:37 callen: sigh, I'd just gone to the trouble of demonstrating.

1:38 arrdem: you appear to understand it just fine. what's the issue?

1:39 arrdem: callen: I've defined a macro that assoc's a key to a fn in an atom

1:39 but it seems that my fns are comming through as lists not nfs

1:39 *fns

1:39 ,(type (fn [x] x))

1:39 clojurebot: sandbox$eval55$fn__56

1:39 callen: if you had a specific problem, why didn't you just refheap it?

1:39 otherwise, the way you phrased your question seemed to merely be musing if it was possible.

1:40 * arrdem shrugs

1:40 arrdem: never had to pastebin my problem before

1:40 callen: so refheap it?

1:40 arrdem: willdo

1:40 callen: I have no idea what your macro looks like

1:40 arrdem: why are you using an atom?

1:42 arrdem: callen: the only way I understand to incrementally accumulate a value

1:42 I suppose a val would work too...

1:46 ok problem reproduced...

1:46 callen: https://www.refheap.com/paste/7807

1:47 callen: arrdem: not seeing the problem.

1:47 are one of those supposed to break?

1:48 arrdem: no, they should both work

1:48 callen: arrdem: so what's the problem?

1:48 arrdem: callen: I get an error that the fns are being parsed as persistant lists and I don't see why

1:49 I mean I understand that I could (eval) em and then apply, but this should work and I would like to understand why

1:49 callen: arrdem: why is table-insert a macro?

1:50 arrdem: no reason for it to be, it's just that the intent is for it to be executed as a (def)ish statement at compile time

1:50 and my line between fns and macros for stuff like this is fuzzy

1:53 amalloy: that shouldn't be a macro. you could make it work, but there's no reason to

1:53 arrdem: callen: how would you structure something like this? your tone suggests that I'm making some strange choices

1:54 callen: arrdem: I'm not the best person to listen to, but I'm going to concur with the more knowledgeable amalloy's comment about the macro.

1:54 arrdem: default to just using functions in general.

1:54 amalloy: just change 'defmacro to 'defn, and it works like magic

1:55 arrdem: amalloy: understood I'm just trying to draw a better line between using defn and defmacro than in a defmacro I need the macro code generation syntax.

1:56 callen: amalloy: for the sake of comprehension, why isn't it working? I'm staring at the macroexpand and feeling stupid.

1:56 amalloy: it's trying to do the swap at compile-time, with the code for f instead of with the function f, and then expanding to the atom's current value

1:57 it could work as a macro if it were like `(swap a assoc ~k ~f), but at that point it's doing nothing different from a function

1:58 arrdem: okay thanks amalloy and callen

1:58 bbloom: you'd use a macro if you were always inserting functions and wanted special syntax for it

1:58 ie to eliminate the "(fn " and one ")"

1:59 arrdem: bbloom: right so you'd do an & forms and just ~ expand it

1:59 bbloom: something like (table-insert :foo [x] (* x 2))

1:59 arrdem: generally, i never write macros longer than 2 or 3 lines

1:59 i always write all my logic in functions

1:59 test them as functions

2:00 and then write a tiny macro at the end to call the function

2:02 arrdem: ok thanks. I'm reading Let over Lambda atm so I may just be on the lunatic fringe with trying to macro.

2:03 amalloy: doug hoyte is certainly a lunatic, though a clever one

2:04 callen: arrdem: please do not write Clojure code based on the lunatic ravings of Hoyte.

2:04 arrdem: please?

2:04 bbloom: arrdem: i feel as though somebody needs to assign levels to each clojure function and beginners should master each level before moving on :-)

2:04 arrdem: callen: ok ok

2:05 bbloom: I joke that in Haskell you take an IQ check before calling a function

2:05 bbloom: heh, i just see lots of people in here wondering about the subtlties of atoms vs refs, or macros vs functions, or what not

2:05 callen: bbloom: I smell a clojure achievements game.

2:05 bbloom: but it's just too much shit all at once

2:06 egghead: ya that's a good idea bbloom

2:06 callen: bbloom: the final level is "found a reason to use fnext instead of second"

2:06 arrdem: callen: lol

2:06 callen: "had a triply-layered macro using juxt"

2:06 "beat amalloy at golf"

2:07 bbloom: egghead: yeah, i think i'd have appreciated a sign "learn all of these functions before touching atoms"

2:07 heh :-)

2:08 that's why i always recommend 4clojure to folks: no def, no macros, it's like levels 1 through 3 without levels 4 and 5

2:08 really helpful for my slow brain

2:09 egghead: even beyond the data structures (can we call a macro a data structure? :p ) -- so many of the functions are built on an understanding of one another

2:09 and in fact written in terms of one another

2:09 sometimes I have a hard time trying to explain clojure concepts to coworkers because I forgot how little context there is for it in the oo/java world

2:10 SegFaultAX: egghead: Or functional programming in general.

2:10 bbloom: egghead: it's easier to explain them in the absence of any particular language

2:10 egghead: even better, avoid any buzz word they may have *ever* heard :-)

2:11 SegFaultAX: bbloom: That's hard because a lot of the important details have names that are buzzwordy right now. Even simple stuff like higher-order functions.

2:11 Raynes: muhoo: Cool. Gonna use it?

2:11 * Bergle_1 wins his bingo sheet.

2:12 Raynes: muhoo: I'm rewriting refheap's views with it. There is exactly one bug that I know of (see the issue) at the moment that isn't a huge deal, but other than that it is released and ready to go.

2:12 mehwork: if the var foo exists, how come re-def'ing like the following doesn't change its value: (def foo (update-in ....)

2:13 bbloom: mehwork: your question doesn't make sense. context?

2:13 mehwork: bbloom: i'm just trying to make an update-in stick

2:13 bbloom: mehwork: do not use vars (via def) for mutable values

2:14 mehwork: vars are only mutable for the sake of interactive development

2:14 mehwork: i have to use let then?

2:14 SegFaultAX: mehwork: What are you trying to do?

2:14 bbloom: put an atom in your var and update that

2:14 mehwork: SegFaultAX: update a value inline

2:14 bbloom: (def foo (atom nil))

2:14 mehwork: let establishes immutable local bindings, you can't mutate those either

2:15 mehwork: i haven't learned atoms yet. They looked like they were more for concurrent programming when i skimmed them before, but i'll try that. Thanks.

2:16 egghead: you can certainly define some foo as the result of evaluating some call to update-in

2:16 bbloom: mehwork: they encapsulate compare and swap, so they are safe for concurrent access

2:16 egghead: it's just considered very messy to do it in the middle of a functions body

2:17 bbloom: see: we need levels :-)

2:18 * arrdem chuckles

2:18 arrdem: get that in the runtime...

2:20 mehwork: to change an atom do i have to do (reset! @atomname (update-in ...))

2:20 egghead: mehwork: the idea is that the value will never change (immutable) and so anything that ever receives the value is afforded that guarantee, you can change the reference so any time you use it in the future it'll evaluate to it's current value, but as it's called by value you can't change a reference in one place and expect to see it in former places

2:20 mehwork: because it's giving me an exception about an Atom can't be cast to Associative

2:21 egghead: atoms allow you to pass around ~references~ though, so if that's what you want you're set

2:22 mehwork: you'd want to say (swap! atom-name (fn [atom-value] (update-in ..))

2:23 oops, reset*

2:24 zellio: egghead: why the (fn ..)

2:25 egghead: zellio: I was mistaken, I was thinking swap! not reset!

2:27 arrdem: okay, so how can I pull off a closure here? https://www.refheap.com/paste/7808

2:28 zellio: egghead: ahh okay, am I correct in remmebering that swap! inserts @atom after fn ?

2:28 so (swap! a fn arg) -> (fn a arg)

2:28 arrdem: zellio: yes, and then sets the value of a to that value

2:29 mehwork: (reset! my-atom (update-in my-addmin [:key :test] "newval")) is giving me an exception

2:29 as is assoc-in

2:29 zellio: mehwork: no ()

2:29 clojurebot: Gabh mo leithscéal?

2:29 zellio: or rather

2:29 sorry

2:29 make it a fn

2:29 reset takes atom newval

2:30 (reset! atom #(update-in % [:key] "val"))

2:30 mehwork: hate to say it but the clojure docs (euphemism "suck")

2:30 zellio: arrdem: thanks, don't have a repl on me

2:30 mehwork: at least for noobs like me

2:30 arrdem: zellio: don't thank me yet... I could be wrong XP

2:30 egghead: update-in takes a function as its final arg, right?

2:30 zellio: arrdem: ha

2:30 mehwork: clojuredocs.org ?

2:31 egghead: http://clojure-doc.org/

2:31 mehwork: zellio: yeah, i mean it's a fine reference if you know the language i'm sure

2:32 arrdem: zellio: yes that's the behavior as repl tested here

2:35 zellio: ahh leiningen installed, much better

2:35 mehwork: zellio: whatever that code example you just gave did reset my atom to only now have a value of like #<Atom...> and @atom looks like #<foo$eval....

2:35 iow, it's fubar'd

2:35 egghead: mehwork: you don't want the # or %

2:36 that makes it a function, that's the repls way of telling you that the value of your atom is a fn

2:36 bbloom: reset! is not what you want

2:36 you want swap!

2:36 (doc swap!)

2:36 clojurebot: "([atom f] [atom f x] [atom f x y] [atom f x y & ...]); Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be called multiple times, and thus should be free of side effects. Returns the value that was swapped in."

2:36 mehwork: egghead: well that puts me back to where i was before and gives me classcastexception clojure.lang.Atom cant be cast

2:37 my head Hz

2:37 bbloom: (swap! the-aom update-in [:key] assoc "val")

2:37 egghead: :)

2:37 bbloom: reset! forcibly overrides a value

2:37 swap! will apply a function and replace the value with the result of that function

2:37 mehwork: just glad you didn't say i need eve instead of atom

2:37 bbloom: (let [a (atom 5)] (swap! a inc) @a)

2:37 ,(let [a (atom 5)] (swap! a inc) @a)

2:37 clojurebot: 6

2:38 bbloom: ,(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] inc) @a)

2:38 clojurebot: {:a {:b 2}}

2:38 bbloom: ,(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] + 2) @a)

2:38 clojurebot: {:a {:b 3}}

2:38 bbloom: get it now?

2:38 ,(let [a (atom {:a {:b 1}})] (reset! a 2))

2:38 clojurebot: 2

2:38 bbloom: ,(let [a (atom {:a {:b 1}})] (reset! a 2) @a)

2:38 clojurebot: 2

2:39 mehwork: thanks bbloom

2:39 zellio: wow, well that's my queue to go to sleep

2:40 mehwork: mispelling cue is

2:40 misspelling mispelling is

2:40 zellio: I didn't get queue wrong, I just got the wrong cue

2:40 bbloom: mehwork: you should watch rich's talk on values, identities, the epochal view of time, etc

2:40 mehwork: fifo

2:41 egghead: http://www.infoq.com/author/Rich-Hickey

2:41 mehwork: i should, but certainly not right now. Head hurts and tired. Probably shouldn't even attempt to atomicize my code

2:41 bbloom: mehwork: yeah, get some rest

2:41 then watch those videos

2:41 ~infoq

2:41 clojurebot: Titim gan éirí ort.

2:42 mehwork: it will give my brain a rich hickey i'm sure

2:42 bbloom: clojurebot: infoq is http://www.infoq.com/author/Rich-Hickey

2:42 clojurebot: Roger.

2:42 bbloom: ~infoq

2:42 clojurebot: infoq is http://www.infoq.com/author/Rich-Hickey

2:42 bbloom: hurray :-)

2:42 watch em all, twice :-)

2:42 mehwork: he looks very nerdy. I trust him already

4:53 jmaloney: So im having a bit of a problem I was wondering if i could get some help with. I am trying to write a partial derivative function (using the difference quotient) which takes a function a vector of values and which value to deriv on. I am having issues constructing a the values vector with a variable inserted into it

4:53 by variable i mean that i reduce the input of the function f to just one param to derive over

4:56 i need some crazy form of partial or something

4:57 borkdude: jmaloney maybe you can share some code via refheap ?

4:57 jmaloney refheap.com

4:58 jmaloney: borkdude lemme figure out refheap real fast

4:58 borkdude https://www.refheap.com/paste/7809

4:58 borkdude that work?

4:59 borkdude this has my f-prime function if that helps https://www.refheap.com/paste/7810

5:00 borkdude: jmaloney can you also show how you would use this function?

5:01 jmaloney: borkdude https://www.refheap.com/paste/7811

5:03 borkdude: jmaloney how is function f supposed to be called, with a collection or single value?

5:05 jmaloney: borkdude i want it to work on functions that except a collection of values, so they are multivariable, so i made f like this and just grabbed the first value of the vector

5:06 borkdude I'm pretty sure the issue is that the vector passed to it is [() 1 ()]. I just don't know how to construct it without getting empty lists

5:07 borkdude: ah

5:07 jmaloney what should [() 1 ()] be instead then?

5:07 jmaloney: borkdude [1]

5:08 borkdude wait no no no

5:09 borkdude: jmaloney maybe you mean nth?

5:09 jmaloney: borkdude its not really being passed in

5:09 borkdude: jmaloney you want f to have a vector of numbers?

5:10 jmaloney maybe it should help if you add some fictional type signatures to the functions

5:10 jmaloney in Haskell fashion

5:10 jmaloney: borkdude im making an anonymous function which should make (f [m]) the function being passed to f-prime

5:11 borkdude instead its creating the function #(f [() % ()])

5:12 borkdude: jmaloney f-prime expects a function and arguments, and applies those arguments to the function

5:13 jmaloney so I have no idea why you apply arguments to f in partial-deriv

5:13 jmaloney shouldn't you just pass f and the args seperately, not wrap it inside an anonmyous function?

5:14 jmaloney: borkdude well f-prime takes a one variable function so I need to reduce f to one variable (the one specified by n in the partial deriv call)

5:15 borkdude because we are only varying over one of the variables when taking the partial derivative

5:15 borkdude: jmaloney ah I see

5:16 jmaloney: borkdude maybe im just not thinking about it in the best way

5:17 borkdude: jmaloney maybe some fictional type signatures would help, becuase I have trouble understanding what goes in where exactly

5:17 jmaloney: borkdude lemme think about it some more. thanks for the help

5:18 borkdude: jmaloney it seems that f takes a vector of numbers? what you pass to it now is not a homogenous vector

5:19 jmaloney or does f take a vector of vector of numbers?

5:19 jmaloney: borkdude it takes a vector of numbers

5:19 borkdude: jmaloney you pass a vector of sequences to it now

5:19 jmaloney in f-prime

5:20 jmaloney: borkdude i realize this im not sure how to get around that

5:25 borkdude: jmaloney what should go into function f inside f-prime, when you call f-prime with [1]?

5:25 jmaloney: borkdude just a number

5:26 borkdude i want f-prime to get a function like #(f [2 3 % 1 2]) and eval it

5:27 borkdude: jmaloney random numbers surrounding it?

5:27 jmaloney: borkdude thats generalized to a 5 variable function

5:27 borkdude in this simple case #(f [%])

5:28 borkdude: jmaloney in this simple case that would simply be f, instead of the whole (fn [m] (f (vector …))))

5:29 jmaloney ah wait, confusion

5:29 jmaloney you want f-prime to have a function that takes a single number

5:29 jmaloney but the function f at the beginning is a multivalued function

5:30 jmaloney: borkdude yea

5:30 borkdude exactly

5:32 borkdude: jmaloney so in this simple case it would be (f-prime (fn [x] (f (vec x))) ...

5:32 jmaloney: borkdude yea

5:33 borkdude: jmaloney (f-prime (fn [x] (f (vector x))) ... ;; sorry, no vec

5:37 jmaloney maybe you want something like (concat (take n x) (vector x) (drop (inc n) x))

5:40 jmaloney: jmaloney i think that works!!

6:04 callen: $findfn [0 1 2] [0 2]

6:04 lazybot: []

6:04 callen: $findfn [0 1 2] 0 2

6:04 lazybot: []

6:04 callen: ,(even? 2)

6:05 clojurebot: true

6:05 callen: ,(filter even? [0 1 2])

6:05 clojurebot: (0 2)

6:06 hyPiRion: ,(filterv even? [0 1 2])

6:06 clojurebot: [0 2]

6:09 callen: hyPiRion: wait, when did the *v fns happen?

6:09 I don't suppose anyone here knows the difference between sandbar and friend, would they?

6:10 it seems like friend is more comprehensive and extensible, not too sure beyond that.

6:11 borkdude: callen the *v fns were added in clojure 1.4.0

6:11 hyPiRion: Aren't that many though

6:11 ,(removev even? [0 1 2]) ; <- Won't work

6:11 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: removev in this context, compiling:(NO_SOURCE_PATH:0)>

6:11 callen: borkdude: that explains why I didn't know about them.

6:12 borkdude: ,(-> #'filterv meta :added)

6:12 clojurebot: "1.4"

6:12 callen: <3 ->

6:19 borkdude: ,(filter (fn [me] (= (-> (second me) meta :added) "1.4")) (ns-publics 'clojure.core))

6:19 clojurebot: ([mapv #'clojure.core/mapv] [*data-readers* #'clojure.core/*data-readers*] [filterv #'clojure.core/filterv] [default-data-readers #'clojure.core/default-data-readers] [ex-info #'clojure.core/ex-info] ...)

7:07 dronlinux: CPU:intel(r) core(tm) i5-3210m @ 2.50ghz Memory:8031MB In-use:36% Display:1366X768 Microsoft Windows 7 Ultimate Edition, 64-bit Service Pack 1 (build 7601) Uptime:00:06:31:19 client:ThrashIRC

9:04 konr_trab: What do you use to deploy applications?

10:06 rodnaph_: hey, does anyone have suggestions for how to get started with clojurescript? i've got cljsbuild set up on my project, but now i want need to include some other libraries, and not sure where to begin... halp! thanks.

10:32 solussd: does compojure have something similar to noir.core/url-for to construct urls from routes + a param map?

10:58 rodnaph_: hi - does anyone know how to parse EDN (from a web service) in clojurescript - i can't find a read-string equivalent... or am i missing it?

11:02 nm - gorrit. cljs.reader/read-string

11:59 uvtc: Are "reader literals" the same thing as "tagged literals"?

12:00 It appears that the 1.4 changes.md file refers to them as "reader literals", but http://clojure.org/reader calls them "tagged literals".

12:11 Slow day here today. I asked on the ML.

12:30 jkkramer: uvtc: yeah, same thing - the #inst "2012-12-22…" syntax. And data readers are what handles them

12:31 I guess technically anything that's not sexps could be considered a reader literal, so tagged literal seems more correct

12:33 uvtc: jkkramer: thanks

12:33 antoineB: j clojurebot

12:45 duck1123: Did the rules for pushing stable releases to clojars change already? I pushed a new version of one of my libs, but it is not showing up

12:50 antoineB: what is wrong (case (type []) clojure.lang/PersistentVector "vector" "default") ?

12:58 raek: antoineB: case does not evaluate the clojure.lang/PersistentVector argument

12:58 so it tries to match it with _the symbol_ "clojure.lang/PersistentVector"

12:58 antoineB: ok

12:59 raek: you either need to something else than 'case' or you need to put the actual classes in the code

13:00 antoineB: https://gist.github.com/997652

13:21 xeqi: duck1123: when you do a push, you can log in and either see problems or promote it

13:22 we've stopped the auto promotion atm due to a concurrency bug

13:25 antoineB: raek: tahnks, but i don't manage to transform it into a clojurescript macro

13:39 mehwork: is there a good reason to use atoms/reset! instead of just var-set in non-concurrent/non-threaded code?

13:55 TimMc: xeqi: Oh, is there a stable-releases repo now?

13:57 xeqi: TimMc: https://groups.google.com/forum/?fromgroups=#!msg/clojure/AsPs9ZonRPQ/9ztNyKcMpB0J

13:58 lots of discussion of concurrency bug / WHY U USE GPG? after the first message tho

13:58 mehwork: what's a good way to know if you should make a separate defn when a line is getting too long, versus just putting an indented paran on a new line?

13:59 AimHere: Do it one way and try reading it. If it looks hard to read, do it the other way.

14:00 mehwork: it feels equally as readable to me

14:00 in this case anyway

14:09 TimMc: xeqi: Thanks.

14:16 xeqi, technomancy: I'd also like to see the documention link to some best-practices document on creating and managing software signing keys.

14:16 xeqi: I think technomancy has pplans to work on getting the docs int oshape next

14:16 TimMc: I know how to create and use GPG keys for personal use, but that doesn't mean I know how to use them securely for signing software.

14:41 Hmm, why would you want a software signing key to expire in a year or two?

14:50 xeqi: TimMc: to limit the damage time if you lose the private key ?

14:50 I'm not really sure

14:50 only started using it during the summer when lein-master started auto-signing

14:51 TimMc: xeqi: My concern is what happens to an existing release in 2 years.

14:52 Raynes: Hmm, I kind of like this Laser thing... but you know what it needs? CSS selectors! *forks*

14:53 xeqi: It just occurred to me that I don't keep copies of my old releases. I really should do that!

14:54 xeqi: or tag the commit in git

14:54 so you can just regenerate them

14:55 llasram: I'm not so happy about pushing new copies of old releases, even if they are from the same tagged commit

14:56 But since that seems to be the process -- joining the club and getting libs promoted

14:56 TimMc: xeqi: A rebuild 2 years later of the same commit is likely to have weird little differences sneak in.

14:57 I'm just going to download all my releases and keep them somewhere. I can sign them later.

14:58 xeqi: llasram: agreed, thats just the easiest way

14:59 if you know how to manually sign them, and make sha1+md5sum, then you could just PUT them to the right url

15:00 llasram: Oh. Should be pretty easy to create a tool to do that then. Just run w/ the dep coordinates as arguments, and it could do the rest

15:00 xeqi: yeah, just thought of that

15:00 though you might need some pom changes depending on the metadata

15:03 llasram: Oh? Like what?

15:05 xeqi: to promote to the releases repo they need url, description, license, and scm

15:06 llasram: Oh, ok. But most projects should already have those, right? Leiningen adds scm, and includes the others in the project.clj template

15:08 Well, that wasn't so bad

15:08 xeqi: I've got a couple that don't, but most new ones should

15:13 borkdude: someone interested in responding to this scala complexity story from a clojure (simple made easy) perspective? clojure doesn't even get a mention in this article http://branchandbound.net/blog/scala/2012/12/scala-is-like-git/

15:20 so how would cond-> et al be used? examples?

15:20 find the docs a bit cryptic

15:20 (talking about clojure 1.5-RC1

15:20 )

15:21 seangrove: borkdude: Pretty sure the ml had a few examples

15:24 Well, maybe not. Don't see any for that particular macro

15:24 They all seem very useful to me though

15:25 TimMc: borkdude: The IRC logs have some examples.

15:25 borkdude: hmm, is it a bug that clojure lets me define a var named like this? https://www.refheap.com/paste/7815

15:26 TimMc: ,(munge 'added-1.5)

15:26 clojurebot: added_1.5

15:27 seangrove: ,(let [added-1.5 2] added-1.5)

15:27 clojurebot: #<CompilerException java.lang.ClassFormatError: Illegal field name "added_1.5" in class sandbox$eval53, compiling:(NO_SOURCE_PATH:0)>

15:27 TimMc: Hrm. That should be added_1_DOT_5, I think

15:27 borkdude: (I was trying to get a list of all vars added in 1.5, then this happened to me)

15:29 llasram: Is '.' supposed to be valid in the qualified part of symbol which doesn't refer to a class?

15:29 TimMc: From Compiler.java: // '.', "_DOT_",

15:29 So I guess that's not supposed to be munged? :-/

15:30 llasram: "'.' has special meaning - it can be used one or more times in the middle of a symbol to designate a fully-qualified class name, e.g. java.util.BitSet, or in namespace names."

15:30 TimMc: ,(class 'added-1.5)

15:30 clojurebot: clojure.lang.Symbol

15:30 llasram: http://clojure.org/reader

15:30 TimMc: ,(class 'java.lang.String)

15:30 clojurebot: clojure.lang.Symbol

15:30 borkdude: llasram yes, but should clojure allow me to define it or not?

15:31 't was defined: https://www.refheap.com/paste/7816

15:32 TimMc: I want to see Clojure have a defined grammar for symbols.

15:32 This gets really annoying.

15:34 They could even do it in a backward-compatible way with soft-fails. "Use of $ in a symbol is accepted but not supported in version 1.3."

15:34 llasram: borkdude: Hmm. Good question. My vote would be that it shouldn't -- dots are for namespaces and packages

15:34 TimMc: +1

15:34 Errors involving mixes of munged/unmunged/partially-munged names are not friendly

15:34 TimMd: what have you done!

15:34 you've mutated my nick!

15:35 llasram: Oops! I meant

15:35 (inc TimMc)

15:35 lazybot: ⇒ 29

15:35 llasram: There we go

15:35 TimMc: I guess you didn't ++, so never mind.

15:40 borkdude: would it be worth it mentioning this on the mailing list or is this seen as annoying noise?

15:42 arrdem: is there an equivalent to (gensym) for keywords?

15:43 borkdude: too late, already mailed it

15:43 arrdem you can gensym and use that to create a keyword?

15:43 arrdem: ,(type (keyword (gensym)))

15:43 clojurebot: clojure.lang.Keyword

15:43 * arrdem shrugs

15:43 arrdem: ok, thanks borkdude

15:43 borkdude: ,(keyword (gensym))

15:43 clojurebot: :G__56

15:43 borkdude: ,(keyword (gensym))

15:43 clojurebot: :G__83

15:50 TimMc: ,(gensym)

15:50 clojurebot: G__110

15:50 TimMc: ,(= (gensym) 'G__111)

15:50 clojurebot: false

15:51 borkdude: ,(keyword (gensym))

15:51 clojurebot: :G__164

15:51 TimMc: arrdem: ^ gensym makes *slightly* less sense for keywords because keywords are interned

15:51 borkdude: ,(keyword (gensym))

15:51 clojurebot: :G__191

15:51 borkdude: ,(= :G__218 (keyword (gensym))

15:51 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

15:51 borkdude: ,(= :G__218 (keyword (gensym)))

15:51 clojurebot: false

15:51 borkdude: ,(keyword (gensym))

15:51 clojurebot: :G__269

15:52 TimMc: ,(= 'foo 'foo)

15:52 clojurebot: true

15:52 borkdude: ,(keyword (gensym))

15:52 clojurebot: :G__322

15:52 borkdude: ,(keyword (gensym))

15:52 clojurebot: :G__349

15:52 borkdude: I thought steps of 27, hmm

15:53 hmm

15:53 wait

15:53 ,(keyword (gensym))

15:53 clojurebot: :G__376

15:53 TimMc: Maybe someone else is playing with clojurebot in PM?

15:53 borkdude: ,(= (gensym) 'G__403))

15:53 bbloom: borkdude: you can't make any assumptions about the number of gensyms

15:53 clojurebot: true

15:53 borkdude: yeah :-)

15:53 TimMc: It's going by 3 on my REPL.

15:53 borkdude: you should put the gensym first, else the symbol already exists and the gesym will be something else

15:54 bbloom of course, but I got true =)

15:54 TimMc: ooooh

15:55 That doesn't happen in PLT Scheme!

15:59 borkdude: TimMc looking at the source I can't really see why this is

16:00 https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java

16:00 TimMc I mean line 459

16:01 TimMc maybe it's a co-incidence

16:05 ravster: hello all

16:09 I have a map in one namespace, and I'm trying to apply a function from another namespace on it. And it removes all the quotes that are in the map.

16:10 TimMc: borkdude: Hmm, order doesn't seem to matter.

16:10 I think that false was a mistake.

16:11 ravster: If you put the map and fn in the same namespace, do you have the same issue?

16:11 ravster: What do you mean by removing the quotes?

16:12 (I don't see why namespaces would matter here.)

16:18 ravster: TimMc: I put a (println) in the function, and instead of printing a {:foo "bar" :baz "quux"}, it printed {:foo bar :baz quux}

16:18 TimMc: Oh yeah, that's normal -- you still have strings.

16:18 borkdude: ,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])

16:18 ravster: This isn't giving problems when I feed the same map into the function from within the function's ns

16:18 clojurebot: [31 32 1]

16:18 borkdude: ,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])

16:18 clojurebot: [61 62 1]

16:18 borkdude: ,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])

16:18 clojurebot: [91 92 1]

16:18 borkdude: hm.

16:19 TimMc: ravster: Try (println (class (:foo my-map)))

16:19 borkdude: it depends on the context where gensym is called in how many steps it takes?

16:20 TimMc: borkdude: Sure, there are other things calling gensym during evaluation.

16:21 ravster: print[ln] prints for human consumption; pr(n) prints for reader consumption.

16:21 Try (prn my-map) instead.

16:21 ravster: TimMc: oh, okay

16:22 TimMc: ,(println {:foo "bar"})

16:22 clojurebot: {:foo bar}

16:22 TimMc: ,(prn {:foo "bar"})

16:22 clojurebot: {:foo "bar"}

16:22 ravster: TimMc: that did it. thanks

16:22 TimMc: "pr" stands for "print read-ably"

16:23 ,(println {:foo 'symbol})

16:23 clojurebot: {:foo symbol}

16:23 TimMc: ,(prn {:foo 'symbol})

16:23 clojurebot: {:foo symbol}

16:23 TimMc: ^ A case that might still be confusing.

16:24 The reason you don't see 'symbol in the output is that the input was not merely read, it was also evaluated, so the (quote ...) disappears from the data. :-)

16:25 ravster: oh wow. okay

16:25 TimMc: ,(pr-str (read-string "{:foo 'symbol}"))

16:25 clojurebot: "{:foo (quote symbol)}"

16:26 tgoossens: I'm making a simulator for lego robots. When i send a command to the simulator, it must execute that command and return true when it has succesfully finished. Whenever a new command is sent, the currently running must be stopped. Any tips in what direction i must start looking

16:28 is it the responsibility of the caller to first stop the simulator

16:28 or rather the simulator's

16:28 bbloom: tgoossens: what's the return true bit about? that sounds very C-like to have a function return success/failure like that

16:30 tgoossens: this is how i currently am thinking:

16:30 https://github.com/tgoossens/robotclj/blob/master/src/robotclj/core.clj

16:31 (usage at the bottom in the comment)

16:31 (drive v :forward)

16:31 in the case of simulator

16:31 * in general

16:31 bbloom: can the robot make any decisions?

16:31 or just follow a fixed list of steps?

16:32 tgoossens: a command can be "explore maze". Its an algorithm placed on the robot. If that is what you mean with taking descions, then yes

16:33 or different: the algorithm runs on the robot itself. A command is just to tell the robot to start executing the algorithm

16:33 bbloom: so yeah, if you upload the algorithm to the robot

16:34 and the client just sends commands and reads values out

16:34 you should use a command queue

16:34 and you just send some commands to the bot

16:36 tgoossens: bbloom: i'm looking at how agents might help me with that (never used them before)

16:48 hyPiRion: Oh nice, my Clojure stickers came

16:49 Raynes: Put on on your face.

16:50 one*

16:51 hyPiRion: Meh, don't want to waste them yet

16:51 llasram: Put one one his face? That doesn't make sense either

16:52 ivan: actually it is tempting

16:53 llasram: I think I'd probably avoid the guy/gal with the Clojure symbol face tattoo, honestly

16:53 dnolen: bbloom: keyword patch in master

16:53 AimHere: We've all got Clojure face tattoos in here

16:54 llasram: AimHere: You have changed my mental image of #clojure forever. Thanks!

16:54 borkdude: Why not wear it as a religious programmer's mark? http://en.wikipedia.org/wiki/Tikka_(forehead_mark)

16:55 AimHere: Come to think of it, has ANYONE ever used ESR's Hacker emblem?

16:56 For anything at all, that is, other than maybe plonking it down in a life implementation

17:00 ravster: how do I install and use a clojure library using lein when its not on clojars (Where do I download the code?)?

17:00 mehwork: what's the diff between print and pr

17:00 borkdude: ravster google for lein localrepo or smth

17:00 llasram: ravster: leiningen is pretty opinionated about JARs being in a repository.

17:01 Hmm, I haven't used it, but I've seen a lot of people have trouble with localrepo

17:01 ravster: Why is this library not in a repo?

17:01 And what's your scope of using it not-in-a-repo?

17:01 ravster: borkdude: okay

17:02 borkdude: ravster or upload it to clojars under your own name

17:02 ravster: llasram: dunno, I should probably ask the dev to put it on clojars

17:02 borkdude: ravster or set up your own (local) maven repo

17:06 hyPiRion: git clone and lein install

17:06 quick and dirty solution

17:06 ravster: hyPiRion: cool, will have a look at lein install

17:06 hyPiRion: thanks

17:06 llasram: (inc hyPiRion)

17:06 lazybot: ⇒ 10

17:07 borkdude: it must be a leiningen project then right, hyPiRion ?

17:07 hyPiRion: borkdude: yeah, it must be a leiningen project then

17:07 ravster: you're welcome :)

17:07 borkdude: hyPiRion ah, "a clojure library" is most often a leinigen project of course

17:11 Sgeo: If one vocab defines a tuple TUPLE: a b c d ; and another defines TUPLE: g b c d

17:11 Will the accessors conflict?

17:11 Can accessors conflict?

17:11 llasram: Sgeo: Who defines what how?

17:11 borkdude: Sgeo is this clojure? ;-)

17:11 Sgeo: borkdude, no, wrong channel

17:12 borkdude: ah, this is the wrong channel… let's rename everything then.

17:15 gfredericks: if I put a patch on jira and stuarth says "it would be nice if there was X also", does that mean I should attach a new patch for the whole thing or just for X?

17:25 muhoo: Raynes: i'm going to play with it, for sure. nice work.

17:26 i have to rewrite crudite to de-noir-ify it anyway. i may need stuff like laser in order to do what i want.

17:32 bbloom: dnolen: thanks

17:32 callen: this channel is filled with /lastlog champions.

17:32 dnolen: hmm, I wonder how long before somebody tries an CLJS AST -> CLJ source w/ this http://github.com/clojure/core.logic/commit/4e2affa39bd4cbc74bd1177152f45cb2b757bd5a

17:32 bbloom: np

17:33 callen: it's like the conversations are timeless...dare I say...persistent...

17:34 muhoo: how does the HTML generation in crudite work?

17:38 seangrove: dnolen: What would CLJS AST -> CLJ source be for?

17:38 ibdknox: code transforms

17:41 bbloom: dnolen: http://dev.clojure.org/jira/browse/CLJS-301 patch updated

17:42 er um wait a sec

17:42 nevermind

17:43 mehwork: how do you loop through a nested sequence and print out the values in human-readable form?

17:43 dnolen: ibdknox: have you started using blind? I saw that you submitted a patch?

17:43 mehwork: 30 min of googling and i still can't find one example of printing something in human readable form in clojure; everything prints a sequence

17:43 bbloom: dnolen: i think it's good, but i gotta run...

17:43 dnolen: bbloom: thx

17:44 seangrove: Uhg, datomic just keeps dying

17:44 mehwork: by human-readable i mean not a datatype and one value per line, say.

17:44 seangrove: Need more memory to run it on a proper server

17:45 mehwork: Like how do you print ([a b c [d e f]) as a b c d e f (all on their own lines)

17:45 a

17:45 b

17:45 etc

17:47 oh wait maybe with doall and map'ing println

17:48 works for single sequence anyway, arg

17:49 callen: seangrove: how much memory are you providing, just wondering?

17:50 mehwork: clojure seems to have a learning curve of 180 degrees - right back to whatever language you were using before :|

17:50 callen: mehwork: relax and try to enjoy yourself. Clojure has a lot of concepts built into it that are wholly alien to people from blub languages.

17:50 mehwork: that is simultaneously what makes it more substantial and worthwhile, but also more difficult.

17:51 mehwork: callen: i know. It's only been a week and i've learned a lot but still frustrating when i can't even figure out how to do the simplest of things

17:51 callen: mehwork: contrast: If you already know Python, learning Ruby isn't that hard. Why? Because it doesn't have much to teach you.

17:51 mehwork: do you have a book?

17:51 mehwork: true

17:51 programing clojure

17:51 seangrove: mehwork: Could just flatten it of course

17:51 callen: mehwork: my favorite is Clojure Programming, but let me say this

17:51 mehwork: the prob is all the examples i see are rarely what i want to do

17:51 seangrove: ,(map println (flatten [1 2 4 [5 6 7]]))

17:51 clojurebot: (1

17:51 2

17:51 nil 4

17:51 callen: mehwork: just try to relax, work through the book. Chill and fiddle.

17:52 clojurebot: nil 5

17:52 nil 6

17:52 nil 7

17:52 nil ...)

17:52 Sgeo: flatten?

17:52 seangrove: But I remember flatten is almost never what you want

17:52 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

17:52 seangrove: Hah, beat Sgeo to it

17:52 callen: mehwork: once I stopped demanding immediate 100% productivity of myself in Clojure and focused on experimentation and comprehension before trying to hack stuff up, I started enjoying myself more.

17:52 mehwork: it's always these obscure functions that end up being useful, like flatten. that function isn't covered in the book

17:52 that's why i hate books. they're so unreal world

17:52 callen: mehwork: people tend to get better at things that enjoy faster than things they resent or are frustrated with.

17:52 Sgeo: mehwork, don't use flatten

17:53 ibdknox: dnolen: yeah, I'm using blind

17:53 callen: mehwork: just relax and cool your jets and you'll learn Clojure faster. The real world will always be waiting for you, just spend time with the book so that you have a better foundation of comprehension and don't have to constantly grasp about for a solution to an artifact of misapprehension.

17:53 dnolen: ibdknox: cool!

17:53 mehwork: it feels like clojure won't pay off until i start doing concurrent programming. It has been fun though to some degree. When things work it's like 'yeeeess' and when they don't it's like 'f uuuuuuu'

17:53 ibdknox: dnolen: I may end up trying to add comment preservation to it

17:54 mehwork: i'll take your advice another week

17:54 callen: mehwork: it pays off in many arenas outside of that. You just don't know it well enough yet.

17:54 ibdknox: dnolen: then we can do lossless code transforms :)

17:54 callen: mehwork: I've learned many languages to varying degrees of proficiency, just try...to take my word for it and relax.

17:54 ibdknox: comments too? :P

17:54 mehwork: i have infinite patience. I mean i do php for a living

17:54 ibdknox: yep

17:54 dnolen: ibdknox: nice, yeah I'm looking forward to adding that as a dependency to CLJS - source mapping has stalled a bit because I need more column info.

17:55 mehwork: but then again i can use foreach for everything in php, including printing a nested data structure, which i'm so struggling to do in clojure right now ;p

17:55 callen: mehwork: I'd argue that PHP is a byproduct of extreme impatience with comprehension and good design and always shooting for the most readily available "solution" to a misunderstood problem. But duly noted.

17:55 mehwork: not at all trying to say that php is a better designed language than clojure in any way, shape or form, though

17:55 ibdknox: dnolen: I have a branch that adds position info to basically everything, including end-line and end-column

17:55 seangrove: callen: Not much, maybe ~512MB

17:55 callen: dnolen: aha, I was wondering what happened to sourcemaps.

17:55 mehwork: i just wonder if clojure can be a real world language more than a hobby thing in my spare time

17:56 dnolen: ibdknox: nice

17:56 callen: mehwork: that all depends on you and you alone

17:56 mehwork: is clojure like nodejs? not quite ready for prime time even though enthusiasts say it is?

17:56 dnolen: callen: soon as 1.5.0 goes out the door I will probably just merge the work into master

17:56 mehwork: and if so when will it be

17:56 callen: mehwork: plenty of companies and individual make a living off Clojure. Your obsession with "real world" here is harmful, not constructive. Learn for the sake of learning. If you find an opportunity to use Clojure, so be it. But don't let your whole life be dictated by economic priorities.

17:57 dnolen: callen: the infrastructure is in place - but some serious changes to emission are required for the next phase

17:57 borkdude: mehwork clojure is quite young in programming languages terms, also it's ecosystem (editors, libraries, etc) are still developing quite fast

17:57 ibdknox: dnolen: oh?

17:57 callen: dnolen: I ask because I'm in the middle of converting a frontend JS/HTML/CSS guy and he's an aggressive debugger like me. That means sourcemaps are sorely needed. Your work to that end is much appreciated btw.

17:57 ibdknox: dnolen: what kinds of changes to emission?

17:57 dnolen: ibdknox: yeah, CLJS just emits munged strings when it should emit vars nearly all the time.

17:58 callen: dnolen: I wish you weren't across the country, I'd get you a pint :P

17:58 mehwork: callen: well i'd like to. that's why i started learning it because i was told by other programmers that lisp will make you a better programmer just by knowing it. I've learned all the basic concepts this week and there's no way that it's changed me at all or will make me write code differently in other languages

17:58 dnolen: ibdknox: I want line/column information to tracked in pretty much one place - emit :var

17:58 ivan: mehwork: are you using regular Clojure datastructures? you can just print those the normal way

17:58 mehwork: maybe it's because i've already experienced functions HO functions in python and javascript

17:58 dnolen: ibdknox: but many names just get passed through as strings - which is just wrong anyway.

17:58 borkdude: mehwork you only did clojure for a week?

17:58 mehwork: ivan but i dont want to print it 'as' a data strcuture

17:58 ibdknox: dnolen: ah

17:59 mehwork: ivan iow i don't want to see []'s ()'s {}'s around what i'm printing

17:59 dnolen: callen: thx :)

17:59 mehwork: borkdude: yeah

18:00 borkdude: mehwork you expect to learn a new programming language in just one week and then have an opinion about it? try a year

18:00 dnolen: ibdknox: I can't imagine that will effect anything you're doing right?

18:00 mehwork: borkdude: sure, i did with python, ruby, javasript, php, ...

18:00 ibdknox: dnolen: not that I can think of

18:00 mehwork: borkdude: i'm trying to understand what exactly i will have leanred in a year that i havent learned already that will make a huge difference...

18:01 lisp is an extremely simple language

18:01 maybe it's because clojure isn't purely functional and i'm able to write it in a similar way to how i write everythign else, idk

18:02 it doesn't feel much diff than using a lot of list comprehensions and generators in python, for example

18:02 other than it's a looot harder to change the value of a variable

18:02 ivan: mehwork: (doseq [[k v] {:a :b :x :z}] (print k v \newline))

18:02 borkdude: mehwork maybe clojure isn't just really what you are looking for - for many people clojure is the answer to "I want a lisp on the JVM"

18:03 mehwork: maybe. I'm just dissapointed in the sense that i thought it would be some earthshattering 'change the way you think forever' like i always heard. Maybe you have to get to an advanced place with it for that to happen?

18:03 gfredericks: "I want a practical functional language with persistent data structures"

18:03 borkdude: mehwork so if lisp and JVM both aren't appealing to you, maybe dynamically typed and functional will, but I don't know what you're looking for

18:04 ivan: you have to get burned by mutation a hundred times first

18:04 mehwork: is the 'not having side effects' really the only enlightening thing about it?

18:04 gfredericks: mehwork: if you're not used to immutable data structures, that can be a valuable aspect as well

18:04 seangrove: mehwork: Macros are another obvious one

18:04 mehwork: ivan i have been, but i can usually write unit tests. Granted i havent done any real threaded programming

18:04 gfredericks: that goes along with "no side effects"

18:05 mehwork: macros are usually a clever, and thus bad, thing. at least in other languages. I haven't done much with them in clojure yet. Anyway i'll stick to it a little longer

18:05 llasram: mehwork: After Clojure really "clicked," it definitely changed how I write code. My co-workers joke that my Ruby/Python is Clojure in Ruby/Python syntax

18:05 mehwork: llasram: seems like a good way to write unreadable code

18:06 gfredericks: llasram: I did that and my coworkers called it "frankenruby" and deleted it

18:06 seangrove: mehwork: Having powerful features in a language doesn't absolve you of the responsibility to use them wisely

18:06 ibdknox: the real lessons are not any of the things mentioned so far, I don't think. Those are simply aspects of Clojure. The real lesson is in what the combination of all these things moves you towards.

18:06 seangrove: I'd agree with ibdknox

18:06 ibdknox: The way you naturally end up writing Clojure is what's so interesting

18:07 and *that* is not something you can learn in a week

18:07 seangrove: But Clojure is pretty practical, it's not required to be earth-shattering

18:07 mehwork: it reminds me a lot of what perl felt like the first week i learned it

18:07 terse and hard to read but practical

18:08 ibdknox: I actually find Clojure to be easier to read than most any language these days

18:08 mehwork: it's nice not having useless braces and semicolons everywhere like in javascript and php

18:08 borkdude: it largely depends on how it's written. you can obfuscate pretty much anything

18:08 gfredericks: especially languages with lots of infix things with precedences that you have to memorize

18:08 mehwork: but python and ruby dont have them either

18:09 * gfredericks coughs out the word "haskell"

18:09 mehwork: i guess i'm mainly spoiled by python and ruby

18:09 they're very practical, easy to read and learn. Clojure has to somehow beat them at something for me to keep it up i guess

18:09 gfredericks: mehwork: after using clojure for 4 years, and ruby for about the same amount of time, programming in ruby makes me terribly uncomfortable

18:09 mehwork: maybe the problem is i don't really care about the jvm

18:10 but even if i did, there's still jruby and jython

18:10 gfredericks: how come

18:10 gfredericks: mehwork: 60% pervasive mutability, 30% having to fit everything into an OO design

18:10 borkdude: mehwork maybe this is interesting to see http://tin.nu/sudoku.html - just to compare python and clojure

18:11 xeqi: gfredericks: 10% other?

18:11 gfredericks: yeah there's a long tail

18:11 clj-newb-2345: has anyone tried to build an "OS" on top of java or clojure?

18:11 gfredericks: somewhere in the long tail is the fact that "- 2" and "-2" have different semantics :)

18:11 clj-newb-2345: besides the inability to kill java threads, it seems like it'd be rather cute

18:12 epitron: gfredericks: do you have any examples of frankenruby? i'm curious what it looks like :)

18:12 ibdknox: I don't care about the JVM

18:12 never have

18:12 gfredericks: epitron: A) all your code goes in static methods on modules (i.e., namespaces); B) use hamster for data structures; C) use some atoms lib for state

18:12 clj-newb-2345: ibdknox: what do you run clojure on?

18:13 gfredericks: epitron: doubt I have any links, but I'll let you imagine it

18:13 epitron: gfredericks: what's hamster?

18:13 gfredericks: immutable data structures

18:13 epitron: ahh

18:13 and what's an atoms lib?

18:13 gfredericks: a lib that gives you atoms. I.e., a reference type that holds a value

18:14 epitron: how is that different from a variable?

18:14 gfredericks: more awkward

18:14 and maybe threadsafe

18:14 epitron: :O

18:14 so basically, you use some libraries that make ruby immutable?

18:14 gfredericks: well it gives you immutable data structures; doesn't make anything else immutable

18:14 daimrod: "maybe threadsafe" doesn't sound really safe...

18:15 ibdknox: clj-newb-2345: I use mostly cljs these days.

18:15 clj-newb-2345: so a lot of nodejs

18:15 gfredericks: daimrod: I meant it depends on the lib; not that the goal is to sometimes be threadsafe

18:15 clj-newb-2345: I piad with cljs for a while; couldn't get used to it's lack of debugging tools

18:15 but definitely clojure-ish

18:15 gfredericks: ibdknox: I'm curious what are the benefits of node-cljs over jvm-clj

18:16 epitron: clj-newb-2345: have you tried lighttable?

18:16 clj-newb-2345: gfredericks: having never tried node, I bet it starts up faster :-)

18:16 epitron: I thought itw as still in development

18:17 mehwork: the other main thing that's bugging me about clojure is how slow lein is. Everytime i type 'lein run' on my super tiny project it takes 5 seconds to start on a super fast machine which slows development down a ton. WHat's up with that?

18:17 epitron: clj-newb-2345: it is, but it's usable

18:17 they guy made a game with it recently

18:17 borkdude: mehwork what version of leiningen are you using?

18:17 ibdknox: gfredericks: in my case? It solved the deployment story for me. Aside from startup time, I wouldn't say one is better than the other... they're just different ecosystems

18:17 mehwork: borkdude: 1.7.1

18:17 epitron: http://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/

18:18 ibdknox: mehwork: JVM startup is really slow

18:18 clj-newb-2345: mehwork: I solved that problem with a ~100 line topological sort algorithm that figured out what module needed reloading nad reloaded them (with one persistent lein session)

18:18 llasram: gfredericks: I can see the risk of frakenruby, but I mostly meant structuring things to avoid locking values and operations into classes. A bit more of a functional style to individual methods perhaps, but nothing too overboard

18:18 ibdknox: epitron: lol that guy is me ;)

18:18 mehwork: clj-newb-2345: great, but i have no idea what you just said

18:18 epitron: ibdknox: o hai!

18:18 :)

18:19 clj-newb-2345: mehwork: to get around the lein startup time, you can run one lein session, then have it dynamically reload your code with you make modifications

18:19 llasram: mehwork: For one thing, the workflow most people use doesn't involve spinning up a new JVM (as with `lein run`) very ofter

18:19 (inc clj-newb-2345)

18:19 mehwork: clj-newb-2345: interesting. how?

18:19 lazybot: ⇒ 1

18:19 llasram: mehwork: What editor are you using?

18:19 mehwork: vi

18:19 borkdude: mehwork 1.7.1 is considered old, but it's probably the JVM startup time ibdknox is talking about. Usually you don't need to restart a clojure project that often though, while developing.

18:19 clj-newb-2345: hmm, I'ma ctually interested in hearing llasram's solution first :-)

18:19 [mine is a bit adhoc]

18:20 * clj-newb-2345 hopes it involves vim rather than emacs

18:20 llasram: I use emacs myself, but there's https://github.com/sattvik/lein-tarsier and https://github.com/tpope/vim-foreplay

18:21 You run a REPL server once, then connect to it from your editor, then restart it v v rarely

18:21 mehwork: cool

18:21 clj-newb-2345: gah, nailgun <-- always had weird situations where I had to resttart everything

18:22 llasram: Yeah. The vim side definitely doesn't have as many people working on it

18:22 mehwork: why is emacs favored for lisp languages

18:22 clj-newb-2345: I don't really mind emacs, it's elisp that I can't stand; if someone write an editor in clojure ....

18:22 gfredericks: paredit!

18:23 seangrove: <3 paredit

18:24 mehwork: someone should make a lisp based operating system, instead of in C. C being so popular makes c-like languages (perl, python, etc) popular. Lisp seems like it still has a lot to prove

18:25 gfredericks: once the hardware runs lisp...

18:25 mehwork: plus i think if there was such a project i'd jump on contributing because i hate c but lisp is tolerable

18:25 stain_: http://en.wikipedia.org/wiki/Lisp_machine - you can watch it in its glory in Boston at least

18:25 clj-newb-2345: hmm, let's call it symbolics

18:26 mehwork: itd probably be best if it was a new project on github, and didn't have the word 'museum' attaached to it ;)

18:26 ibdknox: clj-newb-2345: I *am* writing an editor in clj :p

18:26 dnolen: mehwork: heh, Lisp doesn't have to prove anything. Interpreted languages, dynamic memory allocation, high level meta programming - that all started with Lisp.

18:26 clj-newb-2345: ibdknox: cool, tell me more

18:26 ibdknox: lol

18:26 clj-newb-2345: Light Table

18:27 mehwork: dnolen: i just mean for lisp to get the respect it deserves

18:27 gfredericks: the googles know about it

18:27 epitron: mehwork: i think the major problem is that few languages can produce C-linkable libraries, and the whole OS is build out of those

18:27 clj-newb-2345: ibdknox: ah, you are the light table guy?

18:27 ibdknox: yeah

18:27 epitron: mehwork: did you see alan kay's little experiment?

18:27 mehwork: otherwise it makes lisp seem like smalltalk in the sense of being influential but not good enough o its own

18:27 epitron: which one

18:27 clj-newb-2345: ibdknox: I should go tell the YC guys you're wasting time on IRC rather than coding. :-)

18:27 epitron: mehwork: STEPS

18:27 ibdknox: lol

18:28 mehwork: no

18:28 epitron: mehwork: quick summary: reinventing the entire OS, from the metal up to the UI, in under 20,000 lines of code

18:28 spent 5 years on it

18:28 they managed to do it

18:28 clj-newb-2345: epitron: is this the FONCs guys ?

18:28 epitron: it's made out of language transformers

18:28 clj-newb-2345: that's the one!

18:28 seangrove: ibdknox: Any emails from pg these days?

18:29 epitron: it currently takes the form of a bunch of talks and a bunch of papers: http://vpri.org/html/writings.php

18:29 mehwork: so is the real problem not lying with lisp, but with programmers in general who tend to like oop/procedural based languages?

18:29 seangrove: Few things more unnerving than pg asking for a status update :P

18:29 clj-newb-2345: epitron: wait, so they actually have an OS rather than a bunch of ideas? [I'm on the mailing list, and every week, there's some new guy that pops up, proposes a bunchof ground shaking ideas, and doesn't implement anything]

18:29 epitron: mehwork: i think picking any one language as the foundation of your OS will mean that you can't evolve it

18:29 STEPS is designed to be late bound all the way through

18:29 mehwork: people hated whitespace in python but it still grows in popularity. Why is 'parens' in lisp such a deal breaker to most people?

18:29 epitron: so that it can evolve

18:30 dnolen: mehwork: I'm not sure there is a problem.

18:30 epitron: mehwork: people are different :)

18:30 ibdknox: seangrove: hm? we talked with him a bit ago.

18:30 epitron: that doesn't mean we shouldn't work together

18:30 seangrove: ibdknox: I haven't been in for office hours for awhile, and just got an email out of the blue asking for a status update

18:30 Still wondering what set it off...

18:31 clj-newb-2345: seangrove: what startup are you workingon?

18:31 seangrove: Zenbox

18:31 ibdknox: seangrove: he does that every once in a while

18:31 mehwork: there seems to be something strange in the idea that i should be open minded enough to switch from ruby to clojure/lisp but then not be open minded enough to 'go back' to any other languages after i've done so

18:32 every language seems to say the same thing "come to us and you'll never wanna go back"

18:32 epitron: languages are made of two things: semantics and syntax

18:32 mehwork: every high level language anyway

18:32 epitron: syntax is like a "theme"

18:32 you can implement the same semantics with many different syntaxes

18:32 clj-newb-2345: i.e. they're all turing complete

18:32 borkdude: mehwork what about choosing many languages at the same time and choosing them wisely for whatever you're working on

18:32 epitron: it would be nice if languages using the same semantics could just be translated between each other

18:32 mehwork: then how can one objectively be better

18:32 epitron: clj-newb-2345: turing completeness is a very trivial semantic :)

18:33 ibdknox: mehwork: fwiw, I've used most mainstream languages out there extensively, even owned the future of a couple, and don't care to go back to any of them :)

18:33 mehwork: ibdknox: right but i can go to #ruby, #python, etc and here the same thing about those languages

18:33 and have them say they tried clojure and went back

18:33 clj-newb-2345: clojure is almost perfect, it lacks one thing for me: the conciseness of mathematica, unfortunatey, that doesn't play well with ()'s

18:33 mehwork: it all seems very subjective

18:33 ibdknox: and it is

18:33 dnolen: mehwork: to me Ruby & Python are not different in any way that is interesting.

18:33 clj-newb-2345: no, some people are wrong, others pick clojure

18:34 epitron: a language is a tool.

18:34 mehwork: it feels like the same arguments as emacs vs vim

18:34 personal preference and nothing more

18:34 ibdknox: at some level that is true

18:34 epitron: if you wanted to make webapps, ruby is probably a better choice at the moment :)

18:34 mehwork: clojure will be better at certain things but it can be better at literally everything

18:34 and that's why there's always a tug-of-war

18:34 epitron: if you want to do hardcore shit, clojure seems a better choice

18:35 mehwork: epitron: well for example, why should a web developer choose clojure/ring over ruby on rails or python django

18:35 clj-newb-2345: if cojure had llvm bindings, so one could create low latency code, it'd be complete

18:36 epitron: mehwork: the usefulness of a language for solving a certain problem depends on the language's capabilities and the size of the developer community

18:36 mehwork: why doesn't it have llvm bindings? evne haskell does

18:36 epitron: because nobody does language development in ruby :)

18:36 if 100,000 people started making webapps in clojure, it would be awesome for making webapps :)

18:36 mehwork: epitron: well Io has a huge library set and is very capable, but no one uses it

18:36 dnolen: mehwork: the problem is that programmers only want to talk about the good stuff. Those systems have incredible amounts of bad stuff.

18:36 mehwork: so maybe it only coems down to size of community

18:36 epitron: yep

18:36 right

18:36 but you grow your community by making the language good at doing something

18:36 and people start using that tool

18:37 Io probably never did that

18:37 dnolen: Io is dog slow

18:37 epitron: hah

18:37 mehwork: Io decided to become an embedded language

18:37 epitron: that's good for NOTHING

18:38 mehwork: on the server there's no monopoly like javascript on the web client

18:38 epitron: there are ecosystems

18:38 a thriving ecosystem makes it easy to do things

18:38 a sparse ecosystem means you have to develop your own things

18:38 mehwork: programmers always talk about how we should use the right tool for the job, yet we make all these different languages and none of them perfect

18:39 in the real world we'd make an automatic drill instead of screw driver, just just to be an alternative but because it's better

18:39 epitron: it's not entirely the language

18:39 it's also the libraries

18:39 mehwork: there's only so many nail hammers and they all look the same

18:39 epitron: ruby wasn't good for webapps until DHH made rails

18:39 mehwork: that's using the right tool

18:40 Dirklectisch: Hi everyone!

18:40 I could use some advice on dynamically loading namespaces on runtime. Depending on the users config file the code should decide from which namespace to get some functions. I tried:

18:40 (use [(get config :parser 'myapp.parsers.default) :only '(load-tasks)])

18:40 Problem is that changing your config file now requires you to recompile the whole project before it will actually use the other namespace. Any pointers?

18:40 mehwork: i just feel like everything we're doing is prehistoric and we're still stuck in prehistoric times and my grand kids won't be doing c, python, ruby, or lisp or javascript

18:40 at least not in their current forms

18:40 epitron: hah

18:40 i agree with the first part

18:41 i'm not sure about the second :)

18:41 mehwork: the second part has a sad likelihood of being wrong

18:41 based of history :/

18:41 epitron: heh

18:41 in one of vernor vinge's books, humanity had spread across the galaxy.. and their software stack was this gigantic mountain of hacks

18:42 it was thousands of years of cruft piled on top of cruft

18:42 mehwork: like our spoken languages?

18:42 epitron: i suppose!

18:42 stain_: when I learnt programming it was Pascal that was the big thing - obviously kids these days don't know what that is. C was there back then,. being just as difficult to use properly as of today

18:42 borkdude: mehwork I think you're right in the sense that we want to specify the solution to a problem more declaratively than is now the case in almost all existing programming languages

18:43 mehwork: borkdude: iow i shouldn't be excited about any current lang. Maybe that's teh right attitude, rather than trying to find the 'one' to be excited about

18:43 epitron: declarativeness is basically just stating the goals and letting something else build the program :)

18:43 borkdude: mehwork people say: functional programming is more about the "what", then the "how", that's crap - we're still telling "how" in clojure or Haskell

18:43 mehwork: if the goal is to solve problems and right "cool apps" then i could do that in php or javascript

18:43 or rails

18:44 epitron: and the only reason that's tenable is because there are so many people writing stuff for js and ruby

18:44 you have a mountain of libraries

18:44 it's like perl's cpan

18:44 perl is pretty gross, but everything is already written :)

18:44 borkdude: but as long as we're stuck in pre-history, I like clojure ;-)

18:44 mehwork: willlllllmaaaa

18:44 maybe i was born in the wrong century, but i'm not happy with anything right now

18:44 or maybe i just need some anti-depressants

18:45 epitron: you ever read alarmingdevelopment.org? :)

18:45 mehwork: nope

18:45 borkdude: mehwork are you living in northern scandinavia?

18:45 mehwork: i've read lambda-the-ultimate

18:45 epitron: http://alarmingdevelopment.org/?p=6

18:45 mehwork: borkdude: beautiful southern california. Where everyone is a rails brogrammer or javasript dude

18:46 epitron: or a visionary

18:46 ^_^

18:46 mehwork: i said javascript dude

18:46 epitron: visionaries hire the javascript dudes

18:46 mehwork: html5 is the only vision people have right now

18:46 epitron: to make the next facebook

18:47 it's facebook... FOR CARS

18:47 mehwork: sadly people prefer to copy rather than innovate

18:47 vsauce on youtube did a good piece on why people prefer familiar things, which is why most music sounds the same

18:48 even though there's a huge range of potential music that's not been explored

18:48 epitron: humans have tiny brains

18:48 mehwork: clojure will get enough of the next generation doing lisp for it to feel natural to them and thus become familiar and mainstream

18:48 epitron: they can't take a 5000 year old evolved artform and reinvent it from scratch by themselves :)

18:49 mehwork: maybe the aliens will save us

18:49 and bring us their wares and languages

18:49 epitron: or we'll just juice ourselves up

18:49 * epitron gets brain V2

18:49 mehwork: humans are good at deconstructing

18:50 the thigns we've reverse engineered just to make money is amazing. We really need to reverse engineer some alien stuff already

18:50 OR we need to stop teaching kids that drugs are bad :)

18:50 acid for everyone!

18:51 why is it acceptible to get drunk at your holiday party and *lose* braincells and come in hung over and stupid and tired

18:51 but pot or acid is the devil!

18:51 wonder if that will be the case 100 years from now

18:52 epitron: Beer is one of the world's oldest prepared beverages, possibly dating back to the early Neolithic or 9500 BC, when cereal was first farmed,[11] and is recorded in the written history of ancient Egypt and Mesopotamia.[12] Archaeologists speculate that beer was instrumental in the formation of civilisations.[13]

18:52 mehwork: considering that every commercial on tv is for some dangeros prescription drug, i doubt it

18:52 epitron: pot and acid on the other hand were formative in making people sit around and not work :D

18:52 borkdude: epitron I like to hear that, thanks ;)

18:53 mehwork: beer or alcohol in general?

18:53 epitron: don't split hairs

18:53 borkdude: gtg

18:55 mehwork: tbh i've never done drugs so i'm speaking from others' experiences which could be totally false. Surely mandelbrot's were discovered by a stoner

18:55 all i know is classic rock > justin beiber

18:55 and the osmands

18:55 epitron: pot and acid definitely help art. but not industrialization.

18:56 industrialization requires lots of little robots

18:56 mehwork: well which is programming closer to

18:56 epitron: exactly

18:56 seangrove: epitron: Weird

18:56 mehwork: i'd like to artfully program some robots

18:56 seangrove: I feel acid should basically be a required experience for everyone

18:57 epitron: they tried that in the 60's

18:57 it was bad :D

18:57 mehwork: they over tried it

18:57 epitron: people realized what was going on, and decided to stop being robots

18:58 mehwork: i don't think drugs are the only way to expad your mind

18:58 just a shortcut

18:58 epitron: yep

18:58 one that can backfire

18:58 mehwork: music can do it

18:58 meditation

18:58 exercise

18:58 epitron: reading books

18:58 mehwork: learnin lisp :|

18:58 epitron: sleep deprivation

18:58 mehwork: though i'm having a bad trip

18:58 feeling like the walls ()'s are closing in on me

19:23 bosie: TimMc:t

19:25 TimMc: sorry

19:46 hyPiRion: Aaah, GitHub is down

19:46 ibdknox: oh no's

19:47 hyPiRion: Indeed

19:58 bbloom: hyPiRion: luckily, git itself can't go down

19:58 :-)

20:00 hyPiRion: Yeah, that's actually very nice

20:00 But I still have possibility to download 1.5.0 RC 1

20:01 have no*

20:01 mehwork: won't be long till someone makes a virus that infects all code on github

20:02 gfredericks: that would be difficult to do undetected.

20:02 mehwork: would get deteted very quickly but the damage would already be done

20:03 AimHere: There was an HN post about someone using a github pull request to attempt to (badly) deface someone's website

20:03 Sortof a "This virus uses the honour system. Please trash your own files"

20:04 mehwork: i haven't seen a defaced website in a long time. Used to see them daily in the late 90s

20:05 gfredericks: you could definitely infect direct downloads

20:05 mehwork: maybe i just don't pay attention

20:05 gfredericks: good thing we never download files directly from github, like e.g. lein

20:05 Bronsa: http://kimochi.ath.cx/up/687869eb8e83448319778f19704f01e7.gz clojure 1.5-RC1

20:07 hyPiRion: Bronsa: I believe it's up in the maven central too, I need the source :(

20:07 but thanks anyway

20:07 (inc Bronsa)

20:07 Bronsa: hyPiRion: yeah, that's the source

20:07 lazybot: ⇒ 2

20:07 hyPiRion: oh

20:08 But without the git repo

20:08 Oh well, not too critical when testing patches

20:09 Bronsa: with the .git it would have been 35MB :P

20:09 hyPiRion: --depth=30 :D

20:14 Raynes: ~gourds

20:14 clojurebot: SQUEEZE HIM!

20:14 Raynes: Gets me every time.

20:16 hyPiRion: heh

20:22 * gfredericks turns a (let [foos (->> thing (filter ...) (map ...))] (for [foo foos] ...)) into just a for

20:26 * bbloom is always pleasantly surprised when he remembers that 'for exists

20:27 gfredericks: I wonder how many of my lengthy ->> forms could be turned into lengthy for's

20:29 amalloy: all of them, man

20:30 gfredericks: not the perverse ones that end in (let ...) or (try ...)

20:30 or (defn ...)

20:31 amalloy: pretty sure behavior like that gets you smited

20:32 hyPiRion: gfredericks: (->> ... ) with a... defn?

20:34 gfredericks: (->> [1 2 3] (mapcat #(list x %)) (apply +) with-out-str (defn totes []) (let [x 15]))

20:34 * gfredericks wonders what is the opposite of idiomatic

20:35 * gfredericks prepares to be smited

20:36 hyPiRion: hahah, wow

20:36 gfredericks: could add to the end of that (->> ... (catch Exception e) (try (/ 8 0))) for completeness

20:36 haha no you can't

20:37 that must be CLJ-1121

20:38 hyPiRion: That is a feature we need for lazybot

20:38 Lookup issues

20:38 gfredericks: $google CLJ-1121

20:38 lazybot: [[#CLJ-1121] -> and ->> have unexpected behavior when combined ...] http://dev.clojure.org/jira/browse/CLJ-1121

20:38 hyPiRion: $jira CLJ-1121

20:38 :(

20:38 though that one suffices, I suppose

20:43 gfredericks: yep it's indeed related to that issue

20:44 clearly not enough clojurians write code like ##(->> :phew (catch Exception e) (try (/ 42 0))) or we would have noticed this a while ago

20:44 lazybot: java.lang.SecurityException: You tripped the alarm! catch is bad!

20:44 gfredericks: lazybot: thanks kid

20:45 hyPiRion: Who catch things anyway

20:46 gfredericks: (defmacro without-problems [& forms] `(try ~@forms (catch Throwable t :it-all-good)))

21:08 are data readers not meant to be used in clojure source?

21:08 hyPiRion: In the source? Why asking

21:08 ?

21:08 gfredericks: I defined one for dates

21:09 then when I try (eval (list 'list my-date)) I get "Can't embed object in code"

21:09 so if eval doesn't accept the object being there I'm not sure why the regular compiler would?

21:09 it works with a uuid though

21:09 hyPiRion: Oh, I thought you meant "core.clj" in Clojure

21:10 gfredericks: ah no

21:10 the exception msg continues with "maybe print-dup not defined"

21:10 but I can't imagine what print-dup has to do with eval

21:12 oh nevermind I figured out my actual problem I think

21:13 well the eval might well still be a problem

21:14 hyPiRion: oh hey, this may be interesting

21:14 gfredericks: should this be considered a bug?

21:15 I can work around it with good old clojure.walk; but it's still inconvenient

21:15 hyPiRion: What about read-string. What does it return?

21:15 gfredericks: the data reader is working correctly

21:16 yeah, I just confirmed that the compiler accepts the literal in code, but c.c/eval doesn't

21:16 hyPiRion: Could you hook it in with *data-readers*?

21:16 gfredericks: the thing is already read at the time

21:17 it's an object at this point

21:17 hyPiRion: Hm.

21:17 gfredericks: i.e., I can (def thing #my/date [2012 1 1]) but I cannot (eval '(def thing #my/date [2012 1 1]))

21:17 hyPiRion: Funny thing: do "lein repl" and type in "#uuid 1234"

21:18 gfredericks: that's probably nrepl crashing?

21:18 hyPiRion: it turns out an assertion error, so probably

21:19 ,#uuid 1234

21:19 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.AssertionError: Assert failed: (string? form)>

21:19 gfredericks: probably nrepl only expects some particular set of errors from the reader

21:19 hyPiRion: &#uuid 1234

21:19 Most likely

21:19 echo echo

21:19 lazybot: echo

21:34 gfredericks: oh I take it back

21:34 the compiler sometimes rejects it as well

21:34 I can (def thing #my/date [2012 1 1]) but cannot (defn thing [] #my/date [2012 1 1])

21:34 I guess def doesn't really get compiled the same way

21:35 hyPiRion: what does `thing` print?

21:35 gfredericks: in the former case it would print the object using the print-method I defined. In the latter it's a compile error

21:39 I guess def doesn't necessarily involve any compiling at all

21:40 yeah eval allows the def as well

21:44 at least they're consistent. But that makes data readers seem 2% less useful

21:45 mehwork: can't believe github is still down

21:46 gfredericks: I bet github can't believe github is down in the middle of the holidays like this

21:49 amalloy: i wonder how long they'd have to stay down before people start switching to bitbucket

21:49 gfredericks: I wonder what the halflife is

21:49 every week half of the remaining users switch to bitbucket?

21:56 * gfredericks notices the vowel similarity between "bitbucket" and "github"

21:56 * gfredericks wonders if bithub.com and gitbucket.com are taken

21:58 mehwork: no but bighub.com is taken

22:14 muhoo: *sigh* infoq presentations do not work on android tablets

22:45 wingy: noooo

22:53 muhoo: well not on mine at least (CM9)

23:01 ivan: heh, first google suggestion for "infoq" is "infoq rich hickey"

23:03 video is working for me in Chrome on Nexus 4

23:06 muhoo: ivan: thanks! chrome works, i was using firefox.

23:13 pppppppppaul: Hey guys

23:14 Github is back up

23:14 Best Xmas ever

23:16 wingy: thought the end of the world wasn't over yet

23:39 hey guys .. i have a hash map and wanna iterate only the ones with :item-type.property/x as keys .. how do i do that? https://www.refheap.com/paste/7822

23:53 theatticlight: Why are you putting your keys in separate namespaces?

23:53 TimMc: theatticlight: Why not?

23:53 theatticlight: Just wondering... seems odd to me.

23:53 abp: ,(map :kw [{:kw 1 ;x 2} {:kw 6 ;x 5}])

23:53 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

23:54 TimMc: abp: ;

23:54 abp: ,(map :kw [{:kw 1 :x 2} {:kw 6 :x 5}])

23:54 clojurebot: (1 6)

23:54 abp: wingy ^

23:54 TimMc: Not quite, wingy wants keywords from a certain namespace.

23:54 abp: TimMc, yep, this damned irc client loves cutting of my font baseline :(

23:54 tomoj: (for [[k v] m :when (and (symbol? k) (= (namespace k) "item-type.property"))] [k v]) :/

23:54 wingy: datomic?

23:54 wingy: i want the keywords with the :item-type.property/ prefix

23:54 tomoj: yeah

23:55 TimMc: wingy: You want to suck out just those vals, or update those vals?

23:55 abp: ah ok, misread

23:55 tomoj: it would seem better to pick out the attributes you want ahead of time and just use select-keys, if possible

23:55 wingy: TimMc: i want to just read them

23:55 tomoj: you could pull all the attributes out of datomic and group them by ns ahead of time or something

23:55 wingy: hmm .. maybe i can query them?

23:55 theatticlight: You can get the namespace from a keyword with the "namespace" function

23:55 tomoj: s/symbol?/keyword?/ ofc

23:56 theatticlight: yes

23:56 TimMc: ,(into {} (for [[k v] {:foo/a 1 :foo/b 2 :c 3} :when (= (namespace k) "foo")] [k v]))

23:56 clojurebot: {:foo/b 2, :foo/a 1}

23:56 tomoj: (:db.install/attribute (d/entity db :db.part/db)) will give you all the attributes, iirc

23:57 wingy: theatticlight: yeah (namespace :item-type.property/usb-2_0-ports) => :item-type.property

23:57 i can filter by that

23:57 TimMc: great

23:57 TimMc: ,(filter #(= (namespace %) "foo") (keys {:foo/a 1 :foo/b 2 :c 3})

23:57 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

23:57 TimMc: ,(filter #(= (namespace %) "foo") (keys {:foo/a 1 :foo/b 2 :c 3}))

23:57 clojurebot: (:foo/b :foo/a)

23:58 abp: I need to get accustomed to that into-ism

23:58 ,(filter #(= (namespace (first %)) "x") {:x/a 1 :x/b 2 :a/b 1})

23:58 clojurebot: ([:x/a 1] [:x/b 2])

Logging service provided by n01se.net