2010-12-09
| 00:14 | auser | hola |
| 00:19 | technomancy | wow, this is kind of embarassing: http://groups.google.com/group/clojure/browse_thread/thread/4b9a0d4da8c36c09 |
| 00:23 | technomancy | scripts are referencing all kinds of files that don't exist; they won't even launch on machines with less than 3GB of ram; they assume you've got the Mac version of yourkit installed in a specific location. eep. |
| 00:25 | technomancy | the readme has twelve lines (four relevant) about Clojure followed by tons of stuff about asm |
| 00:25 | defn | technomancy: that's why I was suggesting hamster |
| 00:25 | defn | https://github.com/harukizaemon/hamster |
| 00:26 | technomancy | oh, I see. cool |
| 00:27 | technomancy | even with that, you want alter semantics though, which I don't see cloby providing |
| 00:27 | technomancy | I guess ref-set! semantics is better than nothing |
| 00:28 | dnolen | technomancy: debatable. It's kinda slow. You're slowing down your mutable code. Might as well just live on the edge. |
| 00:33 | defn | how so? (are you slowing down your mutable code?) |
| 00:33 | defn | @dnolen |
| 00:35 | defn | technomancy: is there any reason to assume alter semantics couldn't be added? |
| 00:37 | technomancy | defn: not at all; I implemented them in clojure-gem |
| 00:37 | technomancy | it's a bitmore awkward without first-class functions, but it's easy to do |
| 01:24 | btw0 | If string slicing using "subs" cannot have negative args, how can i get the specified lenth of a substring at the end of a string? |
| 01:24 | technomancy | I think I submitted a patch to make subs accept a negative argument |
| 01:25 | technomancy | hrm; maybe not. I guess I just proposed it. |
| 01:27 | btw0 | cool, but is there an elegant way to achive that for now? |
| 01:44 | amalloy | &(let [s "long string"] (subs s (- (count s) 3))) |
| 01:44 | sexpbot | ⟹ "ing" |
| 01:44 | amalloy | not exactly elegant, but not terrible |
| 01:44 | amalloy | btw0: ^^ |
| 01:50 | btw0 | thanks, i've also found "tail" in clojure.contrib.string does this too |
| 01:52 | hiredman | ,(doc partition-all) |
| 01:52 | clojurebot | "([n coll] [n step coll]); Returns a lazy sequence of lists like partition, but may include partitions with fewer than n items at the end." |
| 01:54 | auser | has anyone here ever use RMI or some other messaging in clojure? |
| 02:01 | defn | i always forget about subs |
| 02:02 | defn | I think in general the partition fns have been the most all-around useful for me. |
| 02:02 | natto | hi, is anyone familiar with the error "error in process filter; Wrong type argument" in emacs+slime? |
| 02:03 | natto | this is mentioned in github and SO, which basically say "please use the ELPA version", which I do, and still can't resolve it |
| 02:04 | natto | i.e. where you'd expect the backtrace in emacs, the error appears and hangs |
| 02:05 | technomancy | natto: maybe you have the other version of slime still installed alongside it? |
| 02:07 | natto | i was using the boinkor.net version, but now I installed slime via ELPA, and my .emacs knows nothing of the boinkor version |
| 02:07 | natto | so there is no "slime" appearance in my .emacs |
| 02:07 | technomancy | no version from apt-get or anything either? |
| 02:08 | natto | nope, not there |
| 02:09 | technomancy | hmm; I haven't seen that. maybe M-x toggle-debug-on-error and send the stacktrace to the swank-clojure mailing list? |
| 02:09 | defn | how many people are actually doing web development with clojure? |
| 02:10 | natto | btw technomancy, I assume you're aware that when the ELPA slime prompts to install clojure, it gives an error because repo.technomancy.us isn't giving jars? |
| 02:10 | technomancy | natto: yes, swank-clojure from elpa has been deprecated for quite some time now. |
| 02:10 | defn | let me rephrase that because it's somewhat rhetorical: what is preventing more people from doing web development in clojure? where are some good places to look to in philosophy that are more in alignment with the style of language? |
| 02:11 | natto | i see... |
| 02:12 | defn | err, some good places to look where the the underpinnings of the design rely on something which resembles clojure |
| 02:12 | technomancy | natto: all you need on the elisp side is slime and slime-repl |
| 02:12 | technomancy | sounds like it's time for another blog post |
| 02:13 | natto | so the "recommended way" right now is to launch a swank server externally then do slime-connect? |
| 02:13 | natto | sorry i'm missing something |
| 02:13 | defn | technomancy: you did a lot of ruby, (maybe still do?) do you have any ideas on the whole rails story and how one can translate it without making a mess into clojure? |
| 02:13 | defn | s/into/in |
| 02:13 | sexpbot | <defn> technomancy: you did a lot of ruby, (maybe still do?) do you have any ideas on the whole rails story and how one can translate it without making a mess in clojure? |
| 02:14 | natto | and yes a blog post will be much appreciated -- there are all sorts of different guides out there, all within the last 9 months, all leading to different results |
| 02:14 | technomancy | natto: that's right, though there's a little lib called durendal that combines the two steps |
| 02:14 | technomancy | defn: I'm not sure. I haven't really done frontend web work since 06 or so. |
| 02:15 | defn | technomancy: what is your opinion on a "web development" story for clojure? |
| 02:15 | defn | Does it make sense? Is it a square peg in a round hole? |
| 02:15 | technomancy | defn: on the whole I'm really glad clojure seems to be resisting the monolithic framework approach of rails |
| 02:15 | natto | ok, well i'll be happy as long as i can just recover my old and trusty slime->clojure repl at this point (many hairs pulled out). |
| 02:15 | technomancy | even if it's more work up-front to piece things together, you end up with a much more coherent result |
| 02:15 | defn | technomancy: I agree, actually -- but there is a trade off |
| 02:16 | defn | more work up-front is sort of contrary to what seems to be so prevalent in the community: a desire for adoption |
| 02:16 | natto | ok so, there's a bucket of tricks for emacs, and the bucket of tricks includes setting up slime+clojure? |
| 02:16 | technomancy | defn: true, but it's much easier to achieve something cohesive from composable libraries than to try to go the other direction |
| 02:17 | technomancy | natto: tl;dr: lein swank in a shell, then M-x slime-connect in Emacs |
| 02:17 | technomancy | once you've got that working you can try durendal which may be a bit more convenient, but don't sweat it up front |
| 02:18 | defn | technomancy: optimized for developer happiness, and convention over configuration |
| 02:18 | defn | in the case of the former I believe we're halfway there. in the case of the latter I think we're behind the curve |
| 02:20 | natto | so i've been able to do slime-connect to a swank server (so i'm opening another process aside emacs) since i got slime. the backtrace still hangs emacs though |
| 02:21 | technomancy | natto: clojure 1.3? |
| 02:22 | natto | 1.2, after discovering 1.3 doesn't work |
| 02:22 | natto | wait... no, lein swank uses 1.3 sorry. |
| 02:22 | natto | let me retry |
| 02:22 | technomancy | there are definitely unresolved issues with 1.3 =\ |
| 02:23 | natto | yes i discovered there was no print-doc after much head scratching |
| 02:24 | natto | (all the blog posts about setting up that pull from rhickey's github will lead to these errors!) |
| 02:27 | natto | ok lein's swank is 1.3.0 (should be pulling from github). clojure is 1.2.0 |
| 02:27 | technomancy | subs with negative offset: http://dev.clojure.org/jira/browse/CLJ-688 |
| 02:28 | technomancy | natto: that's what you want; 1.3.0-SNAPSHOT of swank |
| 02:28 | technomancy | so how about calling into with a string as its first arg? |
| 02:29 | technomancy | seems like if seq of a string returns a seq of chars, you should be able to reverse that operation with into |
| 02:31 | natto | no dice. |
| 02:31 | natto | just to confirm: swank=1.3.0-SNAPSHOT, clojure-1.2.0.jar, slime, slime-repl, clojure-mode all from ELPA |
| 02:31 | natto | that's the bare setup |
| 02:32 | technomancy | what Emacs version? |
| 02:32 | natto | 23.2, from PPA |
| 02:32 | natto | launch lein's swank-clojure, in emacs, slime-connect, all defaults. type a<return>, expect stack trace, get hang |
| 02:33 | natto | GNU Emacs 23.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.21.6) of 2010-09-01 on americium, modified by Debian |
| 02:33 | technomancy | could try emacs -Q; manually M-x eval-buffer in ~/.emacs.d/elpa/slime-xxxx/slime.el just to rule out the possibily of mix-up on the elisp side. |
| 02:36 | natto | so 1. i get Versions differ: ... 20100404 (swank).; continue. swank server: Error reading swank message |
| 02:37 | natto | 2 is swank server error. there's no 3rd point |
| 02:40 | technomancy | sorry, not sure what's going on there =\ try the swank-clojure mailing list I guess |
| 02:45 | natto | ah. got it. it's autopair |
| 02:45 | technomancy | ...?! |
| 02:46 | natto | i'm not sure why i got a hang in the last emacs -Q |
| 02:46 | technomancy | that's a serious bug if autopair affecting the connection to swank |
| 02:47 | natto | actually no i didn't. i had to load more than slime.el to get a repl |
| 02:47 | natto | this is a different error from the one i was getting when i just ran M-x slime |
| 02:47 | technomancy | time to ditch it and grab paredit |
| 02:47 | natto | but (autopair-global-mode) causes hang in repl from slime-connect |
| 02:48 | natto | autopair's for electric "'({[ |
| 02:48 | natto | can't have everything :-/ |
| 02:48 | natto | but, i have a stacktrace now. so happy! thanks! |
| 02:49 | natto | thanks very much |
| 02:49 | technomancy | sure. better report a bug with autopair though. |
| 02:49 | natto | ok |
| 02:57 | defn | autopair?! paredit! |
| 02:58 | natto | do you use electric quotes? |
| 02:59 | natto | i installed autopair on top of paredit for that |
| 02:59 | technomancy | that's redundant |
| 03:00 | natto | it is, but js2-mode provides its own quote matching, so autopair falls back to paredit in that mode |
| 03:00 | natto | but otherwise -- do you use something for electric quotes? |
| 03:02 | technomancy | paredit does electric quotes |
| 03:10 | natto | there are some behaviors in autopair i was more happy with. playing around it looks like paredit changes the default way you delete parens? |
| 03:10 | Derander | it seems to |
| 03:11 | defn | haml and sass have indentation rules that allow you to forego parens, why not leverage that? |
| 03:11 | natto | you can probably configure one to behave like the other, but vanilla autopair behavior is quite nice imo (aside of crashing the repl) |
| 03:12 | Derander | defn: how would you do haml w/o parens in clojure? |
| 03:12 | Derander | oh wait, what was that other html gen library? |
| 03:13 | defn | hiccup? |
| 03:13 | Derander | yeah |
| 03:13 | Derander | I think hiccup is closer to the spirit of haml than clj-haml |
| 03:13 | defn | hm, I disagree |
| 03:13 | defn | try to get your designer to use hiccup |
| 03:13 | defn | clj-haml is clojure, |
| 03:14 | defn | closer* |
| 03:14 | defn | haml is still a stretch, but at least they'll use it |
| 03:14 | Derander | I don't look at it as a "for designers" thing |
| 03:14 | Derander | I see it as a power tool for me |
| 03:14 | defn | yeah, it just seems to turn out that most of the people who do most of the templating and view-wrangling on my projects do PSDs, followed by haml |
| 03:14 | Derander | and aren't they basically the same thing except clj-haml uses calls to h= in favor of nested vectors? |
| 03:15 | defn | Derander: again, explain that to your designers |
| 03:15 | Derander | seriously, they look basically the same except one has less line noise |
| 03:16 | defn | they care more about aesthetics |
| 03:16 | defn | nature of the breed |
| 03:17 | Derander | (html [:div#header [:h1 "hello!"]]) vs (h= :html (h= :div#header (h= :span "hello!"))) |
| 03:18 | Derander | we're arguing something subjective, but to me the former is nicer looking |
| 03:18 | defn | oh, there i tend to agree |
| 03:19 | defn | but what im saying is, neither is "haml" |
| 03:19 | Derander | right |
| 03:19 | defn | which is what i need |
| 03:19 | defn | s/need/want |
| 03:19 | sexpbot | <defn> which is what i want |
| 03:19 | hiredman | if you use enlive your designers can just write html and you can use css selectors to inject content |
| 03:19 | Derander | it'd be pretty simple to parse %h1 to [:h1 |
| 03:19 | Derander | haml turns into nice sexps I'd imagine |
| 03:19 | defn | hiredman: that adds to the dev load, though |
| 03:20 | defn | hiredman: i mean, i've considered enlive, but i don't think i'd use it as my primary templating solution |
| 03:20 | Derander | I like a combination of haml and enlive |
| 03:20 | Derander | they each have their perks |
| 03:20 | Derander | when I work in ruby I use haml and erb depending on the situation |
| 03:21 | defn | i basically never use .erb unless it's a page full of script tags, like google analytics partials |
| 03:21 | Derander | I use erb for static content |
| 03:21 | Derander | well |
| 03:21 | Derander | text heavy content w/ lots of tags in the middle of it |
| 03:22 | Derander | "Hello we are <strong>Company name</strong> and we make <a href = "...">product</a>" reads better to me |
| 03:22 | defn | my sense is this: if we had a way to do something similar to Rails without it being Rails (very modular, not a cathedral) |
| 03:22 | defn | we'd have a better "web dev" story for clojure |
| 03:22 | Derander | right now ring is basically rack, right? |
| 03:23 | Derander | I haven't worked with ring in any real sense |
| 03:23 | defn | right |
| 03:23 | Derander | rails is basically some nice helpers on top of rack nowdays |
| 03:23 | defn | many nice helpers |
| 03:23 | defn | it's huge, but it turns out a lot of it is necessary |
| 03:23 | Derander | clojureql fills the orm gap kind of |
| 03:23 | Derander | need something for migrations |
| 03:23 | defn | lots of error wrangling, lots of model niceties |
| 03:23 | Derander | for errors |
| 03:24 | Derander | yeah |
| 03:24 | defn | yeah clojureql is close, but still cumbersome |
| 03:24 | defn | people need the same damn experience they have when they boot up a rails app |
| 03:24 | Derander | I think rails wins in terms of view helper libraries mostly |
| 03:24 | Derander | can implement the backend stuff very efficiently in clojure |
| 03:24 | bobo_ | view helper libraries? |
| 03:24 | Derander | all of the fancy link routing, inflection stuff, ajax helpers |
| 03:25 | bobo_ | (i dont know rails) |
| 03:25 | Derander | form helpers |
| 03:25 | bobo_ | ah you mean so you can do ajax stuff without knowing javascript? |
| 03:25 | Derander | kind of |
| 03:25 | Derander | you can do it to a point |
| 03:25 | Derander | the original goal that rails had was to abstract away javascript |
| 03:25 | bobo_ | predefined components, or something like that? |
| 03:25 | Derander | that went out of vogue w/ rails 3 |
| 03:26 | defn | yes the routing is nice, arel is nice, generators are nice, the built-in helpers/utilities are nice, the model agnosticism is nice, the way things just map up as long as you name them correctly is nice |
| 03:26 | Derander | <% form_for @comment do |f| %> ... is how you start a form tag in rails for a comment object |
| 03:26 | defn | ewwww |
| 03:26 | defn | use formtastic! |
| 03:26 | Derander | you could drop in <% remote_form_for @comment do |f| %> and have it automagically be ajaxified |
| 03:26 | Derander | defn: talking vanilla rails |
| 03:26 | defn | <% semantic_remote_form_for |
| 03:26 | defn | ah, sure |
| 03:26 | Derander | and now it's form_for ... :remote => true anyways |
| 03:26 | defn | *nod* |
| 03:27 | bobo_ | personaly you lost me at <%, i hate that. but i agree that something like it is needed for the masses |
| 03:27 | defn | bobo_: i hate it too |
| 03:27 | Derander | bobo_: rails < 2 would spam generated prototype.js stuff |
| 03:27 | bobo_ | enlive changed my view of web development |
| 03:27 | Derander | bobo_: rails 3 will stick data-attributes in and give you unobtrusive js to use |
| 03:27 | defn | bobo_: that's why i use haml. the same thing looks like: = remote_form_for ... |
| 03:27 | bobo_ | and i learned some jquery, and now i dont want any crappy components |
| 03:27 | Derander | bobo_: yeah, rails 3 is really nice w/ jquery now |
| 03:28 | bobo_ | but i do understand that it is needed |
| 03:28 | Derander | it's officially "js framework agnostic" |
| 03:28 | Derander | not sure to what extent is true |
| 03:28 | defn | i dont get the fucking prototype.js default |
| 03:28 | defn | wtf? |
| 03:28 | Derander | it was the best thing when rails came out |
| 03:28 | defn | who uses that garbage? |
| 03:28 | defn | yes, 4 years ago |
| 03:28 | defn | jQuery has been the du jour for at least a year |
| 03:28 | Derander | rails 3 has been in dev for like two years |
| 03:29 | Derander | but yeah |
| 03:29 | Derander | there is no default anymore |
| 03:29 | Derander | you can use whatever you want |
| 03:29 | defn | *nod* |
| 03:29 | defn | i dont know what the answer is honestly, im just ranting |
| 03:29 | Derander | and there has been a jquery.rails drop in for a very long time |
| 03:29 | Derander | that would redefine helpers/provide js as a complete replacement for prototype |
| 03:29 | defn | im just doing a lot of work in rails lately and find the way rails behaves to be what one should expect in any other framework |
| 03:30 | Derander | usually, yeah |
| 03:30 | defn | otherwise it has more pain than it's worth |
| 03:30 | defn | shops aren't going to switch unless they have that work-alike feeling |
| 03:31 | defn | copy and paste haml templates, convert a rails app to clojure with a single command, etc. |
| 03:31 | defn | that sort of thing needs to happen for webdev adoption |
| 03:31 | Derander | not sure to what extent that is true |
| 03:31 | Derander | people switched to rails from php/asp |
| 03:31 | Derander | and that was a sea change |
| 03:32 | defn | i've worked with some prominent rails consulting firms and there is little interest in clojure |
| 03:32 | Derander | I'd like to think that ruby programmers are fairly open minded in general. you have to keep up with a *lot* of new libraries to be cutting edge |
| 03:32 | Derander | mm |
| 03:32 | Derander | I haven't |
| 03:32 | Derander | so I don't know |
| 03:32 | defn | when i try to explain the webdev "story", it's fragmented |
| 03:32 | defn | it doesn't make any sense |
| 03:32 | defn | too many steps. too many hurdles. too many new things to consider. too much choice. |
| 03:32 | defn | they just want a goddamn framework. |
| 03:33 | Derander | rails is getting that way too, lately, but the people who are doing it know how to navigate it |
| 03:33 | defn | ive spent the better part of two months getting "back in the saddle" on rails. i was off in another land for ~3 years |
| 03:33 | Derander | getting started now you have your choice of 3 templating languages, 4 auth solutions, 2-3 testing solutions, umpteen trillion sub-testing-libraries, 3 or 4 major orms |
| 03:33 | Derander | and that's just major components |
| 03:33 | defn | Derander: yes, but now enumerate those in clojure |
| 03:34 | Derander | if you want to do twitter, facebook, csv, xml, html parsing, etc. |
| 03:34 | Derander | hah, I have no idea |
| 03:34 | Derander | I don't know clojure libraries. |
| 03:34 | defn | /you don't know what you don't know/ |
| 03:34 | defn | this is the problem. |
| 03:35 | defn | It's not that there is a lack of maturity. It's that there is a lack of presentation. |
| 03:36 | defn | Here is an example of rails-related documentation: http://mongoid.org/ |
| 03:36 | Derander | right |
| 03:36 | defn | Nothing like that exists in the clojure community. |
| 03:37 | defn | So the libraries look brittle and iffy. |
| 03:37 | Derander | mongoid is a slick piece of software too |
| 03:37 | Derander | on the other hand, nothing like http://clojuredocs.org/ exists in the rails community :-) |
| 03:37 | defn | sure it does :) |
| 03:38 | Derander | http://railsapi.com/ ? |
| 03:38 | defn | it's called google, because ruby/rails was born in the heat of "blogs" |
| 03:38 | Derander | hah |
| 03:38 | defn | everyone contributed, it's just indexed elsewhere :) |
| 03:38 | Derander | developer tools for clojure are massively superior |
| 03:38 | Derander | emacs/slime is just good |
| 03:38 | Derander | but that's just lisp in general |
| 03:39 | defn | yeah there's no equivalent in ruby which sucks so bad |
| 03:39 | defn | it's just sad everytime i'm reminded of it |
| 03:39 | Derander | it feels like it should be possible to do |
| 03:39 | defn | /some/ of it is possible to do. |
| 03:39 | defn | you could build a source code traversing thing-a-mabob |
| 03:40 | defn | so in swank you so M-., maybe you add something like that to comint ruby |
| 03:40 | Derander | I think you could get pretty close w/ some mishmash of static analysis, drb and irb |
| 03:40 | defn | s/so/do |
| 03:40 | sexpbot | <defn> do in swank you do M-., maybe you add domething like that to comint ruby |
| 03:40 | defn | drb is a graveyard |
| 03:40 | defn | probably better to use something else |
| 03:41 | Derander | I don't mean drb itself |
| 03:41 | Derander | the concept |
| 03:41 | defn | ah sure |
| 03:41 | Derander | like a ruby method server |
| 03:41 | Derander | ala swank |
| 03:41 | Derander | rubymine is getting damn good at ruby code analysis |
| 03:41 | defn | everyone i work with derides rubymine |
| 03:41 | Derander | have you tried it? |
| 03:41 | defn | i own a copy, yes |
| 03:41 | Derander | mm |
| 03:41 | Derander | I couldn't use it for primary dev |
| 03:41 | defn | the refactoring tools are pretty great |
| 03:41 | Derander | right |
| 03:41 | defn | tcrayford has a wonderful refactoring project for clojure |
| 03:42 | Derander | it's getting good at understanding semantics and doing debugging and stuff |
| 03:42 | defn | i wish there was more attention paid to it |
| 03:42 | Derander | yeah, I've been meaning to install that for awhile |
| 03:42 | defn | do it. just try it out. you will feel like you're wathing magic. |
| 03:42 | defn | s/wathing/watching |
| 03:42 | sexpbot | <defn> do it. just try it out. you will feel like you're watching magic. |
| 03:42 | Derander | I am severely time limited |
| 03:42 | Derander | high school student doing college apps & working |
| 03:42 | Derander | I'm studying spanish right now on the other monitor :P |
| 03:42 | defn | don't play games with me. you're on irc. |
| 03:43 | defn | nice calculated move there |
| 03:43 | Derander | ;-) |
| 03:43 | defn | quit making excuses and do it. |
| 03:43 | defn | :) |
| 03:43 | Derander | I will later |
| 03:43 | Derander | I have it on a todo list |
| 03:43 | Derander | but emacs isn't open right now |
| 03:43 | defn | https://github.com/tcrayford/clojure-refactoring |
| 03:44 | Derander | right |
| 03:44 | defn | thread-first and thread-last are great fun to play with |
| 03:44 | Derander | I wish I understood font-lock |
| 03:44 | Derander | there are a lot of things I want to do with syntax highlighting in clojure |
| 03:44 | defn | you can walk through a bunch of source you've written without paying attention to thread-first/last |
| 03:44 | Derander | that I simply can't implement |
| 03:45 | defn | and then go back and literally hit hotkeys on your forms and change them to use ->, ->>, so you can see the readability changes immediately |
| 03:45 | defn | it's great. |
| 03:45 | Derander | right |
| 03:45 | Derander | I want arguments to functions to be highlighted in their bodies |
| 03:45 | defn | i wish more language focused on "code filters" |
| 03:45 | Derander | code filters? |
| 03:46 | defn | what we're describing are "code filters". my term, not sure what the proper nomenclature is... |
| 03:46 | defn | we're not changing the overall truth of the function |
| 03:46 | Derander | oh, yes. |
| 03:46 | defn | we're just changing its structure |
| 03:47 | Derander | yes. I remember a few years ago when I was learning ruby I had an epiphany about refactoring |
| 03:47 | defn | i think it would be cool to have a photoshop Filters-size list of possible "filters" you could apply to a form. |
| 03:47 | Derander | it was a really magical moment |
| 03:48 | Derander | basically what you're talking about -- thinking about transformations as keeping the same meaning while altering the structure |
| 03:48 | Derander | I think that's why sexps are so pretty to me |
| 03:48 | Derander | it's easier to do that |
| 03:48 | defn | i cannot convince anyone to use clojure |
| 03:48 | defn | i think im a terrible salesman or something |
| 03:49 | Derander | I don't really argue for clojure, just for thinking outside the imperative/procedural/oop box |
| 03:49 | Derander | I usually do it by challenging somebody to a coding competition |
| 03:49 | defn | i object strongly to that |
| 03:49 | defn | the first part :) |
| 03:49 | defn | we /must/ argue for clojure |
| 03:50 | Derander | why? |
| 03:50 | clojurebot | http://clojure.org/rationale |
| 03:50 | defn | FP has taken a lot of ideas from OOP, but the reverse is not true |
| 03:50 | Derander | haha |
| 03:50 | Licenser | morning! |
| 03:50 | Derander | Licenser: good morning |
| 03:50 | defn | morning Licenser, long time no see |
| 03:50 | Licenser | I have chocolat! |
| 03:50 | defn | NOMNOMNOM |
| 03:50 | Licenser | defn: yap I had to manage to break my IT departments security again so I could use IRC :P |
| 03:50 | defn | ssh tunnel or even more hackish? |
| 03:51 | Derander | https://github.com/ivan4th/swank-js <-- this is glorious |
| 03:51 | defn | Derander: ive been using that for the last week now! :) |
| 03:51 | Derander | breaking through firewalls at school has been the single greatest motivation to learn about ssh |
| 03:51 | Derander | defn: another one of those things I haven't installed yet |
| 03:51 | Licenser | defn: both |
| 03:51 | Derander | I'm hung up on slime |
| 03:51 | Licenser | since SSH isn't allowed |
| 03:51 | Derander | I have slime/slime-repl from elpa |
| 03:51 | Derander | but those versions don't include slime-contrib |
| 03:51 | Derander | and I haven't managed to get a working emacs ecosystem w/ cvs slime yet |
| 03:51 | Licenser | only stupidly proxied connetion .... |
| 03:51 | Derander | I've tried three time |
| 03:51 | defn | Derander: don't use CVS slime |
| 03:51 | defn | Derander: what platform? |
| 03:52 | Derander | defn: os x |
| 03:52 | Derander | carbon emacs |
| 03:52 | Derander | Licenser: are they blocking the protocol or the port? |
| 03:52 | Licenser | aquamax ftw |
| 03:52 | defn | what OS v#? |
| 03:52 | Derander | 10.6.5 |
| 03:52 | defn | Derander: i compiled from source |
| 03:52 | Licenser | Derander: everything |
| 03:52 | Derander | I used to use aquamacs but I saw no benefit to continuing to do so |
| 03:52 | Derander | hah. fun |
| 03:52 | defn | im on 10.6.5 |
| 03:52 | Derander | for awhile they blocked 22 at school so I ran it on 443 |
| 03:52 | Derander | defn: I don't think it's an emacs problem |
| 03:53 | Derander | I think I just need to trash a significant portion of my .emacs.d and rebuild |
| 03:53 | defn | oh your config is broken? |
| 03:53 | Derander | it's working now |
| 03:53 | defn | or you cant `make`? |
| 03:53 | Licenser | Derander: yes so they are a bit more strict here so they don't let you connect to 443 either unless it goes over ther effing proxy either |
| 03:53 | Derander | if i remove elpa slime/slime-repl and insert cvs slime then I'm fucked |
| 03:53 | Derander | Licenser: yeah, they eventually did that |
| 03:53 | defn | what is all this cvs talk? |
| 03:53 | defn | this is crazy. |
| 03:53 | Derander | defn: that is what I was advised to do |
| 03:54 | defn | do /not/ use cvs. use github. |
| 03:54 | Derander | Licenser: the school runs a networking class so we argued successfully for an unfirewalled (mostly) linux box that can sh out |
| 03:54 | Derander | I bounce everything through that now |
| 03:54 | Derander | https://github.com/nablaone/slime ..? |
| 03:54 | Licenser | Derander: yea sadly our IT department are dorks |
| 03:54 | defn | that's the one |
| 03:54 | Derander | Licenser: windows guys? |
| 03:54 | defn | i use technomancy's though |
| 03:54 | Derander | defn: "imported from CVS daily"? :) |
| 03:54 | Licenser | Derander: yes |
| 03:55 | defn | Derander: there are nightly builds you know? |
| 03:55 | defn | like, DMGs |
| 03:55 | Derander | defn: of carbon emacs? |
| 03:55 | Derander | or slime? |
| 03:55 | Derander | ah, technomancy's is frozen w/ clojure compat |
| 03:55 | Licenser | sad part is that I work in a Telco Supplyer so everyone in my department has a good understanding of networking and IT, sadly we are not the IT depretment :P |
| 03:55 | Derander | it's the new version of slime from cvs that are owning me. |
| 03:55 | Derander | Licenser: of course |
| 03:55 | Derander | Licenser: the district's networking/it used to be run by this sweet old linux guru |
| 03:56 | Derander | everything open source and primarily student setup/run |
| 03:56 | Licenser | heh that is good |
| 03:56 | Derander | ran great for 14 years |
| 03:56 | Derander | he retired to teach the networking class |
| 03:56 | Derander | windows guy managed to spend $4 million in 3 years and break literally everything |
| 03:56 | Licenser | which reminds me I should call our IT department since their stupid patches won't install |
| 03:56 | Derander | active directory: broken, proxies: broken, internet outages: common, firewalls: too restrictive, email: broken |
| 03:57 | Derander | replacing all linux and mac servers w/ windows servers in a district that uses exclusively macintosh computers for the users |
| 03:57 | defn | Licenser: i suggest a 3g tether |
| 03:57 | Derander | </rant> |
| 03:57 | Licenser | defn: the reception in here is horrible |
| 03:57 | Licenser | we're like in a pharadayic cage |
| 03:57 | defn | farradayic? |
| 03:58 | defn | farraday cage? |
| 03:58 | defn | s/farraday/faraday |
| 03:58 | sexpbot | <defn> faraday cage? |
| 03:58 | Licenser | yes that stuff |
| 03:59 | defn | heh |
| 04:01 | Derander | la encuesta |
| 04:02 | defn | good night all |
| 04:02 | defn | good talking with you Derander |
| 04:02 | Derander | good night |
| 04:02 | defn | ciao Licenser |
| 04:05 | Licenser | Í haaaate windows |
| 04:05 | Derander | yes |
| 04:05 | Derander | me too |
| 04:05 | Derander | good night from me as wlel :-) |
| 04:06 | Licenser | take care Derander |
| 04:10 | fliebel | morning |
| 04:25 | defn | ' as a constituent character is fun. |
| 04:27 | raek | # as a reader macro character is fn. |
| 05:32 | auser | clojure noob here... having some trouble importing the clojar dependency (org.clojars.ctdean/apache-cassandra) from lein. |
| 05:33 | auser | I have "[org.clojars.ctdean/apache-cassandra "0.7.0-beta3"]" in the project.clj and (:import '(org.clojars.ctdean.thrift CassandraDaemon) in the class file, but it's failing with ClassNotFoundException |
| 05:38 | btw0_ | for identation of coding style, is there a simple rule of thumb? I am a little confused of when to use 2 spaces and when to align all args to the first args |
| 05:39 | Chousuke | align args when it looks okay. :P |
| 05:43 | Chousuke | so, hm. Indent code according to the level of nesting, and align code after indenting it as needed to make it visually appealing. |
| 05:44 | raek | btw0_: 2 spaces are mostly used for special forms |
| 05:45 | Chousuke | hm? |
| 05:45 | Chousuke | 2 spaces is used for all indents. |
| 05:45 | raek | hrm, that's not how clojure-mode does it... |
| 05:46 | Chousuke | When does it indent more than 2 spaces? |
| 05:46 | Chousuke | (per level, of course) |
| 05:46 | btw0_ | raek: so 2 spaces for special forms and ident args to the first one for all other cases? |
| 05:47 | raek | (foo a |
| 05:47 | raek | b |
| 05:47 | raek | c) |
| 05:47 | raek | but |
| 05:47 | Chousuke | raek: that's alignment, not indentation |
| 05:47 | raek | (if pred |
| 05:47 | raek | a |
| 05:47 | raek | b |
| 05:47 | btw0_ | raek: i got it, thanks |
| 05:47 | raek | I guess I wasn't aware of the difference... |
| 05:48 | Chousuke | The way I see it b and c have the same indent as foo |
| 05:48 | Chousuke | and are just aligned to a |
| 05:48 | Chousuke | while with if, a and b are their own scopes, one level deeper than if, so they need a new indent |
| 05:50 | Chousuke | it gets somewhat trickier with defn etc. that takes parameter vectors and dosctrings and whatnot before the actual code block begins |
| 05:56 | raek | one difference from other lisps I have noticed is the tendency for this: |
| 05:56 | raek | (dosync |
| 05:56 | raek | (a) |
| 05:56 | raek | (b)) |
| 05:56 | raek | instead of |
| 05:56 | raek | (dosync |
| 05:57 | raek | (a) |
| 05:57 | raek | (b)) |
| 05:57 | stain_ | that looks totally different! :) |
| 05:57 | stain_ | 1-space-indent must die |
| 06:26 | Licenser | aloa |
| 06:28 | lpetit | in ccw i currently implemented the most "repeatable" (context free) indentation heuristic possible: alignement with the first previous sibling which is the first non blank thing on a line, or else 2-space indent from the parent paren form, or else 1-space indent from the parent non-paren ({, [, etc.) form (1-space or 2-space relative to the end of the form "opening", that is if the form is 2 chars wide, like in #(, it's 2 spaces from th |
| 06:29 | lpetit | There's not assumption about whether we're in a function call, a special op call, a macro call. |
| 06:31 | Licenser | lpetit: ccw's identation works good I just had one feature request: ident all or ident selection :) |
| 06:31 | Licenser | that'd be sweet |
| 06:32 | lpetit | indeed. |
| 06:32 | Licenser | I had to reindent a large file and it was hell :P doing it for each line on it's own |
| 06:32 | lpetit | Though when I work on this again (yet I'm busy with finalizing the repl ui integration), I'll first make auto-indent better, by also reindenting possibly existing following siblings and children. |
| 06:33 | lpetit | Licenser: :-( |
| 06:33 | Licenser | lpetit: not your fault, it came from moving source around and each editor having it's own thoughts about identations |
| 06:34 | Licenser | also in the repl UI I kind of miss the prompt |
| 06:34 | Licenser | it's hard to see what NS you're in |
| 06:34 | lpetit | And I'll do this "smarter auto indent" smart enough not to ruin hand-made indentation: it will just reindent the line you ask it for, observe the col change (+ 2 , -3, whatever), and replicate this change to the following lines concerning children and siblings; |
| 06:35 | lpetit | yes, the prompt issue keeps coming |
| 06:35 | Licenser | ^^ |
| 06:36 | lpetit | Did you do a permanent switch to the (temporary) repl ui fork ? |
| 06:36 | Licenser | other then that I find the repl management in the beta a bit more confusoing then in the stable :P |
| 06:36 | Licenser | yap |
| 06:36 | cemerick | Licenser: I'm listening :-) |
| 06:36 | lpetit | heh, there were sufficient disclaimers about the stability of this branch :-p |
| 06:36 | lpetit | look, you've awaken the wolf :) |
| 06:37 | Licenser | lpetit: yes I don't talk about crash's but about usability |
| 06:37 | Licenser | it is a nice improvment that you have a 'run as clojure' now so I kind of miss the simple 'start project REPL' |
| 06:37 | lpetit | working hard today on bringing more of paredit to it |
| 06:37 | lpetit | ?? |
| 06:37 | Licenser | oh yes and paredit in the repl console can be a PITA if you copy/paste half finished code :P |
| 06:37 | Licenser | *starts eclipse* |
| 06:38 | lpetit | when paredit is totally ported, intend it to behave as in the editor, including the 2 modes: default and strict. |
| 06:38 | lpetit | s/intend/expect/ |
| 06:38 | sexpbot | <lpetit> when paredit is totally ported, expect it to behave as in the editor, including the 2 modes: default and strict. |
| 06:40 | Licenser | also the enable/disable clojure thing could indicate if itis currently active or not |
| 06:40 | Licenser | AND if you reopen the workspace the clojure menu is gone |
| 06:40 | Licenser | sorry for whining so much but I figure feedback helps := |
| 06:41 | Licenser | the editor has paredit modE? |
| 06:41 | cemerick | It seems like the typical approach in eclipse-land is that, once a nature is added to project, it's not removable. We could match that. *shrug* |
| 06:42 | cemerick | Licenser: Indeed, I use it constantly. |
| 06:42 | Licenser | I only see that you can set up strict mode, is that paredit mode? |
| 06:43 | cemerick | yeah |
| 06:43 | lpetit | Licenser: strict mode is what emacs users call paredit mode, yes |
| 06:43 | Licenser | ah okay |
| 06:43 | Licenser | okay okay :) |
| 06:43 | lpetit | You can change the default mode an editor is open in, via Window > Preferences > Clojure > ... |
| 06:43 | Licenser | ctrl+alt+l seems for some reason not to work when you have no repl started |
| 06:44 | Licenser | that'd also be noice if it could start the repl if you are trying to load something into it :P |
| 06:44 | lpetit | known regression, reported by Lee, if I remember well |
| 06:44 | cemerick | Licenser: what command does that correspond to? |
| 06:44 | Licenser | ah okay :) |
| 06:44 | Licenser | cemerick: load file in REPL |
| 06:45 | lpetit | yes, the enable / disable clojure thing should be smarter. There's an issue for it. |
| 06:45 | lpetit | Concerning the clojure menu, I'm not sure I understand. |
| 06:45 | cemerick | lpetit: That's not a regression, IMO. That's a flaw in Lee's workflow. If I start popping open new REPL processes because I try to load a file without a REPL available, I'll be very irritated. :-| |
| 06:45 | Licenser | traclked it down: if you select the project and are not in a editor the clojure menu disapears |
| 06:46 | lpetit | cemerick: That's a regression wrt how things work in 0.0.64. How things work in 0.0.64 being a good or bad thing is another topic :) |
| 06:46 | Licenser | it makes sense since currently there are only editor level commands in there but it is a bit confusing tohave it pop up and hide |
| 06:47 | cemerick | lpetit: fair enough :-) |
| 06:47 | Licenser | another question is compiling, is there something like 'compile project'? |
| 06:47 | lpetit | Licenser: well, it's dynamically visible depending on the context, indeed. |
| 06:47 | Licenser | I kind of didn't found it hat do do the horrible thing of writing a maven pom |
| 06:47 | cemerick | That's usually considered a feature :-) |
| 06:47 | lpetit | Licenser: hot topic. |
| 06:47 | Licenser | heh |
| 06:47 | Licenser | should I mention the next hot topic: dependencies :P |
| 06:47 | lpetit | Licenser: I definitely want to rework the current Clojure Builder. |
| 06:48 | cemerick | Licenser: eclipse's model is to continuously build projects |
| 06:48 | Licenser | very sweet would be lein support (in my eyes) |
| 06:49 | cemerick | A contentious issue. |
| 06:49 | lpetit | Even without talking (heh, Chas ;) ) about not hijacking the clojure application started by the user for the internal needs of ccw, the current builder does 2 things: it loads things in the application, and it does this by compiling namespaces. |
| 06:49 | Licenser | *nods* so in other words if I want to have things packaged I will be dependant on maven or lein right? |
| 06:50 | lpetit | I want it to be the other way around: it should only load things. AOT compilation should be only done when there's no REPL ('cause e.g. in windows the AOT compilation will fail if the class file is already loaded by the JVM) |
| 06:50 | cemerick | Licenser: the project.clj "model" is in such a state of flux, I don't think lpetit or I have any interest in spending time tracking it. |
| 06:50 | Licenser | also true |
| 06:51 | cemerick | Licenser: Eclipse has excellent ant, maven, and gradle plugins. *shrug* |
| 06:51 | lpetit | yep |
| 06:51 | Licenser | but maven is horrible, ant is supposed to be horribler and gradle - never tried it |
| 06:52 | Licenser | yet lein is the mostly wide spread build/dep management tool for clojure I think |
| 06:52 | cemerick | I'm sure I'll be including that topic in my next survey. |
| 06:52 | lpetit | If the world was just: "existing java ecosystem build tools (maven, gradle, ant)" versus "clojure NIH-reinvented lein build tool", and all the clojure community (or a biig part of it) was behind lein, then I'll consider supporting it *now*. |
| 06:52 | Licenser | hmm perhaps if there were a lein library that'd let people do things like (lein compile "my/project/dir") |
| 06:53 | lpetit | The problem, is, the NIH syndrom has led to (to my knowledge): leiningen, cake, cljr. |
| 06:53 | Licenser | what is NIH? |
| 06:53 | lpetit | Not Invented Here |
| 06:53 | Licenser | ah |
| 06:54 | Licenser | no to be frank I don't care if the build tool is writen in Visual basic, just that maven for example is horrible complex compared to a project.clj |
| 06:54 | Licenser | the pom.xml for the project I work on has like 160 lines of which I only understand half. the project.clj would have less them 10 I guess |
| 06:55 | Licenser | that is what I currently measure 'I prefare line over mvn' |
| 06:55 | Licenser | or rather the pom.xml |
| 06:56 | Licenser | don't care what works in the background if I don't have to magle with it |
| 06:56 | lpetit | Licenser: but isn't the philosophy of Clojure to not reinvent the wheel, and to provide (when possible) "lightweight" layer over existing java libs ? ;-) |
| 06:56 | Licenser | isn't lein doing exactly that? :P |
| 06:56 | lpetit | lein, cake, etc., by adding their own way of providing "plugins", by masking the use of maven plugins, do not play it well IMHO |
| 06:56 | Licenser | afiak is it using ant/mvn for the actual work just coving it |
| 06:57 | Licenser | so in the end I don't care as long as I don't have to fill out a 160 line form to download 2 dependencies and compile my project in a jar |
| 06:57 | Licenser | I have enough of that byrocracy out of the programming world :P and trust me I do I live in germany |
| 06:57 | lpetit | no, lein is reinventing existing maven plugins, and just leveraging the use of maven libs for accessing / managing maven repos. |
| 07:00 | lpetit | If I was not busy enough with ccw, I'd work to push clojure version of polyglot maven, help make clojure-maven-plugin more featureful (for example the REPL you get from clojure:repl is so 70ies ;) ), and add this clojure layer which would enable building maven plugins in clojure to be super easy. |
| 07:01 | cemerick | lpetit: did you see the project.clj-SPEC thread? |
| 07:01 | lpetit | Yes, but where is it now ? |
| 07:01 | cemerick | hasn't moved: http://groups.google.com/group/projectclj---spec/browse_frm/thread/855ce112689fb33f |
| 07:02 | cemerick | pmaven appears to be a broken premise, at least according to the two contributors to the clojure side of it. |
| 07:02 | lpetit | oh no, I hadn't seen this projectclj google group |
| 07:03 | lpetit | joining it right now |
| 07:03 | lpetit | will read it later, though, dinner time! |
| 07:06 | cemerick | It's not really a "live" group. I think that thread sorta killed it. :-( |
| 07:07 | cemerick | Licenser: FWIW, those of us that use maven don't do it because we're masochists or because we like "bureaucracy". e.g. http://cemerick.com/2010/03/25/why-using-maven-for-clojure-builds-is-a-no-brainer/ |
| 07:07 | fliebel | Is there something like Pythons Mechanize for Clojure? Mechanize is one mutable object thing, and it kills me. |
| 07:11 | mfex | fliebel, perhaps https://github.com/clj-sys/clj-http |
| 07:11 | Licenser | cemerick: I'll ra that |
| 07:12 | fliebel | mfex: nah, Mechanize is specialized in scraping data and submitting forms. |
| 07:14 | cemerick | fliebel: Check out selenium -- primarily intended for automated webapp testing, but it'll do for a lot of other uses as well. |
| 07:14 | cemerick | Absurdly comprehensive functionality. |
| 07:15 | fliebel | cemerick: It's not Clojure, right? The I might just as well use Mechanize. |
| 07:15 | cemerick | Hrm, almost certainly mutable stuffs though -- it uses the actual browsers (e.g. webkit or mozilla, or whatever). |
| 07:16 | mfex | fliebel, there is also this in java: http://htmlunit.sourceforge.net/ |
| 07:16 | Licenser | cemerick: my yuck with maven is that the pom's are horrible to read/write and the oficial documentation expects to to know the stuff already since they just explain things like: Filter - you can filter stuff with that, no mention of syntax or how exactly things work |
| 07:16 | cemerick | fliebel: As you like. Just because something's not written in Clojure doesn't mean it's bad. Having JVM libs at our disposal is one of our greatest strengths. |
| 07:18 | cemerick | Licenser: If it's XML you don't like, I'd agree with you; but, that's the same objection people raise about lisps and their parentheses…fundamentally a cosmetic one. FWIW: http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files |
| 07:19 | Licenser | cemerick: yes I do dislike XML but if I had to write 160 lines clojure to compile my project and pack it in a jar I'd just object that as much |
| 07:20 | Licenser | I don't even dislike XML in general, I think it is overused in some places and the pom is one of them in my eyes |
| 07:20 | fliebel | cemerick: I will have a look around. The Python thing works fine, but the browser is a mutable object, that changes as you browse, so I have to make sure to leave it as it was after every action. |
| 07:21 | Licenser | cemerick: I think I read that already, but I still failed to do what I wanted and had to redo my application structure since I failed to work out maven's copy stuff dependencies |
| 07:22 | Licenser | hack I am still not rid of the useless folders in the target directory |
| 07:22 | cemerick | fliebel: I wouldn't expect anyone to be crazy enough to reimplement a browser client framework in a persistent fashion. *shrug* |
| 07:23 | Licenser | things like maven-archiver |
| 07:24 | fliebel | cemerick: I don't see why a browser needs to be so stateful on a sateless protocol like HTTP. |
| 07:24 | Licenser | or classes - for some reason |
| 07:25 | Licenser | [ |
| 07:26 | cemerick | Licenser: there's no doubt that maven is not the simplest tool. Of course, if it were, I wouldn't be using it. |
| 07:26 | Licenser | don't you like simple tools? |
| 07:28 | cemerick | fliebel: A stateless protocol says nothing about the architecture of the client that implements it. |
| 07:29 | cemerick | Licenser: Yes, but I need *capable* tools as well. A simple build tool that can't do what I need it to do isn't very helpful to me. |
| 07:29 | Licenser | I personally think that simplicity is a very important feature |
| 07:29 | Licenser | cemerick: I think that's wrong |
| 07:29 | Licenser | things don't have to be complicated to be capable |
| 07:30 | fliebel | cemerick: True, I can see how this could be implemented in a persistent manner though. |
| 07:30 | Licenser | I belive that simple things should be simple |
| 07:30 | cemerick | fliebel: I'm certain it could; the question is, who wants to take that particular implementation and maintenance burden? ;-) |
| 07:31 | cemerick | Licenser: "build", broadly writ, is not a simple concept. |
| 07:31 | Licenser | I mean I dear to say that many pom files are more complex and hard to write then the code they compile - especially in clojure land |
| 07:32 | Licenser | cemerick: it has simple basics |
| 07:39 | cemerick | Licenser: We'll have to agree to disagree. I've exceeded my quota of beating the dead build horse for the day. FWIW, my bottom line re: maven v. lein/cake is here: http://groups.google.com/group/projectclj---spec/msg/ff9439428484059b |
| 07:45 | bozhidar | hi, guys |
| 07:45 | bozhidar | anyone here running stock SLIME + clojure? |
| 07:46 | bozhidar | recently I've been hacking some Common Lisp and I had to go back to the stock SLIME instead of the clojure compatible in ELPA |
| 07:46 | bozhidar | so I was wondering what are my options now |
| 07:47 | bozhidar | I tried connecting to a swank-clojure server started from lein |
| 07:47 | bozhidar | the repl opened |
| 07:47 | bozhidar | but nothing would be evaluated in it |
| 07:47 | bozhidar | there was nothing significant in the inferior lisp buffer as well |
| 07:59 | mrBliss | bozhidar: I've experienced the same. I'm using slime-20100404.1 from technomancy's elpa repo. I pulled in the rest of slime of the same CVS revision (the same day at least), hoping it wouldn't break. I didn't touch the original files from technomancy. Clojure works perfectly and CLISP as well. The only problem I've noticed: closing CLISP sldb buffers produces an error, but you can just ignore it and press enter again. |
| 08:00 | bozhidar | mrBliss: I dream of upstream Clojure support in SLIME someday... |
| 08:00 | mrBliss | bozhidar: me too :-) |
| 08:01 | mrBliss | bozhidar: or a non-stripped down version of SLIME in technomancy's elpa repo. |
| 08:01 | bozhidar | well, he mentions in the docs |
| 08:01 | bozhidar | that his slime should work with Common Lisp |
| 08:02 | bozhidar | but it doesn't(at least for me) and that's what's causing my grief |
| 08:02 | bozhidar | but you're right, a fully fledged SLIME would be a welcome resolution to the problem |
| 08:03 | bozhidar | what environment are you using cemerick? |
| 08:03 | mrBliss | The thing I hate about SLIME is the font on the homepage (Curse you Comic Sans MS!) ;-) |
| 08:04 | cemerick | bozhidar: I use Eclipse and ccw, but I wouldn't bother trying to convert emacs users; my point is, a purpose-build emacs environment for Clojure would seem to be an obvious step, yet no one's taken it. |
| 08:06 | cemerick | SLIME (AFAIK) is weighed down by a ton of stuff that's legacy to CL, knows nothing about the JVM, and apparently breaks on HEAD regularly vs. swank-clojure. Seems less than ideal. *shrug* |
| 08:06 | bozhidar | cemerick: you're absolutely correct. As far as I know the problem is that the implementation of such supports require vast knowledge of both SLIME & Common Lisp |
| 08:06 | cemerick | But then, I'm the last person that should be advising emacs users on what they should do. ;-) |
| 08:07 | bozhidar | cemerick: I'm a progressive Emacs user and I understand and accept its problems |
| 08:07 | jweiss | if i just want to create a class with some methods (and I won't be creating any instances from clojure, just creating the class to be consumed by a java tool), can i use reify? i don't have any interfaces to implement |
| 08:09 | cemerick | jweiss: reify generates an instance of an anonymous class. |
| 08:09 | cemerick | Your use case would require gen-class. |
| 08:09 | bozhidar | cemerick: Emacs is less than ideal for many tasks, but I think that Lisp coding is not one of them. If the situation around slime doesn't get resolved however I might move my Clojure coding next to my Java coding - in IntelliJ IDEA |
| 08:10 | jweiss | cemerick: ok that's how i'm doing it now. i thought i might be able to use defrecord or reify, but i don't think it quite fits |
| 08:10 | cemerick | bozhidar: how is La Clojure doing these days, anyway? It was in rough shape last I looked. |
| 08:10 | cemerick | jweiss: You could use definterface and defrecord together… |
| 08:10 | bozhidar | cemerick: there is a new release of the plugin for the upcoming IDEA X |
| 08:11 | bozhidar | I haven't had the time to play with it yet, but I heard some nice comments about it |
| 08:11 | cemerick | I heard it's not functionally different though…just made IDEA X compatible? |
| 08:11 | jweiss | cemerick: yeah, i may try that just because gen-class is awkward. i don't even need the interface but it may be less awkward :) |
| 08:11 | bozhidar | cemerick: the old version didn't even work so I'd call this is a welcome improvement :-) |
| 08:12 | cemerick | ha. |
| 08:12 | cemerick | yikes :-) |
| 08:12 | bozhidar | cemerick: it seems that JetBrains are investing heavily in Groovy & Scala - the support from them rivals the Java support |
| 08:12 | cemerick | Groovy makes sense. Scala seems like a bad bet. |
| 08:13 | cemerick | bozhidar: you should give ccw a shot, if you can bear the pain of eclipse ;-) The latest RC is *very* good, and lpetit is busy making it better even now. |
| 08:13 | bozhidar | cemerick: what makes you think that? most people seem to prefer scala - better performance, FP |
| 08:14 | lpetit | a grave for groovy |
| 08:14 | bozhidar | cemerick: I might check it out. I used to use Eclipse a lot before I found IntelliJ and don't have anything against in particular(except for the terrible plugin updates) |
| 08:14 | cemerick | bozhidar: Groovy has a *huge* community, far larger than either scala or Clojure. And, assuming Oracle doesn't drop the ball on Java 7 and 8, I don't think scala will see much "mainstream" adoption. *shrug* |
| 08:15 | lpetit | cemerick: java has a *huge* community :p |
| 08:16 | cemerick | lpetit: point taken, I was speaking in relative terms. Groovy has a decent sized community. Better? ;-) |
| 08:16 | cemerick | 'course, we'd then have to characterize the Scala and Clojure communities as diminutive, which is rhetorically unfortunate. |
| 08:17 | lpetit | yes, to me groovy filled a hole. And now "it's there". But really I don't like groovy. Even groovy's creator said he would not have written groovy if scala had been 4 years older. |
| 08:17 | bozhidar | cemerick: sadly, in my country(Bulgaria), none of those languages has any community |
| 08:17 | bozhidar | I judge about something' |
| 08:18 | bozhidar | s popularity by google trends, stackoverflow questions and the amount of books being published |
| 08:18 | cemerick | lpetit: I saw that, and I don't understand it at all -- groovy as the dynamic counterpart to Java isn't replaced in any way by scala. |
| 08:19 | bozhidar | scala feels like a dynamic language although it's not |
| 08:19 | fogus` | cemerick: It depends on the original motivation for creating Groovy. |
| 08:20 | bozhidar | and it has nice support for parallel programs, which Groovy lacks |
| 08:20 | lpetit | cemerick: to be really honest, programs which start with weak static typing compilation checks do this half by religion, half by ease of implementation ! |
| 08:21 | cemerick | fogus`: yeah, perhaps he had a particular use case that is now better served by scala. On spec though, the languages couldn't be less alike. |
| 08:21 | lpetit | fogus: indeed, thus my point on not doing compile time type check and saying it's a feature where it's a resource dedication choice |
| 08:22 | lpetit | s/where/when/ |
| 08:22 | sexpbot | <lpetit> fogus: indeed, thus my point on not doing compile time type check and saying it's a feature when it's a resource dedication choice |
| 08:22 | fogus` | If I hadn't discovered Clojure the world would have had to content with yet another poorly implemented Scheme. :p |
| 08:22 | fogus` | s/content/contend/ |
| 08:22 | sexpbot | <fogus> If I hadn't discovered Clojure the world would have had to contend with yet another poorly implemented Scheme. :p |
| 08:23 | bozhidar | haha, good one fogus` :-) |
| 08:23 | dnolen | lpetit: it's not just a resource dedication choice. Static typing guarantees are still so weak. You build a complex system that can catch only a small portion of programmer error. |
| 08:24 | cemerick | fogus`: no need to stop now; it's not like yet another poorly implemented scheme will hurt anything. ;-) |
| 08:24 | lpetit | dnolen: I'd call that "throwing the baby with the bath water" :) |
| 08:24 | fogus` | cemerick: ;-) |
| 08:24 | dnolen | lpetit: no, it's like ubiquitous laziness, it's a great idea generator. but it's a also a big pain in the butt. |
| 08:24 | lpetit | At least the Qi language has proven that this could be done. |
| 08:26 | dnolen | lpetit: yes Qi's approach is great. But with Qi III just around the corner, that's 10 years of work. resource dedication has to be considered in that time frame. |
| 08:26 | lpetit | dnolen: I would really see nothing wrong with an optional type check system "a la Qi" on clojure. And Rich seems to agree with this. |
| 08:27 | lpetit | dnolen: Exactly. It's more resource dedication than anything else. It's too easy to claim it's a feature not to have it. |
| 08:28 | dnolen | lpetit: totally. but it's not a feature worth having if not done right. |
| 08:28 | dnolen | I find Odersky's complaints on how Scala's popularity basically froze the language telling in that regard. |
| 08:29 | dnolen | s/complaints/comments |
| 08:29 | sexpbot | <dnolen> I find Odersky's comments on how Scala's popularity basically froze the language telling in that regard. |
| 08:29 | cemerick | lpetit: does he really agree? I thought his last comment was in the neighborhood of "if someone wants to implement it and use it, they're free to do so"… |
| 08:29 | fogus` | cemerick: That was my "reading" as well |
| 08:29 | lpetit | dnolen: granted. And I really appreciate Rich having the intelligence to say that, cause then clojure is not slowed down by a poor implementation. |
| 08:31 | dnolen | Alan Kay's points about "style" vs. "accretion" languages is also appropriate. Lisp usually gives you an escape hatch and and more opportunities to change your mind. |
| 08:31 | cemerick | dnolen: well, Scala needed some freezing. fogus`'s tweets notwithstanding, I struggle to truly understand scala code, even if I can bang it out mostly blindly. |
| 08:31 | cemerick | That needed a ;-) |
| 08:32 | lpetit | cemerick: I remember him telling that he would find it interesting to do something like in Qi. But there are a lot of pre-requisite work, which have not been done yet. He (wisely) wanted to be able to build this on top of a more general rule inference system. |
| 08:32 | cemerick | I must not have been around for that. |
| 08:33 | kotarak | I recently listened to two introductory talks to Scala. And I was quite disappointed of what kind of hoops you have to hop through. And how the underlying warts and bolts shine through... :/ |
| 08:33 | fogus` | lpetit: ... with Datalog at its base |
| 08:33 | cemerick | fogus`: I was going to say, a decent unification library would make a lot of sense… |
| 08:33 | lpetit | fogus: yes, it's "Datalog" I couldn't make out of my fingers. |
| 08:35 | esj | yes please ;) |
| 08:35 | lpetit | cemerick: there http://groups.google.com/group/clojure/browse_thread/thread/6f8bf865f4afbb6f/5d8366b79d80edc0?lnk=gst&q=datalog+static+typing#5d8366b79d80edc0 |
| 08:36 | lpetit | fogus: I'm really a noob wrt these inference engines. For example (without tongue in a cheeke pliz ;) ), are clojure.unify and mini-kanren and alike (logos it is ?) competitors ? |
| 08:37 | cemerick | ah, I do seem to remember that…from before I gave up on reading the clojure ML |
| 08:38 | dnolen | lpetit: Logos is me mostly me studying Prolog and Prolog literature in Clojure, w/ an interest in seeing how well a Clojure Prolog engine could perform. |
| 08:39 | dnolen | miniKanren is basically a purely functional take on Warren's Abstract Machine, a good thing to try with Clojure. |
| 08:39 | fogus` | lpetit: The core.unify lib only solves a very narrow problem that is orthogonal to inference. |
| 08:40 | dnolen | I think a sufficiently performant Datalog in Clojure will need to use ROBDDs. Lots 'o work. |
| 08:41 | lpetit | ROBDDs being ... ? |
| 08:41 | dnolen | Reduced Ordered Binary Decision Lists |
| 08:41 | lpetit | ok, it's definitely not my field of expertise :-p |
| 08:41 | fogus` | lpetit: David has taken a slightly different route to unification than me, but I don't see it as competition. Hopefully there will be cross-pollination |
| 08:41 | dnolen | http://bddbddb.sourceforge.net/ |
| 08:41 | lpetit | thanks for the info! |
| 08:42 | lpetit | must leave, cu |
| 08:42 | esj | bddbddb ! |
| 08:42 | esj | its like caadddr :) |
| 08:44 | fogus` | lpetit: take care |
| 08:45 | esj | thing they could have thrown some "p"s in there to give the dyslexics more to cheer about |
| 08:46 | dnolen | fogus`: totally, I added my unifier to see what it would take to add one that worked like yours. |
| 08:55 | bozhidar | cemerick: IDEA's La Clojure doesn't look that good even now - starting a new REPL generates a NPE :-) |
| 08:55 | cemerick | yikes! |
| 08:55 | cemerick | bozhidar: that's even worse than before IIRC |
| 08:56 | bozhidar | it's still RC so they fix something before the final release but I seriously doubt it |
| 08:56 | bozhidar | La Clojure doesn't support Clojure 1.2.0 as well |
| 08:56 | bozhidar | only 1.0 and 1.1 |
| 08:56 | cemerick | Might be time to stick a fork in that one. :-( |
| 08:56 | bozhidar | it seems that trying ccw might be a good idea :-) |
| 08:57 | cemerick | bozhidar: Definitely go for the RC. It has much-improved REPL support. |
| 08:57 | cemerick | I think we'll probably do one or two more RC's before putting out an 0.2.0 release. |
| 08:58 | bozhidar | ok, I'll certainly try the RC |
| 09:01 | bozhidar | btw as we spoke JetBrains officially unveiled IntelliJ X :-) |
| 09:07 | cemerick | bozhidar: whoa, they list Clojure as a "supported language". That's some unfortunate marketing B.S. |
| 09:09 | bartj | &(clojure.set #{2} '(2 3)) |
| 09:09 | sexpbot | java.lang.ClassNotFoundException: clojure.set |
| 09:10 | bozhidar | cemerick: the small community is the greatest IntelliJ weakness. There is almost nothing developed outside of JetBrains and the end result is to be expected...I think the same 5 or so guys develop the plugins for most of the lesser known langs and I really doubt that they are experts in all of them |
| 09:10 | bartj | the above expression does not warn saying (2 3) is not a set |
| 09:10 | bartj | and it returns a #{} |
| 09:11 | cemerick | bozhidar: The published screenshots show them browsing around enclojure's codebase, too. That's just bad form. :-( |
| 09:11 | cemerick | e.g. http://plugins.intellij.net/preview/popup/?sid=2625&pid=4050 |
| 09:13 | bozhidar | cemerick: this is disturbing indeed, I haven't noticed it before |
| 09:13 | chouser | weird |
| 09:22 | bartj | chouser, were you replying to my question/comment above? |
| 09:24 | chouser | bartj: no, that's just undefined behavior when you give a funtion undocumented input. :-) |
| 09:24 | chouser | "weird" was for a product screenshot to include code from a competing product |
| 09:25 | chouser | oh no, I created another race condition. Grrr |
| 09:25 | bartj | chouser, would that be classified as a bug? |
| 09:27 | chouser | bartj: probably not. well, maybe a bug in the code that's calling a clojure.set function with a non-set argument |
| 09:34 | bartj | chouser, ok, thanks |
| 09:53 | jcromartie | what's up with clj-stacktrace? the example in the readme doesn't print a stacktrace http://github.com/mmcgrana/clj-stacktrace |
| 09:56 | jcromartie | never mind, I'm way out of date |
| 09:58 | jcromartie | was using 0.1.0 |
| 09:58 | jcromartie | never mind, 0.2.0 doesn't do anything either |
| 09:59 | dnolen | jcromartie: are you using Clojure 1.2.0? IMO, Clojure 1.3.0 stacktraces outdo clj-stacktrace. |
| 10:00 | jcromartie | I'm using the released Clojure 1.2 |
| 10:00 | jcromartie | 1.2.0 |
| 10:01 | dnolen | jcromartie: hmm, I never had any issues w/ clj-stacktrace and 1.2.0, but I mostly used it in the context of Ring. |
| 10:02 | jcromartie | It just doesn't seem to do anything on exceptions in the repl |
| 10:07 | jcromartie | should I be using clj-stacktrace 0.1.0 or 0.2.0? |
| 10:08 | fogus` | ,``````````x |
| 10:08 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.StackOverflowError> |
| 10:08 | jcromartie | is there perhaps some extra step I'm missing, or maybe it doesn't work with lein repl? |
| 10:09 | cemerick | kotarak: FYI: https://groups.google.com/group/clojure-clutch?hl=en |
| 10:09 | kotarak | cemerick: thanks :) Clojure and Couch feel like a good team. :) |
| 10:09 | cemerick | Indeed they are. :-) |
| 10:10 | jcromartie | compare https://gist.github.com/734802 to https://github.com/mmcgrana/clj-stacktrace/blob/master/README.md |
| 10:11 | jcromartie | wow ok |
| 10:11 | jcromartie | you know what's COMPLETELY missing from the clj-stacktrace readme? |
| 10:11 | jcromartie | that you have to use (pst) to print stack traces |
| 10:12 | tonyl | jcromartie: it seems like clj-stacktrace is not being loaded in the class path |
| 10:12 | tonyl | wait, scratch that |
| 10:12 | tonyl | then use would've send an error |
| 10:13 | jcromartie | readme says "For example, to print a nice stack trace in a REPL:" but is missing a rather important bit (the part with what you have to do to actually print the stack trace) |
| 10:14 | tonyl | I would contact the author about it. |
| 10:22 | fliebel | kotarak: I missed the conversation about Couch. What are you doing? |
| 10:22 | kotarak | fliebel: there was not really a discussion about couch. I use it to back me homepage rewrite. |
| 10:23 | jcromartie | I've thought about using couch |
| 10:23 | fliebel | kotarak: Are you using Clutch or Clojure-CouchDB? (And what is the homepage?) |
| 10:23 | jcromartie | being able to just stick Clojure hash-maps in a document store seems too good to be true though |
| 10:24 | jcromartie | I wonder how it would scale for a business app |
| 10:25 | fliebel | I wonder how those CouchDB libs deal with failed updates. |
| 10:25 | kotarak | fliebel: clutch. http://kotka.de/blog. The blog is done by blosxom (an ancient perl script). The static part is terribly out-of-date, because I broke my mason scripts (also perl). I'm about a re-design with a new build system in the background using clojure and couch. |
| 10:26 | kotarak | fliebel: they will probably tell you? |
| 10:26 | fliebel | For example, I get 2 copies of the same document, update them, and insert the updates one after another. After the first update, the _rev is changed, and the second update will fail. |
| 10:27 | fliebel | So unless there is magic in there, it looks painful in a real app where Couch gets hammered a bit. |
| 10:29 | kotarak | fliebel: this is what clutch tells you: #<CompilerException java.io.IOException: CouchDB Response Error: 409 Conflict (REPL:4)> |
| 10:30 | fliebel | kotarak: I thought it would be nice to implement the atom interface on top of Couch, but I can't, because there isn't one. |
| 10:31 | kotarak | fliebel: I know. And even if it were there, I'm not sure it would be a good idea. However I showed how you do it locally for your projects (or anyone who wants to use the modified API). |
| 10:31 | kotarak | fliebel: I would be highly suspicious of any automatic merging going on there.... |
| 10:32 | fliebel | kotarak: No merging! Just getting the new version and applying the fn until it works. Just like the regular Atom spin loop. |
| 10:33 | kotarak | fliebel: yeah exactly. The merging. Someone changes a key :a to value :b and another one to :c. The :c guy is faster (and more correct because :b is already out-of-date). Now the :b guy retries and overwrites with a wrong value. No. I don't like that. |
| 10:33 | kotarak | At least not for the systems I work with. |
| 10:34 | kotarak | If everything is purely based on computations, then the situation might be different. |
| 10:34 | fliebel | kotarak: So how would you handle the issue if Couch told you the update failed? |
| 10:35 | kzar` | I'm just reading about multimethods, haven't tried them yet but they look cool. One thing I wasn't sure about, when you use stuff like (derive doesn't that change some global variable somewhere? Does it end up working OK? |
| 10:35 | kotarak | fliebel: the :b guy (which is a guy in front of computer) would go "huh?", read ":c", understand what happened (or get that understanding from a colleague) and skip his try to write :b somewhere |
| 10:36 | kotarak | kzar`: it does end up OK, because you have to use ::qualified-keywords. |
| 10:37 | kzar` | kotarak: How come using qualified keywords makes it OK? (Sorry I'm probably being dumb here) |
| 10:37 | kotarak | kzar`: because your derivations don't interfer with others. But you can just as well use a custom hierarchy with defmulti. |
| 10:37 | fliebel | kotarak: But you're assuming you just change the value regardless of that's in it, in which case you'd use reset! If you do (swap! doc inc) You'll want to have both executed, regardless of the order. |
| 10:38 | kotarak | fliebel: I don't need that up to now. But maybe my systems are just weird. |
| 10:39 | kotarak | and the user base small... |
| 10:39 | kotarak | and the data volume miniscule.... |
| 10:39 | kotarak | etc. |
| 10:39 | fliebel | kotarak: But your case would still work as expected with reset!, right? |
| 10:39 | kzar` | kotarak: OK thanks I think I getya |
| 10:40 | kotarak | fliebel: no. Because afterwards there is a :b, where there should be a :c. The point is, that the computer cannot decide about :b or :c. You need human intervention. (In my case. Incrementing a counter is something different) |
| 10:42 | jweiss | & (#({:k :v})) |
| 10:42 | sexpbot | java.lang.IllegalArgumentException: Wrong number of args (0) passed to: PersistentArrayMap |
| 10:42 | jweiss | i'm a little baffled by the syntax here, how come it doesn't just return the map |
| 10:43 | kzar` | jweiss: I think you're trying to call the map as a function but with no arguments |
| 10:43 | kzar` | ,{:a 1 :b 2} |
| 10:43 | clojurebot | {:a 1, :b 2} |
| 10:43 | jweiss | kzar`: i thought i was creating a fucntion that returns a map, and calling the function. |
| 10:43 | kotarak | jweiss: #(foo) is (fn [] (foo)) |
| 10:44 | tonyl | ((fn [] {:k :v})) |
| 10:44 | tonyl | &((fn [] {:k :v})) |
| 10:44 | sexpbot | ⟹ {:k :v} |
| 10:44 | kotarak | ,(#(hash-map :k :v)) |
| 10:44 | clojurebot | {:k :v} |
| 10:44 | jweiss | ah so i can't use the literal |
| 10:44 | jweiss | ok thanks |
| 10:44 | fliebel | kotarak: So you define the 'correct' order by the order people get the value, rather than by the order in which they update it? |
| 10:45 | kzar` | jweiss: Could you do it like this ,(#(map [:k :v])) ? |
| 10:45 | kzar` | ,(#(map [:k :v])) |
| 10:45 | kzar` | ,(#(hash-map [:k :v])) |
| 10:45 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$map |
| 10:45 | clojurebot | java.lang.IllegalArgumentException: No value supplied for key: [:k :v] |
| 10:46 | kzar` | ,(#(hash-map :k :v)) |
| 10:46 | clojurebot | {:k :v} |
| 10:46 | tonyl | &(#(apply hash-map [:k :v])) |
| 10:46 | sexpbot | ⟹ {:k :v} |
| 10:46 | kotarak | fliebel: No. I define "correct" by the content. If two people edit the same entry at the same time, those two people have to figure out, whether everything is ok on conflict. Not the machine. |
| 10:48 | kotarak | fliebel: Because the machine can't know whether really 500 or 700 units are blocked in production somewhere at the other end of the world. |
| 10:48 | kotarak | fliebel: But the people working with the data know it. |
| 10:51 | fliebel | kotarak: … Okay, I'll give the issue some more thought. |
| 10:57 | fliebel | kotarak: I think in your case you could still use compare-and-set! to resolve the conflict case yourself. |
| 11:15 | Islon | does anyone knows how to add a maven repository to cake? |
| 11:19 | Raynes | In your project.clj: :repositories [["nameofrepo" "linktorepo"]] |
| 11:19 | Raynes | Should do the trick. |
| 11:23 | Islon | thanks Raynes =) |
| 11:55 | fliebel | kotarak: I'm trying the protocol thing now, but it doesn't work: java.lang.IllegalArgumentException: No single method: swap_BANG_ of interface: iatom.IAtom found for function: swap! of protocol: IAtom |
| 11:56 | fliebel | Okay, I'm messing up arguments... |
| 12:03 | Islon | how do I take elements from a seq 2 by 2? |
| 12:03 | tonyl | try partition |
| 12:04 | tonyl | partition-all too |
| 12:04 | Islon | exactly what I want! |
| 12:04 | Islon | i always forgot function names >< |
| 12:05 | tonyl | me too, there are a lot of function names |
| 12:06 | Islon | i know what the function does but not the name |
| 12:09 | tonyl | &(count (remove fn? (vals (ns-publics 'clojure.core)))) |
| 12:09 | sexpbot | java.lang.SecurityException: You tripped the alarm! ns-publics is bad! |
| 12:09 | tonyl | ,(count (remove fn? (vals (ns-publics 'clojure.core)))) |
| 12:09 | clojurebot | 546 |
| 12:09 | Islon | i should use more clojuredocs too |
| 12:10 | tonyl | that is not counting macros |
| 12:10 | tonyl | yeah that helps me |
| 12:10 | tonyl | ,(count (remove #(:macro (meta (var %1))) (vals (ns-publics 'clojure.core)))) |
| 12:10 | clojurebot | java.lang.Exception: Unable to resolve var: p1__571# in this context |
| 12:11 | tonyl | I am getting this error |
| 12:11 | tonyl | i don't know why |
| 12:12 | tonyl | ,(count (filter #(:macro (meta %1)) (vals (ns-publics 'clojure.core)))) |
| 12:12 | clojurebot | 71 |
| 12:12 | tonyl | weird |
| 12:17 | amalloy | tonyl: %1 can be shortened to %, and #(:macro (meta %)) can be written as (comp macro meta) |
| 12:17 | amalloy | er, :macro |
| 12:17 | tonyl | that is true, I need to use comp more, god knows my code needs it in some parts |
| 12:18 | tonyl | but i thought meta needed a var |
| 12:18 | tonyl | not a symbol |
| 12:18 | tonyl | oh wait ns-publics vals are vars |
| 12:18 | tonyl | :P |
| 12:18 | amalloy | right you are |
| 12:26 | fliebel | Okay, I'm still messed up with the methods of my protocol. :( |
| 12:27 | fliebel | This is what I have: https://gist.github.com/735020 |
| 12:28 | fliebel | works: (swap! (atom 1) + 1) fails: (swap! (atom 1) inc) |
| 12:29 | amalloy | fliebel: "fails" is not very specific |
| 12:29 | clojurebot | You don't have to tell me twice. |
| 12:29 | Chousuke | fliebel: protocol fns don't support varargs |
| 12:29 | amalloy | lol. good work clojurebot |
| 12:29 | fliebel | java.lang.IllegalArgumentException: No single method: swap_BANG_ of interface: iatom.IAtom found for function: swap! of protocol: IAtom |
| 12:30 | Chousuke | fliebel: so you're in fact binding three parameters, f, & and args |
| 12:30 | fliebel | Chousuke: That doesn't make sense, I think… The one without varargs is the one that fails, right? |
| 12:32 | fliebel | And what about reset! and compare-and-set! they don't use varargs either, but they don't work as well. |
| 12:32 | Chousuke | hm wait |
| 12:33 | Chousuke | don't you need to add "this" to the protocol declarations too? |
| 12:33 | fliebel | I don't know… Might try... |
| 12:33 | Chousuke | would explain why (swap a + 1) works since it takes three args. (that get bound to f & args) |
| 12:34 | fliebel | Now everything I do gives me the error. |
| 12:37 | amalloy | fliebel: that's progress! (probably) |
| 12:38 | fliebel | one moment... |
| 12:42 | fliebel | Right, now that I have everyting sorted out, it comes down to the vararg problem. |
| 12:43 | fliebel | But java.lang.Atom must also take varargs in some way, right? |
| 12:43 | amalloy | fliebel: clojure.lang.Atom |
| 12:43 | fliebel | right... |
| 12:44 | hiredman | you can trivially turn a vararg into a fixed arg |
| 12:45 | fliebel | swap(IFn f, Object x, Object y, ISeq args) |
| 12:45 | hiredman | protocols are best as implementation contracts, not usage |
| 12:46 | hiredman | so you have a lower bound of what is needed, which is described by a protocol, with a library of functions built on top of it |
| 12:46 | fliebel | sorry, diner is ready. |
| 12:56 | Licenser | aloa |
| 12:57 | amalloy | hiredman: ah, i see what you mean. so his Atom protocol only needs (atomic-swap f args), and then he builds a library on top of that to supply swap!, reset!, etc, for everything that extends the Atom protocol? |
| 13:02 | hiredman | really it only needs to take a function since you can pass it something like #(apply f % args) |
| 13:03 | amalloy | better still |
| 13:04 | amalloy | i'm starting to feel like i might understand how protocols are different from interfaces now |
| 13:18 | fliebel | I hope this makes somewhat sense? I works at least… https://gist.github.com/735020 |
| 13:21 | amalloy | fliebel: did you read what hiredman and i discussed while you were at dinner? |
| 13:23 | amalloy | that is, IAtom would be best written as a protocol with just one function, named something like atomic-swap or swap*, and then you build up a library of functions that use that to implement varargs, reset!, etc, on top of that function |
| 13:24 | fliebel | amalloy: So I would just be doing ava.util.concurrent.atomic.AtomicReference |
| 13:27 | amalloy | no, you'd be defining an interface/protocol for things that are like AtomicReferences |
| 13:27 | fliebel | But it does make sense... |
| 13:27 | amalloy | then you build a library that deals with such things, and extend your protocol to AtomicReference, c.l.Atom... |
| 13:28 | fliebel | right, makes sense. |
| 13:29 | fliebel | But then I do have to implement Atom I think... |
| 13:30 | amalloy | um, what? |
| 13:31 | fliebel | If I have compare-and-set! defined in the interface, I can't simply map swap! to clojure.core.swap! |
| 13:34 | amalloy | (defn aref-swap! [ar f & args] (compare-and-set! ar #(apply f % args))) |
| 13:34 | amalloy | is not a complicated implementation |
| 13:36 | fliebel | amalloy: But that is not a proper swap!, swap! loops until compare-and-set! succeeds. But anyway, I need to implement a abstract swap! and reset! and do the interface for compare-and-set! |
| 13:38 | fliebel | And there is still validate and notifyWatches to consider. Both are in ARef, which I don't fancy implementing. |
| 13:39 | amalloy | so make swap! your primitive, if you prefer. is there a reason you need access to compare-and-set? |
| 13:39 | fliebel | Yea, because it's part of what Atom does, and part of what I want. As kotarak outlined, swap! is not the solution to everything. |
| 13:47 | fliebel | amalloy: Any idea how to best get hold of the methods in ARef? |
| 13:49 | amalloy | fraid not. i don't think i understand the question, but that's all right cause i can't think of a meaning for the question where i'd know the answer :) |
| 13:50 | fliebel | amalloy: I think I'll have to implement IRef and do it myself. Atom extends ARef, which contains methods to implement watcher and validator functions. |
| 14:10 | amalloy | fogus`: did you see what he did yesterday to poor tree-seq? i'm thinking chaotic good |
| 14:11 | technomancy | I'm just gonna leave this here: http://www.piratejesus.com/nerdcore/005.html |
| 14:12 | Raynes | technomancy: I'm just going to pick it up and walk off with it. |
| 14:15 | fliebel | Is there a reason why swap calls validate and notifyWatches as well? Because it calls compareAndSet which does both already. |
| 14:34 | brehaut | has anyone got a good intro/best practise for the clojure.test stuff? |
| 14:34 | auser | yes, i would like that too |
| 14:34 | brehaut | im currently fumbling round in the dark writing the worst tests in the world |
| 14:42 | KirinDave | Hum |
| 14:42 | KirinDave | I have a var containing a reference to a class. |
| 14:42 | KirinDave | How do I construct a new instance of the class referred to in that var? |
| 14:43 | KirinDave | Is it just reflection stuff? |
| 14:43 | hiredman | yes |
| 14:44 | Chousuke | an actual var object or just a global def? |
| 14:44 | amalloy | ,(.newInstance java.util.Date) |
| 14:44 | clojurebot | #<Date Thu Dec 09 11:44:52 PST 2010> |
| 14:44 | KirinDave | Shucks, was hoping there was a clojurism. |
| 14:44 | hiredman | amalloy: not all classes support that |
| 14:44 | KirinDave | Chousuke: Actual var. |
| 14:44 | Chousuke | then you need to deref the var first I guess |
| 14:44 | cemerick | KirinDave: check out clojure.lang.Reflector for handy utility methods. |
| 14:44 | amalloy | hiredman: well, depends what you mean. they all support newInstance, but they don't all have a no-arg ctor |
| 14:45 | hiredman | which is what I mean |
| 14:45 | KirinDave | It'd be an error if they didn't have a no-arg ctor. |
| 15:04 | fliebel | How do I run java with the cake cp? |
| 15:07 | jjido | Can someone help me with TWAIN-SANE? I installed all the packages, I have the preferences pane but no SANE button in Image Capture |
| 15:08 | stuartsierra | jjido: I think you've got the wrong channel. |
| 15:08 | Raynes | I think you've got the wrong universe. |
| 15:08 | jjido | stuartsierra: well observed. |
| 15:09 | jjido | Raynes: what is yours? |
| 15:12 | ninjudd | fliebel: what do you mean by that? |
| 15:18 | fliebel | ninjudd: I need to do something like java -jar -cp some:jars:in:my:project some.class, but doing so manually is painful and unsafe, because I use some snapshots in deps. |
| 15:18 | ninjudd | fliebel: just build an uberjar |
| 15:18 | ninjudd | or you can use 'cake bin' to create a standalone executable |
| 15:19 | fliebel | Fair point… So I just do java -jar my-project.jar some.class |
| 15:20 | ninjudd | fliebel: if you want to use -jar, you need a main class |
| 15:20 | ninjudd | just add ':main namespace' to your project.clj |
| 15:20 | ninjudd | and add a -main function to that namespace |
| 15:20 | fliebel | ninjudd: some.class needs it right? Not my core ns. |
| 15:21 | ninjudd | your main function can be in any namespace you want, but you can only have one per project |
| 15:21 | bytecolor | import choco.Choco; => (ns choco-tut (:import (choco Choco))) ; is this a correct translation from Java to clojure? |
| 15:22 | chouser | so, what's the state of the art for maven/lazy-test integration? |
| 15:22 | tonyl | bytecolor: it looks like a good import to me |
| 15:22 | chouser | stuartsierra: oh, hi |
| 15:23 | technomancy | bytecolor: should be choco.bo; kupo! |
| 15:23 | technomancy | (not really) |
| 15:23 | dmart__ | chocobo.. wasn't that a bird in some video game? |
| 15:24 | tonyl | sounds like an incantation lol |
| 15:24 | stuartsierra | chouser: hi. |
| 15:25 | stuartsierra | Lazytest has a Maven plugin of its own now. |
| 15:25 | chouser | ah, I see it. |
| 15:25 | bytecolor | I'm trying to access a method of Choco: (.makeIntVar Choco "foo" 0 3) ; IllegalArgumentException No matching method found: makeIntVar for class java.lang.Class clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:50) |
| 15:25 | chouser | 1.0.1-SNAPSHOT |
| 15:25 | stuartsierra | yse |
| 15:25 | stuartsierra | yes |
| 15:25 | stuartsierra | 1.0.0 release will also work |
| 15:26 | stuartsierra | There's no direct dependency between the plugin and the library version. |
| 15:27 | nickik | stuartsierra, could you tell what the stat on the clojure conj videos is? |
| 15:27 | chouser | stuartsierra: should I mention the test goal in the plugin config? |
| 15:27 | tonyl | bytecolor: have you try separating the ns and import statement? |
| 15:27 | stuartsierra | chouser: test is a phase, not a goal, and yes |
| 15:28 | bytecolor | tonyl: hrm, no |
| 15:28 | tonyl | like (ns choco-tut) (import '(choco Choco)) (.makeIntVar Choco "foo" 0 3) |
| 15:29 | stuartsierra | chouser: the sample-maven-project module shows you how to set it up. |
| 15:29 | tonyl | if makeIntVar is static you can use (Choco/makeIntVar "foo" 0 3) to |
| 15:29 | chouser | stuartsierra: ah, thanks. |
| 15:29 | mduerksen | i'm just wondering: does anyone use a infix macro? i built mine because some math forms are really more readable, but interestingly i don't use a often as i thought i would at the beginning. i'm quite new to lisp, is it the case that after some time, one can read prefix-math just as well? |
| 15:30 | stuartsierra | chouser: So are you actually using lazytest? |
| 15:30 | chouser | stuartsierra: about to |
| 15:30 | stuartsierra | cool |
| 15:30 | chouser | stuartsierra: should I not? |
| 15:30 | tonyl | bytecolor: if not, it seems like a reflection problem |
| 15:30 | bytecolor | I don't know if it's static or not, there is not instance of Choco. I'm using my C++ understanding of 'static' here. I'm Java stupid. |
| 15:30 | stuartsierra | chouser: no, just curious, haven't heard from many people |
| 15:30 | chouser | we've got new code, and need unit tests. I'd hate to use clojure.test since it's creator has abandoned it. :-) |
| 15:31 | chouser | hm, we're not on clojure 1.3 yet. might be a problem. |
| 15:31 | bytecolor | tonyl: same error if I separate the two |
| 15:31 | raek | mduerksen: incanter (a statistics lib) provides an infix macro, as people seems to prefer the usual notation for mathematic expressions |
| 15:31 | chouser | mainly ring's fault. |
| 15:32 | tonyl | bytecolor: it seems like a reflection problem, based on that error |
| 15:32 | tonyl | from the arguments that makeIntVar needs |
| 15:32 | chouser | mduerksen: that experience is common, I believe. by the time one knows lisp well enough to write an infix macro, one has already begun to find it less attractive. |
| 15:32 | bytecolor | tonyl: is that something *I* can work around? |
| 15:32 | tonyl | sure |
| 15:32 | tonyl | what is the signature of that makeIntVar method? |
| 15:32 | chouser | mduerksen: http://www.fogus.me/fun/unfix/ |
| 15:32 | clojurebot | #<RuntimeException java.lang.RuntimeException: java.lang.Exception: 503> |
| 15:32 | bytecolor | tonyl: you mean the way in which the args are overloaded? |
| 15:33 | tonyl | yeah |
| 15:33 | bytecolor | ah |
| 15:33 | bytecolor | tonyl: three overloaded methods, second var differs, int, List<Integer>, int[] |
| 15:34 | bytecolor | second argument, that is |
| 15:34 | tonyl | so the second argumend can accept int or a list of ints or an array |
| 15:35 | bytecolor | yes |
| 15:35 | tonyl | the thing is that clojure's ints are javas Integers |
| 15:35 | tonyl | or in ver 1.3 would be Longs |
| 15:36 | bytecolor | I'm using 1.3 |
| 15:36 | tonyl | ok so they are Longs I believe |
| 15:36 | mduerksen | raek, chouser: thank you. i think i will use infix occasionally, when it comes to bigger and more nested math. |
| 15:36 | tonyl | you need to convert them to primative int |
| 15:37 | bytecolor | ah, with a simple cast? |
| 15:37 | tonyl | or typehint them |
| 15:38 | tonyl | like ^int val, ^int val2 |
| 15:38 | bytecolor | and yes, I'm clojure stupid as well ;) But I will learn clojure! |
| 15:38 | bytecolor | ok |
| 15:38 | tonyl | It gets interesting when you are mingling with the host too |
| 15:40 | bytecolor | hrm, the call is (.makeIntVar Choco (str "cell" j) 1 (* n n)), so the last two forms would need to be cast to int |
| 15:41 | bytecolor | ^int val, is that the same as adding meta data? |
| 15:41 | bytecolor | or just looks the same |
| 15:41 | amalloy | bytecolor: it is the same |
| 15:41 | tonyl | you add the meta data |
| 15:41 | amalloy | &(meta ^String []) |
| 15:41 | sexpbot | ⟹ nil |
| 15:42 | amalloy | &(let [^String x []] (meta x)) |
| 15:42 | sexpbot | ⟹ nil |
| 15:42 | amalloy | hm |
| 15:42 | raek | &(meta ' ^String []) |
| 15:42 | sexpbot | ⟹ nil |
| 15:42 | amalloy | well, it's there somewhere :P |
| 15:42 | tonyl | &(let [x ^String []] (meta #'x)) |
| 15:42 | sexpbot | java.lang.Exception: Unable to resolve var: x in this context |
| 15:43 | raek | aren't you adding metadata to the code literal rather than the value? |
| 15:43 | tonyl | yeah, but helps with reflection |
| 15:43 | raek | &(meta (with-meta [] {:tag String})) |
| 15:43 | sexpbot | ⟹ {:tag java.lang.String} |
| 15:50 | bytecolor | hrm so I'd have to do: ^int (* 1) |
| 15:51 | bytecolor | meeting time. I'll get back to this in a bit. Thanks for the suggestions. |
| 15:52 | arohner | has anyone used jclouds blobstore successfully? |
| 15:55 | hugod | arohner: I have, and know of several others |
| 15:56 | arohner | hugod: it used to work for me, running an older beta (3? 4?), now beta 6 through 8 are blowing up for me, just doing 'hello world' on s3 |
| 15:56 | arohner | "Caused by: java.lang.NoSuchMethodError: com.google.common.base.Joiner.on(C)Lcom/google/common/base/Joiner;" |
| 15:58 | amalloy | arohner: that's java's linkage error: some class was built against a different jar version than it's being run against |
| 15:59 | arohner | ok. What can I do about it? |
| 16:01 | amalloy | usually i curl up into a ball and cry |
| 16:02 | amalloy | i don't know anything about your app, but you could look and see what jars on your build path and class path have com.google.common packages in them, and see if there are differences |
| 16:03 | hugod | I would agree, sounds like some sort of dependency issue - you might run mvn dependency:tree and see what is using the google libs |
| 16:05 | arohner | amalloy, hugod: thanks. That fixed it |
| 16:05 | arohner | turns out, infer pulls in some google collections |
| 16:08 | bytecolor | (with-meta 1 {:tag int}) => ClassCastException, can't cast Long to IObj. Why is it an IObj and not clojure.lang.Integer? |
| 16:09 | tonyl | the arguments are flipped |
| 16:10 | tonyl | but a sole 1 can't be cast |
| 16:10 | tonyl | i mean type hinted like that |
| 16:11 | amalloy | &(supers IObj) |
| 16:11 | sexpbot | java.lang.Exception: Unable to resolve symbol: IObj in this context |
| 16:11 | amalloy | &(supers clojure.lang.IObj) |
| 16:11 | sexpbot | ⟹ #{clojure.lang.IMeta} |
| 16:11 | amalloy | &(supers Integer) |
| 16:11 | sexpbot | ⟹ #{java.lang.Number java.io.Serializable java.lang.Object java.lang.Comparable} |
| 16:11 | amalloy | bytecolor: ints can't hold metadata |
| 16:11 | chouser | stuartsierra: lazytest:watch is awefully slick |
| 16:11 | bytecolor | ah |
| 16:12 | stuartsierra | chouser: thanks! |
| 16:14 | tonyl | bytecolor you could use (int 1) |
| 16:14 | arohner | bytecolor: when type hinting numbers, the hint goes on the symbol, rather than the object |
| 16:15 | tonyl | scratch my last advice, that won't help reflection on that overloaded method |
| 16:15 | tonyl | you are better of saving the value and type hinted it |
| 16:15 | bytecolor | tonyl: that's what I'm about to try |
| 16:17 | fliebel | Yay, that was easy(er than I expected): atom-style couch updates: https://github.com/pepijndevos/couch-atom |
| 16:21 | amalloy | fliebel: neat. you might want to tone down the warning about regular atoms: they'll only suffer in performance if the caller uses couch-atom.iatom/swap! instead of clojure.core/swap! |
| 16:21 | arohner | grr, now blobstore is claiming that my data already in S3 fails the naming conventions |
| 16:22 | fliebel | amalloy: True... |
| 16:28 | hiredman | arohner: s3 zones are apparently fragmented about allowed names |
| 16:29 | arohner | hiredman: yes, but jclouds is failing when I call (containers) on data that's already in S3 |
| 16:29 | arohner | I call (containers), and then jclouds throws an exception and tells me my input data is invalid |
| 16:30 | hiredman | ah, well, thats jclouds for you |
| 16:30 | arohner | hiredman: yeah. Just one of those days where everything's broken |
| 16:32 | bytecolor | can't type hint a local |
| 16:32 | amalloy | arohner: good news! if ##(+ 2 2) is 4, then at least arithmetic isn't broken...*waits for sexpbot's result* |
| 16:32 | sexpbot | ⟹ 4 |
| 16:32 | tonyl | bytecolor: what do you mean a local? |
| 16:33 | hiredman | we've stopped using jclouds for storage and ended up writing our own api which ended up looking sort of like https://github.com/hiredman/cellar (surprise surprise) |
| 16:33 | amalloy | &(let [^String x 10] (.length x)) |
| 16:33 | sexpbot | java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String |
| 16:33 | amalloy | &(let [x 10] (.length x)) |
| 16:33 | sexpbot | java.lang.IllegalArgumentException: No matching field found: length for class java.lang.Integer |
| 16:34 | bytecolor | tonyl: well I was trying to store the literal 1: (let [x 1] ...) then type hint the x in the expression |
| 16:34 | amalloy | bytecolor: i just type-hinted the local 10, and you can tell it works because i get different exceptions. what do you think you should be able to do that isn't working |
| 16:34 | hiredman | and I consequently haven't done any further work on cellar |
| 16:34 | bytecolor | (let [x 1] ^int x) or (let [x 1] (with-meta x {:tag Integer})) |
| 16:35 | arohner | hiredman: does it work? |
| 16:35 | amalloy | bytecolor: but neither of those *should* work |
| 16:35 | arohner | hiredman: or, how crazy do I have to be to use it? :-) |
| 16:35 | amalloy | with-meta is trying to tag the value 1, not the variable x |
| 16:36 | amalloy | ^int x inside the let body is...probably trying to do: ((int)new Integer(1)) |
| 16:37 | hiredman | arohner: cellar? uh, pretty crazy, I think you should at least be using jets3t, I think the s3 support in cellar is just using the s3 http api |
| 16:37 | hiredman | and be sure to handle cases where talking to s3 fails (happens more often then you'd think, even from ec2) |
| 16:38 | bytecolor | bbl |
| 16:39 | hugod | hiredman: I am sure adrian would like to hear your issues with jclouds in #jclouds |
| 16:42 | hiredman | hugod: we don't have any issues anymore |
| 16:42 | hugod | hiredman: :) I understood that |
| 17:04 | ihodes | ure |
| 17:04 | ihodes | woops |
| 17:06 | ihodes | is anyone familiar with getting slime (specifically, slime-repl) working with swank-clojure without using ELPA? |
| 17:08 | rata_ | ihodes: you can use lein swank |
| 17:09 | ihodes | rata_: i do use lein swank, the issue is getting my slime-repl connected to my running swank server. slime itself is connected, but i don't know how to access the slime-repl |
| 17:10 | raek | hrm. when using ELPA, I think that can happen if you install slime but not slime-repl |
| 17:10 | rata_ | that's right... do you have slime-repl installed? |
| 17:11 | raek | the repl is supposed to turn up in *slime-repl-clojure* |
| 17:11 | ihodes | i do have it installed, and i have it (require 'slime-repl) in an init file |
| 17:11 | ihodes | but when i start slime (connect it to swank with slime-connect in emacs) the repl doesn't start |
| 17:12 | raek | one thing you could try is to install an older version of slime |
| 17:12 | ihodes | and if i start the repl on its own, i get a weird prompt |
| 17:12 | ihodes | i'm using Phil's modified version of slime and slime-repl |
| 17:12 | rata_ | ihodes: try with (slime-setup '(slime-repl)) in your emacs init file |
| 17:13 | ihodes | oh sweet, that appeared to work! thanks. let's see if the rest does now :) |
| 17:17 | ihodes | rata_: excellent! thanks so much. i just don't like relying on huge software i don't quite understand more than i need to…e.g. ELPA. |
| 17:17 | rata_ | =) |
| 17:18 | ihodes | rata_: one final question, if you will: i get this error when i do "slime-connect": Versions differ: nil (slime) vs. 20100404 (swank). Continue? (y or n) |
| 17:20 | amalloy | add to .emacs: (setq slime-protocol-version 'ignore) |
| 17:21 | rata_ | mmm.. I didn't know that one :) |
| 17:22 | amalloy | curiously it works on my home machine but not my work machine; i imagine it's an ordering problem - need it before or after something in my .emacs. i don't care enough to track it down, though, so no advice from me on that score |
| 17:23 | technomancy | package.el is part of Emacs now... so you pretty much have to bite the bullet and get comfy relying on huge software you don't understand. |
| 17:23 | technomancy | nobody understands all of Emacs |
| 17:23 | ihodes | technomancy: is it? part of 24? |
| 17:24 | technomancy | ya |
| 17:24 | ihodes | amalloy: thanks! |
| 17:24 | technomancy | http://bit.ly/pkg-el |
| 17:24 | brehaut | technomancy: is that the elpa stuff? |
| 17:25 | ihodes | technomancy: in that case, i'll wait until 24 is out to learn to love the bomb ;) |
| 17:25 | ihodes | unless it's out!? |
| 17:26 | ihodes | cemerick: such an emacs-hater :P which IDE are you using? |
| 17:26 | chouser | org.apache.maven.plugin.MojoExecutionException: Clojure failed. |
| 17:26 | chouser | at com.theoryinpractise.clojure.AbstractClojureCompilerMojo.callClojureWith(AbstractClojureCompilerMojo.java:429) |
| 17:26 | cemerick | ihodes: shockingly, eclipse + ccw |
| 17:26 | rata_ | technomancy: do you know a possible reason why "lein compile" doesn't compile my deps into classes/ ? (but it does in the other computers I'm using) |
| 17:26 | cemerick | chouser: surely there's a final cause floating around |
| 17:27 | Raynes | chouser: You didn't add enough Mojo to your Mojo, dawg. |
| 17:27 | chouser | cemerick: that was the root cause. final exception: org.apache.maven.lifecycle.LifecycleExecutionException: Clojure failed. |
| 17:27 | rata_ | *using it |
| 17:27 | chouser | at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583) |
| 17:28 | cemerick | chouser: rerun with -X |
| 17:28 | technomancy | rata_: probably lein issue #141; working around a bug in clojure. |
| 17:30 | chouser | cemerick: what do you want from that? |
| 17:30 | chouser | presumably it's from this clause: if (status != 0) { throw new MojoExecutionException("Clojure failed."); } |
| 17:30 | cemerick | chouser: you should see a more useful root cause in there |
| 17:30 | cemerick | oh, bugger |
| 17:31 | cemerick | chouser: Assuming that's from c-m-p source, your next step is to throttle talios next time you see him ;-) |
| 17:31 | cemerick | chouser: if you like, go ahead and gist the whole mess of garbage you just got dumped with |
| 17:31 | rata_ | technomancy: thanks! =) :keep-non-project-classes true solved the problem |
| 17:32 | chouser | cemerick: let me double-check my plugin version number. 1.3.6 ? |
| 17:33 | cemerick | chouser: 1.3.7 is current |
| 17:33 | technomancy | rata_: in general shipping the .class files of your dependencies is not a good idea though. (modulo the protocol thing =\) |
| 17:33 | cemerick | though I don't expect that you'll see any difference with it vs. 1.3.6 |
| 17:40 | chouser | cemerick: meh. Not sure I'm allowed to paste this. |
| 17:41 | chouser | shoot. well, I've got to run now anyway. |
| 17:41 | cemerick | chouser: launch codes and everything, huh? How about just the part after where it starts the clojure:foo stuff. |
| 17:43 | chouser | hm, found the java command line it's apparently trying to run |
| 17:43 | chouser | that runs fine, exit status 0 |
| 17:44 | chouser | ok, that's all the time I have. thanks for offering to help |
| 17:44 | arkh_ | anybody know of anything that can receive/send with linux netfilter NFQUEUE from java (clojure)? |
| 17:44 | arkh_ | goog gave no joy on that search |
| 17:56 | rata_ | technomancy: I'm not shipping them, I just want them in the classes dir because so it's easier to set the classpath when calling my AOT-compiled files |
| 17:57 | rata_ | *running |
| 18:20 | joshua__ | Hi again. I'm using enlive for scraping right now and I found that I was using (first (:content (first [selector-goes-here]))) so frequently that I made a function fcontentf. Thing is it feels like grabbing the content and the like might be the sort of thing that is built into the library. My question: Is there a way to grab the content of the first selection easily (or any helper functions you think I should know about)? |
| 18:23 | amalloy | joshua__: i know nothing about enlive, but if you actually wrote the function out as a defn, let me suggest something like (def fcontentf (comp first :content first vector)) |
| 18:24 | amalloy | or something like that |
| 18:24 | joshua__ | `(doc comp) |
| 18:24 | amalloy | (since i'm not sure what [selector-goes-here] means - is the [] a vector? |
| 18:24 | amalloy | &(doc comp) |
| 18:24 | sexpbot | ⟹ "([f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc." |
| 18:25 | joshua__ | Oh, that is nice. |
| 18:25 | joshua__ | yes |
| 18:25 | joshua__ | [] is the vector. |
| 18:25 | amalloy | &((comp inc inc inc inc) 1) |
| 18:25 | sexpbot | ⟹ 5 |
| 18:25 | joshua__ | That is a cool function. |
| 18:25 | joshua__ | It reminds me a lot of ->. |
| 18:26 | raek | joshua__: this is what I often end up with: https://gist.github.com/645239 |
| 18:26 | amalloy | joshua__: functional programming is full of em! |
| 18:26 | amalloy | -> is very nice too, but as a macro you can't use it in the same places |
| 18:26 | raek | (all-text (first (html/select node [:p]))) |
| 18:26 | joshua__ | raek: that looks like where I'm headed too atm. |
| 18:26 | joshua__ | ty for the suggestion. |
| 18:26 | amalloy | &(#(-> % inc inc inc) 1) :P |
| 18:26 | sexpbot | ⟹ 4 |
| 18:27 | cky | $source comp |
| 18:27 | sexpbot | comp is http://is.gd/isOeP |
| 18:28 | amalloy | you can implement comp using just reduce, which is a fun exercise |
| 18:28 | cky | amalloy: You mean like http://refactormycode.com/codes/836? ;-) |
| 18:29 | cky | amalloy: (Disclosure: I wrote that code.) |
| 18:31 | cky | The interestingness with Scheme is that you can return multiple values, so, a true composition operator would have to handle that case, and call the next function in the chain with the right number of arguments. |
| 18:31 | cky | i.e., if you do (compose f g), and g returns 3 values, then it should call f with 3 arguments. |
| 18:42 | gfrlog | lein repl doesn't work -- is this because everybody uses emacs and so I'm the only one who would notice? |
| 18:43 | amalloy | gfrlog: lein repl requires a project, last i checked. are you inside a lein project when you run this? |
| 18:43 | jcromartie | I use lein repl |
| 18:43 | jcromartie | constantly |
| 18:44 | technomancy | gfrlog: there were issues with earlier releases, but I'm not aware of anything outstanding in 1.4 |
| 18:44 | jcromartie | lein repl should work without a project.clj |
| 18:44 | technomancy | that said, I don't know anyone personally who uses it, so there is an element of what you're suggesting. =) |
| 18:44 | gfrlog | amalloy: I am inside a project, and it's ironic you say that because I often run it outside a project |
| 18:45 | gfrlog | technomancy: I had 1.3 and things were fine (but old), and I tried downloading 1.4, which is when I started having trouble. It says it can't connect |
| 18:45 | amalloy | see my careful disclaimer: "last i checked" :P |
| 18:45 | gfrlog | it is a very good disclaimer |
| 18:45 | scottj | anyone have fast test running happening on save with lein? |
| 18:46 | technomancy | gfrlog: interesting; guess we need an issue for that. haven't heard of that problem before |
| 18:46 | gfrlog | technomancy: this is what I'm getting http://codepad.org/l3L4NVhe |
| 18:46 | gfrlog | where do issues go? |
| 18:47 | technomancy | scottj: with clojure-test-mode C-c C-, saves, so you basically have it there with swank |
| 18:48 | technomancy | gfrlog: github tracker |
| 18:54 | gfrlog | technomancy: so "lein repl" works fine outside the project. Were there any breaking changes to project.clj or anything else? |
| 18:57 | technomancy | gfrlog: I don't know what's in your project.clj |
| 18:58 | gfrlog | I'll keep poking at it and file the issue if I can't figure it out |
| 19:00 | technomancy | it could be that the repl server is just taking too long to start and needs its timeout lengthened |
| 19:01 | technomancy | the repl task launches a socket server; so as a workaround you could telnet to it in another window |
| 19:01 | scottj | technomancy: nice, I guess I'm ok with going to the test buffer to run them. Have you hooked up difftest or anything to get better error messages in C-c ' or in repl? |
| 19:02 | technomancy | scottj: yeah, difftest works great. |
| 19:03 | scottj | C-c ' or repl? I have difftest working on lein test |
| 19:04 | gfrlog | technomancy: I bet it's that; My code has a database connection that can't be reached locally, so that might be the root cause |
| 19:06 | technomancy | connecting to a DB at the top-level should be avoided |
| 19:08 | gfrlog | technomancy: noted; thanks for the help |
| 19:12 | scottj | technomancy: ^? |
| 19:13 | ohpauleez | Raynes: Have you considered renaming "show-issues" to "list-issues" in the github api |
| 19:13 | ohpauleez | to match the endpoint api name |
| 19:13 | Raynes | ohpauleez: A lot of those names leave a lot to be desired. I've been meaning to go through and clean up the names and make them more consistent, but I've also been meaning to drop 50 pounds and learn to fly airplanes. |
| 19:14 | ohpauleez | Raynes: I'll fork and pull request, I'm going to be dorking around with the api to make a visualize tool in the next few days |
| 19:15 | Raynes | ohpauleez: That would be great! Let me know if you run into any significant bugs. A lot of the more esoteric API calls haven't been tested. |
| 19:15 | ohpauleez | will do |
| 19:16 | jcromartie | let's say I have a defmulti in one .clj file, and I have a bunch of defmethods in other namespaces, and so the defmethod files need to require the defmulti file |
| 19:17 | jcromartie | I guess I can't include all of the defmethod files from the defmulti file? |
| 19:24 | ohpauleez | jcromartie: Is the problem that you want to have all the defmethods written on other files, but available in the file where the defmulti appears? |
| 19:24 | jcromartie | yeah |
| 19:24 | jcromartie | although it's not really necessary |
| 19:25 | ohpauleez | jcromartie: Well, if you need it, checkout: https://github.com/ztellman/potemkin |
| 19:25 | ohpauleez | it gives you a "import-fn" |
| 19:26 | ohpauleez | if you can get around not using it, it's always nice not to have an extra dependency\ |
| 19:49 | jcromartie | I just don't "get" code organization in clojure |
| 19:49 | jcromartie | or, in general |
| 19:49 | gtrak | namespaces? |
| 19:49 | clojurebot | namespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it |
| 19:49 | gtrak | thanks clojurebot |
| 19:49 | jcromartie | :) |
| 19:49 | gtrak | haha |
| 19:49 | jcromartie | yeah |
| 19:49 | jcromartie | I understand namespaces |
| 19:49 | jcromartie | and java packages |
| 19:50 | jcromartie | and anything else you want to call them |
| 19:50 | jcromartie | but the general principles behind *building* them are lost on me |
| 19:50 | jcromartie | I guess because I haven't written enough large projects, but I want to try to split things up anyway since it sounds like a good idea |
| 19:50 | jcromartie | so I just mess things up in the end |
| 19:50 | jcromartie | because it's not really driven by necessity |
| 19:51 | gtrak | how do they do it in lisp? |
| 19:51 | gtrak | i'm really new to clojure, so I can't help so much, just asking :-) |
| 19:51 | jcromartie | I dunno |
| 19:52 | jcromartie | http://stackoverflow.com/questions/73045/whats-the-best-way-to-organize-code http://www.hanselman.com/blog/HowDoYouOrganizeYourCode.aspx |
| 19:52 | jcromartie | hmm, never mind, the hanselman link is junk |
| 19:55 | jcromartie | and stack overflow |
| 19:55 | jcromartie | NOTE TO SELF: don't paste links before reading them |
| 19:55 | gtrak | http://stackoverflow.com/questions/329221/medium-size-clojure-sample-application |
| 19:56 | jcromartie | here we go http://stackoverflow.com/questions/670948/how-to-organize-packages-and-prevent-dependency-cycles |
| 19:59 | gtrak | that's not really clojure-specific tho |
| 20:01 | jcromartie | no |
| 20:01 | jcromartie | but I'm missing the more abstract concepts |
| 20:03 | jcromartie | ok, focus time |
| 20:03 | jcromartie | bye |
| 20:03 | auser | later |
| 20:23 | brehaut | Is anybody willing to critique some noob code? |
| 20:24 | gtrak | sure |
| 20:24 | gtrak | but i'm a noob too |
| 20:24 | brehaut | heh |
| 20:24 | NoobFukaire | I'm a noob as well |
| 20:25 | brehaut | https://github.com/brehaut/necessary-evil/tree/master/src/necessary_evil |
| 20:25 | brehaut | ignore core.clj |
| 20:40 | pppaul | i don't know what it is trying to do? |
| 20:44 | brehaut | pppaul: my project? |
| 20:46 | pppaul | yeah |
| 20:46 | pppaul | it's easier to ask people to review a snip of code and state an objected of what it is supposed to do |
| 20:48 | brehaut | pppaul: im fine with clj in the very small, its at a slightly larger scope that i need some help with. anyway. methodcall and methodresponse implement serialization and deserialization of xml-rpc's dodgy wire format |
| 20:49 | brehaut | pppaul: parse and unparse are the entry point functions in both methodcall.clj and methodresponse.clj |
| 20:50 | brehaut | pppaul: if you are unfamiliar with xml-rpc think of it as lame json |
| 20:51 | pppaul | love the json |
| 20:51 | pppaul | XML-RPC like SOAP? |
| 20:51 | brehaut | its a precursor to soap |
| 20:51 | brehaut | the creator of xml-rpc was an early contributer to soap |
| 20:52 | brehaut | its also about as underspecified as soap is over specified |
| 20:54 | brehaut | my apathy to the format has grown to quite strong dislike as ive worked on the project |
| 20:56 | pppaul | well |
| 20:56 | pppaul | i looked at it |
| 20:56 | pppaul | seems easy to read |
| 20:57 | brehaut | thanks for taking the effort to do that |
| 20:57 | scottj | ditto your body placement on same line as params is odd though |
| 20:57 | pppaul | personally, i think xml and code dealing with xml is not as sexy as json |
| 20:58 | pppaul | anyway, i tried doing xml stuff a little while ago, and my code was a mess compared to yours. so i'll use it as ref next time i need to work with xml |
| 20:59 | brehaut | pppaul: sweet |
| 20:59 | brehaut | scottj: you mean like [arg] (....) in defns? |
| 21:01 | scottj | brehaut: yeah don't necessarily dislike it, but it does limit indentation later |
| 21:02 | brehaut | scottj: ok. i've been a bit unsure about some of that stuff style-wise. i clearly need to go look at some more idiomatic code |
| 21:05 | scottj | there is a certain attractiveness to there being whitespace below the arglist. the only other formatting thing I saw is most clojure code doesn't have columns of left justified stuff except at the beginning of a line. I personally like the look of it but it can be hard to be consistent and most programmers probably don't know how to do it automatically in their editor |
| 21:06 | brehaut | scottj: one thing i like about the [arg] (body) thing is it makes 1 arity functions consistent with 2+ arity funs |
| 21:06 | brehaut | scottj: im not sure what you mean by the left alignment, can you give me an example? |
| 21:08 | scottj | when you put more than one space between two forms |
| 21:08 | brehaut | oh right |
| 21:09 | brehaut | im sure i read a quote about that in the Joy of Clojure actually. really wish i had my PDF on this computer |
| 21:12 | brehaut | cheers for the thoughts anyway |
| 21:21 | chouser | clojure-maven-plugin is failing, but refusing to say why |
| 21:21 | technomancy | chouser: you're making me all nostalgic! |
| 21:22 | chouser | I fetched the source to add debugging messages, but I can't build it |
| 21:23 | chouser | rather frustrating |
| 21:24 | hiredman | given that talios was in here the other night and seemed to think that ^File[] a was a type hint that a is an array of files... |
| 21:25 | chouser | the antlr maven plugin is fantastic. saved so much manual effort, once we found the latest version |
| 22:08 | auser | hola |
| 22:08 | auser | so I'm having a bunch of issues trying to get a library into my leiningin project |
| 22:08 | tonyl | hola |
| 22:09 | auser | I need some insight... I'm trying to work with Hazelcast, which is *not* in clojars... so I downloaded the .jar and placed it in my lib/ dir. however, when I import it in the file, I get an error message (blech) |
| 22:09 | auser | hi tonyl :) |
| 22:10 | auser | a ClassNotFoundException, of course |
| 22:10 | auser | using: (:import '(com.hazelcast.core Hazelcast Topic MessageListener)), that is |
| 22:12 | auser | I'm sure someone has had to deal with this in the past |
| 22:13 | tonyl | I don't use lein |
| 22:13 | tonyl | sorry can't be much of help |
| 22:13 | auser | hm, do you use a project.clj? |
| 22:14 | tonyl | nope |
| 22:14 | auser | do you use maven? |
| 22:14 | tonyl | never used java or lisp so I don't know java environment staff |
| 22:14 | auser | ahh |
| 22:14 | tonyl | I need to learn them though |
| 22:14 | tonyl | *stuff |
| 22:15 | tonyl | but there are a lot of capable people around here that know about this |
| 22:15 | auser | :) |
| 22:15 | auser | hope so |
| 22:17 | auser | alright, be back after I bike home |
| 22:48 | rata_ | auser: ping! |
| 22:48 | auser | pong |
| 22:48 | auser | holla |
| 22:48 | rata_ | hola |
| 22:49 | rata_ | ok, to include a library that's not in clojars in your project file you have to do the following |
| 22:49 | auser | [oh you are a life-saver] |
| 22:49 | rata_ | first, include it as a dep even if it's not in clojars and then run lein deps... it won't finish, but will say something interesting |
| 22:50 | auser | alrighty... I think I did that and got scared from the error message |
| 22:50 | rata_ | for example, I have [clojure.data.finger-tree "0.0.1-SNAPSHOT"] in my project.clj, even when clojure.data.finger-tree isn't in clojars |
| 22:50 | auser | ah, okay, then I'll add that back in |
| 22:53 | auser | so then I download it and put it in the lib/ directory? |
| 22:53 | rata_ | no |
| 22:53 | auser | oh, okay |
| 22:54 | rata_ | btw, have you read the FAQ here? https://github.com/technomancy/leiningen |
| 22:54 | rata_ | well, the error message includes a mvn invocation |
| 22:54 | rata_ | that you must run to install the library in your maven local repository |
| 22:54 | auser | ah |
| 22:55 | auser | how will that work for collaboration? |
| 22:55 | rata_ | you just have to replace the /path/to/file with the path to the jar file you downloaded |
| 22:55 | auser | everyone will have to run that, I suppose |
| 22:55 | technomancy | auser: hazelcast is in maven central; it doesn't need to be in clojars: http://jarvana.com/jarvana/inspect-pom/com/hazelcast/hazelcast/1.9/hazelcast-1.9.pom |
| 22:56 | auser | oh, I searched clojars.org |
| 22:57 | auser | rata_: for the future, run the maven command and install it that way, technomancy thanks for the note... have you used hazelcast? |
| 22:57 | auser | out of curiosity |
| 22:57 | cemerick | everything in maven central is always available to lein and cake builds |
| 22:57 | technomancy | auser: just trivial messing around |
| 22:57 | auser | interestin cemerick... I can add that to the repositories in the project.clj, right? |
| 22:58 | cemerick | auser: it's included implicitly |
| 22:58 | auser | interesting. |
| 22:59 | cemerick | auser, rata_: if you need to use jars that aren't in clojars or maven central, then you really should have a nexus or artifactory install for your team/organization. Barring that, you can abuse e.g. github as a maven repo. That's bad form, but will get you through if you absolutely can't be bothered with a proper repository: http://cemerick.com/2010/08/24/hosting-maven-repos-on-github/ |
| 23:00 | auser | lol, alright... I appreciate the note about it, I'll read that, but you were definitely right, it's included just like that |
| 23:03 | technomancy | cemerick: have you tried using s3? |
| 23:04 | cemerick | as a mvn repo? |
| 23:04 | technomancy | right |
| 23:04 | technomancy | there's a wagon for it |
| 23:04 | cemerick | no, never thought of that |
| 23:04 | technomancy | I haven't looked into it, but apparently it's a thing |
| 23:05 | technomancy | I mean I haven't tried it for myself |
| 23:05 | cemerick | as in, useful in interesting ways, or a clever hack? |
| 23:05 | technomancy | somewhere in between, I guess. =) |
| 23:06 | cemerick | heh |
| 23:06 | technomancy | slightly less hacky than github |
| 23:06 | cemerick | I feel just a little bad about putting that github hack out there, as I've gotten a fair number of tweets from people saying they're using it. |
| 23:07 | cemerick | I suppose it's a small step up from local installs and jamming things into clojars surreptitiously, but… |
| 23:08 | cemerick | There was a fellow who was working on a hosted mvn repo service. Seems like a more and more of a good idea, as things go along. |
| 23:10 | technomancy | cloudbees hosted hudson plus hosted mvn or mvn-on-s3 would be remarkably simple for folks who need private repos. |
| 23:10 | technomancy | I guess the main disadvantage of s3 is it's harder to provide lucene indexes |
| 23:10 | cemerick | True; the trickier part is that you couldn't update it atomically. |
| 23:11 | cemerick | Not that people would generally care. :-/ |
| 23:11 | technomancy | hm; right |
| 23:11 | cemerick | yeah, pair that with downstream proxying repos, and you could be in for a world of hurt, actually. |
| 23:12 | technomancy | well usually there's not much downstream of a private repo |
| 23:12 | cemerick | ah, private, no; presumably plenty of people would like to get their stuffs into a publicly-available repo, but aren't interested in central's hurdles |
| 23:13 | technomancy | isn't sonatype pretty good for that? |
| 23:14 | cemerick | It's certainly not difficult to get access to OSS' releases repo, etc. |
| 23:14 | cemerick | But that still requires signing artifacts, interacting with nexus, etc. |
| 23:14 | cemerick | Totally doable, but surely not of interest to hobbyists, solopreneurs, etc. |
| 23:16 | rsh | is there a way in clojure to accept an arbitrary java string and eval it? |
| 23:18 | rata_ | cemerick: having to install clojure.data.finger-tree in my local maven repository is, I hope, just a temporal solution until finger trees go into clojure.core or clojure.contrib |
| 23:19 | cemerick | rata_: finger trees will be in central as soon as chouser gets on the stick ;-) |
| 23:19 | tonyl | rsh: clojure uses java Strings so I would guess it does |
| 23:19 | tonyl | the tricky part is to get the string |
| 23:19 | cemerick | ,(-> "(+ 1 2 3)" read-string eval) |
| 23:19 | clojurebot | DENIED |
| 23:19 | cemerick | feh |
| 23:19 | cemerick | rsh: ^^ |
| 23:20 | rsh | so by an arbitrary java string, i meant to say a string with arbitrary java code :) |
| 23:20 | cemerick | ah-ha |
| 23:20 | cemerick | that's trickier |
| 23:20 | cemerick | nothing Clojure-specific. There's plenty of info on the web about runtime compilation and execution of Java code. |
| 23:21 | cemerick | rsh: a random google search result http://stackoverflow.com/questions/1064259/how-can-i-compile-and-deploy-a-java-class-at-runtime *shrug* |
| 23:23 | rsh | yeah, most info I have found make a runtime.exec call |
| 23:23 | rsh | which doesn't seem right to me to just run a small bit of code |
| 23:25 | rata_ | cemerick: btw, what's a nexus or artifactory install? |
| 23:32 | rata_ | I'm going to bed... see you guys |
| 23:32 | tonyl | laters |
| 23:59 | technomancy | so... making clojure.core/into work on strings... worth doing for symmetry's sake? |