#clojure logs

2010-02-16

00:33brennancslime doesn't seem to be indenting functions with multiple method bodies, is there a setting to fix this?
01:13qedhello all
01:17lpetithi, has the cell story finally got a final word on the names of things ?
01:26replacahmm, silly Q: is there a func like (foo [a b c] [d e f] [g h i]) => ([a d g] [b e h] [c f i])?
01:26replacatrivial enough to hack up with map, but seems really common
01:31TheBusbySo is there a normal reason why independent clojure calls in a REPL would work, but being wrapped in a function would cause them to fail?
01:31TheBusbyI have the following code for rendering a java.awt.Image to the screen, http://pastie.org/826749
01:32TheBusbywhich works if I execute each line individually, but when wrapped as a function it throws a null pointer exception
01:43replacaTheBusby: where does it throw the null pointer exception?
01:44TheBusbyin the drawImage call I believe
01:44replacaA common reason things work at the repl and not in funcs is laziness (since the repl prints results) but that would appear not to be relevant here
01:45TheBusbyI thought that maybe since the drawing was happening in another thread that image or jframe were being freed
01:45TheBusbyso I added the sleep, but that didn't seem to help at all
01:46replacaI would put code to check the non-nil-ness of each part before calling the drawImage
01:47replacaI'd be especially suspicious of getGraphics and image
01:47TheBusbydid that as well
01:47TheBusbyseemed fine
01:48TheBusbythat's what the println's were for
01:48replacayeah, i see that now
01:48TheBusbydo you get the same behaviour?
01:48replacaI didn't try running it. gimme a sec and i will
01:49TheBusbythank you
01:51TheBusbywonder if it's a swing thing where a re-render causes the problem... The clojure seems too simple to be broken (IMHO)
01:53replacawell, it's not even getting into swing, really
01:53replacathe back trace is right at invoke
01:55TheBusbymy repl is showing the println's all the way up to drawImage
01:56replacayeah, but if you look at the npe, the trace doesn't go deeper than the invoke on drawimage
01:56TheBusbywell the println looks like getGraphics is returning a SunGraphics2D object
01:57replacasorry, I should mention that i'm playing with your code and I do see the same thing
01:57replacawhich seems right...
01:59TheBusbyreplaca: thank you, well at least I know it isn't just my system now
01:59TheBusbyvery strange though...
01:59replacaoh, isn't it treating that nil as a BufferedImageOp
02:00replacawhich you would expect to npe on you
02:00TheBusbythe example java code I was using was passing NULL to indicate no value
02:00TheBusbyand if that was the problem why would it would at REPL but not in a function?
02:01replacayeah, I dunno
02:01TheBusbydoes any casting need to occur?
02:02TheBusbyI notice in the reference example that the getGraphics() value is being casted, http://www.javalobby.org/articles/ultimate-image/#2
02:03replacaI don't *think* that should matter
02:05hoeckTheBusby: to debug such exceptions, you should create a proper namespace for your code and then load it from the repl via require or use
02:05hoeckTheBusby: you will then get at least a line number of where the exception occured, instead of no_source_file:1
02:06TheBusbyhoeck: will try that now
02:16replacaTheBusby: the problem is that clojure is picking the worng overload
02:16replaca*wrong
02:17TheBusby?
02:17replacaIt's calling public abstract boolean drawImage(Image img, int x, int y, ImageObserver observer)
02:17TheBusbygah
02:17TheBusbyhence the cast in the Java code
02:17replacain java.awt.Graphics
02:17replacano, the cast wouldn't matter
02:18replacathe issue is that it is only picking by arg count
02:18TheBusbyhmm, so why would it work in the REPL though?
02:18TheBusbydoes 0 = nil in some cases but not others maybe?
02:20replacayeah, I don't know the answer to that
02:20replacathe results may be indeterminate
02:20TheBusbywell it's not throwing an exception anymore so that's still a huge improvement
02:21TheBusbyhoeck: since the NPL was outside my code, the NS didn't add any additional information
02:21TheBusbythank you both though! No I need to figure out why it's rendering a blank window though... :)
02:21TheBusbyer No->Now
02:23replacayup, onto the next problem!
02:23defn你好
02:23replacatime for me to go to sleep though. Good night!
02:23defnGood night sir.
02:24TheBusbynight, and thank you again!
03:09hoeckTheBusby: my guess is that while the frame pops up you draw into it while the frame is still being resized, if I'm putting the Thread/sleep call before the call to .drawImage, something appears after a few seconds
03:38TheBusbyhoeck: thanks, I'm still messing with that
03:38TheBusbyany idea how to set up redraw to recreate the image with proxy?
03:39hoeckTheBusby: could you elaborate a bit?
03:41TheBusbyI imagine an event is trigger when the window is resized
03:41TheBusbyso I can call drawImage again
03:41TheBusbyit sounds like if I add the sleep timer, although the image will display okay the first time. If I resize it'll disappear again
03:42TheBusbyI'd like to have it so that when the window is resized, some code is called to redraw the image
03:42hoeckTheBusby: right, because you are drawing on the "bare" java-metal
03:42TheBusbycan I add a handler to the "bare" java-metal to redraw when a resize occurs?
03:43hoeckTheBusby: under normal circumstances, you would use a windowing toolkit doing this, but I guess you just want to play around a little bit
03:43ulfsterTheBusby: you should be able to add a onResize listener on the frame, which then redraws the image
03:43TheBusbyhonestly I really just need to display an image
03:43TheBusbythat'll be the end of my awt/swing adventure
03:44TheBusbyahh okay
03:44TheBusbyRich's celsius example has a handler on button, so I'll try to replicate that then
03:45ulfsteryou may want to look up the semantics, i am not 100% sure that this thing is called the way i said in swing
03:45ulfsterbut the general way should work
03:46TheBusbyer, would the general way be with Jframe.addContainerListener?
03:46ulfstertry this: http://java.sun.com/docs/books/tutorial/uiswing/events/componentlistener.html
03:47TheBusbythank you, reviewing the link you kindly provided now
03:56TheBusbyhmm, tried this without any success
03:57TheBusbyhttp://pastie.org/826830
04:00TheBusbyis there any easier way to display an image that I'm missing?
04:02hoeckTheBusby: ContainerListener interface has simply no onResize method
04:03hoeckTheBusby: what you want is: http://java.sun.com/javase/6/docs/api/java/awt/event/ComponentListener.html
04:04TheBusbyhoeck: thanks again, I apologize for my ignorance here,
04:04TheBusbyI'm not used to swing/awt or any GUI framework really
04:05hoeckTheBusby: no need to apologize here, we all have been there :)
04:06TheBusbyso I renamed it from "onResize" to "componentResized"
04:07hoeckright, and ContainerListener to ComponentListener
04:07TheBusbyno change though...
04:07TheBusbyahh
04:09TheBusbySo now,
04:09TheBusby (.addComponentListener frame
04:09TheBusby (proxy [java.awt.event.ComponentListener] []
04:09TheBusby (componentResized [evt]
04:09TheBusby (. (.. frame getRootPane getGraphics) drawImage image nil nil)
04:09TheBusby )))
04:09dsoparg
04:09dsopuse pastebin
04:09TheBusbysorry, will do that now
04:10TheBusbyUpdated code to use components, http://pastie.org/826840
04:23hoeckTheBusby: well, it works, at least the image is painted into the jframe, but the jframe repaints it self immediately after resizing too, so it overwrites your image
04:24hoeckI believe you have to use a java.awt.Canvas, this one also does buffering, so you don't have to manually refresh the screen
04:26hoeckthe getGraphics method in awt and swing components is mainly there to write other components or decorators, not to directly draw on it
04:26TheBusbyAhh
04:27TheBusbyhoeck: thank you! I'll head in that direction.
04:29TheBusbycan you write an image to a canvas though?
04:30LauJensenMorning team
04:31LauJensenB is for? Check out the top video: http://www.rocketboom.com/category/daily/
04:31RaynesMorning teammate.
04:36esjMorning !
04:37Rayneshttp://factor-language.blogspot.com/2010/02/factor-092-now-available.html
04:38hoeckTheBusby: you have to subclass Canvas and overwrite the paint or update method (via clojures proxy) which recieves a Graphics Object (the same you took from the JFrame with .getGraphics)
04:50hoeckTheBusby: http://gist.github.com/305415
04:59ordnungswidrigsorry guys. vpn flapping
05:09qedordnungswidrig: no problem
05:11defnanyone awake?
05:11defni need my clojure fix
05:12Chousuke:P
05:12pjackson
05:12pjackson
05:15defnChousuke: tie me off?
05:17AWizzArdIs there something in Contrib to support “keyword arguments”, similar to the ones in CL?
05:17AWizzArdI saw that more and more fns support (foo 1 2 :some-parameter1 arg :another-one arg2)
05:18AWizzArdWhere the order of the keyword+arg don't matter, as long they come after the non-optional ones.
05:21defnAWizzArd: i think it may be in c.c.macros
05:21hoeckAWizzArd: clojure.contrib.def/defnk ?
05:21AWizzArdWill look at those, thanks.
05:22defnAWizzArd: http://www.assembla.com/spaces/clojure-contrib/tickets/51
05:22defndoes that look like what you're after?
05:22defndefnk looks like what you need
05:24defnbut the link above is absolutely what you /want/
05:25defnAWizzArd: http://groups.google.com/group/clojure/browse_thread/thread/d6b5fa21073541c1
05:27defni wonder if compojure or ring use defnk or some amalgamation of the stuff in that post
05:28defnif it doesnt use either it seems like it might make things simpler
05:28defnbbl, cheers
06:20TheBusbyhoeck: much much *MUCH* thanks
06:21hoeckTheBusby: so you finally got it working?
06:32AWizzArdIs there a bar other than #(symbol (name %)) which returns for (bar :foos) the symbol “foos”?
06:32AWizzArdkeyword to symbol
06:40ChousukeAWizzArd: I don't think so.
06:49AWizzArdoki
07:49RaynesFleetDB looks nice.
07:57LauJensenAnybody know what that RocketBoom is I linked earlier?
08:10cemerickthis book may find a home with many here: http://www.amazon.com/dp/3540891846
08:43esjcemerick: that looks like a challenging read, thanks.
08:44cemerickyeah, no doubt. Stuff like that is likely the sort of foundation one needs to build things like Qi
08:44cemerickWhich would be particularly interesting in clojure, IMO.
08:46bremnerignorant question: does clojure support pattern matching a la Haskell or ML?
08:47cemerickit has excellent destructuring -- no value-based pattern matching, though you could probably put something very interesting together with the new case form
08:47cemerickI think all of the existing pattern matching libs predate case, so they do a lot of heavy lifting that isn't necessary anymore.
08:47bremnerah. yeah, Oz has a very expressive case, but no "top level" pattern matching
08:48bremnernot that I expect anyone to know Oz :)
08:48cemerickask around some more, though, there may be a lib that I'm not familiar with
09:22ordnungswidrigRaynes: I currently evaluate fleetdb and I like it
09:25esjordnungswidrig: have you looked at Mongo ?
09:26ordnungswidrigesj: it's next on the list. I like about fleetdb that it's java. so I have a single environment for development. riak looks nice as well.
09:27esjcool. I'm checking out Mongo right now and have only nice things to say
09:33ohpauleezis there a more idiomatic way to use iterate than: (nth (iterate add2 2) 4)
09:41chouserohpauleez: that looks about right.
09:41ohpauleezcool, I figured as much, just wanted to see if people used it any other way
09:42ohpauleezchouser: thanks
09:42chouserI've never actually done that, I don't think, but if I wanted the fourth application of a fn to its own results, that's the best way I can think of.
09:42ohpauleezthat's indeed what I want
09:45AWizzArdHow helpful would it be if the compiler were emitting warnings for name clashes? Such as having a parameter p called like a function f, thus effectively having p shadowing f.
09:46chouserAWizzArd: it would have a fit with clojure.core
09:47AWizzArdSuch warnings could be turned off by meta-data for example.
09:47AWizzArdToday I was debugging 30 minutes until I found the name clash ^^
09:47ohpauleezI like this idea
09:48chouserwhat about a separate "lint" tool that would flag such things?
09:48AWizzArdchouser: yes, this would be the best.
09:48AWizzArdI already suggested something like FindBugs for optional static typing.
09:48chouserHm... I've started such a thing. I should keep pushing on it.
09:48AWizzArdFindBugs has a very nice infracstructure ready for use.
09:49AWizzArdIt can find unused vars, wrong format strings, etc.
09:49chouserbut it couldn't be used to find this kind of bug
09:49chouserI assume, anyway.
09:49chouserBy the time clojure code has been compiled, the names of things are different and unique
09:50AWizzArdchouser: maybe there could be a way. For example, the compiled version of the function “keyword” will probably have a unique identifier in compiled code.
09:51AWizzArdchouser: http://findbugs.sourceforge.net/
09:51chousermy plan is to let the clojure compiler do its analysis, but then check the results before emitting bytecode.
09:51ohpauleezchouser: I remember you saying you were working on that tool, I'd love to see it make it's way into the community
09:51rhickeyif editors/IDEs understood let, they could color locals differently from globals
09:51AWizzArdrhickey: yes
09:52chousermaybe check those results using datalog...
09:52ohpauleezI'm still working on the clojure repl based JDB interface, which I haven't gotten too far on
09:52lpetitrhickey: soon to come :-)
09:52AWizzArdchouser: yes, the compiler can do the analysis and optionally include data in the compiled code
09:54AWizzArdIn principle it would be nice if the compile function would take in future versions a full stack of options.
09:58cemerickwhoa, looks like I'll be able to make it to the next Clojure-NYC meetup :-D
09:58ohpauleezcemerick: when is that?
09:58cemerickapparently they're pegged at the third thursday each month, starting in march
09:58ohpauleezcool, I'd bus up for that
09:58cemerickhttp://www.meetup.com/Clojure-NYC/
10:02ohpauleezcemerick: thanks
10:07hoeckohpauleez: how far did you get with JDE?
10:09ohpauleezI looked at the jdb source to see how to best interface with JDI, and then sat on the repl trying stuff out and saving a few things that seemed to work on the surface
10:10ohpauleezIt's a weekend project to get a basic version going
10:10chouserohpauleez: can you debug the JVM your REPL is in, or only other JVM processes, or either?
10:11ohpauleezeither
10:11ohpauleezJDI lets you connect remotely, or locally
10:11chouserexcellent.
10:12ohpauleezyeah, totally
10:17hoeckI'm currently trying to hook jde into swank-clojure for better exception stacktraces
10:19ohpauleezhoeck: there's a pretty good developerWorks article about how to pull out more detailed stack traces
10:19ohpauleezI don't know if you've seen that
10:24hoeckno, I'm just using the JDE javadoc
10:24hoeckhardest part is figuring out how slime works
10:33AWizzArdrhickey: what do those options do?
10:34chouservolatile is a Java keyword that means the same thing, I would assume
10:35chouserAnd I would guess unsynchronized-mutable is for a regular ol' Java instance field -- with a long enough name to discourage its use. :-)
10:36ohpauleezhaha
10:36AWizzArdSo, this mutable thing would not trigger the instantiation of a completely new object, but instead mutate the existing one.
10:37Chousukeis volatile then just an instance field, but synchronised?
10:38chouserAWizzArd: just a regular field in the object you can change with the set! special operator.
10:44rhickeycould be :volatile-mutable! and :unsynchronized-mutable!
10:45rhickey:unsynchronized-mutable-I-know-what-Im-doing-and-wont-call-Rich-when-it-goes-awry
10:45chouserthere, that's better.
10:45the-kennyI like the version with !
10:47rhickeyseriously - :volatile-mutable! and :unsynchronized-mutable! ?
10:48chouserI don't really like the ! on a noun. but the words are good
10:48ohpauleezI agree with that, I tend to think of ! as a mutable/destructive verb
11:00rhickeyproposed new text in deftype docs:
11:00rhickeyFields can be qualified
11:00rhickey with the metadata :volatile-mutable true or :unsynchronized-mutable
11:00rhickey true, at which point (set! afield aval) will be supported in method
11:00rhickey bodies. Note well that mutable fields are extremely difficult to use
11:00rhickey correctly, and are present only to facilitate the building of higher
11:00rhickey level constructs, such as Clojure's reference types, in Clojure
11:00rhickey itself. They are for experts only - if the semantics and
11:00rhickey implications of :volatile-mutable or :unsynchronized-mutable are not
11:00rhickey immediately apparent to you, you should not be using them.
11:01ohpauleezsolid
11:03LauJensenExcellent rhickey
11:08cemerickrhickey: it's *almost* like they shouldn't be documented at all ;-)
11:09rhickeycemerick: but there are those pesky people who read the Clojure source :)
11:09cemerickah, but those brave enough to do so get to use the gems they find!
11:10rhickeycemerick: then we'll just be answering about them here over and over
11:10cemerickyeah, omitting docs was a joke, actually ;-)
11:10the-kennylike how/when to use
11:11cemerickthe-kenny: https://www.assembla.com/wiki/show/clojure/Datatypes
11:12cemerickbasically, use deftype when you need to create objects with a set of defined slots
11:12cemericke.g. in place of defstruct
11:14the-kennycemerick: ah, nice. Maybe it makes sense in my small fun-project :)
11:19qedrhickey: i was thinking about fetch/pass this morning. what about 'glean' or 'abscond'?
11:19qedrhickey: for fetch i mean...
11:20rhickeyqed: I like fetch in that it implies go in and bring back
11:21qedrhickey: right, just trying to bring the spirit of 'smuggle' into the mix as you were suggesting yesterday
11:24ChousukeI quite liked "spy" :P
11:24qedyes I liked that as well
11:25qedI was also thinking something like liberate might work
11:26qedit's unique and brings to mind some animal protester letting a bunch of monkeys out of their 'cells'.
11:27Chousuke:P
11:28qedChousuke: oo oo! "fence"?
11:29_fogus_qed: You saw how well that worked out in 28 days Later no?
11:29_fogus_:p
11:30qed_fogus_: haha
11:33lpetitrhickey: what about inspect instead of fetch ?
11:35rhickeylpetit: the roots are good, but the current usage is more of "examine closely"
11:36lpetitrhickey: ah, ok
11:38qedlpetit: perhaps 'probe'?
11:52esjgather ?
11:53esjor, in nod to our friends in London, 'nick' ?
11:53chousergather implies from multiple sources.
11:54esjchouser: true dat.
11:54esjpick ?
11:54chouserI kinda like inspect, though I'm not sure it's any better than fetch. And clojure.inspector already exists.
11:55lpetitvisit ?
11:55lpetitmm, no
11:57lpetitstudy ?
11:57rhickeywow, interactive development with deftype and protocols is way faster and more fun than classes+interfaces
11:58lpetitwhy not just "look" instead of fetch ?
12:01qedlpetit: because you need to go instide
12:01qedinside*
12:02lpetitWell, somehow we already are "inside" ( within-cell ), no ?
12:03chouserrhickey: yes! Never restarted my REPL while hacking out the extra interface impls for gvec
12:17qedgoogle fight: inspect cell vs fetch cell -- inspect wins
12:56sh10151Hi -- is there any variant of pmap that spawns a user-defined number of threads? I have something I/O bound that I want multiple workers to perform
12:58chouserif it's IO bound, why do you want more than one thread?
12:59sh10151it's network-bound, I should say
13:00sh10151some hosts are slow and others are fast
13:00cemerickseems like a better job for agents
13:02sh10151Maybe? I mean, conceptually it's "I want (e.g.) no more than 10 connections open at one time to process these 1000 hosts"
13:03Chousukeyou can use a plain old threadpool :)
13:03sh10151yeah but this code is more Java than Clojure anyway at this point ;)
13:04ChousukeIt might be useful if you could tell eg. futures or agents to execute in a specific threadpool . :/
13:04qedhave anyone done any good write ups on using TDD with clojure?
13:04qedhas*
13:05Chousukeqed: write a function, test it, once it works, goto 10 :P
13:05qedi only go to 11
13:05cemericksh10151: Chousuke has a good point -- just create a fixed threadpool, .invokeAll with your list of fns that do the IO, and then read off the results.
13:05cemericklarger stuff would require a queue
13:05cemerickor, doing something by hand with agents :-)
13:05Chousukeqed: the only one I can find is http://s-expressions.com/2009/07/28/clojure-the-repl-and-test-driven-development/
13:06sh10151aaah i always forget clojure functions are runnables
13:06sh10151that makes that option much less ugly
13:06hiredmanand Callables
13:08qedChousuke: yeah i found that but im not in love with it -- i'd like to get something sexy working where id have a buffer constantly running tests and giving me red/green for every save of a file
13:10qedChousuke: im not sure why i even really want to use tests -- with FP I need them so much less, and after you add the REPL into the mix there's even less reason for good tests for everything
13:10qedhowever, with I/O it'd be nice to double check
13:17Chousukeheh
13:18Chousukewhen I was writing a Clojure reader I didn't even do any IO until the reader was pretty much fully functional :P
13:23sh10151the threadpool looks nice enough
13:23sh10151thanks for the help :)
13:39DeusExPikachutechnomancy, do you have a public read-only development branch of leiningen?
13:40DeusExPikachumore development then master
13:41technomancyDeusExPikachu: no, master is the development branch
14:08metaperlHi all ... who has the best SLIME - Clojure mode for Emacs right now?
14:09metaperlI think technomancy picked up where jeff chu left off?
14:10fanaticometaperl: use the elpa release. http://tromey.com/elpa/
14:10metaperlHmm, I will try
14:10metaperlthanks fanatico
14:10metaperlhavent used ELPA in 2-3 years I think :)
14:11fanaticotechnomancy manages the clojure related packages for it.
14:11fanaticonp
14:13metaperlI see. It installed just fine. Thanks.
14:21licenser__Hi :)
14:22hamzahey guys, i am trying to get lein test to run but i get a classnotfoundexception for leinningen.test, even on a fresh project created with lein new someProj? This is for Mac OS X.
14:22hamzabtw, every other lein task works except test
14:23licenser__Did you do a leon deps first?
14:23hamzayes
14:23hamzai have clojure and contrib in lib/
14:23licenser__Okay then I've no idea
14:26fanaticohamza: do you have an old version of lein in your path?
14:27hamzano, but i removed clojure and contrib from my java extensions folder and seems to fix the problem, multiple clojure in both extension folder and lib/ folder.
14:28licenser__Okay a question about the best aproach here: I've a map of 2k items, the map never changes only the items now i've to run a function on every item that modifies the item itself and perhaps anoter obe or two each of those functions only tale like 10ms currently. To optimize this dies it make sense to send all the functions to a agents and let them handle stuff in paralell, I see chances for conflicts as pretty low
14:32chouserrhickey: abrooks suggests "glimpse" instead of "fetch"
14:34rhickeyhmm
14:41rhickeyI'm finding these word-names completely in the way
14:42rhickeya big diff between cells and the other ref types is that you always have to go through the cell. With the other refs you grab the value out, perform a series of transformations, and stick it back in, ot passa multi-step value transform in
14:43rhickeyor pass a
14:43rhickeycell code will say pass pass pass pass
14:43rhickeyobscuring the work
14:44AWizzArda cell must be traversed from the beginning to end always?
14:44rhickeyAWizzArd: ?
14:44AWizzArdWhat do you mean by "you always have to go through the cell"?
14:45Raynes(())
14:46dakronewhat's the easiest way to get [a b c] [1 2 3] into ([a 1] [b 2] [c 3])? I tried (map #([%1 %2]) [a b c] [1 2 3]) but that doesn't work
14:46AWizzArdtry (map #(vector %1 %2) ..)
14:46opqdonutor (fn [a b] [a b])
14:46cemerickdakrone: zipmap + seq if you're lazy :-)
14:47opqdonutor even map vector
14:47_fogus_,(map vector '[a b c] '[1 2 3])
14:47clojurebot([a 1] [b 2] [c 3])
14:48cemerickI find a lot of people don't grok that map can take any number of collections.
14:48noidithat's a real FAQ :)
14:48dakroneAWizzArd / opqdonut / cemerick /_fogus_, awesome, that works. Thank you
14:48_fogus_,(map vector '[a b c] '[1 2 3] '[e f g])
14:48clojurebot([a 1 e] [b 2 f] [c 3 g])
14:48DeusExPikachutechnomancy, what do you think about the idea of having "wrapper" like project.clj files that act like ebuilds in gentoo, that provide the necessary information to build that project. In this way, there would be a project.clj maintainer who potentially may not be the project's maintainer?
14:48noidiI've noticed after I asked that myself a few months ago :)
14:48noidi+that
14:52technomancyDeusExPikachu: I don't really know what that means. What are ebuilds?
14:52ohpauleeznoidi: totally, that question gets asked all the time
14:53DeusExPikachutechnomancy, ebuilds are like project.clj files, they list the dependencies for building a package in a linux environment, they are general enough to build and install all sorts of packages written in java, python, C/C++ etc...
14:54DeusExPikachuportage, kinda like apt system with debian, looks at that file, downloads the sources, and builds deps and finally the package itself
14:56technomancyDeusExPikachu: still not seeing the connection
14:56stuartsierraThereby adding one more layer at which things can be broken.
14:57technomancyoh, you're talking about leiningen manually building all the deps?
14:58technomancythat sounds really complicated and not helpful.
14:58arohnertechnomancy: it would avoid jar hell of each of your dependencies specifying a different version of clojure
14:58DeusExPikachutechnomancy, yes, so leiningen normally builds allthe deps, I'm asking that potentially described in the project.clj file, it can offload the work to the package's installation method
14:58fanaticomaven already handles that.
14:58technomancyoh, I see... yes, there's a place for a final-AOT before an uberjar is built
14:59technomancybut definitely not checking out all the sources for each dependency
14:59DeusExPikachuall leiningen would have to do is manage downloading sources/jars and installation of the built jar into the local repo
15:03metaperldo you fill out a ticket on Assemba for doc fixes? This section http://clojure.org/getting_started#toc4 does not mention the ELPA method of installing the emacs' clojure mode
15:03technomancyI'm all about late-binding a project to a specific clojure version
15:03technomancythat's why it needs to be done at uberjar-time
15:03metaperlor maybe the website is under source control?
15:04technomancyanything earlier is just going to cause headaches down the road with project that depend on it
15:04technomancymetaperl: no, it's a manually-edited wiki unfortunately.
15:05technomancychouser: do you have write-privs for it? those links are extremely outdated.
15:05metaperloh, and where are the docs on your clojure mode technomancy?
15:05metaperlI dont know how to run it... I can run clojure from the shell jsut fine, but want to step up to emacs
15:05technomancymetaperl: clojure-mode doesn't really need docs; there's nothing to it. swank-clojure (for communicating with running clojure subprocesses) is documented in http://github.com/technomancy/swank-clojure.
15:06metaperloh so I need to install something other than what I got via ELPA... yes us emacs-users certainly would benefit from an update of that section :)
15:07technomancymetaperl: no, getting swank-clojure from elpa is enough
15:07technomancyit will pull in dependencies automatically
15:12tomojanybody happen to have a distance_of_time_in_words function laying around? :)
15:13metaperltechnomancy: I should not have gotten this right - """swank-clojure.el:47:1:Error: Cannot open load file: slime""" - http://pastie.org/paste/827697
15:14technomancymetaperl: that's an elisp byte-compilation error. it won't interfere with usage; elisp will continue to work in interpreted mode
15:19metaperlok and I need to set my environmental variable CLASSPATH to "." to fix this right - http://pastie.org/pastes/827713
15:19hyp3rvigi1antit seems that the Java Media Framework (JMF) requires a manual download (can't get it leiningen)...how should i go about adding it to my project?
15:20hiredmanhyp3rvigi1ant: I'm pretty sure jmf must be a maven repo somewhere
15:26hyp3rvigi1anthiredman: this is what happens when i try with [javax.media/jmf "2.1.1e"] as a dependency: http://pastie.org/827726
15:26metaperleven after setting the CLASSPATH to "." it does not work - http://pastie.org/pastes/827713
15:27hamzatechnomancy: how does lein pass command line args to the plugin? if my plugin expects a port value "lein myPlugin 90" how do i grap 90 from within a plugin?
15:27hiredmanhyp3rvigi1ant: you need to find a maven repo that has jmf in it, and add it to you project.clj
15:28hiredman~google jmf maven
15:28clojurebotFirst, out of 2160 results is:
15:28clojurebotIndex of /maven/2/javax/media/jmf/
15:28clojurebothttp://download.java.net/maven/2/javax/media/jmf/
15:28hiredman^- doesn't look very hard
15:30hyp3rvigi1anthiredman: how do i tell leiningen to use that? (i know nothing about maven and this is the first time i've run into something like this)
15:33metaperlfanatico: have you had any issues with swank-clojure like this - http://pastie.org/pastes/827713
15:34dakroneanyone have a second to take a look at this http://paste.lisp.org/display/95068 and tell me if I'm on the right track as far as coding style / layout goes?
15:34dakronenot sure if function generators are the cleanest way to lay that out
15:35hiredmanhyp3rvigi1ant: :repositories {"name" "url"}
15:35hiredmanor something similar
15:36hyp3rvigi1anthiredman: ah, nice, thanks! i'll check that out
15:36fanaticometaperl: no. I did a clean install last night and everything worked perfectly. Is this error triggered by starting slime?
15:36metaperlyes, when I type M-x slime
15:38metaperlit downloaded and installed clojure the first time, but then it threw this error... I figured it was CLASSPATH, so I set that and then restarted Cygwin/X/emacs .. but the same error...
15:39hyp3rvigi1anthiredman: excellent! it worked perfectly! thanks again
15:40metaperlSo Prolog is not quite homoiconic? I suppose DCGs would get in the way of that?
15:42fanaticometaperl: could there be an previous version of clojure in your CLASSPATH?
15:42metaperlfanatico: CLASSPATH=.
15:43metaperlmaybe I should remove the clojure it installed and uninstall slime and swamk-clojure and try again
15:43metaperlbut where did it install clojure?
15:45fanaticomaven.
15:50metaperlmaven? I dont think I have maven installed unless it comes with java
15:51metaperloh you nkow, it might be because I'm running emacs22 --- Cygwin says it has emacs23, but it keeps installing 22
15:51metaperlI may have to manually compile and install 23
15:53fanaticometaperl: can you start a swank server using lein and connect to it with slime?
15:53metaperllein? I dont know how to do that? I never installed leiningen
15:55fanaticothere is a plugin for leiningen called lein-swank that'll create the slime server for you. it may give you some idea why your current setup isn't working.
15:55metaperlI see - http://github.com/technomancy/leiningen/tree/master/lein-swank/
15:56fanaticojust list it in :dev-dependencies.
15:56metaperlThis is not docs for idiots like me - Simply add [leiningen/lein-swank "1.1.0"] to your :dev-dependencies in project.clj
15:56metaperl1) I dont know what project.clj is, or where it should be
15:56metaperl2) should CLASSPATH just be "."
15:57metaperl3) what is exact syntax to add [leiningen/lein-swank "1.1.0"] to your :dev-dependencies
15:57fanaticometaperl: sample http://github.com/weavejester/compojure/blob/master/project.clj
16:00metaperlok, this is what I setup - http://pastie.org/pastes/827785
16:00metaperlbut I really should install emacs23, he made it clear earlier versions probably would not work
16:04fanaticometaperl: that should work. running this setup on windows is going to be a little error-prone. I don't think any of the devs working on swank run it.
16:04metaperlhmm, I suppose I should ssh to my linux box...
16:13LauJensenDid everyone see this? :) http://www.rocketboom.com/apple-zoom/
16:15lpetitit's *your* Steve Ballmer ! ?
16:17LauJensenYes sir - The girl has got it right, B is for Best In Class :)
16:18danlarkinLauJensen: sweet!!
16:19LauJensenYea! :D
16:19hamzaguys, does lein support chaining tasks such as i can't build my exe before uberjar task is run. so is it possible to make my task depend on other tasks?
16:23metaperlI think swank is not calling java with a windows classpath under cygwin.... where does ELPA install swank-clojure?
16:24fanaticofor me, ~/.emacs.d/elpa/swank-clojure-1.1.0
16:25technomancyhamza: sure; tasks are just functions. you can call them easily.
16:26avarushi
16:27lpetitLauJensen: she's your girlfriend ? ;-)
16:28LauJensenlpetit: Definitely not - I'm married to a very wonderful danish woman :)
16:28hamzatechnomancy: thanks..
16:28lpetitLauJensen: no pb, you can answer me in private, it'll not end up in the logs lol
16:29LauJensenlpetit: Given the morality of men today, thats not even funny
16:29avarussure men...omg
16:29avarus:>
16:30hamzatechnomancy: also, is it ok for a plugin to expect user to define a new key in defproject?
16:30lpetitLauJensen: sorry, I didn't mean to offense you
16:30technomancyhamza: sure, that's quite normal as long as it's clear in docs
16:30LauJensennp
16:31Licenseris there something like values equivalent to keys?
16:32rhickeyvals
16:32Licenserah too easy rhickey you tricked me with that :P
16:32hamzatechnomancy: kk thx..
16:33avaruscan I print something in a (catch Exception _)?
16:34avarusI've seen examples like (catch Exception _ nil)
16:34LauJensentry :)
16:34avarusguess it's returning "nil" :P
16:35avarusaye, my problem is I'm doing it with compojure and I get only 0byte-length output when I do a try catch thing
16:35avarusin case of an error I'd like to print something :)
16:37avarusI tried a (catch Exception _ (println "bla")) and it didn't print anything :)
16:38avarusomg
16:38avarusI'm sooo dumb
16:38avarusit never hit the catch :P
16:39avarusbecause I check for the existing username earlier with an if :
16:39avarus:>
16:39avarusayayayayaaa
16:41Licenserrhickey: it might be a dumb question but what is the reason taht clojure throws java.lang.NullPointerException without any stack trace, is it worth to write a bug report for that?
16:42stuartsierraThe exception is stored in *e
16:42avarusLauJensen: sometimes it simply helps to talk about it :P
16:43hamzacan i create a new namespace without actually switching to it them use it with with-ns?
16:43Licenserstuartsierra: yea *e says: #<CompilerException java.lang.NullPointerException (NO_SOURCE_FILE:0)>
16:44LauJensenavarus: True - When you are unable to master your thoughts, verbalizing the problem often adds structure
16:44Licenserwhich is the problem I have a really hard time tracking the problem that causes this
16:44hiredmanLicenser: do you have a small test case that reproduces the exception
16:44stuartsierraThat usually happens when you're trying to load a file with a bad ns declaration.
16:44Licensersadly not :( it's my biggest clojure project yet
16:45Licenserand since I don't know where it is it's hard to isolate
16:45Licenserit's kind of a hen egg problem
16:45avarusa show stopper
16:45hiredmanLicenser: well, I think if you work it down to a small test case, you might get someone interested in looking at it
16:46Licenserhiredman: Yea I guess so :( it's just so hard to find the bug untill it is fixed :P
16:47Licensertime for more println debugging
16:47hiredmanthe compiler is not throw the NPE, something else is during compilation so it is being wrapped in a compiler exception
16:49Licenserhmm?
16:49hiredman#<CompilerException java.lang.NullPointerException (NO_SOURCE_FILE:0)>
16:49hiredmanthat is an NPE wrapped in a compilerexception
16:51hiredmanit might actually be a reader exception
16:53avarusa show stopper
16:53avarusoops :)
16:54Licenserhmm I try to track it down with println
16:57hiredmanLicenser: easiest would be println's in the Compiler
16:57Licenserin the Compiler o.O
16:57hiredmanCompiler.java
16:58LicenserSee if I touch the .java files I start clawing out my eyes :(
16:58stuartsierra Compiler Exceptions are almost always reader errors at some level.
16:58hiredmanwell, easiest if you are looking for the root cause, if you are looking for what to start to make a test case with, maybe not
16:59Licenserhiredman: yea but I'm not good at Java, I had no idea where to start looking
17:00hiredmanwell, paring it down to clojure code that reproduces is not a bad start either
17:01konrWhat's the clojure equivalent to sub("foo", "bar", "I'm going to the foo")?
17:01stuartsierraLicenser: The root cause is probably a syntax error.
17:01hiredman.replaceAll
17:01Licenserstuartsierra: but why does that show at runtime not at compile time?
17:02stuartsierramacros?
17:02clojurebotHoly Crap.
17:02stuartsierradelayed loading?
17:04stuartsierraeval?
17:04clojureboteval is evil
17:04Licenserno eval, I promise
17:05stuartsierraIt could still be something that isn't fully evaluated until runtime.
17:05stuartsierraI guess my point is, it's unlikely that there's a NPE bug in the Clojure compiler.
17:06stuartsierraIt's probably caused by trying to read/compile some bad code.
17:06stuartsierraYou just have to find where.
17:06Licenserstuartsierra: *nods*
17:09arohnerwhat's the best way to determine whether an object implements a protocol?
17:09stuartsierra(doc extends?)
17:09clojurebotExcuse me?
17:09stuartsierraIt's there, really.
17:09stuartsierra,(doc extends?)
17:09clojurebotPardon?
17:10stuartsierrabah
17:10arohnerstuartsierra: thanks
17:10stuartsierranp
17:13Licensergot a test case
17:13LicenserI actally think it IS a bug in clojure
17:13Licenser,(>= nil nil)
17:13clojurebotjava.lang.NullPointerException
17:13hiredmanwhat else would you expect?
17:13kotarakarohner: satisfies?, extends? is only for explicit extension via extend
17:13stuartsierraThat's not a bug.
17:13Licenserhiredman: wait wait
17:13Licenserso far so good
17:13Licenser(defn x [] (>= nil nil)); (x) should give a stack trace right?
17:14arohnerkotarak: ah, I was wondering why I couldn't get it to work
17:14Licensershould say I called (x) and then a NPE was caused
17:14hiredmanLicenser: I bet it's because >= is inlined
17:15eyerisDoes S.W.F.WebBrowser use the version of IE that is installed on the system at runtime, or does it represent a specific build of IE? My experiments make it seem like the former, but I get different results from IE8 on this computer and an embedded WebBrowser control in my app.
17:15arohnerkotarak: (ancestors (class foo)) works fine, except that if I'm in the ns Foo returns a map
17:15arohneroutside the NS, my.ns.Foo returns the class
17:15LicenserI'm not sure but I think it's a bug or am I mistaken?
17:15eyerisDoh, wrong channel :)
17:16kotarakarohner: I'm not sure what you mean, but you should probably use type instead of class.
17:16stuartsierraLicenser: I'm hesitant to call it a bug.
17:16Licenserwell there is a stack I call a function, x, if I def a to call x I still don't get a trace
17:17stuartsierraThe REPL never prints stack traces.
17:17hiredmanLicenser: the repl doesn't print full traces
17:17arohnerrun (.printStackTrace *e)
17:17metaperlI hope this is just a byte compiler error - http://pastie.org/827968
17:18Licenseruser> (.printStackTrace *e) => nil
17:18Licenserhiredman: there really is none
17:18hiredmanLicenser: not reproducable
17:18arohnerkotarak: if I'm in the ns that defines the protocol named Foo, Foo returns a map
17:18hiredmanI get a stracktrace here
17:18Licenserfor me it is, odd
17:18stuartsierraI get a stacktrace too.
17:18arohnerkotarak: outside the ns, my.ns.Foo returns the interface Foo
17:18Licenserhmm
17:18hiredmanactaully (use 'clojure.stacktrace) (e) makes it pretty clear where the problem is
17:19stuartsierraLicenser: (.printStackTrace *e) will print to *inferior-lisp*, not the SLIME REPL buffer.
17:19kotarakarohner: and the problem is? satisfies? should work anyway, no?
17:19Licenserah sneaky
17:20stuartsierraThat's what (clojure.stacktrace/e) is for.
17:20hamzai have src/leiningen/mytask.clj containing a function called mytask but calling lein doesn't show it also lein help mytask complains that it can not find leiningen/mytask.clj on the classpath?
17:20arohnerkotarak: oh. satisfies? works great. I missed it when reading your earlier comment. thanks
17:21Licenserahhh sneaky sneaky
17:21Licenserso it's actually a SLIEM problem not a clojure one
17:21stuartsierrayes
17:21stuartsierraThe fact that you don't see the stack trace is definitely a SLIME problem.
17:21Licenserokay learned something new again
17:22stuartsierraSometimes I test things outside of SLIME for just this reason.
17:23Licenserhmm someone knows the SLIME hompage so I can report that bug?
17:23LicenserGoogle oddly enough turns off blank
17:24stuartsierraSLIME doesn't care about Clojure.
17:24stuartsierraIt's written for Common Lisp.
17:24Licenserah found it
17:24hiredmanswank-clojure
17:24Licenseryea just found that homepage :)
17:28technomancyLicenser: it's a known bug that some things print to *inf-lisp* when they should go to the repl buffer
17:28technomancythanks for the thought though. =)
17:28technomancyswank IO is insane.
17:28Licenserthere we go, reported thank you hiredman & co
17:29hiredmanare you sure you can't find a real compiler bug?
17:29hiredmanthat would be fun
17:29Licensertechnomancy: the problem is not that (.printst.. *e) does not show, the problem is that the exeption window shows no trace at all
17:30LicenserI had a deeply nested function that caused NPE'ed cause of (>= nil nil) and it just told me 'no trace'
17:30stuartsierraIn nearly 3 years of production use, I've found exactly one bug in the Clojure compiler.
17:30technomancyoh, I see
17:31technomancyLicenser: there are so many bugs in swank-clojure that I really wish I had the time to rewrite it from scratch. =\
17:31stuartsierraAnd that was a Java interop issue.
17:31technomancyit's a mess.
17:31Licensertechnomancy: I know the feeling
17:31stuartsierraok, 2 bugs now that I think about it
17:32stuartsierraI'm off
17:32Licenserhiredman: I'd love to find a compiler bug :P I'm sorry my bug is just a swank problem
17:32hiredman:/
17:32Licenserso I'm kind of glad I didn't tried to debug Clojure.java :P that'd had not helped much
17:32technomancystill not sure I've convinced rich that direct-binding all vars in namespaces that contain the string "clojure" is a bug. =(
17:32hiredman*sigh*
17:35rhickeytechnomancy: it's only namespaces that start with clojure, could easily be stars with clojure., but who is starting with clojure?
17:35technomancyrhickey: clojure-http-client and clojuresque do
17:35rhickeywith no prior segment?
17:36technomancyyeah
17:36technomancyit's pretty common
17:36rhickeyjust one segment>
17:36rhickey?
17:36hiredmanbleh
17:36Licenserso now to fix my actual problem
17:36hiredmansingle segment is a bureport waiting to be filed
17:36hiredmanbug report
17:36rhickeyright
17:37technomancyoh hang on; it's not single-segment
17:37technomancyit's clojure.http.client
17:37technomancyjust no segment prior to "clojure"
17:37rhickeywell, who gave them the right to clojure?
17:37rhickeylike me calling my ns java.something
17:39rhickeyanyone putting anything under clojure that is not part of clojure deserves to break
17:39technomancywell there's still the issue of wanting to rebind clojure.test vars
17:40rhickeytechnomancy: we've discussed that
17:40technomancyyeah, last time we talked I thought I had a workaround, but the fact that it's done so early means there's really no way to get at it
17:40rhickeytechnomancy: I thought you needed a patch to test so it would officially be dynamic in that area
17:41dakronewhat repository does leiningen try to pull its dependencies from again?
17:41hiredmanclojars and build.clojure.org, and maybe the official maven 2 repo?
17:42dakroneokay, I'm assuming the official maven 2 repo is http://repo1.maven.org/maven2/ right?
17:42hiredmandakrone: http://github.com/technomancy/leiningen/blob/master/src/leiningen/pom.clj#L83
17:42technomancyrhickey: well ideally I wanted to be able to experiment with rebinding it to make sure it was useful and worked well before submitting the patch, but I can do that if you don't have any plans for fine-grained direct-binding-control in the near future.
17:42dakroneis there a way to suggest jars to be included in the official repo? I'd like to have leiningen get the repos automatically for some dependencies for my project.
17:43jlillytechnomancy: any chance you plan on opening comments / accepting patches for http://riddell.us/tutorial/clojure/clojure.html ? clojure-contrib now uses maven, not ant.
17:43dakroneI'm not sure even who maintains the official maven repo, is it apache?
17:43abrenkdakrone: http://maven.apache.org/guides/mini/guide-central-repository-upload.html
17:43rhickeytechnomancy: direct binding is still just an experiment
17:44technomancyjlilly: no, it's not my site. I've had trouble with people getting confused about swank from that site too though; I'd like to see it updated.
17:44dakroneabrenk: thanks, drat, looks like you have to be the owner of the project in order to submit it
17:44technomancyrhickey: understood. I do think it's a good idea as long as there are workarounds.
17:44hamzawhen multiple functions are send to an agent are they handled in parallel or one after the other?
17:45jlillyIts a pretty well done guide, aside from being stale.
17:45hiredmanhamza: actions sent to the same agent are executed serially
17:46hiredmandakrone: you can push stuff to clojars
17:46hamzais that the case even if i send them using send-off?
17:46dakronehiredman: can I push java-dependencies for a clojure project, or is clojars for clojure projects only?
17:47rhickeyhttp://www.assembla.com/spaces/clojure/tickets/271-determine-direct-binding-policy-and-controls
17:48technomancyrhickey: great; thanks
17:49technomancyseems like using ns-level metadata would work
17:49technomancysince redefining a namespace with ns leaves the old metadata intact
17:50technomancyyou could vary-meta to turn off direct binding, then force a reload of the namespace
17:50technomancybut that would require a fix for #130; losing ns-level metadata during AOT
17:50hiredmandakrone: you can push any jar
17:51hiredmanas long as you have a pom for it
17:51dakronealright, I will attempt to make a pom for this, thanks for the info hiredman
17:54hiredmandakrone: generally if you are not the primary source of a project you put upload it to clojars under org.clojars.username/projectname
17:54dakronehiredman: okay
17:54jlillytechnomancy: I messaged the guy on github. If he responds, I'll mention the other swank-clojure thing is out of date as well.
17:55hiredmanhttp://clojars.org/org.clojars.hiredman/fnparse
17:59hiredmanclojurebot: ticket #270
17:59clojurebot{:url http://tinyurl.com/yaeskfd, :summary "defn-created fns inherit old metadata from the Var they are assigned to", :status :new, :priority :normal, :created-on "2010-02-14T03:05:14Z"}
18:00hiredmanis that actually a bug?
18:00hiredmanoh, I see it was dicussed in the group
18:01hiredmanI guess I'd better go read that
18:41hamza,(doc add-watcher)
18:41clojurebot"([reference send-type watcher-agent action-fn]); Experimental. Adds a watcher to an agent/atom/var/ref reference. The watcher must be an Agent, and the action a function of the agent's state and one additional arg, the reference. Whenever the reference's state changes, any registered watchers will have their actions sent. send-type must be one of :send or :send-off. The actions will be sent after the reference's state is
18:42hamzaadd-watcher doesn't seem to be in docs is it depricated?
18:44rhickeyhamza: yes
18:45rhickeyuse add-watch
18:46hamzarhickey: thanks..
19:02arohnercan I use extend to make my deftype implement an interface, or do I have to do that when I define the deftype initially?
19:09rhickeyarohner: extend is for protocols only. I can't fix interfaces :)
19:10arohnerrhickey: thanks
19:11arohnerrhickey: I'm trying to make my deftype implement IFn. I find it annoying to have to specify invoke(), invoke(arg1), invoke(arg2), apply(). It would be nice if I could just give deftype a fn and say "go implement IFn, using f for all calls"
19:12dsopurgs backlog is huge
19:14arohnerI can write a macro, but it's sort of ugly
19:35konrWhitespace """code""" generation in clojure: http://pastebin.com/f6366f934
20:20hamzais there a way to determine if await will block for an agent or not?
20:23rhickey.getQueueCount
20:27hamzathanks..
20:28rhickeycells in progress: http://gist.github.com/306174
20:47jperrasrhickey_: cells? (pardon the dumb question)
20:48fanaticojperras: http://clojure-log.n01se.net/date/2010-01-22.html#09:22a
20:48jperrasfanatico: grazi
20:50fanaticonp.
20:55hamzais there a technique that will allow jobs send to an agent to run in parallel (multiple agents underneath?) but still can be able to await for them using master agent?
21:04slyphoninside of a genclass impl method, how does one access "this"?
21:10chouserslyphon: the first arg to each function is the "this"
21:11chouserhamza: you might consider using promise/deliver or a CountDownLatch
21:12slyphonchouser: oh
21:13hamzachouser: will checkout promise/deliver, i would rather use a clojure idiom.
21:14slyphonchouser: "state" is basically something that gets associated with an instance of your generated class?
21:14slyphonfor keeping track of instance-local state?
21:15dnolenso are there any example of what a cells operation would look like? having a hard time making a picture of it in my mind :) I understand the transient persistent! pattern well enough.
21:17chouserhamza: using java.util.concurrent classes for workflow is absolutely acceptible.
21:18chouserslyphon: right, it's the one instance field you get
21:18slyphonchouser: how do i access it from my -methods?
21:18slyphonjust 'state' ?
21:18chouserif (.state this)
21:18slyphonahh
21:19chouserassuming you named your state "state" and your this "this" of course. ;-)
21:19slyphonhah
21:19slyphon:)
21:21Drakesonhow can I use a value that is local to the user of a library?
21:26metaperlThis #^x syntax is being used before it is described.... what is going on here - #^{:x x} [x y 3]
21:30hiredman#^ is a reader macro for with-meta
21:30hiredman,(meta #^{:x 1} [1 2 3])
21:30clojurebot{:x 1}
21:31hiredman,(meta (with-meta [1 2 3] {:x 1}))
21:31clojurebot{:x 1}
21:34metaperlI see.
21:34metaperlNow.
21:34rhickey_added some usage: http://gist.github.com/306174
21:34metaperlCould someone please show me what to type in the REPL to get the mymax function to execute - http://www.screencast.com/users/metaperl/folders/Jing/media/4d3f39e2-6fa8-40c6-b779-49bd00a42597
21:34metaperlit just returned the list
21:38wiligIs there a way to retrieve more then one keys value from a hash? (let [a {:one 1 :two 2}] (a :one :two))
21:38metaperlI will ask my question on the enclojure google group
21:39hiredmanmetaperl: a list is a single collection of things, and for a single thing, the mymax function just returns whatever you pass it
21:39metaperloh the [x] x pattern match
21:40metaperlis what fired
21:40hiredmanclojurebot: destructuring
21:40clojurebotdestructuring is http://clojure.org/special_forms#let
21:40hiredmanmetaperl: it's not a pattern match
21:40hiredmanit is simple arity based dispatch
21:40dnolenrhickey_: thx, and wow! so what is the difference between cell/locked-cell. locked-cell can be used safely in a multi-threaded situation and cell can't?
21:40fanatico,(let [a {:one 1 :two 2}] (map a [:one :two]))
21:40clojurebot(1 2)
21:40rhickey_dnolen: right, locked-cells support multiple threads
21:41hiredman,(let [{:keys [a b]} {:a 1 :b 2}] [a b])
21:41clojurebot[1 2]
21:44metaperlok it worked as expected when I simply passed the values as arguments. Is there an advantage to writing functions that dont expect a list when they will be operating on multiple values? Why was the mymax function written so that its args were "inlined" as opposed to provided in a list?
21:47dnolenrhickey_: so cell might be useful in divide an conquer scenario where you know which threads will operate on which partitions of a java array?
21:47slyphonhrm
21:48slyphonso there's a protected method 'setName' in the class i'm inheriting from, do i need to say :exposes-methods {setName superSetName} then do (defn -setName [this n] (.superSetName this n)) ?
21:48rhickey_dnolen: not exactly. different threads could feed a single new value. the cell will make sure they don't step on each other
21:49dakronewhat's leiningen's supported test framework? Just (test ...) on things? I noticed test-is isn't supported yet
21:49rhickey_i.e. maybe a bunch of threads are processing input and building a single map
21:49slyphon(bean my-inst) actually shows a :name key, so i guess i could just use that
21:49metaperlwell, never mind about my question. I'm going to sleep. I got a good start tonight
21:51dnolenrhickey_: wait so *both* cell/locked-cell are about serializing mutable access?
21:52rhickey_dnolen: sorry - I didn't realize you were trying to distinguish cell from cells in general. cell is just to ensure the access to the transient will occur in only one thread
21:52wilighiredman: perfect, thanks.
21:53rhickey_cell also manages the transition to/from transient
22:02dnolenrhickey: nice, so this is a general way to deal POJOs (arrays, mutable things from Java libs). Put it in a cell, sit back, enjoy Clojure's sane concurrency support.
22:02dnolenthis is -> this is also
22:03rhickey_dnolen: it is the first of the constructs that can be extended to POJOs that aren't otherwise persistent. There are still advantages to the persistent/transient pairs, as generating intermediate and terminal values is much less expensive
22:50lancepantzanyone know anything about http://github.com/joshua-choi/clojure-yaml/
22:50lancepantztrying to figure out if i should use that a java lib for yaml
22:51lancepantzkinda surprised there's nothing in clojure-contrib
22:54slyphon#<CompilerException java.lang.IllegalArgumentException: No matching field found: state for class clojbot.Clojbot (REPL:14)>
22:54slyphonhrm
22:55slyphoni'm trying to call (.state inst) after creating an instance of my gen-class
22:55hiredmandid you tell gen-class to make such a field?
22:56slyphon:state state
22:56slyphonlemme do a fresh compile
23:04slyphonah, there we go
23:10slyphonwhen you recompile, do existing instances see the new methods?
23:11slyphonwait
23:12lancepantz"Could not find clojure.lang.Compile. Make sure you have it in your classpath" <------ means clojure.jar is not in my classpath, correct?
23:12slyphonsounds like it
23:14lancepantzwhat if it is though, anything else that could cause that?
23:16lancepantz:)
23:16lancepantzthis is the stuff i hate about java
23:16slyphonheh
23:39durka42~def generate-class
23:40durka42holy crap
23:48DrakesonIncanter in clojars seems a bit out of date. Is there a more up-to-date repository for incanter?
23:55slyphonso, if the class i'm inheriting from has a protected method setFoo, how do I expose that to consumers of my subclass
23:55slyphoni'm trying :exposes-methods but i'm not having much luck