#clojure logs

2010-10-07

00:14drewr_rata__: you'd add an expression to define-clojure-indent in clojure-mode.el like (complex 1)
00:17drewractually, you'd just add (define-clojure-indent (complex 1)) in your custom elisp after you've initialized clojure-mode
00:17drewrdon't mess with clojure-mode.el
00:17laurusCan anyone here point me to information, or the right lines in the Incanter source code, for creating a JFreeChart theme?
00:19_rata__drewr, thanks :)
00:23laurusHas anyone found a way to generate plots in Incanter for use in academic publications?
00:43_rata__is there anything in clojure like repeat, but that repeats the expression unevaluated?... e.g. (repeat 2 (gensym)) -> two different symbols
00:44scottjwasn't there a version of binding in contrib that spanned threads?
00:45scottjlaurus: do you come in every week asking that? if not it's a common complain/request :(
00:45laurusscottj, I'm sorry. I figured somebody might show up at some point who does.
00:46laurusI'm hacking away at it right now, but it's confusing to a total newbie like me
00:46scottjit's fine, have you tried the ml?
00:46laurusNo, I guess I should do that.
00:46drewr_rata__: constantly
00:46scottjlot more incanterers there
00:46laurusOK, I will try there.
00:47laurusThanks scottj. Sorry for bugging you and everybody!
00:47drewr_rata__: oh, you want unevaluated?
00:47drewr,((constantly (gensym))
00:47drewr,((constantly (gensym)))
00:48drewrconstantly creates a function that always returns the (evaluated) arg you give it
00:48drewrbut you could wrap that arg in a fn to delay
00:48_rata__yeah... then (repeat 2 (constantly (gensym)) returns a seq with two fns
00:49_rata__and the fns would returns both the same symbol
00:51_rata__gensym is just an example... what I really want is to call a function that returns refs, but I don't want the refs to be the same
00:52laurusIf I have a (doto myinstance ... going on, how do I do a chain of multiple method calls?
00:52laurusTo be specific here, I have (doto plot (.getDomainAxis
00:52laurusBut then I want to call setLabelFont right after that.
00:52amalloy,(repeatedly 2 (rand))
00:53scottjlaurus: not following exactly, .. and -> don't help?
00:53amalloy_rata__: the above is wrong :P. but repeatedly is what you seem to want. (repeatedly 10 rand) would get you ten different random numbers
00:55laurusscottj, I want to use the (.. x (y) (z)) form
00:55laurusBut I don't know how to do it inside a (doto form
00:55_rata__ok, thank you guys :)
00:55amalloylaurus: (doto myvar (.setSize 10) (-> .getSize .getX))?
00:56drewr_rata__: what's wrong with #(ref %)?
00:56amalloydrewr: (= ref #(ref %))...
00:56laurusamalloy, that chains getSize and getX?
00:57drewramalloy: I don't follow; each time you call #(ref ...) you get a new ref
00:57amalloylaurus: yeah. try macroexpanding the above
00:57laurusI'm actually not familiar with -> yet
00:57amalloydrewr: and every time you call red you get a new ref
00:57amalloys/red/ref
00:57_rata__drewr, ref is no problem
00:57laurusAnd what is macroexpanding by the way?
00:57_rata__the problem is (repeat 2 (ref nil))
00:58_rata__but (repeatedly 2 #(ref nil)) do it ;)
00:59drewr(for [_ (range 2)] (ref nil)) -> (#<Ref@99846fd: nil> #<Ref@6c5c90f6: nil>)
00:59laurusI actually don't see that -> defined in my Clojure book
00:59amalloylaurus: you can ask the REPL to show you what your form looks like after processing (a single layer of) macros
00:59laurusamalloy, oh ok
00:59amalloyone sec, i'll gist an example
00:59laurusThanks!
01:00amalloylaurus: http://gist.github.com/614574
01:01laurusOk
01:01laurusI have (doto plot and then a bunch of forms inside that
01:01amalloybasically -> and ->> evaluate the first argument, then stitch that into the next form, stitch the result of that to the next form...
01:02laurusAh, perfect
01:02laurusI want (.getDomainAxis
01:02amalloy-> stitches it into the second position, ->> into the last position
01:02sexpbotjava.lang.Exception: Unable to resolve symbol: stitches in this context
01:02laurusAnd then I want to call setLabelFont on what is returned by getDomainAxis.
01:02laurusDoes that make sense?
01:02amalloyyes
01:03amalloy(-> myobj .getDomainAxis (.setLabelFont BLUE))
01:03laurusSo in this case what did -> stitch?
01:03laurusamalloy, oh, so I can't put it inside the (doto ..) then? The doto provides the plot reference in the first place
01:03amalloyit would transform the above into:
01:03amalloy(.setLabelFont (.getDomainAxis myobj) BLUE)
01:03amalloyyes, you can
01:04laurusOh I see how you're doing it
01:04laurusIt's kind of the reverse of the (.. way
01:04amalloy(doto myobj setblah setfoo setbar (-> .getX (.setBaz BLUE)))
01:05scottjthere's also clojure.walk/macroexpand-all
01:05laurusamalloy, check this out: http://paste.lisp.org/display/115291
01:06amalloyit's actually exactly the same as the .. way. it just doesn't require that you use . - you can stitch in any arbitrary function. there's really no reason to use .. now that we have ->, as far as i understand
01:06laurusOh, I see
01:06laurusI'm trying to modify that function, and rename it
01:06amalloyokay
01:07amalloythe first point i would make is that (let) includes an implicit do, so you don't really need one
01:07laurusOk :) Good point there
01:08laurusI'm just confused because (-> myobj .getDomainAxis (.setLabelFont BLUE)) contains an explicit reference to myobj
01:08laurusWhereas in the doto form you don't need that specific reference
01:09amalloybut it doesn't have to. doto will pass that into the ->
01:09laurusSo just omitting the myobj symbol and leaving the rest the same works?
01:09amalloy(doto x (-> .getSize)) is the same as (doto x .getsize)
01:09laurusOh, great
01:09laurusSorry I'm so "n00bish"
01:10laurusThis is really a hack, in the worst way, I'm just trying to see if it's possible before I waste a lot of time
01:10amalloyheh
01:10amalloyi'm not sure what you're trying to do to this function. avoid creating the let block or something?
01:11laurusNo, I'm just trying to add more features to the theme
01:11laurusBut they're not all just single method calls, some require chains
01:11laurusNow I'm getting "java.lang.Exception: Unable to resolve symbol: setLabelFont in this context"
01:11amalloy.setLabelFont, with a . :)
01:12laurusOh, whoops, sorry!
01:12laurusIn the .. form you don't need those single .'s, that's my excuse ;)
01:12amalloyheh. yeah, i don't use the .. form much myself
01:13laurusOuch, running the thing ended up with a java.lang.ClassCastException
01:13laurusWho knows were that came from
01:13laurusI wasn't aware I was casting anything :P
01:15amalloyhah. the Joy of Java
01:16amalloylaurus: http://gist.github.com/614588 is an example of what you want to do, and its macroexpansion
01:17laurusamalloy, while I'm checking this out, check this out: http://paste.lisp.org/display/115291#2 It's the code I ran to get that error :P
01:18amalloylaurus: looks fine, clojure-syntax-wise. i don't know your library, but i'd guess that .setLabelFont wants a Font object rather than a string or something like that
01:18laurusamalloy, ah, you got it. That's what it is.
01:18laurusThanks for that example by the way, it makes great sense to me now.
01:19amalloycool! you're one step ahead of me, then - it only makes vague, magical sense :)
01:19laurusHah ok :)
01:19laurusI'll instantiate a Font object then :P
01:19amalloygood call
01:20amalloybtw, you could save some code by moving the (Color.) into your let block
01:20laurusIt's funny how I'm learning all this random Java stuff
01:21laurusamalloy, thanks. I'm actually going to keep it as close to the original function as possible for now, for reference purposes, since I'm just blindly ripping off liebke's code here
01:22laurusWell, the function ran, I can't tell if it actually worked or not, but it sure did something
01:22laurusamalloy, thanks so much!
01:23amalloyhaha
01:23amalloylaurus: what language(s) are you coming from, ooc? i ask since you mention it's funny learning java stuff
01:23laurusamalloy, well, I actually learned PHP, then Java, then Python, and now Clojure
01:24laurusBut I learned Java from a book that was purely theory, no practical stuff like Swing/AWT
01:24amalloyheh. climbing right up the abstraction ladder, i see. going the right direction
01:24laurusSo now I think it's amusing that I'm learning all of this stuff I thought I never would, like Swing, and instantiating Font objects, and weird things like that.
01:24laurusBut I have two options here, learn how to do this, or learn gnuplot.
01:24amalloyi learned, like...TI-BASIC, java, c, common lisp, clojure, php
01:25laurusI see
01:25amalloyand i like your plan better
01:25laurusHeh, well
01:25laurusThe PHP doesn't really count anyway
01:25laurusThat was just a 2-3 week thing right at the start :p
01:27amalloyi used to luvvvvvvv lava, and then after trying lisp i was like..."wait, really? there's no (map)? not even in any of the libraries?"
01:27lauruslava = Java?
01:27amalloyhah, yes
01:27laurus:)
01:27laurusRight, Python to me is the big disappointment
01:27laurusI spent a lot of time on Python
01:27amalloybut if i ever invent a JVM language, i'm calling it Lava
01:27laurusHahahaha awesome!
01:28laurusI like Clojure better than Python
01:28laurusFonts are so strange
01:29amalloywhat don't you like about python? my understanding (having never written any) was that it has first-order functions and most of the stuff you'd expect in clojure, just in an imperative style
01:29laurusWell, yes, that's right
01:29laurusBut when you start trying to do the functional stuff, Clojure is so much better.
01:29amalloyain't that the truth
01:29laurusI don't think Guido understands or cares about functional programming, at all
01:29amalloyone of these days i'll get up the nerve to understand haskell
01:30laurusThere are a few blog posts he made threatening to remove various functional functions from the language, etc.
01:30amalloyhaha, silly guido
01:30laurusBy the way, let me try to find something funny for you
01:30amalloythere are so many rhyming jokes you could make on his title
01:30amalloyirrelevant dictator for life?
01:30laurus:P
01:30laurusamalloy, look at this: http://answers.yahoo.com/question/index?qid=20080522182651AAh5Hqs
01:32amalloywait, he says he watched "the video", but the link is not to a video
01:32laurusWell, the funny thing is what he said
01:32amalloy(i'm really hoping you'll show me something that makes python look ridiculous. my girlfriend is a python fanatic)
01:32laurus"Thanks a lot, bro. You've given me a fantastic resource. I watched the video and saw Guido for the first time. He's just as cool as I thought he would be."
01:32laurusI literally LOLed when I read that.
01:33amalloyyeah, i'm afraid i don't know enough about the python culture to find that too funny. i can totally imagine seeing a video of my programming idol and finding him as cool as i thought he'd be
01:33amalloytoo young and idealistic, perhaps...
01:36tomojztellman: so for implementing a custom binary protocol in aleph, do I need to go study netty's guts, or just write the parser mostly in clojure using ChannelBuffer?
01:36tomoje.g. netty would probably have me write a FrameDecoder
01:36tomojbut it seems like I should just ignore all that and just write simple functions
01:37_rata__is there the author of fnparse?
01:40laurusamalloy_, are you at all familiar with fonts in Java?
01:41amalloy_i was, back in java 1.3. what do you need?
01:41laurusWell, I'm trying to use the CMU Serif font that's Unicode
01:41laurusThe problem is that when I run "fc-list :style=Regular" in bash, I don't see it. It's under "style=Roman"
01:42laurusSo I have no idea how to specify that in Java...
01:42amalloy_ummmm, well i'm not at all familiar with fc-list in bash
01:42laurusIt's okay, that's the only way I know to list all my fonts :P
01:44laurusAny ideas to make it recognize this darn font?
01:45amalloy_not really. these two might be helpful: http://tinyurl.com/28taa2k and http://tinyurl.com/2bmg49h
01:47laurusThank you
01:48laurusThe problem is the style is Roman, not Regular
01:50tomoj_rata__: he shows up here every once in a while
01:51_rata__tomoj, what's his nick?
01:52tomojjoshuachoi I think
01:56slyrus__rata__: yes, it's joshuachoi. are you using fnparse?
01:56_rata__yeah, and I really don't understand its behaviour right now
01:56_rata__something that seems completely ok gives me an error
01:57slyrus_are you using the develop branch?
01:57_rata__I'm using a version downloaded from git some time ago
01:57laurusamalloy_, have a good night!
01:57laurusAnd thanks again!
01:57slyrus_sure, you can download it from git, but you probably want to be on the develop branch, not master
01:57slyrus_at least that was my experience
01:58_rata__how do I download the develop branch? (I'm a git newbie)
01:58slyrus_git checkout develop
01:58_rata__once I've downloaded the master branch?
01:59amalloy__rata__: you downloaded all the branches. git checkout develop just switches which one is your "current" branch
01:59slyrus_I think when you pull from a remote you get all the branches
01:59_rata__ok
02:00slyrus_but maybe we should take a look at your problem on master before switching to develop. do you have a github/gist of the problematic code?
02:02_rata__slyrus_, I can do one
02:04_rata__how do I disregard a change I've made to the code to pull a new revision from git?
02:05slyrus_git reset --hard
02:05slyrus_will wipe your changes
02:05slyrus_git stash can be used to squirrel them away
02:20_rata__http://gist.github.com/614646
02:20_rata__it seems that the clojure syntax highlighting doesn't work
02:21_rata__the problematic part is (def expression ...
02:21_rata__slyrus_, http://gist.github.com/614646
02:23slyrus_I'm not familiar with the pre-develop (2.0?) fnparse stuff, but I think the problem is that you're matching agnt instead of expression
02:24slyrus_I mean agnt instead of (complex ...)
02:24slyrus_that (alt agnt (complex ...)) form is going to match agnt there, I think
02:24lypanovmorning lau
02:25slyrus_hmm... no, maybe that's not right
02:25_rata__slyrus_, it's going to match agnt for "a, ", but not for "2*b"
02:25slyrus_what about for "2"?
02:26_rata__"2" is a whole-number
02:26_rata__and it's matched by (invisi-conc whole-number (separator \*))
02:26slyrus_yeah, but it's also an alpha-num-string
02:26_rata__really "2*" should be match by that
02:27slyrus_but first it matches as agnt
02:27slyrus_does swapping the order of the (alt agnt (complex ...)) forms change things?
02:28_rata__mmmmm... you're right
02:28_rata__let me try that
02:28slyrus_I'm not sure it will, and even if it does if that's the right thing to do
02:28slyrus_what are you trying to parse?
02:29_rata__the Kappa language (www.kappalanguage.org)
02:30_rata__swapping the order didn't help :( I thought it would
02:30slyrus_no, I didn't really think it would :)
02:30slyrus_so what does 2*b mean in kappa?
02:30_rata__2 agents "b"
02:31slyrus_I'm not seeing * in the kappa syntax page
02:31_rata__no, sorry! it did help!
02:31_rata__I was testing the wrong form... I tested now the right one and now it works!!!
02:31_rata__thank you so much!
02:32slyrus_you're welcome
02:32_rata__(btw, can you say in english "I tested now..."?)
02:32_rata__:)
02:32slyrus_I tested
02:32slyrus_or I have now tested
02:33_rata__thanks
02:34slyrus_I'd still recommend looking at the develop branch before going much further with fnparse
02:35_rata__ok... it's much different from what have you seen in the gist?
02:36slyrus_well, the functionality you want is probably now in the "hound" package. take a look at the demos. it's roughly the same in spirit but the details have evolved a bit
02:36slyrus_defrule (and defmaker) are the things that you use to define rules (and rule-makers)
02:37slyrus_you can also check out my SMILES parser if you want to see a working-ish example of a parser written in it
02:37slyrus__rata__: http://github.com/slyrus/chemiclj/blob/master/src/chemiclj/smiles/read.clj
02:40_rata__thanks a lot! :)
02:42slyrus_np
02:42_rata__the develop branch is fnparse 3.x?
02:43slyrus_I think that's correct
02:46_rata__oh, but fnparse 3.x has renamed a lot of macros and functions :(
02:46slyrus_well, yes, that's why I suggested you start _now_ :)
02:47konrHas anybody used GTK with clojure? I'm getting an illegal argument exception with (.init Gtk (make-array String 0)). The argument seems fine, according to repl-utils/show: [10] static init : void (String[])
02:47_rata__and the worse thing is that you must require it now instead of use'ing it
02:48slyrus_that's a good thing, if you ask me
02:48_rata__why?
02:49hiredmankonr: thats not how you call static methods
02:50konrhiredman: oh, of course...
02:50slyrus__rata__: I guess it's just a matter of convention and taste. the h/cat, e.g. makes it clear to me what's going on here.
02:51slyrus_and I think you _could_ use it if you wanted to deal with the refer-clojure renaming of things
02:51_rata__but to have the code full of "h/" makes it a bit uglier
02:52slyrus_that's subjective. I'd recommend trying it and seeing if you like it. I used to think like that but eventually grew to like things like h/+
02:52slyrus_instead of alt
02:56_rata__I think it will be difficult to get used to... alt was very mnemonic, at least for me
03:12_rata__slyrus_, is there documentation for fnparse 3.x or not yet?
03:12_rata__btw, you've made a smiles parser... are you a chemist?
03:14bhenryanybody up?
03:17kryftbhenry: Sure, it's 10 am here. ;)
03:17slyrus__rata__: I'm more of a biologist, but I've been dabbling in chemistry
03:17bhenryi need to know how to check if a date is within the last 30 days
03:17kryftbhenry: Unfortunately I probably won't be able to answer any clojure questions you may have.
03:18bhenryhaha. it's okay. it's 3:15 am here. i should be going to bed.
03:18slyrus_bhenry: perhaps http://github.com/clj-sys/clj-time might help
03:22_rata__slyrus_, nice to meet you :) I'm a biochemist (but more of a computational biologist now)
03:23notsonerdysunny~(doc var)
03:23notsonerdysunny->(doc var)
03:23sexpbot⟹ "Special Form: Please see http://clojure.org/special_forms#var&quot;
03:23slyrus__rata__: likewise. besides checmiclj, i've been meaning (and slowly starting to) port my cl-bio library over to clojure one of these days.
03:24_rata__what does the cl-bio library do?
03:24slyrus_the first step was my "iwashi" library which provides for 2-, 4- and 5-bit arrays in clojure, for more efficiently storing DNA and protein sequences
03:24slyrus_cl-bio is an in-progress general purpose computational biology library. think bioperl for common lisp. at least that was the idea.
03:25slyrus_some parsers, some data representation, getting stuff from entrez, integration with a DAS client and server, etc...
03:28_rata__nice... I friend of mine used biopython a lot, but he's been recently learning scala and loved it, so I don't know what he's using now
03:29_rata__probably he's using nothing, because he's just entered a phd
03:29_rata__:P
03:29slyrus_are you a grad student/postdoc/something else?
03:31_rata__no, i'm just a bsc in biochemistry, but I'm applying to a scholarship to do a phd
03:34_rata__I'm more from the systems biology branch of computational biology though... I like simulating metabolism or signaling pathways... or rather making tools to simulate/analyse metabolism and signalign pathways models (that's where clojure comes into picture)
03:35_rata__are you a grad student?
03:36kryft_rata__: I'm a grad student in machine learning, and I know some people in our (rather large) group have been doing metabolomics.
03:36kryft_rata__: I'm planning to use clojure for work too. :)
03:37_rata__kryft, where do you work?
03:37kryft_rata__: http://www.cis.hut.fi/projects/mi
03:37bhenryslyrus_: meh. i'd rather not use a library for simple date stuff. http://gist.github.com/614727
03:37kryft_rata__: I'm also collaborating with John Shawe-Taylor's group at University College London.
03:38_rata__kryft, finland! wow
03:38slyrus__rata__: no, but I was. finished up a couple years ago.
03:38tomojkryft: have you heard of random indexing?
03:39_rata__slyrus_, what are you doing now then? postdoc?
03:39slyrus_bhenry: date stuff isn't so simple
03:39slyrus__rata__: industry
03:39bhenrynot all of it, but that gist works well enough.
03:40kryft_rata__: Why wow? :) Where are you?
03:40kryfttomoj: I don't think so - should I? :)
03:41slyrus_bhenry: well, you are using a library, you're just using java.util.Date
03:41slyrus_personally, I'd rather have a clojure library than rely on the java interop stuff, but to each their own
03:41_rata__wow because finland is supposed to have a very good quality of life in general, something I look for in my life :)
03:41slyrus__rata__: a small biotech in california
03:42_rata__I'm from chile
03:42kryft_rata__: Ah. :D Well I would say that's true. :)
03:42tomojkryft: doubtful
03:43kryfttomoj: :D What is it?
03:43bhenryslyrus_: while that's true i won't need to mess with my dependencies. plus the java date library hasn't changed much forever despite it's general suckitude.
03:43tomojseems to be mostly used for NLP, was just curious if you'd heard about it since I'm playing with it and you must be smart
03:43tomojbasically instead of doing dimension reduction you just start off using a random projection
03:44kryfttomoj: I should warn you that I have a special talent for appearing much smarter than I am. (If I appear stupid, I should be worried.)
03:44tomojwell "grad student in machine learning" just caught my ear :)
03:44kryfttomoj: Ah, ok. Is random indexing just a term they use in NLP then (instead of random projection)?
03:44kryftOr is it more specific than random projection.
03:45tomojafaict random indexing is a certain way of applying random projections
03:45konrIt seems that I cannot reference (e.g. (show class)) final classes, or I get a NoClassDefFoundError. Is there some special syntax I must use?
03:45kryfttomoj: Ok. Our group doesn't do nlp, but we do have an nlp group in our lab as well.
03:45slyrus_bhenry: fair enough. And in your original question you didn't say "how do I see if a java.util.Date is within 30 days", but rather a less well specified concept of date that could have been anything (milliseconds since the birth of Jimmy Carter, "Christmas Day 1954", etc...)
03:45kryfttomoj: Are you a grad student yourself?
03:45tomojread a paper recently about how to build tiny low-power one-pixel cameras which do collective image classification
03:45tomojscary!
03:46tomojnope, industry
03:46slyrus_tomoj: I think I saw something like that a while back. neat idea!
03:46kryfttomoj: Are you playing around with random indexing for work or just for fun?
03:47tomojI use it at work, and thinking about it also for non-work things
03:47tomojI wonder how neural networks implemented using aleph channels would perform
03:47kryfttomoj: Where do you work (doing what)?
03:47tomojseems like it would be simple to do, but... slow?
03:48_rata__a lot of scientists here... I'm impressed
03:48tomojstartup, web stuff. just content mining really
03:48kryfttomoj: Is it your startup or are you just employed there?
03:49tomojjust employed, but got in early, so not quite "just" employed
03:49kryft_rata__: I'm not surprised that there are a lot of scientists here. :)
03:50kryfttomoj: Anyway, sounds like a dream job. :) You get a proper salary, but you still get to play with interesting stuff. ;)
03:50kryfttomoj: As a grad student you only get the latter. ;)
03:50tomojhehe
03:50_rata__you're right, it's not surprising, just nice
03:51tomojyou don't have those pesky customers bothering you though
03:52sandGorgontomoj, i wanted to do a side project on mining food/restaurant data. Wanted to work with clojure on that - is that something that you could share your thoughts about. I mean, should I use a crawler like nutch or do the mining using something in clojure ?
03:52tomojgood question
03:52tomojwe haven't used nutch yet but definitely plan to
03:53tomojI think it would be silly to rewrite all the stuff in there
03:53kryftBy the way, how is clojure as a replacement for python for scripting?
03:53_rata__slyrus_, what do you do at work? do you code?
03:53tomojmy problem is figuring out which version of nutch to use
03:53raeksandGorgon: for the html scraping part, check out Envlive
03:53sandGorgonraek, thanks for that
03:53tomojyou can use nutch and plug in your own clojure components
03:53slyrus__rata__: no, I just code at home :) well..., that's not entirely true, but coding isn't really part of my job description
03:53tomoj(though I haven't figured out how to do this yet.. in the worst case you've got gen-class)
03:54_rata__slyrus_, what do you do then?
03:55sandGorgontomoj, sounds like integrating nutch is more complicated than easy in clojure. Assuming I want to use clojure, how does one mine data (could be web, twitter, etc.)
03:55tomojmaybe it's complicated
03:55tomojbut I think it's worth it
03:56tomojif you want to do it from scratch there are several http clients available
03:56tomojbut then you have to re-solve a bunch of problems that nutch already solves
03:56tomojaleph has examples of streaming from twitter
03:56sandGorgontomoj, ah.. ok. I just wanted to throw something together in a week - with maybe a compojure front end
03:57tomojand it comes with asynch http stuff
03:57sandGorgondidnt know about aleph and twitter - thanks!
03:58slyrus__rata__: I try to make sure our scientists are doing useful things and that they have the resources they need
03:59_rata__slyrus_, ah ok
04:00slyrus_anyway, good to see comp bio/bioinfo/machine learning-types hanging around here. i look forward to further discussions on the above topics, but now it's time for bed.
04:00_rata__:)
04:00_rata__yeah, right... here's 4 am
04:01_rata__good night slyrus_
04:15LauJensenwherever you are
04:31lenwHi all
04:31lenwhow do i get a map that i saved using (spit map file) back into a map ?
04:31LauJensenHi
04:32LauJensen(-> (slurp file) read-string) ?
04:32lenwthanks LauJensen
04:32lenwi knew it was something simple
04:32bytecolorspit, slurp? those are actual core functions?
04:33LauJensenbytecolor: yup
04:33tomojhey, it's a lisp-1
04:33lenwbytecolor: yes
04:33LauJensen,(doc spit)
04:33tomojnames are scarce
04:33bytecolorahaha, ok
04:33LauJensen-> (doc slurp)
04:33sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/slurp)
04:33LauJenseneh?
04:33LauJensen$mail raynes -> (doc slurp) ?
04:33sexpbotMessage saved.
04:33LauJensen$mail hiredman where's clojurebot ?
04:33sexpbotMessage saved.
04:34bytecolorso how is clojure for accessing an OpenGL context portably?
04:35LauJensenbytecolor: portably?
04:35tomoj,(slurp nil)
04:35tomojerr
04:35tomoj-> (slurp nil)
04:35sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/slurp)
04:35tomojtough censor
04:35LauJensentomoj: keep up man, I just did the same sequence 2 minutes ago :)
04:36tomojwell
04:36LauJensenoh wait, I should keep up, I thought you were running doc as well, sorry :)
04:36tomojI was testing whether it was something weird about the way doc works that caused the security violation
04:36LauJensenYea dont mind me, keep going
04:36tomojI remember that sandbox tries hard not to let you get ahold of vars that point to bad functions
04:37tomojI broke it twice, both times by finding ways to weasel my way through to a var
04:37tomoj*read-eval*, naturally
04:37tomojI wonder if it will ever be secure
04:37LauJensenhehe
04:37LauJensentomoj: Are there still holes?
04:38tomojdunno, that's the question
04:38tomojthe holes I found have been filled
04:38bytecolorfor simplicity, say I'd like to render a spinning cube using OpenGL, but I'd like it to run on a mac, linux, and window.
04:38tomojso now it's a game of wasting time
04:38tomojmaybe there really are no more holes, and any work trying to find one would be wasted
04:38LauJensenbytecolor: Well, OpenGL does need native dependencies, but Penumbra gets you almost all the way
04:38tomojor maybe there are, and you'd have to work a long time to find one
04:39defnIf you know how to do cat /dev/urandom > /dev/audio on OSX I'd be interested.
04:39tomojpenumbra, hmm
04:39LauJensentomoj: But few Clojurians use their powers for evil and the PHP crowd is no threat. I think the bot is safe
04:39tomojright
04:39tomojbut for the sandbox
04:39LauJensendefn: why ?
04:39defnLauJensen: curiosity.
04:39tomojit would be best for those using the sandbox if it were abused
04:40tomojI mean, if people tried to abuse it to test how easily it can be abused
04:40tomojthough..
04:40tomojhmm
04:41bytecolorfrom what I know of clojure, it's heading in the "right" direction; it runs on most anything and its philosophy is drawn from Lisp. That to me is the holy grail of programming.
04:41tomojI was thinking like maybe you do automatic judging of problems with clojure solutions
04:41hoecktomoj: does the sandbox handle (loop) ?
04:41tomojyou need to know those solutions won't be evil
04:41defnlots of ifs
04:41tomojhmm?
04:41defnjust the way you described that is utopian
04:41defnit wont be that easy
04:41tomoj-> (loop [a 10] (if (pos? a) (recur (dec a)) a))
04:41sexpbot⟹ 0
04:42esjMorning alls
04:42LauJensenbytecolor: http://ideolalia.com/16342460 - consume this blog, in its entirety
04:42LauJensentomoj: If you invented a system which read code and determined if it was malicious or not, you'd make billions
04:42bytecoloraye, thanks LauJensen
04:42LauJensenYou still wouldnt make as much as facebook, but you'd have money
04:43tomojwell..
04:43tomojyou just need a good jail, right?
04:43LauJensentomoj: No, Im talking about understanding, not containing
04:43defntomoj: Licenser's sandbox is pretty well done AFAIK.
04:43tomojyeah
04:43tomojit works by just crippling your access to clojure
04:43defnI know there are several out there. His is the only one I've tried
04:43hiredmanLauJensen: thats called a "interpreter"
04:43defntomoj: well..if it works..
04:43tomojyeah
04:44LauJensenhiredman: But it needs some kind of heuristics awareness of what the code is doing
04:44tomojcan you set up a jvm so that it can only read from stdin, not from any file?
04:45bytecolorcaveat: as long as I dont have to write code in Java, IMO that is the most horrible undertaking any programmer could be subjected to.
04:45hiredmanhttp://github.com/hiredman/Arkham
04:45defnit needs to intuit /goals/
04:45tomojI suppose you could run it as nobody?
04:45hiredman~sandbox
04:45clojurebotsandbox is http://calumleslie.blogspot.com/2008/06/simple-jvm-sandboxing.html
04:47tomojhiredman: sounds interesting
04:47tomojeval->evil is cute
04:48defngeorge jahad has the root of the elegant solution
04:48defntest chunks as you go inside the same stack frame
04:48hiredmanalso "Arkham" as the name of a sandbox, how cute is that?
04:48defnbe able to step around
04:50hiredmana sandbox like arkham can be used for other things too, like http://gist.github.com/550864
04:50defnhiredman: interesting
04:51LauJensennice
04:51tomojreminds me of http://www.youtube.com/watch?v=Du_RTMmofWM
04:51defntomoj: You are awesome for posting that.
04:52tomojthose were the days
04:52tomojit was so goddamn easy back then to make a fucking blog
04:52defnIt's still cool, man.
04:52defnWe're evolving.
04:52defnThings are happening.
04:52tomojnow it's "look at all this shit I have to do, man I need to write some macros"
04:52tomojwell.. yeah
04:53tomojaleph is lookin pretty sweet
04:53defnheh -- yeah it only gets harder, but then it gets easier
04:53defnsawtooth
04:53defntools catch up, i think.
04:53hiredmanpffft, macros, you want a blog post write some monads or arrows
04:53defnepic troll
04:53tomojhmm
04:53tomojI meant a blog engine
04:54defni dont see how it was easy to make a blog engine
04:54defnthe metaprogramming that went into rails was pretty novel and cool
04:54kryfttomoj: Heh, I've never seen that and I don't really know Ruby, but it's still funny.
04:54hiredmanwell you'll obviously need a monad to thread the nosql connection through your function calls
04:54tomojas in "look at all the things I'm not doing"
04:55hiredmanfor your blog engine
04:55tomojdefn: huh?
04:55defnhiredman -- it just sounds really buzzy
04:55hiredmanif you use a dynamo inspired store you'll need to keep track of all those vclocks
04:55tomojdefn: you didn't see the "make a blog engine in XX minutes" stuff?
04:56hiredmanthat's a monad
04:56tomojhuh, the client's responsible?
04:56defn"monad to a thread" "nosql connection" "blog engine"
04:56tomojI have been teetering over hbase vs cassandra
04:56defnit just sounds like a parody of web 2.0
04:56defner 2.5 i guess
04:56hiredmantomoj: for anything really based on the dynamo paper they are
04:56AWizzArdhiredman: the chinese scientist Li improved monads, and will soon publish his lib "Limonade".
04:57tomojI wonder if the GORA for cassandra (if it exists?) for nutch works well
04:57tomojthen we need thrift bindings
04:57tomojjava ones OK or do we have to write a thrift-clj?
04:57tomojanyone used the java generated bindings from clojure before?
04:58hiredmanyou have to have vclocks to establish causal relationships in a coordinated distributed system like that
04:58tomojright
04:58tomojriak too eh
04:58tomojso like, the ruby cassandra library has to deal with vclocks
04:58hiredmanmm
04:58hiredmanis cassandra dynamo based?
04:58tomojyeah
04:59hiredmanhuh
05:00tomoj"this ticket is a dead end for counting, and the primary use case for classic vector clocks of merging non-conflicting updates to different fields w/in a value is already handled by cassandra breaking a row into columns."
05:00tomojhmm
05:00hiredmanright
05:01hiredmanCassandra departs from the Dynamo paper by omitting vector clocks and moving from partition-based consistent hashing to key ranges, while adding functionality like order-preserving partitioners and range queries.
05:01hiredmanhttps://wiki.basho.com/display/RIAK/Riak+Compared+to+Cassandra
05:01tomojhttps://issues.apache.org/jira/browse/CASSANDRA-1501
05:01tomojI see
05:01tomojso perhaps "dynamo-inspired"
05:01bytecolorare :keywords global in clojure? :foo evaluates to :foo no matter where it's used? This to me is a vast improvement over C/C++'s #define or enum
05:02tomojweak refs are involved, I think, but I don't know what those are :(
05:03ChousukeThey are global.
05:05kryftChousuke: Hehe, I was just wondering whether there are any go players here.
05:06ChousukeI haven't played in a long time though :/
05:06defnim going to start working on a ML project involving Go pretty soon
05:07kryftdefn: Cool. A guy in our lab has been working on Go (he plays it as well). Do you play go?
05:07defnkryft: im afraid the answer there is /i am terrible./
05:07defnhence the ML project!
05:08defnIf I'm bad at it -- I'll build a bot.
05:08kryftdefn: I'm terrible too; that's the fate of amateurs!
05:08defnkryft: yeah I've had the experience a lot in life where I had "beginner's luck"
05:08defnbut with Go, forgetaboutit
05:08kryftdefn: (Well, unless maybe you become a really strong amateur. My teacher seems to be rapidly approaching professional strength.)
05:09defnI wonder how much time Go players spend in comparison to WoW players.
05:09defnI have a poor, poor friend of mine who plays WoW.
05:09Chousuke:P
05:09kryftdefn: Is that project just for fun, or are you doing actual research? (Not that you couldn't do that for fun, but well, you know what I mean.)
05:10defnfor fun -- im messing around with AI4R in Ruby with a friend -- there was talk about rewriting it and building a website to sort of bring back the spirit of AI
05:10ChousukeThere are a handful of pretty strong players where I live. But not quite pro level
05:10defnmake it accessible to more people
05:10kryftdefn: Heh, I would say most of them spend far less time. :) Go requires much more effort.
05:11kryftChousuke: I was referring to Antti Törmänen.
05:11defnthere's so much cool stuff to do with ML
05:11defnbut it's not accessible
05:11defnand it's not genius-level stuff
05:11defnif people build friendly libraries this stuff is awesome for amateurs to jump into
05:12Chousukekryft: I suppose he's the strongest in Finland atm :P
05:12defnlittle building blocks that add a bit of brain to your application -- what's not to like?
05:13kryftChousuke: Yes, and he has beaten a professional in an even game at least once. :) Of course he's not professional-level yet, but he intends to get there, and something about him tells me that he's going to succeed.
05:15kryftdefn: I wonder how much better computer game AI could be if programmers applied state-of-the-art research and actually devoted a couple of cores to AI.
05:15kryftdefn: With multi-core CPUs being the norm, especially in high-powered gaming rigs, that shouldn't be a problem.
05:16ChousukeHmh
05:18kryftdefn: I know very little about computer game AI and state-of-the-art AI research, but something tells me the two rarely meet. :)
05:20LauJensenkryft: hopefully, since state of the art AI research has produced nothing more than whats commonly referred to as the AI winter and a very formidable Chess opponent
05:20kryftLauJensen: Ok. :)
05:24kryftLauJensen: Would you say that computer game AI wouldn't be easy to improve by making it a priority?
05:25LauJensenI have no idea, but if somebody would pay me I'd gladly find out :)
05:25kryftLauJensen: :D I'll keep that in mind if I ever find myself with a lot of extra money. ;)
05:26LauJensensounds good :)
05:27bytecolorso how do I make clojure a first-class citizen of my OS? I've compiled clojure with Ant, and I can execute a repl.
05:27notsonerdysunnyhow can i set clojure.core/*assert* to false?
05:29notsonerdysunnybytecolor: what do you mean by "first-class citizen " .. if you are meaning it in the sbcl/slime way .. use lein and slime to set it up.. there are enough tutorials on the web to help you make that happen
05:29LauJensennotsonerdysunny: (set! clojure.core/*assert* false)
05:32notsonerdysunnyLauJensen: Thanks ... I set it .. But I had read that :pre and :post specified in a function definition are only run if the *assert* is true .. but it does not seem to be the case ... am I missing something
05:32LauJensenDid you recompile the functions after setting it to false?
05:32bytecolornotsonerdysunny: well, ultimately, like to be able to experiment in another dir. I should probably learn more Java, but to me Java is nothing more than a vehicle, a stepping stone.
05:32notsonerdysunnyno .. oh .. I need to recompile .. I didn't know that
05:33notsonerdysunnybytecolor: just google for leiningen and slime it will walk you through .. you don't need java
05:33bytecolorcool, slime + clojure sounds good ;)
06:12esjkryft: LauJensen: the state of AI, as far as I understand, is that its been renamed ML (machine learning, much sexier) and is very much focussed on batch problems rather than online (live) problems. This is sort of thing you saw for the Netflix prize. There have been great advances in statistics (ML with a proper mathematical basis) especially numerical stats, even online problems. However they are massively computationally
06:12esjdemanding and beyond what a game could support yet. The other issues is that stats doesn't sound sexy. Of course, I may be biased :)
06:13LauJensenSo they gave up on AI and picked up statistics instead... :)
06:13esjno, the got into ML and stalled a bit
06:14esjand the stats guys caught up
06:30opqdonutok, I'm going crazy with defprotocol
06:30notsonerdysunnyis there a way to programatically check if a given symbol represents a macro?
06:30opqdonutin namespace a I have (defprotocol W ..) (defn ^a.W make-W [args] (reify ...)
06:31opqdonutand I get a ClassNotFoundException
06:31notsonerdysunnysomething like (is-macro? for)
06:31opqdonutif I hint make-W with just ^W, using make-W in another namespace fails with 'Exception in thread "main" java.lang.IllegalArgumentException: Unable to resolve classname: {:on-interface a.W ...}"
06:32opqdonutoh, and, (:import a.W) is not working
06:32carkh i thought you could only type hint the return value of a function on static functions ?
06:32carkhfor the import i do it this way : (:import [a W])
06:33opqdonutthat should be the same thing
06:33carkhbut you need to require the a namespace first too
06:33carkhunless it's already loaded of course
06:33opqdonutyes, I'm doing that anyway
06:34opqdonutI'm actually useing it
06:34carkhah well i had some problems in 1.2 with that
06:34opqdonutyeah, same thing with the [a W] import, java.lang.ClassNotFoundException
06:34opqdonutso I should try require?
06:34kryftesj: I'm a machine learning researcher; that's why I've been wondering about the state of computer game AI. :)
06:34carkhif you use it, W is a var
06:35carkhand importing you get W the interface
06:35carkhand it seems like W the var takes precedence
06:35carkhi really don't like this, but that's the way it is
06:35esjkryft: I'm a recently ex-MCMC researcher :) hehehe.
06:35opqdonutcarkh: oh, that's awful...
06:36carkhwell, that's how i understodd it, i might be wrong
06:36carkhthat's only from experimentation
06:36esjkryft: but we can still be friends :P
06:36carkhand for 1.2
06:37carkhif you want to test it all, you might want to restart the jvm, so thazt you get clean state for your namespaces
06:38kryftesj: I'm sorry to hear you broke up. ;)
06:38kryftesj: Did you graduate or something?
06:39esjkryft: yeah, I eventually had to pay for all the fun I was having.
06:40opqdonutah
06:40opqdonutnow I get it
06:40carkhtell us =P
06:40opqdonutthe namespace had a hyphen. The interface that implements protocol name-space.W is name_space.W
06:40kryftesj: Oh, you were at Cambridge. :) I was at MLSS in 2009.
06:41esjkryft: don't give away my secrets!
06:41kryftesj: I'm in Finland myself, but I'm collaborating with John Shawe-Taylor's at UCL, so I spend quite a bit of time there.
06:41kryftJST's group, even
06:42esjhe's good.
06:43kryftesj: Yeah, I'm happy to have the opportunity. :)
06:44kryftesj: I'd like to do slightly more theoretical and mathematical machine learning, so I think working with him might help.
06:44kryftI just started my PhD in January.
06:44esjkryft: you're really lucky for the chance - enjoy !
06:48notsonerdysunnyhow does one run some thing in the repl with it trying to print out the value?
06:50esjnotsonerdysunny: without it printing the value ?
06:51notsonerdysunnyyes
06:52notsonerdysunnyesj .. I guess I badly messed up my previous sentence ..
06:52esjare you trying to avoid forcing the execution of something lazy ?
06:52notsonerdysunnyesj yes
06:53carkh(let [_ (my-form-returning-lazy-stuff)] nil)
06:55notsonerdysunnycarkh: but I have no access to the return value now..
06:55carkhwhat do you want to do with it ?
06:56carkhthe repl prints it, if you want to get tjhat value and do stuff to it, then include the stuff you want to do in your form
06:57carkhyou could (do (def a (filter odd? (range 100))) nil)
06:57carkhthen work with a
06:57notsonerdysunnycarkh: that does the trick
06:57notsonerdysunnythanks
06:58kryftesj: By the way, did you use clojure for MCMC etc? If so, what was your experience?
06:58esjcarkh: i think you just invented imperative functional programming. yikes :)
06:58carkhhaha don't forget to attribute it to me !
06:59esjkryft: actually, I've done some clojure MCMC and the experience was great.
07:01esjkryft: you should check out this blog: http://aria42.com/blog/ He's doing MCMC in clojure.
07:02esjkryft: this particular post: http://aria42.com/blog/?p=48 rightly caused quite a splash :)
07:03kryftesj: Cool, thanks. :)
07:03kryftesj: What kind of performance did you get?
07:08esjkryft: excellent. It's a huge step up from Matlab / R
07:09kryftesj: Great. I got the impression that it should be possible to get performance close to java (and hence close to C) using clojure; did you manage that?
07:10esjhard to say, I've never tried it in java/C so have no benchmark. To be honest, I didn't really try that hard.
07:11kryftesj: Still, it says something that you didn't have to try that hard or compare with java/C. :)
07:11kryftesj: If it's good enough for MCMC, it should be good for anything I do
07:12esji would agree with that.
07:16kryftesj: Where/why did that particular post cause a splash?
07:19esjNot sure. I think because he tackled a problem that can be understood outside the specialist field. Its a dramatic display.
07:20kryftAh, right. And apparently quite elegantly, if it's only 300 lines of code. (Of course I'm sure you can simulate the universe in 300 lines of clojure.)
07:21tobiasraederhi :)
07:22esjhowdy tobiasraeder
07:23kryftGreetings.
07:23raektobiasraeder: how did things with the interop thingy go, btw?
07:24kryftraek: Apparently not too well!
10:37chousernotsonerdysunny: did you figure out 'is-macro?'?
10:53BahmanHi all!
10:53ohpauleezHi
11:02shanmuhahi, I am trying to get tomorrow's date as a string in clojure
11:04esjshanmuha: maybe not the simplest solution but i'd use clj-time
11:05chouser,(let [d (java.util.Date.)] (.setDate d (inc (.getDate d))) (str d))
11:05clojurebot"Fri Oct 08 08:07:25 PDT 2010"
11:05chouserbut beware, java.util.Date is a bit nasty
11:05shanmuhaI tried (. sdf format (doto (java.util.Calendar/getInstance) (.setTime (new java.util.Date)) (.add java.util.Calendar/DAY_OF_YEAR 1) (. getTime))) which gives a nasty exception
11:06shanmuha(def sdf (new java.text.SimpleDateFormat "yyyy-MM-dd HH:mm:ss"))
11:07chousershanmuha: you were close
11:07chouser(.format sdf (.getTime (doto (java.util.Calendar/getInstance) (.setTime (new java.util.Date)) (.add java.util.Calendar/DAY_OF_YEAR 1))))
11:08shanmuhachouser: thanks! trying it out
11:08chouserdoto returns the object you give it first, so was still returning a Calendar even though you had .getTime at the end of the doto
11:09shanmuhachouser: ah! got it! many thanks!!!
11:09chouserBut I don't know that Calandar is any more reliable than the pure Date solution I gave first
11:09chouserI hear good things about jodaTime
11:09Dawgmatixwhats the state of the art of using clojure from emacs - swank-clojure?
11:09shanmuhachouser: should not be a problem... its not a missile guidance system (yet) ;)
11:09chouser:-)
11:10Dawgmatixalso does swank clojure work with the clojure debugging tools shown recently or was that using some other repl ?
11:12shanmuhachouser: thanks for suggesting joda-time..seems to be an excellent replacement
11:16esjshanmuha: clj-time is a clojure wrapper for joda-time
11:18shanmuhaesj: thanks!
11:19shanmuhawhen I was trying to write my get tomorrow function, got confused between doto and ->
11:19shanmuhadon't they do the same things?
11:20shanmuhawhen applying methods on a java object?
11:20chousernot at all
11:20chouser-> takes each expression and threads it into the next
11:20sexpbotjava.lang.Exception: Unable to resolve symbol: takes in this context
11:21chouserdoto takes the result of the first expression and puts it into all the others, and finally returns it
11:21chouser,(-> 5 (+ 3) (/ 2))
11:21clojurebot4
11:21chouser,(doto 5 (+ 3) (/ 2))
11:21clojurebot5
11:22chouserdoto is only useful if the first arg is something mutable or the expressions to apply to it have side-effects
11:24shanmuhachouser: thanks for the illustration..I think I understand now... but when invoking methods on a java object, would threading mean that you invoke each method successively on the first arg?
11:25kumarshantanushanmuha: chouser is a fan of thrush ;-)
11:26chouserno, -> still means the return value of each method call would become the target of the next
11:26gravityshanmuha: I think you have it backwards. doto invokes each successive form on the original arg, which is why it's useful for mutable objects.
11:26chouser-> is not thrush
11:26sexpbotjava.lang.Exception: Unable to resolve symbol: is in this context
11:26gravityAs chouser says
11:31abrenkDawgmatix: I've using CDT together with a swank server started using the clojure-maven-plugin - works as expected.
11:32shanmuhachouser: your last statement made me understand!! thanks!!
11:32chouserkumarshantanu: yes, many people have stated it. A widely-held misconception. :-)
11:32Dawgmatixthanks abrenk!
11:32chouserkumarshantanu: allow me to direct you to my co-author: http://blog.fogus.me/2010/09/28/thrush-in-clojure-redux/
11:33shanmuha-> operates on the result of prior operation where as doto is always on the first.
11:33sexpbotjava.lang.Exception: Unable to resolve symbol: operates in this context
11:34kumarshantanuchouser: something to note -- the link you mention on your post http://debasishg.blogspot.com/2010/04/thrush-in-clojure.html (seems to call -> one of the thrush operators)
11:35kumarshantanuchouser: toward the end of his post (just FYI)
11:36kumarshantanuchouser: maybe you can attach a sidenote somewhere "the linked post is calling -> a thrush, I am not responsible for it" ;-)
11:36chouserheh, I'll check.
11:36shanmuhathanks a lot people!, you were really helpful..
12:08astoddardI have a best practice question. I am writing an analysis program and have some initial state (data tables as maps) that can be instantiated from different files on disk. And I am wondering about the best representation.
12:09astoddardMy first thought was to declare some vars and set them in an init function but that isn't allowed at the root level.
12:09carkh(def my-table (atom nil))
12:10chouserfor initial state it's probably ok to re-def the vars
12:10carkhthen (reset! my-table (load-table "mytable.data"))
12:10chouseror that
12:12carkhor make it a ref so you can make concurrent updates in a safe fashion later when you'll want to multithread
12:14carkhcrazy how the scope of a program can change with little things ... I made this callshop program around 10 years ago, there used to be only a couple hundreds telephone rpefixes to manage
12:14carkhnow a price list has 100 thousand prefixes
12:14carkhthat's suddenly a whole different problem
12:15carkhactually more 13k prefixes, but still =/
12:15chouseryep
12:17astoddardThanks for the suggestions. As this is initial data that is fixed for a given analysis I would probably rebind it if splitting multiple analyses onto multiple threads.
12:17carkhso why am i saying this : you want to think a little bit at how your program might evolve (while not overdoing it)
12:18carkhwhat if a single analysis is sunddenly so big (10 years in the future) that paralelise your single analysis on those 128 processor you'll have then ?
12:19carkhthat you want to ***
12:22carkhthis program i was talking about is bit rotting hard these days, it was done in delphi for windows 95 ... maintenance is getting a nightmare, and i'm trying to avoid that for the future. I guess the jvm is here to stay, but will clojure survive and still be maintained 10 years from now
12:22astoddardSure. But none of those 128 threads should be _changing_ the initial data given to this analysis, even if the computation is parallelized. Must understanding of refs is they coordinate state change.
12:22carkhastoddard: yes i think you're safe then
12:50dnolenso with-private-fns never made it into clojure.test ?
12:51AWizzArddnolen: what does this macro (?) do? Aren't closures private fns?
12:52dnolenAWizzard: a ns may have private fns that you also want to include in your tests
12:54AWizzArddnolen: ah, *those* private fns you mean, I understand now. Yes, sounds useful.
12:55AWizzArdBut one could write such a macro within 10-50 minutes. The nice thing about Lisp: nearly every update that you want to see you can implement yourself, without the need to wait for the benovolent dictator to include it :)
12:56ohpauleezdo namespaces have the same rules as packages in Java? ie: Can you abuse them to get access to private functions?
12:57ohpauleezif so, you could just do some ns bashing and pull them out.
12:57ohpauleezdnolen: Also, take a look at lazytest, you may find what you're looking for there
12:58RaynesYou can access private functions if you know their name: #'some.namespace/private-fn
12:58dnolenohpauleez: it possible to get them out, testing private fns seems like a common enough scenario to want that macro to be in clojure.test
13:19bhenryis there something like a map-if? (map-if pred func seq)
13:26alpheusThat's filter, isn't it?
13:31AWizzArdwell, nearly
13:32AWizzArdmap applies func
13:32AWizzArdfilter only pred
13:32AWizzArdbut reduce is it, bhenry
13:32AWizzArdmap and filter are special cases of reduce
13:33bhenryi'm not sure how to use reduce to get that
13:33bhenryreduce won't give me back a list
13:33ohpauleezyeah, i would just apply map to a filter
13:33bhenryi want back a list of the same length, but only apply f when pred is true
13:34ohpauleez(map #(...) (filter #(....) [coll]))
13:34bhenryright now i'm using (map #(if some-test (do-this %) %) sequence)
13:34Chousukethat works.
13:34technomancybhenry: there's also for with a :when clause
13:34AWizzArdbhenry: (reduce (fn [result element] (if (pred element) (conj result element) result)) [] input)
13:35carkh(map #(if (pred %) (f %) %) the-list)
13:35technomancyfor is a lot nicer than map+filter, especially if you have to construct custom fns for both
13:35Chousukeusing reduce is overkll :P
13:35AWizzArd,(reduce (fn [result element] (if (< element 10) (conj result element) result)) [] (range 20))
13:35clojurebot[0 1 2 3 4 5 6 7 8 9]
13:35AWizzArd,(reduce (fn [result element] (if (< element 10) (conj result (* 3 element)) result)) [] (range 20))
13:35clojurebot[0 3 6 9 12 15 18 21 24 27]
13:35Chousuke(not to mention inefficient)
13:35AWizzArdThis is filter + reduce
13:35AWizzArduhm, filter + map
13:35AWizzArdand more efficient than both
13:36bhenryAWizzard, that doesn't leave me a list of the same length
13:36AWizzArdChousuke: reduce is more efficient, it traverses the input only once
13:36ohpauleezI'm going to go with technomancy on this, I would use for and :while
13:36AWizzArdbhenry: no
13:36ohpauleezI retract my map filter :)
13:36ChousukeAWizzArd: so do map and filter. you forget they're lazy.
13:36AWizzArdas you see, it returns result without modification if pred is not met
13:36carkhmine is easier and shorter
13:37AWizzArdChousuke: they both are doing only what reduce is doing, it is just a special case
13:37ohpauleezthis is a great game of golf
13:37ohpauleez:)
13:37ChousukeAWizzArd: but they're lazy, which is a perfomance advantage :P
13:37Chousuke(not always, though. it depends.)
13:37AWizzArdChousuke: and what would happen if one would use lazy-cat inside the reduce?
13:37somniumunless you're eager for performance
13:38ChousukeAWizzArd: it would still be strict.
13:38ChousukeAWizzArd: since it would actually realise the source seq
13:38carkhand it would blow the stack on big seqs
13:38Chousuketechnically map and filter are special cases of reduce
13:38AWizzArdcarkh: how?
13:38Chousukebut in practice there's a huge difference :P
13:38carkhthunk calling thunk calling thunk
13:39AWizzArdthe question is if bhenry needs it lazy
13:39carkhrealising the first element would blow the stack ...afterwards you'd be fine axcept the stack is already blown
13:39Chousukewell he probably doesn't
13:39AWizzArdif he wants all elements then lazy is just another performance hit, on top of eager map+filter
13:39Chousukebut lazy = better
13:40AWizzArdno, there is an infinite set of cases where lazy performs worse
13:40Chousukeyeah, and does that apply here?
13:40Chousukeno.
13:41ChousukeYour solution was technically fine, but it's overly complicated.
13:41carkhlet's all agree that lazy is better except when it's worse !
13:41somniumhere here!
13:43ChousukeAlso it forces the entire seq to exist in memory all at once, which is probably unnecessary.
13:44AWizzArdChousuke: I agree on map and filter both having their advantages. Though this is part due to clojures implementation of reduce. Compare with Haskells folding.
13:45Chousukereduce is foldl', right?
13:45ohpauleezI think Clojure is rolling in folding, but don't quote me on that
13:45ohpauleezpopped up in here and in the mailing list not too long ago
13:46AWizzArdChousuke: yes
13:46AWizzArdoh btw, did someone suggest 'for'?
13:46ChousukeIIRC foldl (lazy reduce) has some issues with unexpected memory use.
13:46AWizzArdpotentially
13:47ohpauleezAWizzArd: yeah, technomancy did, I support for
13:47AWizzArdlazy is not always "better"
13:47AWizzArdohpauleez: in the past few minutes?
13:47ChousukeClojure has only lazy sequences though.
13:47ChousukeAnd delays
13:47AWizzArdI meant as a reply to bhenrys request
13:47dnolenAWizzard: I think the issues with foldl in Haskell are common enough that books like Real World Haskell suggest using only foldl'
13:47ohpauleezyeah, at the beginning of all of this conversation
13:47ChousukeHaskell has lazy everything
13:48Chousuke(unless explicitly strict)
13:48ohpauleezAWizzArd: ^
13:48carkh,(let [apply-if (fn [pred func] (fn [val] (if (pred val) (func val) val)))] (map (apply-if odd? inc) (range 10)))
13:48clojurebot(0 2 2 4 4 6 6 8 8 10)
13:49AWizzArdohpauleez: good, I missed that. for is of course very nice for this, I agree.
13:49ohpauleeztotally
13:50somniumits cases like that where it would be so nice to have currying
13:50AWizzArdsomnium: what case?
13:51somniumcarkh's example
13:51carkh(let [a (partial + 2)] (a 2))
13:51carkh,(let [a (partial + 2)] (a 2))
13:51clojurebot4
13:52carkhhow would you rewrite that apply-if using currying ?
13:52somniumcarkh: you would write (defn foo [p f x] (if (p x) (f x) x))
13:52somniumcarkh: and then (foo somep somef)
13:54carkhnice
13:54stuartsierra~seen rhickey
13:54clojurebotrhickey was last seen quiting IRC, 9545 minutes ago
13:54carkh,(let [apply-if (fn [pred func val] (if (pred val) (func val) val))] (map (partial apply-if odd? inc) (range 10)))
13:54clojurebot(0 2 2 4 4 6 6 8 8 10)
13:54carkhvery nice indeed
13:55AWizzArdhmm, maybe I am just blind right now, but I don't see where currying would be applied here
13:56carkhlook my last example
13:56carkhit's way more general than the first
13:56carkhapply-if is going into my personal standard library =P
14:01AWizzArdcarkh: with currying support your map would be (map (apply-if odd? inc) (range 10))
14:01carkhwell partial is the only way i can do currying in clojure so i guess i'm stuck with it
14:02AWizzArdcarkh: yes, or use the reader macro #()
14:02AWizzArd,(let [apply-if #(if (%1 %3) (%2 %3) %3)] (map #(apply-if odd? inc %) (range 10)))
14:02clojurebot(0 2 2 4 4 6 6 8 8 10)
14:03carkhnot as easy to read but yes, true
14:03AWizzArdyes, the fn is really prefferable here, especially with the good names that you used
14:03carkhi often find myself trying to nest #() forms
14:04ossarehI far prefer the explicit syntax of (fn [x] (forms))
14:04AWizzArdcarkh: that would be possible if there were a currying reader macro $()
14:04ossareh#() looks so weird.
14:04AWizzArd,(map #(+ 4 %) (range 5)) ; here I prefer the #()
14:04clojurebot(4 5 6 7 8)
14:04carkhah a currying reader macro would be very usefull
14:04AWizzArdcarkh: not *sooo* useful. And Rich is against it. I discussed this with him in late 2008.
14:05carkhbut i don't see how clojure being all dynamic could do currying without some explicit request in the code
14:05AWizzArdIt would be very similar to #() but could not offer much more, and even miss some points.
14:05AWizzArdcarkh: the problem lies not so much in dynamism, but in the fact that Clojure offers fns that take any number of args.
14:05somniumI wrote a version of fn that creates curried versions, but it would need support from on high not to feel bolted on, (and get curried versions of map, reduce, etc)
14:05AWizzArdIn Haskell for example it is known at compile time how many args each fn must take.
14:06carkhright
14:06AWizzArdThe compiler can fill up the %1 %2 things automatically for us.
14:06AWizzArdBut you can't have "map"
14:06somniumor clojure fns take one arg and its always a list
14:07ChousukeI don't think you can implement currying efficiently in Clojure :/
14:07AWizzArdIn the end it is just syntactic sugar. The current #() is nearly as concise as currying. It can not be nested, but it can do things that currying can't.
14:08ossarehisn't currying achieved with partial?
14:08AWizzArdossareh: technically yes
14:08nickikits not the same
14:09AWizzArdbut currying is about not writing out "partial"
14:09AWizzArd(map (+ 5) (range 5))
14:09somniumyou can take (fn [x y z] ...) and create (fn [x] (fn ([y] (fn [z])) ([y z] ...)
14:10nickiki like to use partial often because it looks less wierd #(+ % 5) (partial + 5)
14:10nickikcould have been a shorter word ...
14:13AWizzArdnickik: (def § partial) ;)
14:14nickikim somethimes tempted to do something like that but I just think its wired for other people to read
14:14AWizzArdThis is especially nice since non-german keyboard layouts might not even support the § char :)
14:14somniumheh
14:15nickikyou do you make it?
14:15jarpiain_http://gist.github.com/615573 <-- a currying macro
14:16AWizzArdnickik: noo, I use #() or maybe in very few cases partial.
14:17AWizzArdGuys, in how many cases (20%, 40%, 60%, 80%) do the elements in your collections (vector, list, set) all have exclusively the same type and are not nil?
14:18chousersame (abstract) type but maybe nil -- 95%
14:19chousersame (abstract) type and never nil -- 80%
14:19AWizzArdI also would tend to say 80%
14:20bhenrycarkh: i really think map-if is a better name than apply-if since the regular apply works on the whole list and returns one thing, but map works on each part of the list. it makes sense that map-if would do the f to each item but only when pred is true
14:20abedra~seen stuarthalloway
14:20clojurebotstuarthalloway was last seen quiting IRC, 8707 minutes ago
14:21carkhapply-if really maps a single value, in haskell map-if would be a good name, not sure about clojure
14:32freakazoidReally, clojurebot, 8707 minutes?
14:39AWizzArdfreakazoid: yes
14:39freakazoidNot a very human-friendly number
14:40AWizzArd,(map #(/ % 60.0) [9560 8710])
14:40clojurebot(159.33333333333334 145.16666666666666)
14:40freakazoidWhat command do I use to replace the source code of that rendering function?
14:40freakazoidOr is clojurebot not programmable from IRC?
14:46chouser,((fn [i] (mapcat list (loop [o [] i i [f & fs] (reverse (reductions * [1 60 24 7]))] (if f (recur (conj o (int (/ i f))) (rem i f) fs) o)) [:weeks :days :hours :minutes])) 8707)
14:46clojurebot(0 :weeks 6 :days 1 :hours 7 :minutes)
14:46chouserhm. there's probably a better way
14:53freakazoidNice.
14:53freakazoidI think it's OK to round.
14:54freakazoidfor something that long you don't need minutes.
14:54freakazoidhaircut time.
15:09cburroughsDoes anyone know what is up with the latest version of the incanter autodocs: http://liebke.github.com/incanter/charts-api.html ?
15:11Dawgmatixis elpa the right place to install swank-clojure from?
15:14replaca_chouser: you are insane!
15:15replaca_:)
15:16replacacburroughs: I make the autodocs and incanter's not building for me :(
15:16replacacburroughs: I'm waiting for some info from liebke on what's up with that
15:17replacaI'll try to get it fixed up RSN...
15:19cburroughsThanks
15:24kanakHi, I'm trying to start a swank server using "lein swank" but i keep getting a "that's not a task" error. I'm using version 1.3.1. Am i doing anything wrong?
15:24mrBlisskanak: try lein deps
15:25mrBlisskanak: try lein deps
15:27kanakmrBliss: I cloned the incanter repo, and I'm did a lein deps inside it. It looks like it installed successfully ("Copying 37 files"...). Now when i do "lein swank" it still says "That's not a task. Use "lein help" instead."
15:27mrBlisskanak: is swank-clojure listed in the dev-dependencies in the project.cj file?
15:28kanakmrBliss: swank-clojure "1.3.0-SNAPSHOT" is listed in the vector corresponding to :dependencies
15:29mrBlisstry putting swank-clojure "1.2.1" under :dev-dependencies
15:31duncanmhmm, if i use a clojure lib, do i still need to :import again if i want to use a defrecord from that lib?
15:31mrBlissduncanm: I believe so
15:32duncanmah
15:35kanakmrBliss: That did the trick. Thank you so much :).
15:36mrBlisskanak: my pleasure
15:37duncanmmrBliss: defrecord doesn't generate a type predicate, does it?
15:38kanakmrBliss: What is the "workflow" when starting a new project (using emacs)? Can i create a new project and start a swank repl for it all within emacs?
15:38mrBlissduncanm: nope, but you can use instance?
15:38mrBlisskanak: http://github.com/mrBliss/dotfiles/blob/master/.emacs.d/clojure.el look at lines 79 and 131
15:42kanakmrBliss: thank you for sharing your dotfiles :). This looks really handy.
15:43mrBlisskanak: I'm currently composing a more modular and well-documented clojure.el that could be a starting point for newcomers
15:48klangmrBliss: some of what you have in your .emacs file is also maintained here, I think; http://github.com/vu3rdd/swank-clojure-extra
15:49mrBlissklang: thanks for the link!
15:51Dawgmatixslime is connecting for me with swank-clojure (i get the message may this repl serve you well) but i get no prompt
15:51Dawgmatixdo i have to do something special for that?
15:51klangmrBliss: swank-clojure-project is not maintained in connection with swank-clojure anymore, but in the above "break off
15:52klangmrBliss: another fun addition, if you do not want to scare people with parenthesis :-) http://gist.github.com/560327
15:53klangDawgmatix: have you tried running the labrepl?
15:53mrBlissklang: I have it already :-)
15:53Dawgmatixno i havent tried labrepl :)
15:53klangmrBliss: heh!
15:54klangDawgmatix: it will serve you well. It has a good simple (7 lines) description on how to get emacs up and running.
15:54ordnungswidrighi, I remember having read about cake in automatically running tests
15:55ordnungswidrigdoes anybody know if I'm right?
15:55mrBlissDawgmatix: have you got the latest version of slime and slime-repl from ELPA and are you using GNU Emacs?
15:55lancepantzordnungswidrig: cake autotest
15:55Dawgmatixi am using slime from cvs
15:55klangDawgmatix: I would suggest .. yes, ELPA ..
15:55Dawgmatixbecause slime from elpa just foobared when i tried to install it
15:55klangfor any specific reason?
15:55Dawgmatixlet me try it again
15:56Dawgmatixand get back to you with the error
15:56Dawgmatixi remember the time when you stuck 4 lines of slime in a .emacs and it just worked !
15:57klangYou don't need that much, if you use ELPA, I think ..
15:59Dawgmatix"lime-repl.el:122:39:Error: No setf-method known for slime-connection-output-buffer"
15:59klang..but then again, I have softlinked ~/.emacs.d/elpa/swank-clojure-1.1.0swank-clojure.el to swank-clojure-extra/swank-clojure-extra.el
15:59Dawgmatixthats the error elpa gives
16:00klangDawgmatix: how much of a clean slate are you using?
16:01Dawgmatixive installed lein. i can get that to create a swank server. now i am trying to get emacs going
16:01Dawgmatix(i normally use slime for sbcl, but ive commented those things out in my .emacs) so effectively i think i am on a clean slate
16:02Dawgmatixis there a repository for the clojure version of slime?
16:03klangTry moving your elpa directory a bit and reinstall everyghing ..
16:03ordnungswidriglancepantz: ah, thanks
16:03Dawgmatixive tried to nuke the elpa directory already and start afresh, same results
16:03moogatronicis the wiki up to date with the order to install emacs->slime / etc ?
16:03moogatronicI wish i had my computer with me at work here to try it. =)
16:05klang.. I'll try to make a clean install on another machine
16:05Dawgmatixthanks klang!
16:10Dawgmatixklang - the elpa slime works inspite of throwing an error during installation !
16:10klangDawgmatix: sudo apt-get install emacs23 git git-core sun-java6-jdk ant will take a few minutes .. (I did say new machine)
16:11Dawgmatixi guess the error is in some non essential part of slime
16:11klangDawgmatix: are you up an running?
16:11Dawgmatixyes
16:11Dawgmatixthank you for your help !
16:11klangNo problem
16:16oguzis there a model checking tool for clojure? does jpf work?
16:16ordnungswidrigwhat's wrong?
16:16ordnungswidrig,(letfn (d [x] (* 2 x)) (d 4))
16:16clojurebotjava.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol
16:17MayDanielletfn requires a vector for its bindings.
16:17ordnungswidrigMayDaniel: thanks
16:21ordnungswidriginstalling clojure-test-mode from elpa complains about clojure-mode-1.7.1/clojure-mode.el already to exist
16:24dnolenordnungswidri: the stock package.el is broken, technomancy has a patched copy
16:24ordnungswidriggithub?
16:24clojurebothttp://github.com/richhickey/clojure/tree/master
16:24dnolenordnungswidrig: yeah
16:24shoover__clojurebot: no, that's old!
16:24clojurebotHuh?
16:24dnolenordnungswidrig: http://github.com/technomancy/package.el
16:25nickikwhats the idiomatic way to update a value in a vector and return the hole vector.
16:26seancorfieldhow exactly do you use / install technomancy's package.el
16:27tomojone option is to install the regular one, then replace it in ~/.emacs.d/elpa/package.el with technomancy's
16:27seancorfieldah, i looked all over for the installed package.el but i don't think i checked in there
16:28seancorfieldwhat about package-maint.el ?
16:29jolynickik: ,(assoc [0 1 2 3 4] 2 'a)
16:29AWizzArdHallo Ord
16:29tomojseancorfield: dunno what that is
16:29freakazoidit says it's for maintaining repositories.
16:29kryftHalloed be your names.
16:29tomojwhere's it come from?
16:30freakazoidit's in the distro I believe
16:30freakazoidsame repo
16:32ordnungswidrigdnolen: no better:Bad url: :clojure-test-mode-1.4.el
16:34seancorfieldcool, well, that got me further with emacs... i still don't think i'll give up eclipse tho'... :)
16:34nickik@joly thx only used assoc with maps. is there a simular thing where i can provide a function instead of a value? Like update in for maps
16:34lpetit:)
16:35dnolenordnungswidrig: will have to defer to technomancy
16:35nickikon my laptop eclipse was just to slow
16:36nickikis ccs written in clojure=
16:36mrBlissordnungswidrig: try using clojure-mode from the github repo. clojure-test-mode is integrated in that version clojure-mode
16:36nickik*ccw
16:36nickik@mrBlisss what does clojure-test-mode do? i alwas use (run-tests)
16:37mrBlissadds C-c C-, binding to run the tests, highlights the failed tests,
16:37jolynickik: not sure about providing a function to apply to the entry
16:38mrBlissjump between test and implementation with C-c t
16:38ordnungswidrigmrBliss: ok
16:38ordnungswidrigmrBliss: which is the best version? jochu or techno?
16:38mrBlissordnungswidrig: technomancy's
16:39nickik@mrBliss ah nice a have to test that. It comes with clojure-mode?
16:39mrBlisshttp://github.com/technomancy/clojure-mode I was wrong, use both files (not test.clj)
16:40lpetitnickik: more and more, yes
16:41ordnungswidrig"vi .emacs" I just can drop this habit
16:41lpetitnickik: for example, all paredit.clj stuff, all actions, ClojoureProjectNature.clj ...
16:43chouserlpetit: I installed eclipse yesterday, and ccw.
16:43lpetitchouser: are you sick ? ;-)
16:43chouseryes, but I don't think it's related.
16:43chouser:-)
16:44nickikhehehe
16:44chouserso I was enjoying hopping about through Java code with <F3> and wondered if that was supposed to work in .clj files as well and I was just doing something wrong, or is that not implemented yet.
16:45lpetitchouser: should work. But only for files which are already loaded in a Clojure VM
16:45chouserok, I may have skipped that
16:45lpetitchouser: no static analysis, only dynamic
16:45chouserok
16:45lpetitdocumentation hover is also on its way in a separate branch
16:47lpetitchouser: don't miss the namespace browser
16:48chouserwhat about finding java method definitions from places they're called in clojure code
16:48chouser?
16:48lpetitchouser: its embedded search engine (ok, just regex matching :) ), its documentation hover, and file opening on double click
16:49lpetitchouser: you mean like Ctrl+Space . It's working, but a bit slow. type "(.hash" and then Ctrl+space for example
16:49lpetitchouser: defintely will need more work before twitting about it :)
16:51chouseroh, that sounds cool too. I meant like having the cursor on (PersistentHashMap/create ...) and pressing <F3> to jump to the definition
16:51lpetitchouser: heyh, days have only 24 hours :-). It's already on the todo list, though.
16:52chousernot asking you to do it, just asking if it's done. :-)
16:54chouserhm, I'm doing something wrong no doubt.
16:54lpetitchouser: also don't miss all the "paredit-like" features. Structural selection via Shift+Alt+[UP|LEFT|RIGHT], "raise over" via Alt+R, "split" via Alt+S, switch between "default mode" and "strict mode" (Alt+D) => In strict mode, try to "wrap around" by just doing a selection (preferably via structural selection commands ;-) ) and then hitting the kind of "wrapper" you want : ( { or [ (soon to come: # as a dead letter so that you can als
16:54lpetitchouser: may I help ?
16:55chouserlpetit: nah, I'll but you some other time.
16:55lpetitchouser: you're on Mac, Linux or Windows ?
16:55chouseryeah, I was playing with the paredit features, the ones I could find and/or understand anyhow.
16:55freakazoidare we talking abotu clojure-mode?
16:55lpetitchouser: if you trigger the internal eclipse documentation from the editor (F1 or Ctrl+F1 I guess...), you'll have the full list
16:56freakazoidI just recently got swank and clojure-mode working but I haven't had much chance to play with them yet.
16:56mrBlisslpetit: can you add * to the list of "wrappers", so we can "earmuff" our vars?
16:56freakazoidOh. Eclipse.
16:56lpetitmrBliss: :)
16:56nickikis there a better way to select (in emacs) then Strg + Space [up right ....] with paredit
16:57chouserlpetit: it's great stuff. I especially appreciate that you're writing what you can of it in Clojure.
16:57lpetitchouser: it's the only clojure I write, since I'm still not able to write clojure at work.
16:57freakazoidI usually use ctrl-space ctrl-(up or down)
16:57chousermy dream is to have something at least as "good" (for me) as vim, plus extendable via Clojure. Maybe it's here already and I just need to learn it.
16:58moogatroniclpetit: do you know of a sane way to "theme" eclipse?
16:58lpetitchouser: but that's not just about writing it in clojure. When it makes sense, it's also not dependent on eclipse. Like all the paredit.clj stuff.
16:58freakazoidbut I don't use paredit
16:58lpetitmoogatronic: no :-( :-( :-
16:58moogatronicccw is nice btw
16:59moogatroniconce the hour shifts to dark, eclipse and the glaring white starts to injure my eyes. =)
16:59chouserlpetit: yeah, awesome.
16:59lpetitchouser: thinking about this more and more. Have been involved with aav's clojure.osgi project recently. It now provides "a story" for using clojure from within OSGi. Once cemerick has finished a first workable version of nREPL integration for ccw, we'll be able to have "Eclipse embedded REPL"
17:00ordnungswidrigmoogatronic: if you're on a mac I recommend "flux". This sets your monitor settings to lower k according to sunset and sunrise
17:00lpetitmoogatronic: you're a poet. If you're also good at graphical design, then please submit a logo for ccw :-)
17:00freakazoidor get a macbook :)
17:01moogatroniclpetit: I'm no graphical designer. =) My wife is doing PhD in HCId, maybe I can have her get a minion to do it.
17:02moogatronicordnungswidrj: i do use f.lux, its nice, and helps a bit. I just think that code looks more beautiful with a black background.
17:02nickikthe problem with the normal selection is that you can and up taking to many parens and then you have a messed up parens. The only way to clean it up is to go out of paredit-mode.
17:02lpetitchouser: and cgrand is "pressing" me to do this. He also wants to hack Eclipse from a REPL :-). But everytime he comes to me with this demand, I answer back "when will incremental parsing in parsley be finished", and I have one more month free :)
17:02duncanmis there a sample implementation of IPersistentMap somewhere that I use for my own deftype?
17:02nickiki would really like to have a paren-save way of selecting
17:03chouserlpetit: heh
17:03lpetitnickik: ?
17:03ordnungswidrignickik: you know: copy paste is evil. it's even more evil in lisp
17:04lpetitnickik: can you explain with words understandable to non emacs users ? I would like to understand if the problem your raising will also be reported for ccw, sooner or later ?
17:04nickiki think is ok if you have found a snipped of code you want in seprat function for more reuse
17:04ordnungswidrignickik: with paredit you do not copy and paste you wrap, raise, splice and join :-)
17:05ordnungswidriglpetit: it's about extending the selection according to the structure of the code, eclipse (IMHO) used alt-up for that, intellij uses ctrl-w
17:05lpetitordnungswidrig: is it possible to wrap siblings in emacs paredit ? e.g. you have "foo" "bar" (bar 0) and you want to wrap the 3 within [] ?
17:06nickik@ordnungwiedrig yes but what do you do if you have a (fn .... ) that you want to cut out of there and put it in a sepret (defn .....)
17:06lpetitordnungswidrig: oh, I have this in ccw. It's Shift+Alt+Up. (extend selection to parent)
17:06ordnungswidriglpetit: imho not
17:06ordnungswidrigit's whas nickik is asking for in emacs
17:07ordnungswidrignickik: kill-sexp
17:07lpetitordnungswidrig: Ah. I've go my killer feature to demonstrate in the conj then to hard core emac users :-P
17:08lpetitordnungswidrig: enter eclipse and the strict mode of structural edition (aka paredit) : Use Shift+Alt+RIGHT_ARROW to select the three, then just hit the [ key => wrapped.
17:08ordnungswidriglpetit: hehe, paredit uses don't need that :) And if yes, the write an emacs function :-)
17:09lpetitordnungswidrig: it's like everything. Don't say they do not need that. Say they've learned to live without :-)
17:09ordnungswidriglpetit: pareditusers do [ CTRL-RIGHT CTRL-RIGHT CTRL-RIGHT
17:09ordnungswidrigCTRL-RIGHT extends the current brace/paren/... (a) b c -> (a b) c -> (a b c)
17:10duncanmla la la
17:10lpetitordnungswidrig: yes, I remember, that's called "slurp" or something like that, or forward-wtf :). I didn't like it. One more command to learn, while with the combination of structural selection + wrap you could do this.
17:11nickikthe CTRL thing comes in handy very often
17:11lpetitThough I may add it, when there's an already existing (a), indeed.
17:11lpetithmm
17:12nickik@lpetit you can look at the paredit functions here http://www.emacswiki.org/emacs/PareditCheatsheet
17:13tomojthere's some hidden stuff I think
17:13nickik@ordnungswidrig the kill-sex is like M - C - k
17:13lpetitnickik: already on my desktop since several months :)
17:13lpetitbut thanks
17:13dnolenlpetit: what? you don't like slurp and barf?
17:14lpetitdnolen: I've learned to not use them, since I've not implemented then yet :)
17:14lpetits/use/like/
17:14sexpbot<lpetit> dnolen: I've learned to not like them, since I've not implemented then yet :)
17:14dnolenlpetit: I was mostly joking about the naming convention. silly lispers.
17:15lpetitMaybe functions like slurp and barf are an indicator that people liking them will stay on emacs and not use Eclipse anyway :-p
17:15nickik@lpetit i can use 3/4 of it without thinking atm
17:15lpetitdnolen : :)
17:16lpetitWell, all this didn't help me solve my grammar problem :-O
17:16ordnungswidrigif find the paredit way more natural for lisp and the emacs/intellij more natural for java
17:16dnolenthe commands that I could not live w/o in paredit is - raise and splice
17:17ordnungswidrigbtw. I like most that a closing paren/brace/curly removes a linebreak
17:17jjidodoes anyone have a Textmate bundle that works?
17:17lpetitordnungswidrig: but Intellij plugin could integrate paredit.clj sooner or later, since I've written it with no dependency but clojure, clojurecontrib, and parsley (which only has a dependency on clojure)
17:17dnolendoing what raise does manually is particularly lame.
17:17lpetitdnolen: they're in ccw already
17:17dnolenlpetit: nice!
17:17lpetitalt+R (Raise), alt +S
17:17dnolenjjido: aria42 and I have a fork that people seem to like
17:18dnolenjjido: caveats, requires ruby and installing cake
17:18ordnungswidrigdnolen: raise, yes, nice
17:18jjidoruby's by default
17:18dnolenjjido: are you on os x?
17:18lpetitdnolen: hmmm, is what you cal "splice" what I call "split" ?
17:19dnolenjjido: duh textmate of course
17:19lpetitoh no
17:19dnolenjjido: sorry cold head
17:19lpetitI don't have splice
17:19chousersplice might be join
17:19lpetitjust raise
17:19jjidodnolen: yes
17:19ordnungswidrigand ) also "jumps to the right place"
17:19dnolenjjido: http://github.com/swannodette/textmate-clojure
17:19lpetitalready there too
17:19lpetitand it also takes care of removing extra spaces
17:19lpetitordnungswidrig: ^^
17:20jjidodnolen: looks like the one I have :(
17:20dnolenjjido: does it not work for you?
17:22jjidodnolen: maybe I need a reinstall
17:23jjidodoesn't compile, doesn't load docs
17:23dnolenjjido: there's a mailing list here, http://groups.google.com/group/textmate-clojure
17:23jjidoI only have syntax highlighting
17:23dnolenjjido: if you could go into detail about your issues that would helpful.
17:24jjidook
17:25jjidois there a vector version of (map)?
17:27nickik@mrBliss or somebody else to invoke the test you should be able to hit "C-c C-" but how? Ctrl + c then what?
17:28ordnungswidrigctrl-c ctrl-,
17:28freakazoidjjido: I'd think map would just take vectors.
17:28freakazoiddoesn't it just use the sequence interface and make another sequence of the same type?
17:29ordnungswidrignickik: then M-n jumps to the next error
17:29ordnungswidrignickik: ctrl-' display the error message for that particular error
17:29AWizzArdordnungswidrig: are you catching keyboard events in Swing? ;)
17:30ordnungswidrigAWizzArd: emacs, if in doubt, use emacs :)
17:30nickik@ordnungswidrig i tought the , was to seperate :)
17:31ordnungswidrignickik: hehe
17:34ordnungswidrig,(if-let [[a b] []] [a b])
17:34clojurebot[nil nil]
17:34ordnungswidrighmm, how can I bind with if-let only if the destructuring matches?
17:35somniumordnungswidrig: I think you need a pattern-matching lib
17:35ordnungswidrigbesides (if (= 2 (count x)) (let [[a b] x) …))
17:35ordnungswidrigsomnium: oh now
17:35jjidofreakazoid: it does take vectors but returns a lazy list
17:35ordnungswidrigno
17:35jjido,(map count ["Joe" "James" "Dick"])
17:35clojurebot(3 5 4)
17:36somniumordnungswidrig: there a few available
17:36ordnungswidrigsomnium: in my case, I got with function dispatch on arity :-)
17:38ordnungswidrigs/got/go/
17:38sexpbot<ordnungswidrig> somnium: in my case, I go with function dispatch on arity :-)
17:40ordnungswidriggoodnight to all
17:41duncanmi'm trying to use deftype, but i keep on getting this 'no single method' error
17:51nickikdamn if you not used to TDD you alwas want to change the test if its not passing :)
18:06ohpauleezjjido: use into
18:06jjidoohpauleez: always forget about that one :)
18:07ohpauleez,(into [] (map count ["Joe" "James" "Dick"]))
18:07clojurebot[3 5 4]
18:07ohpauleezjjido: I always forget about using it to mash vectors together
18:07ohpauleez,(into [1 2 3] [ 4 5 6])
18:07clojurebot[1 2 3 4 5 6]
18:08jjidothe code you showed will be slow on a 1,000,000 items vector no?
18:08ohpauleezjjido: Just be careful, it's going to have to realize that entire lazy list
18:08ohpauleezyou just beat me too it
18:09jjidoohpauleez: I want a vector out so I need to realise it anyway
18:09ohpauleezin this case, you may want to try using loop, recur, and transients
18:09ohpauleezI'm not sure which one will be faster
18:09jjidook
18:09jjidoI will optimise later
18:10ohpauleezjjido: ping me if you need an example of that
18:10ztellmantomoj: sorry, I wasn't around for your question earlier
18:10ohpauleezjjido: it's always a good plan to optimize later
18:10ztellmanyou can do either; either write your frame decoder and insert into the standard TCP pipeline
18:10ztellman(check out aleph.object for an example of that)
18:10jjidoohpauleez: yeah :)
18:11ztellmanor just use simple functions
18:12peepzis there a clojure tutorial that takes me through creating a small simple program?
18:16ossarehpeepz: programming clojure is a good book - the first few chapters are very much like that.
18:16ossarehyou can buy it from pragmatic programmers in ebook form, pretty cheap.
18:17technomancy~peepcode
18:17clojurebotpeepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy
18:17freakazoidwow, the ebook is actually cheaper than the paper book
18:18ossarehfreakazoid: stands to reason, no?
18:18freakazoidYou'd think, but it's not so with Amazon.
18:18freakazoidIf I start buying ebooks I'm gonna have to buy something to read them on.
18:19ossareh<3 my kindle
18:20peepzi bought it from peepcode..
18:21_rata_hi
18:21raekah, just noticed that screencast was by technomancy...
18:21raekyou have done many great things, technomancy
18:22ossarehsrsly though, between clojure itself, lein and the sys-clj stuff - my life is awesome.
18:23freakazoidwhat do you use clojure for, ossareh?
18:23ossarehfreakazoid: www.rahfeedback.com
18:24ossarehright now our web app is built in clj, though over time more will be built that way
18:24freakazoidossareh: The site itself looks cool, but I can't help but get a "the officey" vibe from the product
18:25freakazoidprobably due to my meeting allergy
18:25ossarehfreakazoid: that is kinda the point to some degree - that is who we are targetting. The droves of office employees who have shitty lives - we want to make it better for them.
18:26freakazoidGet them new jobs :)
18:26freakazoidhttp://lh3.ggpht.com/Nitro2k/SBnIWtz79KI/AAAAAAAABOI/4_XhUq8hSkI/s800/hold-a-meeting.jpg
18:26freakazoidBut if it makes meetings more productive, that'd be great
18:26ossareh:)
18:27freakazoidossareh: is this a company you're starting or a company you got hired at and you managed to sneak Clojure in?
18:27ossarehfreakazoid: I'm a co-founder.
18:27ossarehclojure walked in - head held high.
18:28freakazoidcool
18:28freakazoidlike erlang and my company :)
18:28ossarehfreakazoid: my last startup embraced erlang a whole lot
18:29ossarehunfortunately we were acquired by people that wanted to control our codez and now they're in a crappy repository somewhere where they'll never see the light of day
18:30freakazoidI'm not particularly concerned about that happening to our Erlang code - the stuff I've learned from working on it is far more valuable to me than the code itself.
18:30freakazoidHeck, that's true of *all* our code.
18:30freakazoidI'd welcome the chance to reimplement it.
18:33ossarehfreakazoid: for 99% of code I've seen created I agree - however the stuff we developed at heysan should have been OSS'ed - it was a high performance implementation of all the major IM protocols. There was were a few bridges into it - one of them permitted use with JEP0100
18:33freakazoidnice
18:33ossarehs/JEP/XEP/
18:33sexpbot<ossareh> freakazoid: for 99% of code I've seen created I agree - however the stuff we developed at heysan should have been OSS'ed - it was a high performance implementation of all the major IM protocols. There was were a few bridges into it - one of them permitted use with XEP0100
18:34freakazoidI primarily care about XMPP
18:35freakazoidand I'm not even happy with that.
18:35freakazoidUltimately I think a p2p system using a dht for rendezvous and key fingerprints as identifiers is the way to go
18:36freakazoidnot federations where your identifier is owned by some third party who happens to operate a server
18:39_rata_is there something like (doseq [x xs, y ys] ...) but that takes the first x with the first y, then the second x with the second y, and so forth?... something like map but from the "do" family... or should I do (doall (map ...))?
18:41ossareh,(doc doseq)
18:41clojurebot"([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."
18:42raek_rata_: to me, it sounds like (dorun (map f xs ys)) is the best option...
18:44_rata_yeah, dorun is better
18:44_rata_thanks raek
19:13AWizzArdCould one of you please time this in your Clojure? (def baos (ByteArrayOutputStream. 100000000)) (time (dotimes [i 80000000] (.write ^ByteArrayOutputStream baos 0))) (.reset baos)
19:13AWizzArd(import 'java.io.ByteArrayOutputStream)
19:17lpetitAWizzArd: "Elapsed time: 2116.265056 msecs"
19:17AWizzArdclient vm?
19:18AWizzArdMine is a bit faster, but not much, I've got 1692 msecs. Does this mean that our computers can only write 40-50 MB/sec into RAM?
19:18jjido,(read-string "(last (range 10000))")
19:18clojurebot(last (range 10000))
19:20lpetit,(macroexpand-1 '(dotimes [i 10] i))
19:20clojurebot(clojure.core/let [n__3820__auto__ (clojure.core/int 10)] (clojure.core/loop [i (clojure.core/int 0)] (clojure.core/when (clojure.core/< i n__3820__auto__) i (recur (clojure.core/unchecked-inc i)))))
19:21jjidoanyway... I know to do println, can you also readln?
19:22lpetitAWizzArd: don't know. One byte at a time, maybe ...
19:22jjido,(doc read-line)
19:22clojurebot"([]); Reads the next line from stream that is the current value of *in* ."
19:25AWizzArdlpetit: when I read that a quad Magny Cours has a RAM bandwidth of 48 GB/s then our lousy 0,044 GB/s seem a bit too small.
19:26AWizzArdanyway, thanks for testing this
19:27lpetitAWizzArd: but you can cache and write(byte b[], int off, int len) !
19:28lpetitsame for read
19:28AWizzArdlpetit: i more or less thought that the BAOS *is* like caching.
19:28bendlashi people
19:28AWizzArdIt just is an in-memory array to which I can write my bytes
19:28AWizzArdHallo bendlas
19:28freakazoidhi bendlas
19:29bendlas,(case nil nil :x)
19:29clojurebotjava.lang.NullPointerException
19:29bendlaswhat's up with that?
19:29lpetitAWizzArd: using write(byte b[] ...) will internally use System.arraycopy(original, 0, copy, 0,
19:29lpetit Math.min(original.length, newLength));
19:30bendlasWhy can't I define a nil case?
19:31AWizzArdlpetit: I don't want to write zeros. How would I fill b in the first place?
19:32lpetitAWizzArd: found !
19:32bendlasdo i really have to write
19:32bendlas
19:32dnolenbendlas: I think that's because the value of nil is determined at run time? case deals with constants
19:33dnolenbendlas: I think someone has mentioned this before ...
19:33tomojthe value of nil is detrmined at runtime???
19:33bendlas(or (and x (case x ..)) :nil-case)
19:33tomojI thought the value of nil was always nil
19:33bendlas?
19:33AWizzArdlpetit: what did you find? :)
19:33lpetitoh no
19:33bendlasevery time?
19:33freakazoidno, it's just not known to the compiler
19:34AWizzArdI would think that writing to a baos byte by byte should be roughly as efficient as writing to a byte-array byte by byte.
19:34tomojto java, it's null, isn't it?
19:34bendlastomoj: it is
19:34tomojso case is trying to hash null or something?
19:34AWizzArdTomorrow I will have to try that in pure Java and compare.
19:34bendlasmight be
19:35bendlasotoh ,({nil 5} nil)
19:35bendlasworks
19:35tomojhmm
19:35bendlas,({nil 5} nil)
19:35clojurebot5
19:35tomoj,(hash nil)
19:35clojurebot0
19:35dnolenbendlas: http://www.glenmccl.com/tip_026.htm
19:36tomojNilExprs are LiteralExprs.. hmm
19:36dnolenso maybe an artifact of Java silliness ?
19:37tomoj(.getClass nil) is the problem
19:38lpetitAWizzArd: import java.io.ByteArrayOutputStream;
19:38lpetitpublic class TestBAOS {
19:38lpetit public static void main(String[] args) {
19:38lpetit ByteArrayOutputStream baos = new ByteArrayOutputStream(100000000);
19:38lpetit long start = System.currentTimeMillis();
19:38lpetit for (int i = 0; i < 80000000; i++) {
19:38lpetit baos.write(0);
19:38lpetit }
19:38lpetit long stop = System.currentTimeMillis();
19:38lpetit System.out.println("Time elapsed (ms):" + (stop - start));
19:38lpetit baos.reset();
19:38lpetit }
19:38lpetit}
19:38lpetitwoops
19:38lpetitsorry
19:38bendlasok, then easy
19:38bendlas,(class nil)
19:38clojurebotnil
19:41tomojbut I can't tell why it's doing that
19:42tomojthe code isn't actually (.getClass nil), it's in Compiler.java
19:43lpetitAWizzArd: still there ?
19:48cburroughsAccording to http://groups.google.com/group/clojure/browse_thread/thread/de68fbae18bec572/022a828bf0bd3cf7#022a828bf0bd3cf7 at one point wrapping compojure routes in var would cause changes to be reflected in a running server, but that doesn't seem to work for me.
19:48cburroughsEx: (run-jetty (var app-routes) {:port 8085 :join? false}), recompile file in emacs, no changes
19:49ossarehcburroughs: this catches me out *all the time*
19:49ossarehcburroughs: though if you have it setup correctly it does work
19:50ossarehcburroughs: care to drop your file into a gist/pastebin ?
19:52cburroughsWorks fine if you look at the right port.
19:52cburroughsProbably best not to start a jetty on a half dozen reports and *then* try to get things to get the var reload work.
19:54cburroughsThanks ossareh
19:54AWizzArdlpetit: yes
19:54AWizzArdoh
19:55ossarehcburroughs: ;)
19:55AWizzArdclojurebot: help record
19:55clojurebotmacro help is http://clojure-log.n01se.net/macro.html
19:56peepzuser=> (load-file /home/admin/clojure-files/script.clj)
19:56peepzCouldn't read input.
19:56peepzwhy doesnt that work?
19:58lancepantzpeepz: make your path a string
19:59peepzok
19:59peepzworked
20:01jjidois there a good e-book about Clojure? I don't like to sit in front of a video
20:03raekjjido: Joy of Clojure (by chouser and fogus) and Programming Clojure (by stuarthalloway) are available as e-books
20:04raekClojure in Action and Practical Clojure are probably available as e-books too
20:06jjidoraek: thanks, you recommend all these?
20:07raekI have read Programming Clojure and most of Joy of Clojure
20:08coldhead"available"
20:08freakazoidIs a Kindle at all worthwhile if you never buy a Kindle book?
20:08raekthey are both great books
20:08freakazoidor in fact any DRM-crippled media?
20:09lancepantzthere was a thread on HN about technical pdf on ereaders
20:09lancepantzit was pretty unanimous that the ipad is much better than the kindle
20:09lancepantziirc because of the ability to zoom in on charts, etc
20:09jjidofreakazoid: you can read technical papers and non-DRM ebooks
20:10jjidocheaper than an iPad ;)
20:10freakazoidWell, the ipad is itself crippled
20:10freakazoidnot interested
20:10ossarehlancepantz: not for reading in sunlight*
20:10freakazoidway too expensive for the privilege of buying from Apple's store.
20:10lancepantzwhat's that?
20:11lancepantz:)
20:11ossarehfreakazoid: I love my kindle - but I'd not recommend one unless you find yourself lugging books around as the norm
20:11raekjjido: I'd recommend reading the samples from the books to get an overview of them
20:11freakazoidthat's why I got one for my dad
20:11ossarehI certainly do not think the kindle has nailed reading computing texts
20:12freakazoidI just have difficulty with the concept of "buying" hardware that's essentially the equivalent of a cable box
20:12freakazoidsomething that's actually owned by someone else and only usable with their service
20:13jjidoeasily freaked freakazoid?
20:13freakazoidyou'd think I'd have avoided buying a CDMA cellphone. Maybe I should just get over it.
20:14freakazoidit's less of an issue when I want the service in the first place
20:14freakazoidbut I don't want Amazon's Kindle "service"
20:16ossarehfreakazoid: yeah, I completely agree with that - I take it a step further and don't buy anything at all unless there is a clear need for it :)
20:16ossarehI can vouch that as far as a reading experience goes it is really a great device - but don't read code on it.
20:16freakazoidossareh: That's how I am lately
20:17freakazoidpaying alimony helps me stick to that discipline
20:17technomancyfreakazoid: I read only non-DRM'd content on my kindle and I love it
20:17technomancyit's great if you like classic literature
20:17technomancypragprogs and oreilly are also really good about non-abusive ebooks
20:17freakazoidTOR had a great thing going for a while
20:17ossarehyeah, I have programming clojure on the kindle
20:18freakazoidyeah, oreilly and pragprogs might be enough reason for me to buy a reader
20:18ossarehfor a while I was reading oreilly books online using the browser on kindle
20:18technomancythe kindle service and the kindle hardware are very distinct
20:18freakazoidbut I won't buy one that isn't awesome with PDFs
20:18freakazoidmy *cellphone* is awesome with PDFs
20:18freakazoidbut the screen is tiny
20:18technomancyit's not the size; it's the non-e-inkness of cell phones that make them bad readers
20:18freakazoid"awesome" being "much better than kindle"
20:19freakazoidpeople don't seem to complain too much about reading on ipad
20:19freakazoidand it's quite non-e-inky
20:19technomancywell... people who buy ipads generally avoid saying things that might imply they wasted their money
20:19technomancyeven if they are true things
20:19ossarehfreakazoid: as a result of the reality distortion emitter built into the housing
20:22ossarehthe ipad is worth every cent if only for angry birds :D
20:22ossarehand canabalt
20:26_rata_what happened to clojure.contrib.seq-utils in clojure 1.3.x? got integrated completely into clojure.core?
20:27freakazoidtechnomancy: yeah, I think Apple fans suffer from stockholm syndrome.
20:27freakazoidI'm a mac user
20:27freakazoidjust not an iphone user
20:28lancepantzi think thats true of everything though
20:28lancepantzpeople have this inherit fanboyism
20:28freakazoidI'll badmouth anything.
20:28lancepantzfunctional vs oo, kindle vs ipad, etc
20:28lancepantznintendo vs sega
20:28_rata_I can't find the indexed fn nor the clojure.contrib.seq-utils namespace
20:29freakazoidI'm a fan of the right tool for the job.
20:29freakazoidAnd not letting the perfect be the enemy of the good enough.
20:33lancepantzi was surprised to find out there was a rivalry between surfers and boogieboarders
20:33lancepantzhad always thought there was a pretty laid back mentality in each
20:33lancepantzbut no
20:36konrDo you add something on top of Emacs' syntax coloring? I find it a little poor, comparing to vi's (emacs on the left, vi on the right: http://img541.imageshack.us/img541/3438/emacsvsvi.jpg)
20:37lancepantzknor: yeah, i made my own color scheme
20:42coldheadsurfers can be terribly territorial
20:42coldheadwhich seems strange with the fluid nature of water
20:44lancepantzyep
21:10miltondsilvahttp://paste.lisp.org/+2GZB
21:11miltondsilvasomebody can explain what's happening in that code (the one in the paste)
21:12miltondsilvaups, forgot to say how it fails... it throws a nullpointer
21:16dnolenmiltondsilva: you're assuming .write returns something.
21:16dnolennamely the outputstream
21:17cemerick~max
21:17clojurebotmax people is 315
21:17cemericknutty
21:17lancepantzmiltondsilva: the -> is equivalent to (.flush (.write (.getOutputStream con) 1))
21:17lancepantznot what you have below
21:18miltondsilvaohh...
21:18amalloy,(doc doto)
21:18clojurebot"([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"
21:18amalloymiltondsilva: ^^
21:18miltondsilvayep
21:18miltondsilvathanks :)
22:16duncanmla la la
22:18freakazoidscorfield_: where in MV is the meetup? I live in MV
22:19freakazoidwish I'd known about it
22:19duncanmis it possible to use defrecord's impl. of IPersistentMap as a base and add additional overrides?
22:19freakazoidI suppose that would require, like, subscribing to a mailing list or something
22:19scorfield_freakazoid: linkedin, stierlin court (2025)
22:20scorfield_at the end of amphitheater pkwy
22:20freakazoidOh, I didn't realize linkedin was in MV
22:20scorfield_the aleph talk just finished... pallet up next
22:20freakazoidI can't go tonight
22:20freakazoidwife is expecting me home soon
22:22coldheadthat woman has been holding you back for too long
22:23freakazoidhaha
22:37nollidji want to make an array of hashmaps with make-array. what is the type name i need to give to make-array?
22:46amalloynollidj: clojure hashmaps, or java hashmaps?
22:49amalloyactually, it doesn't really matter. you can always find out from the REPL
22:49amalloy,(class (make-array (class {}) 10))
22:49clojurebot[Lclojure.lang.PersistentArrayMap;
23:27freakazoiddamn, lotrepl is written with gwt
23:28freakazoidanyone written an ajax clojure repl in clojure?
23:54nollidjwhat is it exactly that makes (:keyword map-thing) work in cases where (map-thing :keyword) doesn't work?
23:55nollidjin my case, map-thing is a record
23:56tomojrecords don't automatically implement IFn
23:58tomojhttps://gist.github.com/a0ed93a09f9fef44379e
23:59nollidji figured. what makes (:keyword map-thing) work? is that interpreted by the reader as (get map-thing :keyword)?