2010-04-16
| 00:05 | johnmn3 | I mean, what kind of record are we talking about here? The first time I saw it, I thought they were talking about an sql thing. |
| 00:17 | remleduff_ | In emacs, iIf I've got a pretty old repl and some files that have had a bunch of edits, is there a way to compile fresh and make sure that all the changes make it to the repl? I was working today, and had some stuff that had functions defined in the wrong order but I didn't notice because my repl state itself was fine. |
| 00:17 | carkh | remleduff_: no |
| 00:17 | johnmn3 | ok, so with defrecord we can treat an object like a map, with the keys/vals as getters and setters? |
| 00:18 | johnmn3 | ok, I think I see. |
| 00:46 | technomancy | remleduff_: if you have one namespace that requires all the others, you can require it with reload-all: (require 'my-root-namespace :reload-all) |
| 00:46 | technomancy | and all the dependent ones will get loaded |
| 01:33 | Licenser_ | greetings |
| 01:51 | zmila | re |
| 02:49 | vIkSiT | hmm. quick question. I'm fetching some data using http.agent and the result comes out as a clojure.lang.lazyseq. |
| 02:49 | vIkSiT | I was wondering - how do I convert this to text? (The result is actually in JSON format, from the representation) |
| 02:50 | vIkSiT | oh got it. |
| 02:50 | zmila | lazy seq of what? you can convert seq into text by (str ) |
| 02:52 | slyphon | anyone run into problems like: java.lang.IllegalArgumentException: interface com.atomikos.datasource.pool.Reapable is not visible from class loader |
| 02:52 | slyphon | this code works on Mac OS-X, but linux seems unhappy with me |
| 03:01 | piccolino | I'm having a bit of trouble understanding the docs for deftype etc. Is it possible to extend a Java class, maintaining the implementations of the functions you don't override? |
| 03:05 | mae | hi, need a job |
| 03:05 | mae | in california |
| 03:05 | mae | close to bakersfield |
| 03:07 | piccolino | Oops, there it is, nevermind. |
| 03:07 | mae | boom. |
| 03:08 | slyphon | goes the dynamite |
| 03:08 | mae | ice ice baby... |
| 03:08 | mae | so here is my lament, if anyone cares: |
| 03:09 | mae | i have been involved in open source with the ruby/ror and haskell/happstack |
| 03:09 | mae | took steady boring job, administrating windows, bla bla, we make carrots |
| 03:10 | mae | now i like clojure, but stuck at nice but boring (not using my skills) job |
| 03:10 | mae | the end |
| 03:10 | slyphon | such is life? |
| 03:11 | mae | anyone want a free programmer to see if i am any good? for prospects of future jobs? |
| 03:11 | mae | *sombered look* |
| 03:11 | mae | ok time to go make some baby bottles |
| 03:11 | mae | the irc monologue is *definitely* not represented on twitter |
| 03:11 | mae | so alas i am here |
| 03:19 | mae | wrong channel i guess |
| 03:21 | Licenser_ | morning |
| 03:21 | mae | morning |
| 03:21 | Licenser_ | mae: I feel your pain |
| 03:22 | Licenser_ | So I'd take a free programmer but I don't have a job for you :P |
| 03:25 | mae | lol |
| 03:25 | mae | thats the bottom of the bottom |
| 03:25 | mae | so uh, what do you do then? |
| 03:26 | Licenser_ | mae: why is that the bottom of the bottom :P I don't need one for commercial work, I'm not that low ; |
| 03:26 | Licenser_ | ) |
| 03:26 | Licenser_ | we're installing servers for TelCo's |
| 03:26 | mae | cool |
| 03:27 | Apage43 | mae: I am on a support/operations team at work |
| 03:27 | mae | the problem i face is that my job is way easy, and my skills are atrophying |
| 03:27 | Apage43 | i have clojure on my box |
| 03:27 | Apage43 | and use it in pressing situations to quickly write things like log-file analyzers and monitors for things |
| 03:27 | Licenser_ | mae: yea that is why I write open source stuff in my free time so I don't get rusty |
| 03:27 | mae | heh |
| 03:27 | mae | i will not bcome a blog |
| 03:27 | mae | ugh |
| 03:27 | mae | blob |
| 03:28 | Licenser_ | a blob? |
| 03:28 | mae | yes |
| 03:28 | Licenser_ | as in a table cell that can helpd binary data? |
| 03:28 | mae | Licenser_: must be nice, does it pay well |
| 03:28 | Licenser_ | writing open source? does not pay :) |
| 03:28 | mae | no kidding |
| 03:28 | mae | i hate that |
| 03:28 | mae | i could get 3 sap jobs |
| 03:29 | Licenser_ | well it gives me the fluffy warm feeling of doing something good |
| 03:29 | mae | before i get one open source job |
| 03:29 | mae | its not good if no one uses it for something useful |
| 03:29 | mae | it is practically masturbation |
| 03:29 | Licenser_ | well look at rhickey he writes clojure open source and it is a darn good thing |
| 03:29 | mae | true |
| 03:29 | Licenser_ | mae: is science mastrubating? |
| 03:29 | pd | if it's good science |
| 03:30 | Licenser_ | heh |
| 03:30 | mae | lol |
| 03:30 | LauJensen | Mornin team |
| 03:30 | Licenser_ | morning LauJensen |
| 03:30 | mae | but what i need, to make clojure rock, is a useful thing to create, for a real purpose |
| 03:30 | mae | so that way i can find the bugs |
| 03:30 | mae | and it is achieving something |
| 03:30 | Licenser_ | there are no bugs, there are only feature |
| 03:30 | mae | until i have a real reason, it will be crap |
| 03:30 | mae | this is my opinion |
| 03:31 | Licenser_ | mae: clojure is so young that you still can write usefull tools/libs that contribute to the comunity |
| 03:31 | mae | Licenser_: spoken like a true glass-half full kind of guy :) |
| 03:31 | Licenser_ | mae: I am :) |
| 03:31 | mae | Licenser_: yes, but I am not looking to write tools for fun, i am looking to write programs for money so i can feed my family :) |
| 03:31 | mae | heh |
| 03:31 | Apage43 | mae: just try and use clojure for the next thing you need to do |
| 03:31 | Licenser_ | unless it comes to work related topics I am a hopeless optimist |
| 03:31 | mae | Licenser_: same here. |
| 03:32 | LauJensen | mae: So whats the problem? Get to it |
| 03:32 | mae | Apage43: i haven't done anything, thats the point, i haven't been using that skillset, i'm a sysadmin |
| 03:32 | mae | LauJensen: heh, well thats why i'm here |
| 03:32 | Apage43 | What kind of sysadmin? |
| 03:32 | mae | i'm looking for something useful to program |
| 03:32 | Licenser_ | mae: technically I am a system integrator, still I write clojure code to optimize as much stuff as I can |
| 03:32 | mae | and someone with a bit of business sense |
| 03:33 | mae | Licenser_: interesting |
| 03:33 | Apage43 | I threw this together at work to monitor the output of netstat | grep somehost | wc -l on a box without watch while researching a database load issue http://gist.github.com/368131 |
| 03:33 | Apage43 | for example. |
| 03:34 | mae | mae: open and free and useful welcomes maintenance and evolution, but it doesn't lead to money. don't you want to do what love while making money? heh |
| 03:34 | mae | so you have to find a money use in my opinion |
| 03:34 | LauJensen | mae: Just reading the log I'd really advice against offering free services |
| 03:34 | pd | mae: having your name attached to popular projects, even if only in a handful of commits fixing minor bugs is a big ++ in getting your next gig |
| 03:35 | mae | LauJensen: i guess i was going for a bait and switch :) |
| 03:35 | pd | open source doesn't pay but sometimes open source friends know people who do |
| 03:35 | mae | pd: really, does that work for you? |
| 03:36 | pd | it has, yes, and i've seen it work even better for people who, erm, "invest in the community" more than i do |
| 03:36 | mae | i have a few days when i could program |
| 03:36 | Licenser_ | mae: I got a friend a job at my company because I worked with him before and truste dhim |
| 03:36 | mae | 5 days off from work, hanging out at home |
| 03:36 | mae | starting saturday |
| 03:36 | mae | pd: heh |
| 03:36 | mae | pd: i guess i'm lazy |
| 03:37 | mae | i know i can fix bugs but it doesn't seem glamourous |
| 03:37 | Apage43 | in my experience.. you really can't just decide "I have time, so.. i'm going to come up with a kickass idea to program during that time/" |
| 03:37 | Licenser_ | mae: I'm nut sure either lazy or smart :P |
| 03:37 | mae | i'm a bit of a premadonna in case you haven't noticed |
| 03:37 | mae | but i'm a talented one |
| 03:37 | mae | : ) |
| 03:37 | Apage43 | ideas don't manifest themselves under that kind of pressure for me |
| 03:37 | mae | <-- conceited |
| 03:37 | Apage43 | *shrug* |
| 03:37 | mae | heh |
| 03:37 | mae | yeah |
| 03:37 | mae | well |
| 03:37 | Licenser_ | but Apage43 I agre either you have a great idea or you don't |
| 03:38 | mae | for me to spend time i think it has to be "i'll pay you x for doing y" kind of thing, but just a small project, not lrage. |
| 03:38 | mae | large * |
| 03:38 | mae | i'll even do it dirt cheap |
| 03:38 | Apage43 | mae: think about anyone you know that might be able to pay for for a project |
| 03:38 | mae | as long as the goals are concrete |
| 03:38 | mae | Apage43: i see |
| 03:39 | mae | Apage43: so feed off of someone elses creativity? that doesn't sound like a bad idea |
| 03:39 | Apage43 | i for one just found out the place my roommate works might be willing to pay someone to replace some software they use (because it sucks). |
| 03:39 | Apage43 | not creativity leeching, the place happens to have a need that isn't adequately filled currently. |
| 03:39 | Apage43 | Just see if there's someone who's life you can make easier :] |
| 03:39 | pd | you could try door-to-door programming |
| 03:40 | mae | Apage43: market thineself? |
| 03:40 | Licenser_ | mae: so seriousely I think this is the wrong place to look for a job for some reasons A) most people here do stuff for free that is cool B) not may people here use clojure for comercial stuff C)if someone is actuall looking for a coder they most likely won't know you and rahter hire someone who hands them some kind of portfolio |
| 03:40 | Apage43 | mae: rather, network. |
| 03:41 | mae | Apage43: i think avoiding language zealotry is pretty much a solid requirement for doing stuff like that, i have to be a jack of all trades. i think i am still a zealot. |
| 03:41 | Apage43 | i didn't ask around |
| 03:41 | Apage43 | people who know me know what i can do so when they hear that thing X needs doing they know I can do it. |
| 03:42 | mae | Apage43: that sounds like a good way to approach it |
| 03:43 | mae | Apage43: i guess i find it hard to find a target market in my town for advanced programming tasks, i know how to find ms access jobs, or other similar tarded platforms |
| 03:43 | mae | Apage43: good for you |
| 03:43 | Apage43 | not that i enjoy my day job >.> |
| 03:44 | mae | hehe |
| 03:44 | mae | i think you could probably make it enjoyable |
| 03:44 | Apage43 | yeah. corporate politics. |
| 03:44 | mae | my problem is i am underpaid for my position, and upward growth is hard right now |
| 03:44 | mae | Apage43: i have alot of politics |
| 03:44 | Apage43 | and an anomalous situation resulting in me being paid.. not very much at all for what i do. |
| 03:45 | Apage43 | I am.. probably more skilled than most folks I've met and paid the least. |
| 03:45 | mae | Apage43: i feel as if i am in a similar boat |
| 03:45 | mae | i wouldn't believe it if you said it on twitter though |
| 03:46 | mae | on irc i do believe it |
| 03:46 | Licenser_ | is irc a more trustworthy medium? o.O |
| 03:46 | mae | well |
| 03:47 | mae | lets just say the 'OG's of open source tend to be on irc |
| 03:47 | mae | the flashy ruby crowd started the twitter thing :) |
| 03:47 | Licenser_ | there are a lot of smart ruby folks |
| 03:47 | mae | yeah i know |
| 03:47 | mae | just saying |
| 03:48 | Apage43 | *shrug* stuff like me being the only person on the team who knows that FTP opens more than one connection in different directions and that the manner in which its failing points to a firewall issue and noone calling the firewall team for hours regardless of what I say |
| 03:48 | mae | i consider an irc'er to be of a higher pedigree than a twitter person |
| 03:48 | mae | generally speaking of course |
| 03:48 | mae | Apage43: lol1 |
| 03:48 | mae | the ftp thing is interesting |
| 03:49 | Apage43 | or not believing me when I tell them the guy telling them to "recycle the ftp client service on your side" is bullshitting them and there isn't an "ftp client service" and he's trying to get them off the phone so he can go to lunch |
| 03:49 | mae | i am the only sysadmin out of 3 that has any real linux experience, and really understands networking |
| 03:49 | mae | they for instance, couldn't even calculate a subnet mask to save their lives |
| 03:50 | Apage43 | yeah. I finally get on the phone with our actual network guys and start talking at low level about the protocol the app in question uses and what it does and everyone's eyes glaze over and crap gets fixed and everybody's like "Yay!" |
| 03:50 | Apage43 | "I have no idea what you just said." |
| 03:50 | mae | haha |
| 03:50 | mae | let me guess |
| 03:50 | mae | "what port is it?" |
| 03:51 | Apage43 | well this was a NAT issue so it was a bit more complex than that |
| 03:51 | mae | most people think that blocking certain ports will prevent certain services |
| 03:51 | mae | http running on 80, for instance |
| 03:51 | mae | anyone with half a brain knows thats not true |
| 03:52 | mae | i think that computer professionals have started to fit on the bellcurve |
| 03:52 | mae | there is os much demand that quality will vary alot |
| 03:52 | mae | (for computer services, for example) |
| 03:53 | Apage43 | on top of this I've programmed changes to some of our apps that literally saved 20hrs off the work week of several people. I've saved the company more money than they'll ever pay me =P |
| 03:54 | mae | so you get thrown in with interviewing against someone who is very below you in terms of real skill. its no comfort that skill rarely comes into play anyways, usually impressions and politics |
| 03:54 | mae | yeah quantifying that stuff is hard sometimes |
| 03:55 | mae | in any case, i am going to keep looking, suggestions welcomed |
| 03:55 | Apage43 | fun fun, enjoy. |
| 03:55 | mae | and in the meantime i will continue to slay the business objects beast (now sap) daily |
| 03:56 | Apage43 | *shudder* |
| 03:56 | Apage43 | we're undergoing a huge SAP upgrade right now |
| 03:56 | mae | fantastic! |
| 04:33 | vegai | what graphics libraries does clojure/java provide, for gaming purposes? |
| 04:35 | hoeck | vegai: clj-processing, a third party lib to processing |
| 04:35 | hoeck | vegai: or use java gaming frameworks, eg. slick2d |
| 04:36 | hoeck | vagai: clojures java interop features are so good, you often won't need a specific clojure wrapper for those java libs |
| 04:37 | vegai | aye |
| 04:38 | vegai | I've effectively avoided touching Java for a long time, so I'm a bit blind to whatever it provides |
| 04:39 | AWizzArd | vegai: maybe you want also have a look at http://github.com/ztellman/penumbra which allows you to access gpl, be it for display or complex and fast calculations on your video card. |
| 04:39 | hoeck | for very simple games, a use swing JPanel and its update method wich lets you draw directly via point, line etc methods |
| 04:40 | LauJensen | vegai: For Gaming you have 2 good options, 1) Penumbra, 2) JMoneyEngine, the latter being a complete gaming engine |
| 04:43 | eevar2 | vegai: jogl, if you just want plain opengl drawing |
| 04:47 | LauJensen | or Slick2D, but I couldnt get any decent performance out of it |
| 04:47 | LauJensen | (I might be the problem in that case though =)) |
| 05:18 | AWizzArd | Moin cemerick. |
| 05:18 | AWizzArd | Was there some update yesterday, regarding auto constructors/factories for records? |
| 05:20 | cemerick | AWizzArd: :-) |
| 05:20 | cemerick | It sounded like the status quo will hold for a little while. |
| 05:21 | AWizzArd | cemerick: I tend to like the idea to simply keep (Foo. ...) as the only constructor for 1.2 and then see how it is going to be used. And in 1.3 new stuff can be added if needed. Better than removing things later on. |
| 05:22 | cemerick | It certainly sounds like user-defined factory fns are in the works, but support for more than one per defrecord, so perhaps not a default /create, etc. *shrug* |
| 05:24 | Chousuke | hm |
| 05:24 | LauJensen | I didn't understand the objection to the c/create syntax - Is it because it would then replace the period sugar ? |
| 05:24 | Chousuke | why is it that when I'm writing an answer to a question on the group, by the time I post it several people have already posted theirs ;P |
| 05:28 | AWizzArd | cemerick: yes, in the end I am certain we will need user defined factories. Currently for all my deftypes I have a (defn make-foo [] ...). |
| 05:28 | AWizzArd | And indeed, for some I have (defn (make-foo [a] ...) (make-foo [a b c] ...)) |
| 05:29 | edbond | vimclojure problem: Could not determine the Namespace of the file. how to fix? |
| 05:30 | cemerick | Chousuke: I think that's the direction that the factory fns will come in. Otherwise, I figure, why not reuse Foo. and (new Foo ...)... |
| 05:30 | edbond | solved: CLASSPATH=src ~/vimclojure/bin/ng-server |
| 05:30 | AWizzArd | LauJensen: I thought Rich wanted a static method Foo/create so that this can be more than a mere class constructor, not be bound to Java constructors. |
| 05:30 | cemerick | or, I should say, Foo. is going to be there regardless, so why bother with another form for a simple ctor. |
| 05:31 | LauJensen | Simpler is better |
| 05:31 | licoresse | if I wanted to write (comp dec dec dec) using some sort of repeat, how to? |
| 05:31 | cemerick | LauJensen: ach, my last to Chousuke was for you ^^ |
| 05:31 | cemerick | it's too early |
| 05:31 | LauJensen | ah |
| 05:31 | AWizzArd | cemerick: yes, Foo. would be enough imo, when people are writing their make-foo's anyway |
| 05:34 | AWizzArd | The most annoying thing about an auto-generated create-Foo would be that uppercase ‘F’. |
| 05:34 | cemerick | stuff like that is just the tip of the iceberg w.r.t. auto-generated fns IMO |
| 05:35 | AWizzArd | ;-) |
| 05:35 | LauJensen | Whats the deal with that. If you define some kind of class via Clojure, you then automatically get a fn called create-Class ? Seems so hacked together |
| 05:36 | cemerick | no, you don't |
| 05:36 | cemerick | it's been proposed, though |
| 05:36 | AWizzArd | In the end it’s all aesthetics, because from a technical side there is no real problem. But then again, programming languages are there for aesthetics and not so much more. They help us because we humans are lousy programmers. |
| 05:36 | cemerick | it's not all aesthetics |
| 05:36 | LauJensen | AWizzArd: I must admit I cant see far enough into the future to predict if either model will produce problems |
| 05:36 | cemerick | if there's one way to create a thing in clojure, that's good |
| 05:37 | LauJensen | Agreed |
| 05:37 | AWizzArd | LauJensen: same here, so I propose to just keep it with Foo. for now, and then wait until 1.3 to decide if autogens are helpful. |
| 05:37 | LauJensen | After reading some Ruby code, I've really come to appreciate how all Python code looks so much the same |
| 05:38 | cemerick | If there's to be more than one, the others should be discoverable and different enough in functionality to warrant the distinction. |
| 05:39 | AWizzArd | And the question is, if create-Foo is auto-generated, what more can it offer than Foo.? |
| 05:39 | AWizzArd | okay, can be used in (map create-Foo (bar)) |
| 05:40 | AWizzArd | But then I would still have to write my own (defn make-foo [a b] (create-Foo a (bar b))) |
| 05:47 | AWizzArd | cemerick: do you know if it is possible to write print-dup output into a FileOutputStream into which I write java-serialized data, via ObjectOutputStreams .writeObject? |
| 05:48 | cemerick | you could probably do it, but it wouldn't be pretty |
| 05:48 | AWizzArd | Because I would like to serialize j.io.Serializable objects into there via .writeObject, but also put my defrecords into the same file, but there support print-dup. |
| 05:48 | cemerick | OIS and the reader can both read off one form at a time, and you could probably sniff for a leading # to determine clojure vs. java serialized forms |
| 05:48 | AWizzArd | i.e. one output file containing all serialized data |
| 05:49 | cemerick | seems like a painful, difficult path tho |
| 05:49 | LauJensen | OIS? |
| 05:49 | cemerick | ObjectInputStream |
| 05:49 | LauJensen | thx |
| 05:49 | AWizzArd | Or, I could have a Java class ClojureRecord with the fields recordType and serializedString and have those serialized? |
| 05:51 | AWizzArd | then (.writeObject (ClojureRecord. (type my-rec) (with-out-str (binding [*print-dup* true] (print my-rec))))) |
| 05:51 | cemerick | yeah, you *could*. The whole thing is way over the line of being a custom database format tho. |
| 05:52 | AWizzArd | in fact i need this for a db format :-) |
| 05:52 | AWizzArd | my soon-to-be-released Clojure DB |
| 05:52 | cemerick | oh, right, you write your own databases |
| 05:53 | cemerick | IMO, all those options are going to be horribly slow and difficult to maintain. |
| 05:53 | cemerick | Especially any time you're using the clojure reader to deserialize data, that's a slow, slow path. |
| 05:54 | LauJensen | really? Why |
| 05:56 | cemerick | In the simplest case, writing and reading a number as a string vs. using DataOutputStream et al. is slow. |
| 05:56 | cemerick | there's just much, much more to do |
| 05:57 | LauJensen | Yea ok. And the Java strings are huge |
| 05:57 | AWizzArd | the C way is nice where one can just write out a sequence of bytes and read it back in and then have exactly the same object agani |
| 05:58 | cemerick | LauJensen: huge? |
| 05:58 | LauJensen | 2 bytes per char |
| 05:58 | AWizzArd | But in the end any kind of data needs to be mapped to some representation which can be mapped to that specific object |
| 05:58 | cemerick | right, UTF-16 internally. Welcome to an international world. :-) |
| 05:59 | cemerick | LauJensen: you should appreciate that :-) |
| 05:59 | LauJensen | cemerick: Actually I dont , but I live with |
| 05:59 | LauJensen | it |
| 05:59 | cemerick | LauJensen: you'd rather have a multitude of slightly different encodings? |
| 05:59 | AWizzArd | I would appreciate that more if the primitive chars would be 4 bytes and can each represent any unicode char. |
| 06:00 | LauJensen | Danish is a vile language only surpassed by swedish, dutch and finnish which ads nothing good to the world. So I think we should just stick with English in the IT business :) |
| 06:00 | cemerick | AWizzArd: BMP's not wide enough? ;-) |
| 06:00 | cemerick | ha |
| 06:00 | cemerick | An American Imperialist in Denmark! :-D |
| 06:01 | LauJensen | cemerick: Dont get me wrong - I didn't say a single good thing about America, nor the language you stole :) |
| 06:01 | cemerick | Embrace and extend. |
| 06:01 | AWizzArd | cemerick: for the first version i need something simple and human-readable, even if it is performance wise not the fastest serialization/deserialization |
| 06:02 | cemerick | I should get my clj-dbm project out there. That might be interesting to some. |
| 06:02 | AWizzArd | Too bad that the US did not vote to have german as their primary language |
| 06:02 | AWizzArd | There was this (probably wrong) rumor, than german lost only by 1 or 2 voices ;) |
| 06:02 | AWizzArd | http://german.about.com/library/weekly/aa010820a.htm |
| 06:02 | sexpbot | German the Official US Language? |
| 06:03 | cemerick | that's funny |
| 06:15 | AWizzArd | I want: (foo Integer) ==> "java.lang.Integer" |
| 06:15 | AWizzArd | ,(str Integer) |
| 06:15 | clojurebot | "class java.lang.Integer" |
| 06:16 | AWizzArd | for my own defrecord, producing the classname + ns |
| 06:16 | cemerick | ,(.getName Integer) |
| 06:16 | clojurebot | "java.lang.Integer" |
| 06:16 | AWizzArd | works, thanks |
| 06:17 | AWizzArd | Although in the macro it looks like ~(.getName (eval type)) |
| 06:17 | AWizzArd | (my-macro Foo) ==> "user.Foo" |
| 06:18 | LauJensen | AWizzArd: if you're in Emacs, hit C-c I and type Integer, that'll give you a list of all its methods |
| 06:18 | LauJensen | (and statics and fields) |
| 06:18 | AWizzArd | LauJensen: good trick, thx |
| 06:19 | LauJensen | np |
| 06:22 | AWizzArd | is there a clojure functions which shows me all superclasses and interfaces of a given class/object? |
| 06:23 | AWizzArd | ,(parents Integer) |
| 06:23 | clojurebot | #{:clojure.contrib.math/integer java.lang.Number :clojure.contrib.json.write/pr :clojure.contrib.pprint.examples.json/pr java.lang.Comparable} |
| 06:23 | AWizzArd | ok |
| 06:23 | LauJensen | That and ancestors might be of interest to you |
| 06:24 | AWizzArd | Oh good. |
| 06:25 | hoeck | ,(-> {} class supers) |
| 06:25 | clojurebot | #{clojure.lang.APersistentMap clojure.lang.IObj clojure.lang.IPersistentCollection java.lang.Iterable clojure.lang.Obj clojure.lang.AFn clojure.lang.Seqable clojure.lang.IEditableCollection clojure.lang.Counted clojure.lang.Associative java.util.Map java.lang.Object clojure.lang.IPersistentMap clojure.lang.IMeta java.util.concurrent.Callable java.io.Serializable clojure.lang.ILookup clojure.lang.IFn java.lang.Runnable} |
| 06:25 | LauJensen | Wow I cant believe my luck, this complete stranger just wrote "Dear friend, I wanted to transfer $12.000.000.000 to your country" and all he needs is a little money to get started! brb |
| 06:25 | hoeck | :) |
| 06:34 | AWizzArd | cemerick: btw, can Java only deserialize objects of Classes that were not dynamically produced? |
| 06:34 | AWizzArd | I mean, is that the reason why defrecords need to be AOTed to be deserializable? |
| 06:34 | cemerick | it can only deserialize objects of classes that have stable names |
| 06:35 | AWizzArd | But defrecords now do have stable names I think. |
| 06:35 | cemerick | Yes, that's my impression as well. |
| 06:35 | AWizzArd | (defrecord Foo ...) always produces namespace.Foo |
| 06:35 | AWizzArd | But this still can not be deserialized. |
| 06:35 | AWizzArd | Rich said it must be AOTed first. |
| 06:35 | cemerick | the question is whether any inner classes and such have stable names too, which I doubt. |
| 06:36 | AWizzArd | ok |
| 07:00 | LauJensen | Brians Brain on the frontpage of Lambda-the-ultimative - It just lives on and on :) |
| 07:29 | AWizzArd | Maybe Contrib could provide an efficient and general way for serialization. |
| 07:30 | AWizzArd | Something that can be added to classes that did not implement j.io.S, or records for which the author also didn't implement that interface or which can't be AOTed. |
| 08:22 | AWizzArd | cemerick: could we have in 1.2 something else than print-dup, based on Protocols (vs. defmethod print-dup ..)? |
| 08:22 | Licenser_ | (doc print-dup) |
| 08:22 | clojurebot | "; " |
| 08:22 | Licenser_ | wow that is helpful :P |
| 08:23 | cemerick | print-dup is undocumented on purpose |
| 08:23 | AWizzArd | hmm |
| 08:23 | Licenser_ | so noone uses it? |
| 08:23 | cemerick | it's really quite experimental, for all these reasons |
| 08:23 | cemerick | no, it's used :-) |
| 08:23 | AWizzArd | but not encouraged |
| 08:23 | Licenser_ | just noone knows what it does :P |
| 08:23 | cemerick | AWizzArd: yeah, that's possible. Likely not until/unless rhickey adds some kind of dispatch precedence to protocols, tho. |
| 08:23 | AWizzArd | Licenser_: you can use it via (binding [*print-dup* true] (print your-object) |
| 08:24 | Licenser_ | hmm I am always thinking of how to improve the clojure documentation and I'm not entirely sure what the best way would be |
| 08:24 | AWizzArd | cemerick: what are the options? I thought it will dispatch on the type of the first arg? Maybe with Multiprotocols this would change. |
| 08:24 | cemerick | the options for what? |
| 08:25 | AWizzArd | for dispatch precedence? |
| 08:25 | cemerick | I'm definitely not the person to look at for that. Multimethods are pretty good in that area, though somewhat verbose. |
| 08:26 | cemerick | The prefer mechanism can likely be grafted onto protocols, but I get the impression that there's an appetite for a better solution. |
| 08:26 | AWizzArd | They can dispatch on more than one arg, whereas Protocols support exactly one as I understand it. |
| 08:27 | AWizzArd | They ==> Multimethods |
| 08:27 | cemerick | right, multimethod dispatch is wide-open |
| 08:27 | cemerick | they can dispatch on the phase of the moon if you want |
| 08:27 | AWizzArd | They are nearly as nice/powerful as Pattern Matching :) |
| 08:27 | Licenser_ | wooh that would be kind of cool |
| 08:27 | Licenser_ | you could implement a wear wolf with that |
| 08:28 | Licenser_ | or a wear app |
| 08:28 | cemerick | (defmulti craziness (fn [& args] (if (= :full (phase-of-moon)) :do-this :do-that))) |
| 08:28 | cemerick | ^^ not meant as a joke, you could do it |
| 08:30 | Licenser_ | cemerick: I figure |
| 09:07 | AWizzArd | Can records now get type hinted? (defrecord Foo [x]) ... (defn bar [#^Foo f] ...) |
| 09:26 | cemerick | AWizzArd: I would think so. |
| 09:30 | licoresse | What is defrecord for? |
| 09:31 | licoresse | ,(doc defrecord) |
| 09:31 | clojurebot | excusez-moi |
| 09:32 | @chouser | licoresse: It's a cross between defstruct and deftype |
| 09:36 | licoresse | ok |
| 09:46 | AWizzArd | Btw, could Contrib need for 1.2 a general revision from Multimethods to Protocols? |
| 09:46 | AWizzArd | (and Core maybe too) |
| 09:47 | LauJensen | I'd say absolutely - There's already a lot of code which looks really old |
| 09:48 | @chouser | AWizzArd: for what, print-method and print-dup I guess? |
| 09:48 | AWizzArd | chouser: exactly those I had in mind. |
| 09:49 | AWizzArd | Oh, one thing I would love to see included for this guideline on how to write code for Contrib: “Have (set! *warn-on-reflection* true) in every file.” |
| 09:50 | Chousuke | Hm, I wonder if making print-method a protocol would solve the problem of re-evaluating core.clj during runtime? :/ |
| 09:50 | Chousuke | if you try to do it currently it blows up because print-method gets redefined and loses all the defined methods |
| 09:50 | @chouser | AWizzArd: that actually came up already, in the "coding standards" thread, and got beat back. Thankfully. |
| 09:51 | Chousuke | it could be in a comment though, just to remind people ;P |
| 09:51 | AWizzArd | chouser: is there a list pro/con for that? |
| 09:52 | Raynes | Has sexpbot been good whilst I slept? :> |
| 09:52 | @chouser | AWizzArd: you really want every single var and local typehinted? |
| 09:54 | AWizzArd | I am personally trying to type-hint as much as possible |
| 09:54 | Chousuke | actually *changing* the value of *warn-on-reflection* in library code would be rude |
| 09:55 | AWizzArd | Well, it could be set to true only before compilation then, to make the author(s) aware of reflection warnings. |
| 09:55 | @chouser | I try to type-hint as |
| 09:55 | Chousuke | that might be useful |
| 09:55 | AWizzArd | Probably maven can do that automatically ;-) |
| 09:56 | @chouser | I try to type-hint as little as possible |
| 09:57 | AWizzArd | type-hinting does not reduce productivity, can (potentially) be switched invisible with your editor, can be used by automatic documentation tools and may become useful in the future, for optional typing in Clojure. |
| 09:57 | Chousuke | well, getting rid of reflection in library code is a good thing |
| 09:57 | Chousuke | even if it is in a function that is not a bottleneck |
| 09:58 | @chouser | it is ugly, hosty, and can pin things to specific type unnecessarily |
| 09:58 | Chousuke | "hosty" :P |
| 09:59 | AWizzArd | ugly: editor-switch to invisible, hosty: needs to be tuned for the specific plattform, because it should help right there. Pinning things unnecessarily can always happen if people don't know what they are doing. |
| 10:00 | AWizzArd | On the other hand it is providing the host with more information. You are communicating to the compiler what your spec is and what you want. |
| 10:00 | cemerick | is it hard to turn on reflection warnings when one cares to see them? |
| 10:01 | LauJensen | cemerick: You mean those cute 38 (!!!) lines from your video ? |
| 10:02 | cemerick | LauJensen: I said I wasn't going to bring it up. ;-) |
| 10:02 | cemerick | oh, can other people see those /me msgs? :-D |
| 10:03 | AWizzArd | chouser: if contrib uses libs of the underlying host to replace low-level stuff with functional beauty, then the .clj file can't get more hosty than that. Such code would not run under .NET anyway. |
| 10:03 | LauJensen | Oh thats right... I just pains me when people say "I'm cant ever learn Clojure, there's just too much XML" and I'm like "what? You're thinking of Chas Emerick, he's into Maven, thats not Clojure".. "Oh okay, but I just hate the fact that I have to install this huge bloated 350 MB Netbeans IDE to use it", and Im like "what?? Dont be scared, just use Emacs" :) |
| 10:03 | AWizzArd | When people use host-specific methods, then why shouldn't do hosty communication? |
| 10:04 | LauJensen | ~google define: hosty |
| 10:04 | clojurebot | First, out of results is: |
| 10:04 | zmila | just install 299MB Eclipse! :) |
| 10:05 | AWizzArd | technomancy: how difficult would it be to have a visible/invisible switch for type hints in clojure-mode? ^^ |
| 10:10 | Raynes | "I'm installing Eclipse because Emacs is bloated." - Some guy, somewhere on the internet. |
| 10:11 | Raynes | LauJensen: The google Ajax API doesn't support define: or math. |
| 10:16 | rsynnott | Hmm, I've a system with a large number of interlinked objects in-memory. I'd like to be able to take periodic snapshots of this state and be able to reload from this in case of the application crashing. What approach would people use for tih? |
| 10:20 | @chouser | rsynnott: make sure they're all in refs, then in a transaction deref them all and pass them outside the transaction where you can write them to disk |
| 10:21 | AWizzArd | rsynnott: or wait 2-3 weeks until I release my Clojure DB :-) |
| 10:23 | @chouser | LauJensen: now you're getting it. |
| 10:23 | LauJensen | chouser: I somehow knew that would catch your attention :) |
| 10:25 | AWizzArd | Anyone here using Cells? |
| 10:25 | LauJensen | AWizzArd: And if so, would they please write a little tutorial |
| 10:25 | Raynes | +1 |
| 10:26 | Raynes | Considering I have no clue what 'cells' are in this context. |
| 10:26 | Raynes | ;) |
| 10:26 | Raynes | YamNad: ohai |
| 10:26 | YamNad | Hi. |
| 10:26 | AWizzArd | I have a little problem now that I am using the new version http://gist.github.com/306174 - so far I placed in my .clj file after the (ns ..) declarations a (load-file (str (File. (.getParentFile (File. #^String *file*)) "cells.clj"))) |
| 10:27 | AWizzArd | But this outputs now ‘java.lang.ClassNotFoundException: user.Editable (cells.clj:20)’ |
| 10:27 | AWizzArd | If I start a fresh repl and load the file manually I don’t get this warning. And after doing so I can also compile my code without warnings. |
| 10:28 | AWizzArd | Just when I start a repl and try to compile my code the first time. A direct second recompile works fine then. |
| 10:31 | licoresse | Does it matter what order the namespaces appear in :require? |
| 10:32 | Chousuke | it shouldn't |
| 10:32 | cemerick | it does if the namespaces are doing stateful, interdependent things. |
| 10:32 | Chousuke | ie. if they're broken ; |
| 10:32 | Chousuke | P |
| 10:32 | licoresse | right... |
| 10:32 | Chousuke | like my smiley there |
| 10:38 | rsynnott | chouser: ah, yes, that's sort of obvious :) Thanks |
| 10:38 | rsynnott | AWizzArd: what is the nature of your clojure DB? :) |
| 10:38 | @chouser | I'm all about the obvious answers. |
| 10:39 | slyphon | technomancy: hey, if i'm using a particular jar for lein-swank "lein-swank-1.2.0-20100308.145053-2.jar" and i want to lock my project to that particular version, is there a way to do that? |
| 10:40 | AWizzArd | one sec, about my load-file problem here: http://pastie.org/923220 |
| 10:40 | AWizzArd | If somebody could please have a look at this and point out a way how to load the cells.clj without triggering this warning. |
| 10:41 | AWizzArd | If you already have a fresh build of master, including defrecord then it is basically just putting my foo.clj into some dir, as well as cells.clj and try to compile it. |
| 10:42 | LauJensen | AWizzArd: You should check out gist.el |
| 11:00 | Raynes | Aw. You can't merge into defrecords. :( |
| 11:01 | AWizzArd | What would you like to do? |
| 11:01 | Raynes | (merge (Stfu. 3 3) {}), essentially. |
| 11:03 | stuartsierra | Raynes: 'into' might work |
| 11:03 | Raynes | stuartsierra: Ooh, good idea. |
| 11:03 | Raynes | stuartsierra: That did it. :D |
| 11:04 | Raynes | I'm trying to avoid changing as much code in sexpbot as possible, while converting it to my own IRC library, which uses a defrecord. |
| 11:12 | whidden | Is there a practical limit on the number of functions 'comp will work with? |
| 11:12 | AWizzArd | no |
| 11:13 | stuartsierra | in a single invocation, yes |
| 11:13 | stuartsierra | probably the JVM method size limit |
| 11:13 | stuartsierra | unless it's recursive |
| 11:13 | stuartsierra | so no |
| 11:14 | stuartsierra | But eventually your stack traces will look like fn__1234$fn__2345$fn__3456$... |
| 11:15 | whidden | yes, but that's ok for me at the momemt. |
| 11:16 | whidden | because i hardly never make errors. |
| 11:16 | stuartsierra | heh |
| 11:17 | Chousuke | hmm |
| 11:17 | Chousuke | ,(apply comp (repeat 10000 +)) |
| 11:17 | clojurebot | #<core$comp__4952$fn__4971 clojure.core$comp__4952$fn__4971@e4cde8> |
| 11:17 | stuartsierra | ((apply comp (repeat 10000 +)) 1) |
| 11:18 | stuartsierra | ,((apply comp (repeat 10000 +)) 1) |
| 11:18 | clojurebot | 1 |
| 11:18 | stuartsierra | wow |
| 11:18 | Chousuke | comp doesn't actually create a new function |
| 11:18 | stuartsierra | ,((apply comp (repeat 10000 inc)) 1) |
| 11:18 | Chousuke | a new class, that is |
| 11:18 | Chousuke | stuartsierra: extra space |
| 11:18 | Chousuke | ,((apply comp (repeat 10000 inc)) 1) |
| 11:18 | clojurebot | 10001 |
| 11:19 | stuartsierra | ah |
| 11:19 | whidden | ,(time ((apply comp (repeat 10000 inc)) 1)) |
| 11:19 | clojurebot | 10001 |
| 11:19 | clojurebot | "Elapsed time: 27.01 msecs" |
| 11:19 | stuartsierra | So comp with 10000 args doesn't create 10000 fns. |
| 11:19 | stuartsierra | It just creates 1 fn that calls the 10000 fns in order? |
| 11:20 | Chousuke | yes. comp only creates a closure of an existing function that composes its parameter functions |
| 11:20 | stuartsierra | ok |
| 11:20 | stuartsierra | I guess you'd overflow the stack otherwise. |
| 11:20 | Chousuke | in general, only a (fn ...) form in code actually creates a new class |
| 11:21 | stuartsierra | right |
| 11:21 | Chousuke | any function returning functions won't generate classes, but instances of a single class |
| 11:22 | stuartsierra | Right, only one class per *literal* (fn...). I always forget that. |
| 11:25 | AWizzArd | hmm, did Cells change recently? |
| 11:25 | AWizzArd | Such that a LockCell does not have a lock anymore? ;) |
| 11:31 | AWizzArd | yup, a little bug |
| 11:32 | The-Kenny | test |
| 11:32 | AWizzArd | Hi The. |
| 11:33 | The-Kenny | huh, sorry. Erc said my connection was closed. |
| 11:33 | The-Kenny | Hi, AWizzArd :) |
| 11:41 | LauJensen | The-Kenny: Odd - I had a disconnect with ERC about an hour ago which stalled Emacs |
| 12:14 | sergey_miryanov | ,{:keys [x] {:x 1}} |
| 12:14 | clojurebot | java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 3 |
| 12:15 | sergey_miryanov | hi all |
| 12:15 | sergey_miryanov | somebody can explain what wrongs with {:keys [x] {:x 1}}? |
| 12:17 | carkh | hum you're mixing stuff |
| 12:17 | carkh | (let [{:keys [a]} {:a 1 :b 2}] a) |
| 12:17 | carkh | ,(let [{:keys [a]} {:a 1 :b 2}] a) |
| 12:17 | clojurebot | 1 |
| 12:18 | carkh | {:keys [a]} <- this is a destructuring pattern |
| 12:18 | carkh | {:a 1 :b 2} <- this is literal map syntax |
| 12:19 | carkh | destructuring patterns go in binding forms like a let or maybe a doseq |
| 12:19 | carkh | or the parameter list of a function |
| 12:20 | sergey_miryanov | o! thanks! you get me a point - I just typo {:keys [x] {:x 1}} -> should be -> {:keys [x]} {:x 1} |
| 12:20 | carkh | ah =) |
| 12:20 | sergey_miryanov | *i should go sleep* -_- |
| 12:21 | sergey_miryanov | thanks in any case! :) |
| 12:21 | carkh | =) |
| 12:30 | AWizzArd | rhickey offline to code without interruptions? ^^ |
| 12:32 | mtm | I get the strangest feeling that 1.2 is imminent (but maybe that's just the 4 shots of espresso I drank this morning talking...) |
| 12:42 | AWizzArd | Uh, 1981, a 1gb hd from ibm: http://img147.imagevenue.com/aAfkjfp01fo1i-5704/loc54/66568_1gb_hard_disk_ibm_1981_122_54lo.jpg |
| 12:46 | AWizzArd | Ah, there he is :) |
| 12:46 | AWizzArd | wb rhickey |
| 12:47 | rhickey | hey |
| 12:47 | rhickey | everyone rockin' with defrecord? |
| 12:48 | AWizzArd | absolutely |
| 12:48 | AWizzArd | Today i rearranged my code to use it everywhere. |
| 12:48 | AWizzArd | But btw, I don’t know if it is related, I may have discovered a little bug in Cells. |
| 12:49 | AWizzArd | If you (load-file "/path/cells.clj" and then do this in the repl, what do you get? (:lock (LockCell. (java.util.concurrent.locks.ReentrantLock.) 1 2)) |
| 12:52 | AWizzArd | For me this results in nil. May have to do with deftype and the use of :lock as an accessor? *shrugs* |
| 12:52 | AWizzArd | When I use cell-sentry instead of :lock as accessor, then I get the lock. There are seven places where :lock is used in cells.clj. After I changed them to (cell-sentry cell) my code was working again. |
| 12:52 | LauJensen | Can somebody link some help explanation+example of defrecord please? |
| 12:52 | AWizzArd | LauJensen: very similar to defstruct |
| 12:53 | LauJensen | How far can you stretch 'very' ? |
| 12:53 | AWizzArd | just more efficient |
| 13:10 | slyphon | the icicles completion guy is scary |
| 13:12 | timcharper | slyphon: Drew? |
| 13:14 | slyphon | yeah |
| 13:14 | slyphon | dude has thought *way* too much about completion |
| 13:14 | timcharper | slyphon: hah |
| 13:15 | slyphon | the sheer volume of documentation on emacswiki is humbling |
| 13:15 | carkh | is icicles bette rthan ido-mode ? |
| 13:15 | slyphon | ehhh |
| 13:15 | slyphon | i'm still debating that |
| 13:15 | slyphon | i think ido-mode for buffers is probably better |
| 13:16 | AWizzArd | rhickey: can you confirm that? (:lock (locked-cell 100)) ==> nil |
| 13:16 | timcharper | slyphon: when the way to install icicles was downloading code off of pages from a wiki, I stopped there. |
| 13:16 | slyphon | timcharper: :) |
| 13:16 | slyphon | yeah, i remember those days |
| 13:30 | hamza | (- (complex -1.0 -1.0) (complex -0.9 -0.9)) throwing java.lang.ClassCastException: clojure.lang.PersistentStructMap cannot be cast to java.lang.Number is this a bug this used to work? |
| 13:30 | _brian2_ | noob question> what is idiomatic way of defining a function that has variable states for a map like this (map f(state1) ... ? |
| 13:31 | jonasen | Is this a bug in defrecord or am I doing something wrong? http://paste.lisp.org/display/97880 |
| 13:31 | carkh | _brian2_: can you expand a little bit on your qustion ? |
| 13:31 | dakrone | _brian2_: what do you mean by a function having variable states for a map? |
| 13:34 | _brian2_ | well a simple example f(state1 ) (+ 1 %) , f (state1 (+ 2 %) |
| 13:34 | _brian2_ | sorry state2 |
| 13:34 | _brian2_ | f(state2 (+ 2 %)) |
| 13:36 | _brian2_ | isn't that an fp trait ? |
| 13:36 | carkh | you mean something like this ? (map #(%1 some-value) [f1 f2 f3]) |
| 13:36 | dakrone | still not getting what you're trying to do |
| 13:37 | _brian2_ | well, its a function whose behaviour is conditioned by state |
| 13:38 | sh10151 | what you have there is not conditioned by state |
| 13:38 | sh10151 | it's conditioned by a variable |
| 13:38 | _brian2_ | yes |
| 13:39 | _brian2_ | but im trying to segregate the variables |
| 13:39 | _brian2_ | to make the code easier to read |
| 13:39 | sh10151 | (map (fn [x] ((make-function state1) x)) xs) |
| 13:40 | _brian2_ | ok |
| 13:40 | weissj | _brian2_: i'm not sure how what you want is any different than a fn that takes an argument |
| 13:40 | sh10151 | or (let [f (make-function state1)] (map f xs)) |
| 13:40 | weissj | oh i see |
| 13:41 | sh10151 | (doseq [f (map #(make-function %) [state1 state2 state3])] (map f xs)) |
| 13:41 | _brian2_ | ok |
| 13:41 | carkh | ,(let [adder (fn [x] #(+ x %))] (map (adder 2) [1 2 3])) ;the cannonical example |
| 13:41 | clojurebot | (3 4 5) |
| 13:41 | _brian2_ | yea |
| 13:42 | Chousuke | sh10151: note: #(make-function %) is equivalent to make-function |
| 13:42 | Chousuke | unless of course make-function is a macro |
| 13:43 | sh10151 | Chousuke: hehe, thanks :) |
| 13:43 | sh10151 | Chousuke: i almost wrote the same out for (map f xs) |
| 13:43 | _brian2_ | thnks |
| 13:45 | Chousuke | small things can improve code readability quite a bit |
| 13:46 | Chousuke | I had to learn out of the habit of typing #(foo %) all the time too :P |
| 13:46 | Chousuke | I think I use partial and comp more as a result, but #() has its place. |
| 13:47 | Chousuke | one just needs to be careful not to overuse it and make the code look like perl |
| 13:48 | carkh | ok just for Chousuke : |
| 13:48 | carkh | ,(map (partial + 2) [1 2 3]) |
| 13:48 | clojurebot | (3 4 5) |
| 13:48 | Chousuke | heh |
| 13:49 | carkh | i think it's harder to understand for a new user |
| 13:49 | Chousuke | I think (partial + 2) is easy enough |
| 13:49 | Chousuke | any new user will just read partial's docstring and get it right away |
| 13:49 | weissj | i had a lot of trouble wrapping my head around partial at first |
| 13:50 | carkh | you'll find yourself having to explain it in terms of lambdas |
| 13:50 | weissj | Chousuke: i read the docstring and said "what??" read it again.. and again |
| 13:50 | weissj | i get it now, but it's not an easy thing for a noob |
| 13:50 | Chousuke | I've seen much worse point-free expressions in Clojure. Those are the mind-benders |
| 13:51 | Chousuke | I think one contained at least 4 partials and 3 comps |
| 13:51 | carkh | you can go quite far with those update-in things too |
| 13:51 | carkh | always a pleasure =) |
| 13:52 | Chousuke | (doc partial) |
| 13:52 | clojurebot | "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args." |
| 13:53 | Chousuke | hmm, I suppose that isn't so clear if you're not yet used to thinking about functions as values |
| 13:55 | Chousuke | heh |
| 13:55 | Chousuke | I guess those require a basic understanding of what a form is. |
| 13:56 | Chousuke | so that the docstring makes any sense... "if form blah isn't a list, it is wrapped in a list" makes no sense in most programming languages :) |
| 14:00 | nipra_ | Chousuke, That was the exact part of the doc that took time for me to grasp. Anyway.. I find both of them very useful. :-) |
| 14:05 | @chouser | Why is javax.xml.parsers.SAXParserFactory producing a SAXParser that generates events for non-existent HTML and HEAD tags? |
| 14:09 | @chouser | ,(-> (javax.xml.parsers.SAXParserFactory/newInstance) .newSAXParser (.parse (java.io.ByteArrayInputStream. (.getBytes "<foo>bar</foo>")) (proxy [org.xml.sax.helpers.DefaultHandler] [] (startElement [_ _ n _] (prn n))))) |
| 14:09 | clojurebot | java.lang.RuntimeException: java.lang.IllegalStateException: Var null/null is unbound. |
| 14:09 | @chouser | huh |
| 14:10 | fogus | ,64r1 |
| 14:10 | clojurebot | Radix out of range |
| 14:10 | fogus | Did that ever work? |
| 14:12 | jonasen | I asked this earlier but didn't get an answer then, maybe someone can help me now.. |
| 14:12 | @chouser | hm. I don't think so -- always case-insensitive? so tops out at 32 |
| 14:12 | @chouser | 36 |
| 14:13 | jonasen | Is this a bug in defrecord or am I doing something wrong? http://paste.lisp.org/display/97880 |
| 14:13 | @chouser | jonasen: defrecord will behave like a map, so 'count' is already implemented to give the number of key/value pairs it's holding. |
| 14:14 | @chouser | jonasen: if you want to define a type that has its own logic for what 'count' means, that's exactly when you want to use deftype instead of defrecord |
| 14:14 | jonasen | @chouser: ok, thanks |
| 14:17 | timcharper | So, I have this monkey patch that makes the closure test library use clj-stacktrace for errors. |
| 14:17 | timcharper | http://pastie.org/923567 |
| 14:17 | timcharper | However, when I try to load files that reference this under Swank-Clojure, I get an error message: |
| 14:18 | _brian2_ | sorry, this is my last question, which is my real question is how to use a multimethod in a map (ie this is a syntax question), ie is this ok? (defmethod count-cat [:toys] [category] [var] ( do .. (find all instances of toys var hashes and do something))) |
| 14:18 | timcharper | http://pastie.org/923569 |
| 14:18 | timcharper | clojure.test$report__59 cannot be cast to clojure.lang.MultiFn |
| 14:19 | technomancy | timcharper: clojure-test-mode rebinds report IIRC. if you want to use your hack with swank-clojure you might have to disable or hack clojure-test-mode |
| 14:19 | timcharper | Is there an easy way to tell instead of closure if the application is running under Swank-Clojure? |
| 14:20 | timcharper | technomancy: as in emacs clojure-test-mode ? |
| 14:20 | timcharper | emacs is not failing here |
| 14:21 | timcharper | the Clojure process fails because of some environmental difference induced by swank-server (it seems) |
| 14:21 | technomancy | c-t-m has to hack clojure.test in order to get pass/fail stats |
| 14:21 | technomancy | it's not because of swank-clojure |
| 14:21 | AWizzArd | ~seen jcowan |
| 14:21 | clojurebot | jcowan was last seen parting #clojure, 5125 minutes ago |
| 14:21 | timcharper | technomancy: oh... okay, so it actually hacks the running Clojure instance? |
| 14:22 | timcharper | technomancy: I think I would just prefer to conditionally disable my active running from within clojure-test-mode (if that's the case) |
| 14:22 | timcharper | ^my active^my patch from |
| 14:23 | fogus | @chouser: Thanks! |
| 14:24 | cemerick | chouser: I wonder if that condition could be detected and warned about with a better message. |
| 14:24 | cemerick | That'll become a FAQ pretty quick otherwise, I'll bet. |
| 14:32 | timcharper | technomancy: is there some way I can check to see if clojure-test-mode extensions have been loaded from within Clojure? |
| 14:39 | @chouser | can anyone answer my xml question? |
| 14:42 | vegai | fogus: oh, you noticed my nitpicks #2 :P |
| 14:43 | vegai | fogus: are these typo/style suggestions helpful to you? |
| 14:44 | _brian2_ | noob question> how do I correctly call a multimethod in a map : http://clojure.pastebin.com/8KHgdMMY |
| 14:45 | technomancy | timcharper: I don't know of a way other than wrapping your defmethod in try/catch; sorry |
| 14:46 | technomancy | c-t-m is a little haphazard; it could definitely be better-behaved |
| 14:46 | technomancy | oh, you could test for the presence of the clojure.test/old-report var; that would d oit. |
| 14:50 | timcharper | technomancy: that'd work (I don't know I didn't think about that) |
| 14:50 | timcharper | (wrapping it) |
| 14:52 | AWizzArd | technomancy: how difficult would it be to have a visible/invisible switch for type hints in clojure-mode? ^^ |
| 14:54 | technomancy | AWizzArd: I don't think it'd be too hard. I'm not too familiar with the necessary APIs, but I know they exist. |
| 14:54 | technomancy | cool idea |
| 14:55 | LauJensen | technomancy: Is there some kind of folding in cm now ? |
| 14:56 | technomancy | nothing yet |
| 14:56 | LauJensen | Must be something from CL that we can loot :) |
| 15:02 | _brian2_ | can someone tell me if you can call a multimethod in a map? ie, this doesn't work http://clojure.pastebin.com/8KHgdMMY |
| 15:03 | timcharper | technomancy: the try/catch trick worked, all are happy now. Thank you! |
| 15:04 | technomancy | ^5 |
| 15:04 | technomancy | would love to see that in action |
| 15:04 | dnolen | _brian2_: you put a multimethod into a map? |
| 15:05 | _brian2_ | yes, is that possible ? |
| 15:05 | _brian2_ | or plain wrong |
| 15:11 | arohner | _brian2_: you can call multimethods from a map, though your syntax is wrong |
| 15:11 | arohner | I don't know how to fix it because I don't know what you want to happen |
| 15:11 | arohner | (map #(cc {:category :toys} %) [ 1 2]) is closest to working |
| 15:11 | arohner | though that (inc v) won't work |
| 15:12 | arohner | nm, what I wrote should work |
| 15:12 | _brian2_ | ok, thnks I need to take a look |
| 15:13 | Chousuke | it looks like you're trying to call functions using foo(bar) syntax :/ |
| 15:14 | _brian2_ | arohner> "(inc v) won't work", what will? |
| 15:14 | Bendlas | hi folks |
| 15:14 | Bendlas | has there been anything done on clojurescript lately? |
| 15:15 | LauJensen | Bendlas: Not that I know of, but recently a similar lib named Scripjure was put on Github I believe |
| 15:16 | arohner | _brian2_: actually, (map #(cc {:category :toys} % ) [1 2]) |
| 15:16 | arohner | produc |
| 15:16 | arohner | produces (2 3) |
| 15:16 | arohner | _brian2_: is that what you want? |
| 15:16 | _brian2_ | oh, ok |
| 15:16 | arohner | Bendlas: there's http://github.com/arohner/scriptjure |
| 15:16 | Bendlas | LauJensen, thanks, that looks interesting |
| 15:16 | arohner | http://arohner.blogspot.com/ |
| 15:16 | sexpbot | "/dev/rohner" |
| 15:16 | arohner | I mean |
| 15:16 | arohner | http://arohner.blogspot.com/2010/04/writing-jquery-code-with-scriptjure.html |
| 15:16 | sexpbot | "/dev/rohner: Writing JQuery code with Scriptjure" |
| 15:18 | Bendlas | I wrote something very similar last night, but wanted to investigate before putting more work in |
| 15:19 | Bendlas | arohner, that seems very much like what i was looking for |
| 15:20 | arohner | Bendlas: great |
| 15:26 | dnolen | _brian2_: sorry, yeah, keep fns out of maps |
| 16:05 | timcharper | the error screens in slime are driving me nuts. Is there any way to make it so errors just appear in the mini buffer instead of switching my focus to a new split? |
| 16:06 | timcharper | (when I evaluate Clojure code via c-c c-r, or use repl in swank-clojure) |
| 16:14 | licoresse | timcharper: yeah, that IS annoying |
| 16:14 | licoresse | growl support would be nice, if you are on a mac |
| 16:15 | licoresse | I guess there is growl for win as well |
| 16:15 | licoresse | http://www.emacswiki.org/cgi-bin/wiki/growl.el |
| 16:15 | timcharper | licoresse: yeah, anything that doesn't take your focus away so when you resume typing you're like "what the heck?" |
| 16:16 | licoresse | for the small messages, I would like it to pop up afloat and not stealing focus |
| 16:21 | licoresse | this one seem more up-to-date: http://github.com/elim/emacs-growl/blob/master/growl.el |
| 16:22 | timcharper | The trick is tracking down where the function sldb-get-buffer is called |
| 16:37 | licoresse | extract the notes from slime-compilation-finished in slime.el |
| 16:37 | licoresse | and growl the extraction |
| 16:43 | timcharper | licoresse: I can't tell where the debug window is being allocated and focused though, can you? |
| 16:44 | licoresse | yes |
| 16:44 | licoresse | brb |
| 16:44 | timcharper | allocated, sldb-get-buffer |
| 16:44 | timcharper | But where is it focused? |
| 16:45 | licoresse | the fouus thing is a pref |
| 16:45 | licoresse | at my system, the frame is just divided |
| 16:45 | timcharper | Which pref? (Here too) |
| 16:45 | licoresse | but focus does not shift, M-x apropos compiler notes |
| 16:46 | timcharper | focus shifts here |
| 16:46 | timcharper | :S |
| 16:46 | timcharper | on slime 20091016 |
| 17:02 | a_strange_guy | hi there |
| 17:02 | a_strange_guy | can somebody help me with my swank-clojure problems? |
| 17:03 | a_strange_guy | after compiling the latest clojure from git |
| 17:04 | a_strange_guy | i get a "java.lang.ClassNotFoundException: clojure.main" when starting up slime |
| 17:05 | a_strange_guy | using the jar normally with java -jar works |
| 17:05 | hiredman | that means your clojure.jar is not on the classpath of the jvm that slime is trying to start |
| 17:06 | a_strange_guy | that is strange |
| 17:06 | a_strange_guy | is there any way to find out the classpath which swank-clojure passes to the jvm? |
| 17:06 | a_strange_guy | some variable in emacs? |
| 17:08 | technomancy | a_strange_guy: have you tried the instructions in the swank-clojure readme? there are several ways to launch a session. |
| 17:08 | Bendlas | swank-clojure-classpath |
| 17:12 | a_strange_guy | ah found the reason |
| 17:12 | a_strange_guy | swank-clojure-jar-home got unset somehow |
| 17:12 | bozhidar | anybode knows the criteria on which some core functions are marked as built-ins in clojure-mode, where other aren't? |
| 17:12 | a_strange_guy | thx anyway |
| 17:12 | bozhidar | http://paste.lisp.org/display/97895 |
| 17:13 | bozhidar | I cannot understand why even? is there, but odd? isn't |
| 17:13 | a_strange_guy | bozhidar: there is a big list of clojure functions in clojure-mode.el |
| 17:13 | bozhidar | a_strange_guy: I know how big the list is - I'm looking at it :-) |
| 17:13 | bozhidar | but it should be a lot bigger IMO |
| 17:14 | bozhidar | otherwise the font locking seems non uniform |
| 17:14 | a_strange_guy | there was a post by Lau Jensen in his blog on how to scrape the api page for functions to add |
| 17:17 | unlink | hi |
| 17:17 | unlink | Is anyone using Clojure to trade with Interactive Brokers? |
| 17:19 | bozhidar | a_strange_guy: I found the post and while it presents a workaround it doesn't offer an explanation |
| 17:19 | bozhidar | about what insight made the developers include only those particular functions |
| 17:20 | bozhidar | I can easily alter the mode myself, but I'm curious as to the current state of affairs and what led to it... |
| 17:20 | a_strange_guy | probaply it's a hassle to keep the list up to date |
| 17:20 | a_strange_guy | and ccorrect with the latest versions of clojure |
| 17:21 | a_strange_guy | as long it doesn't interface with slime, it will miss some functions |
| 17:24 | AWizzArd | rhickey: did you get my messages about Cells from 5 hours ago? |
| 17:24 | bozhidar | a_strange_guy: certainly |
| 17:25 | bozhidar | I hope that one day will get the same level of slime integration for Clojure that exists today for CL |
| 17:25 | bozhidar | clojure + slime have come a long way, but I still envy the CL guys for some stuff |
| 17:26 | The-Kenny | Yeah, me too. Debugging and stuff like list-callees is very nice |
| 17:27 | scottj | unlink: nope, but I've thought about it and talked to another person that was thinking about it. If you write a wrapper and open source it I'm sure it would be of interest to others |
| 17:28 | technomancy | bozhidar: I can think of one great way to make that happen... =) |
| 17:29 | bozhidar | technomancy: me coding less Java and more Emacs Lisp I presume ;-) |
| 17:29 | a_strange_guy | well the problem is that clojure-mode and swank-clojure are distinct |
| 17:32 | unlink | scottj: Yeah I'm pretty sure I am going to. |
| 17:34 | bozhidar | a_strange_guy: even with common lisp - swank and lisp-mode are separate |
| 17:34 | bozhidar | and I find this reasonable |
| 17:34 | bozhidar | you have access to slime-complete-symbol from lisp/clojure buffers |
| 17:35 | bozhidar | it would have been nicer is something like that is used to generate dynamically the list of symbols to font lock |
| 17:36 | bozhidar | I might try to conjure something up after I'm done with my current projects... |
| 17:36 | mabes | Could someone explain what "clojure.lang.RT" does here? (let [entry (. clojure.lang.RT (find map (first keys)))] |
| 17:37 | mabes | ^ taken from (source select-keys) |
| 17:37 | Raynes | http://spikeypillow.com/2010/04/what-programming-languages-are-people-learning/ "There might be a lot of hype about languages like Clojure, Scala and Smalltalk but the numbers show there just are not that many people picking them up." |
| 17:37 | sexpbot | "Hello World: Which programming languages are people learning? - Spikey Pillow" |
| 17:37 | lancepantz | that's absurd |
| 17:37 | Raynes | I'm sure that's why over 400 people signed up for the Clojure course at rubylearning. |
| 17:37 | lancepantz | he's comparing clojure to smalltalk? |
| 17:38 | Raynes | lancepantz: He has a graph. |
| 17:38 | bozhidar | Raynes: don't you find it amusing that rubylearning are doing a clojure course? :-) |
| 17:39 | Raynes | Apparently, according to his graph, more people are picking up Forth and Fortran than Clojure. |
| 17:39 | Raynes | bozhidar: Indeed. It's beautiful. |
| 17:40 | bozhidar | there is this massive switch to clojure from ruby that I've noticed |
| 17:40 | bozhidar | I guess that Rails really played them a bad joke... |
| 17:40 | Raynes | Parens are all the rave these days. |
| 17:40 | hiredman | the seattle clojure group has a lot of pythonistas |
| 17:40 | clojurebot | clojure is not groovy |
| 17:40 | Raynes | The truth. |
| 17:40 | Raynes | He speaks it. |
| 17:40 | bozhidar | Raynes: parens have been the rave for the last 50 years :) |
| 17:41 | lancepantz | bozhidar: i've notices the same re: ruby->clojure |
| 17:41 | lancepantz | it's the path i'm coming down |
| 17:41 | bozhidar | lancepantz: me too |
| 17:41 | lancepantz | we've convinced my boss to migrate all of our backend to clojure |
| 17:41 | bozhidar | but I have to admit that before ruby I was fond of Common Lisp |
| 17:41 | mabes | lancepantz, bozhidar: same, but I think that says more about the ruby community than anything else.. (early adopters) |
| 17:41 | Raynes | I believe technomancy is/was a Ruby guy as well. |
| 17:41 | Chousuke | mabes: clojure.lang.RT is a class that contains many static methods used by clojure.core |
| 17:42 | bozhidar | I like the language, but there weren't that good deployment options for CL apps |
| 17:42 | bozhidar | clojure changed that... |
| 17:42 | lancepantz | we basically realized there was nothing we could do to make our ruby backend faster... in ruby |
| 17:42 | mabes | Chousuke: Why is it being used in that context though? It seems like the select-keys would work fine with just (find map (first keys)). |
| 17:42 | lancepantz | some of our early benchmarks have clojure 100x faster |
| 17:43 | Chousuke | mabes: find is not a clojure function |
| 17:43 | lancepantz | there's also some db changes, but still |
| 17:43 | bozhidar | lancepantz: I also disliked a little the overly frivolous syntax - it seemed to me it added some unneeded complexity |
| 17:43 | mabes | ,(doc find) |
| 17:43 | clojurebot | "([map key]); Returns the map entry for key, or nil if key not present." |
| 17:43 | Chousuke | oh, it is? heh |
| 17:44 | Chousuke | maybe it's newer than select-keys :/ |
| 17:44 | mabes | Chousuke: ok, I suspected it could be cruft, thanks |
| 17:44 | lancepantz | bozhidar: well and as you try to implement more complex features that all work together you end up with a huge abstracted mess |
| 17:45 | Chousuke | does anyone actually use that find function? |
| 17:45 | AWizzArd | ,(find {:a 1, :b 1} 1) |
| 17:45 | clojurebot | nil |
| 17:45 | bozhidar | lancepantz: indeed |
| 17:45 | Raynes | (doc find) |
| 17:45 | clojurebot | "([map key]); Returns the map entry for key, or nil if key not present." |
| 17:45 | Chousuke | get and map-as-fn make it kind of irrelevant |
| 17:45 | AWizzArd | ,(find {:a 1, :b 1} :b) |
| 17:45 | clojurebot | [:b 1] |
| 17:45 | mabes | ,(source find) |
| 17:45 | clojurebot | Source not found |
| 17:45 | Raynes | ~def find |
| 17:45 | mabes | Well, this is the source: map key] (. clojure.lang.RT (find map key))) |
| 17:45 | Chousuke | ah, right, it returns the entry. |
| 17:46 | AWizzArd | Raynes is our bot operator :-) |
| 17:46 | Raynes | :p |
| 17:46 | mabes | Too bad tinyurl broke |
| 17:48 | Raynes | mabes: That's why sexpbot uses bit.ly. :> |
| 17:49 | Raynes | Sadly, it doesn't have the definition lookup stuff. |
| 17:49 | Raynes | :\ |
| 17:49 | Raynes | But! It has walton. |
| 17:49 | Raynes | $walton doseq |
| 17:49 | sexpbot | Raynes: http://getclojure.org:8080/examples/doseq |
| 17:49 | mabes | ah, very nice |
| 17:50 | Raynes | defn: <3 |
| 17:53 | mabes | Raynes: where does sexpbot's code live? |
| 17:53 | remleduff | Is the "id" attribute not supposed to be unique? I'm looking at the walton page source and it has <div id="post"> for every post. Wish they'd get out from port 8080 so I could use the site at work :\ |
| 17:53 | mabes | Raynes-: : where does sexpbot's code live? |
| 17:55 | Raynes | mabes: Sorry about that. |
| 17:55 | Raynes | Wouldn't let me send. |
| 17:55 | Raynes | mabes: It's http://github.com/Raynes/sexpbot |
| 17:57 | mabes | nice, thanks |
| 18:02 | defn | hehe Raynes :) |
| 18:07 | Bendlas | /j #clojure-casual |
| 18:59 | Bendlas | can you tell me the reason why `java -cp classes/ clojure.main` won't work, when `java -cp clojure.jar clojure.main` does? |
| 19:00 | Bendlas | fails with java.lang.ExceptionInInitializerError caused by a NullPointerException |
| 19:09 | cemerick | is there anyone maintaining a clojure 1.2-compatible compojure 0.3.2 branch? |
| 19:45 | shales | maven just downloaded a new clojure-contrib 1.2.0-SNAPSHOT and I'm getting this error Could not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj on classpath: |
| 19:46 | shales | sure enough, I don't see anything in the clojure-contrib.jar for duck_streams. Anyone seeing this error too? |
| 19:47 | remleduff | Sounds like you need to use clojure.contrib.io instead (it moved) |
| 19:47 | remleduff | But you must have been on a really old 1.2.0 snapshot |
| 19:47 | shales | I'm not using duck_streams anywhere that I know of though |
| 19:48 | Raynes | shales: A library you depend on might be trying to use it. Check the stacktrace and see if it talks about a file in a jar you're depending on. |
| 19:48 | Raynes | shales: I ended up having to update 3 different projects to use Clojure 1.2 yesterday to update sexpbot to Clojure 1.2. |
| 19:49 | shales | oh, good point. I'll check the other libraries |
| 19:51 | shales | hmm, I'm using the latest version of the libs that are on clojars, but that might not be good enough |
| 20:33 | slyphon | is it possible that the classloader would behave differently on linux and mac os-x when stuff is being loaded through slime |
| 20:33 | slyphon | ? |
| 20:33 | slyphon | https://gist.github.com/a3a4516a79c4ce0fe109 |
| 20:34 | lancepantz | anyone know how github computes their language popularity lists? |
| 20:36 | technomancy | lancepantz: it's by number of repositories that contain at least one file of a given lang |
| 20:37 | slyphon | technomancy: hai! |
| 20:37 | slyphon | technomancy: what do you know about classloaderS? |
| 20:37 | technomancy | less than I should? |
| 20:37 | hiredman | there be dragons |
| 20:37 | lancepantz | that makes sense |
| 20:38 | technomancy | github languages ranked by bytes: sonia |
| 20:38 | slyphon | its' weird, i get that traceback above when running on linux but not on mac os-x |
| 20:38 | technomancy | rather: http://gist.github.com/118810 |
| 20:38 | technomancy | weird... IME classloader issues are a lot more common on OS X due to the hacks they have for "native-feeling" swing |
| 20:39 | slyphon | there are a bunch of hits on google related to Spring and other containers, but i don't know enough to even start |
| 20:39 | slyphon | well, that might be overstating it |
| 20:40 | hiredman | you didn't use add-classpath did you? |
| 20:40 | technomancy | dependency injection doesn't play nice at all with Clojure in my experience |
| 20:40 | slyphon | hiredman: nope |
| 20:40 | hiredman | just making sure |
| 20:40 | technomancy | but that was with Maven's, not Spring |
| 20:41 | hiredman | wow |
| 20:41 | slyphon | i even grabbed the standalone jdk distro from sun and same thing happens |
| 20:41 | slyphon | (just to make sure it wasn't the package maintaner being cute) |
| 20:42 | slyphon | also |
| 20:43 | slyphon | when i run lein repl, and run the tests (how that bug gets triggered) it works fine |
| 20:43 | slyphon | it's only from slime that it throws that exception |
| 20:43 | slyphon | which is interesting |
| 20:44 | hiredman | perhaps you need to restart slime? |
| 20:45 | slyphon | tried that |
| 20:45 | slyphon | couple of times |
| 20:45 | slyphon | it's really strange that swank-clojure "causes" the issue |
| 20:45 | hiredman | what about slime connecting to lien swank? |
| 20:46 | slyphon | that's the thing |
| 20:46 | slyphon | *that* is when the issue happens |
| 20:46 | slyphon | lein repl it works fine |
| 20:46 | hiredman | and what about swank-clojure-project? |
| 20:47 | slyphon | that i dont' have set up because i need to pass properties on the command-line |
| 20:47 | slyphon | i guess i could get around that by loading them when i init my stuff |
| 20:49 | technomancy | swank-clojure-extra-vm-args may also do it |
| 20:49 | slyphon | only thing that's kind of annoying about that is there doesn't seem to be a way of making that per-project |
| 20:50 | technomancy | you can use .dir-locals to set it in elisp |
| 20:50 | technomancy | if you're on emacs 23+ |
| 20:51 | slyphon | on linux i'm using 22, font rendering is AFU in ubuntu in 23 |
| 20:51 | slyphon | spent a few hours chasing this one down: https://bugzilla.redhat.com/show_bug.cgi?id=517272 |
| 20:52 | technomancy | weird; never seen that one. is that the emacs-snapshot package? |
| 20:52 | slyphon | nope |
| 20:52 | slyphon | wlel |
| 20:52 | slyphon | both, actually |
| 20:52 | slyphon | emacs23 and emacs-snapshot |
| 20:52 | slyphon | *and* i checked out the code and built by hand, but i pulled from a git repo, and i think it was an old cut of the code |
| 20:55 | slyphon | hrm |
| 20:55 | slyphon | what happened to java-utils in clojure-contrib? |
| 20:56 | technomancy | it got split up into a number of other nses |
| 20:56 | slyphon | ah |
| 20:56 | technomancy | c.c.io, c.c.properties, possibly more |
| 20:56 | slyphon | ahh |
| 21:00 | slyphon | oh ffs |
| 21:06 | slyphon | hiredman technomancy: running it with swank-clojure-project works... |
| 21:07 | technomancy | so lein swank runs in a subclassloader in order to keep leiningen's deps separate from your project's |
| 21:08 | technomancy | repl hasn't been fixed to do this yet (though that's a bug) |
| 21:08 | technomancy | so there must be something about the root classloader that isn't getting propagated to the project classloader |
| 21:08 | technomancy | the only other time this has been an issue is with OS X gui classes |
| 21:08 | slyphon | and how is swank-clojure-project different? |
| 21:09 | slyphon | it's java.lang.reflect.Proxy.getProxyClass() |
| 21:09 | slyphon | referenced in a number of other posts |
| 21:09 | technomancy | swank-clojure-project calculates the classpath in elisp rather than clojure |
| 21:09 | technomancy | so it lets your project use the root classloader |
| 21:09 | slyphon | ahh |
| 21:09 | technomancy | you can force leiningen to fork a new JVM for your project instead of using a subclassloader |
| 21:09 | technomancy | it'll be slow, but it will probably sidestep the problem |
| 21:10 | technomancy | you can do it by setting a dummy value for :native-path in project.clj |
| 21:10 | slyphon | hm |
| 21:11 | slyphon | well, i'm ok with running swank-clojure-project |
| 21:11 | slyphon | so |
| 21:11 | slyphon | emacs question |
| 21:11 | slyphon | do you have to set swank-clojure-extra-vm-args inside the "custom-set-variables" sexp |
| 21:11 | slyphon | ? |
| 21:11 | slyphon | or can you just do setq ? |
| 21:12 | technomancy | setq is fine |
| 21:12 | slyphon | mm'kay |
| 21:12 | technomancy | gotta jet; hope you get it figured out |
| 21:12 | slyphon | yeah, thanks for the hlep |
| 21:12 | slyphon | :D |
| 21:12 | technomancy | you can post to the lein mailing list if you get stuck |
| 21:12 | slyphon | kk, tyvm |
| 21:30 | defn | how do we use the new version of contrib? im using clojure-contrib 1.2.0-master-SNAPSHOT |
| 21:30 | defn | how do i add the one in which we have .io instead of .duck-streams, etc. |
| 21:30 | hiredman | lose the master |
| 21:31 | defn | wonderful -- thanks |
| 21:32 | Raynes | defn: Did you ever checkout irclj? |
| 21:32 | Raynes | check out* |
| 21:32 | defn | Raynes: that question i just asked is directly related to me playing with irclj :) |
| 21:32 | defn | I needed to get the new SNAPSHOT to use .io etc. |
| 21:33 | Raynes | Ah. :p |
| 21:33 | slyphon | argh |
| 21:33 | Raynes | defn: If you see anything obvious that needs added, leave me a $mail or something. It's definitely lacking right now. At least it's enough for sexpbot for now. :> |
| 21:33 | slyphon | anti-aliasing is the *worst* idea |
| 21:34 | defn | in emacs 23? respectfully disagree. |
| 21:34 | slyphon | no no |
| 21:34 | slyphon | firefox |
| 21:34 | defn | oh |
| 21:34 | defn | Raynes: I will definitely do that |
| 22:07 | slyphon | is the stderr output captured when you do swank-clojure-project? |
| 22:08 | slyphon | oh, nvm |
| 22:15 | defn | slyphon: you fixing up swank-clojure-project? |
| 22:15 | slyphon | well, i got it workin' for me |
| 22:15 | defn | slyphon: i believe there is a problem with it picking up the resources directory -- not sure if that's in the scope of things you're messing with |
| 22:15 | defn | but that'd be a nice thing to fix |
| 22:16 | slyphon | hrm, i just link the stuff i need from resources/ into classes/ which is probably The Wrong Way |
| 22:16 | slyphon | i only have 1-2 properties files i use |
| 22:16 | defn | *nod* |
| 22:17 | slyphon | i think you should be able to put that in swank-clojure-extra-classpaths |
| 22:19 | defn | slyphon: oh right, that makes sense |
| 22:21 | slyphon | i mean, it'd be nice if it picked that up automagically, but i dunno how to do that without reading through the .el |
| 22:27 | defn | no worries, just thought id ask |
| 22:53 | slyphon | hrm |
| 22:59 | slyphon | sooo, if i want to tweak one or two methods on c.test/report, what's a good way to do that? |
| 22:59 | slyphon | "methods" look like Special Creatures |
| 23:08 | slyphon | is it possible to copy a method impl? |
| 23:09 | slyphon | or rather a "multi", then tweak your version, like "subclassing" |
| 23:29 | technomancy | what kind of things could cause the JVM to exit even after shutdown-agents is run? |
| 23:29 | technomancy | maybe some rogue thread kept alive? |
| 23:29 | slyphon | to not exit? |
| 23:30 | slyphon | usually it's a rogue non-daemon thread |
| 23:30 | slyphon | in my experience |
| 23:30 | slyphon | technomancy: do you know if it's possible to override a single defmethod ? |
| 23:30 | slyphon | like, if you wanted to override clojure.test/report :end-test-var |
| 23:31 | technomancy | I think you can just defmethod over the same dispatch value |
| 23:31 | technomancy | but I don't know how to preserve the old one |
| 23:31 | slyphon | yeah, i'm actually writing a post to the group about that |
| 23:31 | slyphon | it doesn't seem possible, really, looking at c.t.junit |
| 23:31 | slyphon | and reading the defmulti code |
| 23:31 | technomancy | you could probably do it with some Java calls |
| 23:32 | technomancy | yeah, not great |
| 23:34 | technomancy | you could just write a defmulti whose default method just calls the old one |
| 23:34 | slyphon | HMM |
| 23:35 | technomancy | nothing wrong with that apart from one extra call |
| 23:35 | slyphon | yeah, but i have to bind over clojure.test/report |
| 23:35 | slyphon | before running the tests |
| 23:35 | technomancy | oh, can't do that in 1.2 |
| 23:35 | slyphon | can't do what? |
| 23:35 | technomancy | oh, never mind |
| 23:36 | slyphon | maybe aliasing the original? |
| 23:36 | technomancy | direct binding inhibits you from rebinding most functions bound to vars beginning with "clojure" |
| 23:36 | technomancy | but clojure.test/report is explicitly excluded |
| 23:36 | slyphon | ah |
| 23:38 | technomancy | remleduff: hey, are you going to submit that repl patch as an assembla issue? |
| 23:39 | remleduff | I don't have a CA in place at the moment, go ahead if you want to :) |
| 23:39 | technomancy | ok, cool |
| 23:53 | slyphon | technomancy: w00t! |
| 23:54 | slyphon | technomancy: http://gist.github.com/369247 |
| 23:59 | technomancy | heh; what's harpo? |
| 23:59 | slyphon | oh, heh, that's my project i'm working on, i name all our major infrastucture projects after Marx Brothers |