#clojure logs

2012-05-13

00:09wkmanirethunderstorm, poweroutage, internet outage... and... I'm bakc.
00:09wkmanireback*
00:10wkmanirexeqi: I did get your link before my google... I mean, my internet stopped working. thanks.
00:13xeqiwere you able to get your address listbox working?
00:15technomancyany gnome shell users want to try my plugin out?
00:15technomancyor alternatively: any unity users want to make the switch so they can start extending their desktop in Clojure? =P
00:16gfredericksmake the switch?
00:16gfrederickslike to not-ubuntu or something?
00:19xeqior choosing gnome-classic or whatever for the window manager when they log in
00:24technomancygfredericks: I mean switch from unity to gnome
00:24technomancyunity is kinda lame anyway =)
00:24technomancygnome shell has its issues, but I'm pretty sure there's nothing that a well-placed ClojureScript extension couldn't fix
00:25technomancyUbuntu defaults to Unity but it works fine with Gnome too
00:25wkmanirexeqi: Haven't tried yet. been getting interruped.
00:25wkmanireinterrupted* bleh. I should have something working here soon.
00:34wkmanirexeqi: Got it figured out. That was definitely not was I expected, but the example was exactly what I needed. thank you!
00:35amalloytechnomancy: i use gnome, but don't know the first thing about scripting it. what awesome powers will your plugin unleash?
00:35wkmanirexeqi: https://www.refheap.com/paste/2704
00:36technomancyamalloy: right now: you can make a panel button that shows a hello world box!
00:36technomancy...in CloooooojureScript!
00:36technomancybut really the possibilities are endless
00:36wkmaniretechnomancy: Can you do anything at gnome3zombo.com?
00:36technomancywkmanire: you certainly can
00:37wkmanire:D
00:37technomancyamalloy: at the risk of blaspheming, it's kind of like Emacs. core written in C, UI written in a more friendly, dynamic language
00:37technomancy(we'll overlook the fact that the language currently happens to be JS since JS is a handy compilation target)
00:38technomancybasically, there are three ways to make large user-facing programs: 0) the unix way, 1) the Emacs way, and 2) the wrong way
00:38amalloy*laugh*
00:38gf3Raynes: Crap
00:38gf3Raynes: Thx
00:38technomancy0 only works if you can get by using processes and pipes as your core abstractions
00:39technomancyamalloy: gnome 3 means gnome has moved from 2 to 1.
00:39xeqiis it better than xmonad?
00:40technomancyxeqi: currently: not by a long shot
00:40technomancybut the potential is way higher IMO
00:40amalloyoh, gnome 3? this ol' computer is still on ubuntu 10.04 and gnome 2
00:40wkmanirexeqi: I really tried to like xmonad... I think I ended up liking it. But I still use openbox.
00:40wkmanirexeqi: I might give xmonad another go around eventually.
00:41gf3Raynes: I think it may have just been slow
00:41gf3http://cljbin.com/paste/4faf3b19e4b0565c9e05bcfd
00:43technomancyxmonad is definitely a local maximum
00:44uvtcamalloy: I was on 10.04, upgraded, but then was not very happy with Unity, so went with Lubuntu (which is like Ubuntu, but no Gnome, nor some other large-ish apps like Evolution and OO.o).
00:44wkmanireI think it's because I spend about 95% of my time on linux either in a web browser or in a full-screened xemacs.
00:44wkmanireSo being able to tile windows in xmonad didn't really help me with anything.
00:45wkmanireDesktop 1 gets emacs, Desktop 2 gets brower(s), Desktop 3 get's anything else etc...
00:45technomancyit's definitely more valuable when you have 2 displays
00:45wkmaniretechnomancy: I miss my second monitor :( I've been working on a laptop for the past 3 months.
00:52uvtctechnomancy: What do you mean by "gnome 3 means gnome has moved from 2 to 1."?
00:58technomancyuvtc: it's moved from "the wrong way" (huge piles of static C) to "the Emacs way" (core in C, UI in JS)
00:59wkmaniretechnomancy: Interesting that they chose javascript.
00:59uvtctechnomancy: Oh, I see. Thanks. Yes, wkmanire, interesting choice of language.
00:59technomancywkmanire: in 2002 or so they were talking about using guile
01:00technomancybut guile was awful in 2002
01:00wkmanireThey're probably going to see a whole lot of new apps popping up as a result.
01:00technomancywkmanire: there are tons of extensions already: https://extensions.gnome.org/
01:00zakwilsonJS makes a lot of sense if you want to make something pupular.
01:00wkmanireI'm not sure if there is value in an HTML 5 app also being able to run in gnome.
01:00technomancyextensions are the only reason FF is still around after chrome kept cleaning its clock in performance
01:01uvtcI hadn't considered switching from Ubuntu + Unity to Ubuntu + "Gnome Unity".
01:01wkmanireWow, there's a whole bunch of extensions.
01:01technomancygnome is not unity
01:02technomancygnome shell
01:02Rayneswkmanire: xemacs?
01:02technomancyI'll write a big ol blog post about it soon hopefully
01:02wkmanireAre we going to be able to target gnome with clojurescript?
01:02technomancywkmanire: we just did
01:02technomancythat's what I just posted =)
01:02uvtc!
01:03wkmaniretechnomancy: Sweet!
01:03wkmanireoh man, I cannot wait to get started with clojurescript.
01:03wkmanireI'm almost ready.
01:03technomancytry it out; let me know if it works on something other than my machine =)
01:03technomancyoh, the only thing it doesn't mention is after you generate your project you have to update project.clj with the specific :shell-version you're using
01:03wkmanireRaynes: emacs running on xorg as opposed to running in a terminal emulator.
01:04Rayneswkmanire: Oh, I thought you literally meant xemacs.
01:04technomancywkmanire: xemacs is a fork of GNU emacs
01:04technomancyI only know one person who uses it
01:04wkmanireI didn't realize it was a fork.
01:04uvtcwkmanire: `emacs -nw`?
01:04wkmanireuvtc: Right.
01:09wkmaniretechnomancy: As in cljs shell-version?
01:11wkmaniretechnomancy: I'm actually trying your new plugin out.
01:32michaelr525hello
01:34RaynesI'm writing Javascript!
01:34RaynesPinch me!
01:34uvtc*pinch*
01:36RaynesOw!
01:48wkmanireRaynes: What are you writing javascript for?
01:48Rayneswkmanire: refheap.com
01:49wkmanireNeed a hand?
01:49wkmanireI need a break anyway.
01:49RaynesActually finished. Was just a few lines.
01:49Raynes:)
01:49wkmanireah ok.
01:49wkmanireWhat did you add?
01:50RaynesThe paste box used to have a fixed height. I added a few lines to resize it based on the size of the window so that it looks good on all screen sizes.
01:50amalloyerrors
01:51spjtnice site. Am I the only one that accidentally typed C-x C-e on it
01:51wkmanireRaynes: Ah, I saw that issue.
01:51RaynesOf course, not *those* keyboard shortcuts.
01:51RaynesLight table might add those shortcuts. :p
01:51wkmanirevertical heights are a pain in the arse.
01:52RaynesThis was a really super easy solution.
01:52RaynesDon't know why I didn't do it ages ago.
01:53wkmanirehe he, one liner. Can't beat that.
01:55cgagI'm using clj-http, and trying to use the cookie-store, am I making an obvious mistake with this?
01:55cgag(set! clj-http.core/*cookie-store* (clj-http.cookies/cookie-store)
01:57wkmanireDammit, whats the paredit-mode command to wrap a region in square brackets?
01:57cgagi have ido so i don't know exactly, but it's something like paredit-wrap-square
01:57wkmanirenvm, kill, bracket, yank.
01:58amalloyM-x paredit-wrap-square
01:58Rayneswkmanire: There is the function though, so it's more than one line.
01:58amalloybind it to something, if you want
01:58Raynesamalloy: WAAAAAT
01:58RaynesThat exists?
01:58wkmanireamalloy: Thanks.
01:58RaynesWhy isn't it bound to M-[?
02:00spjtam I the only person that can't stand paredit
02:00RaynesI think so, yes.
02:00amalloyescape characters are hard, Raynes
02:00RaynesI can't even write code without paredit at this point.
02:00amalloyM-[ is fine in a gui, but that's hard to send over ssh
02:00RaynesI'd kill something.
02:00uvtcspjt: I haven't taken the paredit-plunge yet myself.
02:00wkmanireRaynes: really? I guess I only saw the one line change in the diff. + editor.refresh()
02:00Rayneswkmanire: That's a different commit. Look at the one before it.
02:01wkmanireahhh ok
02:01spjtFor some reason I tend to write functions from the inside out, which doesn't work well with paredit
02:01wkmanireuvtc: it's worth it. Although sometimes I still turn it off to fix messed up parens.
02:01RaynesSo do I, spjt.
02:01scottjwkmanire: if you have [ bound to paredit-open-bracket I think you can just type that if you have a region selected
02:01Rayneswkmanire: C-u backspace
02:02spjte.g. (/ (+ 1 2) 2) with paredit, if you've written (+ 1 2) first, seems to not like putting the parens on the outside
02:02wkmanirescottj: bingo! awesome tip
02:02Raynesspjt: M-(
02:03Raynes|(+ 1 2) <-- If your cursor is where the | is, M-( gets you ((+ 1 2))
02:03spjtRaynes: hehe, I think I just prefer (
02:03RaynesThe answer to life, the universe, everything.
02:03spjtI'm just excited that I finally found out how to disable C-c in term mode, so now I can use emacs as my shell :)
02:04wkmanirespjt: I think there was an actual emacs based linux distro at some point.
02:04wkmanireIt booted you directly into emacs from power on.
02:07wkmanire#clojure, makes you better at emacs.
02:08uvtcwkmanire: Thanks. So I've heard (that paredit is worth it). I've got a video of the talk Neale S gave on it, but haven't gotten round to really trying it out for more than 5 minutes.
02:08scottjspjt: yeah in that case I'm not sure paredit helps much. It's C-M-u ( / C-M-f 2 ) vs C-M-u M-( / C-M-f 2. anyone know a useful feature here?
02:09rbxbxuvtc: definitely need ot spend more time with it than that to start to appreciate/be productive with it. Definitely worth taking the 30-45 minutes and going through emacs tutor.
02:09wkmanireuvtc: I didn't know there was a video. Link?
02:09spjtThe best thing you can do is print out the emacs reference card :)
02:09spjtI actually have a printed emacs manual, but it's for version 19 or so
02:09rbxbxuvtc: and for me at least, not using something like prelude that gives you sensible defaults you don't understand helped a lot as well... That 'blackbox' style of usage didn't work well for me.
02:09spjtfrom the last time I tried to get into it and gave up
02:10rbxbxpredominantly have a hard time fighting my vi muscle memory more than anything else :)
02:11uvtcwkmanire: err... it's a 7-minute lightning talk. Hm. I think I found the link searching the ML archives ... (just a sec)
02:11Raynesrbxbx: I use evil-mode.
02:11uvtcrbxbx: "prelude"?
02:12uvtcwkmanire: Here it is: <http://skillsmatter.com/podcast/scala/paredit-mode&gt;
02:13wkmanireuvtc: Thank you!
02:13uvtcwkmanire: y/w :)
02:13rbxbxRaynes: I used evil as well, but I felt like I knew just enough emacs that evil was beginning to hurt me. Plus a handful of vim things being un/half-implemented..
02:13rbxbxRaynes: easier just to not fight it, I found ;)
02:14rbxbxuvtc: http://batsov.com/prelude/
02:14rbxbxuvtc: it seems like a good batch of settings, and I like the ease of getting up and running... but felt like there was too much going on that wasn't vanilla emacs for learning.
02:15uvtcrbxbx: If I use vim even for a short time, it takes me the rest of the day to stop hitting :wq to quit every app I'm in contact with. :)
02:15rbxbxuvtc: yeah, I had :q remapped in bash to exit for a while. /me has broken vim brain
02:16rbxbxuvtc: and then I can use vimperator and vimium in my browsers to perpetuate my bad/good habits ;)
02:17wkmanireI remember the first time I tried to use vim. I went to edit a text file and my knee jerk reaction was to start typing.
02:17wkmanireI've never liked VIM since then.
02:17scottjdo vimmer's wish they'd used ; instead of : for commands since it's unshifted?
02:18scottjwkmanire: there's probably an option to put in insert mode by default :)
02:18rbxbxHmm. I find : pretty easy to type... though the binding on ; is arugably less useful.
02:18rbxbx*shrug*
02:18rbxbxPlus you're not necessarily in command mode _that_ often.
02:19rbxbxnormal mode ftw ;)
02:22wkmanireRaynes: Do you have an aversion to semi-colons? :P
02:24spjtI still go through cycles where I edit .emacs with vi and then start emacs to see if it works
02:25rbxbxspjt: I do that as well ;) – really ought to alias vi/vim to emacs -nw someday.
02:26spjtI have to ssh into servers all day that don't have emacs so I'm sort of stuck with vi anyway
02:27rbxbxI think it's important to at least be adequate in both...
02:29rbxbxBut being in boxes you don't have control over sure must be an impedement to learning/trying things out :(
02:32scottjspjt: emacs-lovers use tramp in that case
02:33spjtI still think vi is better than emacs for quick edits, sorry :)
02:35uvtcspjt: If you've got a compiler available, one nice small little editor that's easy to build and use is [ne](http://ne.dsi.unimi.it/).
02:35spjtuvtc: I might have to ssh into 100 different servers every day, so probably not :)
02:36rbxbxspjt: I find having a subset of emacs readline bindings set up to work while in insert mode in vim to be helpful.
02:37rbxbxspjt: at least the big ones, ctrl+e/ctrl+a/ctrl+f/ctrl+b/etc
02:37eggsbyyou can implement vi pretty adequately in emacs, could you implement emacs in vi?
02:38rbxbxeggsby: not exactly, but there have been attempts – http://www.vim.org/scripts/script.php?script_id=300
02:39rbxbxeggsby: the issue being that VimL is something of a mindfuck if you're doing anything of reasonable complexity.
02:39spjtI tried to get into emacs before, but I never really kept with it until clojure, since being able to evaluate from the file you're editing is too useful.
02:40rbxbxspjt: fwiw slime.vim is pretty acceptable on that front... basically just run a repl inside of a named screen session and shoot code over to it...
02:40rbxbxspjt: it's not nearly as advanced, but comes pretty close in basic cases.
02:40spjtrbxbx: I've put too much work into my .emacs to go back :)
02:41spjtI wanted to learn clojure, somehow ended up learning more emacs lisp
02:41rbxbxspjt: and I'd not urge you to do so, but it's nice enough if you find yourself in vimland and want a lispy development cycle. (bonus! works for any language with a repl!)
02:42eggsbyI wonder if I could set that up with tmux...
02:42spjtthe boxes at work don't have the jvm either...
02:43rbxbxspjt: clojurescript running on type of python then? :p
02:44spjtrbxbx: is that a thing?
02:44spjtI think they have python 2.4 or something
02:44rbxbxspjt: https://github.com/halgari/clojure-py
02:44spjtI've totally given up on python now
02:44ibdknoxthat's not cljs
02:45eggsbyheh, I play a lot with python and I haven't even played w/ that project
02:45ibdknoxit's a port of JVM clojure unfortunately
02:45rbxbxspjt: I'd sort of doubt it being ready for a production app, but it seems to have been reasonably maintained.
02:45rbxbxibdknox: ohhh.. Am I thinking of the one running on top of guile?
02:45eggsbyclojure is pretty tied to the jvm, js is probably the closest it's gotten to running on another vm
02:45ibdknoxthere's a cljs impl that emits scheme
02:45eggsbylol
02:46ibdknoxand soon a lua one
02:46eggsbyjs is my vm
02:46eggsbylua-clj would rule
02:46spjtmy main problem with python has been mostly "oh, I wrote it for this version, you have that version, so it doesn't work"
02:46rbxbxCan't keep up with you whacky clojure kids ;p
02:46uvtcibdknox: Why "unfortunately"?
02:47ibdknoxit's "wasted" effort
02:47eggsbyspjt: I've never had that problem... you use virtualenvwrapper?
02:47ibdknoxfor example if they had started from CLJS we would be much closer to Clojure in Clojure
02:47ibdknoxsince they would've had to have solved eval and a number of other things
02:47spjteggsby: I don't use anything.
02:47ibdknoxthe work would've been much more reusable for other implementations
02:47ibdknoxsay an LLVM one :)
02:48wkmanirespjt: virtualenv makes Python a lot easier to deal with for that specific problem.
02:48spjtis anyone working on a llvm clojure?
02:48ibdknoxno
02:48eggsbyhas clojure had growing pains re: versioning compatibility?
02:48ibdknoxerr, not to my knowledge
02:48eggsbyif not, do you think it will?
02:48spjteggsby: not like python
02:48uvtcibdknox: Thanks for your thoughts. I think clojure-py appeals to folks who like Clojure but who don't want to use the JVM for whatever reason.
02:48ibdknoxeggsby: the 1.3 transition hurt a little
02:49rbxbxeggsby: I think leiningen helps a lot in that regards... if not directly solving the problem.
02:49eggsbylike what about when java gets clojures or if the jvm gets tco
02:49spjtin python, everything breaks. even print doesn't work from 2 to 3
02:49ibdknoxuvtc: yeah, that could've happened using the CLJS compiler too though :)
02:49eggsbyerrr
02:49eggsbyclosures*
02:49spjteggsby: it seems like that would just change the implementation
02:49uvtcibdknox: Not sure I understand. You mean start with the cljs compiler and have it emit Python instead of JS?
02:49ibdknoxuvtc: yep
02:50ibdknoxuvtc: it's not unreasonable to assume that down the line JVM clojure might just be Java emitted from the CLJS compiler
02:50ibdknoxmight be quite a ways down the line
02:51uvtcibdknox: Now might be a good time to contact the author of clojure-py about that. He's starting a pretty major rewrite at the moment, fwiu.
02:51ibdknoxbut as the CLJS stuff improves it becomes more and more appealing
02:51spjtI'm still not sure what cljs is for
02:51eggsbymmm languages written in their own langauge, so nice
02:51uvtcibdknox: currently, afaik, clojure-py generates Python bytecode.
02:51ibdknoxspjt: building awesome things
02:52rbxbxspjt: applications that need to target javascript?
02:52rbxbxspjt: basically every web app and some non.
02:52rbxbx;)
02:52ibdknoxspjt: like this: http://www.chris-granger.com/2012/02/26/connecting-to-your-creation/
02:52spjtrbxbx: I just started using javascript, but it's pretty weak stuff
02:52eggsbyi've invested so much time into ~my existing javascript toolkit~ how can I abandon it
02:53rbxbxeggsby: uhhh. You're in the Clojure channel aren't you? Clearly you understand the value in using a powerful/sane toolchain
02:53rbxbxin spite of learning curve...
02:53rbxbxeggsby: plus if you've already taken to Clojure half the learning curve is already behind you.
02:53spjtibdknox: what's he using to edit in that video?
02:54ibdknoxhe = me :)
02:54ibdknoxand not sure I understand your question
02:54eggsbyI saw a gist of using core.match for clientside validation... looked so nice
02:54spjtok, you, what are you using to edit in that video? :)
02:54ibdknoxit's a codemirror instance in the browser
02:54spjtyou have a split screen editing on one side and making changes
02:55ibdknoxthe code's on github
02:55ibdknoxif you wanna take a look
02:55ibdknoxspjt: also of note: http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/
02:56eggsbyibdknox: that's a similar method to the in browser repl right?
02:56ivanthere is no portable Python bytecode so generating it is kind of wrong; users are just lucky PyPy has the same as CPython's with a few addons
02:56ibdknoxeggsby: sort of
02:56ibdknoxeggsby: it's real-time evaluation, though the mechanism is similar, yeah
02:57rbxbxspjt: yeah. While javascript got a lot of things right the implementation is just awful... and the culture surrounding it. eek. Scarybad :D
02:58eggsbyibdknox: that's the sort of stuff that makes cljs look so exciting :)
02:58ibdknox:)
02:58spjtrbxbx: Yeah, I like it a lot more than I thought I would. I've heard so many bad things about it.
02:58ibdknoxa practical starting point: http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/
02:59ibdknoxas long as you know some about clojure
02:59ibdknoxand have done a little JS before
02:59michaelr525ibdknox: hi, is it reasonable for 'lein run' in a webnoir project to take a few minutes to start the server?
02:59rbxbxAlso if you're wondering how CLJS may fit into your webdev workflow the relevance crew have been working on http://clojurescriptone.com/ which is a pretty illustrative demo
02:59ibdknoxmichaelr525: minutes? that's way too long. What version of lein?
02:59spjtI've probably spent 10x as much time on clojure as javascript, yet I seem to know 10x more javascript.
03:00ibdknoxspjt: what's your background?
03:00amalloyminutes is plausible if he's AOT compiling the whole thing transitively (that's the most common mistake i know of that would cause that)
03:00ibdknoxah
03:00rbxbxIn clojure you spend cycles learning about higher levels of abstraction, in JavaScript you spend cycles learning to reconcile quirks ;)
03:00michaelr525ibdknox: Leiningen 1.7.1 on Java 1.6.0_23 OpenJDK 64-Bit Server VM
03:01eggsbyhah rbxbx succinct
03:01spjtibdknox: Not functional. :)
03:01ibdknoxmichaelr525: try adding ^{:skip-aot true} after :main in your project.clj
03:01ibdknoxe.g. :main ^{:skip-aot true} my.ns.foo
03:02ibdknoxspjt: JS is probably just similar to what you've done before. Almost all of the c-based languages are essentially the same
03:02michaelr525ok, let me try that
03:03spjtibdknox: In C or Java, I might not always know the "best" way to do something, but I can almost always get it done. In clojure I still frequently get to a point where "I don't know how to do this, and I have no idea where to even start to find out how."
03:03eggsbylikewise spjt, I just bug this chan when that happens :)
03:03ibdknoxspjt: yeah, it takes a little time, but I promise it'll ultimately make you a better programmer in the long run
03:04ibdknoxfor many, Clojure is an eye opening experience
03:04ibdknoxmyself included :)
03:04spjteggsby: hehe. I really try not to. Last thing I gave up on was taking a bunch of nested vectors within nested vectors and turning them into one list of vectors
03:04spjteggsby: The problem is I didn't really learn anything, because I don't understand at all how it works.
03:05Soraimaholaaa
03:05Soraimaalguien habla español
03:05Soraima??
03:05lazybotSoraima: Definitely not.
03:05ibdknoxlol
03:05eggsbyspjt: I recommend clojuredocs.com
03:05Soraimano no i am colombia
03:05Soraimawoman
03:05eggsbythe examples clarify stuff a lot
03:05Soraima???
03:05lazybotSoraima: Oh, absolutely.
03:05Soraimai am colombia woman 20 age
03:05Soraimaespañol
03:06eggsbyI've found the actual (doc some-func) leaves a bit to be wanted... while they are all technically correct when you don't understand them they don't help at all
03:06rbxbxspjt: I find clojure better arms you to help yourself out...
03:07rbxbxIf you haven't seen it, devn is working on a project that may be of interest to you https://github.com/devn/indiana
03:07rbxbxAllows you to finding (working) examples of the usage of a particular function... which can be very instructive (and fun!)
03:08michaelr525ibdknox: didn't seem to help, should i try to upgrade to lein 2?
03:08ibdknoxmichaelr525: you could, but I'd be surprised if that fixed it :(
03:08rbxbxAlright #clojure, to bed with me. It was real :)
03:09spjthttp://pastebin.com/W2tJQfuQ This is an assignment I did for a class. I'm trying to do it in clojure, this is as far as I got: http://pastebin.com/ERNzwdgU
03:11tomojspjt: maybe you want to do a direct translation, but you may want to look at https://github.com/daveray/seesaw
03:11michaelr525too bad there is no verbose option to see what's going on in these minutes
03:11spjttomoj: I'm trying to do as much as possible by hand so I can understand what's going on
03:12spjtMy latest problem with that is the (get-usable-canvas) function
03:12spjtwell, that works, it returns a canvas, but (.getGraphics canvas) always returns nil.
03:14spjtor (.getGraphics (get-usable-canvas 512)) is what I think I was aiming for
03:14spjtit opens the window, but I can't get the Graphics object.
03:14wkmanireRaynes: Still there?
03:14Rayneswkmanire: Yep
03:15wkmanireRaynes: I'm working on the javascript for refheap.
03:15wkmanireIs there a particular reason why create.js and refheap.js are separate?
03:15Rayneswkmanire: Modularity.
03:16Rayneswkmanire: I think I actually did it so I'd only have to load js for a given page on that actual page.
03:16RaynesWhat are you working on?
03:16wkmanireRaynes: but these scripts aren't being dynamically generated and they're really small.
03:16Raynes*shrug*
03:16wkmanireIt'd be better to put the scripts all together so that the browser caches them on the user's first visit.
03:17RaynesMy problem with it is that I'm binding events to ids and stuff. If I reused those ids and classes on other pages, I'd end up with a mess.
03:17RaynesBut I'm not a JS guy. I thought this was better.
03:17wkmanireOk, well I'm only looking at the scripts under resources/public/js
03:18wkmanireRaynes: Here, I forked it. Let me push refheap.js so you can see what I'm screwing with.
03:19RaynesI don't think I'd care if the scripts were all put in a single file again. It just 'feels' wrong, but like I said, not a JS guy so I wouldn't know how people do these things.
03:20wkmanireRaynes: https://github.com/wkmanire/refheap/commit/feb3bccbd77be27f6e4e7d6e04f4625a68b560b3
03:20tomojwe have a thing that takes the many files in the source and combines them into one file as require-able modules
03:20tomojthere are many such things I believe
03:20wkmaniretomoj: requirejs?
03:20ivanRaynes: latency to get another script will generally be worse than the few extra KB to get it all the first time
03:20tomojbut for two files.. overkill :)
03:21tomojwkmanire: I guess that is one such thing, we use browserify right now
03:21Raynesivan: Speed wasn't my concern.
03:21wkmanireRaynes: I'm just reading the code and playing with stuff.
03:21wkmanireRaynes: You have a lot of functions getting attached to the global scope (window)
03:21wkmanireIn create.js
03:21Rayneswkmanire: Does that .post actually work? I could have swore I had a reason for using .ajax specifically, but I can't remember now.
03:22spjthehe, I tried that seesaw thing and it doesn't compile. Oh well.
03:22wkmanirethat aughta go into a psuedo-namespace. Javascript doesn't have real namespaces but you can cut down on collisions by using a single global object.
03:22wkmanireRaynes: yes, I tested it just now
03:23Rayneswkmanire: I have no idea what you just said.
03:23wkmanireLook at line 9 of create.js
03:23wkmanireWhen you declare a function like this it will get attached to the window object.
03:23amalloyRaynes: he suggests you use a function to "fake" a let, so you don't pollute the global namespace
03:23wkmanireWhich is the global namespace of the browser.
03:24RaynesOh, those weren't the kinds of collisions I was worried about, but sure.
03:24wkmanireSo we almost exclusively use the "var foo = function () {...}" syntax
03:24amalloy(function() {var x = 1;})() // JS devs love this stuff
03:24wkmanireamalloy: Yep, sure do.
03:25wkmanire(function () { var x = 1;}())
03:26ibdknoxamalloy: and by love you mean...
03:26spjtI hate that.
03:26uvtcibdknox: ping?
03:26wkmanireRaynes: The only scope you get in javascript is function scope. And since there are no namespaces, collissions happen constantly. One thing I do is I wrap a function closure around all of my code so that I can gaurantee that for the scope of my module
03:26ibdknoxuvtc: pong
03:26wkmanirethat undefined === undefined, window === window and $ = jQuery
03:27uvtcibdknox: in this thread http://groups.google.com/group/clojure-py-dev/browse_thread/thread/31e93bb179001dfa# the author mentions why translating to Python (rather than Python bytecode) is problematic.
03:27Raynes wkmanire: Is that what this $( function ( $, window ) { } ( jQuery, window)); crap or whatever is?
03:27uvtcibdknox: "I started with that idea, but for instance, clojure supports
03:27uvtc multi-statement lambdas and Python does not. So the compiler has to
03:27uvtc drop to the bytecode level to support all the features it needs. "
03:27wkmanireRaynes: Right.
03:27spjtI have a webpage at work I need to keep open, and the people that made it got a little too excited with the javascript so I needed to make another script that overrides all of the javascript on the page. Only problem is I can't override anonymous functions because there's no name to overwrite.
03:27RaynesI have no idea what this code means at all.
03:27ibdknoxuvtc: unless there's something I'm not thinking through, you can make the CLJS compiler emit bytecode too
03:27wkmanireRaynes: :)
03:28wkmanireYou seem to dislike javascript.
03:28ibdknoxwho doesn't ;)
03:28RaynesNo, I just haven't done much of anything with it and I need to understand your code if I'm ever going to work with it again.
03:28uvtcibdknox: thanks.
03:28RaynesYou might not always be around to maintain my javascript.
03:29wkmanireRaynes: he he, I'll explain this stuff afterwards.
03:29ivanuvtc: I don't think you need to generate lambdas (even though you can trick them into doing multiple expressions)
03:30wkmanirehopefully clojurescript will catch fire and we'll have a better option in the future.
03:30wkmanireI'd love to see <script type="text/clojurescript"> be recognized natively. Assuming that clojurescript. Or text/coffeescript for that matter.
03:30ivanwkmanire: that could work once the ClojureScript compiler can be compiled to JavaScript
03:31ivanI doubt browsers are going to start supporting clojurescript natively any time soon
03:32wkmanireivan: I talk about this a lot with one of my coworkers. I just wish it were an option. I wish I could configure the browser to let any script interpreter I want handle script type X. In a sandboxed user account of course. Not unlike a shebang but with less bite.
03:33ivan<script type="text/javascript" src="clojurescript.js"></script>
03:33wkmanireThe interface would be like CGI but you get handed a DOM.
03:33ivan(I know you want a better thing, but it's pretty hard)
03:34ivanI mean, a lot of V8 would have to change
03:36ivanwkmanire: oh, that's a very different thing if it's running outside the browser process
03:36ivaninteresting.
03:36wkmanireivan: For me, the biggest use case would be custom client apps for internal business applications.
03:36ivanthere are some browser testing/automation frameworks that do something like what you want
03:36ivanpossible Windmill in Python, but I forgot
03:37ivanpossibly
03:38ivanwkmanire: you can connect to Chrome and tell it to run certain JS
03:38ivanI think there is a better API in development, but it's geared towards browser automation/testing
03:38ivanmaybe you can take over their mailing list with your use case
03:39wkmanireivan: So if a business has a large software package written in Python and they want to use it to do stuff on various client machines, then the client machine just needs a copy of the library and a web browser and they're automatically up to date + the user is still clicking the little blue E to start their day.
03:39wkmanireivan: He he, I doubt it.
03:39Rayneswkmanire: ibdknox just explained your code.
03:39RaynesIt's just I didn't recognize the new on-ready stuff.
03:40RaynesAnd he is also explaining why you passed that stuff in.
03:40wkmanireRaynes: Ahhhh, sorry, I forgot to mention.
03:41wkmanireRaynes: Also, the browserid API has been updated. I have never worked with browserID so I went onto MDN and read about the navigator.id object.
03:42wkmanireRaynes: They want you to use navigator.id.get now.
03:43Rayneswkmanire: Feel free to update that too.
03:43Rayneswkmanire: What else are you going to poke around with?
03:44wkmanireFor tonight I'm just going to clean up create.js.
03:44wkmanireAnother time perhaps we can discuss combining the javascript.
03:44wkmanireI think api.js is unused correct?
03:45Rayneswkmanire: I'd appreciate it if you could explain the things you clean up for me too, if you've got time.
03:45RaynesAPI is used.
03:45wkmanireNo problem.
03:46Raynescreate.js is the only significant JS I have, IIRC.
03:46RaynesI'll do the combining part.
03:46wkmanireRaynes: If you'd like to pop into another channel for this, or perhaps talk to me over a messenger client that'd be fine.
03:47RaynesWe have a #refheap channel! :D
03:47wkmanireMost of this stuff has nothing to do with clojure at all. I'm sort of flooding here.
03:47wkmanireOk, I'll join that channel then.
03:52wmealing_lein search can take a _really_ long time, is there any tricks i could do to speed it up.
03:52wmealing_its "downloading from central repo.. maven.org"
03:52wmealing_Downloading index from central - http://repo1.maven.org/maven2 ... this may take a while... no kidding.
03:53wmealing_3 hours so far.
03:55wmealing_how big are we talking about for this download.
03:55RaynesUnless you're on dialup, something went wrong.
03:55wmealing_dsl 8 down 1 up
03:56wmealing_Mb, of course.
04:00noncomthe lein-eclipse plugin is dated by 2 years, is it safe to go with it?
04:02_KY_If I use "send", the argument passed to the func is the state of the agent, not the agent, right?
04:04wmealing_109k/s down for 3 hours, suspect.
04:04_KY_(Nevermind...)
04:18wmealing_Raynes, where should it be putting its files, in this circumstance ?
04:18Raynes~/.lein/indices
04:18clojurebotI don't understand.
04:18RaynesYou should probably stop it and try again at this point.
04:19RaynesIt's only like 70MB.
04:34_KY_How can I write (fn [_] 13) in # notation?
04:34_KY_Seems to require an "identity function"
04:34raek_KY_: you can't
04:34Bronsa(,#(do 13))
04:34Bronsaops
04:35raekwell, you can do (constantly 13) or #(do 13)
04:35Bronsa,(#(do 13))
04:35clojurebot13
04:35_KY_I see...=)
04:35_KY_Thanks
04:35raekthe #() syntax requires the body to be a call form, which "13" isn't
05:19CozeyHello. Why (conj {} [:a 1]) works, and (conj {} '(:a 1)) doesn't ?
05:20Cozey`(conj {} '(:a 1))
05:20Cozey,(conj {} '(:a 1))
05:20clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry>
05:21mittchelAfternoon everyone
05:26wmealing_my this is frustrating
05:27BorkdudeI'd like to analyze some Clojure code with https://github.com/frenchy64/analyze - is he here?
05:30Borkdudenever mind, twitter
05:38wmealing_technomancy, is there a chance we can get some progress bars for the "downloading from central repo" or is that outside of leiningen ?
05:39antares_wmealing_: it belongs to pomegranate
05:39fliebelCozey: because a vector of 2 is special-cased to represent a map entry in some places. At least, that is what I think it is.
05:39antares_I think Aether (Maven library for dependency management) supports it
05:40Cozeymhm, so a proper way would be to (apply hash-map list-or-vector)
05:43fliebelCozey: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L23
05:44CozeyPerfect, thanks!
05:44fliebel&(conj {:a 1} {:b 2})
05:44lazybot⇒ {:b 2, :a 1}
05:45fliebelso if it's not a mapentry or a vector of 2, it should be a sequable thing that is a seq of map entries.
05:45fliebel&(seq {:a 1})
05:45lazybot⇒ ([:a 1])
05:46fliebel&(map class (seq {:a 1}))
05:46lazybot⇒ (clojure.lang.MapEntry)
06:18Cozeythanks!
06:18mittchelHey, I've got a question regarding Comp. If you have this: (let [x 4 y 1] ((comp + - -) x y)) what happens is it takes -4 and adds it with 1 so you'll have -3 as answer, but I thought it would take -4 and -1.. why is it doing +4 + -1 when you have 2x -
06:20raekmittchel: ((comp + - -) x y) is the same as (+ (- (- x y)))
06:21raek(+ (- (- 4 1))) → (+ (- 3)) → (+ -3) → -3
06:23mittchelSo first it calculates -4 +1 = -3 and (+(-3)) stays the same, so answer is -3
06:24raekno, first it calculates 4 - 1, yielding 3. then it negates 3, yielding -3, then it passes -3 to + with only one argument, which does nothing, yielding -3
06:25raek((comp f g h) x y z) is the same as writing (f (g (h x y z)))
06:26mittchelYep I know it turns it around haha
06:26raekthat is, the f and g functions only receive one argument
06:27raekmittchel: there is probably a way to express your original intention in clojure code too
06:34matessimibdknox, any news with light table?
06:53mittchel(defn max-except-first[[x & args]] (apply (max(rest args))))
06:53mittchelWhen I call it like this: (max-except-first [100 78 7 9 12]) it gives me an error
06:53mittchelSaying wrong number of args passed
06:53mittchelits a list right
06:54Bronsa,((fn [[x & args]] (apply max (rest args))) [100 78 7 9 12)
06:54clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
06:54Bronsa,((fn [[x & args]] (apply max (rest args))) [100 78 7 9 12])
06:54clojurebot12
06:54Bronsayou want (apply max (rest args))
06:55Bronsanot (apply (max (rest args)))
06:55mittcheldarn:P
06:55mittchelclose
06:55Bronsaalso, put a space before the args vector
06:56Bronsa(defn f [])
06:57mittchelWell it returns 12 which isn't correct. It should subtract the first one and give me the max of the rest (so 78)
06:57Bronsawell.
06:58Bronsa,(let [[x & args] [1 2 3 4]] {:x x :args args})
06:58clojurebot{:x 1, :args (2 3 4)}
06:58Bronsa,(let [[x & args] [100 78 7 9 12]] {:x x :args args})
06:58clojurebot{:x 100, :args (78 7 9 12)}
06:58Bronsaif you call rest on args you get (7 9 12)
06:58Bronsaso either
06:59Bronsa,((fn [[x & args]] (apply max args)) [100 78 7 9 12])
06:59clojurebot78
06:59Bronsaor
06:59Bronsa,((fn [args] (apply max (rest args))) [100 78 7 9 12])
06:59clojurebot78
07:00mittchelbut what differs your last one from mine? since you call rest on args there
07:01Bronsayeah i call rest
07:01Bronsabut i dont destructure
07:01mittchelOh it has 1 input
07:01Bronsadestructuring like that you call rest once
07:01Bronsaif you call rest again, you get the vector removed of the two first items
07:02mittchelAhh
07:02mittcheland your first example includes destructerin
07:02Bronsayeah
07:03mittchelIs that available in the documentation? I have been searching for it:/
07:03Bronsawhat?
07:03clojurebotwhat is 2d6
07:04Bronsathe destructuring syntax?
07:04Bronsahttp://clojure.org/special_forms it's here
07:05Bronsacheck where it documents `let`
07:07mittchelHmm
07:08mittchelI don't understand the main goal of restructuring.. is it to transform certain sequential types into a vector/list of any of that kind?
07:09mittchelOr is it like you know you'll receive a list so you can take it a part?
07:16Cozeymittchel: think destructuring is just for convenience, so you can take apart the structure in one line, instead of writing a (let ..) to take values from inside the structure
07:17mittchelcozey: thanks for the clarification
07:35Borkdudeam I wrong or was it possible to annotate code on github before?
07:35Borkdudewas this feature removed?
07:39Borkdudeah found it
07:42wmealing_i think it was..
08:50Borkdudewmealing_: broke lein?
08:51wmealing_my local config, lein search never seems to return
08:51wmealing_downloads ~ 45mb, then just sits there.
08:52wmealing_it puts a file in /tmp/leinNNNnnNNnNnNnnn
08:52wmealing_then thats all i get.
08:52wmealing_"lein search ring" is such a command
08:55Borkdudewmealing_: sorry, I never used it
08:55wmealing_when it works, it rocks.
08:55Borkdudewmealing_: what does it do?
08:56wmealing_automating clojure projects without setting your hair on fire
08:56wmealing_so the story goes.
08:56wmealing_https://github.com/technomancy/leiningen
08:56wmealing_lots of plugins to make it all shiny.
08:56Borkdudewmealing_: I know, but I mean lein search
08:56wmealing_but its plenty useful even by itself
08:56wmealing_oh
08:56wmealing_finds jars for my project.. apparently
08:56wmealing_i'd like to install drools
08:56HCumberdaleHi ;)
08:57HCumberdaleSeeing strange behaviour with monger & map-reduce
08:57xeqiwmealing_: lein2-preview4 has a progress indicator
08:57wmealing_xeqi, sweeet.
08:58xeqinot that that will help if it's stalling somewhere else
08:58wmealing_yeah, but at least i'll have an idea if its doing anything
08:58wmealing_or nothing
09:00xeqiI usually just use search.maven.org or go to clojars.org and search there
09:02xeqiis there something you're looking for with ring?
09:02xeqior was that just an example
09:02wmealing_that was an example
09:02wmealing_i was looking for drools fusion actually
09:03wmealing_i'm pretty new to how things work in java
09:09Borkdudeehm, what was the leiningen command to see the resolution of dependencies?
09:10Borkdudeah, :tree
10:39twhumeAnyone able to help with a newbie question on lazy sequences? I'm trying to generate a breadth-first tree of the form A, B, C, AA, AB, AC, BA, BB, BC, CA, CB, CC, AAA, AAB, AAC.
10:40_KY_If I have a huge list in memory, I modify it to get list2, but I also keep a reference to list1 -- how can I make sure they share parts and not waste too much memory?
10:41_KY_twhume: are you trying to generate that?
10:41twhumeKY: yes.
10:42twhumeSo far I have (defn make-tree "" [node l depth]
10:42twhume (if (< (count node) depth)
10:42twhume (let [children (map #(str node %) alphabet)]
10:42twhume (lazy-cat children (mapcat #(make-tree % l depth) children) l)
10:42twhume )))
10:42twhume…which gives me ("A" "B" "AA" "AB" "AAA" "AAB" "ABA" "ABB" "BA" "BB" "BAA" "BAB" "BBA" "BBB") - close but not quite there.
10:43_KY_Shouldn't it be completely lazy?
10:43fliebeltwhume: So are you "counting", generating all possible "Words"?
10:43HCumberdaleHi!
10:44HCumberdaleIs there a fn to count the occurances of a object in a map
10:44twhumefliebel: the count is there to set a maximum limit on the depth I go to. I'm not sure if the issue with my implementation is lack of understanding of lazy-cat or a poor implementation of the algorithm.
10:44HCumberdalelike ("x" "y" "z" "x") => ("x" 2 "y" 1 "z" 1)
10:45_KY_Yes there's a library function for that...
10:45fliebel_KY_: I don;t think you can share parts of a linked list. You can share the end of one though.
10:45fliebel$findfn [1 1 2] {1 2 2 1}
10:45lazybot[clojure.core/frequencies]
10:46_KY_,(doc frequencies)
10:46clojurebot"([coll]); Returns a map from distinct items in coll to the number of times they appear."
10:46wmealing_the cdoc help is awesome.
10:46_KY_=)
10:47HCumberdalethx
10:47_KY_twhume: sorry I'm not that familiar with lazy sequences...
10:47twhumenp, thanks for popping up.
10:48fliebeltwhume: What I would do is do (range), convert to n-base numbers, and then replace the symbols you want :P
10:48_KY_fliebel: say if I use assoc to change part of the list... but the list may be huge...
10:48fliebel_KY_: assoc on a list? ##(assoc '(1 2 3) 4)
10:48lazybotclojure.lang.ArityException: Wrong number of args (2) passed to: core$assoc
10:49_KY_twhume: look in library "combinatorics", if your goal is just to do it not to learn
10:49twhumefliebel: heh, dirty. But I don't think that'll work for me. This is a model for the thing I *really* want to do (generating vast streams of Java byte code - don't ask!) and I don't think that'd work for the real problem.
10:49twhumeKY: ideally I'd do both! Will have a look, thanks.
10:50fliebel_KY_: Vectors do share stuff, if that's what you mean. Then assoc is fine, as well as subvec
10:50fliebel(doc subvec)
10:50clojurebot"([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
10:50twhumeKY: omg, that's *exactly* what I'm looking for. Thanks!
10:51_KY_=)
10:52_KY_fliebel: I have the deeply nested structure consisting of vectors of maps, recursively
10:52_KY_fliebel: *I have a deeply nested structure consisting of vectors of maps, recursively
10:53_KY_I want to keep references to old-structure, new-structure at the same time
10:54twhumeKY: OK, that's clojure.math.combinatorics now - does that mean it's part of the core clojure dist?
10:54fliebeltwhume: no, you need to ad it as a dep
10:55tmciver_KY_: you get that kind of sharing for free with clojure. :)
10:56fliebel_KY_: I'm not sure I understand what you're doing, but mostly, if you just change one itme, you'll be fine. If you're mapping, you're probably not.
10:56HCumberdaleHow to turn {"x" 2, "y" 1} into '( {:name "x" :count 2} {:name "y" :count 1} ) ?
10:56_KY_twhume: (:use [clojure.math.combinatorics :only [cartesian-product]])
10:56_KY_Oops, that's my code... change it to yours =)
10:57HCumberdale(map #( {:name %1 :count %2} ) (ccount-tags)) << does not work,... map uses each entry and not a pair
10:57twhumeanything in your project.clj?
10:57twhume(sorry, total newbie)
10:58fliebel(map #( {:name (key %1) :count (val %1)} ) {"x" 2, "y" 1})
10:58fliebel&(map #( {:name (key %1) :count (val %1)} ) {"x" 2, "y" 1})
10:58lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap
10:58_KY_tmciver: thanks... that's the confirmation I was looking for... =)
10:58fliebel&(map (fn [[k v]]{:name k :count v} ) {"x" 2, "y" 1})
10:58lazybot⇒ ({:name "x", :count 2} {:name "y", :count 1})
10:58_KY_twhume: hold on...
10:58fliebelHCumberdale: ^
10:59_KY_:dependencies [[org.clojure/math.combinatorics "0.0.2"]]
11:00_KY_Try that, if you're using lein
11:01twhumelovely, thanks
11:03xumingmingvhow to translate the following java code to clojure? Map<String, Integer> map1 = new HashMap<String, Integer>(); ?
11:04tmciverxumingmingv: no need to do initial construction; just use literal syntax: {"str1" 1 "str2" 2}
11:04xumingmingvmap1 will need to be used in java code, clojure's map is not a HashMap in java, right?
11:06twhumeKY: that works great. Thanks again.
11:06tmciverxumingmingv: clojure's map implements java.util.Map ...
11:06xumingmingvoh, that's wonderful, thanks twhume
11:09fliebel&(.put {:a 2} :b 2)
11:09lazybotjava.lang.UnsupportedOperationException
11:09fliebelah
11:11tmciverfliebel: oh yes, only the read-only portions.
11:13tmciver,(.get {:a 1} :a)
11:13clojurebot1
11:27fliebelIs there something like Mori for Java?
11:29gfredericksthat's an interesting idea.
11:29gfrederickswould require the whole clojure jar at runtime though
11:29gfredericksthe cljs case is not so kitchen-sink
11:31gfredericks$google lib-2367
11:31lazybot[fredericksgary/lib-2367 · GitHub] https://github.com/fredericksgary/lib-2367
11:31gfredericksfliebel: I think you could whip one up pretty quick with that lib ^
11:31fliebelgfredericks: Only because of advanced compilation, right?
11:32gfredericksand cljs just doesn't have as much runtime shtuff as clj does
11:32gfrederickse.g. the whole namespace infrastructure
11:33fliebelhm, I think the datastructures are already pretty usable as-is
11:33gfredericksare they?
11:34gfredericksI guess I don't know exactly how much functionality the classes have on them
11:34gfredericksI'd expect the more familiar you are with clojure the weirder that approach would feel
11:35gfrederickswouldn't that mean calling methods instead of functions? :/
11:35fliebelyea
11:35fliebel(java.lang.PersistentVector. 1 2 3)
11:35fliebel&(java.lang.PersistentVector. 1 2 3)
11:35lazybotjava.lang.ClassNotFoundException: java.lang.PersistentVector
11:36gfredericksif you exported stuff you could do all the seq functions too
11:36xeqi&(clojure.lang.PersistentVector. 1 2 3)
11:36lazybotjava.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.PersistentVector
11:36gfredericksdon't know if that's an insane idea or not
11:36fliebel&(clojure.lang.PersistentVector. 1 2 3)
11:36lazybotjava.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.PersistentVector
11:36fliebelhm
11:36gfrederickscould just export clojure.core and use clojure from java :D
11:37fliebelWhat is the meaning of "Object... items"
11:37gfredericksoh the export thing in lib-2367 doesn't do varargs :/ that'd suck
11:37gfredericksthat's java varargs
11:37fliebelso why does my above code not work?
11:37gfredericks&(clojure.lang.PersistentVector. (into-array [1 2 3]))
11:37lazybotjava.lang.IllegalArgumentException: No matching ctor found for class clojure.lang.PersistentVector
11:38gfredericksI don't know.
11:38fliebeland why does IFn not use java varargs?
11:38gfredericksthat I don't know either.
11:38clojurebotIt's greek to me.
11:38gfredericksnor does clojurebot
11:39gfredericksfliebel: I don't see a constructor that does what you were trying to do
11:39gfredericksjust factories
11:39gfredericks&(clojure.lang.PersistentVector/create 1 2 3)
11:39lazybotjava.lang.IllegalArgumentException: No matching method: create
11:39gfredericks&(clojure.lang.PersistentVector/create (into-array [1 2 3]))
11:39lazybot⇒ [1 2 3]
11:39fliebeloh, right
11:39fliebelI skipped to much boilerplate :P
11:39gfredericksI think there's some low-level equivalence between java varargs and arrays
11:40fliebelhm
11:40gfredericksoh
11:40gfredericksI bet IFn doesn't use that so it can be lazy
11:40fliebelhuh?
11:40gfredericksyou can pass a lazy seq as the varargs to a clojure fn
11:40wmealing_does anyone here use lein-localrepo and if so can they give me an example of their project.clj ?
11:40gfredericks&(apply (fn [a b c & _xs] (+ a b c)) (range))
11:40lazybot⇒ 3
11:41espeedHow do you explicitly specify a namespace when using “apply” on a function?
11:41gfredericks^ infinite arguments there
11:41gfredericksespeed: same way you specify a namespace on any symbol: foo.bar/baz
11:41fliebelgfredericks: that's restfn, I think. ifn is call(arg1) call(arg1 arg2) ... cal(.. args15 Object... rest)
11:41gfredericksfliebel: okay I don't know what I'm talking about then.
11:42fliebelgfredericks: neither am i, actually.
11:42fliebel$source apply
11:42lazybotapply is http://is.gd/Qs77VS
11:42fliebellazybot: apply is not there at all!
11:43gfrederickslazybot's source dohicky is broke
11:43raekI think a vararg method is just a method with a an array argument as its last argument and with a special attriute set
11:43gfredericksdef apply
11:43gfredericksclojurebot: def apply
11:43fliebelhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L89
11:43gfredericksraek: in java or clojure?
11:43raekgfredericks: in java
11:44gfredericksand a "special attribute" is some kind of reflective metadata?
11:44raekthey are backwards compatible with methods taking arrays
11:45raekit is stored in the .class data like other flags (e.g. public, private, static, final, etc)
11:45raekI think it is accessible throught reflection
11:45raekso if you just ignore the attribute (like clojure does) they look like array-methods
11:46gfredericksraek: so do you know how clojure varargs are implemented?
11:46fliebelaha! https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java#L154
11:47raekwell, last time I check (these things might have changed since then) IFn contained about 20 different methods
11:47espeedgfredericks: that doesn't seem to work if the function name is passed in as a var: (fn [func & args] (apply foo.bar/func args))
11:47raekeach for a specifict arity and one that takes some of the arguments as an array
11:47HCumberdaleis it possible to write clojure.string/lower-case shorter?
11:47gfredericksespeed: oh I see. yes this doesn't quite make sense, since func is a local, so we'd have to know more context about what makes you want to do that
11:48espeedSee http://stackoverflow.com/questions/10572443/how-do-you-explicitly-specify-a-namespace-when-using-apply-on-a-function-in-cl
11:49fliebelHCumberdale: ??
11:49lazybotfliebel: Uh, no. Why would you even ask?
11:50HCumberdalelike static import clojure-string to call lower-case directly?
11:50ibdknox(:use [clojure.string :only [lower-case]]) in your ns decl
11:50gfredericksespeed: it seems like in your ideal version, the caller to your graph function would not really have control over what they're passing in
11:51gfredericksthat would be very odd and unexpected behavior. I think better to just let the caller do whatever they can in their own namespace to make things succinct
11:52gfredericksthat could mean (:require [bulbs.neo4jserver.graph :as g]) instead of :as graph, for instance
11:52gfredericksor (:use [bulbs.neo4jserver.graph :only [graph out1]])
11:55espeedgfredericks: thanks -- I'll explore those options. On another note, is the graph function bad design? Someone on the mailing list said they didn't like the approach "returning
11:55espeeda function that takes a function and applies it over the other args."
11:56raekthat's just a higher order function. nothing wrong with that.
11:56gfredericksyeah without knowing what you're doing in a lot more detail there's nothing to criticize there. But changing the HOF so that you could only pass in functions from that ns would be bad design :)
11:56espeedthat's what I thought, but I'm just getting started with clojure so I wasn't sure
11:58raekin Clojure it's not as ideomatic to treat a namespace as a map as it is in languages like Python and Ruby
11:58gfrederickshmm. I would not have thought of ruby in those terms.
11:59gfredericksraek: is there some common example of that being done in ruby?
12:00raekif you only want the client to be able to use a certain set of the functions, just make a dispatch map from keywords to functions
12:00raekgfredericks: hrm, actually I'm not so sure about the Ruby case...
12:01raekit was a feeling I got when I programmed in Python
12:01gfredericksis it fair to say that it is unidiomatic in clojure to interact directly with the ns infrastructure at all?
12:01gfredericksin application code?
12:02raekI think of it as similar to using reflection in Java in application code
12:03gfredericksmakes sense
12:03raekmost cases I have heard of where people have wanted to do this could have been solved by putting functions in data structures
12:04gfredericksthere was an exchange on the clojure-dev mailing list where hiredman mentioned that ns's are mutable, and got me wondering what would be the implications if they were instead references to immutable data structures
12:05gfredericksprobably some kind of low-level performance implications :/
12:05raek...for instance various kinds of callback mechanisms
12:05gfredericksalthough are namespaces generally used at runtime?
12:06raekif you load a namespace with only functions and constants, I guess you could eval the op level forms in one go and then make a map from it
12:06raekbut when you reach a macro halfway through a file, it can access the already evaled half
12:07gfrederickswell I mean a ns could just be an atom. And interning a var means (swap! my-ns assoc symbol var) or whatever
12:07raekI suppose you could incrementally assoc new definitions, though
12:13espeedI suppose I could keep the graph.clj clean and only put the graph function def along with the desired namespaces, and then you could use :use instead of :require
12:23brainproxyis there syntax in clojurescript whereby when I access a js obj property, the compiled code will use square brackets + string notation instead of dot notation?
12:23brainproxysomething like (.+prop myobj) instead of (.-prop myobj)
12:24brainproxyto the compiled code will have myobj['prop'] instead of myobj.prop
12:24brainproxy*so
12:50mmarczykbrainproxy: (aget obj "prop") should do that
14:05amalloyanyone here know how to use the clojure dev wiki? i want to write a summary of the current issues with creating new Reducible sources, and it's not at all clear where to put it
14:29myeI'm confused about what (:import ) is given and how it finds the classes. I have org.semanticweb.owlapi.apibinding but get
14:29myeerror: java.lang.RuntimeException: java.lang.ClassNotFoundException: org.semanticweb.owlapi.apibinding.OWLManager
14:29myebut the owl-api-3.3.jar file is in the -cp according to lein classpath
14:30myewhen I do ,i in the SLIME repl and tab complete it shows me clojure and swank stuff
14:30myebut not owl-api stuff...
14:30raekmye: you should give it a full class name
14:31raek(:import org.semanticweb.owlapi.apibinding.OWLManager)
14:32raekalso, :import does not cause the class to be loaded. the jvm does that automatically. it only provides a shorter name for the class in the ns.
14:32myeraek, it seems to work with a final dot ^^
14:32myehttps://github.com/stain/owlapi-clj/blob/master/src/owlapi_clj/core.clj
14:32myehere the same is being imported but with a space
14:33raekyes. you can import multiple classes from one package in one go: (:import (java.util Map List))
14:33raekit's a shorthand for (:import java.util.Map java.util.List)
14:34raekif you don't get an error when you type org.semanticweb.owlapi.apibinding.OWLManager in the repl, then the class name is right
14:36raekonce that works, you should also be able to do (ns ... (:import (org.semanticweb.owlapi.apibinding OWLManager)))
14:36raekevaling OWLManager in that namespace shoud not result in an error if evaling org.semanticweb.owlapi.apibinding.OWLManager did not
14:36myeraek, I get an error, but doing C-x C-e on the (ns )works
14:37myeand compiling and loading works too from the source file
14:37myewhich without the dot didn't work
14:37raekmye: what does the code that doesn't work look like?
14:39myeraek, I typed org.semanticweb.owlapi.apibinding.OWLManager in the slime repl and get the class error
14:39myeraek, I have no code that uses the class yet
14:40raekmye: also, have you restarted slime after you added the dependency?
14:40myeI think so several times by doing the clojure-jack-in
14:40raekthat should be enough
14:41myethe thing i dont get is, shouldnt owl stuff be in ,i with tab completion
14:41myemaybe the class name isn't correct after all
14:41myehow do I know what is embedded int he .jar?
14:41brainproxymmarczyk: that works well, thanks; more general question (researching now via google, etc.) ... is it possible to "decorate" an extern such that the closure compiler will not attempt to shorten the name of not only the extern symbol
14:41raekwrong class name or missing dependency would explain it
14:41brainproxymmarczyk: but also any properties
14:42raekI think there is a lein plugin that can be used for this
14:42raekmye: one way is to open it. it's just a zip file.
14:42brainproxymmarczyk: i mean properties of the object referenced by the extern
14:43raekmye: which [group/artifact "version"] did you use?
14:44myeraek, good idea. So the last name is the .class file? and everything before a folder?
14:44fliebelWhat is it with Clojure development that makes it hard to contribute? I contributed to 2 programming languages in the last month, while my clojure patches just get stuck in Jira.
14:44myeraek, [net.sourceforge.owlapi/owlapi-api "3.3"]
14:44raekmye: exactly
14:45amalloyfliebel: jira, and a single committer who wants to be very careful thet everything that gets in is extremely well thought out
14:45raekmye: which repo is that one in?
14:45myeraek, OK there is no apibinding folder ^^
14:46myeraek, you mean source code for owlapi?
14:46raekmye: I couldn't find that library when I searched for it in the maven repo
14:47myeraek, I built it with mave and did maven install and it installed it locally
14:47myeit's only in clojars in an outdated version
14:47fliebelamalloy: That is something... Lack of deep though is one of the feelings I had when reading about Mirah and clojure-py
14:47fliebel*thought
14:47raekah, ok
14:49raekmye: Java libraries are usually in the Maven repo (unless another Clojurian added it to Clojars)
14:49myeraek, I think I have to declare more dependencies, I just realized that the maven build has seemingly made it into many small libraries
14:53myeraek, just typed the class name in the repl without error. Indeed I had to add a specific dependency in project.clj for apibinding :0
14:53myeraek, thanks for helping me out
14:53raekmye: ok, good. no problem :)
14:57XPheriorWhenever I do lein run in an empty core file, I get a null pointer exception. Sort of confused why that happens. https://gist.github.com/2689742
14:58XPheriorEr, not in. On*
15:00jasonjcknXPherior: in any case, you need a :main for lein run to work
15:00jasonjcknin project clj
15:01XPheriorYep, my main points to the correct file, jasonjckn
15:01jasonjcknXPherior: and you still get that?
15:01jasonjcknand if you add a defn it goes away?
15:02jasonjcknfile a bug report
15:02XPheriorjasonjckn: Added my project.clj to the gist.
15:02XPheriorWait, what do you mean a defn?
15:02jasonjcknyou need a (defn -main [& args] ..) in your core file
15:03XPheriorAw balls. I knew I was missing something like that. Okay, yeah. No bug, just wasn't clear on that
15:03jasonjcknyah error sucked
15:04XPheriorMaybe I'll try to put in a better error message in a pull request.
15:05wkmanire java.lang.Exception: lib names inside prefix lists must not contain periods
15:05wkmanire
15:05wkmanireWhat is a prefix list?
15:05jasonjcknwkmanire: context?
15:05amalloywkmanire: you only get one level of nesting in your import/require
15:06amalloy(:require (foo [bar.baz ...])) isn't allowed - the bar.baz part can't have a separator
15:06raekwkmanire: you cannot do this: (:require (a.b c.d e.f)), you have to do this (:require a.b.c.d a.b.e.f)
15:06amalloy(:require (foo.bar [baz ...])) would be fine
15:07wkmanireI keep getting bitten by this.
15:07wkmanireHow do I :require multiple modules with aliases?
15:08wkmanireI'm trying (:require [foo.bar :as something] [foo.bar2 :as somethingelse])
15:08amalloythat should work fine
15:08raekwkmanire: that one should be ok
15:09raek(:require (foo [bar :as something] [bar2 :as somethingelse])) should be fine too
15:10amalloyjasonjckn: i think whether repeat should be Counted and Seqable probably depends on how this other stuff turns out
15:10wkmanireI must be messing up in a different source file. Thanks for the help.
15:10jasonjcknamalloy: *nods* yah i'm waiting for a resolution
15:11jasonjcknamalloy: thanks for doing all the heavy lifting :)
15:11wkmanireYep, I found it.
15:11amalloydon't tell rich, but i think my defseq macro is a cool idea, and if it's not in core i'll probably put it in useful
15:12wkmanireI had nested my requirements together in a single list. :require [[foo.bar :as something] [bar.foo :as somethingelse]]
15:12jasonjcknYah it's certainly very useful, you're basically using macros as a form of generic programming, i can see why he doesn't like it though, just like C++ templates you get a tone of code duplication in the binary
15:13jasonjcknideally ArrayList would accept a protocol
15:13jasonjcknor at least ISeq
15:14amalloyArrayList really isn't the issue. the point is clojure sequences should be acceptable in any context that expects an java collection
15:14amalloyi suppose the code duplication is an issue, but i expected him to dislike it mostly because it's a large poorly-considered addition to core
15:14jasonjcknright, I mean all cases analogous to ArrayList
15:15amalloysure. it'd be nice if interfaces were protocols
15:16jasonjcknI think we're better off without reductions and clojure.core being separated completely as oppose to partially
15:17jasonjcknideally it'd be unified, but it's all or nothing in my view
15:17jasonjcknotherwise you have to memorize what's where
15:19jasonjcknwith*
15:24jasonjcknreducible-lazy-seq is a respectable solution
15:25amalloyyeah, it's an interesting tradeoff
15:39mudphoneYay, I just submitted an update to my Clojure API iPhone app!
15:39mudphone(feedback and comments welcome)
15:39mudphoneoh, and I should say, anyone on this channel can have a free copy
15:42RaynesIf only I had an iPhone
15:42wkmanireRaynes: Why do you want an iPhone?
15:43wkmanireoh
15:43wkmanireder
15:43RaynesHahaha.
15:48mudphoneha
15:49mudphoneI would build it for Android too… but, it was a "speed project"
15:50mudphoneI might be able to see if a friend would deploy something similar on Android
15:58mittchelEvening!
16:00mudphoneMorning!
16:01Scriptorafternoon?
16:02wkmanire< tomorrow!
16:06mittchelIt's 22:05 here haha
16:07Raynes15:05 or gtfo
16:07Bronsa22:06 here
16:10mudphone10:08
16:12mittchelWhy is clojure that hard lol haha
16:12mudphoneI think it's unlearning C that's hard. :)
16:13neotykhello everyone
16:13hyPiRionHello
16:14mittchelhaha lol
16:15mittchelI really need to go to bed, but I need to complete this exercise for school tomorrow for Clojure.. last one :P It's about converting an Schema program that calculates the square root into CLojure
16:15mudphoneor, in my case, Ruby and OO
16:15jasonjcknmittchel: your school teaches clojure?
16:15mittchelYep, my teacher is in here sometimes haha
16:15mudphone(def x 10); (* x x)
16:15mudphonedone
16:16jasonjcknmittchel: consider yourself very fortunate
16:16mudphonemittchel: which school?
16:16mittchelhaha mud phone I wish it was that easy, I have to use the newton method. So basically transform this: http://mitpress.mit.edu/sicp/full-text/sicp/book/node12.html
16:16mittchelHogeschool Utrecht in Netherlands
16:17neotykmittchel: I wished my uni would show me any lisp
16:17mittchelThey've pushed us into JAVA for 3 years and now we got Clojure:P
16:17mudphoneoh, square *root*
16:17mittchelYea i've been trying for a while, but haven't had any success
16:19mittchelis 'guess' already available in clojure?
16:24jasonjcknmittchel: i'm not sure if this conforms exactly to SICP but this works https://gist.github.com/2690031
16:24mittchelholy crap
16:24mittchelI actually got it
16:24jasonjckn:)
16:25mittchelBasically I just changed it to the Clojure formats
16:25jasonjcknlet's see your code
16:27mittchelLet me pastebin it
16:27mittchelhttp://pastebin.com/73qgq1iZ
16:27mittchelBasically it's exactly the same
16:28jasonjckncool
16:29Bronsaexcept there's no `abs` and `square` in clojure
16:29mittchelHow come it gives me the correct output?:P
16:30brehautperhaps you have the functions already defined in your repl
16:30brehaut(like improve, which is also missing from your paste)
16:30dreishWhat do you get when you type #'abs and #'square?
16:30mittchel#'Week2/abs
16:30jasonjcknheh
16:30Bronsaoh
16:30jasonjcknhe's a student
16:30mittchel=> #'square?
16:30mittchelCompilerException java.lang.RuntimeException: Unable to resolve var: square? in this context, compiling:(NO_SOURCE_PATH:1)
16:31brehautmittchel: whats the definition of improve?
16:31dreishQuestion mark was part of my sentence, not the symbol, sorry.
16:31dreishSo: #'square
16:31dreishBut I'm guessing it's going to be #'Week2/square or something similar.
16:31mittchelWell I did copy some page from a tutorial
16:31mittchelSo if I close my repl and try it again, it shouldn't work right?
16:32Bronsamittchel: http://sprunge.us/VSMf
16:32Bronsaalso, comments in clojure are marked with `;` not with `//`
16:32mittchelBronsa did you just translate the schema to clojure?
16:32Bronsayeah
16:33Bronsa*scheme :)
16:33mittcheloh typo
16:33mittchelhaha
16:33mittchelhow come mine is compiling and working?
16:33Bronsawell, if you try it from a fresh repl it shouldnt
16:34jasonjcknit's fine… his teacher probably did something
16:34mittchelI do understand your code
16:34mittchelLet me try a fresh one
16:34Bronsaalso because, you are using `good-enough?` and `sqrt` from `sqrt-iter` /before/ defining them
16:34mittchelyep unable to resolve abs
16:34Bronsaso either you have to declare them or move their definition up
16:35mittchelBronsa, I'm still wondering what that guess is
16:35mittchelis that something in Clojure or?
16:36mittchelYou don't really define it
16:36Bronsait's the name of an argoument
16:36Bronsawhen you call (sqrt-iter 1.0 4), guess is 1.0
16:36mittchelAlright
16:37mittchelWhat does that X do?
16:37TEttingerI need to pass a value from a java enum to a clojure function, but...
16:37TEttingerhttps://github.com/Insubstantial/insubstantial/blob/master/substance/src/main/java/org/pushingpixels/substance/api/SubstanceConstants.java
16:37Bronsathen you see it's not good-enough so you improve it and it becames 2.something
16:37TEttingerthe enum is declared as a static value of a class or something weird
16:37mittchelaahh nice:)
16:37mittchelBRonsa: thanks a lot
16:37Bronsayou continue improving it untill it is good-enough
16:37Bronsathen you return it
16:37TEttingerand I can't figure out anything with the . and / for static and package stuff
16:38Bronsamittchel: np
16:38mittchelAlmost can go to bed now haha
16:39Bronsahow cool your teacher teaches you clojure and uses SICP
16:39TEttinger(the specific value I need is FocusKind.NONE , but I can't treat that enum as a package, so...?)
16:39Bronsayou're lucky
16:40srid`where does avout persist values of atoms/refs? they don't seem to
16:40srid`exist in the zk tree. further, restarting the repl makes those values
16:40srid`go away. i am going to try the mongo driver.
16:46neotykTEttinger: you should be able to call (.paintFocus enum)
16:47TEttingerneotyk, what I want to do is change the app from showing the focus as a dashed line inside buttons, to not showing any focus
16:47TEttingerbut how would I import a static enum from a class?
16:47raekTEttinger: (:import org.pushingpixels.substance.api.SubstanceConstants$FocusKind)
16:47raekTEttinger: SubstanceConstants$FocusKind/LEFT
16:48TEttingerdollar sign, eh? where is that documented?
16:48BronsaTEttinger: it's internal JVM notation i think
16:48neotykTEttinger: in java interop docs
16:49amalloyjasonjckn: oh yuck. LazySeq is final, so i can't just implement ReducibleLazySeq as a subclass of LazySeq
16:49TEttingerthanks, I looked for enum and didn't find anything
16:49raekTEttinger: this dollar thing is how the java compiler names nested classes
16:50TEttingeryay it works! thanks
16:50raekso what you call FocusKind actually has SubstanceConstants$FocusKind as the real class name
16:50iwohi, can anyone tell me how to add a directory to the lein repl classpath?
16:51iwois there an command line argument i can use when i start lein repl?
16:51neotykTEttinger: it is same as SubstanceConstants.FocusKind in java
16:52iwoor is there a clojure function i can invoke to cause a new item to be added to the classpath while the repl is running?
16:53michhello
16:55espeedIs there much of a performance penalty when calling a function using ns-resolve?
17:02tomojwhen deciding between (fn [a b]) and (fn [b a]), are there important concerns besides the relative likelihoods of usage inside -> vs ->>?
17:03tomojI mean, is thinking of ->/->> use cases a good heuristic for deciding?
17:04neotyktomoj: put more static arguments first
17:05neotyktomoj: more static as in less changing
17:06tomojthat means, if you count all the arguments ever passed in at each position, the first one should have the fewest groups and highest counts?
17:06tomojdnolen: do you plan to expose protocols and records in mori? I started looking at the implementation of these but can't tell yet how difficult it would be to port to js
17:07dnolentomoj: wasn't planning on exposing that, there's a lot of compiler magic for that stuff to work.
17:07neotyktomoj: like (fn [connection operation]), there will be many operations on single connection
17:10the-kennyAny chance on getting clojure.data.priority-map running in Clojurescript?
17:11dnolenwhy not add a cljs variant to the repo
17:11tomojdnolen: the macros, right? or darker magic?
17:11dnolen?
17:11dnolentomoj: protocols are subject to namespacing.
17:11dnolenfoo.prototype.clj$core$ISeq$first
17:11tomojyeah, I don't see yet why it should be difficult to handle that in js
17:11tomojjust verbose maybe
17:12dnolenmaking JS folks write that by hand doesn't make sense.
17:12tomojright..
17:12dnolenalso Mori isn't intended to attract super sophisticated devs.
17:12the-kennydnolen: Hm yeah, I'll give it a try
17:12tomoj:)
17:12dnolenmight as well write ClojureScript
17:12espeedIs there much of a performance penalty when calling a function using ns-resolve?
17:12dnolenit's for people who like underscore.js and want something better, or people who need sensible data structures.
17:12the-kennyJust hoped there was already an implementation :)
17:13tomojI was planning to implement IReduce and ISeq in JS
17:13tomojbut actually I did decide I should just write it in clojurescript
17:13tomojthen they get two 100KB libraries..
17:14tomojactually
17:15tomojif I implement IReduce in my cljs library and they depend on it and mori, will mori's clojurescript even see my stuff?
17:15dnolentomoj: nope
17:16neotykdnolen: I was looking at http://dev.clojure.org/jira/browse/CLJS-204
17:17dnolenneotyk: yeah need IComparable and relevant implementations of it.
17:17neotykdnolen: IComparable should be based on java Comparable?
17:19dnolenneotyk: look at how it's done in Clojure on the JVM.
17:19tomojwait, "see my stuff" here just means e.g. "look up a namespaced -reduce method in the object", doesn't it?
17:20dnolentomoj: yes, which advanced compilation will have completely removed.
17:21neotykdnolen: for JVN, could you look at http://dev.clojure.org/jira/browse/CLJ-975
17:21dnolentomoj: that said the other point of Mori is so that the library is easy to customize or extend for ClojureScript users.
17:23dnolenneotyk: don't know anything about CLJ-975
17:23tomojI don't understand - if I write a cljs library which exports functions that return instances of my deftype which implements IReduce, and they depend on this library and mori, their mori.reduce won't work with it due to advanced compilation?
17:24dnolentomoj: not unless it's compiling with Mori no.
17:24neotykdnolen: it was a bug reported: https://groups.google.com/forum/?fromgroups#!topic/clojure/3z3JtXhcDB0
17:24dnolentomoj: or you have a custom build of Mori that doesn't go through advanced compilation.
17:25dnolenneotyk: yes but I don't know what you want me to do - I'm usually review CLJ tickets.
17:25dnolenI don't usually I mean.
17:26tomojI see
17:27neotykdnolen: roger
17:27tomojso advanced-compiled mori.first(foo) doesn't look up foo.prototype.clj$core$ISeq$first
17:27tomojcrazy
17:27dnolentomoj: nope
17:27tomojbecause it knows all the protocol implementations at compile time
17:27dnolentomoj: if it did, Mori would be ~20k gzipped.
17:27dnolenwouldn't be
17:28dnolentomoj: no, because advanced compilation rewrites all names.
17:28tomojoh, I see
17:28tomojso yeah extend-type from js is doomed..
17:29tomojI guess then the best solution at this time would be to reexport all of mori in my library and have people use its mori :(
17:29tomojor just forget about js
17:29dnolentomoj: similar problems exist in the JS world.
17:30dnolentomoj: you want some UI library but you don't want the whole thing.
17:30dnolentomoj: so the consumer could use a non advanced mode compiled Mori and your JS lib
17:30dnolentomoj: and run Closure themselves.
17:31tomojI was wondering if maybe npm can be made to help with that
17:31tomojbut it seems unlikely
17:31dnolentomoj: wait you want this for Node?
17:32tomojwell, yeah
17:33tomojI hadn't realized mori was only 20K gzipped so that it was reasonable to use in the browser
17:33dnolentomoj: yes
17:33tomojso browser would be good too
17:33dnolentomoj: so just use non-advanced mode compiled version of Mori.
17:33arohnerare there up to date docs on lein native deps anywhere?
17:34arohnerit seems to be built in to 1.7, but I can't figure out how to use it
17:34dnolenarohner: I'm suprised people are still using it. Doesn't lein have it's own thing now?
17:34tomojand then for browser I can provide a build script that advance compiles mori and my lib into a min.js
17:34arohnerdnolen: I guess? I'm trying to use the built in thing
17:34dnolenarohner: oh, k. Yeah don't know anything about that.
17:37tomojdnolen: would need to publish mori-simple to npm and have people depend on that instead of mori, yes?
17:39dnolentomoj: require("mori/simple") does that work?
17:40tomojyeah
17:40tomojcomes with some performance penalty I guess?
17:41dnolentomoj: some yes since many function expressions won't get lifted.
17:42dnolentomoj: if some wrote a pass for the compiler to do that we could avoid relying on GClosure for that.
17:48dnolencolors and design need work but the content is coming along http://swannodette.github.com/mori
17:55tmciverdnolen: FYI: that page looks good in Chrome, but in FF the text in the main content area is "on top of" the scroll bar for the naviagation frame.
17:57dnolentmciver: thanks for the report. Focusing more on the content at the moment - will look into display issues when the content is more fully-fleshed out.
18:01arohnerok, I got passed the previous native deps problem. Now it appears my native jar is not happy unless jna.library.path is set, but lein appears to set java.library.path
18:01frozenlockI'm having some difficulties with seesaw. When an action is too long to execute, the java frame 'hangs'. Is there a way to make it continue to work as usual and only updates the different widgets when the data is finally available?
18:04dreish,((fn ^Long [^long x ^long y] (num (+ x y))) 1 2)
18:04clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.NoSuchMethodError: clojure.lang.IFn$LLO.invokePrim(JJ)Ljava/lang/Long;>
18:05dreish,((fn [^long x ^long y] (num (+ x y))) 1 2)
18:05clojurebot3
18:05dreishIs this a known bug?
18:05tomojoh, I see, (prim-seq js/arguments 0) works. was miffed there was no way to extend the protocol
18:06tomojI wonder why prim-seq doesn't default to 0
18:06dnolentomoj: that's fixed in master
18:06tomojcool
18:19ForSparePartsIs there a way to do inline local binds in Clojure? Similar to, say, the <- operator in Haskell's do notation?
18:20brehautdnolen: with mori, you would need to implement the hashing method to use arbitrary JS objects in the value semantics right?
18:20brehaut(ie to use a random JS object as the key in a map)
18:20dnolenbrehaut: which is already works.
18:20brehautoh right
18:21brehauti wonder how useful mori is with roy
18:21dnolenbrehaut: dunno.
18:22raekForSpareParts: you mean with something else than 'let'?
18:22RaynesForSpareParts: Not really, no.
18:22Raynesraek: I think by inline he means 'a way that doesn't involve nesting the code under let'.
18:22ForSparePartsRaynes: right.
18:22RaynesBasically, he is the devil and wants to corrupt us all.
18:22Raynes;P
18:23ForSparePartsSATAN
18:23ForSparePartsetc. etc.
18:23ForSparePartsI take it this would be horribly unidiomatic, then?
18:23raekwell, you can still do (let [a (f), b (g), c (h)] (i a b c))
18:24ForSparePartsraek: yeah, that would work. the issue I'm having is that sometimes I don't really WANT to think about something until right before I use it
18:24raekwhich isn't too different from do a <- f; b <- g; c <- h; return i a b c
18:24ForSparePartsand nesting let upon let upon let feels kinda ugly
18:24weavejesterWhy would you need to nest lets?
18:24RaynesYou shouldn't need to nest let.
18:25weavejester,(let [x 1 y (+ 1 x)] y)
18:25clojurebot2
18:25weavejesterEach expression in let can refer to the expressions that come before it.
18:27ForSparePartsweavejester: so I get that part -- my issue with that is that sometimes it seems better, organizationally, to have the definition come right before the code that uses it
18:28ForSparePartsbut I'm open to the idea that I'm, broadly speaking, doing it wrong
18:28ForSparePartsIs my real issue that I'm trying to write functions that are too big...?
18:29tomojit may be helpful to see an example
18:29weavejesterTypically your functions should only be several lines of code long.
18:29ForSparePartsOK.
18:29dreishExcept when they aren't.
18:30weavejesterdreish: Yes :)
18:30ForSparePartsI started wondering about this while I was working on a BST implementation.
18:30weavejesterBut as a rule of thumb it's not bad.
18:30dreishIt's a good ideal to push toward, but not to the breaking point.
18:30ForSparePartsI just found that my functions were turning into these huge unreadable messes.
18:31ForSparePartsAnd I wished I could just give something a *name* and use it later (as I would in an evil imperative language ; )
18:32dreishThe definition of defmacro in clojure/core.clj is somewhat long.
18:32weavejesterdreish: Yes, but all the really long functions in core tend to be fairly complex macros
18:32weavejesterForSpareParts: A BST shouldn't be that big a function, should it?
18:34ForSparePartsNot massive, no. But my delete is really awkward, and it just seems... I dunno, off somehow? Like I'm missing something, making it harder than it is.
18:36weavejesterIs your code online?
18:36ForSparePartsI just pasted it, actually
18:36ForSparePartshttp://pastebin.com/pHHgJBAK
18:36ForSparePartsit's not completely correct right now
18:36ForSparePartsdelete can trim big chunks off the tree
18:37dreishThose aren't long.
18:37dreishThey'd be even shorter if you didn't have standalone closing parens. ;-)
18:37ForSparePartsAh, true. I can fix that.
18:38raekthe nested ifs could be written using cond
18:39ForSparePartsraek: thanks! I had forgotten about cond -- that would probably make it more readable.
18:40raekin swap-delete the two lets are very similar
18:41ForSparePartsyou think they'd be better as a separate function?
18:41raekmaybe you could make both branches use, say, other-node instead of pred-node and succ-node
18:41raekI can make a paste
18:43dnolenbrehaut: if you have any design thoughts about http://swannodette.github.com/mori/
18:43ForSparePartsraek: if you could, I'd appreciate it.
18:43dnolenbrehaut: please send them along
18:43brehautdnolen: dangerous ;)
18:43brehautdnolen: what do you think about bright yellow?
18:44dnolenbrehaut: was thinking about something greenish - if you want to play around feel free to fork and let me know what you come up with.
18:45brehautdnolen: sorry the yellow was a poor joke. some people on the channel (raynes) dont think much of my choice of colors
18:45tomojcan lein cljsbuild accomodate advanced-compiling multiple cljs libraries together, using all their exports?
18:45brehautdnolen: today is extremely busy, but i'll give it some thoughts
18:45dnolenbrehaut: thx much.
18:46tomojwell, nevermind, it certainly can't accomodate what I want anyway
18:48raekForSpareParts: https://gist.github.com/2690616
18:50raekForSpareParts: the only difference between the two branches is the value of pred-node/succ-node. pred-val/succ-val and deleted-pred/deleted-succ are calculated the same way
18:50raekas well as the body of the let
18:51raekI also replaces == with =. == is some special numerical operator that is rarely used.
18:52ForSparePartsraek: thank you!
18:52ForSparePartsthat already looks a LOT cleaner and more readable
18:53ForSparePartsAn unrelated question: what do you all edit with? I've been using La Clojure, but it doesn't seem to support debugging...
18:53raekI'm using Emacs
18:55ForSparePartsAre there good emacs extensions for clojure code completion, breakpoints, repl debugging, that sort of thing?
18:56raekyes, but I haven't used breakpoint debugging much myself (by it should be possible to do, I think)
18:56jasonjckni've used breakpoints a little bit, the interface was not very good
18:56tmciverForSpareParts: you can get that kind of debugging using slime/swank.
18:56raekthe repl often works quite well as a substitute for breakpoints for simpler or purely functional code
18:57ForSparePartsraek: noted.
18:58ForSparePartstmciver: is there a good newbie tutorial for that setup somewhere? I can kind of get around in Emacs, but I'd be lying if I said it didn't intimidate the hell out of me...
18:58jasonjcknprint debugging is much better for loops and stuff, you get a view across time
18:58raekI think slime/swank has the most pain-free intergration with leiningen of all the IDEs currently
18:58raekcounterclockwise (the eclipse plugin) is probably the second best
18:59raekForSpareParts: yes. only look at the offical docs. period.
18:59raekForSpareParts: https://github.com/technomancy/swank-clojure
18:59raekyou also need this first: https://github.com/technomancy/clojure-mode
19:00kaoDCCW is not bad but Emacs with Clojure mode seems much powerful
19:00raekclojure-mode provides does highlighting and indentation (basically)
19:00kaoD*much more
19:00kaoDspeaking of which, I couldn't get CCW to launch my application's -main
19:00kaoDand lein integration is awful
19:01raekand slime + swank gives you the ability to interact with a running clojure instance (repl + reloading code)
19:01kaoDwhich basically renders CCW useless
19:01jasonjcknForSpareParts: http://clojure.bighugh.com/
19:01ForSparePartsCCW has a repl and reload, actually. Although for the life of me I couldn't figure out keyboard commands to switch back to the code from the repl.
19:01jasonjcknlooks out of date
19:02raekdon't use clojurebox
19:02raekit predates leiningen
19:03raekit doesn't provide a way to use external libraries or source directories (!)
19:03raekit's basically just a repl
19:03ForSparePartsOK.
19:03tomojForSpareParts: note there is no need for blank-bst ##(assoc nil :value 3)
19:03lazybot⇒ {:value 3}
19:04tomoj&(:left (assoc nil :value 3))
19:04lazybot⇒ nil
19:04tomojalso (not (nil? foo)) should usually just be foo
19:04tomojand (if (nil? x) z y) can be (if x y z)
19:04tomojand (cond :else nil) is the same as (cond)
19:05raektomoj: the last one was mine... :-)
19:05tomojI guess it could be nice to be explicit
19:06raek(ok, apparently you can tell clojurebox about your libraries and source directories)
19:06ForSparePartstomoj, not sure I follow: are you saying I don't need blank-bst because I could just use nested assoc statements onto a nil map?
19:07tomojright, in other words (defn make-bst [val] {:value val})
19:07raekthe setup process used to be much more complicated. now it's basically just 1) install clojure-mode in Emacs, 2) install the lein-swank or swank-clojure plugin in Leiningen, 3) start hacking with M-x clojure-jack-in
19:09ForSparePartstomoj: OK. Also, are you saying that (if (:left swap-node)) is equivalent to (if (not (nil? (:left swap-node)))
19:09ForSpareParts?
19:09tomojthe only exception is if (:left swap-node) might be false, which won't happen here
19:10ForSparePartsgot it.
19:10ForSparePartsOK, I'm gonna go try to get Marmalade working and install clojure-mode! Wish me luck!
19:11raekyou can also use (if-not x ...) instead of (if (not x) ..) as an abbreviation
19:11ForSparePartsAlso, thanks for all your help, everyone.
19:11raekif you use emacs-starter-kit, you get marmalade included by default
19:12ForSparePartsAh, cool. Thanks.
20:11muhoois there some way to print stack traces without throwing exceptions?
20:12muhoosah, cool, found it (.printStackTrace (Exception. "fobbar"))
20:17gfredericks&(with-out-str (.printStackTrace (Exception. "fobbar")))
20:17lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
20:18kaoDlol
20:29wmealing_careful, i think he likes it.
20:31kaoDdo you like it, lazybot???
20:31lazybotkaoD: How could that be wrong?
20:31kaoDthat's what I thought
20:37gfrederickshe thinks it's bad but he likes it at the same time.
20:39tmciverthe real question is . . . will you still respect him in the morning?
20:41gfredericksdepends on what his thread-bindings are like by then
20:42kaoDI pictured that on my mind
20:44kaoDand I can tell you for sure that you don't want to know how I picture thread-binding
20:44kaoDs
20:44kaoDwait a second, this channel is logged, right?
20:44kaoDmy account's been hacked
20:44kaoDthis isn't me!
20:45gfrederickskaoD: say some more embarrassing stuff then
20:47elliottwoh man, jokes in the clojure channel
20:49gfrederickslazybot started it
20:49kaoDI thought it was me, what a relief
20:49kaoDalso, couldn't anytthing more embarrasing gfredericks
20:57oakwisednolen: I think core.logic is broken against clojurescript since cd7afc0 of cljs. Set => PersistentHashSet
20:58kaoDoh, now that I think of it
20:58kaoDis there any plugin system ready for clojure or I gotta cook my own?
20:58kaoDnothing fancy, something along the lines of lazybot's plugins
21:01gfrederickskaoD: what's something you would want to do with such a system?
21:03kaoDpluggable sound modules (generators and effects)
21:09kaoDgfredericks: I specifically like the idea of hookable events
21:11ozatamanHi all. If I have a function producing a seq and I'd like to apply or to this resulting seq, what is the best way? simply doing (or (map ...)) doesn't work, as I think I need the contents of that list spliced into the call to or.
21:11kaoDapply ?
21:11gfredericksozataman: since or is a macro you can't do that at runtime. there's a different function you want
21:11ozatamandoesn't work - or is a macro, right?
21:11ozatamanthere is an apply-macro
21:11ozatamanbut doc says it's evil :)
21:11gfredericksyeah that sounds evil
21:12kaoDyeah, I always wondered, why is it evil?
21:12gfredericksmacros are a compile-time thing, he wants to do this at runtime
21:13gfredericks(keep identity my-seq) might work
21:13gfredericks,(doc keep)
21:13clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
21:14gfredericksor (first (filter identity my-seq))
21:14kaoDwhy not reduce?
21:14kaoD&(reduce #(or % %2) [true true true true])
21:14lazybot⇒ true
21:15ibdknoxyou want it to stop
21:15kaoD&(reduce #(or % %2) [true true false true])
21:15lazybot⇒ true
21:15ozatamanyeah, I could use reduce, but then it's reinventing a simple pattern, it feels like
21:15ibdknox(first (filter identity ..)) is the way to go
21:15ozatamanI come from haskell, where we can just do "or [a,b,c,d]" and you're done :-)
21:15gfredericksibdknox: except for chunking :(
21:15ozatamanoh sorry, "any [a,b,c,d]"
21:15ibdknoxgfredericks: you can't have everything
21:15ibdknox;)
21:15jasonjcknthere's a blog post on 'disabling' chunking if that's what you want
21:16ibdknox,(doc some)
21:16clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
21:16ibdknox,(some identity [false nil 4 false])
21:16clojurebot4
21:16ibdknoxfor some reason I thought some nuked its return
21:17ozatamangreat, that'd do it!
21:17ozatamanthanks guys
21:17ozatamantrying to work through some euler problems to catch up with clojure :)
21:28wkmanireWhy is UI layout so damned hard.
21:28wmealing_doing it right, or doing it at all ?
21:29wkmanireboth.
21:29wmealing_i hear ya buddy.
21:29wmealing_i got a minion web developer who helps out with my ui "questions"
21:29wmealing_he often tells me "you fool, do it this way, it will save you hundreds of hours"
21:29wmealing_okay.jpg
21:30wkmanirewmealing_: Sounds wise.
21:30wkmanire:D
21:30wmealing_talking to these designer people, even though they sometimes seem a bit pretentious really saved me a lot of upfront development time.
21:31wmealing_you doing swing or html or otherwise ?
21:31wkmanireseesaw
21:31wmealing_ah, be thankful you're not doing raw java swing ;)
21:31wkmanireIt would probably be going faster if I would have taken the time to study the whole seesaw library before starting to use it.
21:31kaoDanyways, the problem is not user experience nor API
21:31kaoDswing just sucks
21:32wkmanireCan't just weesle your way through it.
21:32kaoD"please swing, put this control there"
21:32wmealing_kaoD, nope.. nope nope
21:32kaoD"NO WAY!" SLAM
21:32wmealing_hah
21:33wkmanireIt's almost like they wanted to avoid assuming the user has a monitor.
21:33kaoDSwing is ugly and mean :(
21:33wmealing_its probably the best they could do at the time though
21:34kaoDactually it's not so bad, but I think that a markup approach makes it better for the developer
21:35kaoDsince, well, you're laying out things around
21:35wkmanireHonestly, once you get used to HTML, and once you accept its limitations, it's pretty hard to beat.
21:36wmealing_target the most supported "spec" don't do anything crazy and you're 90% of the way there.
21:37kaoDwmealing_: does Glade really work? I got tired of NetBeans layout editor since 90% of the time what you saw was not what you got
21:38kaoDand laying out UI's in code is even more frustrating
21:38wmealing_kaoD, it does for the cases that I use it for, i've mainly used it for python/mono work though
21:38wkmanireGlade is nice.
21:38kaoDnever worked with GTK
21:39wmealing_what you see in the designer is what it ends up behaving like
21:40wkmanireI actually asked in here about laying out frames using XML.
21:40wkmanirebut it was suggested that Clojure, being itself a form of data, is sufficient.
21:40wmealing_it.. kind of is, i think
21:40wmealing_i'm by no means an expert on any of this tbh
21:40wmealing_just a casual hacker.
21:41wmealing_i looked at writing a dsl in clojure then thought.. its not worth it because the language is mostly there already.
21:42kaoDI didn't try seesaw myself, but as I see it, clojure is some kind of rich markup language
21:42kaoDthe boundaries are thin
21:42kaoDexaggerating, of course
21:43wkmanireI think it would be easier to work with as XML honestly. FOr layout work.
21:43wkmanireThat is probably because I'm just more familiar with that style of doing things.
21:43pcavsIs there an example of using clojure.core.logic.arithematic?
21:44wmealing_i tried pulling in some custom jars last night from maven
21:44wmealing_scarey stuff.
21:45wmealing_was i delusional or was there clojure on the python vm ?
21:45ivanclojure-py
21:45wmealing_have you used it ?
21:45ivanI've confirmed that the REPL works, heh
21:45kaoDbut isn't python a bit bulky?
21:45wmealing_:)
21:46wmealing_compared to jvm ?
21:46wmealing_meh
21:46ivanpulling in jars from maven is pretty scary
21:47wmealing_ivan, i'm using lein as my build tool. there was all kinds of massage that i needed to do to make it work.
21:47wmealing_i tried localrepo, but not coming form a java background, i dont know what the talk of artifacts etc mean
21:47ivanI build everything from source, which is not for the sane ones
21:48wmealing_you let lein do the build ?
21:48hiredmanivan: scary how?
21:48ivanno, I haven't gotten around to using lein to improve my life
21:48hiredmanmaven is just an http client
21:48wmealing_so is wget, but it doesn't talk about artifacts
21:49ivanhiredman: they're being pulled it over HTTP and the sigs aren't checked
21:49ivanin*
21:49hiredmanivan: but it doesn't have to
21:49hiredmanyou can pull over https and point to your own server
21:50ivantrue
21:51ivanwmealing_: I have some Python script that builds everything using Ant-like commands
21:51hiredmanhttps is kind of ridiculous since you are just pulling publicly available zip files anyway
21:51ivanwmealing_: sometimes it just calls ant
21:52wmealing_ant is like make, right ?
21:52ivanyes
21:52startlinghi! I know python and good chunks of scheme and haskell, plus bits and pieces of other languages. how should I learn clojure?
21:53kaoDbut much more headaching
21:53wmealing_startling, you sound just like me
21:53kaoDstartling: www.4clojure.com and a good book
21:53kaoDthat's pretty much what you need
21:54startlingthanks!
21:54kaoDstartling: and, from my own experience, mess with Emacs ASAP if you're not comfortable with it
21:55kaoDI'm yet to find a good full-fledged IDE
21:55kaoDthey all get in my way to coding instead of making my life easier
21:56kaoDand mess with Leiningen ASAP too
21:56kaoDand look around GitHub for good code to learn from
21:56wmealing_i found misaki a good place to start
21:57wmealing_compact, clean.
21:57kaoDMire is a good start too
21:57kaoDhttps://github.com/technomancy/mire
21:58kaoDits branches are step-by-step guides to coding a full app
21:58wmealing_nice
21:59kaoDapparently there's a (paid) screenscast to it
21:59kaoDbut I didn't need it to learn my first steps through it
22:01startlingkaoD: would you recommend emacs over vim for clojure?
22:02wmealing_but if you know vim, dont change.
22:02startlingi've been meaning to learn emacs anyway. might be worth it
22:03kaoDstartling: emacs integration is better
22:04kaoDapparently most lispers do emacs so...
22:04startlingyeah
22:04kaoDthere's an Eclipse plugin, Counterclockwise, which is not too bad
22:04kaoDbut it's not too good either
22:04cgagit's unfortunate since vim has such better key bindings
22:04startlingcgag: tell me about it. :(
22:05cgagi have a pretty decent evil set up but it's not the same
22:05kaoDyeah, and I like the notions of commands instead of hotkeys
22:05kaoD*notion
22:05tos9vim has been fine for me
22:06kaoDIMHO commands are easier to remember, which leads to easier integration in your mindset
22:10startlingtos9: when the Joy of Clojure book says the source is available, is that just source for the code they use? or the entire book?
22:10tos9startling: iirc just the former
22:10ivanthat's the source for the examples
22:10startlingah. no wonder I couldn't find any text
22:11tos9if there's a good free tut these days it's probably fine
22:13kaoDstartling: wait a second, I have a post in a forum with some links
22:13kaoDhttp://www.mediavida.com/foro/9/programacion-funcional-scala-clojure-etc-446872
22:13kaoDignore the fact that it's in spanish
22:13kaoDjust go to the Clojure section
22:13kaoDand click under the link below "Enlaces"
22:14kaoD*links
22:14startlingkaoD: lovely, thanks
22:14kaoDnp
22:22echo-areaTimMc: ping
22:23TimMcpong
22:23kaoDsmack!
22:26gfredericksare small vectors stored efficiently or do they all have a length-32 array underneath?
22:26echo-areaTimMc: I read your message. As I tried, proxy won't work even if a second function with different arity is provided and delegated to its parent class. Proxy seems using a hash-map to represent bound methods, is this the thing you mentioned as "do with proxy"?
22:29echo-areaI wanted to write my own version `proxy-call-with-super' but there seems no way to avoid the same problem this way.
22:30echo-areaSo currently the only solution is to fall back to Java.
22:31ibdknoxI got my O'Reilly mention: https://twitter.com/#!/timoreilly/status/201852654182334466
22:31cgagawesome
22:32ivan&(type [])
22:32lazybot⇒ clojure.lang.PersistentVector
22:32cgagwhen do we get to see that next demo?
22:32echo-areaAnd thank you for paying attention to it, Tim :)
22:32ibdknoxcgag: a weekish
22:35ivangfredericks: from reading the source, I'm guessing sometimes the array is sometimes < 32; see trimmedTail
22:36muhoooh dear god that's annoying. something is silently including clj-stacktrace, i have no idea what, it's not on the classpath, but it's in loadad-libs
22:37muhooand whatever version it is, it's not honoring {:test-color false}
22:37hiredmangfredericks: https://github.com/hiredman/tuples
22:38ivanhiredman: any reason to use this over defrecord?
22:39ivanshould be in your performance section :)
22:40muhooaha! it's ring-devel. naughty naughty....
22:43TimMcecho-area: Yeah, proxy is kind of terrible. I think you can do what you need with gen-class, though.
22:45echo-areaTimMc: Is there plan for fixing proxy, BTW?
22:45TimMcecho-area: Going to bed now, though. (And I haven't really used gen-class's full feature-set.)
22:45TimMcecho-area: No idea. I'll probably file a bug for it, but who knows...
22:45echo-areaTimMc: Okay, good night
22:46ivanhiredman: cool. looks like records are just as slow as vectors.
22:50ForSparePartsHey, has anybody here had trouble installing lein? It seems to have downloaded the standalone jar, but when I try to do anything it complains about missing dependencies
22:53wmealing_nope, usually just get the binary, run it.. then it doe sthe rest.
22:53wmealing_which procedure are you following
22:54ivanForSpareParts: try clearing ~/.m2?
22:55ForSparePartsivan: just tried that and reinstalled. no dice.
22:56ForSparePartswmealing: just going off the instructions here https://github.com/technomancy/leiningen
22:57wmealing_ForSpareParts, by "do anything" i assume you mean a lein command like "lein new projectname" , on the command line ?
22:57ForSparePartsyeah
22:58wmealing_can you pastebin the message ?
22:58ivaninstructions followed on a clean Ubuntu 12.04, lein new and lein repl work here
23:00ForSparePartshttp://pastebin.com/kkmFjY6d
23:00ForSparePartsI have deleted that file and reinstalled, several times.
23:00ForSparePartsAlways the same thing.
23:01wmealing_ah windows
23:01ForSparePartsyeah
23:01wmealing_what if you do
23:01wmealing_lein project new
23:01wmealing_lein new projectname
23:01wmealing_rather
23:01ForSparePartssame thing
23:02ivanI'm guessing you're running the preview release bin/lein?
23:02ForSparePartsI think so, yeah.
23:02ForSparePartsWould it be better to try 1.7?
23:04ivanI guess
23:04ForSparePartsalrighty.
23:07ForSparePartsWell, 1.7.1 works. Still have no clue why.
23:08amalloyForSpareParts: technomancy would probably love some feedback about what goes wrong on windows
23:08myeFile file = new File("/tmp/test"); How dow I translate that into clojure?
23:09ForSparePartsamalloy: OK. What's the best way to give feedback?
23:09ivanperhaps (File. "/tmp/test")
23:10amalloyi dunno. open a github issue? or find an existing issue that looks the same, and comment on it
23:10brehautmye: (require 'clojure.java.io) (file "/tmp/test")
23:10wmealing_github issue is best imho
23:10wmealing_technomancy is here sometimes, but best to put it in github
23:10brehautmye: not a direct translation however
23:10ForSparePartsaffirmative, I'll do that.
23:13uvtcRaynes: ping?
23:15myebrehaut, thanks
23:15myeWhere should I put data files in my leiningen project folder?
23:15kaoDmye, direct translation: (def my-file (File. "/tmp/test"))
23:15myeIs there some standard directory?
23:15kaoDoh, ivan said it
23:16myekaoD, so File. does a new?
23:16kaoDyup
23:16wmealing_mye, the . is part of the java interop
23:16kaoDactually you can do new
23:16kaoD(new File "/tmp/test")
23:16kaoDbut the . shorthand is preferred
23:16myeI had only seen . for instance props
23:17kaoDinstance props?
23:17mye(.thisIsMyMethod instance arg arg arg)
23:18kaoDbut that's different
23:18kaoD(.method instance args)
23:18kaoD(Class. args)
23:18kaoDthe . is on the other said
23:18kaoD*side
23:18kaoDas I said, it's a shorthand for (new Class args)
23:18myegood now I know ^^
23:19pushp0pwow these clojure koans are great
23:19pushp0pwhat a fun way to learn a language
23:19wmealing_what are you up to ?
23:19myecan I refer to files in my project without absolute paths?
23:19kaoDmye: what?
23:20kaoDyou must follow the same rules as Java's classpath
23:20wmealing_(he may want to acccess something in ./resources, perhaps ?)
23:20myehttp://clojuredocs.org/clojure_core/clojure.java.io/resource
23:20myesomething like that I'm trying to grok what this is really for
23:21Raynesuvtc: pong
23:21wmealing_(clojure.java.io/resource "something.txt")
23:21wmealing_something like that ?
23:22amalloyresource also lets you access "files" bundled inside your executable jar
23:23ForSparePartsSo, I've got lein working now, but I'm getting this when I try to clojure-jack-in:http://pastebin.com/P1tFWnTe
23:23myeso I just manually create ./resources/ and that's it, whenever I need files local to the application I just put them in there?
23:23ForSparePartser http://pastebin.com/P1tFWnTe
23:23wmealing_thats what i'd do
23:24tmciverif I create a function with literal notation, #(...), but don't reference any args, %, do I get a function of no args?
23:24kaoDtmciver: yes
23:24tmciverI get an arity exception when I call such a function with args.
23:24kaoDof course
23:24wmealing_ForSpareParts, this is windows still ?
23:24tmciverSo I should use (constantly ...) instead.
23:24ForSparePartsyeah
23:25kaoDwhy would you call a function with no args with args?
23:25myeForSpareParts, I had the same error yesterday and I solved it, but forgot how... :-)
23:25wmealing_ForSpareParts, i think $SHELL is an env variable for a shell.. like bash
23:25tmciverkaoD: I was hoping it would just behave like (constantly ...)
23:25wmealing_mye, did you install something like cygwin ?
23:26myelet's think, .. I tried going cygwin first but then put lein in the windows path
23:26myeit calls cmdproxy.exe in the emacs folder
23:26wmealing_https://github.com/technomancy/swank-clojure <-- discussion there on the cygwin part
23:26myewhich is your normal dos prompt
23:26kaoDtmciver: it won't work that way.. although you might be able to use %&
23:26kaoD(to ignore it)
23:27myewmealing_, no I'm running the native emacs
23:28ForSparePartsthis is quite frustrating -- I was really hoping to hack around with swank tonight, see if I dig it, but it's been hours just trying to get it up and running...
23:28kaoDtmciver:
23:28kaoD&( #(if (not (nil? %&)) 3) 1 2 3 4 5 6)
23:28lazybot⇒ 3
23:28kaoD&( #(if (not (nil? %&)) 3) [1 2 3 4 5 6])
23:28lazybot⇒ 3
23:28myeForSpareParts, I spent the first day that way too
23:29myehave you but the lein.bat script in your path?
23:29ForSparePartsAh, that could be it.
23:30myeForSpareParts, you must be able to call it in a cmd.exe
23:30ForSparePartsyeah, I understand
23:30ForSparePartsI had forgotten about that part -- I was running lein from the location where I had it stored instead of adding it to path
23:31kaoDin fact, tmciver
23:31kaoD&( #(do %& 3) 1 2 3 4 5 args lol lol)
23:31lazybotjava.lang.RuntimeException: Unable to resolve symbol: args in this context
23:31kaoDoops
23:31kaoD&( #(do %& 3) 1 2 3 4 5 'args 'lol 'lol )
23:31lazybot⇒ 3
23:31kaoDthere's your constantly
23:31ForSparePartsbefore when I was having trouble with lein, I had the dir extracted from the download in my path, I removed it when I realized lein self-installs.
23:31ForSpareParts(and there was no point in having a C:\lein)
23:32zcaudateI'm looking for a good namespace tool. Two things are really bugging me..
23:32zcaudate- is there a way to list all the namespaces that could potentially be loaded?
23:32zcaudate- clojure.reflect is unreadable... is there something like dir(obj) in Python to list all the method names for java objects that is similar to ns-publics?
23:34hiredman,(-> String .getMethods (map bean) (map :name))
23:34clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
23:35hiredman,(->> String .getMethods (map bean) (map :name))
23:35clojurebot("hashCode" "compareTo" "compareTo" "indexOf" "indexOf" ...)
23:35hiredmanclojurebot: jerk
23:35clojurebotyou cut me deep, man.
23:36ForSparePartsOK, putting lein.bat in the path fixed that error, but now I've got a new one: http://pastebin.com/BGn28M5k
23:36kaoDzcaudate: in fact there was a repl-utils package under contrib which did pretty much what you want
23:36kaoDnot sure if someone still mantains it
23:37myeForSpareParts, 1.4.4? I have 1.4.2
23:37ForSparePartsI just installed the latest thing from marmalade
23:38xeqiForSpareParts: do you get the same error if you run it again?
23:38ozatamanwould reduce cause head-retention when used with take on a long lazy-seq
23:39ozatamansomething like (reduce + (take 10000000 big-lazy-seq))
23:39myeForSpareParts, I didn't install it with emacs, I just put in in th e plugins section of project.clj
23:40ForSparePartsHuh. Now I've got this: http://pastebin.com/UEEFWe7M
23:41ForSparePartsmye, Oh! Yeah, I did that too, but I got the description from the swank tutorial. I wonder if it's not in sync with marmalade and I have the wrong version?
23:41zcaudatekaoD: hmmm... do you mean this page http://richhickey.github.com/clojure-contrib/repl-utils-api.html ?
23:41lazybotNooooo, that's so out of date! Please see instead http://clojure.github.com/clojure-contrib/repl-utils-api.html and try to stop linking to rich's repo.
23:41kaoDhehehe
23:41kaoDzcaudate: clojure-contrib is no longer maintained
23:42kaoDbut you might aswell copy whatever you need
23:42brehaut~contrib
23:42clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
23:42kaoDand maybe someone still maintains it in a separate library
23:42zcaudatekaoD: yeah... its so annoying
23:42zcaudateit should be something really simple
23:43zcaudateto add
23:43zcaudatesomewhere
23:45ForSparePartsOK, so I killed emacs, started over, now I've got the "that's not a task" error.
23:48technomancyzcaudate: it sounds like you want Bultitude
23:48technomancyclojurebot: google bultitude clojure
23:48clojurebotFirst, out of 23 results is:
23:48clojurebotRaynes/bultitude · GitHub
23:48clojurebothttps://github.com/Raynes/bultitude
23:48myeForSpareParts, I'd try installing it only once, maybe uninstall the marmelade version
23:49technomancyzcaudate: for checking all the methods on a class, slime works really well for that if you have it: C-c S-i
23:49ForSparePartsmye, marmalade version's the only version I've got (I think?)
23:49zcaudateclojurebot: nice!
23:49clojurebotIt's greek to me.
23:49technomancyFrozenlock: how did you install swank?
23:49technomancyoops
23:49technomancyForSpareParts: ^^
23:50ForSparePartsI used the emacs package manager to install clojure-mode.
23:51FrozenlockWhat's happening... awwww
23:51technomancyFrozenlock: sorry man. first three letters of the nick mismatch.
23:52technomancyFrozenlock: I used to hang out with a guy called technoweenie so I know how that is =)
23:52Frozenlocktab's a bitch :p
23:52Frozenlock(or M-/)
23:53zcaudateclojurebot: so if I wanna write those two functions but don't wanna make my own project... whom should I make the pull request to?
23:53clojurebotAnyone can hack! http://images.wikia.com/pixar/images/0/0d/Http_alliedow-files-wordpress-com_2011-01_anyone-can-cook-445x355.png
23:54zcaudatetechnomancy: =) emacs and i aren't gelling yet
23:55zcaudatemember:technomancy: was looking for something quick and easy on the repl
23:55technomancyit's an acquired taste
23:55technomancyI think there's something simplistic built-in
23:56ForSparePartstechnomancy, do you have any clue what it is I've done to break your nice plugin? I'd really like to give it a shot : )
23:56technomancyForSpareParts: how did you install swank?
23:57ForSparePartstechnomancy, package manager, like I said
23:57ForSparePartser
23:57ForSparePartsemacs package manager
23:59technomancyForSpareParts: oh, you said you installed clojure-mode that way; that's different