#clojure logs

2010-05-02

00:02mmarczyksome points in the discussion where interesting, though; I'm not always clear on why some switches from data structure A to data structure B that were mentioned (from both sides) would ever make sense, so I guess I might ask some time in the future, when emotions subside :-)
00:05rhudsonRich seems to want to make it clear when you're buying into O(n)
00:06_atoPersonally, when new to the language I would actually have expected 3 functions: (defn contains? [coll x] (some #(= % x) coll)) (defn has-key? [coll k] (not= (get coll k ::fail) ::fail)) (defn has-value? [coll x] (some #(= % x) (vals coll)))
00:06mmarczykhas-key? strikes me as a particularly reasonable name :-)
00:06mmarczykand if it has one, then of course I can get it
00:07rhudsonYeah, has-key? is good
00:07_atowhere of course contains? doesn't really make sense for use on associative structures
00:08mmarczykI sort of got used to thinking about it as testing whether the domain of the function which is represented by the given structure has a particular item as an element
00:09mmarczykso I'm sort of fine with that, but... it strikes me as rather convoluted when I actually try to express the idea (as above)
00:11mmarczyk_ato: incidentally, I had two questions in relation to clojars: (1) how about putting up a "browse repository" link to clojars.org/repo/; (2) would it be possible to put a link to a "project page" for each jar in the pom and then display that on the jar's page?
00:12mmarczykfor (2), I know next to nothing about maven, but if it should be possible, I could learn enough to write patches for lein & clojars
00:13mmarczykand also, thanks for keeping the site live! that (together with the fact that people actually use it) is the single claim Clojure has to pushing things forward in the infrastructure department :-)
00:14_ato(1) good idea, I'll do that now. (2) yes there's a field in the pom format for that, which I'd like to use.
00:15_atoThis is a mockup of what I'd like to do next with the per-jar pages: http://meshy.org/~ato/clojars-wip.html
00:15sexpbot"Clojars"
00:15mmarczykoh, great, that's much better :-)
00:16mmarczykI take it the pom can have pretty much arbitrary stuff put into it, then?
00:16mmarczykor is the info meant to come from elsewhere?
00:17_atoI can't have arbitrary stuff. it has fields for homepage url, mailing list and commits. Dunno how yet to get data in for "tutorial", "screencast" links, maybe just a web interface to add links to the pages
00:17_ato"autodoc" I'm going to generate for all jars :)
00:17_atoas long as I can get the sandboxing to work
00:18_atoI'd also like to investigate some sort of better browse, rather than just a big alphabetical list
00:18_atosome sort of categories or wiki type thing
00:18_atonot sure I'm going to get around to it soon though
00:20_atoI'm not hugely satisfied with the way Python and Perl do browse either: http://pypi.python.org/pypi http://www.cpan.org/modules/by-category/
00:20sexpbot"Python Package Index : PyPI"
00:20_atobut maybe that's the best that can be done without a lot of manual curation work
00:20mmarczykright
00:23_atobut yes, if you'd like to submit a patch for leiningen that adds fields for homepage (mailing list and license would be nice too) please do.
00:23mmarczykI would
00:23mmarczykI'll look into it in the coming week then
00:23_atothe full list of fields pom supports is here: http://maven.apache.org/ref/2.2.0/maven-model/maven.html
00:23sexpbot"Maven Model - Maven"
00:23mmarczykgreat, thanks
01:03technomancy"it does what it says on the tin."
01:04technomancyand I wish "some" were renamed/aliased to "any?"
01:04technomancybut I really like =?
01:05technomancy=fn might work too (in order to counteract "things are getting a little too perlish" claims), but I like =? better
01:08technomancy_ato: nice; I've been wanting an "other versions" listing for a while now
01:11technomancyjoshua-choi: the problem with autodoc is that it depends on an old version of clojure
01:11technomancylein plugins shouldn't depend on clojure at all; those dependencies are implied
01:11technomancyreplaca: ^^
01:12technomancyjoshua-choi: you could check out autodoc yourself, do the fix, and do lein install while you wait for it to be fixed upstream
01:12technomancyor it might work to remove the old versions of clojure from lib/ (or lib/dev if you're bleeding-edge lein), but you'd have to do this every time you re-ran lein deps
01:15joshua-choitechnomancy: I see; that's unfortunate. Thanks for the answer.
01:18mmarczyktechnomancy: which version of =? do you like?
01:18joshua-choiFor anyone using FnParse, I'm finally done with the antepenultimate stage of FnParse 3. Once I generate Autodoc documentation, beta testing begins.
01:19mmarczykjoshua-choi: cool :-)
01:19joshua-choimmarczyk: Thanks. :)
01:20technomancymmarczyk: wasn't aware there was more than one. I like =? meaning "return a predicate for equality to the argument."
01:20technomancywhat was the other version?
01:20mmarczyktechnomancy: not really, I was just thinking of extending it to something like oneof? to check equality to one of a bunch of arguments
01:21technomancyI suppose since equal takes varargs that might make sense in parallel
01:21technomancyit's rarely used though
01:21technomancyoh, that's different though; = is allof? rather than oneof?
01:22technomancybut for that you have sets already
01:22mmarczykright on allof?
01:22mmarczyksets, sure, but they're equaly good for testing = to one arg
01:22mmarczykwith less typing
01:23technomancytrue. I'd have to see it in action
01:23mmarczykunless you've got nils or falses, which is the interesting case where a function might add value over a set -- in addition to sugaring things a bit, of course
01:24technomancythere's something to be said for more specific versions just for purposes of clearer intent
01:24mmarczykno argument about that :-)
01:24mmarczykI actually like #{x} for checking whether x is contained (:-P) somewhere (values-wise)
01:25mmarczykto the point where I'm not sure I wouldn't prefer (#{x} x) to return true / false
01:25technomancyI would like that if "some" had a better name. strikes me as an anachronistic CL-ism.
01:25mmarczykI've yet to see an added benefit to (#{x} x) returning x
01:25mmarczykas written now, it's not a predicate
01:26mmarczykthus no ? makes sense
01:26technomancygenerally (and this changes now with the new keep function) predicates are OK with any truthy values
01:26technomancythere has historically been no reason predicates should return booleans
01:26mmarczykwell that's a Scheme convention
01:27technomancy(keep now being an exception to this rule)
01:27mmarczykand I thought it was being followed in the Clojure world
01:27kencausey"The Clojure conditional system is based around nil and false, with nil and false representing the values of logical falsity in conditional tests - anything else is logical truth."
01:27kencauseyhttp://clojure.org/data_structures
01:27technomancyI wasn't fond of map-indexed until I realized it was 5x faster
01:28technomancythen I realized I could deal with it. =)
01:28mmarczykkencausey: sure, but I still think there's a convention at work here
01:28technomancykencausey: that's not true anymore; "keep" will keep false values and only discard nil.
01:28mmarczykseq-contains? was written to be a predicate, I believe
01:28mmarczykI mean there was an (if blah true false) form in it
01:29mmarczykalso, I'm really under the impression I've read about the ? convention applying to Clojure somewhere... need to look it up
01:29mmarczykand in Scheme a predicate could contain anything other than #f for true, yet they always coerce truthy values to #t
01:30technomancy? definitely implies predicateness, but IME predicateness really only means truthiness matters
01:30technomancywhich is why you can say things like "use this map as a predicate"
01:30kencauseytechnomancy: I'm speaking out of turn really, but one exception does not discard a general rule.
01:30technomancykencausey: yeah, I'm actually arguing for the rule
01:30technomancyI think the exception is confusing.
01:31mmarczykProgramming Clojure, page 52: "A predicate is a function that returns either true or false."
01:31mmarczykso that's were I remembered it from
01:31hiredman*snort*
01:31mmarczyknot sure if I have a personal opinion on that, though
01:32kencauseywell, there are occasions in which you need to distinguish between false and null, not to mention occasions when you just need a truly distinct sentinel.
01:32kencauseyI'm too green with clojure to even be sure of what is meant by the keep function.
01:32technomancykencausey: agreed; I just think those don't belong in general functions like keep.
01:33mmarczykif you're calling a predicate, then you certainly won't be doing anything with the return value other than using it as a boolean, so it probably wouldn't be a problem to have nil returned
01:33technomancybut I don't really want to argue about it because Rich has been getting a lot of undeserved crap recently =)
01:33kencauseyyes, I don't understand why there is an exception there
01:33technomancymmarczyk: yeah, that's the way I see it
01:33mmarczykotoh, if you were to store the return value somewhere -- say, build a map whose values where the return values of various predicates -- you might not want huge objects stored
01:34mmarczyklike what (some #(= % huge-object) sequence) might return
01:34mmarczykso since you're not supposed to care about what huge-object if it's just a predicate anyway
01:34mmarczykno harm in casting to Boolean inside the predicate
01:34technomancywell, technically some only returns the first value
01:34technomancy(did I mention it's terribly-named?)
01:35hiredmanIBool
01:35mmarczykactually I misrepresented my idea
01:35technomancy"some" implies plurality, but only one element is returned
01:35mmarczyk(some #{huge-object} sequence) might return something huge
01:35mmarczyktechnomancy: ok, I've got it finally
01:35hiredman(extend IBool nil {:bool (constantly false)})
01:35mmarczykso, yeah, either have some?
01:35mmarczykor something without ?, but not some
01:36technomancy"any?" is a much better name for it
01:36mmarczyk(I could have used some "s to make myself clearer :-()
01:36mmarczykand none? is a much better name for not-any? :-)
01:38mmarczykthough as soon as any? -- hypothetically -- got adopted, not-any?'s value as a name would increase
01:39mmarczykas for map-indexed, I realise it might be much faster than (map foo (indexed bar)), but I view it as an unfortunate product of the present-day compilation infrastructure to merge ops etc.
01:40hiredman"blah blah blah sufficently smart compiler blah blah blah"
01:40mmarczykincidentally, map-indexed is basically just a way to avoid consing
01:41Licenser_moin
01:41mmarczykhiredman: I know how it sounds, but this particular feature is available at least in GHC afaik
01:42mmarczykof course Haskell is a pure language *and* it's own platform, which might be a necessary combination of properties for this sort of magic
01:42hiredmanhaskell compilers have control off everything down to the metal
01:43mmarczykyeah, that's what I mean by "its own platform"
01:43hiredmanthe clojure compiler is there to generate bytecode and hand it off to the jit
01:43mmarczykfair enough, I have no problem whatsoever with it
01:44mmarczykbut I pity the poor indexed, currently deemed an inferior primitive
01:44hiredman*shrug*
01:44hiredmanI recommend just not using it
01:44mmarczykmap-indexed doesn't take multiple sequences, for one thing
01:44hiredmanthen don't use that
01:45mmarczykso that's something that might usefully change
01:45mmarczykwell I'm not really complaining, you know
01:45mmarczykextending map-indexed to handle multiple seqs at some point seems like a valid feature request to me
01:48mmarczykok :-)
01:49hiredmanit would be really cool if amazon had some kind of map/reduce search api so I wouldn't have to use their crummy website
01:50mmarczykI notice that I only use indexed once in my code, to solve Euler 50 :-)
01:51mmarczykI wonder if I'm in some sort of special debating mood (euphemism?) if I find it possible to consider at length a function I've apparently used one single time outside of the REPL *sigh*
01:54mmarczykbtw, wall-hack-method is back :-)
01:54hiredmanhah!
01:54mmarczyklovely :-)
01:55mmarczykone naming issue going my preferred way for now
03:04Licenser_hmm proxy allows anonymous classes, there was a way to make non anonymous ones right?
03:17replacaLicenser_: gen-class
03:18gerryxiaohello
03:19Licenser_replaca: but gen-class is ugly :P there isn't another way I guess
03:20gerryxiaoi have resources/images/file.jpg under project file dir, use what dir/file name as file name when using file.jpg in clojure src?
03:20gerryxiaoi have use images/file.jpg, but not work with lein
03:21ChousukeLicenser_: gen-class and deftype/defrecord are the only things that generate non-anonymous classes.
03:21Licenser_okay thank you *looks into deftype since he didn't ever got gen-class to work*
03:22Chousukein general though, you should be coding to an interface so that the name of the class doesn't matter.
03:22gerryxiaolein package files as images/***.jpg, but java couldn't find it
03:22Licenser_Chousuke: my thought being that a lot of this swing data model stuff is based on eachother
03:22gerryxiaoi have to use "resources/images/file.jpg" as file name?
03:22Chousukegerryxiao: I think "@images/file.jpg" or something
03:23gerryxiaoChousuke: not work
03:23Licenser_so if I implement List model (for example) I'd not need to 'reimplement' the same code for ComboBoxModel since it extends list model
03:23Licenser_of cause I also could make it a macro but that'D get uglyish I nthink
03:23Chousukegerryxiao: then check if the resources directory is added to classpath
03:24gerryxiaoi'm using lein which should care about classpath for me
03:24ChousukeLicenser_: swing is unfortunately designed like that :P gen-class is probably your only option
03:24Chousukegerryxiao: right. check whether it actually does.
03:25gerryxiaoChousuke: howto?
03:25hamzagerry I had the same problem with lein, when testing images can be accesed using resources/images/some.png but in jar they are images/some.png so i use (ClassLoader/getSystemResource "file") check both places which ever returns the url.
03:25hamzaif file is not found it will return null
03:25hamza*nil
03:25Chousukegerryxiao: (System/getProperties "java.class.path")
03:29Licenser_Chousuke: I know swing is ... odd at times
03:30Licenser_I managed to get around some of the things by macro mojo but well
03:32gerryxiaoi have to check java docs ;)
03:33Chousukeyou could probably use some reflection hacks to figure out the generated class name at runtime and derive from that :P
03:33Licenser_lol that sounds ugly
03:33Chousukeyes it is :P
03:34Chousukebut it should work, as long as the proxies get evaluated in order
03:34Licenser_heh
03:35Licenser_well I think the macro mojo is less ugly
04:25replacaQ: what's the magic for leaving off the namespace on a symbol in a syntax quote?
04:27hoeck~'foo
04:27clojurebotIt's greek to me.
04:28replacahoeck: thanks!
04:28hoeckyw!
04:29replacadon't think that's actually documented anywhere (or if it is, it's well hidden!)
04:32bsteuberreplaca: it kind of follows from the rules of ` and ' but yeah, some "official macro-writing guide" for this would be nice :)
04:40replacabsteuber: yeah, I get it when I see it, but... :-)
04:42bsteuberyeah, it also took me a while to find out :)
04:48Chousukeheh
04:49Chousukeit's more apparent if you write it as ~(quote foo)
07:51raek,`_
07:51clojurebotsandbox/_
07:52raekis there any reason why _ becommes fully-qualified?
07:54kzarWith swing when does paintComponent get run?
07:56hamzaAFAIK once when the object is created and on consequtive repaint calls.
07:57Licenser_raek: because of the
07:57Licenser_`
07:57Licenser_`,'_
07:57Licenser_,'_
07:57clojurebot_
07:57kzarhamza: So if paintComponent for my panel is never being called I guess I haven't added it to the frame properly?
07:59Licenser_kzar: if you have an example for me on how you use swing I'd be very glad, I'm currently working on clj-swing a clojure wrapper for swingy stuff
08:02kzarLicenser_: http://paste.lisp.org/display/98667 although it's not working
08:03kzarI was trying to get this donut example working http://zetcode.com/tutorials/javagamestutorial/basics/
08:03sexpbot"Basics"
08:03kzarLicenser_: I can't wait till your wrapper is ready
08:04Licenser_kzar: me neither :P
08:04raekhrm, how do I turn (1 2 3 4 5 6 7) into ((1 2 3) (4 5 6) (7))?
08:04Licenser_raek: partition
08:04Licenser_,(partition 3 '(1 2 3 4 5 6 7))
08:04clojurebot((1 2 3) (4 5 6))
08:04hamza,(partition 3 [1 2 3 4 5 6 7])
08:04raekpartition either requires padding or drops the last
08:04clojurebot((1 2 3) (4 5 6))
08:04Licenser_,(partition 3 nil '(1 2 3 4 5 6 7))
08:04clojurebotjava.lang.RuntimeException: java.lang.NullPointerException
08:04Licenser_,(partition 3 3 nil '(1 2 3 4 5 6 7))
08:04clojurebot((1 2 3) (4 5 6) (7))
08:04Licenser_that was it
08:04raekah
08:05raekthanks!
08:05hamzakzar: in your paint method, graphics object does not have getSize method.
08:06hamzapaint-donut is called but it throws an exception
08:06kzarHow come it didn't throw an exception for me?
08:06Licenser_kzar: you're using emacs right?
08:07hamzano idea, Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: No matching field found: getSize for class sun.java2d.SunGraphics2D
08:07Licenser_look in the inferior-lisp buffer
08:08kzarIt didn't show up there
08:09kzarNo that's weird, no exceptions for me. Also I removed the getSize bit and just passed a with + height over and it still doesn't seem to draw the panel.
08:10kzar(Yea I'm using semacs)
08:10kzars/semacs/emacs/
08:10sexpbot(Yea I'm using emacs)
08:13Licenser_kzar: you're up trying clj-swing out? if I see how it is used chances are it might get better quicker :P
08:15hamzakzar: http://paste.lisp.org/display/98669 working..
08:15hamzayou missed g when calling rotate.
08:32nurvHi.
08:32Licenser_so wie siehts aus in windoof :)
08:34Raynes$trans de en so wie siehts aus in windoof :)
08:34sexpbotLooks like in windoof:)
08:34RaynesDid I get the wrong language? :o
08:34RaynesOr does google translate really just suck that bad?
08:35kzar$trans jp en nan deska?
08:35sexpbotLanguages not recognized.
08:35Rayneskzar: ja
08:35kzarLicenser_: Yea I'd love to try it
08:35RaynesI think.
08:35kzar$trans ja en nan deska?
08:35sexpbotnan deska?
08:36Chousukeyou probably need to input the actual japanese
08:37Chousuke$trans ja en 何ですか
08:37sexpbotWhat
08:38Licenser_Raynes: yes
08:38RaynesIt's 100 degrees if it's 1 in here. :|
08:39Licenser_kzar: I'll gladly go over your results and try to make things more clojury from the framework
08:40kzarhamza: Ah tanks
08:40kzars/a/ha/
08:40sexpbothhamzha: hah thanks
08:40kzaroops
08:41Chousukeheheh
08:41kzarhamza: Are you using Emacs / what environment are you using? I'm curious how you got exceptions thrown but I didn't
08:44hamzakzar: i am using emacs with inferior-lisp
08:45kzarHmm wierd
08:54kzarLicenser_: Does it need Clojure 1.2, I'm using 1.1
08:55Licenser_yea it's 1.2 :(
09:09Licenser_,(println ",(+ 1 1)")
09:09clojurebot,(+ 1 1)
09:17arjhello. I have a wierd hard to trigger problem in my compojure web project. It seems to be something related to seq and filter. I have tried to write down everything I could about the problem here: http://stackoverflow.com/questions/2748087/stackoverflow-in-compojure-web-project
09:17sexpbot"StackOverflow in compojure web project - Stack Overflow"
09:18arjI can't seem to figure out why this bug happens, it's very random so it's very hard to reproduce
09:49raekthought I might share this: http://gist.github.com/387097
09:49raekit's a cond-like macro using if-let and re-find
09:50raekeach clause is a [regex bindings body] triple
09:51raekif the string matches the regex, then vars in bindings are bound to the groups of the match and body is evaluated
10:06raek~exceptions
10:06clojurebothttp://paste.lisp.org/display/74305
10:14leifwhey
10:14leifwwhat is a portable (across versions) way to check for regex match?
10:14leifwI had been using (if (re-seq pattern string) ...)
10:15leifwbut when I went (backward) from 1.2 to 1.0, re-seq started returning () instead of nil for a non-match
10:15leifwwhich broke *everything*
10:15leifwis there a "correct" way to do it?
10:15leifwre-matches perhaps
10:18Licenser_leifw: re-find?
10:18Licenser_also (empty? (re-seq ...)) should work too
10:22leifwthanks
10:24leifwre-find is what I was looking for
10:24leifwdammit I was using that earlier and forgot about it :-/
10:28leifwraek: yeah, it's like haskelly pattern matching for strings :)
10:29raekI also made a cond-like macro based on that pattern: http://gist.github.com/387097
10:29raek(I posted it here some minutes ago, sorry for spamming...)
10:29bosieanyone ever managed to use java source classes directly in clojure?
10:30raekwell... yes
10:30raek,(.toUpperCase "foo")
10:30clojurebot"FOO"
10:30bosieraek: but that's not the source, that is a binary
10:30raekah, I see
10:31raekthey have to be compiled before clojure can use them
10:31bosiecrap
10:31raekbut as long as the .class files are on the classpath, you should be able to use them
10:33bosieoh
10:34raekdo you need to include some java source in your clojure project?
10:34bosieyes
10:35raekthe new deftype and defrecords solve the problem I've had with needing java code so far
10:35raekbut they're still in the alpha version
10:35raekwhat classes do you need? Exceptions?
10:36bosieraek: no, i wrote an xml parser in java, which i need to ... parse the xml files ;)
10:36Licenser_proxy often works too
10:36Licenser_rewrite it in clojure :P
10:36bosieit is already too slow in java ;)
10:37Licenser_bosie: it might get faster in clojure
10:37raek"There are several plugins for Leiningen in Clojars repository. These plugins implement different functionality — automatic uploading of code into Clojars repository, building of Java source code, etc."
10:37Chousukeare java's built in parsers too slow as well? :/
10:37Licenser_speed is 10% about language 90% about algorithm
10:37raeksaw this...
10:37bosieChousuke: very
10:37rhudsonbosie: Is there some reason you didn't use one of the standard Java XML parsers?
10:37Licenser_raek: did a post on the plugins
10:37Licenser_http://blog.licenser.net if you are interested
10:37sexpbot"lice!"
10:37raekah, nice
10:37bosierhudson: it is quite slow to be honest, esp. since you have to go over it again
10:38rhudson?
10:38Licenser_bosie: how big are your files?
10:38bosieLicenser_: between 100kb and 3mb
10:38Licenser_that shoulodn't be too bad
10:38bosierhudson: you parse it and then you have to tokenize the text etc
10:38bosierhudson: i read it into a char array and do it while i read it from the filebuffer
10:39bosieLicenser_: not if you parse 27million xml files ;
10:39bosie)
10:39Licenser_bosie: parse n of them in paralell :P
10:39Licenser_and why would you want to do that?
10:39bosieLicenser_: 128 of them in parallel actually
10:39Licenser_hmm that might be too much
10:40Licenser_if you read 128 in paralell IO will liely bekomm a bottleneck
10:40bosiebecause of the disc?
10:40bosieyead
10:40bosieyea
10:40Licenser_and unless you're running sparc you likely don't havfe 128 cores :P
10:40bosiewe will see
10:40bosiei have 128 cpus
10:40bosie;)
10:40Licenser_cpu's or cores?
10:41bosiecpu
10:41Licenser_that still isn't too good
10:41bosiehm?
10:41Licenser_rather make 128 chunks of files and pass each cpu one chunk
10:41Licenser_well small talks don't paralelizes good
10:41Licenser_but I've to go
10:41bosieLicenser_: yea
10:41Licenser_bosie: I'll be back in a bit, I
10:41Licenser_'ll talk to you later promised
10:42Licenser_once I'm out of the office
10:42bosieLicenser_: but without testing the theories, i am just guessing... so i need runnable code first
10:42Licenser_*nods*
10:42bendlasHi
10:42Licenser_well I'll ba back in a bit
10:44bosiei compile my java files, put the parser into the classpath, do a little (import '(parser.FileParser))
10:44bosie(new FileParser) fails, being not able to resolve the classname
10:45rhudson(import '(parser FileParser))
10:45raek'(parser.FileParser) is the empty prefix list
10:46raek(import 'parser.FileParser) also works
10:46bosieneither works
10:47raekis the source compiled? is the .class files in the classpath?
10:47bosieyes and yes
10:47raekdoes import fail?
10:47bosieno
10:47bosiewell yes with 'parser.Fileparser it does
10:48raekthen clojure cannot find it in the classpath
10:48raekare you using leiningen?
10:48bosieno
10:49bosiei manually set the classpath with "java -classpath...."
10:49raekhow do you start the repl?
10:49rhudson../parser is in your classpath?
10:49raekthe directory above parser needs to be in the classpath
10:49bosierhudson: as an absolute path
10:49rhudson(i.e. the directory containing your 'parser' dir)
10:50bosieyes, the directory containg 'parser' is in the classpath
10:51raekwhat does the import exception say?
10:51bosiei went with rhudson's version and it says: Exception in thread "main" java.lang.NoClassDefFoundError: parser/FileParser (wrong name: FileParser) (main.clj:1)
10:53rhudsonDoes your FileParser.java say "package parser;" ?
10:53bosieidea is able to pick it up
10:53remleduffIs FileParser actually in the "parser" package?
10:53bosieit is
10:55remleduffFileParser.java has the "package parser;" line, it's located in "classes/parser/FileParser.class" and "classes" is in your classpath?
10:55raeklooks like it finds the .class file...
10:56bosieremleduff: it is not located in 'classes/parser/', is the word classes that important?
10:56remleduffNo
10:56remleduffJust the structure needs to match
10:57bosiethey do
10:57bosieand since La Clojure is able to pick it up i guess i am doing something wrong with the export
10:58remleduffHmm, FileParser is a public class?
10:58bosieremleduff: of courrse
10:59rhudsonAre you saying in works in IDEA, but not standalone?
10:59bosierhudson: that is what i am saying
11:02rhudsonWell, the IDEA Run command shows you the command line it's executing -- you could compare that to what you're doing standalone.
11:03bosierhudson: ok, i miscommunicated. it works in the editor of idea but neither standalone nor in the run command
11:03bosiebut thanks guys, i will dig into it once i have more time
11:03rhudsongood luc
11:20parasebaHi, I know the following wont work, but is there any way I can get the same effect?: (apply new MyClass [arg1 arg2 ...])
11:21parasebaI mean, expand an array of arguments into a constructor call
11:22replacaparaseba: (apply #(MyClass. %1 %2 %3) [a1 a2 a3]) if you know the number of args
11:23parasebareplaca: that's the problem, I need to call one constructor or the other based on the size of the arguments array
11:25remleduff(defn create-foo ([a b] (Foo. a b) ([a b c] (Foo. a b c)); (apply create-foo args)
11:25peregrine81paraseba: could you use a macro for that?
11:26replacaparaseba: yeah, I think remleduff has the best solution, unfortunately
11:27parasebaremleduff: no easier way to achieve that? I don't like writing one of those for each cardinality ...
11:27replacaparaseba: you could write a macro that used reflection to generate that function, if it was a common prob
11:27parasebareplaca: I see ... I thought there was a reflective mechanism for this already in clojure
11:28replacaparaseba: only for clojure funcs AFAIK because it's part of the generation/invoke cycle
11:29maravillasparaseba: I had a similar problem recently that I approached as remleduff suggested, at first
11:29maravillasI ended up replacing it with keyword args to call setters
11:29replacareplaca: using a general reflective method for interop would make interop very slow
11:29rhudson(defmacro construct [cl args] `(new ~cl ~@args))
11:30replacarhudson: which doesn't work when the number of args varies at runtime
11:30parasebareplaca: yes of course, it shouldn't be the default mechanism ...
11:30rhudsonDon't see why not
11:31parasebarhudson: args is an array ... not expanded at macro expansion time
11:31rhudsonI tested (construct BigInteger [str(1000000000)])
11:32remleduffMaybe: (Reflector/invokeConstructor (into-array Object args))
11:32remleduffSorry: (Reflector/invokeConstructor Foo (into-array Object args))
11:32parasebaremleduff: yes ... I think that's the easier way to go ...
11:34remleduffNot sure how guaranteed that method is to exist in any future version of clojure...
11:36parasebarhudson: try (construct BigInteger (first [1]))
11:36parasebarhudson: you're handling the easy case of *actual* compile time array
11:37rhudsonI see
11:37rhudsonreflection it is then
11:37parasebaremleduff: why is that? can you explain please?
11:38remleduffIt's just kind of an implementation class, I can't speak for Rich on if it's a guaranteed class. It's probably fine though
11:40remleduffAlso, that does reflection every time, was hoping to find something that did caching of the constructors
11:40remleduffWill probably be pretty slow if you are doing a ton of it
11:41parasebaremleduff: thanks, performance won't be a problem
12:28bsteuberwhich swank was it that works with clojure's new meta syntax?
12:36replacabsteuber: the latest on clojars
12:38bsteuberreplaca: weird, then my error must be sth. else..
12:40bsteuberI'm getting "unmatched )" when slime-connecting to a mvn clojure:swank with that version
12:49bsteuberis it normal that the jar is named swank-clojure-1.2.0-20100308.145053-9.jar though released 28th Apr, not 8th Mar
12:50bsteuber?
13:00jgracinHi! I'm getting "swank is not a task" when running "lein swank". Using lein 1.1.0. I have :dev-dependencies [[leiningen/lein-swank "1.1.0"]] in project.clj. Any ideas?
13:02replacabsteuber: that's the one I've got and it sems to work ok
13:02replaca*seems
13:03bsteuberreplaca: ok thx, have to look somewhere else then
13:04remleduffjgracin: You ran lein deps?
13:04jgracinremleduff: yes, lib/ contains 20+ jars
13:05jgracinremleduff: including lein-swank.jar
13:05remleduffAre you on windows/
13:05jgracinremleduff: Solaris
13:06remleduffif you do "DEBUG=1 lein swank" what's your classpath?
13:07jgracinremleduff: it outputs a line containing only leiningen-1.1.0-standalone.jar
13:08remleduffWell that's no good... what does: find lib/ -follow -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr \\0 \:
13:09remleduffdo for you?
13:09jgracinremleduff: Found it! Thanks remleduff! The problem is that lein script depends on GNU find, and it doesn't work on Solaris.
13:09remleduffCool
13:09remleduffI think I saw a commit for fixing find on other Unixes go by on github, so it may be fixed in a newer version
13:10rfgHow can I take a string and make it the first entry in a String[]?
13:11jgracinremleduff: great, I'll check out the git repo
13:12remleduff,(into-array ["hello"])
13:12clojurebot#<String[] [Ljava.lang.String;@17f2e13>
13:12rfgThank yee, kind sir!
13:15remleduff,(apply into-array String "does" "this" "work?")
13:15clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$into-array
13:16remleduff,(into-array String (apply vec "does" "this" "work?"))
13:16clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$vec
13:16remleduffbleh
13:16remleduff,(into-array String (list "does" "this" "work?"))
13:16clojurebot#<String[] [Ljava.lang.String;@1b87d8c>
13:16rfg,(into-array String (apply vector "does" "this" "work?"))
13:16clojurebotjava.lang.IllegalArgumentException: array element type mismatch
13:18remleduff,(into-array String (apply str "does" "this" :also 1 2 "work?"))
13:18clojurebotjava.lang.IllegalArgumentException: array element type mismatch
13:18remleduff,(into-array String (map str ["does" "this" :also 1 2 "work?"]))
13:18clojurebot#<String[] [Ljava.lang.String;@1a07c8c>
13:18remleduff,(seq (into-array String (map str ["does" "this" :also 1 2 "work?"])))
13:18clojurebot("does" "this" ":also" "1" "2" "work?")
13:19bmason,(apply str ["does" "this" :also 1 2 "work?"])
13:19clojurebot"doesthis:also12work?"
13:20remleduffIs there an "apply" that applies the variadic args as a single collection to the function?
13:21remleduffSo (myapply f 1 2 3 4) -> (f (list 1 2 3 4))
13:21remleduff(defn myapply [f & args] (f args))
13:21bmasonwhy not literally write out (f '(1 2 3 4)) ?
13:22mmarczykyou mean the function to the collection :-)
13:22mmarczykand since you've just defined, sure there is one ;-)
13:22remleduffhehe
13:22mmarczyk(defined it)
13:24mmarczyk,(apply (comp count vector) 1 2 3 [4 5 6])
13:24clojurebot6
13:25mmarczyk,(apply (comp count list) 1 2 3 [4 5 6])
13:25clojurebot6
13:47rfgWhy isn't this working: (java.nio.IntBuffer/wrap (into-array [1 2 3]))?
13:48rfgThat's an Integer array as opposed to an int array?
13:50hoeckrfg: try (into-array Integer/TYPE [1 2 3])
13:53rfgThanks
14:21iruedigeris it possible to destruct a list without binding each value?
14:21iruedigerI know I can do: (let [[x y] [1 2 3]] [x y])
14:22iruedigerbut is it possible to do without binding to x and y
14:22iruediger?
14:33chouseriruediger: why else would you be destructuring, except to bind x and y?
14:33chouseriruediger: why else would you be destructuring, except to bind x and y?
14:35iruedigerchouser, I want to use clojure.contrib.sql/create-table. It takes the table name and specs
14:35iruedigerI have a list of specs: ([:id :int :name :varchar])
14:35iruedigerbut this varies for each table
14:37iruedigerI'd like to destruct that list of specs and call create-table, like (create-table :table_name (magic-destructing-fn specs))
14:38iruedigerI am not sure if that is possible
14:38Associat0rhey Ash
14:39remleduff,(partition 2 [:id :int :name :varchar])
14:39clojurebot((:id :int) (:name :varchar))
14:40chouseriruediger: I'm not sure, but I think you may want (apply create-table :table_name specs)
14:41iruedigerremleduff, chouser: thanks, I'll try both suggestions
14:41remleduffI think you want to end up with (create-table :tablename [:id :int] [:name :varchar]) right?
14:41iruedigeryes
14:42remleduff(apply create-table :tablename (map vec (partition 2 [:id :int :name :varchar])), I think
14:42iruedigersorry I got the specs collection wrong, it should be: (([:id :int] [:name :varchar])
14:43iruediger([:id :int] [:name :varchar])
14:43remleduffOh, then just what chouser said, as usual :0
14:44iruedigerok thanks anyway remleduff
14:44LauJensenEvening guys
14:46LauJensens/guys/crew
14:53remleduffWill protocols allow (partition 2 '[a b c d]) to return a vec instead of a list or seq or whatever it is?
14:54remleduff,(class (partition 2 '[a b c d]))
14:54clojurebotclojure.lang.LazySeq
14:54remleduff,(class (first (partition 2 '[a b c d])))
14:54clojurebotclojure.lang.LazySeq
14:57Licenserremleduff: that'd actually be quite cool :P
15:00TakeVIs there a Clojure version of SDL, out of curiosity?
15:02chouserremleduff: yes, but I doubt partition will do that. ...mainly because it could today for built-in collections like vector. The decision to return lazy seqs is intentional
15:04arjagents are really a brilliant concept
15:04remleduffAh, I understand the outer one being lazy, but seems like each interior one could be the original type
15:07Associat0rjoin ##fsharp
15:07arj:>
15:13fro0gcan I set up a website using clojure (EPL license) + some AGPL licensed project, or am I in violation of the AGPL license?
15:20Licenserhm so what to do tonight
15:49LicenserI've a dream
15:51Licenserone happy day when unicorns are freely roaming the wide green oceans of europe, the hippies are happily cuddling their trees, some lonely phenixes roam the sky every now and then picking out one of the weaker parts of the hippy herds clojures compiler errors will actually be helpful.
15:52technomancyclojurebot: unmatched ) is an indicator you need to upgrade clojure-test-mode, not a problem with swank itself.
15:52clojurebotRoger.
15:53LicenserI mean is it that hard for the compiler to spit out a line or at least a file name :(
15:54LicenserI mean I'm willing to deal when it comes to the phenixes if it are just a few of them it's OK with me
15:59rfgOver 9000 points for anyone who can tell me how to convert a ByteBuffer to a string (where the bytes are chars).
16:01rfgAh!
16:01rfgWell that didn't work.
16:01remleduffByteBuffer.remaining tells you how many bytes to get, create an array of that size, then ByteBuffer.get(array), then (String. array)
16:02rfg Log: 䙲慧浥湴⁩湦漊ⴭⴭⴭⴭⴭⴭⴊ〨㐩›⁥牲潲⁃㔰㔲㨠杬彖敲瑥砠楳潴⁡捣敳獩扬攠楮⁴桩猠灲潦楬攊 :)
16:03Licenserhrm
16:04rfgThat was using (.toString (.asCharBuffer bbuffer)).
16:05LicenserSo I have this code: http://github.com/Licenser/clj-swing/blob/master/src/clj_swing/document.clj#L53 that is supposed to create a java object, the API http://java.sun.com/javase/6/docs/api/javax/swing/text/AbstractDocument.html tells me that there is a constructor like I call but clojure screams :(
16:06Licenserrfg: mayhaps your encoding is wrong?
16:06hiredman~google java abstract classes
16:06clojurebotFirst, out of 468000 results is:
16:06clojurebotAbstract Methods and Classes (The Java™ Tutorials &gt; Learning the ...
16:06clojurebothttp://java.sun.com/docs/books/tutorial/java/IandI/abstract.html
16:07Licenserhiredman: thank you :) I feel stupid now ;)
16:07rfghttp://download.java.net/media/jogl/jogl-2.x-docs/javax/media/opengl/GL2ES2.html#glGetProgramInfoLog(int,%20int,%20java.nio.IntBuffer,%20java.nio.ByteBuffer)
16:07sexpbot"GL2ES2 (JOGL, NativeWindow and NEWT APIs)"
16:09remleduff(let [bbuffer (java.nio.ByteBuffer/wrap (.getBytes "hello")), size (.remaining bbuffer), buf (create-array Byte/TYPE size)] (.get bbuffer buf) (String. buf)) ;optionally specify the encoding in String constructor
16:09remleduffMaybe I should have pasted that
16:10remleduffrfg: ^^
16:12chousermy agents don't appear to be using up all my CPU resources
16:13Licenserchouser: they are secret agents and doN#t want to get noticed
16:13remleduffDoes anyone happen to know when LISP added defconstant?
16:13chouserhmph
16:14remleduffSorry, wrong window, but if anyone knows :)
16:14rfgheh
16:18rfgCheers remleduff
16:18remleduffI want my points :P
16:18kzarwhat's the equivalent of e.getX(); ?
16:19remleduffkzar: If you mean interop-wise, (.getX e), if you mean what the "clojure way" would be, probably (:x e)
16:20remleduffI have all the points, muahaha
16:21kzarremleduff: Hmm that's what I thought but I get a class cast exception
16:21kzarremleduff: Thanks I'll check the other stuff I changed
16:23rfgYay, my GLSL shader works.
16:29Licenseroh darn it :(
16:40kzarSo I'm working on a little swing app but I had two questions; how come if an action calls println I don't see it at the repl? How come I don't see exceptions caused by code called by actions either?
16:41technomancykzar: IIUC each thread gets its own stdout and stderr
16:43kzarah ok
16:43Licenserswing documents areno fun
16:44Licenserkzar: you can look in the *inferiour-lisp* buffer
16:51chousertechnomancy: really!?
16:51chouserI was under the impression swank or slime rebinds *out* and *err*
16:51chouserin order to send them back to the emacs buffer
16:52Licenserchouser: not when you open a new thread
16:52technomancyhm; I could be wrong about that.
16:52chouserbut if you print from another thread, that gets the root binding again
16:52Licensernah it is a thread thing
16:53technomancy(.start (Thread. #(println "hi")))
16:53technomancy,(.start (Thread. #(println "hi")))
16:53clojurebotnil
16:53technomancyyeah, that goes too inf-lisp. never mind.
16:53technomancymust be some weird swing quirk then.
16:53LicenserI really really wonder how I can get String index out of range: -1 when I wrap both arguments of subs in (max 0 ...)?
16:55kotarakLicenser: maybe the second in a (max 1 ...)?
16:55kotarak,(subs "Hello" 0 0)
16:55clojurebot""
16:55kotarakNevermind.
16:55Licenseryea tried that
16:56Licenserthe second is in (max 0 (min len (.length stringythingy)))
16:56LicenserI really am not sure if I'll get the swing of this :(
16:57technomancyI wonder if a patch for that would be accepted
16:58Licenser,(subs "" 0 0)
16:58clojurebot""
16:59Licensertechnomancy: I'd rather put that in c.c.string since I'm not sure if it expected behaviour :P
16:59technomancyelisp and ruby both do that
16:59Licenserwell my document is horribly bad, it refuses to render, crashes when editing, I am not good at this :(
16:59Licenserhmm true
17:00Licenserand you still can 'shield' subs from that by min max you just don't get errors
17:02remleduff~subs
17:02clojurebotexcusez-moi
17:09technomancyis anyone using slime trunk?
17:10Chousukeare you going to break compatibility? :P
17:10technomancyChousuke: it's already broken in the current release; I'm hoping to restore it in the next.
17:11ChousukeI don't update very often, but I'm not using the elpa version either
17:11technomancyChousuke: I'm just wondering if slime is at a good point right now to attempt that or if there have been any major changes recently that may contribute to instability.
17:12rfgHmm, these microwave times are non-linear.
17:14rfgOkay, I need to microwave my lasagne for 8m50s (fitting a quadratic).
17:14Chousukeyeah, the slime guys only care about common lisp implementations of the swank backend :(
17:15Chousukeanything else basically works by accident.
17:15Licenser,(subs "bla" 1 0)
17:15clojurebotjava.lang.StringIndexOutOfBoundsException: String index out of range: -1
17:15Licenseroh for crying out lod ...
17:20technomancyworst error message evar
17:21Chousukeleaky abstraction ;P
17:22technomancyhugod: pingo
17:22Licenserit took me nearly an houre to find why that happens
17:28hugodtechnomancy: hi
17:31technomancyhugod: I keep forgetting which of your swank branches still need attention =)
17:31technomancyhugod: it was mostly compile-string and hyperdoc, right?
17:32hugodyes, autodoc needs redoing for rpc
17:32hugodcompile-string is the most useful
17:33hugodbut also contains a nasty Compiler/load call
17:38MadWombatanyone knows how to pass dont-close to lein swank command?
17:38MadWombatlein swank :dont-close true doesn't seem to work
17:44raekI ended up making this: http://gist.github.com/348309
17:44raeklein didn't pass the options to swank
17:44raekthought, this might have been fixed now...
17:52technomancyMadWombat: $ lein swank 4005 localhost :dont-close true # <= works for me
17:53technomancyjust has an odd argument order since the port is the thing that you're most likely to change
17:53technomancyany reason why :dont-close shouldn't be the default?
18:09replaca~doc subs
18:09clojurebotthe doctor is out
18:11technomancyreplaca: did you see my chat from yesterday about how lein plugins shouldn't declare a dependency on Clojure?
18:18technomancyMadWombat: I just pushed a fix for swank-clojure so :dont-close is no longer required
18:18technomancyshould be available on clojars
18:44MadWombatGuess I will need to switch back to the github version of swank-clojure
18:46MadWombatcause lein swank 4005 localhost :dont-close true gives me wrong number of arguments error
18:48replacatechnomancy: no, I didn't
18:48replacatechnomancy: I suppose that that's aimed at sutodoc :-)
18:48replaca*autodoc
18:49MadWombattechnomancy: wonder if it makes more sense to include lein-swank in leiningen instead
19:07nurvHi.
19:08MadWombatany recent word on 1.2 release date?
19:34technomancyreplaca: yeah, it's badly-documented
19:34technomancyI'll make sure the next release has more details about authoring plugins
19:36replacatechnomancy: ok, I'll pull clojure out then
19:37technomancyreplaca: if you want autodoc to work with lein 1.1.0 then I'd recommend leaving #^ alone
19:37technomancy#^ is going to stay in clojure for a while for backwards compatibility
19:37technomancyit's only ^-as-meta that's deprecated
19:38replacatechnomancy: oh, I was changing it in pprint
19:38replacacore is now pretty much free of #^, so I didn't want to be the laggard :-)
19:39technomancyoh gotcha; makes sense
19:40technomancyI just recently got a patch that removed #^ because somebody thought it was going away, I was beginning to think it was a common misconception
19:43replacayeah, I guess apps should keep it for awhile. It'll be interesting to see how long 1.1 lives in the wild
19:46MadWombatwhat arguments are passed to erc-text-matched-hook functions?
19:49technomancyMadWombat: I can't repro that wrong-number-of-args error in lein swank
19:49MadWombattechnomancy: hmm
19:50technomancyMadWombat: I'm about to take off, but if you continue to have trouble feel free to mail the swank-clojure mailing list with the details to repro
19:50MadWombattechnomancy: OK
19:50remleduffWhat does that :dont-close parameter to swank do?
19:51technomancyremleduff: nothing, anymore
19:51MadWombatremleduff: keeps server listening to connections after you disconnect
19:51technomancyremleduff: it used to be that after you disconnected from the swank server, it would shut down
19:51MadWombatremleduff: well, used to
19:51remleduffOh man, I've been wanting that :)
19:51technomancybut that behaviour was nonsense, so I just removed it.
19:52MadWombattechnomancy: basically I am using emacs pieces from ELPA and lein-swank/clojure-swank from :dev-dependencies [[leiningen/lein-swank "1.1.0"]]
19:52technomancyMadWombat: try boosting the lein-swank version to 1.2.0-SNAPSHOT
19:53technomancyI do recall that may have been an issue with the earlier release now that you mention it
19:53technomancyhopefully I can get 1.2.0 stable released soon.
19:54MadWombattechnomancy: does it require clojure 1.2.0?
19:54technomancyMadWombat: it shouldn't
19:55MadWombatOK
19:55technomancyI will try to make that more explicit in the actual release.
20:03remleduffYou should call it swank 2010 ;)
20:03remleduffOr Swank 2.0
20:03remleduffOr even better, Swank 7
20:06MadWombattechnomancy: now it works :)
20:17eliantorhi
20:18eliantoris there a way to use macros inside deftype?
20:38defnhttp://gist.github.com/38759
20:38defnCould someone take a look at that and offer any ideas on why that's happening? It seems to work fine in the REPL, but then I plug it into my application and get Unreadable Form, see gist^
20:39arbschtis that link correct?
20:39defnwhich link?
20:40arbschthttp://gist.github.com/38759
20:40defnhttp://gist.github.com/387593
20:40defnsorry
20:41defni tried replacing the (read (pushback (stringreader with (read-string and still have the same problem
20:47defnany ideas?
20:53defnI can't find any mentions of unreadable form in the source, hmm
20:56defnmaybe i need a macro...
20:56defnbut then why would it work in the REPL but fail in the application
20:56defnso confused.
20:59remleduffI'm a little suspicious of those single-\ s
20:59remleduffJava might want those to be escaped depending on the context
21:00hiredmanunreadable form is an exception from the clojure reader
21:01defnremleduff: which single \s? the \"foo\"?
21:01defnthat seems to work fine in my SLIME repl also
21:01remleduffNo, the resulting "\n"
21:02defnoh -- well, that's the output from the format-code function, that's what i want, i dont see how producing a string with \n would confuse the reader, that's pprint's job to add those for me
21:03hiredmanare you sure the input is the same?
21:03hiredmanI kind of doubt it is
21:04hiredmanyou can grep LispReader for that exception and find out when it throws that exception
21:05hiredman,(read-string (pr-str (Object.)))
21:05clojurebotjava.lang.RuntimeException: java.lang.Exception: Unreadable form
21:05hiredmanetc
21:08MadWombatwhat is the most current couchdb client for clojure?
21:08defnhiredman: thanks for the help, looking into it further, but it does appear that my input is the same
21:09hiredmanhow do you know?
21:10defni stepped through it
21:11hiredmanwith what?
21:16defnhiredman: i have a structure like: (["(code (input))" "(result of the code run in the sandbox")] [...] [...] ...)"
21:16defni run this function across the first item in the nested vector, and the second item in the nested vector
21:17defnactually you know, i think i see what the problem might be
21:17defnone second
21:19defn,(read-string "clojure.lang.LazySeq")
21:19clojurebotclojure.lang.LazySeq
21:19defn,(pprint (read-string "clojure.lang.LazySeq"))
21:19clojurebotjava.lang.Exception: Unable to resolve symbol: pprint in this context
21:19defn(use 'clojure.contrib.pprint)
21:19defn,(use 'clojure.contrib.pprint)
21:19clojurebotnil
21:19defn,(pprint (read-string "clojure.lang.LazySeq"))
21:19clojurebotclojure.lang.LazySeq
21:20defn,(with-out-str (pprint (read-string "clojure.lang.LazySeq")))
21:20clojurebot"clojure.lang.LazySeq\n"
21:21hiredman,(pprint (range 10))
21:21clojurebot(0 1 2 3 4 5 6 7 8 9)
21:23defnhiredman: are you trying to suggest that when i do a read-string it's actually evaluating?
21:23defn,(pprint (read-string "(range 10)"))
21:23clojurebot(range 10)
21:24defn,(pprint (read-string "{:foo \"bar\"}"))
21:24clojurebot{:foo "bar"}
21:25hiredmanI still suggest you look at th reader and figure out where it thorows that exception
21:31defnhiredman: could you be a bit more explicit in how to do that, im not sure how to go about that
21:31defnhiredman: you mentioned "grep LispReader", where do I do that?
21:33remleduffIf you just print out the strings in code instead of pprinting them, can you verify that they're what you're actually expecting?
21:33defnremleduff: yes, they are what I'm expecting
21:34defnremleduff: and again, they actually work in the SLIME repl, but I get Unreadable Form exceptions once it's on swank
21:35remleduffI'm not sure what you mean by in swank though, there's a lot of walton code and ring and hiccup calls in the stacktrace. Was thinking there might be some html-escaping getting in your way
21:35hiredmanin the clojure source there is a LispReader.java
21:35defnhiredman: ah-ha, thanks
21:37defnWell I find the mention of it, but I'm no java buff -- I see it is UnreadableReader, but beyond that I'm not sure what's goin gon there
21:38defnWhat is object "leftangle"?
21:38defna <?
21:39hiredmangrep for leftangle
21:46defnhiredman: im not 100% sure what im looking at is correct, but...
21:46defn List list = readDelimitedList('>', r, true);
21:46defnis that what you were thinking?
21:47defnor were you thinking across all of clojure, another file other than LispReader perhaps?
22:09defnso i must be picking up a < someehere
22:10defni just dont see them :\
22:15defn,(read-string "#<core>")
22:15clojurebotjava.lang.RuntimeException: java.lang.Exception: Unreadable form
22:15defnfinally for the bastard...
22:15defnthanks hiredman
22:33GeoffSKseeking a clue...
22:33GeoffSK(require '[clojure.contrib.http.agent]) (http-agent) java.lang.Exception: Unable to resolve symbol: http-agent in this context
22:34GeoffSKWhat am i missing with the require?
22:40MadWombatyou are not missing anything, when you do require this way, you have to use fully qualified names
22:41MadWombat(require 'clojure.contrib.http.agent)(clojure.contrib.http.agent.http-agent "http://www.google.com&quot;)
22:41MadWombatif you want to shorten it, you need to use :as keyword
22:41clojurebothttp://clojure.org/data_structures#toc8
22:41GeoffSKthanks, i get:
22:41GeoffSKjava.lang.ClassNotFoundException: clojure.contrib.http.agent.http-agent (NO_SOURCE_FILE:2)
22:42MadWombatoops, my mistake, change last . to / like clojure.contrib.http.agent/http-agent
22:42GeoffSKyes!
22:42MadWombat(require '[clojure.contrib.http.agent :as http]) might help
22:43MadWombatthen you can use (http/http-agent)
22:43GeoffSKobviously a newbie, didn't realise i needed the slash. Thanks.
22:43MadWombatno problem, I am relatively new to clojure myself
23:18defnHow can I find all the strings that contain a char
23:19slyphonfilter ?
23:19defnlol of course
23:34technomancyMadWombat: hey, did you get a chance to look at the cygwin fix mentioned in #emacs?
23:44eliantoris this a right fold?
23:44eliantor(defn foldr [f acc seq]
23:44eliantor (trampoline
23:44eliantor (fn []
23:44eliantor (if (first seq)
23:44eliantor #(f (first seq) (foldr f acc (rest seq)))
23:44eliantor acc))))
23:44slyphonuse a pastebin
23:44eliantorsorry
23:46eliantorhttp://pastebin.com/cey23PBD
23:46eliantorhere it is
23:47slyphonopen 2
23:47slyphonlkjdslfdskjfdlkjsfd
23:51eliantordid you see the paste?