#clojure logs

2009-07-29

04:02AWizzArdHi cgrand
04:05lbjAWizzArd: You did work on JavaFX right?
04:06cgrandHi AWizzArd!
04:40angermanI cannot just drop an item from a vector, can I ?
04:41angermane.g. [1 2 3 4] -> [1 2 4]
04:42angerman,(let [x [1 2 3 4]] (subvec x 3))
04:42clojurebot[4]
04:42angerman,(let [x [1 2 3 4]] (subvec x 0 3) (subvec x 3))
04:42clojurebot[4]
04:42angerman,(let [x [1 2 3 4]] (conj (subvec x 0 3) (subvec x 3)))
04:42clojurebot[1 2 3 [4]]
04:42angerman,(let [x [1 2 3 4]] (conj (subvec x 0 3) @(subvec x 3)))
04:42clojurebotjava.lang.ClassCastException: clojure.lang.APersistentVector$SubVector cannot be cast to clojure.lang.IDeref
04:44angerman,(let [x [1 2 3 4]] (reduce conj (subvec x 0 3) (subvec x 3)))
04:44clojurebot[1 2 3 4]
04:44angerman,(let [x [1 2 3 4]] (reduce conj (subvec x 0 2) (subvec x 3)))
04:44clojurebot[1 2 4]
04:44angerman,(let [x [1 2 3 4]] (reduce conj (subvec x 0 1) (subvec x 2)))
04:44clojurebot[1 3 4]
04:45hiredmanuh
04:45angermanthat doesn't seemto be the best solution :/
04:45lbjangerman: Cosider using remove?
04:45lbj+n
04:45Raynes,(remove #(= 3 %) [1 2 3 4 5])
04:45clojurebot(1 2 4 5)
04:46hiredman,((comp vec drop-nth) 2 [1 2 3 4])
04:46clojurebotjava.lang.Exception: Unable to resolve symbol: drop-nth in this context
04:46angermanhmm ok. joined with nth thtat could vork
04:47hiredmanhuh
04:47angerman(let [x [1 2 3 4]] (remove #(= (nth x 3) %) x))
04:47angerman,(let [x [1 2 3 4]] (remove #(= (nth x 3) %) x))
04:47clojurebot(1 2 3)
04:48Fossio_O
04:48angermanbut it's not a vector after that anymore ...
04:48Raynesangerman: Call vec on it.
04:48angermanhmm yea.
04:49lbjor (into [] ...)
04:49angermanhmm into...
04:49hiredman,((comp vec (fn f [n m] (lazy-seq (if (zero? n) (rest m) (cons (first m) (f (dec n) (rest m))))) 2 [1 2 3 4])
04:49clojurebotEOF while reading
04:49lbjBut this might be the best thing after all: (apply str (map char (remove #(= 555 %) [555 97 112 112 108 97 555 117 555 100 32 82 97 555 121 110 101 115])))
04:49hiredmanbah
04:50hiredman,((comp vec (fn f [n m] (lazy-seq (if (zero? n) (rest m) (cons (first m) (f (dec n) (rest m)))))) 2 [1 2 3 4])
04:50clojurebotEOF while reading
04:50Rayneshiredman: Clojurebot is kicking your ass.
04:50hiredman,((comp vec (fn f [n m] (lazy-seq (if (zero? n) (rest m) (cons (first m) (f (dec n) (rest m))))))) 2 [1 2 3 4])
04:50clojurebot[1 2 4]
04:50angerman,(let [x [1 2 3 4]] (into (subvec x 0 1) (subvec x 2)))
04:50clojurebot[1 3 4]
04:50angermanahh :)
04:51lbjOT: Anyone here good at getting logo ideas?
04:52angerman,(let [x [1 2 3 4] drop-nth (fn [coll n] (into (subvec coll 0 (- n 1)) (subvec coll n))] (drop-nth x 2))
04:52clojurebotUnmatched delimiter: ]
04:52jdzi personally thing that using clojurebot as a repl for experimentation is antisocial behaviour
04:53hiredmanmy drop-nth is lazy
04:53jdzthink even
04:53hiredmanwell, keep us updated
04:55angermanhiredman: well i need it for the backing of a JTable
04:55lbjjdz: agreed
04:55angermanso lazynes is not an option as it's being consumed anyway
04:56lbjhiredman: Consider this: Opening access to your sandbox repl from some website, keeping an infinite log, letting people evaluate expressions and logging them next to their nick. That'd be an interesting read in a couple of months time
04:57hiredmanlbj: who says I don't log everything sent to clojurebot?
04:57Fossijdz: lbj zou can actually send him a private message if you must :)
04:58jdzi just brought up a point, it's up for discussion. you're kinda not adding to that discussion really.
04:59hiredmanclojurebot: numbers?
04:59clojurebotNo entiendo
04:59hiredmanclojurebot: numbers is <reply>(pl reverse $ (↕reduce range $ 10 () λxy (↕conj inc $ y x)))
04:59clojurebotc'est bon!
04:59angermanwow. thats that with the up-down arrows and the lambda in there?
05:00jdzthat's what you get when you cross clojure and haskell.
05:00hiredmanpl is a macro that does some code transforming
05:19angerman,(replace {3 "x"} ["a" "b" "c" "d" "e"]) ;; what am I doing wrong?
05:19clojurebot["a" "b" "c" "d" "e"]
05:28Chousuke,(replace '{a x} '[a b c d e a]); angerman
05:28clojurebot[x b c d e x]
05:35rottcoddangerman: (assoc ["a" "b" "c" "d" "e"] 3 "x")
05:46AWizzArdlbj: I am interested to know how far JavaFX is usable from Clojure. But I am not working on/with it currently.
07:58angermanhmm I think I have a problem again.
07:59angermanI have a map {"A" Class1 "B" Class2 "C" Class3}
07:59angermannow I'd like to do something like (("A" my-map). arg) or (new ("A" my-map) arg)
07:59angermanbut I think clojure does not like it that way
08:00rhickey~jcall
08:00clojurebotHuh?
08:01angermanrhickey: hm. do I have a match x with a b c like statement? then I could just write a dispatch function that returns the an instance of the class with the arg
08:03rhickeyangerman: is the problem looking up the Class by string? just switch it to (my-map "A"), or is the question how to create a new instance given the class? Classes with no-arg ctors support newInstance
08:03rhickey,(.newInstance String)
08:03clojurebot""
08:04rhickeyif the ctors take args you will have to use reflection, or make another plan where the map contains closures and not classes
08:04angermanrhickey: well I have this: {"GET": HttpGet, "POST": HttpPost, ...)
08:04angermanthey each take an url as argument
08:05angermanso my idea is to have a function that takes the key and url as arguments and returns an instance
08:05angermanand I think (cond might be a soltion
08:06Fossirarely the right one though ;)
08:06rhickeymaps are faster than cond, what's wrong with using a map? just use (m k) instead of (k m) when your keys are not keywords
08:06rhickeyor (get m k)
08:08angermanhmm. yep clojures are fine I think
08:50Chouser~jcall is http://paste.lisp.org/display/67182
08:50clojurebotAlles klar
08:50Chouser~jfn is http://paste.lisp.org/display/67182
08:50clojurebot'Sea, mhuise.
08:51Chouserclojurebot: jcall?
08:51clojurebotjcall is http://paste.lisp.org/display/67182
08:55Chouserapparently wave robots run in a GAE environment, and since they already have a GAE Clojure REPL, I assume it's just a matter of time before there's a clojurebot for wave.
08:59rhickeyChouser: the question is how ambitious will it be? a repl bot is one thing, how about live .clj files?
08:59rhickeycode is data is wave
09:02Chouserhm... one namespace per wave, I'd think
09:02rhickeynewnew is proving to be a huge pain BTW
09:03Chouserwriting it in java, hm? is that the source of the pain?
09:03cemerickit's quite an ambitious project
09:04rhickeycompiling calls like (.foo this ...) without runtime reflection means doing so without compile-time reflection either, as the class does not yet exist, but all of the host access compilation code uses reflection - aargh
09:05Chouserthat's not required for newnew, is it? an initial version could still use reflection.
09:05rhickeyI've done some refactoring so the Java doesn't become a complete mess, but Java is no fun either
09:05Fossiclojure on GAE is just fine
09:05Fossiruntime compiling and all
09:06rhickeyChouser: yes, it could use reflection but would be a sore spot since the whole point is for this to be fast enough for the bottom layer of the system
09:07rhickeythat's why I had to pause yesterday and work more on my design for primitive support in IFn, since the creation of these things will be locked inside fns, if the fn required boxing just to get a primitive through to the implemented class you'd get double allocations you are trying to avoid
09:07rhickeyeverything is interconnected
09:09cemerickI enjoy situations like that, only because of their payoff: eventually, one gets through the dip, and then vast swaths of tangled code just melts away
09:10rhickeyso I think I've figured out (but not implemented) everything, one point left is that I am currently not supporting concrete superclasses whose ctors take args - is that too draconian? I've even changed RestFn so it doesn't and can play along
09:12cemerickrhickey: I don't think it's a matter of draconian or acceptable -- if this is a primary piece of interop, it *will* come up. *shrug*
09:13rhickeycemerick: newnew is not an interop feature
09:14angermanhmm ... how do I turn {"a" "b" "c" "d"} into {:a "b" :c "d"}? json-read is not restoring the keywords
09:15rhickeymaking it so it can only implement interfaces is certainly easiest
09:15cemerickrhickey: in that case, I'm not sure what to say to your (potentially rhetorical?) question :-)
09:15rhickeythen there is no question, no superclass
09:15angermani tried to run (map (fn [[k v]] (keyword k) v) {...})
09:15rhickeycemerick: I'm practicing my excuses :)
09:15Chousukeangerman: you need to return [(keyword k) v]
09:16Chousukeangerman: and then (into {}) it
09:16cemerickrhickey: you could always go Henry II on people. "There's no sense asking if the air's good when there's nothing else to breathe." :-)
09:16rhickeyadding no-ctor concrete superclasses *is* a slippery slope, brings in protected access, calling "super" version
09:17rhickeyadding ctors args and fields just blows things up incredibly, with multiple nested scopes
09:17angermanChousuke: thanks. hmm seems expensive, but i don't have many elements anyway
09:17rhickeycemerick: hah
09:18Chousukeangerman: it's not that expensive.
09:18cemerickrhickey: thinking for a minute, I'm curious as to how you can get around concrete superclasses with ctor args -- tons of that in the std collections right now w/ meta, nevermind PSM
09:19ChouserwithMeta after construction
09:19rhickeymeta will change, it's been a pain this way anyway
09:20rhickeywill just move into leaf classes
09:20Chouserbase collection classes will just start empty, I'd guess?
09:20rhickeystructs on newnew?
09:21rhickeyChouser: if you look at the ctors there is only metadata being passed to the abstract bases
09:21ChouserNot that I need to understand, but I still don't see why compile-time reflection would require runtime reflection.
09:21cemerickrhickey: what about structs?
09:21rhickeyall the java util abstract classes take no args
09:22rhickeyChouser: compile-time reflection needs an existing class (which I don't have yet), but the compiled code would then need no reflection
09:23rhickeycemerick: it would be interesting to build structs on newnew
09:24cemerickrhickey: Oh, I hope so! That's my #1 use case (efficient structs w/ slots defined in interfaces).
09:24cemerick(hopefully with optional map usage as well, but we'll see, I suppose)
09:25rhickeycemerick: so once you are doing that, the question becomes what is faster, multiway conditional (generated per struct) or map lookup + array access?
09:26rhickeymy bet is on the former for modest sized structs
09:26rhickeyso then you are not reusing a generic lookup strategy but compiling unique code per struct
09:26rhickeyand PSM goes away
09:27cemerick...but with a PHM off to the side when you've got additional, runtime-defined slots, yeah.
09:27rhickeyright
09:27cemerickI think your bet is about right, especially as you could probably distill the conditional to a switch (and whatever that boils down to in bytecode)
09:27rhickeystruct become a more involved macro
09:28rhickeycemerick: esp since small maps use multiway conditionals anyway (known faster for n <= 9 or so)
09:30rhickeyswitch a bit sticky since the dispatch values would be keywords
09:30rhickeyI'll just leave it to hotspot, if you want the best perf you'll define an interface, that's the whole point
09:31Chouserand (:b foo) --> (.b foo)
09:31cemerickrhickey: I'd think it'd be worthwhile to emit something similar to switch (hash(yourkeyword)) { case 102934827: ... }
09:32rhickeycemerick: I welcome your patch :)
09:33cemerickChouser: (:b foo) is *always* preferable, so that you can make an object of type Foo functionally into a Bar (suffering real map lookups, but at the very least not worrying about what that thing is going to be used for when you create it)
09:33cemerickrhickey: I'll benchmark the easy way first, but it's something I'd definitely hit ASM for if need be.
09:35Fossii want to filter a seq with a pred, but also need the others. nicest way to do it?
09:36Fossifound separate
09:37Fossigoing through the list twice feels like a waste though
09:38rhickeyFossi: http://paste.lisp.org/display/76458
09:38rhickeyer, http://paste.lisp.org/display/76458,1/raw
09:41Chouser~unzip-with is http://paste.lisp.org/display/76458,1/raw
09:41clojurebotAlles klar
09:41Chouserso much easier than actually adding it to contrib. :-P
09:41rhickeythat focuses on calling the pred only once per and being lazy, one pass would be a different thing
09:42Fossiwell, the usecase is for pretty small lists anyway. still trying to get a feel though
09:42Fossiand i wondered that the implementation for "seperate" is so un... i don't know.. cool?
09:43Fossibut then, if i need something more optimal, i prolly want to write a specific version anyway
09:44rhickeywhat's separate?
09:45Fossihttp://code.google.com/p/clojure-contrib/source/browse/trunk/src/clojure/contrib/seq_utils.clj#40
09:53lisppaste8rhickey pasted "which new form?" at http://paste.lisp.org/display/84374
09:57Chouser1 and 3 are actually compatible
09:57cemerickrhickey: #3: typing {:as this} constantly is going to get irritating (unless the 'this' symbol is going to be the default, in which case, +1 on #1)
09:57Chouserwell, I suppose all of them are.
09:57rhickeycemerick: no default, same reason as yesterday
09:59Chouseryeah, I like #3 as well
09:59rhickeyor a new name like make/instance/obj[ect]
09:59rhickeywould allow this-name first
10:00ChouserNot sure 'this' belongs first. (new [SomethingListener] this {} (handleFoo [] ...)) has a pleasant order
10:01rhickeyChouser: I reconsidered the multiple overloads under one name, doesn't work due to ret type is hint on name and might differ
10:01rhickeyChouser: I agree, it's not a new this
10:02rhickeyyou can leave out both this and the map if you don't need them
10:02Chousuke#3 seems neat.
10:15mebaran151I'd like to build a lazy sequence n items at a time
10:15mebaran151is there a good tutorial on writing lazy functions that way
10:15mebaran151once the user tried to access the n+1 item, it would evaluate a given function
10:16Fossitried seque?
10:16rhickeypmap
10:16Chouserconcat
10:16cemerickmapcat
10:16rhickeyall have logic like that
10:16Chouserer, lazy-cat
10:17mebaran151well I'm looking more for something that thunks
10:17mebaran151like lazy-cat, except that I could pass a function
10:17mebaran151let me check these things out
10:19Chouser,(take 4 (lazy-cat [1 2 3 4] ((fn [] (prn "called") [5 6 7]))))
10:19clojurebot(1 2 3 4)
10:19Chouser,(take 5 (lazy-cat [1 2 3 4] ((fn [] (prn "called") [5 6 7]))))
10:19clojurebot(1 2 3 4 5)
10:19Chouserhm, clojurebot swallowed my prn?
10:19mebaran151I'd like to make it an explicit function though
10:19mebaran151because I have to handle the cursor releasing etc
10:19Chouser(fn [] ...) is an explicit function, isn't it?
10:20mebaran151oh
10:20mebaran151tis
10:20mebaran151got lost in my irc formatting
10:21mebaran151is there any decent way to pass the last element as an argument to that anonymous function?
10:22mebaran151I could probably pull something off using binding, but a binding solution never seems elegant
10:22Chouserthe last element of what?
10:22mebaran151the last element of the realized collection
10:23mebaran151(take (lazy-cat [1 3 4 5]
10:23mebaran151) ((fn [5 would go here] ....)))
10:24cemerickmebaran151: that's iterate territory
10:25mebaran151it is a little bit: what I'm trying to accomplish is a way to make a cursor based hash store look sort of like a lazy list
10:26mebaran151the thing is, I can't keep my cursors open all the time, so I thought I'd take the first n, then close the cursor, than restart it again if someone "used up" the first results
10:26mebaran151I need to pass back the last result so I know where to replace my cursor
10:26Chouserah, interesting idea.
10:27Chouseryou really need the last item of the previous series, and not some kind of offset or index?
10:27mebaran151I really do in a way
10:28mebaran151I think I can pull it off with a binding
10:28Chouseryou shouldn't need binding
10:28mebaran151whereby the last function would just bind its final result so I know where to restart
10:28ChouserI don't think. They're easy to get wrong when you've got closures nearby.
10:28cemerickmebaran151: something like take-while + mapcat + iterate should get you there
10:29Chousermight actually be easier to do with lazy-seq and close over what you need to do the next part.
10:29mebaran151yeah, that's what I was originally thinking
10:29Chouserhm, though maybe you could do that with lazy-cat too...
10:29rhickeyyes
10:30mebaran151it's actually coming out to be a pretty cool library
10:31mebaran151does full text indexing of arbitrarily nested maps on top of bdb
10:31mebaran151I just want to make the query interface more clojurey
10:32mebaran151so that users could do things like apply their own custom sorters mapping and the like without having to worry too hard about managing where the cursor is at any giving time
10:37cemerickmebaran151: sounds nifty. Roughly what I need to build this week. We're going with perst, which I'm very happy with so far.
10:39mebaran151yeah, it's been a two week project: though I've had to work on some other things in the mean ime
10:39mebaran151how does perst do for replication?
10:40cemerickostensibly, there's various options, though I've not bothered to look at that much. What's the use case in an embedded environment?
10:40mebaran151also does perst do phrase matching? (ie maintain word order)
10:41cemerickit has its own full-text indexing which is so-so, but you can also use lucene on top of it. That puts the DB and lucene all in one file, and gives you everything lucene has to offer.
10:42mebaran151ha
10:42mebaran151are you going to share this lib or is it strictly commercial only
10:42mebaran151would be cool to see how they compare :)
10:43cemerickI don't think there's much of a lib to write, honestly. I'm just going to be persisting maps, and then using the lucene API to search over them.
10:43cemerickit's an object database, so there's very little mismatch in the models
10:44mebaran151ah
10:45cemerickIf something interesting does come out of it, I'll certainly share. We don't care much about DB code.
10:46cemerickbut honestly, the API is something like (.put object-key-here {:foo 4 :bar "blah" :etc 'sym}) :-)
10:50mebaran151does it nest?
10:50mebaran151that was wher most of the current solutions got me down
10:50cemericknest?
10:51mebaran151handling nested hashes
10:51mebaran151{:a {:b [:c [1 2 "my test here" {:d 8}]}}
10:51cemerickyup, and arbitrary java objects
10:52cemerickgotta be careful with those -- all of the niggles of serialization come up there
10:52mebaran151well if you get nested hashes, arbitrary java objects should be pretty easy
10:52cemerickI do need to define a custom serializer for clojure objects that uses prn.
10:52cemerickbut that should take all of about 20 min.
10:53mebaran151java regexps are locale aware right?
11:01AWizzArd,(seq? (java.util.ArrayList.))
11:01clojurebotfalse
11:01AWizzArd,(coll? (java.util.ArrayList.))
11:02clojurebotfalse
11:02cemerick,(doc coll?)
11:02clojurebot"([x]); Returns true if x implements IPersistentCollection"
11:03stuartsierra,(list? (java.util.ArrayList.))
11:03clojurebotfalse
11:04AWizzArdis there a truth function which returns true for standard JRE collections AND for the Clojure collections?
11:06stuartsierra(instance? java.util.Collection ...) I guess
11:06AWizzArdyes ok, that would work
11:06AWizzArdthx
11:06stuartsierranp
11:06rhickeyj.u.Maps are not j.u.Collections, need to test for both
11:07stuartsierragrr
11:07stuartsierraI always forget that
11:08stuartsierraDid coll? formerly test for j.u.Collection?
11:08rhickeymaybe
11:10stuartsierraA non-committal response. :)
11:10rhickeyI don't recall
11:10stuartsierraok
11:14cratukiHaving some troublc compiling clojure.contrib. Following instructions at http://riddell.us/tutorial/clojure/clojure.html
11:14cratukiIn the ant command I specify a valid jar, but I get java.io.FileNotFoundException: Could not locate clojure/walk__init.class
11:15replaca_cratuki: you've got a version mosmatch
11:15cratukiIt still seems to produce a clojure contrib jar though. Has anyone else seen this?
11:15stuartsierrayep
11:15replaca_*mismatch
11:15cratukiahh
11:15cratukiOf course. My brain hasn't adjusted to git yet :)
11:15replaca_if you're using 1.0 clojure, you should get the 1.0 compat branch of contrib
11:15stuartsierraEither 1) get the latest Clojure from Git, or 2) get the clojure-1.0-compatible branch of contrib
11:16cratukiI used subversion to get trunkclojure - but maybe I should just get 1.0
11:16cratukithanks all
11:17stuartsierraNothing on SVN any more; use github
11:44Chousereevar: seems like a good idea.
11:50cemerickis there no way to simply eliminate those projects on GC?
11:51Chousercemerick: a pointer to the new host might be preferrable
11:52cemerickthat's already been the case, tho, for clojure, anyway (and people still grab from the GC svn there)
11:52rhickeyboth home pages have links to github and assembla, nuking the code on gc seems extreme
11:52eevarshould point to clojure.org/source (or whatever the url is) imo
11:52eevarrather than github, in case it's ever moved again ;)
11:54angermanhow will clojure benefit from JDK 7?
11:54Chouserexcept people seem to pretty frequently get the old code anyway.
11:54eevarrhickey: the repos show up in searches, tho
11:54Chouserand old blog posts and tutorials, etc.
11:56stuartsierraThere may be useful stuff on Google Code, e.g. in the wiki, but this makes it very clear that the current source is on github.
12:22angermanI need some help with macros (again :/)
12:23angermanI think this piece of code qualifies to be macrofied: "(.getMinSelectionIndex (.getSelectionModel (.field this))))"
12:23angermanso I though i'd write (defmacro selection-of [field] `(.getMinSelectionIndex (.getSelectionModel (.field this))))
12:26Chousukehmm
12:26Chousukeyou can use . directly if you want the field to vary.
12:26stuartsierrait would look like (. this ~field) in your back-quote
12:29angermanstuartsierra: but "this" sould be taken from outer scope right? a macro is (as far as i understand) a simple text-replacement during compiletime
12:30Chousukeit's not text-replacement.
12:30Chousukeclojure code is not text :)
12:31replaca_stuartsierra (and everyone): most of the doc from google code is now available on github
12:31stuartsierraoh, then "this" should be an argument to your macro
12:31replaca_(for contrib)
12:31stuartsierrareplace_: ok
12:31angermanstuartsierra: can any way to implicitly have it bound?
12:32Chousukeangerman: if this is bound in the scope you call the macro in it should be fine.
12:32replaca_the exceptions are the wiki pages for datalog and pretty printing/cl-format and they'll be there rsn
12:32stuartsierraIf you have "this" locally let-bound, you can requote it. (. ~'this ~field)
12:32replaca_one thing we need to add to github (if we haven't already) is a list of folks with commit privledges
12:32angermanChousuke: I call it from withing a function clojure in a proxy
12:33stuartsierrashould work
12:35angermanhmm. now it sais it can't find the symbol of the field
12:35replaca_btw, stuartsierra, thanks for cleaning up GC -> that's been necessary for a while now
12:35angermane.g. I have (defmacro selection-of [field] `(.getMinSelectionIndex (.getSelectionModel (. ~'this ~field))))
12:35Chousukeangerman: anyway, thinking of macros as text replacement is wrong. Clojure code is data, and a macro call is part of the data structure that makes up a program. At macro expansion time, the compiler calls the macro function, replacing it with the data structure it returns.
12:35angermanand call it like (selection-of myfield)
12:36angermanChousuke: ok. So it's intelligent text-replacement. :)
12:36angermanor data-structure replacement
12:36JomyootI think we are getting more mainstream
12:36stuartsierramaybe that should be (. ~'this '~field)
12:38Chousukeangerman: I guess. Code being data has some interesting consequences.
12:40Chousukeangerman: but the fact that clojure code is in text files is just a coincidence :P
12:40angermanChousuke, stuartsierra thank you
12:41Chousukeangerman: I think some lisps have editors that don't work with text files at all; instead, they modify data structures directly.
12:41clojurebotThey found no relationship between a programmer’s amount of experience and code quality or productivity.
12:45stuartsierraChousuke: "Structured editors," I think, but they never caught on.
12:46ChousukeI suppose text is still the most convenient representation.
12:46cemerickChousuke: that's intriguing. Seems like it'd be pretty straightforward in enclojure.
12:46cemerickangerman: everything dies eventually.
12:48stuartsierraOld languages never die, they just get ported.
12:49cemerickdeath is just the passing of flesh into memory.....and newer VMs? :-P
12:49stuartsierraUntil we all reach that great Garbage Collector in the sky. :)
12:55technomancyis there a command-line arg to clojure.main that can automatically require a given namespace?
12:56Chousukeyou can eval things with -e, right?
12:56technomancyright, but I want it to go to the repl after the require
12:56ChousukeI think -e works with the repl too
12:56hiredman-e something -r
12:56technomancy-r is repl?
12:56Chousukeor you can use an initfile with -i
12:57technomancycool; thanks
12:57hiredmanI think -r is repl, but --help will tell you for sure
12:58technomancyright on
12:59technomancybtw; was messing around over the weekend on JRuby/Clojure integration; turns out using STM from Ruby is absurdly easy: http://github.com/technomancy/clojure-gem/tree/master
13:00hiredmantechnomancy: you ever make it to seafunc?
13:00technomancyruby blocks can be passed as fn args to alter refs and such; very nice
13:00technomancyhiredman: I've only gone once before, but I plan on going tonight.
13:00hiredmanso it's cool?
13:00technomancyif you like geek talk. =)
13:01technomancyit's pretty low-key chatter, people come from quite a variety of backgrounds
13:02cemericktechnomancy: so blocks implement callable?
13:03technomancycemerick: yep. I think seeing that really helped me understand what a good idea interfaces are.
13:03hiredmanI am intrigued by the move to chipotle
13:03technomancycemerick: I was blown away by the fact that everything worked so seamlessly; was expecting it to be a lot more work.
13:04cemerickyeah, JRuby is pretty sane, and it sounds like it's going to get even better
13:04mrsolooh?
13:04stuartsierraJust pushed new clojure-hadoop, now writes Hadoop jobs with no Java calls. http://github.com/stuartsierra/clojure-hadoop
13:04technomancycemerick: especially sane compared to the standard 1.8 interpreter. =)
13:05cemerickyeah, I've no use at all for non-jvm stuff at this point.
13:05mrsolowell 1.8 is on its way out....
13:05technomancycemerick: you don't need any scripts that have subsecond launch times? =)
13:06hiredmancemerick: operates on the timescale of EONS
13:06mrsolotechnomancy: :-)
13:06cemerickI've never done "scripting".
13:06cemerickhiredman: I *AM* Time.
13:07Chousernearly everything I do is "scripting"
13:07cemerickthat's why I never bother with big-O concerns, either: what's quadratic time mean, when you have eternity? ;-)
13:08ChouserI guess that's not quite true. 90% of the "apps" I write (by count) are "scripts". But that's probably 40% of my coding time.
13:09hiredmannailgun!
13:09mrsolohas issues!
13:10hiredmanI think jruby ships with nailgun these days
13:10mrsoloheh
13:10cemerickthis would be a great stand-up routine :-)
13:10technomancyhiredman: true. it'd be nice to not have to worry about having a server running though.
13:10Chousersurely a server could be started up automatically on demand.
13:10mrsolowell i doubt that will ever get resolved without nailgun type service
13:11hiredmantechnomancy: @reboot /home/kpd/bin/boot-nailgun in your crontab
13:11hiredmanlaunches nailgun at boot
13:12technomancyhiredman: right, but you still need one ng server per clojure program
13:12hiredman:/
13:12technomancynot saying it's not good, it's just not quite as nice as an instant-on JVM.
13:21AnniepooI've got a situation that would be easy to deal with in an OO language, I'm wondering what a good design pattern is in an FP language
13:22AnniepooI have a structmap that's a model in a GUI editor. it represents an object that will ultimately be uploaded to a virtual world
13:23replaca_Dumb ant Q: how do I write a task that will exec "markdown foo.markdown > foo.html" for each foo.html in *.html?
13:23replaca_this seems like it should be really easy, but I'm not seeing it
13:23Anniepoothe upload is modestly expensive/slow so it's only done when the user says
13:24AnniepooI want to keep a needs-uploading bit and flip it when the object is changed
13:25mrsoloreplica: (:require [clojure.contrib.shell-out :as shell])
13:25mrsolothen (shell/sh .... )
13:26replaca_mrsolo: no not in clojure, in ant (thx)
13:26technomancyjust feed it through the clojure-to-and compiler. =)
13:26technomancyyay turing-complete XML!
13:27replaca_technomancy: every time I use ant I feel the motivation to write a clojure-based build system a la rake
13:27replaca_don't think I'd target ant though
13:28technomancygood. =)
13:28Anniepooevery time I use ant I realize that build systems are just horribly wrong
13:29mrsolonaw success is built on previous mistakes
13:29replaca_I think I may just end up writing a shell script to transform textile and markdown but that just seems so wrong
13:31technomancyworse than executable XML?
13:32replaca_well, you'd think that a declarative build system would allow you to specify transformation rules. :-(
13:32replaca_but at least being able to run a command on a bunch of files one at a time!
13:32replaca_sigh, but I don't see how to do it.
13:33replaca_the prob with a shell script is that it means *nix only (which is fine with me, but maybe not so good for all others)
13:34replaca_oh well, off to a four hour mgmt meeting :-(
13:36Anniepoohack lancet into what you need
13:38replaca_Anniepoo: yeah, that's a *big* tangent!
13:39lbjGood evening gentlemen
13:40Anniepoo8cD
13:40Anniepooso, replaca, what do I do about my 'setFoo does something else' problem?
13:40clojurebotPeople have a problem and think "Hey! I'll use a regular expression!". Now they have two problems....
13:41AnniepooLOL
13:41AnniepooI agree with clojurebot
13:41technomancyclojurebot: what is XML?
13:41clojurebotc'est bon!
13:41technomancyclojurebot: XML is like violence; if it doesn't solve your problems, you're not using enough of it.
13:41clojurebotAlles klar
13:41Chouser~what?
13:41clojurebotwhat is XML
13:41technomancydoh!
13:42Chouser:-)
13:42technomancyclojurebot: forget what
13:42clojurebotI forgot what
13:43lbjBests one I heard about XML was something like "XML, reinventing s-exps since 1995"
13:46lbj(fine, pretend that wasnt funny)
13:46Anniepooit's true
13:46Anniepooin 96 or so I needed some more accessible way to manipulate the structure of non roman WorldScript fonts
13:47Anniepoowhich are nasty huge nested structures
13:47AnniepooI was actually working with SGML on another project at the time
13:48cemerickwhoo, SGML
13:48Anniepoobut sanely decided we'd have a pair of C++ programs that converted to/from an s-expr
13:49AnniepooThere's probably STILL some poor mostly-writing-C++-occasionally-they-let-me-write-lisp programmer
13:49Anniepoowho thanks me every morning
13:52lbjAh, trusty old ERC
13:52ChouserHey, *I'm* a mostly-writing-C++-occasionally-they-let-me-write-lisp programmer
13:52ChouserThough I forgot to thank Anniepoo this morning
13:53AnniepooLOL
13:53Anniepoodo you work for Apple's Text and International?
13:54Chouserdo they employ anyone in Fort Wayne, IN?
13:54clojurebotThey found no relationship between a programmer’s amount of experience and code quality or productivity.
13:55AnniepooDon't think so
13:55Chouserwell then I guess not.
13:55Anniepoohey, clojurebot, I don't know who 'they' are, but
13:55lbjWhat was clojurebots latest quote based on ?
13:57Chouserhm. google finds nothing but clojurebot's brain
13:58Anniepooanybody else find it a bit bizarre that we're arguing with a bot?
13:58Chouserhttp://www.codinghorror.com/blog/archives/000072.html
13:58lbjIn my personal experience, I could actually find grounds to agree with Clojurebot, but I'd like some documentation behind it :)
14:01Anniepoocertainly I've met lots of programmers who have spent the last 20 years adding crap to one SAS program
14:04AnniepooThe productivity difference can depend on the domain
14:04AnniepooI think often we undervalue the rather pedestrian virtue of knowing the local language/ide/etc. well
14:04Anniepoobut it's true that a mark of a good programmer over a bad one is that
14:05Anniepoothe good programmer, never having seen C# before and now confronted with writing something in it
14:05Anniepoowill get the job done in a reasonable amount of time
14:06Anniepooand we spend more of our time learning new technologies than we usually recognize when we discuss how to program
14:08hiredmanthat they quote is triggered a lot
14:09Anniepooso, now that more people are on, mind a repeat of my question from before?
14:10AnniepooI've got a structmap that represents data I update to a virtual world only
14:10Anniepoowhen they ask, so I have a dirty bit
14:10Anniepoo(they = user)
14:11Anniepooin an OO language I'd just flip the bit in the setFoo method
14:11technomancyAnniepoo: sounds like a job for an atom
14:11Anniepoono, this can be immutable
14:12AnniepooI have a list of gidgets
14:12Anniepooeach gidget is a structmap with a bunch of keys
14:12Anniepoothe atom is the entire model
14:13Anniepoo(swap! my-model (fn [the-gidgets] (do-something the-gidgets)))
14:15mebaran151so you want to set the dirty bit clean?
14:15Anniepoono, I want to make sure that when do-something changes
14:16Anniepoothe value associated with :blah it also sets :dirty true for that gidget
14:16hiredmanuh
14:16AnniepooI have a local GUI editor. I draw up what I want, then upload it to the VW
14:16hiredmanwell, then whenever you update :blah set :dirty to true
14:16Anniepoogreat
14:17Anniepoonow all I need is to have every programmer working on the project
14:17Anniepooreligiously do that without fail
14:17Anniepoois there no way to encapsulate this?
14:17hiredmanAnniepoo: yes
14:17hiredmanit's called a "function"
14:18Anniepoosure, I can make an accessor function
14:18hiredmanand you can make an updator function
14:18Chousukehmm
14:19Anniepoobut the members are public, it's Fred-the-not-so-swift or me-at-3-am that will fail to do it
14:19Anniepooand just fiddle with the key
14:19hiredmanyou can group related functions in a namespace
14:19ChousukeAnniepoo: you can have a validator function on refs
14:19kotarakYou can make a watch, which changes :dirty if :blah was changed.
14:19hiredmanChousuke: he is not using refs on a fine grained level
14:20Anniepookotarak, tell me more
14:21AnniepooI could, I suppose, keep the last uploaded version of the db and figure out what to upload
14:22kotarakAnniepoo: Chousuke's idea is probably better. But maybe you can do: (def x (atom my-map)) (add-watch x :dirtyfy-watch (fn [x _ old new] (when (not= (:blah old) (:blah new)) (swap! x assoc :dirty true))))
14:22hiredmanAnniepoo: if you define a set of functions in a namespace that act as the interface for your datatype, I don't see what the problem is
14:23Anniepooah!
14:23AnniepooI can make the actual defstruct private somehow?
14:24ChousukeAnniepoo: not really, but you can just tell people not to use the keys directly or things will break :)
14:24kotarak(defstruct #^{:private true} some-struct :a :b)
14:24kotarakMaybe there is a defstruct- in c.c.def.
14:25AnniepooFor some other reasons too uninteresting to go into here the 'keep the uploaded version' solution is a good one for me
14:25kotarakDocstrings are the contract. If they say: Don't use the keys! Well.. then don't use the keys.
14:25Anniepoobut Chousuke, isn't lack of data hiding a major problem as programs become large?
14:26Chousukewell, python does not do it.
14:26Chousukeit's only a problem if programmers try to bypass the API.
14:26Anniepoook
14:27Anniepooso it means we're a little farther down on the drool-proof meter
14:27AnniepooI can accept that
14:27hiredmanAnniepoo: if you really really really want to complete hide the structure of your data you can use a closure
14:27hiredmanbut I think you should learn to live with encapsulation
14:28Anniepoook, cool
14:29Chousukea watch might be able to do what you need, though.
14:30kotarakChousuke: Do watches have some delay? That is: can one see the new value before all watches were called?
14:30kotarakIf so, a validator is maybe the better idea.
14:30Chousukehmm, right.
14:30Anniepoocurrently I'm using an atom and swap! to access my model
14:31Chousukeevery time someone updates the atom, you could go through it and assoc :dirty true to whatever changed. Of course, that will be O(n) so it's probably not that good if you have lots and lots of objects :/
14:31kotarakAnd what happens, if one changes the IRef in the watch? I did that above, but I'm not sure it's allowed.
14:31Chousukethen again, you will probably be able to use identical? to check the data structures so *that* should be quick :)
14:31AnniepooYah, Chousuke, I'm actually gonna be lazy about it. It's a reasonably small structure
14:32AnniepooI'll keep the last version uploaded to the VW around
14:32Anniepooand the upload function will optimize on the fly
14:32Anniepoo'don't need to upload that, already have one'
14:32Anniepoobecause in this case there are several kinds of dirty
14:33hiredmanAnniepoo: you could memoize the upload function :P
14:33Anniepoono, that wouldn't work, I need to do it on a finer grain than that
14:33Anniepoobut I like the separation of concerns of being smart
14:34Anniepoolike, if the label on the gidget changes I have to upload a new texture
14:34Anniepoowhich costs about 4 cents
14:34Anniepoobut if the object has just changed size I can just reshape it.
14:37Anniepoohmm... actually, I do need to keep track. I forgot I'm visually distinguishing what needs uploading
14:37Anniepoonow that I think on it, I'm not so clear why I'm doing that
14:53Anniepooanybody else using La Clojure?
14:54AnniepooI'm seeing unreasonable amounts of computation if I try to start a repl and have an editor window tiwh a syntax error in it
14:55ataggartI tried but I couldn't grok IDEA's notion of projects/modules
14:55ataggartthe eclipse plugin works well enough
14:56AnniepooI've used IntelliJ for years, I'd have to pay a high price in lost learning to switch
14:56ataggartfair enough
14:57ataggartthere's a forum for the plugin somewhere, might be worth asking Ilya about it
14:57Anniepooyes, I posted a note
14:59angermanhow would I construt an (all (true true true))?
14:59Chouserwhat's 'all'?
14:59hiredmanevery?
14:59hiredman,(doc every)
14:59clojurebot"/;nil; "
15:00hiredman,(doc every?)
15:00clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
15:00hiredmanI really need to fix that
15:00hiredman,(every? true? '(true true true))
15:00clojurebottrue
15:01angermannice
15:01angermanI came up with
15:01angerman,(reduce #(and % %2) '(true true true))
15:01clojurebottrue
15:01angermanthough every is probably better
15:01hiredmaneh?
15:01ataggart(apply and '(true true true))
15:01hiredmanand is a macro
15:01ataggartbah
15:01stuartsierraOr if you don't want to accept any non-nil, non-false thing as true, (every? identity ...)
15:01ataggarthavent had my coffee
15:03angermanno no. it should be only logical values :)
15:03angermani'm basically running map over a collection and check if ... ohh that sounds like a stupid idea now.
15:04Anniepoo,(doc and)
15:04clojurebot"([] [x] [x & next]); Evaluates exprs one at a time, from left to right. If a form returns logical false (nil or false), and returns that value and doesn't evaluate any of the other expressions, otherwise it returns the value of the last expr. (and) returns true."
15:04Anniepooyou can and any number of things
15:05Anniepoo,(apply and '(true true true))
15:05clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/and
15:05hiredman 12:04 hiredman : and is a macro
15:05Anniepoo8cD now I know
15:13Anniepoois there some library thingum that will do this?
15:14Anniepoo(foo pred fun seq)
15:14ataggartwhich "this" are you referring to?
15:14ataggartah
15:14ataggartwhat's going on with that?
15:14Anniepoowhere foo returns a seq whose elements are the same as in seq
15:14hiredmanuh
15:15hiredmanthat is the point of that then?
15:15kotarak(map identity seq)?
15:15ataggartlol
15:15Anniepooif pred (element) is false, and (fun element) if pred is true
15:15AnniepooI'm writing lots of handlers that do something to my model
15:16ataggart(map #(if (pred %) % (fun %)) seq)
15:16hiredman,(map #(if (number? %) (inc %) %) [1 :two 3 :four])
15:16clojurebot(2 :two 4 :four)
15:16kotarak(map #(or (and (pred %) (f %)) %) seq)
15:16Chouser(map #(if (p e) (f e) e) s)
15:16kotarakdoes that work?
15:16Chouseroops, I said e when I meant %
15:16ataggartmy logic was backwards
15:17ataggartbut we're all saying the same thing
15:17hiredmanmine was perfect
15:17ataggartas always, hiredman
15:17Anniepooyah, I'm doing what Chouser says, just tired or reading it over and over
15:19Chouser(defn map-if [p f s] (map #(if (p %) (f %) %) s))
15:19AnniepooI guess I could make my own
15:19Chousertoo late
15:19Anniepoo8cD
15:19Chouser:-)
15:19hiredman,(pl (↕map call · (⌽vector 1) $ :two $ 3 $ :four λx (if number? $ x inc $ x x)))
15:19clojurebotjava.lang.Exception: Remove at top
15:20hiredmandamn
15:20hiredman,(pl (↕map [1 :two 3 :four] λx (if number? $ x inc $ x x)))
15:20clojurebot(2 :two 4 :four)
15:20kotarakhiredman: are you trying to port Haskell to Clojure?
15:21mebaran151typed clojure?
15:21hiredmankotarak: the problem with that would be haskell's lazy eval
15:21mebaran151you could all it Curry....
15:21mebaran151*call it
15:33cemerickholy hell, annotations are *insane*
15:33Anniepoo??
15:33Anniepooas in Java annotations?
15:34cemerickyeah
15:34ataggarta terribly misused piece of tech
15:34AnniepooYou know, coming from mostly writing Java over the last ten years
15:34AnniepooI feel like somebody who'se left a cult
15:34Anniepooand is thinking 'what was I DOING thinking like that?'
15:35mebaran151annotations are a bad bandaid for bad syntax
15:35cemerickthey're mostly fine for "users" (e.g. throwing a @Whatever on a field is pretty simple, straightforward way to compose functionality), but it's incredibly complex on the back end and the abstraction leaks hard outside of the simple cases.
15:35Anniepooannotations are mostly used for javadoc, which everybody seems to agree is lame, and
15:36ataggartand there's a tendency for people to abuse annotations beyond metadata, and start using it as configuration
15:36angermancan I have only one additional argument?
15:36Anniepooand J2EE, which is a bandaid on a piece of horribly broken technology
15:37cemerickAnniepoo: that is probably overly broad. JMS is a pretty fine piece of kit.
15:38baetis-flyi swore I saw a nifty function that would show the source code to another function but now i can't find it. did i imagine that?
15:38Anniepoo=8cO
15:38kotarakbaetis-fly: clojure.contrib.repl-utils/source
15:38mebaran151yep source
15:38mebaran151it's a fun function
15:39ataggartangerman: you can have multiple arguments (name="value") in an annotation
15:40mebaran151I often wish clojure had a more general source, like toSource in JS
15:40baetis-flykotarak, mebaran151: many thanks. didn't think to look in contrib for some reason.
15:40mebaran151seems like if functions really are data, they should have a printable structure that looks less like comic book swearing and is more generally useful
15:41hiredmanwell
15:41kotarakIt's a two-edged sword. It's easy to rely on the implementation...
15:41hiredmanyou would need to decompile them
15:41Chouserclojure functions used to be data, until they were compiled
15:42mebaran151I understand why they're compiled but this is lisp
15:42Chouserand even if you hang onto the pre-compiled forms, you lose formatting, comments, etc.
15:42mebaran151I was thinking more for something akin to serialization
15:43mebaran151I wouldn't expect data to keep its superficial representation
15:43mebaran151they have javascript bytecode interpreters that can uneval
15:43clojurebothttp://homepages.inf.ed.ac.uk/kwxm/JVM/codeByNo.html
15:43hiredmanclojurebot: good catch
15:43clojurebotPardon?
15:50Anniepoohmm... is there a way to get a "serialized" form? As in a string representation of it?
15:50Anniepoouser=> (str (repeat 0 10))
15:50Anniepoo"clojure.lang.LazySeq@0"
15:51lpetitHi
15:52hiredmanAnniepoo: prn-str
15:52Anniepoothanks
15:52lpetitMaybe you know this out of your head: do you know if there is an already existing function (in core or contrib), presumably called 'map-keys , which takes a fn, a map, and returns a new map with every value mapped to (fn old-key) (the caller having to ensure that fn is injective, of course)
15:55hiredman,(let [m {:a :b 2 :c 3}] (reduce #(update-in %1 [%2] inc) m (keys m)))
15:55clojurebot5
15:55hiredmanbah
15:55stuartsierrahmm, (defn map-keys [f map] (reduce (fn [m [k v]] (assoc m (f k) v)) {} map)
15:55hiredman,(let [m {:a 1 :b 2 :c 3}] (reduce #(update-in %1 [%2] inc) m (keys m)))
15:55clojurebot{:a 2, :b 3, :c 4}
15:55hiredmanthere must be something in contrib
15:56stuartsierraoh, wait, just (zipmap (map f (keys m)) (vals m))
15:56stuartsierraassuming keys and vals return use the same order
15:57Chousukeor (into {} (map (fn [[k v]] [(f k) v]) the-map))
15:58ataggartwoot, my first contribution toclojure-contrib is in github
15:58mebaran151I wish there were a better way of managing clojure contrib: it seems very hodge podgy
15:58mebaran151kind of the inspiration for a packaging system: so every one could mix and match in their own contrib
15:59Chousukeif you have suggestions, bring them up on the group.
15:59ataggartwe have plenty of suggestions; better would be to write it :)
15:59ChousukeOn IRC things tend to just get mentioned and then no-one does anything :)
16:00mebaran151heh
16:01ataggartif anyone is bored and wants to critique the contrib logging code, please feel free.
16:01mebaran151a co worker of mine is actually going to test his search stuff against a database clojure libs, both in contrib and out
16:01mebaran151he was the scheme guy, so he's been spoiled by wacky package management systems
16:02baetis-fly /quit
16:03lpetitGuys, I had a break for some minutes, and you implemented the functions, thanks but it was already done on my side :-) I was just trying to clean my code, and especially trying to not reinvent some clojure or clojure-contrib wheel :-)
16:04hiredmanI think there should be more jars
16:05hiredmanyou should not wait until you have a whole app and roll at all up into one jar
16:05hiredmanhave a namespace and 10 functions? make a jar
16:05lpetitSo map-keys (or whatever better name) is not already in contrib ?
16:05rhickeyaargh - google is not helping me find my old message re: seqable?, anyone with better email/rss tools able to do so?
16:06hiredmanseems like something for clojure.contrib.map-utils
16:08mebaran151hiredman, pretty much agreed
16:08achimrhickey: "Re: A nil puzzle" from 2009-01-25 - that one?
16:09mebaran151he's actually thinking of doing something, indexing packages at the funciton level and tracking imports in the ns declarations
16:09mebaran151*something cool
16:09AnniepooRich, I've been looking for a La Clojure user for a while. It's rumored you're an IntelliJ user
16:09mebaran151then you could pull only the namespaces that seem to reference things you'd like
16:11Chouserrhickey: dunno if this is the one you're thinking of: http://groups.google.com/group/clojure/msg/ea899cfd965744a8
16:12lpetithiredman: you think it's of sufficient general utility to be a contribution (I can make that, little contribution, to get started with the new Assembla stuff I haven't used yet)
16:12Chouserrhickey: I have yet to find better than using google web search to find messages at mail-archive.com, and then trying to find that specific message back over in the google group ui.
16:12RaynesAnniepoo: He's hiding it from us!
16:12AnniepooLOL
16:12RaynesAnniepoo: Looks like we'll have to break into his house and search his computer. >:)
16:12Anniepoowell, I feel bad - I ask noob questions and the only one who answers is Chris Houser
16:13Anniepooand now I'm having an IDE problem and the only user of my IDE I can find is Rich Hickey
16:14RaynesI use IntelliJ too, I just don't have it on this computer. I'm not sure which I would use if it was on this computer right now however, now that I'm accustomed to emacs.
16:14mebaran151Anniepoo, I know it seems like a step down, but you might look at Netbeans
16:14mebaran151it has a pretty sweet plugin
16:14RaynesThe IntelliJ plugin, the last time I checked, was a quite a bit far ahead of the NetBeans plugin.
16:14mebaran151really?
16:14mebaran151I actually found the netbeans plugin surprisingly competent
16:14rhickeyChouser, achim: it's older than those, arguing against seqable? with the example that strings were once not
16:15RaynesHowever, I'm not quite up to date with Enclojure because I can't get it to install on my PHP installation of NB 6.7
16:15mebaran151hmmm a php install....
16:15kotarakrhickey: that's mentioned in the message Chouser posted
16:15mebaran151I got running on a ruby install of netbeans
16:16mebaran151it does all the basic things you could ask for, except its code completion leaves a little to be desired
16:16AnniepooI like the La Clojure plugin, but at times it goes berzerk
16:16kotarakquote: There was a time when Strings weren't
16:16kotarak"seqable", now they are.
16:16mebaran151then again, I rarely used code completion
16:16AnniepooI get 100% CPU for a minute or so
16:17AnniepooSergey actually owes me a power supply, I burnt one out doing this
16:17AnniepooLOL
16:17Raynesmebaran151: It seems like, if there is any possibility of a problem emerging, I will find that problem in Enclojure, and no one else will be able to reproduce it. :|
16:17mebaran151have you tried a Java install of Netbeans
16:17rhickeykotarak: I guess so, it's just such a big discussion otherwise, I know I made that same point earlier in a smaller message
16:17mebaran151you can add the php stuff later as plugins
16:17RaynesNo, too lazy.
16:18mebaran151try adding the java stuff
16:18mebaran151enclojure probably needs the java integration to do its job
16:18RaynesIt pulls it down automatically, and I tried pulling it down myself, nothing works.
16:18hiredmanspeaking of php I got my php.lisp "compiler" to generate php function backed objects as closures
16:19mebaran151that's pretty neato
16:20mebaran151have you tried hosing your .netbeans dir?
16:20mebaran151I'm a unix person, so destroying all valuable data is always my first recourse :)
16:21Raynesmebaran151: The only way I can restart netbeans is by nuking the .netbeans dir.
16:21RaynesOtherwise NB wont even say hello.
16:22kotarakrhickey: http://markmail.org/message/56r3eflx4a6tasoe
16:22kotarakmaybe?
16:22mebaran151hah
16:22rhickeykotarak: wins
16:22rhickeythanks
16:22kotaraknp
16:24rhickeylead to this which is the one I remembered: http://groups.google.com/group/clojure/msg/fc3cd6e81c9afb8d
16:30rhickeyheh, now I can't get the ggroup msg ID of http://markmail.org/message/56r3eflx4a6tasoe
16:30rhickeywhy is ggroup history so shallow?
16:32stuartsierrafunny, google web search finds the markmail URL, but nothing on Groups
16:34achimrhickey: http://groups.google.com/group/clojure/browse_thread/thread/b2aa24dd1a86102f#
16:34achimgoogle should really be better at searching
16:35rhickeyachim: thanks, found how?
16:36rhickeyI went through my profile, which had a link for that month, but got tired after showing me only 4 pages
16:37achimplayed with the offset in the url, manual binary search :)
16:37rhickeyachim: yikes
16:37hiredman:/
16:37cemerickI call shenanigans ;-P
16:38stuartsierraI had no idea Google Groups had such crappy search.
16:38Chousergmail is also surprisingly bad
16:38stuartsierraSo the string in the URI is like a hexadecimal timestamp?
16:39rhickeystuartsierra: I think they are just limiting the window of time in the index for ggroups, I could find in my gmail once I used "seq-able?"
16:39cemerickI don't understand why the geek hipsters aren't beating a path to not-google at this point.
16:39stuartsierraBut at least gmail doesn't "forget" old messages.
16:39stuartsierracemerick: It's like Churchill said of democracy, it's the worst system except for all the others.
16:40cemerick*shrug* I've been using yahoo search primarily for about 2 months now with good results.
16:40rhickeyit's kind of silly they would keep the index for each gmail user but not the 2200 people sharing the group
16:40stuartsierrayes
16:40stuartsierraBut Groups has long been the least reliable of Google services.
16:53dysingerIs this the way things are supposed to go? I imagine this is because byte[] is an Object and object's default equals is =.
16:54dysinger(= (.getBytes "hello") (.getBytes "hello"))
16:54dysingerfalse
16:54dysinger(= (String. (.getBytes "hello")) (String. (.getBytes "hello")))
16:54dysingertrue
16:54dysingerI am rusty at java :P
16:54mebaran151I thought Object equals just compared the pointers
16:55mebaran151whereas strings got special overloadinjg
16:55kotarakI think that's identical?
16:55Anniepoono, to get proper string compaer in Java you have to use .equals
16:55Anniepoo== won't do it
16:55Anniepoo8cD A common source of bugs
16:56Chouserbut Clojure = uses Java .equals
16:56hiredman,(= (seq (.getBytes "hello")) (seq (.getBytes "hello")))
16:56clojurebottrue
16:56mebaran151I thought that Object.equals works on pointer equality
16:56Anniepooyes
16:56hiredman,(.equals (.getBytes "hello") (.getBytes "hello"))
16:56clojurebotfalse
16:56rhickey= uses equals(), which is a value comparison for strings and identity for arrays
16:56cemerick,(java.util.Arrays/equals (.getBytes "foo") (.getBytes "foo"))
16:56clojurebottrue
16:56mebaran151and you had to override equals to get semantic equals
16:59lpetitWhat does == add to = since it seems = can also be used with numbers ?
17:00cemerick== is object-identity
17:00cemerick,(identical? "foo" (str "fo" "o"))
17:00clojurebotfalse
17:00cemerick(= "foo" (str "fo" "o"))
17:00lpetit,(== 0 0.0)
17:00cemerick,(= "foo" (str "fo" "o"))
17:00clojurebottrue
17:00clojurebottrue
17:00ChouserClojure == can inline primitive args
17:01ChouserClojure = always boxes
17:01lpetitSo == is optimized for numbers ? Not very clear on the documentation
17:01lpetit,(doc ==)
17:01clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the same value, otherwise false"
17:02cemerick== returns false if any arg is a non-number, I thought
17:03Anniepoo== is optimized for pointer compare
17:03Anniepoo(sorry, thought u were talking java)
17:04lpetitcemerick: certainly, but as soon as one finds =, reads its doc, sees that it can handle numbers, I'm not sure one will then search again to find something more specific to numbers. Maybe making == and = docs self referencing could be an improvement
17:04cemerickyeah, perhaps
17:04dysingerYeah the == doesn't say it does anything different than =
17:04dysingeron the website
17:05dysingerit uses value
17:05lpetitIs it worth an issue and a patch ? I can do that
17:05rhickeylpetit: sure
17:06dysingercemerick: thanks for reminding me about Arrays/equals
17:06dysingerdang I am rusty at teh java
17:06cemerickyou can forget all your java. The jvm stuff, on the other hand, is worth knowing as best you can.
17:07cemericknot that I'm a great example of that, but....
17:08ChouserI'm getting a NPE in a proxy method -- after the object has been called (the object itself is non-null) but outside the appropriate fn.
17:08technomancy= for array identity is news to me
17:08technomancywould not have guessed that
17:10Anniepooilyas, are you the creator of La Clojure?
17:11lpetittechnomancy: are you talking about arrays or clojure vectors ?
17:11lpetittechnomancy: I mean <java> arrays
17:12technomancylpetit: right, I understand. it just means one more reason to avoid using Java arrays for anything but the closest layer of code that touches Java.
17:13lpetitt> ,(= (into-array String ["la" "clojure"]) (into-array String ["la" "clojure"]))
17:13lpetit,(= (into-array String ["la" "clojure"]) (into-array String ["la" "clojure"]))
17:13clojurebotfalse
17:13lpetittechnomancy: I would say it also mean use precise terminology and stick with the word "vector" Rich uses all over the clojure doc :-)
17:14lpetit:-p
17:14cemerickheh, just as I open my mouth about how I've been enjoying yahoo search, they go and white-label bing. :-P
17:14technomancylpetit: yeah, I'm not interchanging the two.
17:15lpetittechnomancy: sorry, no offense intended
17:16technomancyof course. =)
17:19angermanhow would I split and strip a string?
17:19angerman"foo, bar" -> "foo" "bar"
17:19technomancyangerman: re-split from contrib's str-utils maybe
17:20angermantechnomancy: hmm... let's see
17:21Chouser,(map #(.trim %) (.split " foo , bar " ","))
17:21clojurebot("foo" "bar")
17:24technomancyI'm looking at character detection libraries, anyone have thoughts on choosing between jchardet, cpdetector and juniversalchardet?
17:25technomancyjuniversalchardet is a port of Mozilla's algorithm, which I'd guess is pretty state-of-the-art
17:25angermanhmm... why are there str-utils and str-utils2?
17:26technomancyangerman: double the fun!
17:38Anniepooilyas, are you the creator of La Clojure?
17:39ChouserCaused by: java.lang.NullPointerException at clojure.proxy.my-pkg.MyClass.MyMethod(Unknown Source)
17:39dysingerangerman did you get your answer?
17:39ChouserI guess that's asm-generated code from proxy?
17:40dysingerangerman: here's my fugly one
17:40dysingeruser> (let [tokenizer (java.util.StringTokenizer. "hello, there, partner" ",")]
17:40dysinger (for [tokens (range (.countTokens tokenizer))]
17:40dysinger (.trim (.nextToken tokenizer))))
17:40dysinger
17:40dysinger
17:40dysinger("hello" "there" "partner")
17:40dysingeruser>
17:41rhickeyChouser: looks like proxy code
17:41cemerickChouser: yeah, but it's probably not a bytecode-generation problem -- I've seen similar things when passing nil when the proxy needs a boxed number.
17:41cemerick(or when it needs to return a boxed number)
17:41Chouserhm...
17:59bhurt_Have a stupid question: what am I doing wrong:
17:59bhurt_$ ./repl.sh
17:59bhurt_Clojure 1.1.0-alpha-SNAPSHOT
17:59bhurt_user=> (def x 1)
17:59bhurt_#'user/x
17:59bhurt_user=> (binding [x 4] (inc x))
17:59clojurebotx is w
17:59bhurt_2
17:59bhurt_user=>
18:01Chousukebhurt_: weird. Works for me.
18:01AnniepooOn the 19th bay area java users sig will be having a clojure hack
18:01Chousercemerick: you nailed it
18:02cemericknice
18:02Chousercemerick: the java method is supposed to return a bool, but my proxy fn was returning nil
18:02cemerickyeah, that's a java beating you around the head and ears. The autoboxing impl is sorta evil on the edges.
18:06bhurt_Hmm. Looks like a bug in the version of Clojure I have. Unfortunate. But easily fixable.
18:06bhurt_Grabbed a copy of 1.0 and it works as expected.
18:08Chouserbhurt_: that must be some odd version of clojure you've got there.
18:10bhurt_Not sure where I got it, but it has -alpha-snapshot in the release name.
18:11rhickeyChouser: you could compile in a call to RT.booleanCast if rtype is boolean instead of gen.unbox, in both gen-class and proxy
18:13ataggartif, during a dosync transaction, I read a value from a ref, will the same value akways be returned if the tx is retried, or will I get whatever is the latest value of the ref?
18:13cemericknot sure about that idea -- silently promoting nil to false seems like a recipe for producing harder-to-find-bugs...
18:13rhickeygoing to Java normally I can't do that, too many conflicts with overloading, no ambiguity on return
18:14rhickeycemerick: on return, really?
18:15rhickeyataggart: a retry is a new point in time, so things might have changed
18:15ataggartrhickey: thanks
18:19ataggartaaaaand it turns out the concern behind that question was moot, since ref-set doesn't have any effect if the tx is retried. I'm not yet used to *not* worrying about order-of-operations w.r.t. concurrent code.
18:19lpetitWhile filing the issue for the doc improvement of == and =, I thought : is it ok for == to return false if one of its arguments is not a number ? Shouldn't it be considered a bug from the programmer, and shouldn't we throw an IllegalArgumentException instead ?
18:20lpetitThat is (== "hi" 1) would throw IllegalArgumentException, and also (more interesting), (== "hi" "hi") would throw the exception, instead of just returning false (which could then be a rampant bug)
18:20ataggartwhat woudl you say the answer is in java for ("A" == 5)
18:21hiredmanrhickey: did you ever think about lexically scoping namespaces? like (ns same.ns (defn f [x] x)) ?
18:21lpetithiredman: same as modules in scheme ?
18:21ataggartlpetit: that (== 5 foo) is only true if foo is a number and foo is 5 has no bearing on other values of foo.
18:22lpetitataggart: the doc of == places an almost explicit pre-condition that arguments must be numbers. Not so for java ==
18:22hiredmanlpetit: never really used scheme
18:22ataggartthe precondition is only for when the result can be "true"
18:22ataggartelse everything is false
18:22lpetithiredman: me too, really, just wondering :-)
18:23lpetit,(doc ==)
18:23clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the same value, otherwise false"
18:23rhickeylpetit: can't, since equiv is used in scenarios where equals is, and must similarly not fail
18:23lpetitataggart: "if nums all have" => it's pretty clear to me, args are expected to be nums
18:23ataggartI should be able to do
18:23ataggart,(filter #(== 5) '("a" 5 "b" 5))
18:23clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: sandbox$eval--5788$fn
18:23ataggart,(filter #(== 5 %) '("a" 5 "b" 5))
18:23clojurebot(5 5)
18:24ataggartI shouldnt be forced to handle an exception there
18:24rhickeylpetit: I think it used to blind cast to Number and throw
18:24lpetitrhickey: what is "equiv", is it the literal name for == ?
18:25rhickeylpetit: follow the source
18:25lpetitrhickey: sorry for my english, literal is not the right word I think
18:27lpetitrhickey: even more weird, look :
18:27lpetit,(== "hi")
18:27clojurebottrue
18:27lpetit,(== "hi" "hi")
18:27clojurebotfalse
18:27lpetit:$
18:28lpetitrhickey: padawan currently following the source
18:28lpetit:)
18:28rhickeythe improved docs should make it clear not to do that :)
18:30lpetitrhickey: something like "unspecified behaviour if used with non numbers args" ?
18:30rhickeyi.e. == is a numbers op only for when working with known numbers, in all other cases use =
18:31rhickeyi.e. in ataggart's case above using == is not a good idea
18:32rhickeylpetit: most of Clojure has unspecified behavior if used incorrectly, I really don't like specifying 'unspecified'
18:32lpetitrhickey: ok.
18:34lpetitrhickey: a last word please: could == benefit from the new precondition machinery, though ? (I'm not volunteering to make a global pass on clojure.core, still just focusing on == :-) )
18:35replaca_lpetit: have you digested the stuff I wrote about how pprint works? Did that help?
18:37rhickeylpetit: == returns true if x and y are 2 equivalent numbers, false otherwise
18:38lpetitrhickey: ok. Thanks for all.
18:39lpetitreplaca_: I'm so sorry, but I had vacations, and then Howard unveiled a bad performance bug that stuck me. Still on it, since the way to solve it could have deep implications in the current implementation of clojuredev.
18:41lpetitreplaca_: but it gave me time to think about it "offline", and I don't think I'm ready to follow this path, finally. At least not in a first implementation.
18:41gulagong__hi
18:41lpetitWe finally have 2 remaining challengers for the new name of clojuredev --> coming soon :-)
18:42mebaran151how would one functionally transform a Number into a byte array?
18:43mebaran151I'm thinking of something like 60 bytes per number with 4 bytes or so to describe the mantissa
18:44gulagong__i just wrote a macro which takes a binding-list and while doing so i discovered that there is some kind of restriction for binding-lists....?
18:44hiredmanbinding-list?
18:44gulagong__mom
18:45gulagong__i post the code...
18:45lpetitrhickey : docs for >=, <=, also state "... non nil" , should I replace it with "true" while I'm at it ?
18:45hiredmanlisppaste8: url?
18:45lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
18:46lisppaste8gulagong__ pasted "matrix multiplication" at http://paste.lisp.org/display/84411
18:47gulagong__ok :)
18:47replaca_lpetit: ok, cool
18:47gulagong__the problem is, that this is not possible:
18:48gulagong__(mat-mult '(0 0) matrix #(somefn))
18:48hiredmanwell
18:48gulagong__it will only accept vecs as first argument
18:48hiredmanthe problem there is you are calling the wrong macro
18:48lpetitreplaca_: well, not so cool, I wish I had some more time to work on it, I would surely have followed the pprint path more before making my choice :-(
18:48hiredmanthe name of the macro you posted is mat-map
18:49gulagong__d'oh
18:49gulagong__i mean mat-map
18:49gulagong__mean.... english....
18:49gulagong__i wanted to write mat-map
18:49hiredmangulagong__: what is the exeption that you get?
18:51gulagong__Unsupported binding form: (k g)
18:51hiredmanare you absolutly sure that exception comes frim this macro?
18:51hiredmanare there any other macros you are using?
18:52gulagong__if i do (mat-map '(k g) matrix fn)
18:52gulagong__nope, just this macro
18:52hiredmanI don't see where that exeception could come from in this macro
18:52replaca_lpetit: yeah, I understand. That's a hard problem, though. At some point, I may do some general framework work in that direction myself. But I don't have the time either now.
18:52gulagong__this works: (mat-map [k g] matrix fn) but this doesn't: (mat-map '(k g) matrix fn)
18:53lpetit,(<= 1 2 :a)
18:53clojurebotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number
18:53lpetit,(<= 2 1 :a)
18:53clojurebotfalse
18:53hiredmangulagong__: can you paste the output of (macroexpand-1 '(mat-map '(k g) matrix fn))
18:54gulagong__a lot of gensyms ;)
18:54gulagong__(clojure.core/let [size-y__15045__auto__ (clojure.core/count matrix) size-x__15046__auto__ (clojure.core/count (clojure.core/first matrix)) top-i__15047__auto__ (clojure.core/- size-y__15045__auto__ 1)] (clojure.core/loop [quote (clojure.core/int 0) (k g) (clojure.core/int 0) mat__15048__auto__ matrix] (if (clojure.core/= (k g) size-x__15046__auto__) mat__15048__auto__ (clojure.core/let [zero-i?__15049__auto__ (clojure.core
18:54gulagong__/= quote top-i__15047__auto__)] (recur (clojure.core/int (if zero-i?__15049__auto__ 0 (clojure.core/inc quote))) (clojure.core/int (if zero-i?__15049__auto__ (clojure.core/inc (k g)) (k g))) (clojure.core/assoc-in mat__15048__auto__ [quote (k g)] (fn (clojure.core/get-in mat__15048__auto__ [quote (k g)]))))))))
18:54hiredmanuh
18:54hiredmangulagong__: paste to the pastbin
18:54hiredmannot the channel
18:55gulagong__to paste.lisp.org?
18:55hiredmangulagong__: if you go to your previous paste there is a button at the top of the page "Annote this paste"
18:56gulagong__hiredman: thanks, i paste some more code so you can see for yourself :)
18:56hiredmanfor feature reference, always paste to a pastebin
18:56hiredmanfuture
18:57lisppaste8gulagong__ annotated #84411 "untitled" at http://paste.lisp.org/display/84411#1
18:57hiredmanuh
18:57gulagong__hiredman: funk takes only one arg
18:57hiredmanthat is not what I asked for
18:58hiredmananyway, (k j) is litered through out your macro expansion
18:59hiredmanI would check to make sure the code you pasted is really what is being run (did you edit the macro and not re-evaluate it)
18:59gulagong__yap
19:00hiredmanI would start from scratch
19:00hiredmanthat is a complex macro
19:00gulagong__(mat-map '(i j) (create-matrix (double 0) 3 3) #(+ %1 i j))
19:00gulagong__doesn't work
19:00hiredmanso start from scratch, testing as you go to make sure the output is correct
19:00lpetitgit expert around here?
19:00gulagong__the macro works...
19:01hiredmangulagong__: if it works then what is your question?
19:01gulagong__but i don't see why i shouldn't use a list instead of a vector
19:02gulagong__(mat-map [i j] .....
19:02gulagong__works perfect
19:02lpetitI've added a file in the index. I would like to see the diff between the index content and the commit onto which I'm working. git diff doesn't work
19:02hiredmangulagong__: [i j] is valid in side a let
19:03hiredmanas a name
19:03hiredman(i j) is not
19:03hiredmanso inside your macro something is expand to something like (let [(i j) foo] )
19:03hiredmanwhich is not valid
19:03gulagong__no
19:03hiredmanYes
19:03gulagong__look at the first two lines
19:03hiredmangulagong__: something like!
19:04hiredmansomething like!
19:04hiredmannot exactly that
19:04gulagong__(let [i (first bindings)]
19:04lpetitOk, found it : git diff --cached or git diff HEAD in my case
19:04hiredmangulagong__: look at the macro expansion for the macro
19:05hiredmanyou will see something similar in form to (loop [(x y) something]
19:05hiredmanwhere x and y are some symbols
19:06gulagong__hiredman: ok, i will try
19:06hiredmanclojurebot: destructuring
19:06clojurebotdestructuring is http://clojure.org/special_forms#let
19:06hiredmangulagong__: check that out
19:06gulagong__hiredman: but there are so many gensyms...
19:06hiredmangulagong__: so?
19:07gulagong__hiredman: i'm no computer ;)
19:07hiredmanif you don't want to read macro expansions then don't write macros
19:07gulagong__hehe
19:07hiredmanI am not saying you have to trace the execution of the thing
19:07clojurebottrace is (in contrib) http://github.com/kevinoneill/clojure-contrib/commit/43e4168fc8772225c7f749ffb363b0e2a8f7b84f
19:07hiredmanjust look at the binding forms
19:08hiredmanlet, loop, etc
19:08Drakesonhow can a namespace export [some] symbols that it USEs or REQUIREs from other namespaces?
19:08hiredmanlike at the vectors
19:08hiredman~namespaces
19:08clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
19:08gulagong__but i never expand the binding except when i pull the two symbols
19:08hiredmangulagong__: the macro expansion says otherwise
19:08hiredmanI can believe either you, or the actual code
19:09gulagong__;)
19:09hiredmanclojurebot: that is not what I wanted
19:09clojurebotIk begrijp
19:09gulagong__i'll read
19:09hiredmanDrakeson: I am pretty sure you have to re-intern the functions into the new namespace
19:10hiredmanhttp://clojure.org/namespaces
19:12gulagong__ok, now i'm confused
19:13hiredmangulagong__: I recomend you start from scratch and incrementally write the macro, and as you go check the expansion to make sure it is what you want
19:13gulagong__inside the macro (first '(i j)) results quote and (second '(i j)) results (i j)
19:14lpetitrhickey : ok, issue 163 created, and ready to test
19:14gulagong__thanks anyway
19:14gulagong__on this way (i j) creeps inside the binding form
19:17gulagong__but i still have no clue how ;I
19:17gulagong__;)
19:17gulagong__but i'm quiet now
19:20durka42gulagong__: '(i j) means (quote (i j))
19:20durka42,(macroexpand ''(i j))
19:20clojurebot(quote (i j))
19:23G0SUB(hello-world!)
19:25cemerickrhickey: sorry, yes, RT.booleanCast would be OK if rtype is boolean
19:28lpetitDrakeson: see immigrate in this thread: http://groups.google.com/group/clojure/browse_thread/thread/180185dfcb88d7ea
19:28Drakesonlpetit: thanks. too late though. I wrote one. ...
19:33gulagong__durka42: thanks, that explains it.... although i should have known it
19:34gulagong__than i can't do it with a list
19:34gulagong__cause (list i j) evals i and j..
21:02rhickeyit's ........ alive
21:03rhickeyfirst object created with new new
21:06durka42I, for one, accept our new new overlords.
21:13RaynesCheers!
21:13RaynesA bit late, but I just noticed the message. :>
22:27prospero_I'm finding references to gen-and-load-class, but it doesn't seem to exist anymore
22:28prospero_if I want to define a custom exception, what's the preferred way to do it?
22:35Chouserprospero_: you can gen-class (and AOT compile it), or use one of the contrib libs: except, error-kit, or ...
22:35Chouserbah, too slow.
22:56eyerisIs there a way to make test-is/run-tests be verbose?
22:56RaynesAsk it nicely. ;)
22:57mebaran151Chouser, couldn't you proxy on Throwable?
22:57Chousermebaran151: yes, but that gets you exactly one new class.
22:57mebaran151ah
22:57Chouserno matter how many times you proxy it
22:57mebaran151I see
22:58Chouserand you don't get to name it. end up being a bit silly.
22:58ChouserI guess it depends on why you want a custom exception
22:58mebaran151ah I do see
22:59mebaran151I kind of wish that Java was more like Javascript and you could throw anything
23:00Raynesmebaran151: I wouldn't want Java to throw me. :|
23:01prospero_Chouser: I think I may have been disconnected while you answered my question
23:02mebaran151Raynes, but then you could be Exceptional (har har)
23:02Raynes;)
23:02Chouserprospero_: I should probably first ask why you want a custom exception
23:02prospero_well, I've since decided that I don't
23:02Chousergreat!
23:03prospero_but for the sake of satisfying my curiosity, I was walking a tree, and wanted to throw an exception that would bubble up
23:03prospero_or rather, bubble up any exceptions that were thrown
23:04prospero_the easiest way I could think to do that was to wrap any exceptions in a custom exception, and not touch that custom exception on the way up
23:04prospero_is there a better way than that?
23:05Drakesonliebke: ping
23:05liebkeDrakeson: Hey
23:06Drakesondo you have a call to JFreeChart.createBufferedImage() in incanter?
23:06Chouserprospero_: could you just pass fn down (perhaps via a binding) and call it with your exception info?
23:06liebkeno, I don't
23:06Drakeson(like, say, when you want to produce a graph in a webserver, and do not save it on disk)
23:07Drakeson(and feed it directly out to the client)
23:07liebkeah, good point
23:07liebkeI'll put that on the todo list
23:07Drakesoncool. thanks :)
23:08prospero_Chouser: that would work, it just seems a little more contrived than what I was trying to do
23:08prospero_or rather, it would be more contrived if it weren't such a pain to generate a class
23:08DrakesonBTW, thanks again. Incanter is incredible.
23:09liebkeThanks :)
23:09Chouserusing exceptions for flow control is discouraged
23:09liebkeI've added createBufferedImage to the TODO list. Goodnight all
23:10prospero_Chouser: I just wanted the exception to contain information about where in the tree the exception occurred
23:12ChouserWon't any ol' exception do for that?
23:13prospero_well, not if you're trying to capture exceptions at every level in the tree to append more information to them
23:14prospero_I mean, that would work
23:14prospero_but it would have potentially a lot more stuff in there than you'd like
23:14prospero_maybe I'm missing something, though?
23:14hiredmanthat all sounds like a bad idea
23:14prospero_like I said, I've since decided against doing any of this
23:15prospero_this is all an academic discussion at this point
23:16hiredmanif it was academic there would be footnotes
23:16prospero_ha
23:16hiredmanand it would be in haskell
23:16prospero_anyways, it's not a big deal
23:16prospero_I'll drop it
23:16hiredmanzing!
23:17Chouserwell, you can certainly create a custom named exception using gen-class and then AOT compiling.
23:19prospero_yeah, I found the archived discussions of gen-class vs gen-and-load-class
23:20prospero_on a completely different note, has anyone seen this github recommendation competition?
23:20prospero_it seems interesting
23:22Chouserlink?
23:23prospero_http://contest.github.com/
23:23eyerisWhen I use the <javac> target in my build.xml for my .java files, it always recompiles, even if the .java files haven't been touched since the last compile. Is there a way to prevent this?