#clojure logs

2010-02-19

00:22konrAny idea for a project name (related with money) better than coinj?
00:24konrcurrenjy, haha
00:31TheBusbykonr: I'm doing some automated trading stuff why?
00:33konrTheBusby: Do you do it as a side project or commercially? Do you use open-source software? I'm interested in finding out how much time it consumes
00:34TheBusbyfor fun, trying to start an "automated stock trading fastasy league" with some friends
00:34TheBusbyrewriting a bunch of it in clojure now, time=(results you want)
00:35TheBusbyand a lot of conditions deal with frequency/time-delay
00:35konrTheBusby: hmm, is it open source? can I take a look?
00:35TheBusbyunfortunately most it is in ruby now,
00:35TheBusbyif I clean up some clojure code I'll post it though
00:37TheBusbyif you're in a hurry, I'd take a quick look at the google financial web-api
00:37TheBusbyand write some clojure wrappers on top of that (what I'm just starting now)
00:37danlarkinhiredman: On the phone you mentioned your clojure reader and another impl, whose was that again?
00:38konrinteresting... I've got a couple of friends that are writing investment programs as their main jobs, so I guess it must be pretty lucrative
00:39TheBusbymost of the professional stuff I've heard about is all high-frequency
00:40TheBusbyI've heard of people, in articles, doing it out of their house though
00:41TheBusbymy favorite quote though "you only have to be right 51% of the time" (if you have enough volume)
00:41TheBusbylots and lots and lots of horror stories though, but I think most companies keep them under wraps
00:42konrhahaha, this whole trading thing sounds very exciting
00:42konrI'll keep you informed if I write something relevant
00:43TheBusbyI'll ping you if the league comes together too
00:43TheBusbythe idea is for everything to be open source and to share
00:44TheBusbyyou'll want to get your api together quickly though so you can have a history to run any trading logic over. I also recommend taking a look at ESPER (http://esper.codehaus.org/) for adding CEP
00:47konrThanks! I'll check it out!
00:48TheBusbyif you find more people interested, please contant me and we may have enough to get a league going
00:49slyphonis there a way to treat a blocking queue as a seq?
01:24hiredmandanlarkin: Chousuke's
01:26danlarkinhiredman: excellent, thanks
01:30lancepantzis there a function that will allow me to see if a var is bound without throwing an exception?
01:33hiredmanlancepantz: :( why?
01:34devinusis clojure-install deprecated ?
01:35lancepantzwell, i'm coming from ruby, so i'm probably doing something wrong, but i'd like to do something like this: (def env (or env (System/getenv "APP_ENV") "development")))
01:36lancepantzi guess i need a way to represent ||=
01:37lancepantzi'm reading in config file from yaml, and i want to use different values from it if i'm in a test
01:37hiredmanwhy are you using yaml?
01:38lancepantzi want to read the same config files as a rails app
01:38hiredmanand why don't you just do something like (def env (read-env))
01:39lancepantzread-env?
01:39hiredmanyou definitely don't want to use binding for a config
01:39hiredmanlancepantz: read-env is the function that reads in the env information
01:40lancepantzis that documented?
01:40hiredmanlancepantz: you have to writ it
01:40hiredmanwrite
01:41lancepantzah :)
01:41hiredmanyou aren't re-def'ing env in your code right?
01:41hiredman(just making sure)
01:42lancepantzkinda, i was using different namespaces
01:43lancepantzclearly, i'm doing it wrong, i'm going to re-think my approach
01:43hiredmanhow is different namespaces like re-def'ing?
01:45lancepantzi was def'ing a var in a test.utils namespace, and defining the same var in a namespace in my app, but i wanted the app namespace to ignore it if it was already def'ed
01:45lancepantzwhich would occur only in my test
01:46lancepantzsuppose i did rails too long
01:47hiredmanyou can't have the same var in multiple namespaces without a lot of jumping through hoops (and even it's more like you have a var in the other namespace pointing to the var in this namespace)
01:50hiredmanyou must be using use or similar, which lets you refer vars from other namespaces without having to namespace qualify them
01:51lancepantzexactly
01:59jcromartieI want to automatically create some vars in a namespace
01:59jcromartiewith a macro
02:00jcromartiebut I can't get the macro syntax right
02:00jcromartieif I syntax-quote the body of the macro then it qualifies the symbols that I want to def
02:00hiredmanwhy would you do that?
02:00jcromartiehiredman: why?
02:01hiredmanbecause generally there are easier ways
02:01jcromartiebecause I want to create accessors for some resources
02:01tomojhave you written out the macro form you want and the form you want it to compile to?
02:01jcromartiebasically I have a mongodb collection name and a struct definition, and I want to create find, find-one, create!, update!, and delete! functions
02:02jcromartieyeah I have written it out tomoj
02:03jcromartieI think I figured it out... I was being too liberal with syntax quoting
02:03slyphoner
02:03slyphonfunny
02:04jcromartieheh
02:04jcromartieFuture cancelled due to rain.
02:04tomojI read that as "train"
02:04tomoj:(
02:04slyphon:D
02:07jcromartietomoj: are there any good macros you would recommend me to look at?
02:07jcromartie2AM I'm not thinking clearly
02:08tomojhuh?
02:09tomoj,def for
02:09clojurebotjava.lang.Exception: Unable to resolve symbol: def in this context
02:09tomojhmm
02:09slyphoncan you destructure with a def?
02:09tomoj@def for
02:10tomojI don't think "destructure with a def" makes sense
02:11slyphonyeah, that's one i shouldn't have bothered asking out loud
02:12tomojjcromartie: http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core.clj#L3141
02:12tomoj:P
02:12tomojjust kidding
02:12jcromartieheh
02:12jcromartieat 2 AM
02:14jcromartiethis is what I'm wrestling with http://gist.github.com/308514
02:15TheBusbyare most of the folks here on the US west coast?
02:15jcromartieI don't understand why the resulting template is what it is
02:16jcromartiefor instance (clojure.core/list coll)
02:16hiredmanbecause you have a quote inside a quote
02:16jcromartiehmm
02:16jcromartieso should I just stick with syntax-quote?
02:17jcromartieoh, beautiful
02:17jcromartie~'foo
02:17clojurebotIt's greek to me.
02:17jcromartiethat's what I need
02:19jcromartienow I just need to wire it up with compojure routes and I'm golden :)
02:28tomojTheBusby: TX here
02:31TheBusbyso mainly night owls it seems like then ;)
02:42jcromartienight owl... I wish
02:43jcromartiemore like night slug
02:43jcromartieI'm not soaring that's for sure
02:54zaphyrhi folks, is there any documentation on what the classes the compiler generates do? i'm poking around the output and it is... very magical :)
02:59slyphoncan you remove a reference to resolve a name conflict?
03:00slyphonoh ns-unmap
03:06tomojhmm
03:07tomojslyphon: why exactly are you using that?
03:07slyphonnah, i just restarted my repl
03:07tomojoh, ok
03:07slyphoni'd gotten into some weird state
03:07slyphonand was kind of curious
03:07tomojI thought you were using it as a replacement for :exclude
03:08slyphonoh, heh
03:09miltondsilvahi.. what is the best way to translate something like this: groundTransform.setIdentity(); groundTransform.origin.set(new Vector3f(0.f, -56.f, 0.f));
03:09slyphonit's hard to come up with names for all the little functions
03:12miltondsilvaI was trying to use doto and .. but somehow it keeps throwing No matching field found
03:13Chousukemiltondsilva: something like (.setIdentity groundTransform) (-> groundTransform .origin (.set (Vector3f. 0. -56. 0.))
03:14miltondsilvaso the doto and .. are a bad idea?
03:14Chousukewell, not nexessarily
03:15ChousukeI guess you'd need to do it like (doto groundTransform .setIdentity (-> .origin (.set ...)))
03:15ChousukeI prefer -> over ..
03:16woobyChousuke, any particular reason?
03:16miltondsilvaok thank you very much
03:16Chousukewooby: -> allows for clojure functions as well, and you type the . in java method names, keeping it clear which is which
03:16woobyChousuke, i see, thank you
03:18miltondsilvaChousuke: also thanks for explaning -> vs ..
03:19miltondsilvaexplaining*
03:22miltondsilvaclojure 21 lines... java 100+ it's really a joy to see this
04:08vsteinI'm newbie-macro-stuck :| I want to do a for on a variable seq-expr, and matching body-expr. Like (for a b). Guess its been done many times. Any directions?
04:10TheBusbyvstein: I can't help you, but you may want to look at the definition of the "for" macro in clojure source or look in clojure-contrib for any similar examples
04:11vsteinTheBusby: Yes, I am :)
04:15LauJensenMorning team
04:16esjMorning Lau
04:17sparievMorning
04:19AWizzArdMoin Lau
04:19AWizzArdoh
04:19AWizzArdHi Lau
04:19RaynesMorning teammate.
04:19LauJensenMoin Andre
04:19RaynesThe giant!
04:19AWizzArdEurope is waking up.
04:20LauJensenWhile America slumbers perpetually.... ok enough with the US jokes :)
04:20sparievhave you guys read http://www.infoworld.com/d/developer-world/oracle-set-merge-java-virtual-machines-935 ?
04:20LauJensenRaynes: I would like to host a Clojure Symposium on a ranch sometime in the near future - And every morning we should all wake up to the sound of chickens clucking while you get us started with a little tune on the Banjo
04:21RaynesWhoa. You put effort into that one. :)
04:21LauJensenNot really, just a thought I had
04:21RaynesWe actually used to have chickens that lived in the yard. Wild chickens. They got killed by wild cats last year.
04:22LauJensenoh :(
04:23RaynesOf course, there is are some chicken houses within walking distance from here. About 4-5 miles I imagine.
04:23Raynesthere are*
04:23RaynesProbably less than that.
04:24LauJensenWell - It was fun hearing about chickens - Hows your Factor experiment coming along ?
04:25RaynesHow did you know I was using Factor? :o
04:26LauJensenIts my business to know
04:26RaynesHeh heh.
04:26RaynesIt's going great. Doing some rosettacode stuff with it.
04:26LauJensenGreat - Uploaded it yet?
04:27Rayneshttp://rosettacode.org/wiki/Send_email#Factor Well, all I've actually done so far is that. :>
04:28LauJensenOh ok, looks simple enough
04:29RaynesThe swapping was awkward, but it makes sense.
04:29LauJensenWhat do you like about Factor?
04:30RaynesMade me feel like Scorpion in Mortal Kombat vs the second item on the stack. "GET OVER HERE!!!!!!"
04:30RaynesI like how bizarre it is to me mostly. I've never done anything with stack-based languages before.
04:31RaynesI don't really know enough about it to really say what I like and don't like yet.
04:31LauJensenClojure makes me feel like Epic Beard guy
04:32RaynesYou should do one of your patented Clojure vs <language> comparisons with Factor one day.
04:32RaynesWould be interesting.
04:32LauJensenIf I was going to do another one of those, I think I'd look into Haskell
04:33RaynesThat would be interesting as well, I imagine, albeit probably not a very fair comparison.
04:33LauJensenWould wouldn't it be fair?
04:33jcromartiewhat's this "seqable? is not public" crap?
04:33LauJensenWhy
04:34RaynesYou'd be comparing an inpure fp language to a pure one.
04:34jcromartieI'm not using seqable? anywhere in my code
04:35vsteinI found out how to do a (for a b). In LauJensen:s excellent blog. Thanks Lau
04:35LauJensenRaynes: I dont think that tells you anything about fairness - Fair to me, means taking a look at the relevant angles and not supressing comments - People have accused me of the latter, but mostly for not understanding that I censor any and all foul language
04:35LauJensennp vstein :)
04:35jcromartieWTF
04:36LauJensenjcromartie: If you have a problem state it, but please stop ranting
04:36RaynesThe flaming you get for the comparisons is amazing.
04:36jcromartieOK here's the problem: where requiring a lib I wrote which does not use seqable? clojure 1.1.0 complains that seqable? is private
04:36RaynesEspecially since you always point out that it's simply the way you see things.
04:37zaphyrRaynes: yes. but it's that old affliction "someone's wrong on the internet" xD
04:37jcromartiehmm, looks like it's deep in congomongo
04:38Raynesjcromartie: You aren't thinking about going in there are you? I hear there's monsters in those caves!
04:38Raynes;)
04:38patrkrisLauJensen: Please do a comparison with Haskell :)
04:39LauJensenhehe
04:39LauJensenI might, but getting a good feel for Haskell takes a while
04:39woobyhm, LauJensen, had you written something in the past about updating clojure fn highlighting in emacs?
04:40LauJensenwooby: yea "Enlive Vs Clojure-mode" I think I called it
04:40patrkrisLauJensen: Yeah, it does. How much Haskell have you done?
04:40woobyLauJensen, thanks. love your stuff btw... waiting for clojure vs. php >:)
04:40LauJensenpatrkris: Not nearly enough, just simple experiments and reading others code
04:40LauJensenwooby: Clojure vs PHP was the very first Post I ever did, but it wasn't looking at direct examples, just the overall approach of PHP
04:41RaynesI never saw that one.
04:41woobynor i
04:41LauJensenWasnt much to see, but its still there
04:41RaynesJust Python and Scala.
04:41patrkrisLauJensen: I used it during a course at university on Programming Paradigms. There is a certain beauty about its relatively concise syntax and all of the type inference stuff. But I simply can't get myself to think about it as a practical language.
04:42LauJensenpatrkris: Perhaps not - But it does fascinate me as well
04:42RaynesIn order to see the practicality of the language, you have to really know the language.
04:42piccolinoI remember the #scala reaction to your Scala vs. Clojure piece.
04:42RaynesThe benefit may not be worth the time spent, however.
04:42LauJensenpiccolino: It was quite intense. Some from their ranks actually made fake profiles on various social sites and openly slandered me, quite nasty
04:43LauJensen(although, a little amusing nevertheless)
04:43patrkrispiccolino: is there a log somewhere?
04:43Raynes^ what he said.
04:44patrkrisRaynes: I agree about knowing the practicality. Maybe I'll get around to it someday, i.e. really learning and using the language.
04:44piccolinopatrkris, I'm afraid I don't know.
04:45piccolinoLot of complete jerks in there.
04:45patrkrisisn't scala a product of academia? maybe that's the reason for all the arrogance :)
04:46piccolinoMust be.
04:46piccolinoGuys in the channel weren't academics, though.
04:48LauJensenAlso lets not start bad-mouthing #scala, I love #clojure for the polite and friendly tone which is always found here
04:48LauJensen(except maybe for Raynes)
04:48LauJensen:)
04:48RaynesHah!
04:49RaynesI'm the nicest person in here. hiredman is the mean one.
04:49Raynes:>
04:51piccolinoOf course, there's thought police in any channel.
04:51zaphyryou're not allowed to think that, piccolino.
05:07mikemhi, trying to get lein-nailgun to work with my project. I have :dev-dependencies [[lein-nailgun "0.1.0"]] and `lein nailgun` starts NGServer on port 2113, but once I run vim it complains that the file I'm editing is not in the classpath
05:07mikemam i missing some configuration? is there a way to check what classpath the nailgun server is configured with?
05:08mikembut shouldn't `lein nailgun` "do the right thing" and start NGServer with the correct classpath set?
05:09ChousukeThe idea is to concentrate on making Clojure look good rather than making other languages look bad.
05:09Chousukethough
05:09Chousuke~scala
05:09Chousukehm
05:10Chousukeclojurebot: you have failed me :(
05:10clojurebotI will hold the money!
05:10Chousukeclojurebot: scala
05:10Chousukemeh, I liked those :P
05:13LauJensenscala: 2 + 2
05:13LauJensen~scala: 2 + 2
05:13LauJensenI think he used to be able to do that
05:13Chousukeyeah
05:19fanaticomikem: didn't lein-nailgun need a patched version of leiningen?
05:20fanaticofound the thread http://groups.google.com/group/leiningen/browse_thread/thread/66c6c72dba4bbd47.
05:20fanaticolooks like that could be your problem.
05:25mikemfanatico: those patches seem to address this faster testing with leiningen, not `lein nailgun` and vim, though
05:26Hali_303what can be the reason that code completion with TAB does not work in clojure paredit? is it bound to somethin else then tab?
05:27fanaticothe patches also make sure that changes are reloaded while the jvm is still running.
05:29mikemyeah, that's true. still, it seems my issue is with the classpath that the nailgun instance started with `lein nailgun` has
05:35mikemdoes anyone know where the source is for the lein-nailgun plugin?
05:41Hali_303no idea :( the lein-swank is in the lein repo
05:43mikemHali_303: actually, leiningnen/nailgun.clj is inside the jar file. it's only about 9 lines long
05:46Hali_303mikem: lein-swank is about the same length, too
05:50Hali_303when working with SQL code, I repeatedly get No matching method found: println for class swank.util.io.proxy$java.io.StringWriter$0. Does anyone have an idea why?
05:50Hali_303probably my query is wrong, but then it should display the DB's error message instead of this
05:50Hali_303maybe it is a lein/swank thingie?
06:21Raynesjoin #concatenative
06:21Raynes/fail
07:31AWizzArdwb angerman
07:31angermanthanks :D
07:33nubacan you use clojure with GWT?
07:34AWizzArdnuba: I think GWT compiles Java code to JavaScript.
07:34AWizzArdSo, when it finds Clojure code this may unfortunately no longer work.
07:36LauJensenThere has been an attempt at using GWT with Clojure, but I think it fail0red
07:39nubaoh, this is nice, from http://code.google.com/webtoolkit/learnmore-sdk.html: Use the backend language of your choice
07:41nubaheh, i was kinda hoping not having to touch java, and do it all with clojure
07:49AWizzArdnuba: interesting
07:50AWizzArdnuba: hmm, i think you may have misunderstood this part
07:50AWizzArdI understand this section as: “Your server can be programmed in Visual Basic.”
07:50nubai understand i'll have to write my interface in java, compile to JS, and write my backend in my language of choice
07:50somniumVB + Clojure = huge win
07:50AWizzArdBefore that they write: “With the GWT SDK, you write your AJAX front-end in the Java programming language which GWT then cross-compiles into optimized JavaScript [...]”.
07:51AWizzArdThe really nice thing would be, if they offered a compiler clj2js
07:52LauJensenI'll make a GUI in Visual Basic so we can track the IP address
07:52nubaheh
07:53hamza_LauJensen: lol and you get unlimited enhance functionality.....
07:53LauJensenhaha, only if you zoom in far enough
07:58Hali_303how to create a keyword from a string?
07:58somniumI have a prototype of a clj->js translator for the adventurous. this kind of clj: http://paste.lisp.org/display/95247 -> this kind of js: http://pastie.org/832602
07:59Hali_303ah, keyword :)
07:59somniumIve been using it for my omn work in and trying to work out the kinks
08:00somniumIm starting to think it would be better to make a minimalist scheme-to-js compiler and extend it with macros
08:00boojumcould clojure be targeted for v8 or tracemonkey?
08:01somniumI think there are some questions about how the data-structures will be implemented in js, but lisp->js is really just healing js :)
08:02Chousukeit might be possible in the long term
08:03Chousukeonce most of Clojure is written in Clojure. But that's not happening right now :)
08:04somniumtheres only about 10-15 keywords you need to encompass js compared to the 200 + opcodes in c.c.Compiler
08:05somniumand no threads, shouldnt it be a relatively easy target?
08:05ChousukeWell, there was a clojure-to-js translator at some point
08:06Chousukewoefully incomplete, of course. :)
08:06somniumChousuke: Ive written one that can do TCO and varargs, so it cant be that hard :)
08:07ChousukeI suppose javascript is an easy target, because it's already dynamic
08:07somniumand it has lambda as a first class construct
08:09Hali_303how to convert the resultset coming from a with-query-results into a simple map that can be used later outside of a transaction?
08:10ChousukeSheesh, TeXLive is quite huge. Need 2.7GB of space to even be able to unpack the installer.
08:12LauJensensomnium: Why didnt you just extend Clojurescript ? Tons of work have gone into making that compiler
08:12ChousukeI'm just glad I have a fast internet connection so it didn't take hours to download the 1.3GB zip file :P
08:12somniumLauJensen: clojurescript is extremely complex
08:13LauJensenIts a complex task to implement Clojure in JS - Will be a little better once cinc is in place
08:13somniumLauJensen: implements a hierarchical system symilar to javas
08:14somniumjavascript is scheme with an object system that enables duck-typing
08:14somniumI wanted to try compiling a tiny-subset and building straight up
08:15somniumLauJensen: how complex is implementing clojure in Scheme?
08:16LauJensenWell, you have to implement the datatypes, like PersistVector, sets etc, and although its faster to do in Scheme its still a job - When CINC is in place, PV will be implemented using Clojure so thats one less thing to bootstrap
08:16ChousukeClojure needs persistent vectors to compile though.
08:17Chousukeit's an interesting bootstrap problem :P
08:17somniumwhy cant you use lists and alists?
08:17Chousukeyou can't compile the Clojure-PV implementation without an existing PV implementation :)
08:18somniumjavascript is not a great platform for implementing datastructures
08:18Chousukesomnium: if you used just lists and alists it wouldn't really be Clojure, would it? :/
08:19Chousukesomnium: and Clojure code itself is more than just lists and symbols.
08:19somniumChousuke: ok, but if in the kernel, you can represent everything with a list and an alist, and then extend the reader and type system once you can say, new and lambda
08:20somniumand whatever else you need to describe yourself, well, that was my thinking
08:20Chousukeit might be possible to make a bootstrap vector implementation with lists, yeah
08:21Chousukeit would be horribly slow, but I suppose speed would not matter in the bootstrap phase
08:22somniumright, and javascript arrays are VM optimized, faster than linked lists
08:23somniumanyway, there are no threads, node.js and mozilla have message passing, so I wonder what the eventual official ClojureScript will be like
08:25somniumrelatedly, this js-language is getting some momentum: http://jashkenas.github.com/coffee-script/
08:26somniumI would be very happy to see many alternative 'JSVM' languages as on the JVM
08:54AWizzArdIs there a update-in! that works on transients?
09:07chouserI don't think so
09:07chouserI may have written something like that, but if so the performance was surprisingly bad.
09:49hamzaguys, when clojure code is aot compiled, does the macros in the code already expanded?
09:52ohpauleezhamza: yes, they're expanded
09:52hamzakk great thanks.
09:53ohpauleeztotally welcome
09:54stuarthallowayclean slime/swank install from elpa is dead in the water this morning. did something change?
10:12AWizzArdHallo ordnungswidrig.
10:13AWizzArdchouser: do you think update-in! performed worse than its non-transient counterpart?
10:14chouserI think so. the problem was that converting a transient to a persistent is O(1), but converting a transient of transients to a persistent of persistents is O(n)
10:15chouserI think so. the problem was that converting a transient to a persistent is O(1), but converting a transient of transients to a persistent of persistents is O(n)
10:15AWizzArdrhickey: When I extend Number to have a (transient-of/value-of [n] n), will that then also work with primitives?
10:15chouserAWizzArd: doubt it. primitives are not Numbers
10:16AWizzArdmy repl tests with such cells work, I just don't want to run into exceptions during runtime
10:17ChousukeI think they will get autoboxed
10:17Chousukeyou can't put primitives in references anyway
10:17Chousukethey need to be Objects
10:22AWizzArdok, then it is autoboxing
10:22LeafwAWizzArd: write a few tests to catch all these possibilities of non-object inputs. I also think they should just be autoboxed.
10:22AWizzArd,(class (int 5))
10:22clojurebotjava.lang.Integer
10:22AWizzArdAlso some magic autoboxing?
10:22Chousukeyes
10:26AWizzArdOne thing about deftypes: can we have automagic behaviour when listing the Editable and Transient Protocols that automatically provide an implementation à la identity?
10:27AWizzArdOtherwise I would (extend-class ::Foo Editable (transient-of [foo] foo)) for a deftype Foo.
10:27AWizzArdNice would be (deftype Foo [a b c] clojure.lang.IPersistentMap Editable Transient)
10:27AWizzArdAnd that immediately allows me to Cell Foos.
10:30AWizzArdSaves us to type “:as this” and saves us to provide implementations for transient-of and value-of.
10:40AWizzArdrhickey: could that make sense?
10:41rhickeyAWizzArd: I've thought about default of identity for val/trans, but it is only safe for immutables
10:42rhickeybut oyu should really wonder why you would be putting numbers or struct-like deftypes in cells
10:42raekI'm trying to figure out if it would make sense to put a socket (or any input or output stream) in cell
10:42AWizzArdnumbers I don't want, that was just for playing/testing
10:42AWizzArdBut a complex deftype I want.
10:43AWizzArdI want to modify one and do IO inside in-cells.
10:44raekAWizzArd: how does your IO inside in-cells look like?
10:45AWizzArdwell, the pseudocode is like this: (in-cells [c] (modify1 c) (modify2 c) ... (modifyN c) (when (all-was-good?) (do-IO) @c))
10:46raekah, ok
10:46AWizzArdCells are ideal for that, because I need cooperation, sychronization and serialization.
10:48chouserping?
10:48chouserclojurebot: ping
10:48AWizzArd,(time (println "pong"))
10:48raekI want something for a situation where multiple readers want to proccess the lines of a stream (in their own tempo) and multiple writers want to write lines to another stream
10:48clojurebotPONG!
10:48clojurebotPONG!
10:48clojurebotpong "Elapsed time: 0.172 msecs"
10:48AWizzArd:)
10:49raekmaking a lazy-seq from a BufferedReader becomes very beatyful...
10:49raekbut writing requires some kind of locking
10:50raeki'm thinking about making a Source/Sink library
10:51raekthis is still only philosophizing...
10:51rhickeyraek: how would it differ from j.u.c.queues?
10:52raekprobably not much...
10:52raekall sources and sinks might not be connected to a j.u.c.queue
10:54rhickeyraek: ok, but the interfaces still work
10:54rhickey?
10:54raekbtw, if one would like to synchronize access to a POJO, what would the Editable object one passes to (*-cell ...) be
10:54raekyes, this will be built around Protocols
10:55AWizzArdraek: it should be a clone/copy of the POJO
10:56AWizzArdOn that copy you can then use setters as you wish.
10:56raekand for things like sockets or open files? (maybe not very "plain" java objects, but anyway...)
10:57AWizzArdWhat operation do you want to do on a file that requires cells?
10:57raekwriting lines from multiple threads
10:58AWizzArdAn agent can't do it?
10:58AWizzArdOr a j.u.c blocking queue?
10:58AWizzArdAll threads could add a job to a writer agent perhaps.
10:58raekwell, I guess those solve the problem pretty well...
10:59AWizzArdIf you don't insinst on a specific write order an agent may be okay. Otherwise a queue can keep your order.
11:00hiredmanerm
11:00raekagents don't keep the order?
11:00hiredmanwhy would a queue keep order better than an agent?
11:01AWizzArdrhickey told me some weeks ago that an agent is a sink, not a queue, and if i want a queue i should use one.
11:01hiredmansend adds and action to be executed to the agent's queue
11:01hiredmanan
11:01AWizzArdI don’t remember the details, it was between September and November I guess.
11:01raekI would be surprised if the implementation of agents doesn't include a j.u.c.queue somewhere
11:02rhickeyyou can't 'consume' an agent like you can a queue - the consuming end is predefined
11:02hiredmanAWizzArd: that has nothing to do with ordering though
11:02AWizzArdok
11:03hiredmanadding things to a queue and sending actions to agents are both just as "ordered"
11:03raeka question about lazy-seqs... the body of a lazy-seq is only evaluated once, right?
11:04hiredmaneach node in a lazy-seq is evaluated once
11:04raekand if the node is being evaluated, other threads trying to read that node will block?
11:05raek...until its value is ready
11:06raeki.e. will (repeatedly (.read stream)) only do .read in one thread at a time?
11:06AWizzArdrhickey: if identity becomes the default for immutables (deftypes), could the compiler then eliminate calls to produce a transient/persistent object?
11:06rhickeyAWizzArd: you are worried about a call to identity?
11:07AWizzArdno, I just remember you mentioned something yesterday about the compiler being able to remove cells for thread-local changes, or something like that.
11:07AWizzArdThought it could be possible here as well.
11:08AWizzArdraek: yes, this would read only in one thread.
11:08raekperfect!
11:08AWizzArd.read blocks when nothing is .available but when the stream is still open.
11:12raekbtw, I love (extend ...)
11:12raekit's just fun to make protocols
11:12raekthat one can make old things fit into one's new abstraction
11:13AWizzArdDoes in-cell nest within one thread?
11:13noidishould the slime in ELPA work with sbcl?
11:13rhickeyAWizzArd: no
11:14noidiI'm starting to read On Lisp in the hope it would make me a better Clojure programmer, but for that I need to set up a Common Lisp environment :P
11:15tomojit should work, I think
11:15AWizzArdWould there be a problem if it would nest inside the same thread?
11:15tomojonly problem is setting it up to use multiple lisps
11:15noidiM-x slime starts a Clojure REPL on my Emacs. When I try to start a Common Lisp REPL with C-u M-x sbcl, I get the following error
11:16noidiCouldn't load "/home/noid/.emacs.d/elpa/slime-20091016/swank-loader.lisp": file does not exist.
11:16tomojhmm, maybe it's not enough
11:16AWizzArd(dosync (alter foo conj 1)) works as well as (dosync (dosync (alter foo conj 1)))
11:16rhickeyAWizzArd: yes, because in-cells enforces lock order - consider (in-cells [a c] ... (in-cells [b] ...)))
11:16tomojyeah, I think I remember hearing technomancy say that the slime there is just a tiny part of slime
11:16tomojyou may have to install the real thing and get rid of your elpa version
11:17noidiokay, thanks
11:17noidithat's what I was afraid of :)
11:17tomojand do you have slime-lisp-implementations set?
11:17noidiyes
11:17AWizzArdMaybe it is fine the way it is, but perhaps (in-cells [a b] ... (in-cells [a b] ..)) could be okay. Don't know if this makes sense though.
11:17tomojthen, that should work with real slime
11:18noidithere are no *.lisp files in my .emacs.d, so ELPA probably has a stripped down version of slime like you said
11:18tomojI haven't tried to get other lisps working since I switched to using elpa
11:19AWizzArdWhen the set of cells are the same it won't hurt, and there may be a useful function that can be called on its own, but also as an inner call inside a in-cells block.
11:19raekAWizzArd: (defmacro in-cells .... (assert (nil? *in-cells*)) ... (binding [*in-cells* true]
11:20rhickeyAWizzArd: that's possible, as is (in-cells [a b] ... (in-cells [c] ...))), but you'd have to have a deterministic knowledge of lock ordering. I had a broader design for lock-based references that put more control over lock ids and hierarchy in hands of users. Not sure how much of that will make it into cells
11:20AWizzArdI see.
11:21rhickeyAWizzArd: but that kind of nesting is really fraught - so let's see how hard it is to work within current limits of in-cells
11:21rhickeywill certainly yield simpler designs
11:22AWizzArdYes, in fact I can easily arrange my code so that it will work with the current model.
11:23AWizzArdI have only one entry point to in-cells and don't need to nest them.
11:23noidiyay, my whole ELPA installation broke when I tried to uninstall slime :P
11:23noidiargh
11:24noidinote to self: never ever touch a working installation. even if you need a feature that it doesn't have.
11:26AWizzArdrhickey: one suggestion to << and >> is: please add an arglists for them :)
11:29noidithis just keeps getting better, instead of ELPA I just removed my whole .emacs.d
11:30noidiand apparently the default setting in backintime is to exclude backing up hidden files and folders
11:30noidiI should probably step back from my computer before I throw it off the balcony
11:30tomojouch
11:31Hali_303is there a way to do a trace that prints the arguments and evaluates every subexpression?
11:32noidiphew, I found a backup from december \o/
11:35bsteuberhali_303: could you give a simple example how you would like to use it?
11:35Hali_303I mean something like that I can also emualte by inserting some (do expressions and doing printlns
11:35chouserI think I have a use for &env that would otherwise require macrolet
11:35chouserassuming I have a clue how macrolet would work of course.
11:35Hali_303bsteuber: (trace (+ *(1 2) 3))
11:36Hali_303and that should print a call trace in the repl
11:37bsteuberlike "called + with ...., called * with ..., returned 2, returned 5?"
11:37bsteubersounds difficult to me
11:38stuartsierraHali_303, bsteuber: a limited version of that exists in clojure.trace
11:38arohnerHali_303: it's possible, with a macro
11:38stuartsierraI mean clojure.contrib.trace
11:38Hali_303stuartsierra: in what way it is limited? actually I've tried it, but stuck with enabling the :debug loglevel
11:39stuartsierraHali_303: you have to declare which fns you want to trace
11:39bsteuberOh yeah, dotrace looks promising
11:39chouserA form has an outer macro with some args and a body. The body can contain uses of an inner macro.
11:40chouserThe outer macro expands to a let that creates a local with some metadata on its symbol. The inner macro uses &env to collect that metadata and uses it in its expansion.
11:43chouseroh, but :inline doesn't get &env. pity.
11:43AWizzArdesj: what are you talking about? :)
11:43bsteuberhali_303: dotrace won't do inlined ops like +, but otherwise it should be a good tool
11:44AWizzArdWhat is the difference between “pass” and “>>”?
11:44arohnerhrm, this is fun
11:44arohnerlein is downloading some jars for me
11:44ohpauleezAWizzArd: Nothing I don't think. >> is an alias for pass
11:44ohpauleezbut I may be wrong
11:45arohnerand rather than getting a jar, it returns a "moved permanently"
11:45Hali_303thanks all, I'll play around with (dotrace
11:45StartsWithKchouser, like: (letmacro [a ([x] `(println ~x)] (some-form (a 1))) and then some-form inspects a &env for 'a?
11:45arohnerbut it sticks that moved permenantly html file into a .jar extension, which java then tries to load
11:46arohnerwhich 1) doesn't checksum, and 2) causes java to throw an exception when trying to unzip the "jar"
11:47esjoh, just blathering. I being impressed in Clojure doing something that I was sure was too absurd to contemplate. I have to connect to an API meant for C#, so is exposed via COM objects. These object in turn generate COM events that I have to listen for. COM doesn't play with jvm, so you have to generate 3rd party wrappers, which expose java objects. Then clojure can get at the java objects with proxy, reify what not. This is too
11:47esjbaroque to work. Only it bloody well does.
11:47chouserStartsWithK: I don't think so. The user can do something like (foo [x XClass] ... (bar x a b c))
11:48esjoh yeah, and its on Windows. Nothing on Windows ever works.
11:48chouserboth foo and bar are macros, and bar wants to know at expansion time that x is an XClass
11:49chouserso foo expands to (let [#^{::foo-data XClass} x (whatever)] ...)
11:49StartsWithKchouser, but in a normal macro bar can't see value of x at expansion time
11:49chouserthat allows the bar macro to look up x in it's &env, check the metadata, end produce code based on info about XClass
11:50chouserStartsWithK: right, not that *value* of x, but using this trick can see the symbol XClass
11:51StartsWithKchouser, but isn't a symbol XClass a value of x (if foo is let-like in that example)
11:51chousersomething similar could perhaps be done if we had macrolet and foo produced a macrolet block, or if foo did a code-walk of its body.
11:51StartsWithKthe problem with code-walk is
11:51StartsWithKyou can't do it
11:51chouserright. so I don't do it.
11:51StartsWithKyou have to macroexpand your body first
11:51chouserthe problem with macrolet is clojure doesn't have one
11:52chouserso this is a neat trick, seems to me.
11:52StartsWithKit is easy to construct it
11:52StartsWithKno need for &env
11:52StartsWithKi think a implementation is in contrib
11:52chouserI think the one in contrib uses code-walking
11:52StartsWithKif i remember that one correctly, but it has some missing parts/errors
11:53chouserright, so maybe not so easy to construct a correct macrolet
11:53StartsWithKit dosn't expand metadata.. and i think it will not expand in sets or something like that
11:53chouserand this remains an neat trick.
11:53StartsWithKbut i think if that two parts are fixed it would be fully functional
11:53rhickey&env is a precursor to support for macrolet
11:54rhickeybecause macroexpand will have to take an env arg
11:54chouserarguably this technique would still be preferred even in macrolet existed.
11:54chousereven if
11:55StartsWithK&env is needed for macrolet nesting? or am i missing something
11:55replacaHali_303: I have preferred Craig McDaniel's tracer (http://paste.lisp.org/display/71656) to the one in contrib. It's more repl centric (easier to turn tracing on and off, etc.)
11:56rhickeyStartsWithK: macros can do macroexpansion, but if macrolet existed, how could they macroexpand something and make sure any macrolets were respected? only by passing &env to macroexpand
11:59StartsWithKrhickey, if macrolet does a full recursive expansion of it's body and treats 'macrolet as special symbol that is not expanded and reinserts its own definitions at the begining of its bindings vector, woudn't that have a same effect?
12:00rhickeyStartsWithK: that's not what macrolet does. macrolet defines a local macro
12:01rhickeythe interesting variant of which is symbol-macrolet
12:02StartsWithKi used the above procedure based on a code from contrib for my own usage, it worked ok.. maybe there are some cases i overlooked
12:02rhickeywith which you can do things like: every time I say x in this context turn it into (getx foo)
12:02bsteuber apropos: why are there no (native) symbol-macros in clojure?
12:02StartsWithKwhere i would define a new macroexpander with new special form inserted
12:03AWizzArdAre those needed for Clojure-in-Clojure?
12:04rhickeybsteuber: just not done yet
12:04bsteuberic
12:04AWizzArdPlease continue with Cells first :p
12:04rhickeyStartsWithK: oh, you are talking about the implementation of macrolet
12:04StartsWithKyes :)
12:05rhickeyI don't think it can be done correctly as a library
12:06StartsWithKdid you see the one in contrib?
12:06rhickeyyes
12:06StartsWithKhow 'broken' is it? should i mimic what is done there?
12:07rhickeyStartsWithK: I don't recall
12:07StartsWithKso symbol-macrolet could be used for something like import-static from java
12:08rhickeyStartsWithK: if allowed at top level. I'm not sure I have seen compelling use cases for other than symbol-macrolet
12:09rhickeyI guess there was some use for macrolet in monads?
12:11arohnerleiningen is completely choking on log4j, attempting to download bad jars. (I think) I have the appropriate exclusion, directly copied out of the docs. Has anyone else seen this problem?
12:13StartsWithKit looks like that, but only symbol-macrolet version, to remove extra () around monad function
12:13StartsWithKletfn but macrolet?
12:16Chousukemacrolet is the CL name, isn't it?
12:16stuartsierraChousuke: yes
12:16Chousukeletmacro would be more consistent with letfn, but then what about symbol-macrolet? :/
12:16Chousukeletsymbolmacro is not so hot :P
12:16rhickeysymbol-macrolet and macrolet are different
12:16rhickeyhttp://www.lispworks.com/documentation/lw50/CLHS/Body/s_symbol.htm#symbol-macrolet
12:18rhickeymy experience has been symbol-macrolet is the most useful
12:19mattreplarohner: I don't think the exclusion support is in the current release, you'll have to grab the latest from github
12:19rhickeythe only one I have plans to support
12:19AWizzArdsounds ok
12:20ChousukeI suppose macrolet wouldn't be that useful as you can just define a private macro
12:22vyHow can I make a Java array of native types?
12:22arohnermattrepl: ah, thanks
12:22bsteuberchousuke: this could be an argument against letfn, too. but people use it
12:23arohnermattrepl: turns out, using log4j 1.2.14 rather than 1.2.15 also avoids the problem
12:24mattrepliirc, the earlier version of log4j didn't have those dependencies
12:24arohnerright
12:25Chousukebsteuber: local functions are *much* more common than local macros
12:25bsteubersure
12:25bsteuberbut sill I think local macros are useful in some cases
12:25bsteuberwhere you need code-walking otherwise
12:25Chousukeyeah, but the point is that those cases are not frequent enough to warrant a real local macro construct :)
12:26vyNevermind.
12:26Chousukestill, I wouldn't oppose a letmacro if one were introduced
12:26bsteuberphew, that seems hard to decide for me :)
12:27AWizzArdrhickey_: in your Cells gist, in lines 83 and 84, why do you overwrite (set! ..) the :trans slot of the LockCell?
12:27StartsWithKsometimes i would like to make a local macro inside another macro instead of writing a new stared version
12:27dakronevy: what kind of type? (int-array <size>) would work for ints
12:27vydakrone: What about 2D arrays?
12:27ChousukeStartsWithK: are you sure you're not just wanting a local function?
12:27stuartsierravy: Java doesn't actually have 2D arrays.
12:28vystuartsierra: Hrm... I'm not that Java expert, I just need an object of type int[][].
12:29stuartsierravy: Can't do that in Java.
12:29rhickey_AWizzArd: the transient/persistent protocol demands that the transient 'become' the persistent, that's how that can be O(1). So another transient will be created iff needed
12:29stuartsierravy: Either make an int[] and compute indicies in your code, or make an array of arrays.
12:30stuartsierravy: Clojure has helpers to make arrays of arrays (make-array-2d or something)
12:30AWizzArdrhickey_: okay, that makes sense, now that I look at what pass does plus what you've just said. Thank you.
12:30hiredman,(doc make-array)
12:30clojurebot"([type len] [type dim & more-dims]); Creates and returns an array of instances of the specified class of the specified dimension(s). Note that a class object is required. Class objects can be obtained by using their imported or fully-qualified name. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
12:31hamzagents, is there a predicate that will return true for both vector and list, something like seq? and vector? combined?
12:31Chousukecoll? would :P
12:31Chousukebut it will also return true on other things.
12:32dakroneso (make-array Integer/TYPE 2 2) would make a 2x2 matrix
12:32dakrone,(pprint (make-array Integer/TYPE 2 2))
12:32clojurebot[[0, 0], [0, 0]]
12:32hamzachousuke: that would do fine thanks...
12:36AWizzArdrhickey_: if I don't want to make my transient persisent inside an in-cells I must not deref my cell. So, is the right way to access my full celled object (<< identity obj)?
12:37AWizzArdHere obj is a map and I would like to (let [{:keys [bar foos]} (<< identity obj)] ...)
12:37rhickey_AWizzArd: returning non-values from << is a mistake
12:38AWizzArdWhy?
12:38clojurebotwhy not?
12:39ChousukeAWizzArd: the cell can't control access anymore
12:39ChousukeAWizzArd: rendering it useless
12:40vydakrone: But it is not of primitive type int.
12:40AWizzArdChousuke: can you please tell me more about this?
12:40hiredmanvy: yes it is
12:43ChousukeAWizzArd: well, if you have a direct reference to the transient inside the cell, the sentry can no longer enforce the access policy (eg. ensure locks are held for concurrent access, etc.)
12:44AWizzArd(deftype Foo [a b c] ...) And then (in-cells [foo] (let [{:keys [a b]} (<< identity foo)] (>> assoc foo :c (bar a b)) @foo))
12:44ChousukeAWizzArd: or even if you only read from the transient, you may observe changing or inconsistent values
12:45ChousukeAWizzArd: well, in that case foo is a value. but it might not be.
12:46AWizzArdWhat is a non-value then?
12:46Chousukea StringBuilder for example
12:46Chousukeor a transient
12:46Chousukeie. TransientVector
12:46Chousukeor whatever it's called
12:46Chousukebasically, anything mutable
12:47AWizzArdSo, is there a better way than (<< identity foo) if I just want to destructure it (maps, deftypes, structs)?
12:47AWizzArdAnd is it okay to do it in such a case?
12:47Hali_303is there a function that transforms a value in a map given a function?
12:48Chousukewhat you should do in your example is something like (>> foo (fn [[a b c]] (Foo a b (bar a b))))
12:48ChousukeHali_303: update-in
12:48Hali_303Chousuke: thx
13:00vyIs it possible to type-hint the return type of a function?
13:00vyala (declare (function ...) ...) in Common Lisp?
13:02dakronevy: (let [#^String foo (some-function ...)] ...) ?
13:03stuartsierraor (defn #^String foo [args] ...)
13:06vystuartsierra: Thanks.
13:13vyWhat's wrong with this function: http://privatepaste.com/739a4144e4
13:15vyHrm... Can't I use a native type in a type hint?
13:16dakronevy: why do you want to use int instead of Integer?
13:16dakroneout of curiosity
13:17vydakrone: For performance reasons?
13:20dakrone"Instead, use the let technique shown to place args in primitive locals if they need to participate in primitive arithmetic in the body. (let [foo (int bar)] ...) is the correct way to get a primitive local. Do not use #^Integer etc."
13:20dakronefrom the java interop page on clojure.org
13:21dakronethe Coercion section
13:22hiredmandakrone: which has nothing to do with arrays
13:23dakronehiredman: would coercing them with (let ...) in the coord-to-idx function give the performance boost instead of trying to type-hint the type for the function result?
13:24hiredmandakrone: sorry, i thought vy was still asking about arrays
13:24dakroneoh, I was referring to the paste he/she posted
13:26vydakrone: I think this is the right clause that explains it all: All arguments are passed to Clojure fns as objects, so there's no point to putting non-array primitive type hints on fn args.
13:34dakronevy: okay, sorry I couldn't help
13:35vydakrone: I figured out the problem, but IMHO it's a bug that Clojure couldn't compile the code.
13:36hiredmanwhy?
13:36clojurebothttp://clojure.org/rationale
13:36hiredmanclojurebot: bzzt
13:36clojurebotNo entiendo
13:36dakronep4 sync
13:36dakroneerr... whoops, not a terminal window
13:38Hali_303is there a nice easy way to do pattern matching on keyword?
13:39Hali_303I've tried match, but as far as I understand, it does not support keywords
13:39dakrone,(re-find #"oba" (name :foobar))
13:39clojurebot"oba"
13:40Hali_303hm, ok it does support keywords, i just messed it up
13:40Hali_303thx
13:42the-kennymh :/ A "minijob" (german..) next to school really steals my time for clojure
14:14stuartsierraAny reason extend-type for the interface clojure.lang.IFn would throw a NullPointerException?
14:21stuartsierraDoes extend work on Java interfaces?
14:22kotarakI would think so.
14:23stuartsierraI know you can put Java interfaces in deftype, but the docs for 'extend' don't explicitly say that you can put interfaces there.
14:25kotarakI thought this was the point about protocols. That you can also extend other types, not under your control. I would be really surprised, if this didn't work.
14:25stuartsierraProtocols, yes. I don't know if that works with Java interfaces.
14:41konrIs there a way to mimick a this variable in a def? something like (def foo {:n 2 m (+ 2 (:n this))})
14:42stuartsierrakonr: there's a lib for that
14:43konrstuartsierra: on clojure.contrib?
14:49tomojmmm (-> timestamp parse-timestamp .getTime (- (* 1000 60 60 24 days)) Date. format-date)
14:49stuartsierrakonr: yes
14:50tomojI got hit with cupid's ->
14:50chouserhehe
14:51stuartsierra(-> cupid (:heart me))
14:52jcromartieSo tell me about running a remote repl that I can use to reload my running web server.
14:54tomojjcromartie: emacs?
14:54tomojand, leiningen?
14:54jcromartieI want to be able to push my code to the server (rsync) and tell the server to reload some namespaces.
14:55tomojhmm, I don't think there's a way to do that with lein-swank out of the box
14:55tomojunless you have the appropriate :reloads in the right ns declarations, I guess
14:56tomojI've just been keeping emacs with a repl open in a screen, so I can pull changes then C-c C-k the changed files
14:56tomojless than ideal
14:57jcromartietomoj: I've had success with a reload function
14:57stuartsierraYou can run a swank server on a (secured!) port, then tell a local emacs to connect to it.
14:57jcromartiejust gotta remember to reload the reload function :)
14:58jcromartieI have just been leaving a repl running in screen
14:58tomojhmm
14:58tomojI tried using a local emacs before, but then you can't C-c C-k
14:58stuartsierraOr do it my way: start up a new instance of your app on another virtual server, then reroute the public IP address. :)
14:59tomojunless you deal with tramp mappings or whatever
15:00jcromartierlwrap + the repl is pretty good, I can C-r to find previous commands and things
15:00jcromartiebut I'd like to trigger it from rsync
15:00tomojif you don't want emacs stuff, I think http://richhickey.github.com/clojure-contrib/server-socket-api.html might help
15:00jcromartienot sure how it would work
15:00jcromartieooh
15:00konrstuartsierra: hmm, I'm not being able to find it... do you remember it's name or part of the name of one of its functions?
15:00tomojthen just forward that port over ssh and you can access that repl locally
15:01jcromartieI've built a socket-server repl before :) I should know better
15:01jcromartiefor a MUD
15:02stuartsierrakonr: not really, something like let-map or def-map
15:02the-kennyisn't there something like repl-server or so in contrib? I remember it as a one-liner to create a telnet-repl
15:02stuartsierralet-map I think
15:02the-kennyoh sorry.. didn't see the link
15:03tomojI don't see how that's any better than just using a repl in a screen over ssh, though
15:03tomojoh, easier to do stuff programmatically, I guess?
15:03jcromartietomoj: I want to have a "one-button" deployment
15:03tomojyeah
15:03tomojthanks for asking this question :)
15:04tomojI need to think some about my strategy, it currently sucks
15:04technomancy jcromartie: you shouldn't rely on live-reloading for your primary deployment strategy
15:04technomancyit's really hard to ensure you don't have any state left around from the last run
15:04jcromartiethis: http://renesd.blogspot.com/2010/02/secret-to-my-web-development.html
15:04jcromartietechnomancy: that's true
15:04technomancyit's really easy to get slimed
15:04jcromartieyes indeed I've run into it
15:04technomancythat said, it's really handy to have around for when you need it.
15:04cemerick enclojure provides a ready-made repl-server for just this purpose, BTW *shrug*
15:05tomojwhat's the state here that is problematic?
15:05tomojstale var bindings, for example?
15:05jcromartietomoj: vars
15:05tomojah, yeah
15:05jcromartietomoj: the best thing to do would be to unbind everything in a namespace and then reload
15:06jcromartiehow about (require 'foo :no-seriously-reload)
15:06tomojyeah, I had that problem the other day, where it worked with live-reloading, then when I tried to start it later I had to go in and reorder all my functions
15:06tomojwould that solution be safe?
15:06tomojor does it still leave problems?
15:07jcromartietomoj: I believe that it would work
15:07jcromartiebut you will have to reload the reloader first :)
15:08jcromartieBTW I wrote this the other day but I'm not sure if it duplicates something in the API already http://gist.github.com/309148
15:08jcromartiefor specifying namespaces to reload :P
15:15jcromartiewhat can I do with a Var?
15:16jcromartiehow can I get its fully-qualified symbol
15:16dakronehmm, http://pastie.org/833266 anyone know if it's possible to get docstrings in a macro'd defn?
15:17chouser,[(.ns #'map) (.sym #'map)]
15:17clojurebot[#<Namespace clojure.core> map]
15:17drewr,(resolve #'map)
15:17clojurebotjava.lang.ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Symbol
15:17drewr,(resolve 'map)
15:17clojurebot#'clojure.core/map
15:18chouserdakrone: perhaps ~docstring instead of docstring?
15:18chouserdrewr: that's starting with a symbol though
15:19jcromartiehmm, maybe I'll just stick with the symbol
15:19jcromartieI'm iterating over ns-interns
15:19drewrchouser: yeah, true
15:19dakronechouser: hmm, gets Can't use qualified name as parameter: opennlp/p1_1296
15:19dakroneis that due to using %? in the lambda
15:20chouserjcromartie: if you are iterating over some ns that has a var named "map" and you use resolve, you may get clojure.core's map instead.
15:20jcromartieyeah
15:20jcromartieunless I specify the namespace
15:20jcromartiewhich is trivial in this case
15:21chouserdakrone: perhaps. I don't think I've used #() in a macro expansion.
15:21chouseror in a syntax-qoute, rather.
15:21chouserquote. sheesh.
15:22dakronechouser: I changed the #() to be a (fn ..) and it works now, thanks
15:23dakroneoh drat, the doc string still doesn't :-/
15:23chouserdo you mean ~n where you have n
15:23chouser?
15:24dakroneif I do that, I get Var clojure.core/unquote is unbound.
15:24jcromartiehttp://gist.github.com/309148
15:24jcromartiereally-reload
15:26chouser`(defn ~n ~docstring [elements#] ...)
15:27chouseroh, then use it like (post-filter nouns #"^NN") ... don't put quotes around the value you're passing to n
15:28vyWhat would be the easiest way to iterate over a list without a return value? All for/map/etc. tools tend to pack the execution result of the body into a list.
15:29stuartsierravy: doseq
15:29dakronechouser: huh, well that defines alright and then has the correct docstring, but the function doesn't work all of a sudden :)
15:30vyI should have read that book again.
15:34dakroneupdated version, with macroexpand it looks like it should be working, http://pastie.org/833307
15:35dakronebut it's still not, for some reason
15:35hiredmanyou are missing a set of parens
15:37dakronehiredman: ahaha, that was it, silly me
15:37dakronethanks for the extra eyes :)
15:39dakroneand thanks for the macro help chouser
15:42slyphonwhat is the appropriate use for a *binding*
15:42slyphon?
15:43slyphoni know it's kind of a special case
15:43hiredmanyou can use it to emulate multiple return values
15:43slyphonhrm
15:44stuartsierrahiredman: don't you mean destructuring?
15:44hiredmannope
15:44slyphoni'm working on a protocol-level irc bot, like, porting pircbot, and i find myself passing around this 'bot' structure which has the configuration profile, and the socket itself and the output queue etc.
15:45hiredman(declare *return2*) (defn f [x] (set! *return2* (* x 2)) (+ x 2)) (binding [*return2* nil] (print (f 1) *return2*))
15:46hiredmanslyphon: don't do it!
15:46slyphonand then destructuring that struct to get at the components
15:46slyphonno?
15:46clojurebotda da king of the road
15:46slyphoni'm just doing it for fun
15:46hiredmanI mean don't use binding for implicit parameter passing
15:46slyphonoh, ok
15:47slyphonthat's the advice i was looking for
15:47stuartsierrayeah, just made that mistake again myself
15:47opqdonutwhy not?
15:47stuartsierraopqdonut: Breaks multi-threaded code, usually.
15:47ordnungswidrig1hiredman: again, parameter passing. seems to become a hot topic in clojure
15:47chouseropqdonut: because if you do, hiredman will yell at you
15:48ordnungswidrig1chouser: *g*
15:48slyphonwell
15:48opqdonutwasn't binding supposed to be thread-safe?
15:48slyphonthread-local
15:48hiredmanif you ever want more than one db/bot/etc
15:48ordnungswidrig1opqdonut: it is, because it's thread local
15:49slyphonhiredman: i thought then you would just assign the binding before taking an action on the given bot
15:49opqdonutas long as you know it won't propagate outside the thread
15:49opqdonutI think it makes for nice concise code
15:49stuartsierraThe real problem is when you introduce things like agents, or pmap, that execute outside of the current thread.
15:49hiredmanslyphon: or you could, you know, pass parameters around explicitly
15:49slyphonhiredman: sure
15:50slyphonit just seems clunky, coming from mostly an OO world
15:50slyphonhaving to set up your context in every function
15:50opqdonutit seems clunky coming from Haskell too :)
15:50hiredmanopqdonut: how so?
15:50slyphonthat's more a comment about me than clojure, of course
15:51opqdonuthiredman: well the reader monad for example can be used to hide stuff like that
15:51hiredmanyou can write a monad if you want
15:51opqdonutsure, but it's not very idiomatic
15:52ordnungswidrighiredman: but combining multiple reader monads is a pain.
15:52hiredmanyou can write a macro that always adds a "this" parameter to functions
15:52opqdonutnah, just keep the things in a map
15:52opqdonutalso, i can never decide whether to make a higher-order function or a macro :)
15:52slyphonhrm
15:52hiredmanyou can smuggle values in through metadata
15:52opqdonutno there's a good idea!!
15:52opqdonut...
15:52hiredmanall of this is a better solution than binding
15:53hiredmanyou can pass a map
15:53slyphonhow would you "always add a 'this' parameter"?
15:53slyphonyeah, that's what i'm doing
15:53opqdonutso all the with-* macros should be banned too?
15:53slyphonpassing a map and then destructuring it in a let
15:53hiredmanbanned is harsh
15:53slyphonoverandoverandover
15:54hiredmanslyphon: why destructur in a let?
15:54slyphonseems to make things more readable to me
15:54hiredman,((fn [{:keys [a b]}] [a b]) {:a 1 :b 2})
15:54clojurebot[1 2]
15:54slyphonoh
15:54dakroneis there a version of the (flatten ...) in contrib.seq-utils that does a variable amount of flattening?
15:54hiredmanif you are doing the same destructuring over and over you can, of course, roll it into a macro
15:54slyphonok, i didn't realise that
15:56slyphonhiredman: wait, huh?
15:56slyphonhiredman: where is this stuff documented?
15:56hiredmanwhat kind of stuff?
15:56slyphonsyntactical stuff like that
15:56hiredmandestructuring?
15:56clojurebotdestructuring is http://clojure.org/special_forms#let
15:56hiredmanclojurebot: botsnack
15:56clojurebotthanks; that was delicious. (nom nom nom)
15:57slyphonhahahaha
15:57slyphoni put that in all my bots
15:57slyphonhiredman: there was the "language specification" that CL had, which while a bit too much like legaleze was useful
15:58slyphonah, this is a piece of it
15:58stuartsierraslyphon: And Clojure's syntax is quite different from CL.
15:58hiredmanclojurebot: hyperspec?
15:58clojurebothyperspec is not applicable
15:58slyphonstuartsierra: indeed
15:58slyphonhiredman: ah, yes, the hyperspec
16:02slyphonhiredman: this is good (http://clojure.org/special_forms#let), i've been reading the prag-prog book, but it kind of just provides an overview
16:03brandonwi thought it actually covered de-structuring pretty well
16:03brandonwespecially compared to alter & commute :D
16:03slyphonheh
16:03slyphoni think it's just organized in a way that i find somewhat confusing
16:04lancerxHey, experienced hacker but emacs/clojure noob here. I haven't touched emacs in 20+ yrs but am now having a great and gleeful time diving into it (with a bit of "I can't believe I didn't do this sooner"). I got clojure up and running using the ELPA method, but then tore it all down and did a manual install just to learn more. Can someone take a quick look at this gist http://gist.github.com/309085 ? I'm wondering if I need both the
16:04lancerx(eval-after-load "slime...) and the (slime-setup) calls?
16:04slyphonthen again, i mean, this is all kinda new to me, so
16:04brandonwyeah me too
16:05dnolenlancerx: did you install slime via ELPA?
16:05brandonwpart of passing stuff around to funcs is to make everything explicit though
16:05konrExamining the contents of a jar, I've noticed that there is, say, FooLibrary.class and FooLibrary$Versions.class. I'm being able to load the latter, but not the prior. Any idea why? Are they the same thing?
16:05slyphonis it possible to destructure *into* a nested map for instance?
16:05lancerxI did, but then tore it all out and am using the git rev's from technomancy
16:05brandonwit appears to make method definitions more verbose compared to OO, but that's only because from the function definition, you know everything that it takes and and computes
16:05slyphon{:a { :b "c" }}
16:06slyphonbrandonw: yeah, indeed
16:06brandonwand=in
16:06slyphonbrandonw: i'm still struggling a bit with how to use the namespaces effectively, to avoid naming conflicts and make things clear without having functions-that-are-named-so-long-that-it-becomes-impractical-to-use-them
16:06brandonwyeah i am running in to that too
16:07brandonwcombined with me never having used java classpaths seriously
16:07brandonw:D
16:07slyphonhiredman's clojurebot code seems to be a good example in that regard
16:07slyphonhah
16:08dnolenlancerx: I maintained my clojure setup by hand for year, but I switched to ELPA so I don't have my .emacs settings setup for that anymore. I found it easy to use ELPA for initial setup and just symlink to my clojure jars that I build from source.
16:08brandonwmy problem is that clojure has bewitched me, and i want to use it more
16:08brandonwbut instead i have to work on C# at work
16:08slyphonhahahaha
16:08brandonwwith the possibility of using clojure/scala in teh future
16:09hiredmanslyphon: sorry, waht?
16:09brandonwexcept that i keep getting sidetracked by how cool clojure is compared to c# :O
16:09slyphonhiredman: no, i was just saying how your clojurebot code seemed to use namespaces well, to avoid naming conflicts and such
16:09slyphonas a conceptual/organizational tool
16:10slyphonwhich i'm still kind of struggling with
16:10dakronebrandonw: just need the clojure-clr port to be finished and you'll be able to sneak it in with your C# :)
16:10hiredmanslyphon: the namespace structure is mostly result of a re-org Chousuke did
16:10slyphonah
16:10brandonwwell, honestly i'd rather use it in the java environment
16:12lancerxdnolen: Since all the relevant packages are available on technomancy's git repo, it's actually easier for me to just clone them, that way I can refresh/fork etc as needed. The only effort for me has been to figure out how to get it all wired together, but I'm attributing that to my noobness with emacs/clojure/slime
16:13lancerxthat, and the fact that the tutorials are all horribly out of date for manual installs
16:13dnolenlancerx: no, it's not you. I always forget how to set it up. I got tired of forgetting. What error are getting from Emacs when you load a .clj file?
16:13dnolenor run M-x slime?
16:14lancerxdnolen: actually, it all works! I was just wondering if the two slime-setup calls were redundant. I just don't know enough to tell
16:15lancerx(ha, "it all works!"... after hacking against since last night that is...)
16:15konrIn my Jar, there is Foo.class and Foo$Versions.class, which does really look like a class. What is it?
16:16lancerxkonr: that's an inner class (Versions)
16:16dnolenlancerx: heh, your elisp looks OK to me, but I know very little Elisp, and even less about the relationship between slime/slime-repl
16:17lancerxkonr: here's the Java centric overview from Sunacle: http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html
16:18stuartsierraSunacle - nice
16:18lancerx:)
16:18brandonwhahaha
16:18chouserha. "Sunacle" sounds a little rude.
16:18lancerxchouser: exactly
16:18brandonwseems to give sun the emphasis, though
16:18slyphonit's when one of your testicles falls out of your shorts while sunbathing
16:18konrlancerx: thanks!
16:19stuartsierraBut "Orasun" sounds worse.
16:19lancerxwell, do you really want to be saying "Oracun" in public?
16:19brandonwhaving never been involved with the java ecosystem from a business perspective, what are java people's thoughts on it? i know mysql's future is a lot more hazy.
16:19brandonwbut i'm not too knowledgeable about java in the hands of sun vs java in the hands of oracle
16:20Chousukestuartsierra: that almost sounds like the genitive form of my last name (orasen) :P
16:20stuartsierraChousuke: Make them hire you because of that.
16:20Chousukeheh
16:21lancerxfrom an enterprise perspective? Java is "too big to fail". Oracle has a java monetization strategy called BEA, so expect serious cutbacks in the free stuff and more payware.
16:21slyphoncan you :/
16:21slyphonsorry
16:22stuartsierraBut if Oracle seriously screws Java, IBM or somebody will be happy to step in.
16:23technomancylancerx: it's pretty complicated/error-prone to manually install swank even for experienced Emacs users; has nothing to do with noobness.
16:23lancerxand everything rickey has said about JVM's is dead on
16:23technomancythat's why I try to get people to install things the easy way
16:23stuartsierraAnd there's always good 'ol inferior-lisp-mode.
16:24technomancytrue; that doesn't get enough mention
16:24stuartsierraWhich gives you 9/10 the benefit of SLIME for 1/10 the effort.
16:24ordnungswidrigwhere is ->> ?
16:24technomancy90% is a bit generous; /me doesn't know what he would do without M-.
16:24lancerxtechnomancy: yeah, I really did it as an emacs learning exercise - I can write it up if you think it'd be useful
16:24hiredmanin 1.1
16:24technomancyI guess you could build a manual tags table, but ick.
16:25technomancylancerx: actually it'd be better if you didn't unless you were careful about keeping it up to date.
16:25lancerxok, consider it !done :)
16:25technomancylancerx: the #1 problem with swank installation is people finding out-of-date tutorials on peoples' blogs and using them instead of the official docs.
16:25opqdonut:D
16:26lancerxyup, that was my problem :)
16:26technomancyappreciate the thought though. =)
16:26hiredmanhmm
16:27hiredmansounds like we need a bug database where you can file bugs against urls
16:29lancerxGetting the ELPA versions running was really straightforward, but what wasn't clear to me was how to point them at my git clones of clojure and clojure-contrib, so that was a secondary motivation. I understand now 'swank-clojure-classpath', but I just didn't get it the first time around.
16:30stuartsierrahiredman: Or comment on the blog posts.
16:30dnolenlancerx: I couldn't get swank-clojure-classpath to work. I symlinked to my built jars.
16:30dnolenbut perhaps it changed.
16:30technomancylancerx: standalone M-x slime sessions really aren't the common case it's designed to work with.
16:31technomancybut I agree it could use some streamlining/extra explanation for that case.
16:31lancerxOh, I was starting with that ants.clj tutorial
16:31lancerxwhich sends you in that direction
16:32stuartsierraclojurebot: def ants.clj is old
16:32hiredmanclojurebot: ants.clj?
16:32clojurebotants is http://clojure.googlegroups.com/web/ants.clj
16:32hiredmanclojurebot: def ants.clj?
16:33hiredmanhmmm
16:33hiredmanI must have broke it
16:34lancerxso is there a more canonical/updated short tutorial?
16:36arohnerwhat requirements does lein test have?
16:36hiredmanoh, it thinks you are trying to lookup the definition for a symbol ants.clj
16:36arohnerit's complaining about not finding files in my class path, that work fine if I start with 'lein repl'
16:37arohnernm, stupid mistake
16:38konrI'm not being able to import a class (NoClassDefFoundError), but importing its inner class works fine. What could be wrong? The jar?
16:40Hali_303(match [:a :b] [:a] "startswithA" [:a :b] "AandB") can someone explain why this evals to "startswithA"?
16:40hiredmanclojurebot: def ants.clj?
16:40clojurebotIt's greek to me.
16:41dnolenhmm, is there an easy way to flip between functions in a mapping operation? (map foo-on-even-bar-on-odd v)
16:41dnolen?
16:41hiredmancond
16:44chouser'if' with 'indexed' would work
16:45dakrone,(map #(cond (odd? %) (inc %) (even? %) (dec %)) (range 10))
16:45clojurebot(-1 2 1 4 3 6 5 8 7 10)
16:45hiredmanoh
16:46hiredmanyeah, I assumed even? and odd?
16:46hiredmanyou can always split the seq apart, map seperately, then interleave
16:46dnolen(map (flip-flop foo bar) v)
16:46dnolenhiredman I need them to be in order for side-effects (OpenGL)
16:47hiredmanah!
16:47hiredmanbut they will be!
16:47dnolenoh yes
16:47dnolenyou're right :)
16:48hiredman,(let [x (range 10)] (interleave (map inc (take-nth 2 x)) (map dec (take-nth 2 (rest x))))
16:48clojurebotEOF while reading
16:48hiredman,(let [x (range 10)] (interleave (map inc (take-nth 2 x)) (map dec (take-nth 2 (rest x)))))
16:48clojurebot(1 0 3 2 5 4 7 6 9 8)
16:48hiredmanor something
16:50dnolenhiredman I like yours don't need to index the collection.
16:51hiredmanit will generate more garbage
16:51hiredmanephemera
16:54jlillyAnyone have an example of a good, concurrent clojure app? Looking for how people flow info through their programs.
16:57lancerxso looking at the four options outlined for clojure development in emacs (via swank-clojure), it looks like I should setup Leiningen and develop via options 3 or 4?
16:57bsteuberjlilly: did you read ants.clj?
16:57hiredman:D
16:58hiredmanhttp://github.com/hiredman/Repl
16:58dnolenhmm also this, (map (fn [[a b]] (foo a) (bar b)) (partition 2 v))
16:58hiredmanRepl ends up with something like 21 threads just at start up
16:59hiredmandunno if it is a good example
17:01jlillybsteuber: I did. Looking for a 2nd code sample to compare / contrast.
17:02technomancylancerx: that's probably the most straightforward way to go
17:03bsteuberjlily: too bad, I don't know another one =) so you could might start with hiredman's repl
17:03lancerxtechnomancy: thanks...maybe those could be promoted to items 1 & 2 in the list? :)
17:05hiredmanRepl essential does message passing via a shared queue
17:14stuartsierraSecond draft of new testing framework: http://paste.lisp.org/+21G4/1
17:14stuartsierraNow with laziness!
17:15stuartsierraWhich was a heck of a lot harder than I expected.
17:38lancerxwhoa, it looks like lein copies jars from the local maven repo and populates lib/? how come?
17:39technomancylancerx: because calculating the classpath out of ~/.m2 would be a pain
17:39technomancyputting things in lib is a pretty common convention
17:41lancerxI guess seeing all the maven cruft made me shudder a bit :)
17:41technomancyit's a common symptom; you'll recover soon.
17:42technomancytake two aspirin and contact a medical professional if you're still shuddering in the morning
17:43lancerxno, my maven antibodies are already flooding my system...
17:46chouserany chance it could use symlink on platforms that support it?
17:46lancerxchouser: I was just thinking that same thing
17:47lancerxas an intermediate step to a fullblown classpath hack of course :)
17:47lancerxoddly enough, my ~/.m2/repository is already a symlink :)
17:50lancerxpro tip: I keep my maven repo and other java tools/libs outside my homedir because then I can share it to my vm's without worrying about them peeing in my ~
17:51lancerxand it's easier to exclude that whole tree from Time Machine
18:03kwertiiIs there yet any standard/preferred way to get more useful stacktraces in Emacs/SLIME? CLJDB, maybe?
18:05kwertiiThe only lines in stacktraces that apparently refer to my code (loaded via SLIME) give (NO_SOURCE_FILE:1) as the line number, which isn't terribly helpful for tracking down the bug.
18:06hiredmanyou have load the whole file at a time
18:06hiredman(I think)
18:06hiredmanor it's like one of those compile vs. eval options slime has, which are just silly
18:07kwertiiI've been in a tight edit-test loop where I just reload forms on the fly with C-M-x. this is great for rapid development, not so great for debugging... is this just the price one pays for not loading the whole file?
18:08hiredmanI believe so, but my experience with slime is not extensive
18:08kwertiiSLIME knows where the fn is coming from. in theory, it could just tag whatever it pipes over to Clojure with the appropriate line numbers
18:09kwertiiI don't remember whether CL works this way too
18:09the-kennykwertii: This should be fairly easy
18:09kwertiithe-kenny: famous last words :)
18:09hiredmanthe-kenny: are you sure?
18:09the-kennyhiredman: Not absolutely, but I read the lines in the swank-source some time ago
18:11kwertiithe-kenny: do you know whether the fix needs to be in SLIME or on the Clojure end?
18:11hiredmanI think it would need both
18:12the-kennykwertii: hm.. looks like it won't be that easy: http://github.com/technomancy/swank-clojure/blob/master/src/swank/commands/basic.clj#L43
18:12hiredmanslime would need to get at the code between, read and compile time to alter line number information
18:12the-kennythe eval-stuff only gets a string, no line-numbers etc
18:14kwertiieval-region has a signature for [string file line].. if that is available somewhere from Emacs/SLIME, it would just be a matter of changing it to pass it along
18:14kwertiiI guess that would only get you the first line number of the function anyway
18:15arohnerkwertii: I use C-c C-l (load file), that way the line numbers stay in place
18:15kwertiiarohner: yeah, I guess that's a good workaround for now. I can just reload the whole file when bugs come up
18:16arohnerwhen using lein swank, where can I set *print-length* and *print-depth*?
18:23kwertiiarohner: in the REPL?
18:23arohnerkwertii: automatically, on startup
18:23arohnerI know I can set! it
18:24kwertiiarohner: there must be some SLIME hook you can use in your .emacs
18:25arohnerlein repl/swank both call clojure.main. I guess I can just do it with an --init
18:25arohnerthough it would be nice to create tasks in the project.clj file
18:30hamzaaroher: check the last message in the tread, though i could not get it to work, http://groups.google.com/group/clojure/browse_thread/thread/11ee44e988022289
18:31technomancyarohner: you can create tasks in project.clj
18:32technomancyyou just need to define a fn named after the task in the leiningen/$TASK ns
18:32lancepantztechnomancy: is there a way i can have lein test set environment variables?
18:32technomancylancepantz: the JVM doesn't allow that
18:32hamzatechnomancy: i did that but lein does not pick the task defined?
18:33technomancyhamza: did you try it on 1.1.0?
18:33technomancyit was a recent fix that enabled it
18:33lancepantzk
18:35hamzakk that may be it i'm on 1.0.1, one other thing i had was when developing plugins i have to compile it and cp it to lib folder to test otherwise it does not pick it up is this also fixed in 1.1.0?
18:36technomancyhamza: it should be fixed, yeah.
18:37boojumhmm, ldap search filters are like lisp
18:37arohnertechnomancy: I should have been more clear. I mean more like project-specific tasks
18:37arohnertechnomancy: like rake tasks
18:37hamzathough i am sure i did self-install 2 days ago after i had a problem with maven folder do i have to get the new script too?
18:38technomancyarohner: no, I gotcha. you can do that now.
18:38arohnertechnomancy: how?
18:40technomancyarohner: just a make a function in the leiningen/my-task ns
18:40arohnercool
19:02AWizzArdrhickey: I switched now successfuly from hacks to Cells with my DB. Works nicely so far!
19:02jcromartieboojum: they most certainly are
19:03jcromartieboojum: several RFCs use s-expressions to define protocols and such (IMAP is a s-expression protocol)
19:11Scriptorhi everyone
19:13Scriptornoob question: why does Clojure use symbols for keys in something like structs, and not strings? efficiency?
19:15mDuffScriptor, ...needing to test only for identity and not equality does improve efficiency, yes...
19:33jcromartieman... wrangling text with ranges and all that junk is just so not fun in ObjC
19:37tomojthe other day I saw stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding
19:38tomoji.e. urlencode
19:38tomoj:'(
19:38the-kennyWay more fun than pure java or C++ in my opinion
19:38tomojsorry
19:39tomojsure
19:39tomojstill makes me wanna cry
19:43ScriptormDuff, er, so the :foo syntax is for keywords?
19:44the-kennyScriptor: It is
19:45tomoj,(keyword? :foo)
19:45clojurebottrue
19:45tomoj,(symbol? 'foo)
19:45clojurebottrue
19:46Scriptorargh, should've known that from before
20:09uninvertedAnybody know how to set the classpath from clojure?
20:21hamza(System/setProperty "java.class.path" "same/path") should work
20:22technomancyuninverted: there's no way to do it reliably
20:24uninvertedHmm, even with the classpath set to the dir where foo.clj is, I still get java.io.FileNotFoundException: Could not locate foo__init.class or foo.clj on classpath: (NO_SOURCE_FILE:0)
20:52dnolennot sure if there's anyone into OpenGL, but I started porting the Nehe tutorials to Clojure, http://github.com/swannodette/clj-nehe, thanks to Penumbra and Lein it's a pretty simple affair to start hacking at OpenGL interactively right away.
21:06dabdI'm using json-str from clojure.contrib.json.write and I don't understand why it escapes all forward slashes like this: (json-str "http://localhost/foo&quot;) returns "\"http:\\/\\/localhost\\/foo\""
21:19qedevening gents
21:43BrandonWi'm building incanter... this is my first build of anything java. is it normal for a build to require downloading of about a million different small files?
21:44konrhaha, yes, I had the same surprise
21:44BrandonWi guess it is a pretty decent size project
21:45BrandonWall that for matrix multiplication :)
21:50chouserincanter includes a bunch of other libs I believe
21:55BrandonWyes it sure does
22:06konrDo (read-line) work in your emacs? Here, it leaves SLIME waiting for more input indefinitely
22:07BrandonWin hind-sight, incanter is a lot of overhead to deal with for a simple one line puzzle solver, haha
22:08konrWell, you can always roll your own functions :)
22:45redalastorDoes someone have a suggestion for key-value store for java / clojure?
23:00dnolenredalastor: I like CouchDB, and Clutch seems like it's getting a lot of development. There's also a library for MongoDB that people seem excited about.
23:00lancepantzredalastor: tokyocabinet is definitly the fastest
23:02redalastorI would need something that is pure java (or pure clojure).
23:02redalastorDue to a "can't install anything on the server" limitation.
23:03devlinsfVoldemort?
23:03lancepantzall i can think of is the pure java berkeley db
23:03lancepantzvoldemort, cassandra as well
23:03lancepantzthose are intended to be distributed though
23:03lancepantzif you're doing voldemort on one node, might as well use bdb
23:05redalastorI'll check bdb.
23:07dnolenredalastor: fleetdb is pure clojure
23:09redalastorOoooh... I'll check that too!