#clojure logs

2012-12-22

00:00technomancyTimMc: I wonder how many json parsers would just be completely cool if you threw them commented json
00:00callenrking: why would an "end user" be configuring something like lazybot?
00:00Raynesrking: Since when are we talking about end-user configuration? I was talking about configuration languages.
00:00rkingcallen: 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.
00:00callentechnomancy: none of the standards compliant ones.
00:00technomancycallen: the standard sucks, in this particular area =)
00:00callenrking: what config languages and systems do you have experience with?
00:00callentechnomancy: I know that, jus' sayin'
00:00technomancycompletely stupid
00:00Raynesrking: 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.
00:00rkingThe example was of the faux XML like Apache, no?
00:00ibdknoxhas anyone tried doing a comment preserving version of the reader?
00:01technomancycallen: actually, does the standard actually specify what you're required to reject?
00:01TimMctechnomancy: 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.
00:01rkingcallen: I generally like YAML config languages, perhaps processed through ERb if it's really necessary.
00:01RaynesHe just in general isn't friendly. I'm damn offended. I'm going to have to leave now to cool off.
00:01seangrovetechnomancy: eh? I might have missed something...
00:01callenrking: yeah I have a hard time believing you'd have any issue with clojure configs then.
00:01technomancyseangrove: oh, I thought your "dec" comment was re: not writing in C =)
00:02seangroveAh, sorry, hah
00:02seangroveI thought we were affecting the ether
00:02RaynesWhoa, callen and I might agree on something. Maybe the Mayans were right.
00:02callentechnomancy: 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.
00:02callenRaynes: we agreed on grove.io too. Don't act so shocked.
00:03rkingcallen: 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.
00:03amalloyibdknox: i heard the guy who works on light table might be working on that
00:03callenrking: that's not what anyone said.
00:03callenamalloy: on what?
00:03TimMcComment-preserving reader.
00:03callenoh, cool.
00:03rking<Raynes> technomancy: The problem is using software with custom configuration languages.
00:04TimMcIdeally, a reader that preserves whitespace and reader suager too...
00:04RaynesI stand by that. I've used nginx.
00:04amalloyibdknox: seriously though, i think sjacket is the current state of the art
00:04callenrking: most projects don't merit it. Apache being written the way it is has little choice.
00:04seangroveReally? Clojure data structures (ignoring the language) seem far more straight-forward than apache config
00:04TimMcrking: The basic principles here are tool and skill transferability.
00:04callenrking: however, that doesn't excuse how awful Apache's config language is.
00:04seangroveBut it's been several years since I even looked at an apache conf file, could be wrong now... I suppose...
00:04amalloybut i don't know how polished/transparent it is
00:05rkingcallen: Fair enough.
00:05callenrking: for pretty much all Clojure projects, a Clojure config lang makes a ton of sense.
00:05callenMost of the "end users" are clojure users and you don't win anything by not using Clojure.
00:05rkingcallen: Unless somebody who doesn't know Clojure is going to modify them.
00:05callenrking: that's a totally different scenario.
00:06callenrking: nobody proposed non-programmer end-users editing clojure configs.
00:06TimMcBut a valid one.
00:06callenrking: we're talking about our own needs and day-to-day problems as work-a-day programmers. That's all.
00:06TimMccallen: I don't think that was excluded.
00:06rkingcallen: OK.
00:06callenrking: it was stated before that for a "true" end user you'd need to make an interface
00:06rkingI just saw that line, "problem is using software with custom configuration languages." and pounced.
00:06callenbut you could still be reading/writing Clojure data structures for convenience's sake if you really wanted. More likely, an embedded database or something.
00:07rkingcallen: I don't buy that. A text editor is plenty interface enough for most things.
00:07technomancyif you want to use something that isn't a programming language, use yaml or json
00:07callenrking: is it really that ahrd to edit strings?
00:07rkingOne reason being that the config tool would have its own support issues.
00:07technomancyeven XML would be better than inventing your own faux-xml
00:07callenmost Clojure configs are considerably simpler than say, Xmonad's configs, and Xmonad is used by a LOT of non-programmers.
00:08rkingNow I can call BS on that one for sure.
00:08technomancyif you use .ini files I won't hate you, but I do reserve the right to snicker
00:08callenRaynes: oh by the way, went to Hiccup.
00:08rkingI use XMonad, and when I have a problem, it takes like 3 guys on #xmonad or #haskell to sketch out a solution.
00:08callenrking: that's because an Xmonad config is like actual programming
00:08rkingI had one issue in particular that took about 4 different IRC sessions, and it was such a simple task.
00:08rkingYes
00:08callenrking: that clojure config is just a flat data structure effectively, and is equivalent to JSON or YAML
00:09callenI've done my share of battling with Xmonad. Knowing Haskell helps. Knowing Xmonad helps more.
00:09rkingExcept that it isn't optimized for such things, the way YAML is
00:09seangroveI haven't used xmonad, but have been really, really wanting something like it for osx
00:09seangroveIt seems amazing from this end
00:09technomancythough now my config is only 4 settings interspersed with derogatory comments at how crazy it is that these aren't default
00:09rkingseangrove: There is osxmonad, but one limitation is that it only manages X11 apps.
00:09technomancywhich is also a lot like what my gnome config looks like
00:09seangroverking: Yeah, I don't use any x11 apps, sadly
00:10TimMctechnomancy: You're using Debian something, yeah?
00:10callenRaynes: I'm starting to understand you.
00:10technomancyTimMc: yeah, about to make the jump to wheezy now that it's been frozen for a while
00:10TimMcI would like to subscribe to your get-off-my-lawn newsletter.
00:10ibdknoxamalloy: I haven't really gotten sjacket to work :(
00:10Raynescallen: Isn't Hiccup the antithesis of what you wanted?
00:10rkingseangrove: Well, if I was on OS X, I'd use urxvt as a terminal under osxmonad.
00:10TimMcUbuntu is pissing me the hell off.
00:10technomancyTimMc: I actually considered starting to document my dotfiles the other day WHAT IS WRONG WITH ME
00:10ibdknoxamalloy: 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 :)
00:10callenRaynes: yes. frontend guy wanted to learn backend anyway. He's going to learn the fun way.
00:11callenRaynes: he's been mumbling about clojurescript for some time now.
00:11amalloyif there is, nobody's told me about it
00:11rkingseangrove: That plus an X11 web browser would get me almost the same setup as I have now on Linux.
00:11seangroverking: Meh, I use emacs
00:11callenRaynes: to its credit, Hiccup is more compact than actual HTML by a fair bit.
00:11seangroveLooks roughly equivalent
00:11callenRaynes: Hiccup has the benefit of not being insane like Enlive though.
00:11technomancyTimMc: https://github.com/technomancy/dotfiles/blob/master/.gripes.org and https://github.com/technomancy/dotfiles/tree/master/bin/init
00:11TimMccallen: Oh no. We're NOT going there.
00:11ibdknoxlol
00:11seangroveTimMc: Yes, please stop him
00:12rkingURL for Hiccup?
00:12TimMcnot when I should be gong to bed
00:12technomancyoh dear; look at the time
00:12squidztechnomancy: do you prefer enlive or hiccup?
00:12callenTimMc: I said I was sated and no longer had an issue.
00:12callensquidz: he doesn't do a lot of web dev.
00:12technomancysquidz: I find hiccup to be much more maintainable
00:12Raynescallen: Have you looked at Laser?
00:12ibdknoxall of LT is in hiccup!
00:12TimMctechnomancy: "adding a keyboard doesn’t honor caps->ctrl mod" BAIL BAIL BAIL
00:12technomancybut I don't want to get into a discussion right now with callen around =)
00:12ibdknoxsort of
00:12Raynescallen: I'd hope you wouldn't think it totally insane.
00:12seangroveI 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
00:12squidzso who is our webdev on #clojure?
00:12Raynescallen: It has exactly one bug that I know if at the moment.
00:12technomancyTimMc: welllll I'm not sure why that is
00:13callenRaynes: I don't believe in server-side whole-document transformation like that if it can be avoided.
00:13TimMcWait, that's additional keyboards? nvm
00:13Raynessquidz: Well, ibdknox and I recently deprecated a web framework. I think we own this shit.
00:13technomancyTimMc: maybe because I fix caps lock in ~/.xsession instead of system-wide in /etc/?
00:13Raynescallen: Oh, sure, but I meant insane as in like code insane.
00:13squidzRaynes: I see, so what is the pros preference? hiccup or enlive?
00:13technomancysquidz: 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
00:13ibdknoxsquidz: depends on the situation
00:13Raynessquidz: Neither. I wrote my own templating library.
00:13callensquidz: they're used in equal measure. Depends on how you think about documents.
00:14technomancyTimMc: FWIW gripes.org is fairly comprehensive =)
00:14callenRaynes: are you being sarcastic? I'm surprised you are asking for my opinion about code.
00:14Raynessquidz: https://github.com/Raynes/laser :D <plug>
00:14squidzibdknox: yeah I should have expected that answer
00:14TimMctechnomancy: I appreciate this, thanks.
00:14clojurebotWe live to serve.
00:14squidzRaynes: oh, sounds dangerous
00:14technomancyTimMc: have you tried wicd?
00:15TimMcNope. What is?
00:15technomancynetwork-manager replacement
00:15technomancyI was looking at how network-manager stores credentials, and it's horrible horrible horrible
00:15callenyou know, I've tried to use wicd on at least 6 different occasions.
00:15callenit ended in my losing internet access and being unable to reinstall nm-applet each time.
00:15TimMc*distrustfully
00:15technomancyNM mostly works fine from a user perspective, but once you get to trying to automate it it's pretty gross
00:15RaynesYou people are talking too fast.
00:15callenRaynes: I'm looking at the code but I'm still baffled you asked for my opinion.
00:15Raynescallen: I was just curious if you thought my approach was as insane as enlive.
00:16TimMcI mean, I keep a screen session open to restart network-manager and nm-applet every 3 hours, but still... I KNOW those bugs.
00:16technomancycallen: good to have additional data points; thanks =)
00:16callenRaynes: you should benchmark it against Enlive, Enlive is pretty slow.
00:16Raynescallen: I did, it's faster for the tests I ran (from viewbenchmarks)
00:16TimMcRaynes: It's because many of us are northerners.
00:16technomancyTimMc: my main complaint is I can't use dmenu to select new wifi access points, only known ones
00:16RaynesSignificantly faster.
00:16ibdknoxTWO HUNDRED MIRRION FASTER
00:16technomancybut that's fairly high on Maslow's Linux hierarchy compared to periodic network-manager restarts =)
00:16Raynescallen: See the bottom of the readme
00:17callenibdknox: DATS RACIST
00:17callenRaynes: there's something amiss about the benchmarks btw
00:17RaynesBut yeah, one more small bug (there is an issue for it) and I'll recommend it to peoples.
00:17callenRaynes: usually hiccup is close to (str ...) in performance (2x at most)
00:18callenRaynes: in your test it's the worst, worse than Enlive, which I've never seen before.
00:18technomancyTimMc: what the hell, pushed it: https://github.com/technomancy/dotfiles/blob/master/README.md
00:18TimMcRaynes: Does Laser escape node contents by default?
00:18Raynescallen: I didn't really care about benchmarks. I just used what was in viewbenchmarks and posted what it said.
00:18callenRaynes: sure I'm just saying that the numbers are highly irregular.
00:18TimMcAnswer carefully.
00:18callenanyway, back to the code.
00:19RaynesTimMc: The library underneath it, Hickory, escapes all text nodes.
00:19TimMcGood.
00:19callenRaynes: why'd you write your own escape-html?
00:19Raynescallen: It's from an earlier version. Pretty sure I don't use it anymore and it should be removed.
00:19clojurebotversion ranges are nothing but trouble: http://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html
00:19ibdknoxthis will be useful later.
00:19TimMcshit
00:20callenRaynes: you use it in the content function.
00:20TimMcclojurebot: YOU are nothing but trouble.
00:20clojurebot@ has nothing to do with whether sth is evaluated or not
00:20Raynescallen: Okay, in that case it's because it's from an earlier version of *hickory* where things were not escaped automatically.
00:20callenI think clojurebot would make an excellent experiment in how to passively percolate information into a community.
00:20RaynesStill redundant.
00:20RaynesAnd should be removed.
00:21callenRaynes: just being accurate as I troll through the code.
00:21TimMccallen: What makes you think it isn't? ;-)
00:21squidzclojurebot: you so silly
00:21clojurebotGabh mo leithscéal?
00:21Raynescallen: 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.
00:21callenRaynes: why is enlive so big anyway?
00:21RaynesSo thanks for pointing that out and I'll put it on my todo list.
00:22Raynescallen: 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.
00:22callenraynes@dasouth:$ echo "Overthrow Enlive, set myself up as the dictator of whole HTML document transformation-landia" >> TODO.md
00:22TimMctechnomancy: Seriously, this is great. I'm going to buy an SSD and try installing Debian on it.
00:22ibdknoxEnlive is the most obtuse clojure I've seen I think
00:22RaynesI use todoist, so it's more like "click type click"
00:22technomancyTimMc: yessssss
00:23callenRaynes: leave the joke alone.
00:23callenTimMc: http://github.com/bitemyapp/dotfiles/
00:23technomancyRaynes: at least pretend to use org; geez
00:23callentechnomancy: if it comforts you, I too use org.
00:23Raynestechnomancy: I used org once. It did not work.
00:23callenmostly for internal company documents.
00:23callentechnomancy: our due-diligence paperwork was all Org getting exported into LaTeX.
00:24TimMcNice.
00:24callenTimMc: there are 400,000 lines of Emacs Lisp in my dotfiles repo.
00:24callenTimMc: in the current checkout.
00:24TimMcThat's terrifying.
00:24callenMy name is Ozymandias, king of kings:
00:24callenLook on my works, ye Mighty, and despair!
00:25Raynescallen: 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.
00:25technomancycallen: hah nice
00:25callenI only know one guy with more Lisp code in his Emacs install than me, and he's a batty Haskell user.
00:25callenRaynes: thanks for the heads up. I'll be poking through.
00:25ivanis half of that org-mode?
00:25callenorg-mode is part of the Emacs site el, so no.
00:26callenit's all stuff I added manually. I don't believe in package managers for Emacs, although I use it for a couple things.
00:26callenso everytime I add a package, I integrate it manually and test it on Mac and Linux, then push the new version to github
00:27callenI should renick myself, "KingYakShaver"
00:27technomancypackage.el changed my life
00:27callentechnomancy: I'm the pig rolling in the mud, happy as all get out.
00:28callentechnomancy: I like my artisanally crafted Emacs install.
00:28technomancyshade-grown parens
00:28callentechnomancy: 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.
00:28callentechnomancy: I was the only one who had something that worked 99.999% of the time on Mac and Linux.
00:28callenso there's clearly something to be said there.
00:28technomancymy dotfiles repo is the starter kit =)
00:29callentechnomancy: that's cheating dammit.
00:29technomancyI know =)
00:29TimMcYou and your toolbar-hiding, pretty-fn-showing config...
00:29technomancyI don't actively encourage its use these days for anything other than pillaging
00:29technomancybut pillaging is an important Emacs tradition
00:30callentechnomancy: my dotfiles repo is actually shake-n-bake ready for Python, Clojure, Haskell, Scala, J, Java, JavaScript, web dev (HTML/CSS/JS), etc....
00:30technomancycallen: I tried to do the per-language modularity thing with the starter kit
00:30callentechnomancy: you seen how I do it in mine?
00:30technomancybut I basically ignored all non-clojure stuff soon after =)
00:31technomancylooks
00:31callenI lift the subdirs into the elisp search path, then load the configs.
00:31callento disable the language, just comment out the config load.
00:31calleneasy-cheesy.
00:32technomancyhow many mail clients do you have configured here?
00:32callentechnomancy: I don't want to talk about that.
00:32callenthe mail clients situation has been an ongoing canker-sore for me.
00:32technomancywas mostly happy with gnus until I started reading mail on my phone; the gnus model does *not* play well with others
00:33callentechnomancy: anyway, not a terrible per-language module system if you ask me.
00:33technomancyapart from the reliance on offlineimap, mu4e is niiiiice
00:33callenthe per language config/init file system did a lot to clean up my .emacs
00:33technomancyyeah, makes sense to leverage the load-path for that
00:33callentechnomancy: well previously everything in the configs was inside the .emacs
00:34callentechnomancy: and not necessarily grouped together intelligently
00:34callenthe restructuring saved my sanity.
00:34callenso I used to have a big .emacs
00:34technomancydo you do your own autoloads though?
00:34technomancythat sounds like a lot of work
00:34callentechnomancy: autoloads? no.
00:34callenwhat sounds like a lot of work? the restructuring or maintaining the stygian-horror .emacs file?
00:35technomancykeeping autoloads for that
00:35callenbecause after I did the restructuring, it's been pretty smooth sailing.
00:35callenI don't keep autoloads for anything.
00:35seangroveAh, damn
00:35technomancyoh so you just bite the bullet with slow boot times?
00:35seangroveEnded up with a cons instead of a vector
00:36callentechnomancy: yes. it's like leiningen man.
00:36callentechnomancy: I fire up Emacs like once a month.
00:36callentechnomancy: I try not to optimize problems that I don't have :P
00:36callenI abhor premature optimization.
00:36seangrovecallen: You're my archetype for premature optimization in this channel
00:37technomancyI keep all my projects segregated by emacs instance, so that would never work for me
00:37callenseangrove: what.
00:37callentechnomancy: huh. not totally sure what you mean there. emacs-project-mode?
00:38technomancycallen: 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
00:39callentechnomancy: ah yeah. I see what you mean there.
00:39callentechnomancy: I've tried to avoid having that problem
00:39technomancya habit I picked up from gnus blocking behaviour
00:39callenI assumed that if it did become a problem, I'd start using a buffer grouping library.
00:40technomancybut now I like it because I use different themes depending on the context
00:40callentechnomancy: makes sense. I'd end up making the Google Chrome of Emacs instead. (one process per tab)
00:40technomancyheh
00:41technomancywell if you have to run on OS X you're a lot more limited
00:41callenhow so?
00:41technomancyyou don't have xmonad to help you out =)
00:41callentechnomancy: oh yeah, that's a part of the problem.
00:41technomancyplus IIRC the cocoa version makes it difficult to launch multiple instances
00:41callentechnomancy: I use Xmonad when I'm in Linux.
00:42technomancylike you have to make duplicates of the .app dir or something silly
00:42technomancydunno; it's been a while
00:42callenyes, you do.
00:42callenno that's right.
00:42callentechnomancy: most Mac users I know who have that problem usually launch it from the command line or run it in the terminal
00:42seangrovetechnomancy: I use the terminal version of emacs
00:42callentechnomancy: then let each terminal tab be an emacs instance.
00:42seangroveBut I always connect them via emacs-client
00:43seangroveI prefere to have lots of windows into one monstrous emacs process
01:16muhooRaynes: where da laser at, yo?
01:16muhoodid you release it?
01:18callenmuhoo: he's not here right now. I happen to be the 2nd most qualified person to talk about it in this IRC channel though.
01:18callenmuhoo: I promise everything I say will be a lie.
01:20muhooincluding that?
01:20callenmuhoo: hello Kretan.
01:20muhooah, a transformation library with build in logical paradox
01:20callenmuhoo: I'll say this about laser, nothing is stopping you from using it in an app.
01:20callenmuhoo: it is however not as !PRODUCTION! grade as say, Stencil. But few things are.
01:21muhooi just googled it and yes, it appears to be released, yay.
01:21callenmuhoo: it's about 250 lines of code. I'd say just read the code and roll with it.
01:22muhooyeah, 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
01:23callenmuhoo: I'm pretty sure ~800 lines is Enlive, and that's considered to be a bit complex.
01:23muhoocallen: cloning now, thanks.
01:23callenmuhoo: thank github, not me.
01:26muhoo+1 for working "ermahgerd" into the readme
01:36arrdemwhat's the most idiomatic way to put a fn in a map?
01:36callenmuhoo: was there something about enlive that wasn't working for you?
01:37arrdem,((:foo {:foo (fn [x] (* x 2))}) 2)
01:37clojurebot4
01:37callensigh, I'd just gone to the trouble of demonstrating.
01:38callenarrdem: you appear to understand it just fine. what's the issue?
01:39arrdemcallen: I've defined a macro that assoc's a key to a fn in an atom
01:39arrdembut it seems that my fns are comming through as lists not nfs
01:39arrdem*fns
01:39arrdem,(type (fn [x] x))
01:39clojurebotsandbox$eval55$fn__56
01:39callenif you had a specific problem, why didn't you just refheap it?
01:39callenotherwise, the way you phrased your question seemed to merely be musing if it was possible.
01:40arrdemnever had to pastebin my problem before
01:40callenso refheap it?
01:40arrdemwilldo
01:40callenI have no idea what your macro looks like
01:40callenarrdem: why are you using an atom?
01:42arrdemcallen: the only way I understand to incrementally accumulate a value
01:42arrdemI suppose a val would work too...
01:46arrdemok problem reproduced...
01:46arrdemcallen: https://www.refheap.com/paste/7807
01:47callenarrdem: not seeing the problem.
01:47callenare one of those supposed to break?
01:48arrdemno, they should both work
01:48callenarrdem: so what's the problem?
01:48arrdemcallen: I get an error that the fns are being parsed as persistant lists and I don't see why
01:49arrdemI mean I understand that I could (eval) em and then apply, but this should work and I would like to understand why
01:49callenarrdem: why is table-insert a macro?
01:50arrdemno 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
01:50arrdemand my line between fns and macros for stuff like this is fuzzy
01:53amalloythat shouldn't be a macro. you could make it work, but there's no reason to
01:53arrdemcallen: how would you structure something like this? your tone suggests that I'm making some strange choices
01:54callenarrdem: 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.
01:54callenarrdem: default to just using functions in general.
01:54amalloyjust change 'defmacro to 'defn, and it works like magic
01:55arrdemamalloy: 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.
01:56callenamalloy: for the sake of comprehension, why isn't it working? I'm staring at the macroexpand and feeling stupid.
01:56amalloyit'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
01:57amalloyit 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
01:58arrdemokay thanks amalloy and callen
01:58bbloomyou'd use a macro if you were always inserting functions and wanted special syntax for it
01:58bbloomie to eliminate the "(fn " and one ")"
01:59arrdembbloom: right so you'd do an & forms and just ~ expand it
01:59bbloomsomething like (table-insert :foo [x] (* x 2))
01:59bbloomarrdem: generally, i never write macros longer than 2 or 3 lines
01:59bbloomi always write all my logic in functions
01:59bbloomtest them as functions
02:00bbloomand then write a tiny macro at the end to call the function
02:02arrdemok thanks. I'm reading Let over Lambda atm so I may just be on the lunatic fringe with trying to macro.
02:03amalloydoug hoyte is certainly a lunatic, though a clever one
02:04callenarrdem: please do not write Clojure code based on the lunatic ravings of Hoyte.
02:04callenarrdem: please?
02:04bbloomarrdem: i feel as though somebody needs to assign levels to each clojure function and beginners should master each level before moving on :-)
02:04arrdemcallen: ok ok
02:05arrdembbloom: I joke that in Haskell you take an IQ check before calling a function
02:05bbloomheh, i just see lots of people in here wondering about the subtlties of atoms vs refs, or macros vs functions, or what not
02:05callenbbloom: I smell a clojure achievements game.
02:05bbloombut it's just too much shit all at once
02:06eggheadya that's a good idea bbloom
02:06callenbbloom: the final level is "found a reason to use fnext instead of second"
02:06arrdemcallen: lol
02:06callen"had a triply-layered macro using juxt"
02:06callen"beat amalloy at golf"
02:07bbloomegghead: yeah, i think i'd have appreciated a sign "learn all of these functions before touching atoms"
02:07bbloomheh :-)
02:08bbloomthat's why i always recommend 4clojure to folks: no def, no macros, it's like levels 1 through 3 without levels 4 and 5
02:08bbloomreally helpful for my slow brain
02:09eggheadeven 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
02:09eggheadand in fact written in terms of one another
02:09eggheadsometimes 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
02:10SegFaultAXegghead: Or functional programming in general.
02:10bbloomegghead: it's easier to explain them in the absence of any particular language
02:10bbloomegghead: even better, avoid any buzz word they may have *ever* heard :-)
02:11SegFaultAXbbloom: That's hard because a lot of the important details have names that are buzzwordy right now. Even simple stuff like higher-order functions.
02:11Raynesmuhoo: Cool. Gonna use it?
02:12Raynesmuhoo: 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.
02:12mehworkif the var foo exists, how come re-def'ing like the following doesn't change its value: (def foo (update-in ....)
02:13bbloommehwork: your question doesn't make sense. context?
02:13mehworkbbloom: i'm just trying to make an update-in stick
02:13bbloommehwork: do not use vars (via def) for mutable values
02:14bbloommehwork: vars are only mutable for the sake of interactive development
02:14mehworki have to use let then?
02:14SegFaultAXmehwork: What are you trying to do?
02:14bbloomput an atom in your var and update that
02:14mehworkSegFaultAX: update a value inline
02:14bbloom(def foo (atom nil))
02:14bbloommehwork: let establishes immutable local bindings, you can't mutate those either
02:15mehworki 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.
02:16eggheadyou can certainly define some foo as the result of evaluating some call to update-in
02:16bbloommehwork: they encapsulate compare and swap, so they are safe for concurrent access
02:16eggheadit's just considered very messy to do it in the middle of a functions body
02:17bbloomsee: we need levels :-)
02:18arrdemget that in the runtime...
02:20mehworkto change an atom do i have to do (reset! @atomname (update-in ...))
02:20eggheadmehwork: 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
02:20mehworkbecause it's giving me an exception about an Atom can't be cast to Associative
02:21eggheadatoms allow you to pass around ~references~ though, so if that's what you want you're set
02:22eggheadmehwork: you'd want to say (swap! atom-name (fn [atom-value] (update-in ..))
02:23eggheadoops, reset*
02:24zellioegghead: why the (fn ..)
02:25eggheadzellio: I was mistaken, I was thinking swap! not reset!
02:27arrdemokay, so how can I pull off a closure here? https://www.refheap.com/paste/7808
02:28zellioegghead: ahh okay, am I correct in remmebering that swap! inserts @atom after fn ?
02:28zellioso (swap! a fn arg) -> (fn a arg)
02:28arrdemzellio: yes, and then sets the value of a to that value
02:29mehwork(reset! my-atom (update-in my-addmin [:key :test] "newval")) is giving me an exception
02:29mehworkas is assoc-in
02:29zelliomehwork: no ()
02:29clojurebotGabh mo leithscéal?
02:29zellioor rather
02:29zelliosorry
02:29zelliomake it a fn
02:29zellioreset takes atom newval
02:30zellio(reset! atom #(update-in % [:key] "val"))
02:30mehworkhate to say it but the clojure docs (euphemism "suck")
02:30zellioarrdem: thanks, don't have a repl on me
02:30mehworkat least for noobs like me
02:30arrdemzellio: don't thank me yet... I could be wrong XP
02:30eggheadupdate-in takes a function as its final arg, right?
02:30zellioarrdem: ha
02:30zelliomehwork: clojuredocs.org ?
02:31eggheadhttp://clojure-doc.org/
02:31mehworkzellio: yeah, i mean it's a fine reference if you know the language i'm sure
02:32arrdemzellio: yes that's the behavior as repl tested here
02:35zellioahh leiningen installed, much better
02:35mehworkzellio: 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....
02:35mehworkiow, it's fubar'd
02:35eggheadmehwork: you don't want the # or %
02:36eggheadthat makes it a function, that's the repls way of telling you that the value of your atom is a fn
02:36bbloomreset! is not what you want
02:36bbloomyou want swap!
02:36bbloom(doc swap!)
02:36clojurebot"([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."
02:36mehworkegghead: well that puts me back to where i was before and gives me classcastexception clojure.lang.Atom cant be cast
02:37mehworkmy head Hz
02:37bbloom(swap! the-aom update-in [:key] assoc "val")
02:37egghead:)
02:37bbloomreset! forcibly overrides a value
02:37bbloomswap! will apply a function and replace the value with the result of that function
02:37mehworkjust glad you didn't say i need eve instead of atom
02:37bbloom(let [a (atom 5)] (swap! a inc) @a)
02:37bbloom,(let [a (atom 5)] (swap! a inc) @a)
02:37clojurebot6
02:38bbloom,(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] inc) @a)
02:38clojurebot{:a {:b 2}}
02:38bbloom,(let [a (atom {:a {:b 1}})] (swap! a update-in [:a :b] + 2) @a)
02:38clojurebot{:a {:b 3}}
02:38bbloomget it now?
02:38bbloom,(let [a (atom {:a {:b 1}})] (reset! a 2))
02:38clojurebot2
02:38bbloom,(let [a (atom {:a {:b 1}})] (reset! a 2) @a)
02:38clojurebot2
02:39mehworkthanks bbloom
02:39zelliowow, well that's my queue to go to sleep
02:40mehworkmispelling cue is
02:40mehworkmisspelling mispelling is
02:40zellioI didn't get queue wrong, I just got the wrong cue
02:40bbloommehwork: you should watch rich's talk on values, identities, the epochal view of time, etc
02:40mehworkfifo
02:41eggheadhttp://www.infoq.com/author/Rich-Hickey
02:41mehworki should, but certainly not right now. Head hurts and tired. Probably shouldn't even attempt to atomicize my code
02:41bbloommehwork: yeah, get some rest
02:41bbloomthen watch those videos
02:41bbloom~infoq
02:41clojurebotTitim gan éirí ort.
02:42mehworkit will give my brain a rich hickey i'm sure
02:42bbloomclojurebot: infoq is http://www.infoq.com/author/Rich-Hickey
02:42clojurebotRoger.
02:42bbloom~infoq
02:42clojurebotinfoq is http://www.infoq.com/author/Rich-Hickey
02:42bbloomhurray :-)
02:42bbloomwatch em all, twice :-)
02:42mehworkhe looks very nerdy. I trust him already
04:53jmaloneySo 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
04:53jmaloneyby variable i mean that i reduce the input of the function f to just one param to derive over
04:56jmaloneyi need some crazy form of partial or something
04:57borkdudejmaloney maybe you can share some code via refheap ?
04:57borkdudejmaloney refheap.com
04:58jmaloneyborkdude lemme figure out refheap real fast
04:58jmaloneyborkdude https://www.refheap.com/paste/7809
04:58jmaloneyborkdude that work?
04:59jmaloneyborkdude this has my f-prime function if that helps https://www.refheap.com/paste/7810
05:00borkdudejmaloney can you also show how you would use this function?
05:01jmaloneyborkdude https://www.refheap.com/paste/7811
05:03borkdudejmaloney how is function f supposed to be called, with a collection or single value?
05:05jmaloneyborkdude 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
05:06jmaloneyborkdude 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
05:07borkdudeah
05:07borkdudejmaloney what should [() 1 ()] be instead then?
05:07jmaloneyborkdude [1]
05:08jmaloneyborkdude wait no no no
05:09borkdudejmaloney maybe you mean nth?
05:09jmaloneyborkdude its not really being passed in
05:09borkdudejmaloney you want f to have a vector of numbers?
05:10borkdudejmaloney maybe it should help if you add some fictional type signatures to the functions
05:10borkdudejmaloney in Haskell fashion
05:10jmaloneyborkdude im making an anonymous function which should make (f [m]) the function being passed to f-prime
05:11jmaloneyborkdude instead its creating the function #(f [() % ()])
05:12borkdudejmaloney f-prime expects a function and arguments, and applies those arguments to the function
05:13borkdudejmaloney so I have no idea why you apply arguments to f in partial-deriv
05:13borkdudejmaloney shouldn't you just pass f and the args seperately, not wrap it inside an anonmyous function?
05:14jmaloneyborkdude 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)
05:15jmaloneyborkdude because we are only varying over one of the variables when taking the partial derivative
05:15borkdudejmaloney ah I see
05:16jmaloneyborkdude maybe im just not thinking about it in the best way
05:17borkdudejmaloney maybe some fictional type signatures would help, becuase I have trouble understanding what goes in where exactly
05:17jmaloneyborkdude lemme think about it some more. thanks for the help
05:18borkdudejmaloney it seems that f takes a vector of numbers? what you pass to it now is not a homogenous vector
05:19borkdudejmaloney or does f take a vector of vector of numbers?
05:19jmaloneyborkdude it takes a vector of numbers
05:19borkdudejmaloney you pass a vector of sequences to it now
05:19borkdudejmaloney in f-prime
05:20jmaloneyborkdude i realize this im not sure how to get around that
05:25borkdudejmaloney what should go into function f inside f-prime, when you call f-prime with [1]?
05:25jmaloneyborkdude just a number
05:26jmaloneyborkdude i want f-prime to get a function like #(f [2 3 % 1 2]) and eval it
05:27borkdudejmaloney random numbers surrounding it?
05:27jmaloneyborkdude thats generalized to a 5 variable function
05:27jmaloneyborkdude in this simple case #(f [%])
05:28borkdudejmaloney in this simple case that would simply be f, instead of the whole (fn [m] (f (vector …))))
05:29borkdudejmaloney ah wait, confusion
05:29borkdudejmaloney you want f-prime to have a function that takes a single number
05:29borkdudejmaloney but the function f at the beginning is a multivalued function
05:30jmaloneyborkdude yea
05:30jmaloneyborkdude exactly
05:32borkdudejmaloney so in this simple case it would be (f-prime (fn [x] (f (vec x))) ...
05:32jmaloneyborkdude yea
05:33borkdudejmaloney (f-prime (fn [x] (f (vector x))) ... ;; sorry, no vec
05:37borkdudejmaloney maybe you want something like (concat (take n x) (vector x) (drop (inc n) x))
05:40jmaloneyjmaloney i think that works!!
06:04callen$findfn [0 1 2] [0 2]
06:04lazybot[]
06:04callen$findfn [0 1 2] 0 2
06:04lazybot[]
06:04callen,(even? 2)
06:05clojurebottrue
06:05callen,(filter even? [0 1 2])
06:05clojurebot(0 2)
06:06hyPiRion,(filterv even? [0 1 2])
06:06clojurebot[0 2]
06:09callenhyPiRion: wait, when did the *v fns happen?
06:09callenI don't suppose anyone here knows the difference between sandbar and friend, would they?
06:10callenit seems like friend is more comprehensive and extensible, not too sure beyond that.
06:11borkdudecallen the *v fns were added in clojure 1.4.0
06:11hyPiRionAren't that many though
06:11hyPiRion,(removev even? [0 1 2]) ; <- Won't work
06:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: removev in this context, compiling:(NO_SOURCE_PATH:0)>
06:11callenborkdude: that explains why I didn't know about them.
06:12borkdude,(-> #'filterv meta :added)
06:12clojurebot"1.4"
06:12callen<3 ->
06:19borkdude,(filter (fn [me] (= (-> (second me) meta :added) "1.4")) (ns-publics 'clojure.core))
06:19clojurebot([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] ...)
07:07dronlinuxCPU: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
09:04konr_trabWhat do you use to deploy applications?
10:06rodnaph_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:32solussddoes compojure have something similar to noir.core/url-for to construct urls from routes + a param map?
10:58rodnaph_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:02rodnaph_nm - gorrit. cljs.reader/read-string
11:59uvtcAre "reader literals" the same thing as "tagged literals"?
12:00uvtcIt appears that the 1.4 changes.md file refers to them as "reader literals", but http://clojure.org/reader calls them "tagged literals".
12:11uvtcSlow day here today. I asked on the ML.
12:30jkkrameruvtc: yeah, same thing - the #inst "2012-12-22…" syntax. And data readers are what handles them
12:31jkkramerI guess technically anything that's not sexps could be considered a reader literal, so tagged literal seems more correct
12:33uvtcjkkramer: thanks
12:33antoineBj clojurebot
12:45duck1123Did 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:50antoineBwhat is wrong (case (type []) clojure.lang/PersistentVector "vector" "default") ?
12:58raekantoineB: case does not evaluate the clojure.lang/PersistentVector argument
12:58raekso it tries to match it with _the symbol_ "clojure.lang/PersistentVector"
12:58antoineBok
12:59raekyou either need to something else than 'case' or you need to put the actual classes in the code
13:00raekantoineB: https://gist.github.com/997652
13:21xeqiduck1123: when you do a push, you can log in and either see problems or promote it
13:22xeqiwe've stopped the auto promotion atm due to a concurrency bug
13:25antoineBraek: tahnks, but i don't manage to transform it into a clojurescript macro
13:39mehworkis there a good reason to use atoms/reset! instead of just var-set in non-concurrent/non-threaded code?
13:55TimMcxeqi: Oh, is there a stable-releases repo now?
13:57xeqiTimMc: https://groups.google.com/forum/?fromgroups=#!msg/clojure/AsPs9ZonRPQ/9ztNyKcMpB0J
13:58xeqilots of discussion of concurrency bug / WHY U USE GPG? after the first message tho
13:58mehworkwhat'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:59AimHereDo it one way and try reading it. If it looks hard to read, do it the other way.
14:00mehworkit feels equally as readable to me
14:00mehworkin this case anyway
14:09TimMcxeqi: Thanks.
14:16TimMcxeqi, technomancy: I'd also like to see the documention link to some best-practices document on creating and managing software signing keys.
14:16xeqiI think technomancy has pplans to work on getting the docs int oshape next
14:16TimMcI 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:41TimMcHmm, why would you want a software signing key to expire in a year or two?
14:50xeqiTimMc: to limit the damage time if you lose the private key ?
14:50xeqiI'm not really sure
14:50xeqionly started using it during the summer when lein-master started auto-signing
14:51TimMcxeqi: My concern is what happens to an existing release in 2 years.
14:52TimMcRaynes: Hmm, I kind of like this Laser thing... but you know what it needs? CSS selectors! *forks*
14:53TimMcxeqi: It just occurred to me that I don't keep copies of my old releases. I really should do that!
14:54xeqior tag the commit in git
14:54xeqiso you can just regenerate them
14:55llasramI'm not so happy about pushing new copies of old releases, even if they are from the same tagged commit
14:56llasramBut since that seems to be the process -- joining the club and getting libs promoted
14:56TimMcxeqi: A rebuild 2 years later of the same commit is likely to have weird little differences sneak in.
14:57TimMcI'm just going to download all my releases and keep them somewhere. I can sign them later.
14:58xeqillasram: agreed, thats just the easiest way
14:59xeqiif you know how to manually sign them, and make sha1+md5sum, then you could just PUT them to the right url
15:00llasramOh. 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:00xeqiyeah, just thought of that
15:00xeqithough you might need some pom changes depending on the metadata
15:03llasramOh? Like what?
15:05xeqito promote to the releases repo they need url, description, license, and scm
15:06llasramOh, ok. But most projects should already have those, right? Leiningen adds scm, and includes the others in the project.clj template
15:08llasramWell, that wasn't so bad
15:08xeqiI've got a couple that don't, but most new ones should
15:13borkdudesomeone 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:20borkdudeso how would cond-> et al be used? examples?
15:20borkdudefind the docs a bit cryptic
15:20borkdude(talking about clojure 1.5-RC1
15:20borkdude)
15:21seangroveborkdude: Pretty sure the ml had a few examples
15:24seangroveWell, maybe not. Don't see any for that particular macro
15:24seangroveThey all seem very useful to me though
15:25TimMcborkdude: The IRC logs have some examples.
15:25borkdudehmm, is it a bug that clojure lets me define a var named like this? https://www.refheap.com/paste/7815
15:26TimMc,(munge 'added-1.5)
15:26clojurebotadded_1.5
15:27seangrove,(let [added-1.5 2] added-1.5)
15:27clojurebot#<CompilerException java.lang.ClassFormatError: Illegal field name "added_1.5" in class sandbox$eval53, compiling:(NO_SOURCE_PATH:0)>
15:27TimMcHrm. That should be added_1_DOT_5, I think
15:27borkdude(I was trying to get a list of all vars added in 1.5, then this happened to me)
15:29llasramIs '.' supposed to be valid in the qualified part of symbol which doesn't refer to a class?
15:29TimMcFrom Compiler.java: // '.', "_DOT_",
15:29TimMcSo I guess that's not supposed to be munged? :-/
15:30llasram"'.' 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:30TimMc,(class 'added-1.5)
15:30clojurebotclojure.lang.Symbol
15:30llasramhttp://clojure.org/reader
15:30TimMc,(class 'java.lang.String)
15:30clojurebotclojure.lang.Symbol
15:30borkdudellasram yes, but should clojure allow me to define it or not?
15:31borkdude't was defined: https://www.refheap.com/paste/7816
15:32TimMcI want to see Clojure have a defined grammar for symbols.
15:32TimMcThis gets really annoying.
15:34TimMcThey 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:34llasramborkdude: Hmm. Good question. My vote would be that it shouldn't -- dots are for namespaces and packages
15:34llasramTimMc: +1
15:34llasramErrors involving mixes of munged/unmunged/partially-munged names are not friendly
15:34TimMdwhat have you done!
15:34TimMdyou've mutated my nick!
15:35llasramOops! I meant
15:35llasram(inc TimMc)
15:35lazybot⇒ 29
15:35llasramThere we go
15:35TimMcI guess you didn't ++, so never mind.
15:40borkdudewould it be worth it mentioning this on the mailing list or is this seen as annoying noise?
15:42arrdemis there an equivalent to (gensym) for keywords?
15:43borkdudetoo late, already mailed it
15:43borkdudearrdem you can gensym and use that to create a keyword?
15:43arrdem,(type (keyword (gensym)))
15:43clojurebotclojure.lang.Keyword
15:43arrdemok, thanks borkdude
15:43borkdude,(keyword (gensym))
15:43clojurebot:G__56
15:43borkdude,(keyword (gensym))
15:43clojurebot:G__83
15:50TimMc,(gensym)
15:50clojurebotG__110
15:50TimMc,(= (gensym) 'G__111)
15:50clojurebotfalse
15:51borkdude,(keyword (gensym))
15:51clojurebot:G__164
15:51TimMcarrdem: ^ gensym makes *slightly* less sense for keywords because keywords are interned
15:51borkdude,(keyword (gensym))
15:51clojurebot:G__191
15:51borkdude,(= :G__218 (keyword (gensym))
15:51clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
15:51borkdude,(= :G__218 (keyword (gensym)))
15:51clojurebotfalse
15:51borkdude,(keyword (gensym))
15:51clojurebot:G__269
15:52TimMc,(= 'foo 'foo)
15:52clojurebottrue
15:52borkdude,(keyword (gensym))
15:52clojurebot:G__322
15:52borkdude,(keyword (gensym))
15:52clojurebot:G__349
15:52borkdudeI thought steps of 27, hmm
15:53borkdudehmm
15:53borkdudewait
15:53borkdude,(keyword (gensym))
15:53clojurebot:G__376
15:53TimMcMaybe someone else is playing with clojurebot in PM?
15:53borkdude,(= (gensym) 'G__403))
15:53bbloomborkdude: you can't make any assumptions about the number of gensyms
15:53clojurebottrue
15:53borkdudeyeah :-)
15:53TimMcIt's going by 3 on my REPL.
15:53borkdudeyou should put the gensym first, else the symbol already exists and the gesym will be something else
15:54borkdudebbloom of course, but I got true =)
15:54TimMcooooh
15:55TimMcThat doesn't happen in PLT Scheme!
15:59borkdudeTimMc looking at the source I can't really see why this is
16:00borkdudehttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java
16:00borkdudeTimMc I mean line 459
16:01borkdudeTimMc maybe it's a co-incidence
16:05ravsterhello all
16:09ravsterI 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:10TimMcborkdude: Hmm, order doesn't seem to matter.
16:10TimMcI think that false was a mistake.
16:11TimMcravster: If you put the map and fn in the same namespace, do you have the same issue?
16:11TimMcravster: What do you mean by removing the quotes?
16:12TimMc(I don't see why namespaces would matter here.)
16:18ravsterTimMc: I put a (println) in the function, and instead of printing a {:foo "bar" :baz "quux"}, it printed {:foo bar :baz quux}
16:18TimMcOh yeah, that's normal -- you still have strings.
16:18borkdude,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])
16:18ravsterThis isn't giving problems when I feed the same map into the function from within the function's ns
16:18clojurebot[31 32 1]
16:18borkdude,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])
16:18clojurebot[61 62 1]
16:18borkdude,(let [int-gensym (fn [] (Integer/parseInt (.substring (name (gensym)) 3))) a (int-gensym) b (int-gensym)] [a b (- b a)])
16:18clojurebot[91 92 1]
16:18borkdudehm.
16:19TimMcravster: Try (println (class (:foo my-map)))
16:19borkdudeit depends on the context where gensym is called in how many steps it takes?
16:20TimMcborkdude: Sure, there are other things calling gensym during evaluation.
16:21TimMcravster: print[ln] prints for human consumption; pr(n) prints for reader consumption.
16:21TimMcTry (prn my-map) instead.
16:21ravsterTimMc: oh, okay
16:22TimMc,(println {:foo "bar"})
16:22clojurebot{:foo bar}
16:22TimMc,(prn {:foo "bar"})
16:22clojurebot{:foo "bar"}
16:22ravsterTimMc: that did it. thanks
16:22TimMc"pr" stands for "print read-ably"
16:23TimMc,(println {:foo 'symbol})
16:23clojurebot{:foo symbol}
16:23TimMc,(prn {:foo 'symbol})
16:23clojurebot{:foo symbol}
16:23TimMc^ A case that might still be confusing.
16:24TimMcThe 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:25ravsteroh wow. okay
16:25TimMc,(pr-str (read-string "{:foo 'symbol}"))
16:25clojurebot"{:foo (quote symbol)}"
16:26tgoossensI'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:28tgoossensis it the responsibility of the caller to first stop the simulator
16:28tgoossensor rather the simulator's
16:28bbloomtgoossens: what's the return true bit about? that sounds very C-like to have a function return success/failure like that
16:30tgoossensthis is how i currently am thinking:
16:30tgoossenshttps://github.com/tgoossens/robotclj/blob/master/src/robotclj/core.clj
16:31tgoossens(usage at the bottom in the comment)
16:31tgoossens(drive v :forward)
16:31tgoossensin the case of simulator
16:31tgoossens* in general
16:31bbloomcan the robot make any decisions?
16:31bbloomor just follow a fixed list of steps?
16:32tgoossensa command can be "explore maze". Its an algorithm placed on the robot. If that is what you mean with taking descions, then yes
16:33tgoossensor different: the algorithm runs on the robot itself. A command is just to tell the robot to start executing the algorithm
16:33bbloomso yeah, if you upload the algorithm to the robot
16:34bbloomand the client just sends commands and reads values out
16:34bbloomyou should use a command queue
16:34bbloomand you just send some commands to the bot
16:36tgoossensbbloom: i'm looking at how agents might help me with that (never used them before)
16:48hyPiRionOh nice, my Clojure stickers came
16:49RaynesPut on on your face.
16:50Raynesone*
16:51hyPiRionMeh, don't want to waste them yet
16:51llasramPut one one his face? That doesn't make sense either
16:52ivanactually it is tempting
16:53llasramI think I'd probably avoid the guy/gal with the Clojure symbol face tattoo, honestly
16:53dnolenbbloom: keyword patch in master
16:53AimHereWe've all got Clojure face tattoos in here
16:54llasramAimHere: You have changed my mental image of #clojure forever. Thanks!
16:54borkdudeWhy not wear it as a religious programmer's mark? http://en.wikipedia.org/wiki/Tikka_(forehead_mark)
16:55AimHereCome to think of it, has ANYONE ever used ESR's Hacker emblem?
16:56AimHereFor anything at all, that is, other than maybe plonking it down in a life implementation
17:00ravsterhow do I install and use a clojure library using lein when its not on clojars (Where do I download the code?)?
17:00mehworkwhat's the diff between print and pr
17:00borkduderavster google for lein localrepo or smth
17:00llasramravster: leiningen is pretty opinionated about JARs being in a repository.
17:01llasramHmm, I haven't used it, but I've seen a lot of people have trouble with localrepo
17:01llasramravster: Why is this library not in a repo?
17:01llasramAnd what's your scope of using it not-in-a-repo?
17:01ravsterborkdude: okay
17:02borkduderavster or upload it to clojars under your own name
17:02ravsterllasram: dunno, I should probably ask the dev to put it on clojars
17:02borkduderavster or set up your own (local) maven repo
17:06hyPiRiongit clone and lein install
17:06hyPiRionquick and dirty solution
17:06ravsterhyPiRion: cool, will have a look at lein install
17:06ravsterhyPiRion: thanks
17:06llasram(inc hyPiRion)
17:06lazybot⇒ 10
17:07borkdudeit must be a leiningen project then right, hyPiRion ?
17:07hyPiRionborkdude: yeah, it must be a leiningen project then
17:07hyPiRionravster: you're welcome :)
17:07borkdudehyPiRion ah, "a clojure library" is most often a leinigen project of course
17:11SgeoIf one vocab defines a tuple TUPLE: a b c d ; and another defines TUPLE: g b c d
17:11SgeoWill the accessors conflict?
17:11SgeoCan accessors conflict?
17:11llasramSgeo: Who defines what how?
17:11borkdudeSgeo is this clojure? ;-)
17:11Sgeoborkdude, no, wrong channel
17:12borkdudeah, this is the wrong channel… let's rename everything then.
17:15gfredericksif 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:25muhooRaynes: i'm going to play with it, for sure. nice work.
17:26muhooi have to rewrite crudite to de-noir-ify it anyway. i may need stuff like laser in order to do what i want.
17:32bbloomdnolen: thanks
17:32callenthis channel is filled with /lastlog champions.
17:32dnolenhmm, I wonder how long before somebody tries an CLJS AST -> CLJ source w/ this http://github.com/clojure/core.logic/commit/4e2affa39bd4cbc74bd1177152f45cb2b757bd5a
17:32dnolenbbloom: np
17:33callenit's like the conversations are timeless...dare I say...persistent...
17:34callenmuhoo: how does the HTML generation in crudite work?
17:38seangrovednolen: What would CLJS AST -> CLJ source be for?
17:38ibdknoxcode transforms
17:41bbloomdnolen: http://dev.clojure.org/jira/browse/CLJS-301 patch updated
17:42bbloomer um wait a sec
17:42bbloomnevermind
17:43mehworkhow do you loop through a nested sequence and print out the values in human-readable form?
17:43dnolenibdknox: have you started using blind? I saw that you submitted a patch?
17:43mehwork30 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:43bbloomdnolen: i think it's good, but i gotta run...
17:43dnolenbbloom: thx
17:44seangroveUhg, datomic just keeps dying
17:44mehworkby human-readable i mean not a datatype and one value per line, say.
17:44seangroveNeed more memory to run it on a proper server
17:45mehworkLike how do you print ([a b c [d e f]) as a b c d e f (all on their own lines)
17:45mehworka
17:45mehworkb
17:45mehworketc
17:47mehworkoh wait maybe with doall and map'ing println
17:48mehworkworks for single sequence anyway, arg
17:49callenseangrove: how much memory are you providing, just wondering?
17:50mehworkclojure seems to have a learning curve of 180 degrees - right back to whatever language you were using before :|
17:50callenmehwork: 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:50callenmehwork: that is simultaneously what makes it more substantial and worthwhile, but also more difficult.
17:51mehworkcallen: 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:51callenmehwork: contrast: If you already know Python, learning Ruby isn't that hard. Why? Because it doesn't have much to teach you.
17:51callenmehwork: do you have a book?
17:51mehworktrue
17:51mehworkprograming clojure
17:51seangrovemehwork: Could just flatten it of course
17:51callenmehwork: my favorite is Clojure Programming, but let me say this
17:51mehworkthe prob is all the examples i see are rarely what i want to do
17:51seangrove,(map println (flatten [1 2 4 [5 6 7]]))
17:51clojurebot(1
17:51clojurebot2
17:51clojurebotnil 4
17:51callenmehwork: just try to relax, work through the book. Chill and fiddle.
17:52clojurebotnil 5
17:52clojurebotnil 6
17:52clojurebotnil 7
17:52clojurebotnil ...)
17:52Sgeoflatten?
17:52seangroveBut I remember flatten is almost never what you want
17:52clojurebotflatten 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:52seangroveHah, beat Sgeo to it
17:52callenmehwork: 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:52mehworkit's always these obscure functions that end up being useful, like flatten. that function isn't covered in the book
17:52mehworkthat's why i hate books. they're so unreal world
17:52callenmehwork: people tend to get better at things that enjoy faster than things they resent or are frustrated with.
17:52Sgeomehwork, don't use flatten
17:53ibdknoxdnolen: yeah, I'm using blind
17:53callenmehwork: 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:53dnolenibdknox: cool!
17:53mehworkit 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:53ibdknoxdnolen: I may end up trying to add comment preservation to it
17:54mehworki'll take your advice another week
17:54callenmehwork: it pays off in many arenas outside of that. You just don't know it well enough yet.
17:54ibdknoxdnolen: then we can do lossless code transforms :)
17:54callenmehwork: I've learned many languages to varying degrees of proficiency, just try...to take my word for it and relax.
17:54callenibdknox: comments too? :P
17:54mehworki have infinite patience. I mean i do php for a living
17:54ibdknoxyep
17:54dnolenibdknox: 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:55mehworkbut 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:55callenmehwork: 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:55mehworknot at all trying to say that php is a better designed language than clojure in any way, shape or form, though
17:55ibdknoxdnolen: I have a branch that adds position info to basically everything, including end-line and end-column
17:55seangrovecallen: Not much, maybe ~512MB
17:55callendnolen: aha, I was wondering what happened to sourcemaps.
17:55mehworki just wonder if clojure can be a real world language more than a hobby thing in my spare time
17:56dnolenibdknox: nice
17:56callenmehwork: that all depends on you and you alone
17:56mehworkis clojure like nodejs? not quite ready for prime time even though enthusiasts say it is?
17:56dnolencallen: soon as 1.5.0 goes out the door I will probably just merge the work into master
17:56mehworkand if so when will it be
17:56callenmehwork: 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:57dnolencallen: the infrastructure is in place - but some serious changes to emission are required for the next phase
17:57borkdudemehwork clojure is quite young in programming languages terms, also it's ecosystem (editors, libraries, etc) are still developing quite fast
17:57ibdknoxdnolen: oh?
17:57callendnolen: 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:57ibdknoxdnolen: what kinds of changes to emission?
17:57dnolenibdknox: yeah, CLJS just emits munged strings when it should emit vars nearly all the time.
17:58callendnolen: I wish you weren't across the country, I'd get you a pint :P
17:58mehworkcallen: 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:58dnolenibdknox: I want line/column information to tracked in pretty much one place - emit :var
17:58ivanmehwork: are you using regular Clojure datastructures? you can just print those the normal way
17:58mehworkmaybe it's because i've already experienced functions HO functions in python and javascript
17:58dnolenibdknox: but many names just get passed through as strings - which is just wrong anyway.
17:58borkdudemehwork you only did clojure for a week?
17:58mehworkivan but i dont want to print it 'as' a data strcuture
17:58ibdknoxdnolen: ah
17:59mehworkivan iow i don't want to see []'s ()'s {}'s around what i'm printing
17:59dnolencallen: thx :)
17:59mehworkborkdude: yeah
18:00borkdudemehwork you expect to learn a new programming language in just one week and then have an opinion about it? try a year
18:00dnolenibdknox: I can't imagine that will effect anything you're doing right?
18:00mehworkborkdude: sure, i did with python, ruby, javasript, php, ...
18:00ibdknoxdnolen: not that I can think of
18:00mehworkborkdude: 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:01mehworklisp is an extremely simple language
18:01mehworkmaybe 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:02mehworkit doesn't feel much diff than using a lot of list comprehensions and generators in python, for example
18:02mehworkother than it's a looot harder to change the value of a variable
18:02ivanmehwork: (doseq [[k v] {:a :b :x :z}] (print k v \newline))
18:02borkdudemehwork 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:03mehworkmaybe. 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:03gfredericks"I want a practical functional language with persistent data structures"
18:03borkdudemehwork 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:04ivanyou have to get burned by mutation a hundred times first
18:04mehworkis the 'not having side effects' really the only enlightening thing about it?
18:04gfredericksmehwork: if you're not used to immutable data structures, that can be a valuable aspect as well
18:04seangrovemehwork: Macros are another obvious one
18:04mehworkivan i have been, but i can usually write unit tests. Granted i havent done any real threaded programming
18:04gfredericksthat goes along with "no side effects"
18:05mehworkmacros 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:05llasrammehwork: 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:05mehworkllasram: seems like a good way to write unreadable code
18:06gfredericksllasram: I did that and my coworkers called it "frankenruby" and deleted it
18:06seangrovemehwork: Having powerful features in a language doesn't absolve you of the responsibility to use them wisely
18:06ibdknoxthe 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:06seangroveI'd agree with ibdknox
18:06ibdknoxThe way you naturally end up writing Clojure is what's so interesting
18:07ibdknoxand *that* is not something you can learn in a week
18:07seangroveBut Clojure is pretty practical, it's not required to be earth-shattering
18:07mehworkit reminds me a lot of what perl felt like the first week i learned it
18:07mehworkterse and hard to read but practical
18:08ibdknoxI actually find Clojure to be easier to read than most any language these days
18:08mehworkit's nice not having useless braces and semicolons everywhere like in javascript and php
18:08borkdudeit largely depends on how it's written. you can obfuscate pretty much anything
18:08gfredericksespecially languages with lots of infix things with precedences that you have to memorize
18:08mehworkbut python and ruby dont have them either
18:09mehworki guess i'm mainly spoiled by python and ruby
18:09mehworkthey'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:09gfredericksmehwork: after using clojure for 4 years, and ruby for about the same amount of time, programming in ruby makes me terribly uncomfortable
18:09mehworkmaybe the problem is i don't really care about the jvm
18:10mehworkbut even if i did, there's still jruby and jython
18:10mehworkgfredericks: how come
18:10gfredericksmehwork: 60% pervasive mutability, 30% having to fit everything into an OO design
18:10borkdudemehwork maybe this is interesting to see http://tin.nu/sudoku.html - just to compare python and clojure
18:11xeqigfredericks: 10% other?
18:11gfredericksyeah there's a long tail
18:11clj-newb-2345has anyone tried to build an "OS" on top of java or clojure?
18:11gfrederickssomewhere in the long tail is the fact that "- 2" and "-2" have different semantics :)
18:11clj-newb-2345besides the inability to kill java threads, it seems like it'd be rather cute
18:12epitrongfredericks: do you have any examples of frankenruby? i'm curious what it looks like :)
18:12ibdknoxI don't care about the JVM
18:12ibdknoxnever have
18:12gfredericksepitron: 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:12clj-newb-2345ibdknox: what do you run clojure on?
18:13gfredericksepitron: doubt I have any links, but I'll let you imagine it
18:13epitrongfredericks: what's hamster?
18:13gfredericksimmutable data structures
18:13epitronahh
18:13epitronand what's an atoms lib?
18:13gfredericksa lib that gives you atoms. I.e., a reference type that holds a value
18:14epitronhow is that different from a variable?
18:14gfredericksmore awkward
18:14gfredericksand maybe threadsafe
18:14epitron:O
18:14epitronso basically, you use some libraries that make ruby immutable?
18:14gfrederickswell it gives you immutable data structures; doesn't make anything else immutable
18:14daimrod"maybe threadsafe" doesn't sound really safe...
18:15ibdknoxclj-newb-2345: I use mostly cljs these days.
18:15ibdknoxclj-newb-2345: so a lot of nodejs
18:15gfredericksdaimrod: I meant it depends on the lib; not that the goal is to sometimes be threadsafe
18:15clj-newb-2345I piad with cljs for a while; couldn't get used to it's lack of debugging tools
18:15clj-newb-2345but definitely clojure-ish
18:15gfredericksibdknox: I'm curious what are the benefits of node-cljs over jvm-clj
18:16epitronclj-newb-2345: have you tried lighttable?
18:16clj-newb-2345gfredericks: having never tried node, I bet it starts up faster :-)
18:16clj-newb-2345epitron: I thought itw as still in development
18:17mehworkthe 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:17epitronclj-newb-2345: it is, but it's usable
18:17epitronthey guy made a game with it recently
18:17borkdudemehwork what version of leiningen are you using?
18:17ibdknoxgfredericks: 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:17mehworkborkdude: 1.7.1
18:17epitronhttp://www.chris-granger.com/2012/12/11/anatomy-of-a-knockout/
18:18ibdknoxmehwork: JVM startup is really slow
18:18clj-newb-2345mehwork: 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:18llasramgfredericks: 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:18ibdknoxepitron: lol that guy is me ;)
18:18mehworkclj-newb-2345: great, but i have no idea what you just said
18:18epitronibdknox: o hai!
18:18epitron:)
18:19clj-newb-2345mehwork: 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:19llasrammehwork: For one thing, the workflow most people use doesn't involve spinning up a new JVM (as with `lein run`) very ofter
18:19llasram(inc clj-newb-2345)
18:19mehworkclj-newb-2345: interesting. how?
18:19lazybot⇒ 1
18:19llasrammehwork: What editor are you using?
18:19mehworkvi
18:19borkdudemehwork 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:19clj-newb-2345hmm, I'ma ctually interested in hearing llasram's solution first :-)
18:19clj-newb-2345[mine is a bit adhoc]
18:20llasramI use emacs myself, but there's https://github.com/sattvik/lein-tarsier and https://github.com/tpope/vim-foreplay
18:21llasramYou run a REPL server once, then connect to it from your editor, then restart it v v rarely
18:21mehworkcool
18:21clj-newb-2345gah, nailgun <-- always had weird situations where I had to resttart everything
18:22llasramYeah. The vim side definitely doesn't have as many people working on it
18:22mehworkwhy is emacs favored for lisp languages
18:22clj-newb-2345I don't really mind emacs, it's elisp that I can't stand; if someone write an editor in clojure ....
18:22gfredericksparedit!
18:23seangrove<3 paredit
18:24mehworksomeone 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:25gfredericksonce the hardware runs lisp...
18:25mehworkplus i think if there was such a project i'd jump on contributing because i hate c but lisp is tolerable
18:25stain_ http://en.wikipedia.org/wiki/Lisp_machine - you can watch it in its glory in Boston at least
18:25clj-newb-2345hmm, let's call it symbolics
18:26mehworkitd probably be best if it was a new project on github, and didn't have the word 'museum' attaached to it ;)
18:26ibdknoxclj-newb-2345: I *am* writing an editor in clj :p
18:26dnolenmehwork: heh, Lisp doesn't have to prove anything. Interpreted languages, dynamic memory allocation, high level meta programming - that all started with Lisp.
18:26clj-newb-2345ibdknox: cool, tell me more
18:26ibdknoxlol
18:26ibdknoxclj-newb-2345: Light Table
18:27mehworkdnolen: i just mean for lisp to get the respect it deserves
18:27gfredericksthe googles know about it
18:27epitronmehwork: i think the major problem is that few languages can produce C-linkable libraries, and the whole OS is build out of those
18:27clj-newb-2345ibdknox: ah, you are the light table guy?
18:27ibdknoxyeah
18:27epitronmehwork: did you see alan kay's little experiment?
18:27mehworkotherwise it makes lisp seem like smalltalk in the sense of being influential but not good enough o its own
18:27mehworkepitron: which one
18:27clj-newb-2345ibdknox: I should go tell the YC guys you're wasting time on IRC rather than coding. :-)
18:27epitronmehwork: STEPS
18:27ibdknoxlol
18:28mehworkno
18:28epitronmehwork: quick summary: reinventing the entire OS, from the metal up to the UI, in under 20,000 lines of code
18:28epitronspent 5 years on it
18:28epitronthey managed to do it
18:28clj-newb-2345epitron: is this the FONCs guys ?
18:28epitronit's made out of language transformers
18:28epitronclj-newb-2345: that's the one!
18:28seangroveibdknox: Any emails from pg these days?
18:29epitronit currently takes the form of a bunch of talks and a bunch of papers: http://vpri.org/html/writings.php
18:29mehworkso is the real problem not lying with lisp, but with programmers in general who tend to like oop/procedural based languages?
18:29seangroveFew things more unnerving than pg asking for a status update :P
18:29clj-newb-2345epitron: 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:29epitronmehwork: i think picking any one language as the foundation of your OS will mean that you can't evolve it
18:29epitronSTEPS is designed to be late bound all the way through
18:29mehworkpeople hated whitespace in python but it still grows in popularity. Why is 'parens' in lisp such a deal breaker to most people?
18:29epitronso that it can evolve
18:30dnolenmehwork: I'm not sure there is a problem.
18:30epitronmehwork: people are different :)
18:30ibdknoxseangrove: hm? we talked with him a bit ago.
18:30epitronthat doesn't mean we shouldn't work together
18:30seangroveibdknox: 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:30seangroveStill wondering what set it off...
18:31clj-newb-2345seangrove: what startup are you workingon?
18:31seangroveZenbox
18:31ibdknoxseangrove: he does that every once in a while
18:31mehworkthere 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:32mehworkevery language seems to say the same thing "come to us and you'll never wanna go back"
18:32epitronlanguages are made of two things: semantics and syntax
18:32mehworkevery high level language anyway
18:32epitronsyntax is like a "theme"
18:32epitronyou can implement the same semantics with many different syntaxes
18:32clj-newb-2345i.e. they're all turing complete
18:32borkdudemehwork what about choosing many languages at the same time and choosing them wisely for whatever you're working on
18:32epitronit would be nice if languages using the same semantics could just be translated between each other
18:32mehworkthen how can one objectively be better
18:32epitronclj-newb-2345: turing completeness is a very trivial semantic :)
18:33ibdknoxmehwork: 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:33mehworkibdknox: right but i can go to #ruby, #python, etc and here the same thing about those languages
18:33mehworkand have them say they tried clojure and went back
18:33clj-newb-2345clojure is almost perfect, it lacks one thing for me: the conciseness of mathematica, unfortunatey, that doesn't play well with ()'s
18:33mehworkit all seems very subjective
18:33ibdknoxand it is
18:33dnolenmehwork: to me Ruby & Python are not different in any way that is interesting.
18:33clj-newb-2345no, some people are wrong, others pick clojure
18:34epitrona language is a tool.
18:34mehworkit feels like the same arguments as emacs vs vim
18:34mehworkpersonal preference and nothing more
18:34ibdknoxat some level that is true
18:34epitronif you wanted to make webapps, ruby is probably a better choice at the moment :)
18:34mehworkclojure will be better at certain things but it can be better at literally everything
18:34mehworkand that's why there's always a tug-of-war
18:34epitronif you want to do hardcore shit, clojure seems a better choice
18:35mehworkepitron: well for example, why should a web developer choose clojure/ring over ruby on rails or python django
18:35clj-newb-2345if cojure had llvm bindings, so one could create low latency code, it'd be complete
18:36epitronmehwork: the usefulness of a language for solving a certain problem depends on the language's capabilities and the size of the developer community
18:36mehworkwhy doesn't it have llvm bindings? evne haskell does
18:36epitronbecause nobody does language development in ruby :)
18:36epitronif 100,000 people started making webapps in clojure, it would be awesome for making webapps :)
18:36mehworkepitron: well Io has a huge library set and is very capable, but no one uses it
18:36dnolenmehwork: the problem is that programmers only want to talk about the good stuff. Those systems have incredible amounts of bad stuff.
18:36mehworkso maybe it only coems down to size of community
18:36epitronyep
18:36epitronright
18:36epitronbut you grow your community by making the language good at doing something
18:36epitronand people start using that tool
18:37epitronIo probably never did that
18:37dnolenIo is dog slow
18:37epitronhah
18:37mehworkIo decided to become an embedded language
18:37epitronthat's good for NOTHING
18:38mehworkon the server there's no monopoly like javascript on the web client
18:38epitronthere are ecosystems
18:38epitrona thriving ecosystem makes it easy to do things
18:38epitrona sparse ecosystem means you have to develop your own things
18:38mehworkprogrammers 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:39mehworkin 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:39epitronit's not entirely the language
18:39epitronit's also the libraries
18:39mehworkthere's only so many nail hammers and they all look the same
18:39epitronruby wasn't good for webapps until DHH made rails
18:39mehworkthat's using the right tool
18:40DirklectischHi everyone!
18:40DirklectischI 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:40Dirklectisch(use [(get config :parser 'myapp.parsers.default) :only '(load-tasks)])
18:40DirklectischProblem 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:40mehworki 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:40mehworkat least not in their current forms
18:40epitronhah
18:40epitroni agree with the first part
18:41epitroni'm not sure about the second :)
18:41mehworkthe second part has a sad likelihood of being wrong
18:41mehworkbased of history :/
18:41epitronheh
18:41epitronin one of vernor vinge's books, humanity had spread across the galaxy.. and their software stack was this gigantic mountain of hacks
18:42epitronit was thousands of years of cruft piled on top of cruft
18:42mehworklike our spoken languages?
18:42epitroni suppose!
18:42stain_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:42borkdudemehwork 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:43mehworkborkdude: 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:43epitrondeclarativeness is basically just stating the goals and letting something else build the program :)
18:43borkdudemehwork 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:43mehworkif the goal is to solve problems and right "cool apps" then i could do that in php or javascript
18:43mehworkor rails
18:44epitronand the only reason that's tenable is because there are so many people writing stuff for js and ruby
18:44epitronyou have a mountain of libraries
18:44epitronit's like perl's cpan
18:44epitronperl is pretty gross, but everything is already written :)
18:44borkdudebut as long as we're stuck in pre-history, I like clojure ;-)
18:44mehworkwilllllllmaaaa
18:44mehworkmaybe i was born in the wrong century, but i'm not happy with anything right now
18:44mehworkor maybe i just need some anti-depressants
18:45epitronyou ever read alarmingdevelopment.org? :)
18:45mehworknope
18:45borkdudemehwork are you living in northern scandinavia?
18:45mehworki've read lambda-the-ultimate
18:45epitronhttp://alarmingdevelopment.org/?p=6
18:45mehworkborkdude: beautiful southern california. Where everyone is a rails brogrammer or javasript dude
18:46epitronor a visionary
18:46epitron^_^
18:46mehworki said javascript dude
18:46epitronvisionaries hire the javascript dudes
18:46mehworkhtml5 is the only vision people have right now
18:46epitronto make the next facebook
18:47epitronit's facebook... FOR CARS
18:47mehworksadly people prefer to copy rather than innovate
18:47mehworkvsauce on youtube did a good piece on why people prefer familiar things, which is why most music sounds the same
18:48mehworkeven though there's a huge range of potential music that's not been explored
18:48epitronhumans have tiny brains
18:48mehworkclojure will get enough of the next generation doing lisp for it to feel natural to them and thus become familiar and mainstream
18:48epitronthey can't take a 5000 year old evolved artform and reinvent it from scratch by themselves :)
18:49mehworkmaybe the aliens will save us
18:49mehworkand bring us their wares and languages
18:49epitronor we'll just juice ourselves up
18:49mehworkhumans are good at deconstructing
18:50mehworkthe thigns we've reverse engineered just to make money is amazing. We really need to reverse engineer some alien stuff already
18:50mehworkOR we need to stop teaching kids that drugs are bad :)
18:50mehworkacid for everyone!
18:51mehworkwhy is it acceptible to get drunk at your holiday party and *lose* braincells and come in hung over and stupid and tired
18:51mehworkbut pot or acid is the devil!
18:51mehworkwonder if that will be the case 100 years from now
18:52epitronBeer 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:52mehworkconsidering that every commercial on tv is for some dangeros prescription drug, i doubt it
18:52epitronpot and acid on the other hand were formative in making people sit around and not work :D
18:52borkdudeepitron I like to hear that, thanks ;)
18:53mehworkbeer or alcohol in general?
18:53epitrondon't split hairs
18:53borkdudegtg
18:55mehworktbh 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:55mehworkall i know is classic rock > justin beiber
18:55mehworkand the osmands
18:55epitronpot and acid definitely help art. but not industrialization.
18:56epitronindustrialization requires lots of little robots
18:56mehworkwell which is programming closer to
18:56epitronexactly
18:56seangroveepitron: Weird
18:56mehworki'd like to artfully program some robots
18:56seangroveI feel acid should basically be a required experience for everyone
18:57epitronthey tried that in the 60's
18:57epitronit was bad :D
18:57mehworkthey over tried it
18:57epitronpeople realized what was going on, and decided to stop being robots
18:58mehworki don't think drugs are the only way to expad your mind
18:58mehworkjust a shortcut
18:58epitronyep
18:58epitronone that can backfire
18:58mehworkmusic can do it
18:58mehworkmeditation
18:58mehworkexercise
18:58epitronreading books
18:58mehworklearnin lisp :|
18:58epitronsleep deprivation
18:58mehworkthough i'm having a bad trip
18:58mehworkfeeling like the walls ()'s are closing in on me
19:23bosieTimMc:t
19:25bosieTimMc: sorry
19:46hyPiRionAaah, GitHub is down
19:46ibdknoxoh no's
19:47hyPiRionIndeed
19:58bbloomhyPiRion: luckily, git itself can't go down
19:58bbloom:-)
20:00hyPiRionYeah, that's actually very nice
20:00hyPiRionBut I still have possibility to download 1.5.0 RC 1
20:01hyPiRionhave no*
20:01mehworkwon't be long till someone makes a virus that infects all code on github
20:02gfredericksthat would be difficult to do undetected.
20:02mehworkwould get deteted very quickly but the damage would already be done
20:03AimHereThere was an HN post about someone using a github pull request to attempt to (badly) deface someone's website
20:03AimHereSortof a "This virus uses the honour system. Please trash your own files"
20:04mehworki haven't seen a defaced website in a long time. Used to see them daily in the late 90s
20:05gfredericksyou could definitely infect direct downloads
20:05mehworkmaybe i just don't pay attention
20:05gfredericksgood thing we never download files directly from github, like e.g. lein
20:05Bronsahttp://kimochi.ath.cx/up/687869eb8e83448319778f19704f01e7.gz clojure 1.5-RC1
20:07hyPiRionBronsa: I believe it's up in the maven central too, I need the source :(
20:07hyPiRionbut thanks anyway
20:07hyPiRion(inc Bronsa)
20:07BronsahyPiRion: yeah, that's the source
20:07lazybot⇒ 2
20:07hyPiRionoh
20:08hyPiRionBut without the git repo
20:08hyPiRionOh well, not too critical when testing patches
20:09Bronsawith the .git it would have been 35MB :P
20:09hyPiRion--depth=30 :D
20:14Raynes~gourds
20:14clojurebotSQUEEZE HIM!
20:14RaynesGets me every time.
20:16hyPiRionheh
20:27gfredericksI wonder how many of my lengthy ->> forms could be turned into lengthy for's
20:29amalloyall of them, man
20:30gfredericksnot the perverse ones that end in (let ...) or (try ...)
20:30gfredericksor (defn ...)
20:31amalloypretty sure behavior like that gets you smited
20:32hyPiRiongfredericks: (->> ... ) with a... defn?
20:34gfredericks(->> [1 2 3] (mapcat #(list x %)) (apply +) with-out-str (defn totes []) (let [x 15]))
20:36hyPiRionhahah, wow
20:36gfrederickscould add to the end of that (->> ... (catch Exception e) (try (/ 8 0))) for completeness
20:36gfrederickshaha no you can't
20:37gfredericksthat must be CLJ-1121
20:38hyPiRionThat is a feature we need for lazybot
20:38hyPiRionLookup issues
20:38gfredericks$google CLJ-1121
20:38lazybot[[#CLJ-1121] -> and ->> have unexpected behavior when combined ...] http://dev.clojure.org/jira/browse/CLJ-1121
20:38hyPiRion$jira CLJ-1121
20:38hyPiRion:(
20:38hyPiRionthough that one suffices, I suppose
20:43gfredericksyep it's indeed related to that issue
20:44gfredericksclearly not enough clojurians write code like ##(->> :phew (catch Exception e) (try (/ 42 0))) or we would have noticed this a while ago
20:44lazybotjava.lang.SecurityException: You tripped the alarm! catch is bad!
20:44gfrederickslazybot: thanks kid
20:45hyPiRionWho catch things anyway
20:46gfredericks(defmacro without-problems [& forms] `(try ~@forms (catch Throwable t :it-all-good)))
21:08gfredericksare data readers not meant to be used in clojure source?
21:08hyPiRionIn the source? Why asking
21:08hyPiRion?
21:08gfredericksI defined one for dates
21:09gfredericksthen when I try (eval (list 'list my-date)) I get "Can't embed object in code"
21:09gfredericksso if eval doesn't accept the object being there I'm not sure why the regular compiler would?
21:09gfredericksit works with a uuid though
21:09hyPiRionOh, I thought you meant "core.clj" in Clojure
21:10gfredericksah no
21:10gfredericksthe exception msg continues with "maybe print-dup not defined"
21:10gfredericksbut I can't imagine what print-dup has to do with eval
21:12gfredericksoh nevermind I figured out my actual problem I think
21:13gfrederickswell the eval might well still be a problem
21:14hyPiRionoh hey, this may be interesting
21:14gfredericksshould this be considered a bug?
21:15gfredericksI can work around it with good old clojure.walk; but it's still inconvenient
21:15hyPiRionWhat about read-string. What does it return?
21:15gfredericksthe data reader is working correctly
21:16gfredericksyeah, I just confirmed that the compiler accepts the literal in code, but c.c/eval doesn't
21:16hyPiRionCould you hook it in with *data-readers*?
21:16gfredericksthe thing is already read at the time
21:17gfredericksit's an object at this point
21:17hyPiRionHm.
21:17gfredericksi.e., I can (def thing #my/date [2012 1 1]) but I cannot (eval '(def thing #my/date [2012 1 1]))
21:17hyPiRionFunny thing: do "lein repl" and type in "#uuid 1234"
21:18gfredericksthat's probably nrepl crashing?
21:18hyPiRionit turns out an assertion error, so probably
21:19hyPiRion,#uuid 1234
21:19clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.AssertionError: Assert failed: (string? form)>
21:19gfredericksprobably nrepl only expects some particular set of errors from the reader
21:19hyPiRion&#uuid 1234
21:19hyPiRionMost likely
21:19hyPiRionecho echo
21:19lazybotecho
21:34gfredericksoh I take it back
21:34gfredericksthe compiler sometimes rejects it as well
21:34gfredericksI can (def thing #my/date [2012 1 1]) but cannot (defn thing [] #my/date [2012 1 1])
21:34gfredericksI guess def doesn't really get compiled the same way
21:35hyPiRionwhat does `thing` print?
21:35gfredericksin the former case it would print the object using the print-method I defined. In the latter it's a compile error
21:39gfredericksI guess def doesn't necessarily involve any compiling at all
21:40gfredericksyeah eval allows the def as well
21:44gfredericksat least they're consistent. But that makes data readers seem 2% less useful
21:45mehworkcan't believe github is still down
21:46gfredericksI bet github can't believe github is down in the middle of the holidays like this
21:49amalloyi wonder how long they'd have to stay down before people start switching to bitbucket
21:49gfredericksI wonder what the halflife is
21:49gfredericksevery week half of the remaining users switch to bitbucket?
21:58mehworkno but bighub.com is taken
22:14muhoo*sigh* infoq presentations do not work on android tablets
22:45wingynoooo
22:53muhoowell not on mine at least (CM9)
23:01ivanheh, first google suggestion for "infoq" is "infoq rich hickey"
23:03ivanvideo is working for me in Chrome on Nexus 4
23:06muhooivan: thanks! chrome works, i was using firefox.
23:13pppppppppaulHey guys
23:14pppppppppaulGithub is back up
23:14pppppppppaulBest Xmas ever
23:16wingythought the end of the world wasn't over yet
23:39wingyhey 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:53theatticlightWhy are you putting your keys in separate namespaces?
23:53TimMctheatticlight: Why not?
23:53theatticlightJust wondering... seems odd to me.
23:53abp,(map :kw [{:kw 1 ;x 2} {:kw 6 ;x 5}])
23:53clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
23:54TimMcabp: ;
23:54abp,(map :kw [{:kw 1 :x 2} {:kw 6 :x 5}])
23:54clojurebot(1 6)
23:54abpwingy ^
23:54TimMcNot quite, wingy wants keywords from a certain namespace.
23:54abpTimMc, yep, this damned irc client loves cutting of my font baseline :(
23:54tomoj(for [[k v] m :when (and (symbol? k) (= (namespace k) "item-type.property"))] [k v]) :/
23:54tomojwingy: datomic?
23:54wingyi want the keywords with the :item-type.property/ prefix
23:54wingytomoj: yeah
23:55TimMcwingy: You want to suck out just those vals, or update those vals?
23:55abpah ok, misread
23:55tomojit would seem better to pick out the attributes you want ahead of time and just use select-keys, if possible
23:55wingyTimMc: i want to just read them
23:55tomojyou could pull all the attributes out of datomic and group them by ns ahead of time or something
23:55wingyhmm .. maybe i can query them?
23:55theatticlightYou can get the namespace from a keyword with the "namespace" function
23:55tomojs/symbol?/keyword?/ ofc
23:56theatticlightyes
23:56TimMc,(into {} (for [[k v] {:foo/a 1 :foo/b 2 :c 3} :when (= (namespace k) "foo")] [k v]))
23:56clojurebot{:foo/b 2, :foo/a 1}
23:56tomoj(:db.install/attribute (d/entity db :db.part/db)) will give you all the attributes, iirc
23:57wingytheatticlight: yeah (namespace :item-type.property/usb-2_0-ports) => :item-type.property
23:57wingyi can filter by that
23:57wingyTimMc: great
23:57TimMc,(filter #(= (namespace %) "foo") (keys {:foo/a 1 :foo/b 2 :c 3})
23:57clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
23:57TimMc,(filter #(= (namespace %) "foo") (keys {:foo/a 1 :foo/b 2 :c 3}))
23:57clojurebot(:foo/b :foo/a)
23:58abpI need to get accustomed to that into-ism
23:58abp,(filter #(= (namespace (first %)) "x") {:x/a 1 :x/b 2 :a/b 1})
23:58clojurebot([:x/a 1] [:x/b 2])