#clojure logs

2010-07-12

02:21LicenserGood Morning my lispy friends
02:56unfo-{{citation needed}} to prove we are lispy! (too much wikipedia...)
02:58Licenserunfo-: {{citation}} You are lispy
02:59unfo-lol ;)
03:48benatkinthirddog: I'd be interested in an iBatis-inspired sql library, too.
04:33LauJensenGood morning all
04:34ponzao____Hi, I've got a Java method that takes a variable amount of arguments. I noticed I have to wrap the arguments inside an array for it to work in Clojure. Is there a clean way to avoid this?
04:34LicenserMorning LauJensen
04:35LuminousMonkeyMoring LauJensen
04:35Licenserponzao____: I think what java does with variable Rgs is exactly that, wrapp ing ghem in an array
04:38ponzao____Licenser, yes that is what it does, but it is a lot cleaner to do Arrays.asList(1, 2, 3, 4) instead of (Arrays/asList (to-array [1 2 3 4])).
04:39Licenserponzao____: Well you can always make a wrapper function ;)
04:39LicenserBut if you want a list isnt there a way to cate it from a collection
04:39ponzao____Licenser, yeah, I was just wondering if there already was a solution I didn't know of, no sense in reinventing the wheel :)
04:40ponzao____Licenser, that was just an example, my actual use case is different, but syntactically the same.
04:41LicenserAh okay
04:41Licenserwell make a .* macro :)
04:41LicenserYou even could get it with reflections eww
04:41LicenserW
04:43ponzao____Licenser, ok. I am very new to Clojure and I've been very impressed with its Java interoperability. The varargs was the first inconvenience and a very minor one at that.
04:45Licenser*nods* yap sopunds not perfe but actually no problem for me wipth that upto now
05:01LauJensenponzao____: Is it a generic class you had problems with ?
05:10ponzao____LauJensen, the method signature is: public Q from(Expr<?>... args)
05:11LauJensenponzao____: I was wondering about the concrete name, as I wanted to experiment with it, and see it if could pass in collections
05:12ponzao____LauJensen, concrete name, sorry I am not following.
05:12LauJensenlike java.lang.String
05:16ponzao____LauJensen, com.mysema.query.sql.AbstractSQLQuery
05:16LauJensenthanks
05:23mmarczykLauJensen: just watched your latest Emacs screencast... that is *awesome*!!!
05:24mmarczykLauJensen: may I express hope that I you might some day release your Emacs config (I do not dare to ask for a commentary) :-)
05:35LajlaBahman, don't tell me you're that prude.
05:35LajlaBesides, it saves you the cost of a toilet.
05:36BahmanLajla: Any unknown creature may be dangerous ;-)
05:37LajlaBahman, I am the second best programmer in the world, right after the Microsoft Chief Software Architect, you should know that by now.
05:38BahmanLajla: If he's the best programmer of the world, then I'm Albert Einstein for no doubt.
05:38LajlaBahman, but he invented the long filename system on NTFS!
05:38LajlaोAnd BASIC seems to be his favour language!
05:42BahmanLajla: Well these are admirable inventions except that he's just 20 years late to come up with them.
05:44LajlaBahman, but he is rich, he must be the best!
05:51BahmanLajla: Yes he's the best. But best of what?
05:51BahmanPerhaps he's got all that money because of the inventions you said earlier.
05:52LajlaBahman, but he gave us net based applications.
05:52BahmanIt's interesting that being 20 years late in inventing is so money-making.
05:52BahmanTiming is everything.
05:52LajlaAnd enabled us to send XML messages.
05:52LajlaThrough SOAP
05:52LajlaTHROUGH SOAP!
05:52BahmanPraise him!
05:53BahmanThese men are bloody rare.
06:08sandosxb
06:30LajlaBahman, you are my fire,
06:30Lajlamy one desire
06:30Lajlabelieve when I say
06:30Lajlathat I want it that way.
06:30BahmanLajla: Oh yes. I hope you're just high.
06:31LajlaBahman, I don't even drink man.
06:31LajlaI don't need it
06:31LajlaI get high on stealing candy from babies.
06:45ponzao____LauJensen, the class is from Querydsl (http://source.mysema.com/display/querydsl/Querydsl). I was just testing during the weekend if I could get Clojure working with it.
06:46LauJensenYou can get just about anything working. I was just wondering if you get get around (into-array [1 2 3]) and only pass [1 2 3] for varargs hidden in arrays
06:51mmarczykif you mean simply passing in a vector instead of an array to a method -- without some sort of wrapper macro or the explicit into-array -- then no
06:58LauJensensure
07:09_willtim_a LINQ style API for clojure would be nice
07:10_willtim_the 'from' function would need to do a dispatch (for multiple providers) and be a macro in order to get at the expression trees
07:10_willtim_tricky
07:25ponzao____willtim, doesn't ClojureQL do something like that already?
07:40willtimClojureQL looks really nice but afaik only does SQL
07:42Lajlawilltim, you are a teddy bear filled with used batteries, that makes you cute.
07:42willtimWhat's nice about LINQ is that it unifies comprehensions and SQL
07:43willtimwhereas ClojureQL doesn't really integrate with the for macro
07:43willtimor work-like the for macro
07:49cemerickLajla: I often fail to comprehend many of your messages.
07:50cemerickwilltim: it seems the challenge would be to make a "clojure LINQ" as capable/natural to use as all the usual seq tools we have.
07:50Lajlacemerick, I get that a lot.
07:51LajlaI do have a diagnosis schizophrenia running around though, it might be related.
07:53cemerickwilltim: after looking at a few LINQ samples (it's been a while), how would for not do the job as-is
07:53cemerick?
07:56willtimyes for is very powerful
07:57willtimalthough it lacks groupby, orderby
07:57willtimthere is a nice paper by SPJ and Wadler called 'Comprehensive Comprehensions'
07:57willtimwould be very easy to implement in Clojure (no type complexity!)
07:58cemerickwell, for is intended to be lazy, so grouping and ordering aren't germane in that context
07:58willtimbut LINQ would also render a comprehension into SQL
07:58willtimcemerick, very true
08:04cemerickIf I were querying SQL databases (been a while there, too), I think I'd much rather write SQL than use something like LINQ. There's always that edge case that the underlying database supports, but the driver/provider papers over.
08:05cemerickThat said, it'd be interesting to see a stab at it in Clojure. I wonder how much it'd pay off to mix with the various datalog stuffs that have been done.
08:06willtimwe certainly wouldn't have to modify the compiler to produce expression trees ;)
08:07ponzao____cemerick, type-safety is a huge advantage when using LINQ.
08:08cemerickponzao____: I suppose, if that sort of thing is important to you. :-)
08:09ponzao____cemerick, when using a language in which ones mindset is set on the compiler helping you then yes it is very important :)
08:09cemericksure
08:10cemerickand I hear tooling is a big draw for linq usage -- being able to complete on database columns (turned into object fields?) in the same editor as your C#, etc. Doesn't excite me though.
08:19ponzao____cemerick, same advantage exists in a lot of query languages, I find it useful. I am guessing LINQ doesn't restrict you from doing native SQL if needed for that special case.
08:22cemerickexecStream
08:22cemerickbah
08:23cemerickYeah, I'm certain it's useful, as long as your database/language/tooling choices line up. In my current typical case of couchdb/clojure/enclojure, that's not the case though. :-)
08:26ponzao____cemerick, Sure. Eclipse is fantastic for Java development and I couldn't live without it, but for Lua and now Clojure I go with a normal editor, I won't mention the name because I am guessing most of the people here are Emacs users...
08:27cemerickhardly all ;-)
08:27cemerickbut most, perhaps
09:07LicenserWeeh work Day Done :D
10:24ct_why does (take 5 (fib3)) always print 'm' ? (defn fib3
10:24ct_ ([]
10:24ct_ (fib3 0 1))
10:24ct_ ([m n]
10:24ct_ (lazy-seq (do
10:24ct_ (println "m:" m)
10:24ct_ (cons m (fib3 n (+ n m)))))))
10:29ct_arg. I see it. (take 5) is _always_ the first time through. Defining a var to the take result and then iterating through that doesn't print m.
10:31ct_Hmm. no. of course the new seq doesn't print m. I still don't know why (take 5) _always_ prints m. I thought lazy-seq cached the results...
10:37Lajlact_, I worship your shadow
10:38ct_what does that mean?
10:39RaynesIt means he's being an idiot.
10:39ct_Oh, heh..
10:41Lajlact_, http://en.wikipedia.org/wiki/I_Worship_His_Shadow
10:46neotykct_: fib3 could provide different results each run, not that it does
10:46neotykbut in general it would not be to good to memoize all lazy-seq
10:47neotyk,(doc memoize)
10:47clojurebot"([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use."
10:49ct_Thanks. I'm stuck atm. I'd really like memoize to be used. I'm using fibonacci to just get an understanding of how I can create a lazy-seq of a seq created by a fn where the seq is not infinite.
10:49neotykct_: shameless plug http://codemeself.blogspot.com/2010/06/clojurecorelazy-seq-makes-sense.html
10:50neotykct_: though it should cache if I look at
10:50neotyk,(doc lazy-seq)
10:50clojurebot"([& body]); Takes a body of expressions that returns an ISeq or nil, and yields a Seqable object that will invoke the body only the first time seq is called, and will cache the result and return it on all subsequent seq calls."
10:50ct_nice article. I read it last night.
10:50neotykct_: thanks!
10:51slyrusmorning
10:51slyrusanyone know of a clojure library for _undirected_ graphs?
10:55ct_Maybe I'm still misunderstanding lazy-seq. I'd like to create a seq of 20 items. each item is created by a fn. I only want the fn to be called once for each item. I think I'm wrapped around the axel on this..
10:57neotykct_: check this out http://github.com/richhickey/clojure-contrib/blob/78ee9b3e64c5ac6082fb223fc79292175e8e4f0c/src/main/clojure/clojure/contrib/lazy_seqs.clj#L82
10:58Chousukect_: can't you use map or repeatedly or something?
10:58ct_Thanks. I've seen that too.
10:58ct_repeatedly works for infinite sequences.
10:58Chousukect_: using lazy-seq directly is not often necessary.
10:58ct_I actually tried that.
10:58Chousukeit works for finite seqs too :)
10:58Chousuke(take n (repeatedly ...)) :P
10:58ct_I returned 'nil' after my fns are done but ...
10:58ct_hmm.
10:59Chousukeor take-while somepred ....
10:59ct_take-while sounds interesting
11:00ct_Q: (take n (repeatedly ...)) - I did this, but I didn't know how to limit the size of the seq. returning nil didn't stop take
11:00ct_(take kept going what it was told and returning nil for items beyond 20 :-)
11:01ct_going->doing
11:24neotykct_: lazy-seq is cacheing
11:24neotyk,(let [a (lazy-seq (cons (do (println "one") 1) (lazy-seq (cons (do (println "two") 2) nil))))] (first a) (first a))
11:24clojurebot1
11:24clojurebotone
11:24neotykct_: notice that one is printed only once
11:25neotykissue might be that you define it as fn
11:36ct_what you write makes perfect sense. Your article shows 1/one very well. I'm not sure why lazy-seq is not caching fib3: (defn fib3 [m n] (lazy-seq (do
11:36ct_<ct_> (println "m:" m)
11:36ct_<ct_> (cons m (fib3 n (+ n m)))))))
11:36ct_m is printed every time - as if lazy-seq isn't caching.
11:37ct_(take 5 (fib3))
11:39Chousukect_: calling the function always generates a new seq
11:39neotykct_: because you are creating new lazy-seq each time you call fib3
11:39ct_heh
11:39ct_tyvm
11:54arohneris there a function to replace the value of an expression with another value?
11:55arohnerI want something like (replace (foo) {1 "1", :a :b})
11:55arohnerwhich would return "1" if foo returned 1, and :b if foo returned :a
12:03hiredmanarohner: how is that in anyway different from ({1 "1", :a :b} (foo))
12:04arohnerhiredman: I want the expression to return foo's value if it is not present in the replacement map
12:04arohner(or (get map (foo)) (foo)), without the double evaluation
12:04hiredmanyou don't need to use get for that
12:05ct_Chousuke/neotyk - thanks again ! I have everything working on my end. I really appreciate your help.
12:05arohnerhiredman: actually, get has a not-found, which may do what I want
12:35Licenseraloa my lispy friends
12:36TeXnomancyLicenser: cookies?
12:36LicenserTeXnomancy: Way thank you but it is too hot, even for cookies :(
12:42esjEllo Licenser
12:42Licenseraloa esj
12:54konrWhat was that function like filter that returned matching elements inside a nested structure?
14:01rbxbxAfter reading http://gist.github.com/470031 (jkk's examples gist) I've changed my mind and decided it's a good thing :D
14:15jkkramerrbxbx: you thought getting examples at the repl was a bad idea previously?
14:44rbxbxjkkramer: I thought it was superfluous :(
14:44rbxbxbut I've since seen the error of my ways.
15:36dsop?
15:37technomancydsop: is there a specific reason you think it belongs in contrib instead of in a 3rd-party library?
15:38dsoptechnomancy: I think a lot of people need sha-1 or md5, so that's why I think it belongs to contrib
15:39technomancydsop: right now stuart H is pushing for a more modular build of contrib, so I think it's not a good idea to add new namespaces right now
15:39technomancyespecially with 1.2 around the corner.
15:40technomancyI suggest releasing it as a 3rd-party lib anyway, it's not like it's hard to add third-party libraries.
15:40dsoptechnomancy: yes that's okay. I can wait and redo the proposal if contrib contributors like the general idea
15:40technomancyit's not like the old days
15:41dsoptechnomancy: well maybe it's because of my scripting languages background but I found it very handy to have sha-1 distributed with contrib
15:41hiredmanmeh
15:41hiredmancontrib
15:41technomancywell some of us are trying to reduce our contrib usage
15:41hiredmanmake a jar, push to clojars
15:41technomancyif you make it a third-party library, you will be able to accept patches without a CA, and you'll also be able to release new versions at your own discretion.
15:42dsophiredman: that's exactly what I don't like
15:42hiredmanwhy not?
15:42dsopbecause a developer doesn't know if the maintainer of the 3rd party library doesn't do BC breaks or something
15:42hiredmanBC breaks?
15:42dsopif it's in contrib you can rely on some basic backward compatbility
15:43hiredmandsop: you can just use an old version
15:43dsophiredman: oh certainly, until you once you have to upgrade for whatever reason
15:43technomancydsop: http://semver.org
15:43hiredmandsop: not always
15:43lancepantz think it makes as much sense in contrib as other stuff, like clojure.contrib.graph
15:44technomancylancepantz: lots of stuff made it into contrib for historical reasons
15:44lancepantzbut i am dying for contrib to be split up
15:44technomancylancepantz: it used to be that was the only non-painful way to distribute your code
15:44hiredmanand you are just pushing the load of keeping the code up to date from the library writer to whoever is involved in the contrib release process
15:44dsoptechnomancy: I know semantic versioning. It's just that I would trust contrib to be bc more than 3rd party libraries
15:44lancepantzright
15:44hiredmanwhich slows releases
15:45hiredmanand makes a burden for others who might not give a damn about your code, instead of, you know, having the person who cared enough to write it in the first place keep it up to date
15:45technomancydsop: we've had lots of backwards-compatibility issues in contrib; it's part of the reason I am trying to reduce usage of it.
15:45dsoptechnomancy: yes, and it's probably worse in 3rd party libraries
15:46technomancydsop: it varies in 3rd-party libraries
15:46hiredmannope
15:47dsoptechnomancy: exactly, and contrib will probably move into the direction of more stable releases
15:47dsoptechnomancy: anyway I got your point, I was just hoping to get some feedback on the general idea
15:47dsoptechnomancy: because I'm new to clojure and my approach might not be very lispy
15:47hsarvellsha1 feels like something basic enough to be in contrib
15:48hiredmanyour funeral
15:50dsop:)
15:56neotykHello my favorite irc channel
15:59AWizzArdHi neotyk. Sorry about yesterdays football match :)
16:00neotykAWizzArd: I overslept it
16:01kotarakAWizzArd: it was bad karma
16:01neotykmy kids do that all the time to me, I think I put them in bed, but it is other way around :)
16:02dsopoverslept a football match?
16:02dsopthe final..
16:02neotykAWizzArd: my team didn't even qualify to group :P
16:02neotykdsop: true, true
16:03neotykif NL would win, I would be woke up. Most likely
16:03neotykand I prefer Cojure than football
16:04kotarakWell, NL thought it was kind of Kung Fu championship, not soccer.
16:06AWizzArdkotarak: ;)
16:35isloni'm trying to run lein 1.2 RC2 under windows with last clojure from gi but when i execute "lein swank" it raises an exception "Exception in thread "main" clojure.lang.LispReader$ReaderException: java.lang.Exception: Invalid token: C:"
16:35islon*git
16:41cmcclellQuick question: I have slime 07062010 working against ccl&sbcl, but cannot get it to work with clojure (against swank-clojure 1.3.0). No special forms will execute - it just hangs emacs. Any ideas?
16:44arohnercmcclell: I'm not entirely sure that version of slime is compatible
16:44arohnercmcclell: try this one http://github.com/technomancy/slime
16:45cmcclellarohner: I'll try it. My alterative is to split my .emacs file, and use load-file to bring in the common-lisp one when I don't want to use clj
16:50cmcclell(when
16:50cmcclell (load
16:50cmcclell (expand-file-name "~/.emacs.d/elpa/package.el"))
16:50cmcclell (package-initialize))
16:51cmcclellUsing elpa, that seems to be enough to be able to connect to a clojure:swank started by maven
16:52cmcclellusing slime 04042010
17:19epochwolfIs http://pragprog.com/titles/shcloj/programming-clojure still a good book for learning Clojure?
17:21lancepantzepochwolf: its better than nothing, but i think the joy of clojure is much better
17:22neotykepochwolf: is very good start
17:23epochwolfdo I need java experience?
17:23epochwolfor better, is there a website for my newbie questions
17:24qbgAs long as you stay in Clojure land you shouldn't need much java experience
17:25rbxbxepochwolf: http://news.ycombinator.com/item?id=1508609 ;)
17:27cmcclellJoy of Clojure shouldn't be a first read for a person new to clojure
17:27epochwolflancepantz, neotyk, rbxbx: thanks
17:30cmcclellepochwolf: Practical Clojure is also decent; Clojure In Action is shaping up to be nice, but it is not out yet :(
17:30neotykepochwolf: or better write clojure code and ask here :)
17:35kib2Hi. Does someone knows where can I find an article/tutorial on how to transform sexpressions to xml/html ?
17:36jkkramerkib2: hiccup is a lib that does that
17:36jkkramerkib2: well, to HTML, not XML per se
17:36kib2jkkramer: Yes I know, but it is just for personal satisfaction :)
17:37jkkramerkib2: you could look at the sources to hiccup to see how it's doing it
17:37arohnerkib2: then read the source for hiccup. It's pretty short
17:37arohnerenlive may do that as well
17:43jneirahi people
17:44nickikHello, I'm new to emacs and I want to install rainbow parens. But I have no idea how that works. Where do I put this script and make it default=
17:45nickikhttp://stackoverflow.com/questions/2413047/how-do-i-get-rainbow-parentheses-in-emacs
17:45jneirawhen i am writing a function I always think that there will be a better version in contrib or somewhere :-/
17:46cmcclellAnyone have any good information on clojure performance in general? We are evaluating the language as our functional alternative on the JVM A lot of discussions seem way out of date.
17:46nickikI know what you mean
17:46jneirajum personally i dont like rainbow parens ...
17:46jneirai didnt try install it
17:48kotarakjneira: this is not always the case: see reductions
17:49jneirajum @cmcclell i think, generally speaking clojure can have the same performance than java
17:49konrWhat was that function like filter that returned matching elements inside a nested structure?
17:49jneirais not reductions good?
17:51cmcclelljneira: thanks. Basically, when it comes down to debate I know the three things people will use to say no to clojure at my company will be: performance, tool support and "lisp is hard to teach"
17:53jneirakonr with clojure.zip i think you could do so
17:53qbgcmcclell: What do you want to use clojure for?
17:53konrjneira: thanks!
17:54dnolencmcclell: outside of code involving a lot of primitive arithmetic operations, I've rarely heard people complain about Clojure's performance.
17:54technomancyclojurebot: performance?
17:54clojurebothttp://clojure.org/java_interop#toc46
17:54cmcclellqbg: We have sets of problems that will be easily solved by functional means. Currently, we use .NET and the JVM. On the .NET side of the house F# has been used for a while to great effect. On the JVM side of the house, we've been java or bust for a while. But now, we're going to pick a language we will support on the JVM for problems best solved via fn programming.
17:55technomancyclojurebot: performance is http://meshy.org/2009/12/13/widefinder-2-with-clojure.html
17:55clojurebotOk.
17:56jneirajum "yes sir" would be better
17:57jneirai have wrote a function wich extracts the value o a n-dimension matrix
17:58jneiraAlready exists somewhere?
17:59kotarakjneira: reductions in contrib was terribly out-of-date. The new core version is much faster.
17:59jneirafe (nthn [[[4]]] [0 0 0]) -> 4
17:59kib2sorry, guys: baby problem. Thanks for your answers, I've already read hiccup source, but found them difficult to understand (I'm a Clojure newbie)
18:00cmcclelltechnomancy: thanks good article
18:00jneirakotarak: jum ok but sure the old version is better than mine :-P
18:02kib2In fact I've found an article (in Common Lisp) here: http://cybertiggyr.com/lh/ and translated the code to Clojure. But then I realized the author was doing it wrong: he just forgot about escaping "<",">", etc. chars.
18:02jneirathis is my take http://gist.github.com/473128 sure there is a better version ;-)
18:06jkkramer,(get-in [[[4]]] [0 0 0])
18:06clojurebot4
18:06kotarakjneira: (reduce nth coll coords)
18:07kotarak,(reduce nth [[[4]]] [0 0 0])
18:07clojurebot4
18:07jneirañam always reduce
18:07jneirai am rusty
18:08jneirathanks kotarak!
18:09kotarakjneira: loop with accumulator cries for reduce, jkkramer also has an idea with get-in, but maybe nth is faster on vectors?
18:09kotarakdunno
18:10jneirajum
18:19jneiranote to myself: when do you have a recursive accumulative function think in a possible reduced reduce version (or fold)
18:41akhudekhey everyone, is there a reason that the sh function in clojure.java.shell prints its arguments?
18:42akhudekassume it's just debug code that is still present?
18:42lancepantzakhudek: the latter, there was a mention of it on assembla recently
18:42lancepantzi think it got patched
18:42akhudekok, thanks
18:49mudphoneSivajag: hi Siva
19:32bhenry,(def test "test")
19:32clojurebotDENIED
19:33bhenry,(let [test "test"] test)
19:33clojurebot"test"
19:35bhenrywith ring, how might i serve up static files from a dynamically decided path (based on a "get" variable from the query string)? eg. http://localhost:8080/?dir=/Users/bhenry/Pictures/wallpaper would show me all the pictures from that dir on a page of html. right now i have it showing me all the full paths to each picture in dir.
19:51tomojring has some helper function for serving up static files that are on the classpath
19:51tomojbut I think nothing for arbitrary files on the host
19:53bhenryguess i have to make a script asking for dir when starting up the clj file rather than getting it from the url afterwards.
19:53tomojoh, and I was wrong
19:53tomojthere is ring.middleware.file and ring.middleware.static
19:54bhenryi looked at those but couldn't figure out how to go about doing what i wanted.
19:59lancepantzwhat is the penalty for having lots of files on the classpath with the jvm though?
19:59lancepantzi know it would start up slower
19:59lancepantzwould those files also get put in memory?
20:00bhenryno
20:00bhenrymy new idea is to just have the program write a static html file with the file:// links to images. and then open the static html file.
20:01bhenrythe problem i was having is from http://localhost i can't click on file:// links for browser security features.
20:01bhenrybut if i have clojure spit out an index.html i can just have it pop it open in the default browser as file://path to dir/index.html
20:46redalastorFor a new clojure project, would you suggest to go with the latest github sources and transition to 1.2 when it is released or go with 1.1?
20:46lancepantzredalastor: github
20:47lancepantzredalastor: well actually, just pull the jar from repository
20:47technomancyclojurebot: compiling clojure is rarely necessary to do yourself.
20:47clojurebotAck. Ack.
20:48redalastorI regularly checkout the code with git, compiling is more convenient than downloading to me.
20:49technomancywell sure, if you download with wget or whatever. =)
20:56brweber2hey stuarthalloway, can you help with an array type hint question (when using :gen-class)?
20:56stuarthallowayhey brweber2, how are ya?
20:56stuarthallowayand maybe
20:56brweber2great
20:56stuarthallowayif I can't, Stuart Sierra is sitting next to me
20:56brweber2and you? you home today or travelling?
20:56brweber2awesome
20:56stuarthallowayhome
20:56brweber2don't know if Liebke told you
20:57brweber2but Near Infinity will be hosting clojure hack nights in NOVA
20:57brweber2we should probably coordinate with you guys
20:57brweber2to help do some useful stuff
20:57technomancyhow big are your hack nights?
20:57brweber2help out if we can
20:57technomancywe just find a coffee shop with big tables and it works great. =)
20:57brweber2technomancy, first one will be scheduled after capclug this Thursday
20:58brweber2technomancy where do you live?
20:58technomancybrweber2: seattle
20:58technomancywe generally get 7-12 attendees
20:58technomancy(disclaimer: we have really big coffee shops here)
20:58brweber2stuarthalloway so my question... is it possible to do array type hints for a method parameter on :gen-class? I've tried every hack I could think of
20:58brweber2including some that might work on a defn
20:58stuarthallowaywhat kind of array
20:59brweber2technomancy we're hoping for about 50% of capclug so that would be around 10 folks
20:59brweber2technomancy but we'll have to see
20:59stuarthallowayusually the string form of the JVM spec name works, e.g. "[B"
20:59brweber2I think it would be awesome if the groups could coordinate with clojure/core and help out
21:00brweber2I tried "[Ljava.lang.String;" but that didn't work there with trunk
21:00stuarthallowayseems like that should work
21:00stuarthallowaywhat kind of non-working symptom did you get?
21:01technomancybrweber2: better to be prepared, I guess
21:01brweber2Exception in thread "main" java.lang.Exception: Unmatched delimiter: ] (seven.clj:3)
21:01brweber2 at clojure.lang.Compiler.compile(Compiler.java:6042)
21:02brweber2maybe it is a bug in trunk, I haven't tried with 1.1 yet....
21:02stuarthallowaythat definitely seems wrong -- can you make a gist of the whole thing?
21:03brweber2stuarthalloway absolutely
21:03brweber2I'll trying debugging here to in a minute, I have the source checked out
21:05abedralol
21:05technomancysuper friends!
21:05brweber2stuarthalloway http://gist.github.com/473303
21:05abedrai believe he goes by Flash now :)
21:05technomancywho got stuck with Aquaman?
21:05abedraluckily nobody
21:06abedrait would be like the one who has superpowers but only in mutability
21:07stuartsierraYes, I don't get along with Apple.
21:07brweber2stauarthalloway at clojure.lang.LispReader$UnmatchedDelimiterReader.invoke(LispReader.java:1021)
21:07stuarthallowaytechnomancy: we are trying to test the new build box
21:07stuarthallowayhttp://clojure01.managed.contegix.com/snapshots
21:08stuarthallowaybut when I point lein there it grab a less-than-most-recent build
21:08stuartsierrabrweber2: you have a type hint ("#^...") with no symbol to follow it
21:08stuarthallowayis there possibly some magic in leiningen that knows about the official build ip address?
21:09brweber2stuartsierra agreed, but that is how method on :gen-class works
21:09stuarthallowayabedra is http://en.wikipedia.org/wiki/Martian_Manhunter
21:09stuartsierrabrweber2: that can't be right, the Clojure reader can't parse that
21:09technomancystuarthalloway: how did you point lein there? hacking the lein source or adding it to :repositories in project.clj?
21:09technomancyor something like an /etc/hosts entry?
21:09brweber2stuartsierra or you are saying I need to get rid of the quotes?
21:09stuartsierrano
21:10technomancyaquamaaaaaaan! http://www.harkavagrant.com/index.php?id=260
21:10stuarthallowaytechnomancy: repositories entry in project.clj
21:10brweber2stuartsierra agreed :) it isn't working so I def agree with you! I'm not sure it is possible... I'd love to believe that it is though
21:10technomancystuarthalloway: the b.c.o repositories URL is added in lein itself; I'm not sure what the precedence rules are.
21:10technomancyhowever, you can set :omit-default-repositories true
21:11technomancyin your project.clj
21:11stuarthallowaytechnomancy: perfect!
21:11dsopstuarthalloway: stuartsierra one you are here, what about the digest proposal on clojure.user?
21:11stuartsierrasorry, not up to date with mailing list
21:11dsopk
21:11stuarthallowaydsop: I haven't looked at the code, but based on my experience with crypto apis in Java i would support a convenience layer
21:12dsopstuarthalloway: at the moment it's just digest that wraps MessageDigest.
21:12technomancystuarthalloway: I'm taking off now; feel free to email me if you need any more help with the new build box.
21:12stuarthallowaytechnomancy: I am sure the whole community will blame lein (you!) if we break it. Bwa ha ha :-)
21:12stuartsierrabrweber2: don't use meta for types in :method args lists, see http://gist.github.com/473303#comments
21:13technomancyno doubt! =)
21:13technomancycheers
21:13dsopstuarthalloway: anyway, I'll wait until you guys look at it. it's probably not good clojure code anyway
21:13brweber2stuartsierra that works for primitives and classes, but not arrays... any idea about arrays specifically?
21:13stuarthallowaybrweber2: task for capclug: review dsop
21:14stuarthalloway's proposal for digest, possibly extend to other crypto apis
21:14stuartsierrabrweber2: I *think* it can just be a string, like my second comment http://gist.github.com/473303#comments
21:14stuarthallowaywould be cool to add clojure.contrib.java.crypto
21:16brweber2stuarthalloway do you have a link?
21:16stuarthallowaybrweber2: http://github.com/dsp/clojure-contrib/commit/77c9f7dbe071d90bf6cb385db4859e76d5e8ff19
21:19brweber2stuartsierra ah, I see the error of my ways! thank you!
21:19stuartsierrabrweber2: welcome.
21:20dsopbrweber2: there is also a follow up commit thats add a default charset
21:21brweber2dsop stuarthalloway ok, I'll follow up after Thursday's capclug to let you know when the group will meet
21:22dsop?
21:22dsopcapclug, group, meet?
21:25dsopah okay found
21:27stuarthallowaydsop: where are you based?
21:27dsopstuarthalloway: karlsruhe, germany
21:27stuarthallowaybit of a hike to capclug :-)
21:28dsophehe
21:28stuarthallowayyou could come hang at JAOO in Aarhus though
21:28stuarthallowayRich and I will be there
21:29dsophm sounds good
21:30brweber2dsop capclug is national capital area clojure user's group
21:30brweber2dsop the group will be meeting
21:30brweber2soon
21:32brweber2dsop stuart h. was suggesting that the group review it
21:32dsopbrweber2: ah okay. at least you will have something to laugh, I'm not very lisp experienced :)
21:32dsopanyway, looking forward for feedback to make the code better
21:32brweber2dsop I think most clojure devs aren't....
21:33dsopI'm off, it's later here, 3:30 am
21:33dsopbrweber2: I wonder if they will figure out what Class/forName "[B" means ;)
21:34brweber2dsop several of them will know :) the rest will have blank stares
21:35brweber2stuartsierra is stuarthalloway making you work late tonight? ;)
21:36stuartsierraWe're meeting in the Justice League Justice Cave or whatever it is.
21:36stuartsierra'cause it's always a cave
21:36brweber2stuartsierra I'm not sure what to make of the clojure justice league... beats vampires I suppose!
21:37stuartsierraWell, sonian already claimed the Clojure Avengers
21:45tomojhmm.. careful with swank.core/break: if one of the locals is an infinite sequence, your repl dies off
21:46brweber2stuartsierra what build box hacking are you doing? trying to get the build green again or something entirely different?
21:46stuartsierrasetting up new Hudson/repository box
22:06bhenryif clojure justice league was instead clojure league of justice, the initials would be clj. you could also abbreviate it cloj
22:26TimMc:-D
22:37cheluishi good evening... can someone tell me why this works (apply str "string") and this doesn't (apply (fn [x] (str x)) "string")
22:40hiredmancheluis: the fn takes a single arg, str does not
22:41rhudsoncheluis: (apply f "string") is equivalent to (f \s \t \r \i \n \g)
22:41cais2002hi guys, how do I do this: bool e=false; for (int i=0; i<100; i++) if (vec[i]==true) then e=true; // now do something with e
22:41cais2002I am using doseq for the for loop
22:42cheluisoh.. I see.. thanks
22:47rhudsoncais2002: (let [e (some true? myvec)] ...) ; e will be true or nil
22:51cheluisif I want to duplicate every char on a string?
22:52qbg,(apply str (map str "hello" "hello"))
22:52clojurebot"hheelllloo"
22:52rhudsonfor example?
22:52cheluisyep
22:52cheluis"hheelllloo"
22:52qbgProbably a better way to do it
22:54cheluisdon't you think that is a problem that there's so many ways to solve a problem on clojure?
22:57rhudsonmakes it more likely that you'll find at least 1 solution :)
22:59cais2002rhudson: how to do it in a more generalized way, assuming (vec[i]==true) is a test function and I am also doing something for side effects within the for loop?
23:02rhudsoncais2002: I generally think of a way to use reduce if I want to "accumulate" some value across a sequence
23:03aria42Hey, anyone having swank-clojure issues; anything that should throw an error now loops in the mini-buffer "error in process filter: wrong argument type characterp, nil"
23:03aria42On the latest slime, slime-repl, etc.
23:09rhudsoncais2002: something like (let [e (reduce #(or %1 %2) false (for [i (range 100)] (v i)))] ... )
23:20mikem,(macroexpand-1 '(unless false (println "this should print")))
23:20clojurebot(unless false (println "this should print"))
23:21mikemhm, according to Programming Clojure, that should expand to (if false nil (println "this should print"))
23:21bhenry,(doc unless)
23:21clojurebotTitim gan éirí ort.
23:22mikemhm, ok, how about this:
23:23mikemah, ok, never mind :) seems it's working
23:23mikemsince unless isn't actually defined anymore
23:24bhenryyeah seems with the quoted expression you'll get whatever you put there no matter what.
23:25rhudson,(macroexpand-1 '(when foo bar baz))
23:25clojurebot(if foo (do bar baz))
23:25mikem,(macroexpand-1 '(when-not foo bar baz))
23:25clojurebot(if foo nil (do bar baz))
23:27bhenry,(macroexpand-1 '(im-so-drunk-right-now false (println "this should print")))
23:27clojurebot(im-so-drunk-right-now false (println "this should print"))
23:27bhenrywhich is why it worked with unless
23:27bhenrygoodnight everyone.
23:27rhudsonIf the first symbol in the quoted list isn't a macro, there's nothing for macroexpand-1 to do
23:27bhenryright
23:57BahmanHi all!
23:57qbgHi