#clojure logs

2010-04-16

00:05johnmn3I 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:17remleduff_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:17carkhremleduff_: no
00:17johnmn3ok, so with defrecord we can treat an object like a map, with the keys/vals as getters and setters?
00:18johnmn3ok, I think I see.
00:46technomancyremleduff_: if you have one namespace that requires all the others, you can require it with reload-all: (require 'my-root-namespace :reload-all)
00:46technomancyand all the dependent ones will get loaded
01:33Licenser_greetings
01:51zmilare
02:49vIkSiThmm. quick question. I'm fetching some data using http.agent and the result comes out as a clojure.lang.lazyseq.
02:49vIkSiTI was wondering - how do I convert this to text? (The result is actually in JSON format, from the representation)
02:50vIkSiToh got it.
02:50zmilalazy seq of what? you can convert seq into text by (str )
02:52slyphonanyone run into problems like: java.lang.IllegalArgumentException: interface com.atomikos.datasource.pool.Reapable is not visible from class loader
02:52slyphonthis code works on Mac OS-X, but linux seems unhappy with me
03:01piccolinoI'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:05maehi, need a job
03:05maein california
03:05maeclose to bakersfield
03:07piccolinoOops, there it is, nevermind.
03:07maeboom.
03:08slyphongoes the dynamite
03:08maeice ice baby...
03:08maeso here is my lament, if anyone cares:
03:09maei have been involved in open source with the ruby/ror and haskell/happstack
03:09maetook steady boring job, administrating windows, bla bla, we make carrots
03:10maenow i like clojure, but stuck at nice but boring (not using my skills) job
03:10maethe end
03:10slyphonsuch is life?
03:11maeanyone want a free programmer to see if i am any good? for prospects of future jobs?
03:11mae*sombered look*
03:11maeok time to go make some baby bottles
03:11maethe irc monologue is *definitely* not represented on twitter
03:11maeso alas i am here
03:19maewrong channel i guess
03:21Licenser_morning
03:21maemorning
03:21Licenser_mae: I feel your pain
03:22Licenser_So I'd take a free programmer but I don't have a job for you :P
03:25maelol
03:25maethats the bottom of the bottom
03:25maeso uh, what do you do then?
03:26Licenser_mae: why is that the bottom of the bottom :P I don't need one for commercial work, I'm not that low ;
03:26Licenser_)
03:26Licenser_we're installing servers for TelCo's
03:26maecool
03:27Apage43mae: I am on a support/operations team at work
03:27maethe problem i face is that my job is way easy, and my skills are atrophying
03:27Apage43i have clojure on my box
03:27Apage43and use it in pressing situations to quickly write things like log-file analyzers and monitors for things
03:27Licenser_mae: yea that is why I write open source stuff in my free time so I don't get rusty
03:27maeheh
03:27maei will not bcome a blog
03:27maeugh
03:27maeblob
03:28Licenser_a blob?
03:28maeyes
03:28Licenser_as in a table cell that can helpd binary data?
03:28maeLicenser_: must be nice, does it pay well
03:28Licenser_writing open source? does not pay :)
03:28maeno kidding
03:28maei hate that
03:28maei could get 3 sap jobs
03:29Licenser_well it gives me the fluffy warm feeling of doing something good
03:29maebefore i get one open source job
03:29maeits not good if no one uses it for something useful
03:29maeit is practically masturbation
03:29Licenser_well look at rhickey he writes clojure open source and it is a darn good thing
03:29maetrue
03:29Licenser_mae: is science mastrubating?
03:29pdif it's good science
03:30Licenser_heh
03:30maelol
03:30LauJensenMornin team
03:30Licenser_morning LauJensen
03:30maebut what i need, to make clojure rock, is a useful thing to create, for a real purpose
03:30maeso that way i can find the bugs
03:30maeand it is achieving something
03:30Licenser_there are no bugs, there are only feature
03:30maeuntil i have a real reason, it will be crap
03:30maethis is my opinion
03:31Licenser_mae: clojure is so young that you still can write usefull tools/libs that contribute to the comunity
03:31maeLicenser_: spoken like a true glass-half full kind of guy :)
03:31Licenser_mae: I am :)
03:31maeLicenser_: 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:31maeheh
03:31Apage43mae: just try and use clojure for the next thing you need to do
03:31Licenser_unless it comes to work related topics I am a hopeless optimist
03:31maeLicenser_: same here.
03:32LauJensenmae: So whats the problem? Get to it
03:32maeApage43: i haven't done anything, thats the point, i haven't been using that skillset, i'm a sysadmin
03:32maeLauJensen: heh, well thats why i'm here
03:32Apage43What kind of sysadmin?
03:32maei'm looking for something useful to program
03:32Licenser_mae: technically I am a system integrator, still I write clojure code to optimize as much stuff as I can
03:32maeand someone with a bit of business sense
03:33maeLicenser_: interesting
03:33Apage43I 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:33Apage43for example.
03:34maemae: 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:34maeso you have to find a money use in my opinion
03:34LauJensenmae: Just reading the log I'd really advice against offering free services
03:34pdmae: 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:35maeLauJensen: i guess i was going for a bait and switch :)
03:35pdopen source doesn't pay but sometimes open source friends know people who do
03:35maepd: really, does that work for you?
03:36pdit has, yes, and i've seen it work even better for people who, erm, "invest in the community" more than i do
03:36maei have a few days when i could program
03:36Licenser_mae: I got a friend a job at my company because I worked with him before and truste dhim
03:36mae5 days off from work, hanging out at home
03:36maestarting saturday
03:36maepd: heh
03:36maepd: i guess i'm lazy
03:37maei know i can fix bugs but it doesn't seem glamourous
03:37Apage43in 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:37Licenser_mae: I'm nut sure either lazy or smart :P
03:37maei'm a bit of a premadonna in case you haven't noticed
03:37maebut i'm a talented one
03:37mae: )
03:37Apage43ideas don't manifest themselves under that kind of pressure for me
03:37mae<-- conceited
03:37Apage43*shrug*
03:37maeheh
03:37maeyeah
03:37maewell
03:37Licenser_but Apage43 I agre either you have a great idea or you don't
03:38maefor 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:38maelarge *
03:38maei'll even do it dirt cheap
03:38Apage43mae: think about anyone you know that might be able to pay for for a project
03:38maeas long as the goals are concrete
03:38maeApage43: i see
03:39maeApage43: so feed off of someone elses creativity? that doesn't sound like a bad idea
03:39Apage43i 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:39Apage43not creativity leeching, the place happens to have a need that isn't adequately filled currently.
03:39Apage43Just see if there's someone who's life you can make easier :]
03:39pdyou could try door-to-door programming
03:40maeApage43: market thineself?
03:40Licenser_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:40Apage43mae: rather, network.
03:41maeApage43: 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:41Apage43i didn't ask around
03:41Apage43people who know me know what i can do so when they hear that thing X needs doing they know I can do it.
03:42maeApage43: that sounds like a good way to approach it
03:43maeApage43: 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:43maeApage43: good for you
03:43Apage43not that i enjoy my day job >.>
03:44maehehe
03:44maei think you could probably make it enjoyable
03:44Apage43yeah. corporate politics.
03:44maemy problem is i am underpaid for my position, and upward growth is hard right now
03:44maeApage43: i have alot of politics
03:44Apage43and an anomalous situation resulting in me being paid.. not very much at all for what i do.
03:45Apage43I am.. probably more skilled than most folks I've met and paid the least.
03:45maeApage43: i feel as if i am in a similar boat
03:45maei wouldn't believe it if you said it on twitter though
03:46maeon irc i do believe it
03:46Licenser_is irc a more trustworthy medium? o.O
03:46maewell
03:47maelets just say the 'OG's of open source tend to be on irc
03:47maethe flashy ruby crowd started the twitter thing :)
03:47Licenser_there are a lot of smart ruby folks
03:47maeyeah i know
03:47maejust saying
03:48Apage43*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:48maei consider an irc'er to be of a higher pedigree than a twitter person
03:48maegenerally speaking of course
03:48maeApage43: lol1
03:48maethe ftp thing is interesting
03:49Apage43or 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:49maei am the only sysadmin out of 3 that has any real linux experience, and really understands networking
03:49maethey for instance, couldn't even calculate a subnet mask to save their lives
03:50Apage43yeah. 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:50Apage43"I have no idea what you just said."
03:50maehaha
03:50maelet me guess
03:50mae"what port is it?"
03:51Apage43well this was a NAT issue so it was a bit more complex than that
03:51maemost people think that blocking certain ports will prevent certain services
03:51maehttp running on 80, for instance
03:51maeanyone with half a brain knows thats not true
03:52maei think that computer professionals have started to fit on the bellcurve
03:52maethere is os much demand that quality will vary alot
03:52mae(for computer services, for example)
03:53Apage43on 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:54maeso 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:54maeyeah quantifying that stuff is hard sometimes
03:55maein any case, i am going to keep looking, suggestions welcomed
03:55Apage43fun fun, enjoy.
03:55maeand in the meantime i will continue to slay the business objects beast (now sap) daily
03:56Apage43*shudder*
03:56Apage43we're undergoing a huge SAP upgrade right now
03:56maefantastic!
04:33vegaiwhat graphics libraries does clojure/java provide, for gaming purposes?
04:35hoeckvegai: clj-processing, a third party lib to processing
04:35hoeckvegai: or use java gaming frameworks, eg. slick2d
04:36hoeckvagai: clojures java interop features are so good, you often won't need a specific clojure wrapper for those java libs
04:37vegaiaye
04:38vegaiI've effectively avoided touching Java for a long time, so I'm a bit blind to whatever it provides
04:39AWizzArdvegai: 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:39hoeckfor very simple games, a use swing JPanel and its update method wich lets you draw directly via point, line etc methods
04:40LauJensenvegai: For Gaming you have 2 good options, 1) Penumbra, 2) JMoneyEngine, the latter being a complete gaming engine
04:43eevar2vegai: jogl, if you just want plain opengl drawing
04:47LauJensenor Slick2D, but I couldnt get any decent performance out of it
04:47LauJensen(I might be the problem in that case though =))
05:18AWizzArdMoin cemerick.
05:18AWizzArdWas there some update yesterday, regarding auto constructors/factories for records?
05:20cemerickAWizzArd: :-)
05:20cemerickIt sounded like the status quo will hold for a little while.
05:21AWizzArdcemerick: 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:22cemerickIt 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:24Chousukehm
05:24LauJensenI didn't understand the objection to the c/create syntax - Is it because it would then replace the period sugar ?
05:24Chousukewhy 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:28AWizzArdcemerick: 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:28AWizzArdAnd indeed, for some I have (defn (make-foo [a] ...) (make-foo [a b c] ...))
05:29edbondvimclojure problem: Could not determine the Namespace of the file. how to fix?
05:30cemerickChousuke: I think that's the direction that the factory fns will come in. Otherwise, I figure, why not reuse Foo. and (new Foo ...)...
05:30edbondsolved: CLASSPATH=src ~/vimclojure/bin/ng-server
05:30AWizzArdLauJensen: 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:30cemerickor, I should say, Foo. is going to be there regardless, so why bother with another form for a simple ctor.
05:31LauJensenSimpler is better
05:31licoresseif I wanted to write (comp dec dec dec) using some sort of repeat, how to?
05:31cemerickLauJensen: ach, my last to Chousuke was for you ^^
05:31cemerickit's too early
05:31LauJensenah
05:31AWizzArdcemerick: yes, Foo. would be enough imo, when people are writing their make-foo's anyway
05:34AWizzArdThe most annoying thing about an auto-generated create-Foo would be that uppercase ‘F’.
05:34cemerickstuff like that is just the tip of the iceberg w.r.t. auto-generated fns IMO
05:35AWizzArd;-)
05:35LauJensenWhats 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:36cemerickno, you don't
05:36cemerickit's been proposed, though
05:36AWizzArdIn 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:36cemerickit's not all aesthetics
05:36LauJensenAWizzArd: I must admit I cant see far enough into the future to predict if either model will produce problems
05:36cemerickif there's one way to create a thing in clojure, that's good
05:37LauJensenAgreed
05:37AWizzArdLauJensen: 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:37LauJensenAfter reading some Ruby code, I've really come to appreciate how all Python code looks so much the same
05:38cemerickIf there's to be more than one, the others should be discoverable and different enough in functionality to warrant the distinction.
05:39AWizzArdAnd the question is, if create-Foo is auto-generated, what more can it offer than Foo.?
05:39AWizzArdokay, can be used in (map create-Foo (bar))
05:40AWizzArdBut then I would still have to write my own (defn make-foo [a b] (create-Foo a (bar b)))
05:47AWizzArdcemerick: 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:48cemerickyou could probably do it, but it wouldn't be pretty
05:48AWizzArdBecause 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:48cemerickOIS 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:48AWizzArdi.e. one output file containing all serialized data
05:49cemerickseems like a painful, difficult path tho
05:49LauJensenOIS?
05:49cemerickObjectInputStream
05:49LauJensenthx
05:49AWizzArdOr, I could have a Java class ClojureRecord with the fields recordType and serializedString and have those serialized?
05:51AWizzArdthen (.writeObject (ClojureRecord. (type my-rec) (with-out-str (binding [*print-dup* true] (print my-rec)))))
05:51cemerickyeah, you *could*. The whole thing is way over the line of being a custom database format tho.
05:52AWizzArdin fact i need this for a db format :-)
05:52AWizzArdmy soon-to-be-released Clojure DB
05:52cemerickoh, right, you write your own databases
05:53cemerickIMO, all those options are going to be horribly slow and difficult to maintain.
05:53cemerickEspecially any time you're using the clojure reader to deserialize data, that's a slow, slow path.
05:54LauJensenreally? Why
05:56cemerickIn the simplest case, writing and reading a number as a string vs. using DataOutputStream et al. is slow.
05:56cemerickthere's just much, much more to do
05:57LauJensenYea ok. And the Java strings are huge
05:57AWizzArdthe 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:58cemerickLauJensen: huge?
05:58LauJensen2 bytes per char
05:58AWizzArdBut in the end any kind of data needs to be mapped to some representation which can be mapped to that specific object
05:58cemerickright, UTF-16 internally. Welcome to an international world. :-)
05:59cemerickLauJensen: you should appreciate that :-)
05:59LauJensencemerick: Actually I dont , but I live with
05:59LauJensenit
05:59cemerickLauJensen: you'd rather have a multitude of slightly different encodings?
05:59AWizzArdI would appreciate that more if the primitive chars would be 4 bytes and can each represent any unicode char.
06:00LauJensenDanish 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:00cemerickAWizzArd: BMP's not wide enough? ;-)
06:00cemerickha
06:00cemerickAn American Imperialist in Denmark! :-D
06:01LauJensencemerick: Dont get me wrong - I didn't say a single good thing about America, nor the language you stole :)
06:01cemerickEmbrace and extend.
06:01AWizzArdcemerick: for the first version i need something simple and human-readable, even if it is performance wise not the fastest serialization/deserialization
06:02cemerickI should get my clj-dbm project out there. That might be interesting to some.
06:02AWizzArdToo bad that the US did not vote to have german as their primary language
06:02AWizzArdThere was this (probably wrong) rumor, than german lost only by 1 or 2 voices ;)
06:02AWizzArdhttp://german.about.com/library/weekly/aa010820a.htm
06:02sexpbotGerman the Official US Language?
06:03cemerickthat's funny
06:15AWizzArdI want: (foo Integer) ==> "java.lang.Integer"
06:15AWizzArd,(str Integer)
06:15clojurebot"class java.lang.Integer"
06:16AWizzArdfor my own defrecord, producing the classname + ns
06:16cemerick,(.getName Integer)
06:16clojurebot"java.lang.Integer"
06:16AWizzArdworks, thanks
06:17AWizzArdAlthough in the macro it looks like ~(.getName (eval type))
06:17AWizzArd(my-macro Foo) ==> "user.Foo"
06:18LauJensenAWizzArd: if you're in Emacs, hit C-c I and type Integer, that'll give you a list of all its methods
06:18LauJensen(and statics and fields)
06:18AWizzArdLauJensen: good trick, thx
06:19LauJensennp
06:22AWizzArdis there a clojure functions which shows me all superclasses and interfaces of a given class/object?
06:23AWizzArd,(parents Integer)
06:23clojurebot#{:clojure.contrib.math/integer java.lang.Number :clojure.contrib.json.write/pr :clojure.contrib.pprint.examples.json/pr java.lang.Comparable}
06:23AWizzArdok
06:23LauJensenThat and ancestors might be of interest to you
06:24AWizzArdOh good.
06:25hoeck,(-> {} class supers)
06:25clojurebot#{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:25LauJensenWow 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:25hoeck:)
06:34AWizzArdcemerick: btw, can Java only deserialize objects of Classes that were not dynamically produced?
06:34AWizzArdI mean, is that the reason why defrecords need to be AOTed to be deserializable?
06:34cemerickit can only deserialize objects of classes that have stable names
06:35AWizzArdBut defrecords now do have stable names I think.
06:35cemerickYes, that's my impression as well.
06:35AWizzArd(defrecord Foo ...) always produces namespace.Foo
06:35AWizzArdBut this still can not be deserialized.
06:35AWizzArdRich said it must be AOTed first.
06:35cemerickthe question is whether any inner classes and such have stable names too, which I doubt.
06:36AWizzArdok
07:00LauJensenBrians Brain on the frontpage of Lambda-the-ultimative - It just lives on and on :)
07:29AWizzArdMaybe Contrib could provide an efficient and general way for serialization.
07:30AWizzArdSomething 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:22AWizzArdcemerick: could we have in 1.2 something else than print-dup, based on Protocols (vs. defmethod print-dup ..)?
08:22Licenser_(doc print-dup)
08:22clojurebot"; "
08:22Licenser_wow that is helpful :P
08:23cemerickprint-dup is undocumented on purpose
08:23AWizzArdhmm
08:23Licenser_so noone uses it?
08:23cemerickit's really quite experimental, for all these reasons
08:23cemerickno, it's used :-)
08:23AWizzArdbut not encouraged
08:23Licenser_just noone knows what it does :P
08:23cemerickAWizzArd: yeah, that's possible. Likely not until/unless rhickey adds some kind of dispatch precedence to protocols, tho.
08:23AWizzArdLicenser_: you can use it via (binding [*print-dup* true] (print your-object)
08:24Licenser_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:24AWizzArdcemerick: what are the options? I thought it will dispatch on the type of the first arg? Maybe with Multiprotocols this would change.
08:24cemerickthe options for what?
08:25AWizzArdfor dispatch precedence?
08:25cemerickI'm definitely not the person to look at for that. Multimethods are pretty good in that area, though somewhat verbose.
08:26cemerickThe prefer mechanism can likely be grafted onto protocols, but I get the impression that there's an appetite for a better solution.
08:26AWizzArdThey can dispatch on more than one arg, whereas Protocols support exactly one as I understand it.
08:27AWizzArdThey ==> Multimethods
08:27cemerickright, multimethod dispatch is wide-open
08:27cemerickthey can dispatch on the phase of the moon if you want
08:27AWizzArdThey are nearly as nice/powerful as Pattern Matching :)
08:27Licenser_wooh that would be kind of cool
08:27Licenser_you could implement a wear wolf with that
08:28Licenser_or a wear app
08:28cemerick(defmulti craziness (fn [& args] (if (= :full (phase-of-moon)) :do-this :do-that)))
08:28cemerick^^ not meant as a joke, you could do it
08:30Licenser_cemerick: I figure
09:07AWizzArdCan records now get type hinted? (defrecord Foo [x]) ... (defn bar [#^Foo f] ...)
09:26cemerickAWizzArd: I would think so.
09:30licoresseWhat is defrecord for?
09:31licoresse,(doc defrecord)
09:31clojurebotexcusez-moi
09:32@chouserlicoresse: It's a cross between defstruct and deftype
09:36licoresseok
09:46AWizzArdBtw, could Contrib need for 1.2 a general revision from Multimethods to Protocols?
09:46AWizzArd(and Core maybe too)
09:47LauJensenI'd say absolutely - There's already a lot of code which looks really old
09:48@chouserAWizzArd: for what, print-method and print-dup I guess?
09:48AWizzArdchouser: exactly those I had in mind.
09:49AWizzArdOh, 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:50ChousukeHm, I wonder if making print-method a protocol would solve the problem of re-evaluating core.clj during runtime? :/
09:50Chousukeif you try to do it currently it blows up because print-method gets redefined and loses all the defined methods
09:50@chouserAWizzArd: that actually came up already, in the "coding standards" thread, and got beat back. Thankfully.
09:51Chousukeit could be in a comment though, just to remind people ;P
09:51AWizzArdchouser: is there a list pro/con for that?
09:52RaynesHas sexpbot been good whilst I slept? :>
09:52@chouserAWizzArd: you really want every single var and local typehinted?
09:54AWizzArdI am personally trying to type-hint as much as possible
09:54Chousukeactually *changing* the value of *warn-on-reflection* in library code would be rude
09:55AWizzArdWell, it could be set to true only before compilation then, to make the author(s) aware of reflection warnings.
09:55@chouserI try to type-hint as
09:55Chousukethat might be useful
09:55AWizzArdProbably maven can do that automatically ;-)
09:56@chouserI try to type-hint as little as possible
09:57AWizzArdtype-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:57Chousukewell, getting rid of reflection in library code is a good thing
09:57Chousukeeven if it is in a function that is not a bottleneck
09:58@chouserit is ugly, hosty, and can pin things to specific type unnecessarily
09:58Chousuke"hosty" :P
09:59AWizzArdugly: 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:00AWizzArdOn 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:00cemerickis it hard to turn on reflection warnings when one cares to see them?
10:01LauJensencemerick: You mean those cute 38 (!!!) lines from your video ?
10:02cemerickLauJensen: I said I wasn't going to bring it up. ;-)
10:02cemerickoh, can other people see those /me msgs? :-D
10:03AWizzArdchouser: 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:03LauJensenOh 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:03AWizzArdWhen people use host-specific methods, then why shouldn't do hosty communication?
10:04LauJensen~google define: hosty
10:04clojurebotFirst, out of results is:
10:04zmilajust install 299MB Eclipse! :)
10:05AWizzArdtechnomancy: how difficult would it be to have a visible/invisible switch for type hints in clojure-mode? ^^
10:10Raynes"I'm installing Eclipse because Emacs is bloated." - Some guy, somewhere on the internet.
10:11RaynesLauJensen: The google Ajax API doesn't support define: or math.
10:16rsynnottHmm, 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@chouserrsynnott: 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:21AWizzArdrsynnott: or wait 2-3 weeks until I release my Clojure DB :-)
10:23@chouserLauJensen: now you're getting it.
10:23LauJensenchouser: I somehow knew that would catch your attention :)
10:25AWizzArdAnyone here using Cells?
10:25LauJensenAWizzArd: And if so, would they please write a little tutorial
10:25Raynes+1
10:26RaynesConsidering I have no clue what 'cells' are in this context.
10:26Raynes;)
10:26RaynesYamNad: ohai
10:26YamNadHi.
10:26AWizzArdI 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:27AWizzArdBut this outputs now ‘java.lang.ClassNotFoundException: user.Editable (cells.clj:20)’
10:27AWizzArdIf 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:28AWizzArdJust when I start a repl and try to compile my code the first time. A direct second recompile works fine then.
10:31licoresseDoes it matter what order the namespaces appear in :require?
10:32Chousukeit shouldn't
10:32cemerickit does if the namespaces are doing stateful, interdependent things.
10:32Chousukeie. if they're broken ;
10:32ChousukeP
10:32licoresseright...
10:32Chousukelike my smiley there
10:38rsynnottchouser: ah, yes, that's sort of obvious :) Thanks
10:38rsynnottAWizzArd: what is the nature of your clojure DB? :)
10:38@chouserI'm all about the obvious answers.
10:39slyphontechnomancy: 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:40AWizzArdone sec, about my load-file problem here: http://pastie.org/923220
10:40AWizzArdIf somebody could please have a look at this and point out a way how to load the cells.clj without triggering this warning.
10:41AWizzArdIf 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:42LauJensenAWizzArd: You should check out gist.el
11:00RaynesAw. You can't merge into defrecords. :(
11:01AWizzArdWhat would you like to do?
11:01Raynes(merge (Stfu. 3 3) {}), essentially.
11:03stuartsierraRaynes: 'into' might work
11:03Raynesstuartsierra: Ooh, good idea.
11:03Raynesstuartsierra: That did it. :D
11:04RaynesI'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:12whiddenIs there a practical limit on the number of functions 'comp will work with?
11:12AWizzArdno
11:13stuartsierrain a single invocation, yes
11:13stuartsierraprobably the JVM method size limit
11:13stuartsierraunless it's recursive
11:13stuartsierraso no
11:14stuartsierraBut eventually your stack traces will look like fn__1234$fn__2345$fn__3456$...
11:15whiddenyes, but that's ok for me at the momemt.
11:16whiddenbecause i hardly never make errors.
11:16stuartsierraheh
11:17Chousukehmm
11:17Chousuke,(apply comp (repeat 10000 +))
11:17clojurebot#<core$comp__4952$fn__4971 clojure.core$comp__4952$fn__4971@e4cde8>
11:17stuartsierra((apply comp (repeat 10000 +)) 1)
11:18stuartsierra,((apply comp (repeat 10000 +)) 1)
11:18clojurebot1
11:18stuartsierrawow
11:18Chousukecomp doesn't actually create a new function
11:18stuartsierra ,((apply comp (repeat 10000 inc)) 1)
11:18Chousukea new class, that is
11:18Chousukestuartsierra: extra space
11:18Chousuke,((apply comp (repeat 10000 inc)) 1)
11:18clojurebot10001
11:19stuartsierraah
11:19whidden,(time ((apply comp (repeat 10000 inc)) 1))
11:19clojurebot10001
11:19clojurebot"Elapsed time: 27.01 msecs"
11:19stuartsierraSo comp with 10000 args doesn't create 10000 fns.
11:19stuartsierraIt just creates 1 fn that calls the 10000 fns in order?
11:20Chousukeyes. comp only creates a closure of an existing function that composes its parameter functions
11:20stuartsierraok
11:20stuartsierraI guess you'd overflow the stack otherwise.
11:20Chousukein general, only a (fn ...) form in code actually creates a new class
11:21stuartsierraright
11:21Chousukeany function returning functions won't generate classes, but instances of a single class
11:22stuartsierraRight, only one class per *literal* (fn...). I always forget that.
11:25AWizzArdhmm, did Cells change recently?
11:25AWizzArdSuch that a LockCell does not have a lock anymore? ;)
11:31AWizzArdyup, a little bug
11:32The-Kennytest
11:32AWizzArdHi The.
11:33The-Kennyhuh, sorry. Erc said my connection was closed.
11:33The-KennyHi, AWizzArd :)
11:41LauJensenThe-Kenny: Odd - I had a disconnect with ERC about an hour ago which stalled Emacs
12:14sergey_miryanov,{:keys [x] {:x 1}}
12:14clojurebotjava.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: 3
12:15sergey_miryanovhi all
12:15sergey_miryanovsomebody can explain what wrongs with {:keys [x] {:x 1}}?
12:17carkhhum you're mixing stuff
12:17carkh(let [{:keys [a]} {:a 1 :b 2}] a)
12:17carkh,(let [{:keys [a]} {:a 1 :b 2}] a)
12:17clojurebot1
12:18carkh{:keys [a]} <- this is a destructuring pattern
12:18carkh{:a 1 :b 2} <- this is literal map syntax
12:19carkhdestructuring patterns go in binding forms like a let or maybe a doseq
12:19carkhor the parameter list of a function
12:20sergey_miryanovo! thanks! you get me a point - I just typo {:keys [x] {:x 1}} -> should be -> {:keys [x]} {:x 1}
12:20carkhah =)
12:20sergey_miryanov*i should go sleep* -_-
12:21sergey_miryanovthanks in any case! :)
12:21carkh=)
12:30AWizzArdrhickey offline to code without interruptions? ^^
12:32mtmI 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:42AWizzArdUh, 1981, a 1gb hd from ibm: http://img147.imagevenue.com/aAfkjfp01fo1i-5704/loc54/66568_1gb_hard_disk_ibm_1981_122_54lo.jpg
12:46AWizzArdAh, there he is :)
12:46AWizzArdwb rhickey
12:47rhickeyhey
12:47rhickeyeveryone rockin' with defrecord?
12:48AWizzArdabsolutely
12:48AWizzArdToday i rearranged my code to use it everywhere.
12:48AWizzArdBut btw, I don’t know if it is related, I may have discovered a little bug in Cells.
12:49AWizzArdIf 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:52AWizzArdFor me this results in nil. May have to do with deftype and the use of :lock as an accessor? *shrugs*
12:52AWizzArdWhen 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:52LauJensenCan somebody link some help explanation+example of defrecord please?
12:52AWizzArdLauJensen: very similar to defstruct
12:53LauJensenHow far can you stretch 'very' ?
12:53AWizzArdjust more efficient
13:10slyphonthe icicles completion guy is scary
13:12timcharperslyphon: Drew?
13:14slyphonyeah
13:14slyphondude has thought *way* too much about completion
13:14timcharperslyphon: hah
13:15slyphonthe sheer volume of documentation on emacswiki is humbling
13:15carkhis icicles bette rthan ido-mode ?
13:15slyphonehhh
13:15slyphoni'm still debating that
13:15slyphoni think ido-mode for buffers is probably better
13:16AWizzArdrhickey: can you confirm that? (:lock (locked-cell 100)) ==> nil
13:16timcharperslyphon: when the way to install icicles was downloading code off of pages from a wiki, I stopped there.
13:16slyphontimcharper: :)
13:16slyphonyeah, i remember those days
13:30hamza(- (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:31jonasenIs this a bug in defrecord or am I doing something wrong? http://paste.lisp.org/display/97880
13:31carkh_brian2_: can you expand a little bit on your qustion ?
13:31dakrone_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:36carkhyou mean something like this ? (map #(%1 some-value) [f1 f2 f3])
13:36dakronestill not getting what you're trying to do
13:37_brian2_well, its a function whose behaviour is conditioned by state
13:38sh10151what you have there is not conditioned by state
13:38sh10151it'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:39sh10151(map (fn [x] ((make-function state1) x)) xs)
13:40_brian2_ok
13:40weissj_brian2_: i'm not sure how what you want is any different than a fn that takes an argument
13:40sh10151or (let [f (make-function state1)] (map f xs))
13:40weissjoh i see
13:41sh10151(doseq [f (map #(make-function %) [state1 state2 state3])] (map f xs))
13:41_brian2_ok
13:41carkh,(let [adder (fn [x] #(+ x %))] (map (adder 2) [1 2 3])) ;the cannonical example
13:41clojurebot(3 4 5)
13:41_brian2_yea
13:42Chousukesh10151: note: #(make-function %) is equivalent to make-function
13:42Chousukeunless of course make-function is a macro
13:43sh10151Chousuke: hehe, thanks :)
13:43sh10151Chousuke: i almost wrote the same out for (map f xs)
13:43_brian2_thnks
13:45Chousukesmall things can improve code readability quite a bit
13:46ChousukeI had to learn out of the habit of typing #(foo %) all the time too :P
13:46ChousukeI think I use partial and comp more as a result, but #() has its place.
13:47Chousukeone just needs to be careful not to overuse it and make the code look like perl
13:48carkhok just for Chousuke :
13:48carkh,(map (partial + 2) [1 2 3])
13:48clojurebot(3 4 5)
13:48Chousukeheh
13:49carkhi think it's harder to understand for a new user
13:49ChousukeI think (partial + 2) is easy enough
13:49Chousukeany new user will just read partial's docstring and get it right away
13:49weissji had a lot of trouble wrapping my head around partial at first
13:50carkhyou'll find yourself having to explain it in terms of lambdas
13:50weissjChousuke: i read the docstring and said "what??" read it again.. and again
13:50weissji get it now, but it's not an easy thing for a noob
13:50ChousukeI've seen much worse point-free expressions in Clojure. Those are the mind-benders
13:51ChousukeI think one contained at least 4 partials and 3 comps
13:51carkhyou can go quite far with those update-in things too
13:51carkhalways a pleasure =)
13:52Chousuke(doc partial)
13:52clojurebot"([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:53Chousukehmm, I suppose that isn't so clear if you're not yet used to thinking about functions as values
13:55Chousukeheh
13:55ChousukeI guess those require a basic understanding of what a form is.
13:56Chousukeso 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:00nipra_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@chouserWhy 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:09clojurebotjava.lang.RuntimeException: java.lang.IllegalStateException: Var null/null is unbound.
14:09@chouserhuh
14:10fogus,64r1
14:10clojurebotRadix out of range
14:10fogusDid that ever work?
14:12jonasenI asked this earlier but didn't get an answer then, maybe someone can help me now..
14:12@chouserhm. I don't think so -- always case-insensitive? so tops out at 32
14:12@chouser36
14:13jonasen Is this a bug in defrecord or am I doing something wrong? http://paste.lisp.org/display/97880
14:13@chouserjonasen: defrecord will behave like a map, so 'count' is already implemented to give the number of key/value pairs it's holding.
14:14@chouserjonasen: 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:14jonasen@chouser: ok, thanks
14:17timcharperSo, I have this monkey patch that makes the closure test library use clj-stacktrace for errors.
14:17timcharperhttp://pastie.org/923567
14:17timcharperHowever, 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:18timcharperhttp://pastie.org/923569
14:18timcharperclojure.test$report__59 cannot be cast to clojure.lang.MultiFn
14:19technomancytimcharper: 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:19timcharperIs there an easy way to tell instead of closure if the application is running under Swank-Clojure?
14:20timcharpertechnomancy: as in emacs clojure-test-mode ?
14:20timcharperemacs is not failing here
14:21timcharperthe Clojure process fails because of some environmental difference induced by swank-server (it seems)
14:21technomancyc-t-m has to hack clojure.test in order to get pass/fail stats
14:21technomancyit's not because of swank-clojure
14:21AWizzArd~seen jcowan
14:21clojurebotjcowan was last seen parting #clojure, 5125 minutes ago
14:21timcharpertechnomancy: oh... okay, so it actually hacks the running Clojure instance?
14:22timcharpertechnomancy: I think I would just prefer to conditionally disable my active running from within clojure-test-mode (if that's the case)
14:22timcharper^my active^my patch from
14:23fogus@chouser: Thanks!
14:24cemerickchouser: I wonder if that condition could be detected and warned about with a better message.
14:24cemerickThat'll become a FAQ pretty quick otherwise, I'll bet.
14:32timcharpertechnomancy: is there some way I can check to see if clojure-test-mode extensions have been loaded from within Clojure?
14:39@chousercan anyone answer my xml question?
14:42vegaifogus: oh, you noticed my nitpicks #2 :P
14:43vegaifogus: 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:45technomancytimcharper: I don't know of a way other than wrapping your defmethod in try/catch; sorry
14:46technomancyc-t-m is a little haphazard; it could definitely be better-behaved
14:46technomancyoh, you could test for the presence of the clojure.test/old-report var; that would d oit.
14:50timcharpertechnomancy: that'd work (I don't know I didn't think about that)
14:50timcharper(wrapping it)
14:52AWizzArdtechnomancy: how difficult would it be to have a visible/invisible switch for type hints in clojure-mode? ^^
14:54technomancyAWizzArd: I don't think it'd be too hard. I'm not too familiar with the necessary APIs, but I know they exist.
14:54technomancycool idea
14:55LauJensentechnomancy: Is there some kind of folding in cm now ?
14:56technomancynothing yet
14:56LauJensenMust 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:03timcharpertechnomancy: the try/catch trick worked, all are happy now. Thank you!
15:04technomancy^5
15:04technomancywould love to see that in action
15:04dnolen_brian2_: you put a multimethod into a map?
15:05_brian2_yes, is that possible ?
15:05_brian2_or plain wrong
15:11arohner_brian2_: you can call multimethods from a map, though your syntax is wrong
15:11arohnerI don't know how to fix it because I don't know what you want to happen
15:11arohner(map #(cc {:category :toys} %) [ 1 2]) is closest to working
15:11arohnerthough that (inc v) won't work
15:12arohnernm, what I wrote should work
15:12_brian2_ok, thnks I need to take a look
15:13Chousukeit looks like you're trying to call functions using foo(bar) syntax :/
15:14_brian2_arohner> "(inc v) won't work", what will?
15:14Bendlashi folks
15:14Bendlashas there been anything done on clojurescript lately?
15:15LauJensenBendlas: Not that I know of, but recently a similar lib named Scripjure was put on Github I believe
15:16arohner_brian2_: actually, (map #(cc {:category :toys} % ) [1 2])
15:16arohnerproduc
15:16arohnerproduces (2 3)
15:16arohner_brian2_: is that what you want?
15:16_brian2_oh, ok
15:16arohnerBendlas: there's http://github.com/arohner/scriptjure
15:16BendlasLauJensen, thanks, that looks interesting
15:16arohnerhttp://arohner.blogspot.com/
15:16sexpbot"/dev/rohner"
15:16arohnerI mean
15:16arohnerhttp://arohner.blogspot.com/2010/04/writing-jquery-code-with-scriptjure.html
15:16sexpbot"/dev/rohner: Writing JQuery code with Scriptjure"
15:18BendlasI wrote something very similar last night, but wanted to investigate before putting more work in
15:19Bendlasarohner, that seems very much like what i was looking for
15:20arohnerBendlas: great
15:26dnolen_brian2_: sorry, yeah, keep fns out of maps
16:05timcharperthe 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:06timcharper(when I evaluate Clojure code via c-c c-r, or use repl in swank-clojure)
16:14licoressetimcharper: yeah, that IS annoying
16:14licoressegrowl support would be nice, if you are on a mac
16:15licoresseI guess there is growl for win as well
16:15licoressehttp://www.emacswiki.org/cgi-bin/wiki/growl.el
16:15timcharperlicoresse: yeah, anything that doesn't take your focus away so when you resume typing you're like "what the heck?"
16:16licoressefor the small messages, I would like it to pop up afloat and not stealing focus
16:21licoressethis one seem more up-to-date: http://github.com/elim/emacs-growl/blob/master/growl.el
16:22timcharperThe trick is tracking down where the function sldb-get-buffer is called
16:37licoresseextract the notes from slime-compilation-finished in slime.el
16:37licoresseand growl the extraction
16:43timcharperlicoresse: I can't tell where the debug window is being allocated and focused though, can you?
16:44licoresseyes
16:44licoressebrb
16:44timcharperallocated, sldb-get-buffer
16:44timcharperBut where is it focused?
16:45licoressethe fouus thing is a pref
16:45licoresseat my system, the frame is just divided
16:45timcharperWhich pref? (Here too)
16:45licoressebut focus does not shift, M-x apropos compiler notes
16:46timcharperfocus shifts here
16:46timcharper:S
16:46timcharperon slime 20091016
17:02a_strange_guyhi there
17:02a_strange_guycan somebody help me with my swank-clojure problems?
17:03a_strange_guyafter compiling the latest clojure from git
17:04a_strange_guyi get a "java.lang.ClassNotFoundException: clojure.main" when starting up slime
17:05a_strange_guyusing the jar normally with java -jar works
17:05hiredmanthat means your clojure.jar is not on the classpath of the jvm that slime is trying to start
17:06a_strange_guythat is strange
17:06a_strange_guyis there any way to find out the classpath which swank-clojure passes to the jvm?
17:06a_strange_guysome variable in emacs?
17:08technomancya_strange_guy: have you tried the instructions in the swank-clojure readme? there are several ways to launch a session.
17:08Bendlasswank-clojure-classpath
17:12a_strange_guyah found the reason
17:12a_strange_guyswank-clojure-jar-home got unset somehow
17:12bozhidaranybode knows the criteria on which some core functions are marked as built-ins in clojure-mode, where other aren't?
17:12a_strange_guythx anyway
17:12bozhidarhttp://paste.lisp.org/display/97895
17:13bozhidarI cannot understand why even? is there, but odd? isn't
17:13a_strange_guybozhidar: there is a big list of clojure functions in clojure-mode.el
17:13bozhidara_strange_guy: I know how big the list is - I'm looking at it :-)
17:13bozhidarbut it should be a lot bigger IMO
17:14bozhidarotherwise the font locking seems non uniform
17:14a_strange_guythere was a post by Lau Jensen in his blog on how to scrape the api page for functions to add
17:17unlinkhi
17:17unlinkIs anyone using Clojure to trade with Interactive Brokers?
17:19bozhidara_strange_guy: I found the post and while it presents a workaround it doesn't offer an explanation
17:19bozhidarabout what insight made the developers include only those particular functions
17:20bozhidarI can easily alter the mode myself, but I'm curious as to the current state of affairs and what led to it...
17:20a_strange_guyprobaply it's a hassle to keep the list up to date
17:20a_strange_guyand ccorrect with the latest versions of clojure
17:21a_strange_guyas long it doesn't interface with slime, it will miss some functions
17:24AWizzArdrhickey: did you get my messages about Cells from 5 hours ago?
17:24bozhidara_strange_guy: certainly
17:25bozhidarI hope that one day will get the same level of slime integration for Clojure that exists today for CL
17:25bozhidarclojure + slime have come a long way, but I still envy the CL guys for some stuff
17:26The-KennyYeah, me too. Debugging and stuff like list-callees is very nice
17:27scottjunlink: 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:28technomancybozhidar: I can think of one great way to make that happen... =)
17:29bozhidartechnomancy: me coding less Java and more Emacs Lisp I presume ;-)
17:29a_strange_guywell the problem is that clojure-mode and swank-clojure are distinct
17:32unlinkscottj: Yeah I'm pretty sure I am going to.
17:34bozhidara_strange_guy: even with common lisp - swank and lisp-mode are separate
17:34bozhidarand I find this reasonable
17:34bozhidaryou have access to slime-complete-symbol from lisp/clojure buffers
17:35bozhidarit would have been nicer is something like that is used to generate dynamically the list of symbols to font lock
17:36bozhidarI might try to conjure something up after I'm done with my current projects...
17:36mabesCould someone explain what "clojure.lang.RT" does here? (let [entry (. clojure.lang.RT (find map (first keys)))]
17:37mabes^ taken from (source select-keys)
17:37Rayneshttp://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:37sexpbot"Hello World: Which programming languages are people learning? - Spikey Pillow"
17:37lancepantzthat's absurd
17:37RaynesI'm sure that's why over 400 people signed up for the Clojure course at rubylearning.
17:37lancepantzhe's comparing clojure to smalltalk?
17:38Rayneslancepantz: He has a graph.
17:38bozhidarRaynes: don't you find it amusing that rubylearning are doing a clojure course? :-)
17:39RaynesApparently, according to his graph, more people are picking up Forth and Fortran than Clojure.
17:39Raynesbozhidar: Indeed. It's beautiful.
17:40bozhidarthere is this massive switch to clojure from ruby that I've noticed
17:40bozhidarI guess that Rails really played them a bad joke...
17:40RaynesParens are all the rave these days.
17:40hiredmanthe seattle clojure group has a lot of pythonistas
17:40clojurebotclojure is not groovy
17:40RaynesThe truth.
17:40RaynesHe speaks it.
17:40bozhidarRaynes: parens have been the rave for the last 50 years :)
17:41lancepantzbozhidar: i've notices the same re: ruby->clojure
17:41lancepantzit's the path i'm coming down
17:41bozhidarlancepantz: me too
17:41lancepantzwe've convinced my boss to migrate all of our backend to clojure
17:41bozhidarbut I have to admit that before ruby I was fond of Common Lisp
17:41mabeslancepantz, bozhidar: same, but I think that says more about the ruby community than anything else.. (early adopters)
17:41RaynesI believe technomancy is/was a Ruby guy as well.
17:41Chousukemabes: clojure.lang.RT is a class that contains many static methods used by clojure.core
17:42bozhidarI like the language, but there weren't that good deployment options for CL apps
17:42bozhidarclojure changed that...
17:42lancepantzwe basically realized there was nothing we could do to make our ruby backend faster... in ruby
17:42mabesChousuke: 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:42lancepantzsome of our early benchmarks have clojure 100x faster
17:43Chousukemabes: find is not a clojure function
17:43lancepantzthere's also some db changes, but still
17:43bozhidarlancepantz: I also disliked a little the overly frivolous syntax - it seemed to me it added some unneeded complexity
17:43mabes,(doc find)
17:43clojurebot"([map key]); Returns the map entry for key, or nil if key not present."
17:43Chousukeoh, it is? heh
17:44Chousukemaybe it's newer than select-keys :/
17:44mabesChousuke: ok, I suspected it could be cruft, thanks
17:44lancepantzbozhidar: well and as you try to implement more complex features that all work together you end up with a huge abstracted mess
17:45Chousukedoes anyone actually use that find function?
17:45AWizzArd,(find {:a 1, :b 1} 1)
17:45clojurebotnil
17:45bozhidarlancepantz: indeed
17:45Raynes(doc find)
17:45clojurebot"([map key]); Returns the map entry for key, or nil if key not present."
17:45Chousukeget and map-as-fn make it kind of irrelevant
17:45AWizzArd,(find {:a 1, :b 1} :b)
17:45clojurebot[:b 1]
17:45mabes,(source find)
17:45clojurebotSource not found
17:45Raynes~def find
17:45mabesWell, this is the source: map key] (. clojure.lang.RT (find map key)))
17:45Chousukeah, right, it returns the entry.
17:46AWizzArdRaynes is our bot operator :-)
17:46Raynes:p
17:46mabesToo bad tinyurl broke
17:48Raynesmabes: That's why sexpbot uses bit.ly. :>
17:49RaynesSadly, it doesn't have the definition lookup stuff.
17:49Raynes:\
17:49RaynesBut! It has walton.
17:49Raynes$walton doseq
17:49sexpbotRaynes: http://getclojure.org:8080/examples/doseq
17:49mabesah, very nice
17:50Raynesdefn: <3
17:53mabesRaynes: where does sexpbot's code live?
17:53remleduffIs 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:53mabesRaynes-: : where does sexpbot's code live?
17:55Raynesmabes: Sorry about that.
17:55RaynesWouldn't let me send.
17:55Raynesmabes: It's http://github.com/Raynes/sexpbot
17:57mabesnice, thanks
18:02defnhehe Raynes :)
18:07Bendlas /j #clojure-casual
18:59Bendlascan you tell me the reason why `java -cp classes/ clojure.main` won't work, when `java -cp clojure.jar clojure.main` does?
19:00Bendlasfails with java.lang.ExceptionInInitializerError caused by a NullPointerException
19:09cemerickis there anyone maintaining a clojure 1.2-compatible compojure 0.3.2 branch?
19:45shalesmaven 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:46shalessure enough, I don't see anything in the clojure-contrib.jar for duck_streams. Anyone seeing this error too?
19:47remleduffSounds like you need to use clojure.contrib.io instead (it moved)
19:47remleduffBut you must have been on a really old 1.2.0 snapshot
19:47shalesI'm not using duck_streams anywhere that I know of though
19:48Raynesshales: 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:48Raynesshales: I ended up having to update 3 different projects to use Clojure 1.2 yesterday to update sexpbot to Clojure 1.2.
19:49shalesoh, good point. I'll check the other libraries
19:51shaleshmm, I'm using the latest version of the libs that are on clojars, but that might not be good enough
20:33slyphonis it possible that the classloader would behave differently on linux and mac os-x when stuff is being loaded through slime
20:33slyphon?
20:33slyphonhttps://gist.github.com/a3a4516a79c4ce0fe109
20:34lancepantzanyone know how github computes their language popularity lists?
20:36technomancylancepantz: it's by number of repositories that contain at least one file of a given lang
20:37slyphontechnomancy: hai!
20:37slyphontechnomancy: what do you know about classloaderS?
20:37technomancyless than I should?
20:37hiredmanthere be dragons
20:37lancepantzthat makes sense
20:38technomancygithub languages ranked by bytes: sonia
20:38slyphonits' weird, i get that traceback above when running on linux but not on mac os-x
20:38technomancyrather: http://gist.github.com/118810
20:38technomancyweird... IME classloader issues are a lot more common on OS X due to the hacks they have for "native-feeling" swing
20:39slyphonthere are a bunch of hits on google related to Spring and other containers, but i don't know enough to even start
20:39slyphonwell, that might be overstating it
20:40hiredmanyou didn't use add-classpath did you?
20:40technomancydependency injection doesn't play nice at all with Clojure in my experience
20:40slyphonhiredman: nope
20:40hiredmanjust making sure
20:40technomancybut that was with Maven's, not Spring
20:41hiredmanwow
20:41slyphoni even grabbed the standalone jdk distro from sun and same thing happens
20:41slyphon(just to make sure it wasn't the package maintaner being cute)
20:42slyphonalso
20:43slyphonwhen i run lein repl, and run the tests (how that bug gets triggered) it works fine
20:43slyphonit's only from slime that it throws that exception
20:43slyphonwhich is interesting
20:44hiredmanperhaps you need to restart slime?
20:45slyphontried that
20:45slyphoncouple of times
20:45slyphonit's really strange that swank-clojure "causes" the issue
20:45hiredmanwhat about slime connecting to lien swank?
20:46slyphonthat's the thing
20:46slyphon*that* is when the issue happens
20:46slyphonlein repl it works fine
20:46hiredmanand what about swank-clojure-project?
20:47slyphonthat i dont' have set up because i need to pass properties on the command-line
20:47slyphoni guess i could get around that by loading them when i init my stuff
20:49technomancyswank-clojure-extra-vm-args may also do it
20:49slyphononly thing that's kind of annoying about that is there doesn't seem to be a way of making that per-project
20:50technomancyyou can use .dir-locals to set it in elisp
20:50technomancyif you're on emacs 23+
20:51slyphonon linux i'm using 22, font rendering is AFU in ubuntu in 23
20:51slyphonspent a few hours chasing this one down: https://bugzilla.redhat.com/show_bug.cgi?id=517272
20:52technomancyweird; never seen that one. is that the emacs-snapshot package?
20:52slyphonnope
20:52slyphonwlel
20:52slyphonboth, actually
20:52slyphonemacs23 and emacs-snapshot
20:52slyphon*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:55slyphonhrm
20:55slyphonwhat happened to java-utils in clojure-contrib?
20:56technomancyit got split up into a number of other nses
20:56slyphonah
20:56technomancyc.c.io, c.c.properties, possibly more
20:56slyphonahh
21:00slyphonoh ffs
21:06slyphonhiredman technomancy: running it with swank-clojure-project works...
21:07technomancyso lein swank runs in a subclassloader in order to keep leiningen's deps separate from your project's
21:08technomancyrepl hasn't been fixed to do this yet (though that's a bug)
21:08technomancyso there must be something about the root classloader that isn't getting propagated to the project classloader
21:08technomancythe only other time this has been an issue is with OS X gui classes
21:08slyphonand how is swank-clojure-project different?
21:09slyphonit's java.lang.reflect.Proxy.getProxyClass()
21:09slyphonreferenced in a number of other posts
21:09technomancyswank-clojure-project calculates the classpath in elisp rather than clojure
21:09technomancyso it lets your project use the root classloader
21:09slyphonahh
21:09technomancyyou can force leiningen to fork a new JVM for your project instead of using a subclassloader
21:09technomancyit'll be slow, but it will probably sidestep the problem
21:10technomancyyou can do it by setting a dummy value for :native-path in project.clj
21:10slyphonhm
21:11slyphonwell, i'm ok with running swank-clojure-project
21:11slyphonso
21:11slyphonemacs question
21:11slyphondo you have to set swank-clojure-extra-vm-args inside the "custom-set-variables" sexp
21:11slyphon?
21:11slyphonor can you just do setq ?
21:12technomancysetq is fine
21:12slyphonmm'kay
21:12technomancygotta jet; hope you get it figured out
21:12slyphonyeah, thanks for the hlep
21:12slyphon:D
21:12technomancyyou can post to the lein mailing list if you get stuck
21:12slyphonkk, tyvm
21:30defnhow do we use the new version of contrib? im using clojure-contrib 1.2.0-master-SNAPSHOT
21:30defnhow do i add the one in which we have .io instead of .duck-streams, etc.
21:30hiredmanlose the master
21:31defnwonderful -- thanks
21:32Raynesdefn: Did you ever checkout irclj?
21:32Raynescheck out*
21:32defnRaynes: that question i just asked is directly related to me playing with irclj :)
21:32defnI needed to get the new SNAPSHOT to use .io etc.
21:33RaynesAh. :p
21:33slyphonargh
21:33Raynesdefn: 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:33slyphonanti-aliasing is the *worst* idea
21:34defnin emacs 23? respectfully disagree.
21:34slyphonno no
21:34slyphonfirefox
21:34defnoh
21:34defnRaynes: I will definitely do that
22:07slyphonis the stderr output captured when you do swank-clojure-project?
22:08slyphonoh, nvm
22:15defnslyphon: you fixing up swank-clojure-project?
22:15slyphonwell, i got it workin' for me
22:15defnslyphon: 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:15defnbut that'd be a nice thing to fix
22:16slyphonhrm, i just link the stuff i need from resources/ into classes/ which is probably The Wrong Way
22:16slyphoni only have 1-2 properties files i use
22:16defn*nod*
22:17slyphoni think you should be able to put that in swank-clojure-extra-classpaths
22:19defnslyphon: oh right, that makes sense
22:21slyphoni mean, it'd be nice if it picked that up automagically, but i dunno how to do that without reading through the .el
22:27defnno worries, just thought id ask
22:53slyphonhrm
22:59slyphonsooo, if i want to tweak one or two methods on c.test/report, what's a good way to do that?
22:59slyphon"methods" look like Special Creatures
23:08slyphonis it possible to copy a method impl?
23:09slyphonor rather a "multi", then tweak your version, like "subclassing"
23:29technomancywhat kind of things could cause the JVM to exit even after shutdown-agents is run?
23:29technomancymaybe some rogue thread kept alive?
23:29slyphonto not exit?
23:30slyphonusually it's a rogue non-daemon thread
23:30slyphonin my experience
23:30slyphontechnomancy: do you know if it's possible to override a single defmethod ?
23:30slyphonlike, if you wanted to override clojure.test/report :end-test-var
23:31technomancyI think you can just defmethod over the same dispatch value
23:31technomancybut I don't know how to preserve the old one
23:31slyphonyeah, i'm actually writing a post to the group about that
23:31slyphonit doesn't seem possible, really, looking at c.t.junit
23:31slyphonand reading the defmulti code
23:31technomancyyou could probably do it with some Java calls
23:32technomancyyeah, not great
23:34technomancyyou could just write a defmulti whose default method just calls the old one
23:34slyphonHMM
23:35technomancynothing wrong with that apart from one extra call
23:35slyphonyeah, but i have to bind over clojure.test/report
23:35slyphonbefore running the tests
23:35technomancyoh, can't do that in 1.2
23:35slyphoncan't do what?
23:35technomancyoh, never mind
23:36slyphonmaybe aliasing the original?
23:36technomancydirect binding inhibits you from rebinding most functions bound to vars beginning with "clojure"
23:36technomancybut clojure.test/report is explicitly excluded
23:36slyphonah
23:38technomancyremleduff: hey, are you going to submit that repl patch as an assembla issue?
23:39remleduffI don't have a CA in place at the moment, go ahead if you want to :)
23:39technomancyok, cool
23:53slyphontechnomancy: w00t!
23:54slyphontechnomancy: http://gist.github.com/369247
23:59technomancyheh; what's harpo?
23:59slyphonoh, heh, that's my project i'm working on, i name all our major infrastucture projects after Marx Brothers