#clojure logs

2012-03-01

00:00gtuckerkellogghas anyone here had a look at the Clojure implementation in python that just showed up on github?
00:01accelIs there something equivalent to an OpenGL displaylist, but operates on Java Graphics2D environments? For example, I have a bunch of commands I end up sending a Java Graphics2D -- I would like to "save/replay" the list of commands -- basically a display list. Is there a way to do this? Alternatively, is there some Java component that operates as a Graphics2D, but then I can render into anotehr Graphics2D? (I don't want to render to image, then image to Gr
00:01technomancygf3: I like the UI
00:02gf3technomancy: thank you, I wanted something extremely basic
00:03ibdknoxyeah, that's neat
00:36choffsteinAnyone know why I might be getting a 'java.util.zip.ZipException: ZIP file must have at least one entry' from 'lein uberjar'?
00:48choffsteinDamnit, I always forget to use _ instead of - with java interop...
00:51amalloychoffstein: you generally don't have to, right? clojure will munge the names
00:52choffsteinWell, I had to do it with :import earlier, and I just had to change my :main config in my leiningen project from - to _
00:52choffsteinThese little "gotchas" seem to get me wayyyyy too often
00:57seancorfieldclojure.java.jdbc 0.1.2 just despatched to maven central...
01:14MenTaLguYhmm
01:14MenTaLguYcan record definitions be made visible outside the namespace in which they are defined?
01:14brehautMenTaLguY: what are you wanting to do with the record?
01:15MenTaLguYjust instantiate it really
01:15MenTaLguYI could certainly create constructor functions and use those or something
01:15brehautMenTaLguY: in 1.3 you should use the concstructor functions
01:15brehauteg, (defrecord Foo …) creates ->Foo and map->Foo
01:15emezesketechnomancy: Would you expect the rlwrap/jline stuff in the Leiningen shell script to work for trampoline" commands?
01:16MenTaLguY->Foo?
01:16xeqiseancorfield: did you find a different fix for sqlite, transactions, and requiring the result set to be closed?
01:16choffsteinMenTalguY: You should be able to import them
01:16brehautchoffstein: but you sjhouldnt need to if constructing them is all you want
01:16MenTaLguYyeah, I really just need constructors
01:17brehautMenTaLguY: (defrecord Foo [a]) (->Foo 1) ;=>#user.Foo{:a 1}
01:17choffsteinI really need to read something on "good clojure code"
01:17MenTaLguYhm, that doesn't work for me
01:17MenTaLguYI thought I was using 1.3
01:17MenTaLguYhm, I guess not
01:18brehautyeah you have to be in 1.3 or up. in 1.2 you probably want to create a constructor yourself
01:18brehaut(although dont name it the same as the autogenerated constructor)
01:19choffsteinIs lein 1.7 stable?
01:20brehautMenTaLguY: otherwise, you need to a) require the namespace containing the record definition (at least once, somewhere in the code, best to do it whenever you reference it) and b) then import it
01:21brehautimport without the require (or use) will fail because the class is generated at runtime (unless you AOT your project i guess)
01:21MenTaLguYb) = import it as a Java class?
01:21brehautyup exactly
01:21MenTaLguYaha
01:21MenTaLguYokay, I was assuming that defrecord Foo created a var named Foo
01:21MenTaLguYbut it's a class name instead
01:21MenTaLguYnow I understand the behavior
01:21brehautactually it does both
01:21hiredmanin 1.3+ you get factory functions for records
01:22hiredman(->Foo ...)
01:22brehautbut the var is bound to stuff other than the class
01:22MenTaLguYmm
01:22brehautwait. i might be thinking of records; ignore my foolishness
01:25xeqiseancorfield`: https://gist.github.com/1947746 - looks like there is a sqlite transaction issue
01:25MenTaLguYI'm thinking of records
01:26brehautsorry, i meant protocols. having a brain failure
01:26brehautjust for the bit about being bound to stuff other than the class
01:26MenTaLguYmm
01:26hiredmanrecords somewhat similar in doing some funkiness with the mapped names in the namespace
01:28brehauthah macro expanding a defrecord is not for the feint of heart
01:30hiredmancertainly not
01:31brehauthuh. so the defrecord does an implicit import of the record class when it is created
01:33hiredmanit actually imports a different class with the same name everytime it is run
01:34brehauthiredman: what is the purpose of the `(let [] …) ? why not a do?
01:34MenTaLguYI imagine that's probably an artifact of macro expansion
01:34brehautoh sorry, im looking at the macro source here
01:34MenTaLguYmaybe there are other cases in the intermediate macros where that let would be populated... ah
01:34brehautits much less boggling
01:34MenTaLguYso I don't know then
01:36choffsteinAnyone use s3-wagon-private? I am trying to deploy to a private repo and all of a sudden I am getting an Authentication Failed error...
01:36hiredmanbrehaut: I think it is to prevent the code from being evaluated using the rules for top level dos
01:36brehauthiredman: ah interesting thanks
01:36hiredman"compile this as one chunk, all using the same classloader)
01:36hiredman"
01:36hiredmanah, damn brackets
01:37brehautthats really intersting
01:38hiredmanI think it was actually switched for a do at one time and it broke
01:38brehauthuh
01:40brehauti wonder if its time to remove 'Alpha – subject to change' from the docstrings
01:42hiredmanhttps://github.com/clojure/clojure/blob/5f090a0925f3dcbd3fa8b7104cd59b6d4c087413/src/clj/clojure/core_deftype.clj#L153
01:42hiredmanhuh
01:43brehautcurous
01:43hiredmanhttps://github.com/clojure/clojure/commit/2ac93197
01:43hiredmanthats the one
01:43hiredmanoh, right
01:44brehautthe commit message makes it clear
01:44hiredmanbecause the dynamic classloader keeps a weakreference to the class, so it was possible for the class to be create, then flushed before it was used
01:44MenTaLguYthat's one of those commits that really wants an explanatory comment at the site
01:44hiredmancrazy race condition
01:44hiredman2 years ago
01:50bbloomi need a little help writing some production quality code with refs and file io
01:51MenTaLguYhm, I guess the first rule of transactions and io is don't cross the streams
01:51bbloomyeaaah, hence why i need help :-)
01:51bbloom1 sec, my irc is freaking out
01:52bbloomk let me try again :-)
01:52bbloomso basically i want a disk-backed map
01:52bbloomi need the D of the ACID ;-)
01:53bbloomi want to work entirely in memory, but load missing values from disk & write through to disk on changes
01:53bbloomi have much higher read load then write load
01:53MenTaLguYso not a clojure map (in the sense of implementing IMap)?
01:53bbloomit's a normal {} clojure map
01:54MenTaLguYin which case I think "write through to disk on changes" might be your first issue
01:54MenTaLguYsince normal clojure maps are immutable
01:54bbloomwell changes to the ref :-P
01:55MenTaLguYso how do you envision lazily fetching keys from disk working?
01:55bbloomi want:
01:55bbloomtry to get from map
01:55bbloomif it's there, great!
01:55bbloomif it's not there, load it from disk and cache it in the map
01:56replacatechnomancy: you there? I've got a couple questions on precate
01:56bbloomwhen adding a key to the map, write a copy to disk
01:56MenTaLguYI don't think you can get from here to there with normal clojure maps, at least not with that kind of interface
01:56bbloom…really?
01:56bbloomit seems pretty straight forward… i'm just concerned about consistency of things
01:56bbloomit seems like:
01:57bbloom(if-let [foo (get-cached-foo)] foo (if-let [foo (load-foo)] (do (cache-foo) foo) (new-foo)))))
01:57bbloomon get
01:58bbloomas long as i write to /tmp/new-foo-123123213 and then rename atomically the file into place
01:58bbloomin the "write" code path
01:58brehautbbloom: you'd have to lock all the other transactions though, otherwise you would be risking hitting the disk multiple times concurrently for the same piece of data
01:58brehautwhich kind of defeats the point of a transactional memory system
01:58hiredmanbbloom: see https://github.com/clojure/core.cache
01:58brehauts/lock/some non-composable coordination mechanism/
01:59bbloomhiredman: thanks, will look
01:59bbloombrehaut: it sounds like you're saying clojure's STM is simply incompatible with durability… which doesn't make sense… sooo what am i missing?
01:59brehautyeah that is what im saying
02:00brehautnot that im an expert
02:00brehautbut if its all in memory, its not going to be durable
02:00bbloomhence why i want to write to disk :-)
02:01brehautbbloom: but if you add that disk durability what you have is not a transactional memory system, its an on disk database
02:01brehautthat you happen to cache in memory
02:02bbloomyeah, so?
02:02brehautwell then, why try to shoe horn it into STM?
02:02brehautwhy not just use a database that does this for you?
02:03bbloomb/c i want to do some complex analysis that is simply not well suited for a relational model
02:04brehauti never said relational database
02:04bbloomwell regardless, i have a lot of small objects that form a complex relationship graph that i want to traverse very quickly in memory
02:04bbloomoccasionally, i append data to it
02:05bbloomseems like this shouldn't be a "don't do that" situtation lol
02:05brehautits more that theres more than one in memory cooridination mechansim in clojure
02:06bbloomand my question is how best to coordinate them to ensure consistency with a single file on disk per key
02:06brehautthats a better question :)
02:06clojurebotGabh mo leithscéal?
02:06brehautand one i dont know the answer to
02:09bbloomwell maybe we can work it out :-)
02:10seancorfield`xeqi: yeah, i missed a test in the patch and that's the only thing that highlights the issue
02:10bbloomi'm trying to avoid explicit locking
02:10xeqiseancorfield`: making new patch now for it
02:11bbloomusually, i'd write to /tmp/whatever & then rename(2) it into place atomically
02:11bbloomwhich clearly i can do here… but i'm not sure how to coordinate that with dotrans or whatnot
02:12bbloomdosync, rather
02:17bbloomcore.cache looks really nice tho
02:17bbloomi have to study it a bit more…
02:28_ulisesmorning all
02:35seancorfieldxeqi: ok, java.jdbc 0.1.3 is headed for maven now with that extra test (and the fix) for sqlite
02:38xeqiseancorfield: thanks for all your work on it
02:40replacab
02:41seancorfield`xeqi: sorry for not picking up all the bits of your original patch... by the time i'd waded thru all the sql server stuff, it was quite out of whack :)
02:42seancorfield`the only db i don't have setup locally now is postgresql
02:43xeqiheh, I remember having fun trying to figure all the mssql on ec2 stuff
02:45xeqiI'm a big fan of vagrant for project setups like dbs
02:48bbloombrehaut: this thread is helping: https://groups.google.com/forum/?fromgroups#!searchin/clojure/agent$20dosync$20file/clojure/N0SYT7soAtU/-d_eH-4P_gMJ
02:48bbloom(and the linked threads)
02:48bbloomit seems like the strategy is to send the file writing to an agent
02:49bbloomand then update the refs from the agent
02:54BahmanHi all!
02:56seancorfield`xeqi: i have a win xp VM with sql server 2005 express on it :)
02:57seancorfield`and now i have the jtds and ms sql server drivers on the mac so i can run mvn test with suitable env vars and test against sql server running in the VM
02:57seancorfield`hi Bahman
02:57BahmanHey seancorfield`
03:13j0k3rnew to clojure, was trying to solve http://www.4clojure.com/problem/26#prob-title
03:13j0k3ri am trying it on clooj
03:14j0k3r(defn fibo [x n a b] ( (if (> x n) '() ( concat '(+ a b) ( fibo (+ x 1) n b (+ a b) ) ) )) )
03:15AimHereThat takes 3 too many arguments, doesn't it?
03:15j0k3rthis returns (fibo 1 2 0 1) it returns (+ a b + a b)
03:15j0k3rcan anyone please point me to what is going wrong?
03:15raekj0k3r: you have a quote in there for some reason
03:15AimHereYou're quoting a and b
03:16raekj0k3r: better to use (cons element seq) than (concat [element] seq)
03:16AimHereAlso you probably meant '(list (+ a b))', but go with the cons instaed
03:16AimHere*cons
03:16raek(concat [element] seq) could also be written as (concat (list element) seq), which is what I think you meant
03:16AimHere*instead
03:19raekI would write it (assuming a non-lazy, stack consuming version here) as: (defn fibo [n] (letfn [(iter [n a b] (when (pos? n) (cons (+ a b) (iter (dec n) b (+ a b)))))] (iter n 1 1))
03:21AimHereI would cheat. (fn [n] (take n '(1 1 2 3 5 8 13 21 34 55)))
03:21j0k3rI thought '(+ a b) will create a list
03:21AimHere' is a synonym for 'quote'
03:21AimHereAs in, don't evaluate the contents
03:22j0k3roh ok
03:22AimHereIt's confusing you, because when you need to type a list in the repl, you need to quote it
03:22AimHereOtherwise it gets evaluated too soon
03:22raekj0k3r: '(1 2 3) will be a list, because "(1 2 3)" is a list in the source code
03:23raekjust like 'foo becomes a symbol
03:23raekit is not intended as a syntax for data structure literals
03:23j0k3r(defn fibo [x n a b] ( (if (> x n) () ( concat (+ a b) ( fibo (+ x 1) n b (+ a b) ) ) )) ) this is w/o the quotes version
03:23j0k3rand calling (fibo 1 1 1 1)
03:24j0k3rthrows classcast exception
03:24raekj0k3r: this will not work. lets assume a = b = 1. then (concat (+ a b) ...) becomes (concat 2 ...)
03:24AimHereThat's because you're trying to concat (+ a b), which is just a number
03:24raekbut 2 is not a sequence!
03:24AimHerecons it instead, or if you're REALLY stuck on concat, make a list out of (+ a b)
03:25raekj0k3r: you want 'cons' here
03:26raekj0k3r: [1 2 3] is short for (vector 1 2 3), {:a 1, :b 2} is short for (hash-map :a 1 :b 2), but there is no short for (list 1 2 3)
03:28AimHereWell (1 2 3) IS a list, but since your interpreter is eating up lists and evaluating them as code it's not the list you want
03:29AimHereIgnore what I just said, though, because it'll confuse you at this stage ;)
03:29clojurebotPardon?
03:29j0k3r(defn fibo [x n a b] ( (if (> x n) () ( cons (+ a b) ( fibo (+ x 1) n b (+ a b) ) ) )) ) the cons version throws EmptyList cant be cast to clojure.lang.IFn
03:30j0k3rI also tried creating a list out of the fibo call but throws the same error
03:31raekj0k3r: you are calling the result of the (if ...) expression
03:32raekrewrite (defn fibo [x n a b] ((if ...))) into (defn fibo [x n a b] (if ...))
03:34j0k3rthanks a lot raek and aimhere, that worked!
03:35j0k3rofftopic: whats a good way to copy/paste code from clooj to irc
03:35j0k3r?
03:36raekj0k3r: people often use https://refheap.com/paste or http://gist.github.com/ unless the code is very short and fits on one line
03:37raekand then post the link to the paste
04:20ar_for 4clojure problem #26 fibonacci seq I am trying to define a function inside a function : https://refheap.com/paste/898
04:21ar_this throws an exception : #<CompilerException java.lang.IllegalArgumentException: let requires an even number of forms in binding vector (NO_SOURCE_FILE:2)>
04:21muhoowhat'd be a good jvm to use for clojure on an ARM platform (angstrom/openembedded)?
04:21ar_when called like : (fibo 2)
04:21ar_any pointers?
04:21accelI would formally like to file a compliant with the council of clojure wizards. How the &*#! does clojure pick which java function to call when there are multiple java functions of the same name that take the same number of arguments? I'm constantly baffled by which one of java's Graphics.drawImage is being called. Is there a good tutoirla on getting this to work? I tried hinting it via #^ to give type hints on the arguments, but clojure's there like "no d
04:23accelI can't even properly google for this, when I gogole for "clojure pick java function" or "clojure choose java function", all I get are all these posts about how happy peopl are for CHOOSING/PICKING to use CLOJURE, on teh JAVA vm, and do FUNCTIONAL programming --- argh; google-fu fail
04:25amalloyaccel: (a) your first rant was so long it didn't fit in an IRC message, and (b) that means you're not type-hinting correctly
04:28accelamalloy: I will look into type hinting; thanks
04:38vijaykiranaccel: does this help ? https://gist.github.com/381625
04:39christianbergar_: Your code has several problems... First, lose the extra set of parentheses (opening on line 2).
04:39clgvvijaykiran: accel: with (:import 'mypkg.Ugly) you can skip the namespace in the code
04:40raek(import 'mypkg.Ugly) or (ns ... (:import mypkg.Ugly))
04:40raekno quote in the the latter case
04:40vijaykiranwasn't my code :-) http://stackoverflow.com/questions/2722856/how-do-i-call-overloaded-java-methods-in-clojure
04:40christianbergar_: Also, you need to quote the lists in your first two cond clauses, or use vectors instead: [1] and [1 1].
04:41clgvraek: lol right. I thought of both at ones ;)
04:41clgv*once
04:41raekotherwise (:import 'mypkg.Ugly) is treated as (:import (quote mypkg.Ugly)), that is "import the mypkg.Ugly class from the quote package"
04:42christianbergar_: And then, of course, the function never terminates when n>2.
04:42raekaccel: since Clojure 1.2 type hints use ^Class syntax instead of the old #^Class syntax
04:50accelvijaykiran: nice; thanks
04:50accelraek: noted
04:53raekaccel: This is (briefly) described here: http://clojure.org/java_interop#Java%20Interop-Type%20Hints
04:58bOR_'(+ 3 1)
04:59vijaykiran,(+ 3 1)
04:59clojurebot4
04:59bOR_thanks.
05:13vijaykiranWhat's the best way to keep the agent state - persisted (as in: to a database)
05:13vijaykiranshould I just send-off a function/agent that writes the current to db ?
06:48Kototamahi, what's wrong with this code http://paste.lisp.org/+2QTN it works but when compiled into a WAR the protocol can not be found
06:49clgvKototama: usually you have to (:import the
06:49clgvargs
06:50clgvKototama: humm. could be an :import issue.
06:52Kototamait don't thing so, defprotocol doc says "defprotocol is dynamic, has no special compile-time
06:52Kototamaeffect, and defines no new types or classes."
06:53clgvKototama: defprotocol defines a matching interface
06:53Kototamabut why does the code works with SLIME but not compiled?
06:55clgvthats a good question afaik satisfies? works on the protocol and not the interface
06:55clgvis satisfies? really the line which causes the exception?
06:56clgv(defprotocol Bla (blubb [this x])) (.isInterface user.Bla) => true
06:59Kototamahum maybe not
06:59Kototamathe error is at carneades.engine.argument_construction__init.<clinit>(Unknown Source)
06:59Kototamaso while initialization the namespace
07:00Kototamato i need to (:gen-class) the file defining the defprotocol?
07:02clgvKototama: no. that should not be necessary
07:02clgvmaybe there is an entirely unrelated error in there
07:03clgvyou should look at the ensted exceptions which will tell you more
07:03clgv*nested
07:06Kototamai'll paste the stacktrace because i don't see the error
07:09Kototamahere the nasty error http://paste.lisp.org/display/128075#1 :-S
07:11clgvcan you past carneades.engine.argument_construction.clj as well?
07:12clgvwhat clojure version do you use?
07:12Kototama1.3
07:12Kototama(:import of the protocol does not work
07:13clgvyeah. I guess you use the interface somewhere where you dont :use or :require the namespace it is in
07:13Kototamathe file is here: https://github.com/carneades/carneades/blob/port-pm-tool/src/CarneadesEngine/src/carneades/engine/argument_construction.clj
07:13clgvyou can verify that by explicitly AOTing the file that defines the protocol. then it will run smoothly
07:14raekKototama: at the point where you import the class, has the clojure file that defines it been evaluated?
07:14raek(i.e. have you required the namespace before importing the class?)
07:14Kototamayes
07:23Kototamait seems analgous to me here http://stackoverflow.com/questions/6003313/noclassdeffounderror-on-a-protocol-when-requiring-its-namespace
07:31clgvKototama: did you try to AOT-compile the file defining the protocol yet?
07:31clgvthat should fix the problem and indicates that you are currently missing a require or use
07:39Kototamai'm trying now
07:42clgvKototama: if you are using leiningen you can just add a setting for AOT to project.clj
07:46Kototamayes thanks
07:46Kototamait seems to build nicely
07:46Kototamai need to redploy and test
07:55Kototamastill having the problem
07:55Kototamai will take a break
08:03clgvyou still have the problem with AOT-compilation?
08:05mdeboardWhat does aot stand for
08:05mdeboardApproximately on time?
08:06ejacksonany old thing
08:08mdeboardAhead of time, TIL
08:36@rhickey__I just pushed optional metadata elision during compilation - supply a collection of keywords as clojure.core/*elide-meta* or -Dclojure.elide.meta="[:doc :file]" etc
08:36@rhickey__no op if not used
08:36@rhickey__please try it out if it is something you can use
08:36@rhickey__will be in next beta
08:37@rhickey__I realize this is technically a new feature, but since 855 will require some review I'd like people to kick the tires on this as well
08:41@rhickey__one small step for trimming things down on android etc, full tree shaking and dropping ASM will have to wait for future releases
09:04Kototamaclgv: it works now. I think I aot the wrong file by mistake previously. Thanks a lot. It was really helpful. It's nasty that the behavior is not the same if one forget to AOT the file.
09:05clgvKototama: well to get this right. AOT is hiding the symptoms only. somewhere in your code there is a missing require or use
09:06Kototamanot sure about that, I checked where the protocol is used, and it's only used in three places
09:06Kototamaevery place (:use the namespace of the protocol
09:06Kototamathe only funky things i do is dynamically loading all this stuff via load + slurp
09:07clgvhmm but somehow in the execution flow the Interface is used before the protocol definition is compile
09:07KototamaI mean if a :use was missing I would get an error in SLIME no?
09:08clgvwhats the load+slurp stuff you are talking about?
09:08Kototamainstead of having xml data if have a clojure file representing data
09:08Kototamabut the data needs this namespace to create
09:09Kototamaso I do a (load-string (slurp url)) to get them
09:12mdeboard09:06 <Kototama> instead of having xml data if have a clojure file representing data
09:12mdeboardWhat does that mean
09:13Kototamawe have a clojure DSL to represent data
09:14Kototamanot really a DSL, we just use vector, sexpr etc
09:14mdeboardto represent XML data?
09:14Kototamathese data are loaded dynamically
09:15Kototamano no, we don't use XML anymore
09:15Kototamabut this used to be a XML file
09:15clgvKototama: and you can assure that the protocol is created before the load?
09:16clgvwhat if you skip the 'load - do you still get the exception when not AOTing?
09:16Kototamalet me try
09:25Kototamahum nope
09:26Kototamastill having the error in this case
09:29beffbernardQuestion about noir. Is there any way to output prettty printed html? Currently it's outputing everything on one line
09:29mdeboardbeffbernard: https://github.com/weavejester/hiccup ?
09:30beffbernardmdeboard: Yes, I'm using hiccup to generate the html
09:33mdeboardbeffbernard: I'm not familiar ith hiccup unfortunately :-\ amalloy_ and ibdknox would both be good people to ask
09:38beffbernardmdeboard: okie dokie
09:40clgvbeffbernard: as a start you could just replace every ">" by ">\n"
09:41Fossimost browsers can prettyprint the html
09:41Fossiboth in sourceview and in the inspector
09:42Fossiand actually newlines are only needed after script and link tags in IE6 and some obscure old safari versions
09:42beffbernardFossi: That's what I've been doing thus far
09:42Fossiso stripping the newlines saves space :)
09:43beffbernardFossi: Letting the browser pretty print for me
09:45mdeboardno newlines also kills readability & debugging
09:45mdeboardI like how clojure.data.xml emits nested tags
10:41Bronsalol
10:41TimMcAt work, I'm fighting with Java and Maven and JDBC. But I can get a sample Clojure + Leiningen project to talk to the DB in just a couple minutes.
10:51xkbDidn't emacs clojure mode have tab-completion?
10:52cemerickTimMc: lein 2 is pretty close to being a general-purpose replacement for ant and maven for Java-only builds, too.
10:53nachtalpxkb: M-/ ?
10:53xkbnachtalp: ah yes thanks
10:53xkbtab is only for repl
11:01y3disomeone mentioned turning reg ex into a state machine on hn... does anyone know what that means?
11:04nachtalpy3di: maybe this is what you're looking for? http://en.wikipedia.org/wiki/Regular_expression#Implementations_and_running_times
11:08y3dithanks for the link nachtalp
11:08nachtalpy3di: sure
11:14TimMccemerick: *drool*
11:18jimdueyHere's a good link for regex and state machines: http://swtch.com/~rsc/regexp/regexp1.html
11:20muhooclojure running on beaglebone, yay embedded programming in a sane language
11:22RickInGAjimduey: this is a cool article
11:23jimdueyI thought so. He has a couple of follow ons as well.
11:24RickInGAJust the fact that grep and perl use different regex processes was a shock to me. My first impression of Perl was it was grep and sed and awk all mashed together
11:30TimMchaha
12:21jaleyDoes anyone here use the clj-ssh library? For some reason I get UnknownHostException despite the host I'm connecting to being known *and* turning off strict host checking. Any suggestions?
12:22hugodjaley: clj-ssh doesn't use the standard ~/.ssh/config or ~/.ssh/known-hosts
12:23jaleyhugod: ok. but should disabling strict host checking not circumvent this anyway?
12:24hugodjaley: how are you disabling strict host checking?
12:25jaleyhugod: passing :strict-host-key-checking :no to scp-from ... ah. that has to be done with the session function?
12:27hugodjaley: yes, the readme has some examples
12:27jaleyhugod: ok cool, making some progress. thanks! :-)
12:34jaleyhugod: this is very cool. it's almost less work than actually using scp :-)
13:01ferd_I want my macro to expand into two different "top-evel" def's... Should I wrap the defs in a "(do ...)" ?
13:02ferd_Does this make sense?: (defmacro gen2 [] '(do (def x 1) (def y 2)))
13:02TimMcferd_: Yes, a 'do is appropriate.
13:02TimMcThe compiler will treat a 'do at top level as two top-level statements.
13:02ferd_Excellent. Thanks!
13:03TimMc(including nested top-level 'do statements!)
13:14lpetithttps://twitter.com/#!/petitlaurent/status/175281929363525632
13:14dnolendamn V8 is fast - Okasaki stuff would well in CLJS.
13:15dnolenwork well
13:15technomancydoes the latest metadata patch mean that "more core vars" is the accepted approach going forward in general for dynamicity knobs?
13:16stuartsierrathere haven't been any proposals for anything better
13:19technomancyyeah, but usually what happens in those situations is nothing
13:20stuartsierraI think "more core vars" will remain the approach for now.
13:21technomancyworks forme
13:21stuartsierraWhen the time comes for breaking chase, they could all be moved into a separate namespace if needed.
13:21technomancyshould they be marked as alpha if that's an option for the future?
13:21stuartsierras/chase/changes/
13:21stuartsierramy guess would be yes
13:22technomancyhugod: did you catch that?
13:33jaleyI need to run this function over GBs of data. Is there a way to make it fast without mutability? Even using a string builder actually made little difference for me. https://gist.github.com/1951985
13:33ibdknoxjaley, seqs are slow, use an array
13:34jaleyibdknox: a java array? as in, into-array or something?
13:34ibdknoxyeah
13:34Bronsawhat about a transient?
13:35ibdknoxjaley, also is it a bug that you're taking the first of text?
13:35ibdknoxthat seems wrong
13:36jaleyibdknox: yeah sorry, copy and pasting failure
13:36jaleyibdknox: i'll do some fixing...
13:37jaleyibdknox: yeah, updated and tested. sorry about that
13:39rlbjaley: I believe java also has something like mmap (with limitations iirc) -- don't know if that could help.
13:40rlbISTR it may have had a 2gb limit, and perhaps problems with reclaiming the resource (no close?) -- dunno.
13:46dnolenjaley: use StringBuilder, you need to be careful about type hints.
13:47dnolenjaley: if it's slow, you're hitting reflection - it should not be slow at all.
13:47dnolenjaley: (set! *warn-on-reflection* true) helps
13:47jaleydnolen: hmm, not getting any warnings
13:49jaleydnolen: I updated it using a string builder now. It's 5ms quicker over 1000 iterations than conjing to the vector
13:49jaleydnolen: https://gist.github.com/1951985 - is that how you meant?
13:50hiredmanI'd suggest using an index into the string instead of a seq
13:50hiredman.charAt etc
14:01jaleyhiredman: ok, my .chatAt implementation is the slowest yet. I must've done something wrong
14:03hiredmanjaley: fuh, that is weird
14:04jaleyhiredman: uploaded it to that gist, https://gist.github.com/1951985 - i don't get it either :s
14:08jkkramerjaley: (.length text) instead of (count text)
14:08hiredmanjkkramer: wrong!
14:08jkkramerreally?
14:08hiredmanyes
14:08jkkramerhowso?
14:08hiredmancount is correct
14:08hiredmanwhy do you think count is incorrect?
14:09jkkramerless indirection
14:09jaleyit makes no difference to performance either way
14:09hiredmancorrect
14:09hiredmanbecause a. it is outisde of the loop b. count is polymorphic and does the right thing for the type you give it
14:10hiredmanjaley: I may look this over later, I am curious but no time right now
14:10jaleyso this version takes 400ms on my laptop, for 1000 iterations of a pretty short string
14:10jaleyhiredman: sure no problem, thanks for your help
14:21jkkramerjaley: type hint here: (= ^Character (.charAt text pos) \{) ...
14:22ibdknoxbetter would be to only call that once
14:22jaleyjkkramer: thanks, will give that a go now
14:23tborgI'm kind of noobish, but it seems to me like this might be a good place to work transients in, jaley?
14:23jkkramerquick repl test suggests a 100x speedup with the type hint
14:23jkkrameribdknox: that too
14:24ibdknoxhe shouldn't need a transient
14:24ibdknoxsince he's using a stringbuilder
14:24hiredmandepending on what version of clojure you are using there can be issues with the compiler inlining stuff depending on the type hints
14:25hiredmancharAt actually returns a primitive char, if the type hint of Character is making it faster it is almost certainly an issue with the compilers intrinsics
14:25hiredmanI would try (= (int (.charAt test pos)) (int \{))
14:26dnolenjaley: what version of Clojure?
14:26tborg@ibdknox oh I see yeah nvm
14:26dnolenjaley: also I would set (set! *unchecked-match* true), you're paying a little for those incs
14:27hiredmandnolen: :(
14:27dnolenjaley: also the result of count is boxed so you paying for that too.
14:27jkkramerhiredman: yup, that speeds it up almost 1000x
14:27hiredmanthat changes how code is compiled for other libraries you might be using too
14:28hiredmanjkkramer: the latest 1.4 betas should have better intrinsics for chars
14:30jaleydnolen: how do I unbox count? ^Integer?
14:31dnolen(long (count s))
14:31dnolenjaley: I'm assuming you're on 1.3
14:32jaleydnolen: yeah
14:39jaleydnolen, hiredman : ok, now it's taking about a microsecond. that's good :-)
14:40jaleytime to go home, thanks for the help guys
14:41robinkraftAny Cascalog/Hadoop wizards out there? I'd like to defn at the repl on my master node and have that simple function be accessible in my cascalog query, that is, on the slave nodes. As it is I have to upload a new jar file each time I tweak something, which gets old fast ...
14:41dnolenjaley: np
14:41robinkraftHere's what I'm trying to run: defn get-max [my-vec] (apply max (flatten my-vec)))
14:41hiredmanhttps://github.com/clojure/clojure/commit/405d24dd49d649c01b7881f1394fc90924c54ef0 if you use a clojure version after this you shouldn't need the int casts around the characters
14:41robinkraftand the query: (let [src (hfs-seqfile "s3n://formaresults/finaloutput/*")] (??<- [?count] (src ?s-res ?mod-h ?mod-v ?s ?l ?prob-series) (get-max ?prob-series :> ?max) (>= ?max 0.5) (c/count ?count)))
14:43dnolenjaley: you don't need to cast literals to int
14:43robinkraftI get this error: java.lang.IllegalStateException: Attempting to call unbound fn: #'forma.hadoop.jobs.forma/get-max
14:43robinkrafthere's the gist: https://gist.github.com/1952544
14:44hiredmandnolen: in order to get the compiler to do the intrinsic thing properly before the commit I linked you do
14:44dnolenjaley: oops, I'm wrong - the call to charAt.
14:45dnolenhiredman: yeah
14:56jfieldsI want to call some clojure that's in a .clj that's in a jar. Can I use RT.loadResourceScript("foo.clj") to get the clojure into the runtime?
14:58ibdknoxif you just put the jar in your path you can do (ns my-ns (:require the-ns))
14:58osa1so it turns out I can use ::map, ::vector and String when dispatching on `class` in multi methods, but what should I do to catch numbers? I've tried ::number but didn't work
14:59ibdknoxosa1: you're better off writing your on function that coerces things into the keyword representation that you want
14:59ibdknoxown*
15:00osa1ibdknox: but I'll be still calling (class ..) on that values. or is there another way?
15:00osa1ibdknox: and why? I saw this approach on clojure docs
15:00ibdknox,(doc number?)
15:00clojurebot"([x]); Returns true if x is a Number"
15:01ibdknoxif you want to treat integer and double and long differently, sure
15:01ibdknoxdo that
15:01hiredmanosa1: have you read the docs on hierarchies at all?
15:01osa1hiredman: no
15:01hiredmanfeel free to do so
15:01hiredman~multimethods
15:01clojurebotmultimethods is what separates the boys from the men.
15:01hiredman~multimethods
15:01clojurebotmultimethods is what separates the boys from the men.
15:01hiredman~multimethods
15:01clojurebotmultimethods seperate the 20% from the 80%
15:01ibdknoxlol
15:01hiredmanclojurebot: stop that
15:01clojurebotExcuse me?
15:02ibdknox~multimethods
15:02clojurebotmultimethods seperate the 20% from the 80%
15:02hiredmanclojurebot: multimethods |are| http://clojure.org/multimethods
15:02clojurebotc'est bon!
15:02tscheibl clojurebot: shut up!
15:02tscheibl:)
15:03ibdknoxwhy does clojure.org now have a wikispaces toolbar?
15:04tscheiblindeed
15:05llasramAnyone here use aleph/gloss much?
15:06tscheiblllasram: I use aleph
15:07llasramtscheibl: Do you have any idea how to make gloss work with little-endian values?
15:08tscheiblllasram: I'm sorry, no
15:08llasramAh, oh well. Thanks anyway :-)
15:13jfieldsibdknox, sorry, I wasn't clear enough...
15:13jfields I want to call some clojure from Java (the .clj is in a jar). Can I use RT.loadResourceScript("foo.clj") to get the clojure into the runtime?
15:15tscheiblllasram: looking at that https://github.com/ztellman/gloss/commit/e4b4d4b78b73ec5a2ca2a9478d2ca8dfe57cbdc2 I conclude that there should already be little-endian support in gloss
15:16tscheiblllasram: ... although ... https://github.com/ztellman/gloss/wiki/TODO
15:16amalloythere is little-endian support in java.nio.ByteBuffer, which is the data format gloss uses
15:18stuartsierrajfields: yes
15:19jfieldsstuartsierra, strange, it's not working for me. I get "could not locate Clojure resource on the classpath"
15:20stuartsierrathe JAR containing foo.clj must be on the Java classpath
15:20stuartsierraand you must specify the file name as a full path, relative to the root of the JAR
15:21choffsteintechnomancy: I upgraded to lein 1.7 and for some reason, my lein deploys with s3-wagon-private aren't authenticating from .lein/init.clj anymore. Any ideas?
15:21jfieldsstuartsierra, the jar is definitely on the classpath, that much I'm sure of. how can I find the full path relative to the root of the jar?
15:21stuartsierrajfields: in a shell, run `jar -t` on the jar file
15:22jfieldsstuartsierra, thanks
15:23technomancychoffstein: try running with DEBUG=y; you should get more visibility into repository settings
15:24jfieldsstuartsierra, works like a charm. thanks.
15:24stuartsierrajfields: 'welcome
15:25choffsteintechnomancy: Is that a shell variable?
15:26technomancychoffstein: ja
15:26choffsteintechnomancy: Okay. Ran it. Doesn't seem to be showing my repos...
15:27technomancychoffstein: shoot; I may have added that after the release
15:27technomancydo you have a leiningen checkout where you could try the 1.x branch?
15:27choffsteinI'll give it a go. I'm sure I'm just being stupid.
15:28choffsteinOh god, I am an idiot.
15:28choffsteinI was just doing `lein deploy` -- I forgot to add which repo to deploy to.
15:29choffsteinSorry for wasting your time. I'm a bit embarrassed about this one...
15:29technomancyheh; happens all the time
15:30llasramamalloy: (time-travelling) does using .order to set the ByteBuffer byte-order not work?
15:31amalloybeats me
15:31llasramamalloy: Ok, seems to. So ByteBuffer *does* support little-endian access, just not on a field-at-a-time basis
15:34llasramtscheibl: Looks like that makes gloss preserve the endianness of buffers it gets to start with. Hmm
15:44replacatechnomancy: just FYI, the ring output problem I was seeing yesterday appears to have nothing to do with slime or leiningen
16:02Lukehey guys - i'm trying to get swank/slime set up for clojure but I'm having a hard time understanding what's going on with all these components. What I want to do is have a system-wide swank/slime install which I installed via Ubuntu apt-get. I want my emacs to start that at startup and then connect for all the lisp/clojure buffers. is that reasonable?
16:04hiredmanLuke: no
16:06Lukehiredman: why's that?
16:07hiredmanbecause there are many versions of clojure and the version of clojure used by project depends on the project
16:07Lukehiredman: so most people just use an instance of swank per project?
16:08weavejesterLuke: There's usually one swank-clojure, installed as a Leiningen plugin
16:09hiredmanpeople use leiningen
16:09hiredmanit's in the google
16:09weavejesterLuke: So if you have leiningen installed, you can run: lein plugin install swank-clojure 1.4.0
16:10weavejesterLuke: I usually use technomancy's emacs-starter-kit to setup emacs and install the clojure-mode emacs package
16:11weavejesterLuke: And then you can run M-x clojure-jack-in from Emacs to start a SLIME session in the current project.
16:17uvtcHi, #clojure. I'm trying to better understand what leiningen is for and what it does. For one thing, if I create a new project (`lein new foobar`), and then `cd foobar` and run `lein jar`, I see that (1) it downloads clojure-1.3.0.jar for me, but (2), it does *not* include that clojure-1.3.0.jar in the foobar-1.0.0-SNAPSHOT.jar it makes. Why doesn't it include the clojure.jar?
16:18ivanI think lein uberjar does that
16:18brehautbecause thats just the projects jar; if you make an uberjar it includes all the dependancies
16:19uvtcAh, ok. `lein help | grep uberjar`.
16:21Lukehiredman: I have leiningen
16:22Lukeweavejester: cool thanks a lot
16:22clojurebotPardon?
16:26uvtcSo, if I want to send a friend a Clojure program for them to run, I send them a jar created by running `lein uberjar` in my project dir, correct? And then they should be able to run it by doing `java -jar foobar.jar`. Is that the case?
16:27brehautassuming it has a main entry point
16:28amalloyanyone know why IPersistentMap.assocEx exists? i happened to see it in the source, and it looks like it's only used by some commented-out code relating to an old class named PersistentListMap. i'm just sorta curious from a historical perspective what it was good for
16:28uvtcThanks, brehaut.
16:33technomancyreplaca: yeah, thanks for the pull!
16:33technomancyI have a few more loose ends to tie up with lein-precate, but I should have a new version out soon
16:39replacatechnomancy: great. Question: does lein 1.x always run under clojure 1.2 (as the doc says)?
16:39replacatechnomancy: I'm worried that that code may trip over an old cl-format bug
16:40replacatechnomancy: though it worked fine in my environment
16:40technomancyreplaca: yeah, it's stuck on 1.2.1
16:40technomancywhat's the bug?
16:41replacatechnomancy: hmm, the fix must be in 1.2.1 then though the JIRA page says 1.3.
16:41replacawhere ~w wouldn't automatically create a pretty-writer when used outside pprint
16:42replacaCLJ-682
16:42TimMcuvtc: If you don't need AOT compilation, I recommend the lein-otf plugin </shamelessplug>
16:42technomancyreplaca: when I saw that crazy string passed to cl-format I was kinda glad I didn't attempt to tackle that on my own =)
16:42TimMcuvtc: `lein uberjar-otf` is faster than plain uberjar and allows on-the-fly compilation
16:42brehautTimMc: open type format?
16:43TimMcOn The Fly, as opposed to Ahead Of Time
16:43brehautaha
16:43replacatechnomancy: yeah, I found something I didn't implement from the old XP spec that would have made it all cleaner, so now I have another bug. :)
16:43TimMcbrehaut: "JIT compilation" is ambiguous
16:43brehautyes
16:43TimMc(but easier to pronounce...)
16:45uvtcTimMc: I'm still trying to understand in which cases any compilation happens when creating a jar using lein...
16:45TimMcuvtc: At least these times: 1) When :aot is specified, 2) when :main points to something with :gen-class
16:46technomancyactually :main on its own triggers it; no gen-class needed
16:46technomancythough :main ^{:skip-aot true} whatever.main works
16:46TimMctechnomancy: Just with uberjar, or also jar?
16:46technomancyTimMc: for compile, which is invoked by both
16:46uvtcTimMc, when you write ":aot" and ":main", are you referring to keys in the project.clj's defproject fn?
16:47TimMcyep
16:47TimMctechnomancy: :main is complected
16:47technomancyit's true
16:51Lukeslime + clojure is awesome
16:51TimMctechnomancy: I use :main to make the REPL end up in the most important namespace during dev. Should I just use that + :skip-aot to avoid AOT'd regular jars?
16:51Lukeit seems to keep disconnecting though
16:51technomancyTimMc: :repl-init bro
16:52TimMclein 1.x?
16:52technomancymaybe?
16:52TimMcheh
16:52technomancythat's more of a swank thing anyway though
16:52technomancyI mean, repl supports it in 1.x; I think swank should too
16:53TimMcEh, by the tiem I start using Swank, we'll be on Lein 3.
16:59uvtcI'd like to distribute a small command line Clojure program. I created a new project (`lein new count-to`). My `count-to/src/count_to/core.clj` looks like this: http://paste.pocoo.org/show/559456/ .
17:00uvtcI suppose I should be able to test it out using `lein run` or `lein run 3`, but it's telling me "No :main namespace specified in project.clj.". What value of ":main" should I provide?
17:02TimMcuvtc: :main count-to.core
17:02technomancyuvtc: or lein run -m count-to.core
17:03uvtc(Odd that although I created the project using `lein new count-to` (with a hyphen), the lib dir contains "count_to" (with an underscore)).
17:03technomancyuvtc: one of many ways in which the JVM intrudes on our otherwise happy existence
17:04technomancywell, s/many//
17:04TimMcNo, there are many.
17:04uvtctechnomancy, Ah. So, maybe a good rule to follow is to not use hyphens in project names?
17:04technomancyuvtc: no, there's nothing wrong with that
17:04technomancy
17:05TimMcuvtc: Just a warning... JVM startup time can be a bear. Small CLI programs are honestly best written in Python, unless you know your users will be using a client VM.
17:05technomancypython? pshaw.
17:05uvtcTimMc, noted.
17:05TimMctechnomancy: Bash?
17:05technomancyunless you mean clojure-py of course
17:05technomancyTimMc: ocaml!
17:05emezeskeTimMc: INTERCAL
17:06TimMctechnomancy: :-D
17:06technomancyon le metal
17:06uvtcBut I'm looking to write some Clojure and chew gum, and I'm all outta' gum.
17:06uvtcwheee....!
17:06TimMcuvtc: Understood.
17:06hiredman~python
17:06clojurebotpython is "I think dropping filter() and map() is pretty uncontroversial…" — GvR
17:06hiredman~python
17:06clojurebotpython is ugly
17:06TimMcMeh, it gets small jobs done.
17:07emezeskeWait, did filter() and map() get dropped for Python 3?
17:07emezeskeWell, I guess list comprehensions kind of do the same thing, but that's a little sad if so...
17:07emezeskeWait, this is #clojure
17:07brehautemezeske: they are in the functional package
17:08TimMcemezeske: I think they dropped reduce, too. (If they ever had it.)
17:08amalloyemezeske: i think he was harassed into leaving them in, but moved reduce into some package you have to import
17:08emezeskeHaha, thanks guys :)
17:08uvtcSo, after adding ":main count-to.core", and trying `lein run 3`, I get quite a long stack trace, which starts with "Exception in thread "main" java.lang.NumberFormatException: null
17:08uvtc at java.lang.Integer.parseInt(Integer.java:443)
17:08uvtc at java.lang.Integer.parseInt(Integer.java:514)"
17:08technomancy"Complaining about whitespace in python just shows your ignorance; there are so many other more important things to complain about."
17:08brehautclojure solves all my python problems; its unsurprinsing that #clojure can solve #python problems too
17:08hiredmanI was reading over the blog posts from the clojure-py blog and there is a fundamental misunderstanding of vars in there
17:08emezeskebrehaut: burrrrned!
17:09hiredmanI haven't looked at the code to see if it carries over there
17:09technomancyI was kind of disappointed to learn that the point of clojure-py is performance =(
17:09brehautwait what
17:09hiredmanthe blog posts talks about treating non-dynamic vars as constants
17:09ivanPython whitespace would be less bad if it did not break Python code pasted into the REPL
17:09TimMcivan: What do you mean? I do that all the time.
17:10hiredmanand so copying the values around in the global dictionary or whatever
17:10amalloyhiredman: maybe they've never used a repl before
17:10hiredmansounds like it
17:10TimMcI MEAN, WHEN I USED PYTHON. *cough*
17:10clojurebotCool story bro.
17:10hiredman~botsnack
17:10clojurebotthanks; that was delicious. (nom nom nom)
17:10ivanTimMc: it does not work here. maybe it's my settings
17:10uvtcHm... just running `lein run` by itself without any number yields the same stack trace...
17:10TimMcuvtc: gist the code + stack trace (or... refheap it?)
17:11TimMcRaynes: Verb, please.
17:11RaynesTimMc: We call that pasting, sir.
17:11uvtcTimMc, "refheap"?
17:11Rayneshttps://refheap.com
17:11callenI'm a big fan of pasties.
17:11RaynesThe best pastebin ever.
17:11TimMccallen: heh
17:11ivanTimMc: looks like it was because I was pasting tab-indented code into the Windows Python
17:11TimMcRaynes: Your pastebin needs more tassels.
17:12ivanand also into this host running Ubuntu 10.04
17:12callen^^ this guy knows what's up.
17:12uvtcTimMc, http://paste.pocoo.org/show/559461/
17:12callenuvtc: use refheap :(
17:13TimMccallen: One of my housemates does lighting (and video production?) for a burlesque troupe.
17:13uvtccallen, Ah. Interesting. refheap uses Pygments, just like paste.pocoo (pocoo is where pygments was born).
17:13RaynesHere is a funfact about pocoo: if you paste something that causes the theme they use to have italics or unicode characters and the paste is 100 lines or more, the line height is inconsistent and the line numbers become useless, ending long before the paste does.
17:14RaynesThey may have created pygments, but they sure don't know how to use it too well. ;)
17:14TimMcuvtc: count_to.core$eval11.invoke are you doing something naughty?
17:15uvtcTimMc, The only source code file in my brand new "count-to" project is that core.clj file, and it's contents are still what I pasted at http://paste.pocoo.org/show/559456/ .
17:15TimMcuvtc: OK, hadn't seen that paste.
17:16TimMcuvtc: OK, that needs to 1) have an ns declaration and 2) a -main fn
17:16uvtcTimMc, That error message has "count_to" in it, even though my :main is set to "count-to.core".
17:16hiredmanand *command-line-args* might not worker properly with lein run
17:16TimMcuvtc: Right, the classname is munged just like the path.
17:16hiredmanuvtc: you need a namespace at the top
17:17uvtcDoh, sorry. Yes, the `ns` declaration is there at the top. Sorry --- it didn't make it into the paste. Apologies.
17:17uvtcIt's https://refheap.com/paste/905
17:18uvtc(Hm... I think I prefer paste.pocoo's colorscheme ...)
17:18uvtc...Trying a new project named "count_to" instead of "count-to"...
17:19amalloyuvtc: no, disaster, don't do that. the munging is not the issue at all
17:19uvtcamalloy, Ok.
17:19amalloythe issue is what TimMc said: you need to declare a main function
17:19amalloyinstead, this println is being called at compile time, before main is executed, so there are no command-line args
17:20amalloy(then what hiredman said might also be an issue - i don't know if *command-line-args* works with lein run or not)
17:20vijaykiranhi all .. is there a like (fn a b) which will return b if a is empty or nil ?
17:20amalloyor
17:20hiredmanamalloy: there will be *command-line-args* but it will be a big clojure form thing that lein passed to java
17:21hiredmanvijaykiran: or?
17:21uvtcOk. No prob. I don't need to try it out using `lein run`. But I *do* want to package it up and try running the jar.
17:21vijaykiran,(or '() "123")
17:21clojurebot()
17:21hiredmanuvtc: they work the same
17:21vijaykiranI need that function to return 123
17:21hiredmanuvtc: lein run is essentially trying to mimic the experience of running a jar without making a jar
17:22vijaykiran,(or '(1 2 3) "456")
17:22clojurebot(1 2 3)
17:22TimMcvijaykiran: Perhaps you want a seq.
17:22vijaykiranthis case is fine ..
17:22TimMc&(map #(or (seq %) 123) [() [1 2 3]])
17:22lazybot⇒ (123 (1 2 3))
17:23TimMcEw, that was kind of misleading output, but whatever.
17:23vijaykiransweet thanks!
17:23vijaykiranseq should be fine
17:23TimMcvijaykiran: For a related problem, see if-let
17:24uvtchiredman, Hm. Ok. Thank you. Also, running `lein uberjar` failed for me (with a java.lang.NumberFormatException ).
17:24TimMcuvtc: Right, because the error is at compile time.
17:24vijaykiranTimMc: yes, I was just trying that out, thanks a lot.
17:25jkkramer,(or (not-empty [1 2 3]) :foo) ;to maintain concrete type
17:25clojurebot[1 2 3]
17:25hiredman"compile time" is a misnomer, the code is executed at load time
17:25uvtcSo, for command line Clojure programs that take args, perhaps it's best to run them using `java -cp path/to/clojure.jar clojure.main count-to.clj 5`.
17:26hiredmanif you AOT compiled it, the code would execute everytime you loaded the compiled code, not just when you compiled
17:26hiredmanuvtc: as with everything it is best to read documentation and know what you are doing
17:27ndr76anybody knows how to run all Clojure *own* tests ?
17:29vijaykiranjkkramer: neat, not-empty seems more readable
17:30amalloyndr76: ant test
17:30shaolynnHey guys, I'm having an issue with aleph. How do I prevent http-requests from being "chunked"?
17:30shaolynnHere's my code:
17:30shaolynnhttps://gist.github.com/1953683
17:31shaolynnI need the complete result to come back, otherwise I get parsing errors.
17:31uvtchiredman, yes, I prefer reading the documentation, however, I wasn't able to find anything regarding creating an easily-distributable command line program.
17:32uvtchiredman, If you could point me to such documentation, I'd appreciate it.
17:32uvtchiredman, clojure.org/repl_and_main just says to use the "java -cp ..." command, but I'd assumed that it's customary to create and distribute programs using lein.
17:32hiredmanuvtc: http://clojure.org/compilation
17:33uvtchiredman, Will read. Thanks.
17:37amalloybtw TimMc, vijaykiran: seq there looks a little unpleasant. i'd use not-empty instead, to preserve the thing's type, if you really want empty collections to behave like nil
17:39TimMcI never knew about not-empty...
17:39TimMc&(doc not-empty)
17:39lazybot⇒ "([coll]); If coll is empty, returns nil, else coll"
17:51TimMc&(map (juxt not-empty (comp not empty) (comp not empty?)) [nil [] [1 2 3]])
17:51lazybot⇒ ([nil true false] [nil false false] [[1 2 3] false true])
17:52TimMcThat would be a good one for the seqs-and-colls page.
17:59arnihermannI'm having problems reading a file in iso88591 encoding. I think it's java related, not clojure related. I do not have control over the code which reads the file, I give it an input stream or filename (string) and it reads the file as utf8. I cannot for the life of me fix the contents of the file afterwards, I always have '�' or '?' instead of the nonascii-characters (like þæö).
18:00arnihermannIf the contents are read as utf8, is there no way to get back to the original contents with iso88591?
18:00hiredmanarnihermann: how is the code reading it?
18:00arnihermannit's a third party lib I do not even have source of
18:00arnihermanne.g. I give it an inputstream to the file and it reads it
18:01hiredmancan you give it a reader instead?
18:01TimMcarnihermann: Can you give it a Reader instead of an InputStream?
18:01arnihermannno
18:01hiredmaninputstreams don't have an encoding
18:01RaynesMy tip would be to tell that third party lib's developer to fix his broken software.
18:01hiredmanthey are raw bytes
18:01arnihermannI think he might be converting them behind the scenes
18:02arnihermannright
18:02RaynesIt'd be hilarious if I were the developer of said software.
18:02arnihermannRaynes: you're not :)
18:02RaynesOh good.
18:03arnihermannI'll try for the 3rd time to explain the situation to the lib developer :)
18:03arnihermannthanks
18:04llasramarnihermann: If you can't sort it out the right way, Apache Commons has a ReaderInputStream, which reads from a Reader, then encodes in the charset of your choice on read
18:04clj_newbHi, with aleph it is possible to add body to the http request?
18:04arnihermannllasram: ah thanks
18:06clj_newbis it better aleph, or clj-http + agents to keep a connection over http to consume events?
18:06clj_newbaleph does not seems very active, is?
18:06dnolenclj_newb: it's pretty active
18:06clj_newbah
18:06llasramclj_newb: Lots of activity in the clj-1.3 branch
18:07RaynesNot sure if it's helpful, but https://github.com/neotyk/http.async.client is a maintained async http client.
18:07clj_newbdoes not clj-http support async connections?
18:07Raynesdakrone: ^
18:07RaynesDoes it?
18:09dakroneno, it's not async, use http.async.client if you need async
18:11clj_newbthank you
18:12clj_newbI'm evaluating aleph also, but last commit is (in the public repo) from months ago
18:12clj_newbI'm a bit afraid it becomes discontinued or something, thou I like its approach (lamina) of channels
18:13llasramclj_newb: Check the clj-1.3 branch on the github repo. That's where all the activity is
18:14clj_newbgreat, thanks
18:15clj_newbsorry, I closed the terminal
18:15clj_newbI will check it out
18:17brehauthuh. the python library webassets already supports google closure; probably wouldnt be too much work support clojurescript too
18:38rogererensMaybe someone could put that https://refheap.com/paste link in the topic of this group?
18:45RaynesTheoretically, yes. But I doubt anyone will.
18:51chris-m-rhi, is there an easy way to view to documentation/methods for say a jpanel from emacs?
18:52technomancychris-m-r: sure; use C-c S-i
18:56chris-m-rtechnomancy: thanks
18:57tylergilliesHow would i go about embedding a language int clojure, like lua
18:57tylergilliesinto*
18:57technomancysure
18:58emezesketylergillies: That seems like a curious thing to do ^_^
18:58mdeboardI'm rewriting lua in pure python
18:58Rayness/curious/nutsy/
19:02tylergilliesemezeske: why? im im making an app that i want to program in clojure, but want it to be scriptable and not force the scipters to learn clojure
19:02tylergilliesif i'm*
19:03emezesketylergillies: Well, I'd reckon that Clojure and Lua are at a pretty similar level of abstraction
19:03emezesketylergillies: Usually, a more-abstract language is embedded in a less-abstract language
19:03emezesketylergillies: The host is fast, the embedded is expressive
19:04tylergilliesyes, but far more people who write casual scripts for applications know lua than clojure or any lisp for that matter
19:04tylergilliesJVM isn't fast?
19:05emezeskeSure, but clojure doesn't sacrifice expressiveness for speed (IMHO)
19:06tylergilliesso ther are no clojure apps that have a scripting language that isn't clojure?
19:07tylergilliesi would say thats a function of the age of clojure not some intrinsic quality
19:07amalloyyou would be investing a tremendous amount of time into embedding here. you'd be like...rewriting all of lua, in clojure
19:07emezeskeCould be other apps like that, not written by me though :)
19:07tylergilliesis java the same way?
19:07amalloyeven if we take for granted that that's a good thing to do, the cost surely exceeds the value
19:08technomancyamalloy: there are a couple JVM-hosted lua implementations IIRC
19:08technomancynot that I think it's a good idea
19:08amalloyeven figuring out how to integrate with them would probably not be easy
19:09tylergilliesso if i want a scripting language in my app im better off writing it in c++?
19:10tylergilliesthe app that is
19:11cafesofietylergillies: why not just use a language with better JVM support?
19:11cafesofieruby and python come to mind
19:12emezesketylergillies: I see no reason why you couldn't embed Lua in clojure. I just think it's a very silly thing to do.
19:12emezeskeIt's like embedding a Ruby interpreter in your Python app, because people like Ruby
19:13Rayneslazybot has a Ruby interpreter. :D
19:13tylergilliesah, so i guess the purpose of putting lua in a c++ app is that the c++ app can't run c++ from within itself
19:13mdeboardI'm jackie chan
19:13brehautRaynes: all the cool bots have a node.js interpreter
19:13tylergilliesbut clojure can run clojure from within itself
19:14mdeboardwha--
19:14emezeskeYeah, C++ would be a bad scripting language anyway
19:14technomancyoffering C++ as an extension language would be a great thing to do if you hate your users and want them to suffer
19:14tylergillieslol
19:14emezeskehahaha
19:14tylergilliesim writing an irc client called masochism that scripted with c++
19:14tylergillies;)
19:14emezesketechnomancy: You might enjoy my 2011 april fool's joke then: http://blog.mezeske.com/?p=377
19:15qbgScripting in C++ -> PROGRAM IS FINE
19:15technomancyemezeske: I see your april fools and raise you my 2008 april fools: http://technomancy.us/107
19:15tylergilliesemezeske: thats awesome and horrible at the same time
19:16technomancyemezeske: that's pretty hilarious though
19:16emezesketechnomancy: LOL @ "What about type safety?" "Always wear a helmet"
19:17technomancyemezeske: looks like about a 50/50 ratio of getting the joke in the comments on yours; nice
19:17rplevydsantiago: hi, it sounds like from what you're saying in https://github.com/davidsantiago/clojure-hbase/pull/5 that there is some way to direct convert a string-string map to an HBaseConfiguration object?
19:17emezeskeOh, man, I didn't think anyone would beleive it, I was so shocked
19:17qbgC++ programmers can't take a joke; that is why they are programming C++
19:18Raynesrplevy: I have a mission for you, should you choose to accept it.
19:18dsantiagorplevy: No, I'm saying that that object appears to exist just to be a string-string map, so if that is the case (I'm really not sure, you seem to know this API better than me), the configuration should just be a string/string map, and we convert it to the thing they want at the last second, in set-config.
19:18emezeskeqbg: Hey! I can take a joke! Maybe that's because I've been off C++ for a little while though
19:18rplevydsantiago: I doubt I know it better than you haha
19:18rplevyalso: ah I see
19:19dsantiagorplevy: Well, you knew of its existence, so that already is suggestive right there. When I first wrote it, I asked in #hbase and they said XML file was the only way to do it.
19:19rplevyRaynes: yes?
19:19qbgemezeske: These quips write themselves...
19:19Raynesrplevy: Since you know more about Jython and stuff than I do, go take this issue: https://github.com/Raynes/refheap/issues/2
19:20emezeske:)
19:20rplevyRaynes: sounds fun, I will look into it
19:20Raynesrplevy: It is extremely low priority, but I figured if you ever got bored… ;)
19:20rplevyRaynes: cool
19:21dsantiagorplevy: Typically what I do with these sorts of things is allow strings, keywords, and symbols by calling clojure.core/name on them before using them.
19:23rplevydsantiago: sounds good like a good approach. btw, this month is my first foray into anything HBase related, so you definitely know it better. I'm jumping in at a time when there is slightly better documentation available. :)
19:49rplevydsantiago: https://github.com/rplevy-draker/clojure-hbase/commit/9c23bf00dab743551db254b3ba4bb0ad6f9267bd
19:49rplevyclojure IRC log broke this afternoon around 2:30, or did I just never notice that it doesn't update live?
19:50zztwI'm poking around in Storm ( https://github.com/nathanmarz/storm ) in eclipse and when I try to view source for a clojure class like Seqable it tells me the attached source is wrong. Indeed, inspecting the jar ( jar tvf $HOME/.m2/repository/org/clojure/clojure/1.2.0/clojure-1.2.0-sources.jar ) exposes only .clj files, no java. how might I get maven2 to download the java source?
19:50dabdis there a xml-rpc client in clojure-contrib?
19:51brehautdabd http://github.com/brehaut/necessary-evil/
19:51brehautid be horrified if xml-rpc made it into contrib; that might encourage people to build things with it
19:51RickInGAgood name for it
19:53dabdbrehaut: I read some bad things about it. I have to use a xml-rpc server so I need a client. What's a good alternative?
19:53brehautto xml-rpc?
19:54brehautdabd: or do you mean you have read bad things about necessary-evil?
19:54dabdbrehaut: I read bad things about xml-rpc
19:55brehautyeah for good reason
19:55dabdbut what is a good alternative?
19:55brehautjson of rest?
19:55dabdjson-rpc?
19:55brehauts/of/over/
19:55brehautdabd: ideally not RPC over the web.
19:56dabdhaha I see you are the author of necessary-evil
19:56brehautplain REST services are much better
19:56brehautyes
19:56dabdActually I will have the server running locally
19:56dabdbut the guy that wrote it chose xml-rpc so i can't do anything about it
19:56brehautthats why necessary-evil exists
19:57brehautand why its named what it is named ;)
19:57dabdok I will get it from clojars
19:57dabdthanks
19:57rplevybrehaut: that's a great name
19:57dabdor should i get it from git instead?
19:57brehautdadb: clojars
19:57dabdok
19:58brehautsorry about the typo
19:58rplevymuch better than clj-xmlrpcjure
19:58brehautrplevy: lol
19:58brehautthat has a certain charm :P
19:58rplevy:)
19:59aperiodicif i want to intern something that conflicts with an existing mapping in a namespace, should i just unset it with ns-unmap beforehand?
20:00RickInGAdo you need to use both sides of the conflict? I think you can do :exclude with use
20:01aperiodicRickInGA: the conflicting mapping is in clojure.core
20:01RickInGAso (use 'clojure.set :except difference) ; don't remember if it is exclude or exept
20:03RickInGAok
20:03amalloyaperiodic: (:refer-clojure :exclude [...])
20:03amalloybut if you do that, everyone who uses your namespace will need to decide which of those things they want to be able to refer to easily. it's not very friendly most of the time
20:04hiredmanamalloy: yet another reason why :require :as is superior
20:05amalloyindeed
20:06amalloyi prefer :use/:only personally most of the time, because then when you look at the code it's not all cluttered up with annotations about where each function comes from. but i realize it's a tradeoff that makes other things less pleasant
20:07rplevyI like this idea http://dev.clojure.org/jira/browse/CLJ-879
20:07rplevyand get rid of :use
20:07aperiodicamalloy: it's a very simple ns with only get, set, and delete. I'd rather have succintness when using it via require and not really support use, but perhaps i'm too attached to being able to write meta/set rather than meta/set-metadata
20:08amalloyaperiodic: so use that refer-clojure. if you prefer to write meta/set anyway, then there's no downside at all
20:09rplevyoh hey that patch was applied recently, I didn't notice
20:10dabdhow do I find which clojure-contrib runs well with clojure 1.3.0? What are the required leiningen keys [org.clojure/clojure "1.3.0"] [org.clojure/clojure-contrib "1.3.0"]?
20:10brehaut~contrib
20:10clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
20:10brehaut(inc seancorfield)
20:10lazybot⇒ 3
20:11rplevythat's ideal, I think it will be most idiomatic to replace all :use clauses with :refer of vars in require clauses
20:11brehautdabd: short answer: there is no 1.3 contrib
20:11brehautin the same sense as there was in 1.2.x
20:13aperiodicyeah, I've never been a big fan of use, though that's mainly because it makes it really easy to hide where the variables are actually coming from
20:13aperiodici kind of like cljs's restriction on it
20:13dabdbrehaut so I should use clojure-contrib 1.2
20:13dabdwith clojure 1.3
20:14brehautdabd: no, you should usethe individual libs that have been split out of it; see the above link clojurebot spat out
20:19aperiodichmm, why does :refer-clojure only work as a keyword?
20:20aperiodicevery other ns option i've used works as long as the name is the same
20:21dabdbrehaut: ok thanks
20:30RickInGAfor doing exponents in clojure, there is Math/pow and clojure.math.numberic-tower/expt is one preferred over the other?
20:31qbgRickInGA: For what types of numbers?
20:31RickInGAints
20:31ibdknoxmath/pow
20:31qbgOr use BigInteger to deal with overflow
20:32RickInGAok, thanks
20:32brehauti want math/pow!
20:32brehautcomplete with kirby dots
20:33amalloyaperiodic: if you try to call it as a function, you've already referred clojure.core. what's the point?
20:33TimMctylergillies: Late to the conversation, but I'll point out that DevilsPie uses a Scheme or something as its scripting language. It was easy to pattern off the examples.
20:34TimMctylergillies: The real question is... how advanced will the scripts be? (Will your users *have* to know about the scripting language's pitfalls and idioms?)
20:34technomancyit's not scheme
20:34RickInGAibdknox = Chris Granger?
20:34ibdknoxhe does :)
20:34technomancyit's a stupid crippled wannabe-lisp
20:34aperiodicamalloy: but this is in the ns macro, so it shouldn't be getting called
20:35RickInGAcool, I'm looking forward to web programming class!
20:35ibdknoxRickInGA: yeah, I think we're going to have some fun :)
20:35ibdknoxI was surprised there was such interest in data-viz
20:35ibdknoxthat'll definitely be interesting
20:36TimMcaperiodic: Right, it modifies some ns defaults, so it *has* to be in the ns block.
20:37TimMcEverything else (import, use, require) has an ns equivalent for convenience (and appropriateness or something).
20:39aperiodicTimMc: my confusion is that import, use, require and friends can be used by supplying a symbol, keyword, or string in the ns macro
20:40rplevyI also can't think of any case where it would make sense to use the present refer given the :refer key of require, it's more repetitious in any usage.
20:41aperiodicTimMc: however, (ns (refer-clojure :exclude [get set]])) doesn't work for me, while (ns (:refer-clojure :exclude [get set])) does
20:42TimMcaperiodic: (ns (import ...)) is not valid, it should be a keyword.
20:44aperiodicTimMc: ok, I didn't realize that was unsupported
20:46ferd_I have a macro dilema: I don't want to use ` because it fully qualifies symbols and that screws my macro... But, I need ~@ to splice a list :-\
20:46technomancycan't use appli concat?
20:46technomancyapply
20:47qbgCan't use ~'foo where needed?
20:48TimMcaperiodic: Yeah, it'll really screw with beginners. (ns (require foo.core)) will complain that foo.core isn't defined. >_<
20:48ferd_qbg: would that prevent the namespace qualification? let me try that
20:48TimMcaperiodic: Wait, never mind, that's an incorrect statement.
20:48qbg,`~'+
20:48clojurebot+
20:48ferd_technomancy: using concat would work... but would be a pain
20:49qbgThat almost looked like Perl...
20:49Iceland_jackhaha
20:49rplevyferd_: yes this is how you can do anaphoric stuff where you want symbol capture to
20:50rplevytoo*
20:51TimMcqbg: This look enough like Perl? https://github.com/baznex/imports/blob/7754d3a565a4db47b68cdf1e86bb6edf6bb8cbbd/src/org/baznex/imports.clj#L169
20:51aperiodicTimMc: yeah, the whole requiring beginners to understand macros to realize why (require foo.bar) doesn't work at the REPL is unfortunate
20:52ibdknoxTimMc: that made me cry a little.
20:52qbgTimMc: I see letters
20:52TimMcibdknox: Shhh, don't cry. I reverted most of that code.
20:52ibdknoxlol
20:52ferd_thanks! that worked...
20:52rplevy@@#'other-namespace/some-atom looks kind of perlish to me
20:52TimMcIt hurt to write, too.
20:53ferd_Now for another macro issue: I want to generate a metadata... but actually, it's for Java annotations on a deftype
20:53TimMcibdknox: When you realize what it is doing you will probably cry more.
20:54ferd_I could find a way to pass the ^{ } syntax from the macro to the results... So I tried generating (with-meta ... but deftype doesn't like with-meta :-(
20:54ferd_*couldn't
20:55TimMcferd_: You need to do with-meta in an unquote
20:55qbgDid you do something of the effect `(defn ~(with-meta 'foo {:private true}) ...)
20:57ferd_I tried `(deftype (with-meta ~foo ~annotations) ...
20:59ferd_but it complains with "PersistentList cannot be cast to clojure.lang.Symbol"
20:59qbgYou need to eval with-meta with unquote
20:59qbgSince you want a symbol there, not a list
21:00TimMcferd_: Use (binding [*print-meta* true] (macroexpand-1 `...)) to debug your output.
21:00TimMcerr
21:01TimMcferd_: Use (binding [*print-meta* true] (pr-str (macroexpand-1 `(my-macro ...)))) to debug your output.
21:04ferd_hmmm if I let the "with-meta" to run at macro-exansion time, I get the symbol but without the metadata
21:04ferd_if a let the (with-meta ...) on the output, then deftype complains
21:05TimMcferd_: How do you know it doesn't have metadata?
21:05ferd_I mean the expanded macro does have it... I'll try to put together a smal example to share here
21:07ferd_(defmacro M [t] (with-meta t {:a "a"}))
21:07ferd_(macroexpand-1 '(M test)) -> test
21:08ferd_with the deftype: (defmacro M [t] `(deftype ~(with-meta t {:a "a"})))
21:09ferd_same thing: (macroexpand-1 '(M test)) -> (clojure.core/deftype test)
21:10ferd_now, leaving with-meta quoted chokes deftype :'(
21:10TimMcferd_: Did you see the binding form I gave you above?
21:10qbgBoth of those have the metadata...
21:10qbg=> (meta (second (macroexpand-1 '(M foo))))
21:10qbg{:a "a"}
21:12ferd_(binding [*print-meta* true] (macroexpand-1 '(M test))) --> (clojure.core/deftype test)
21:12qbgYou need the pr-str there
21:12qbgOr do (set! *print-meta* true) and the REPL
21:13qbgSo it prints it with the meta data
21:13qbg=> (set! *print-meta* true)
21:13qbgtrue
21:13qbg=> (macroexpand-1 '(M foo))
21:13qbg(clojure.core/deftype ^{:a "a"} foo)
21:13ferd_genius... (clojure.core/deftype ^{:a "a"} test)
21:14ferd_thanks a lot! I would've never figured that out
21:15ferd_now, why doesn't it print it by default? why is there even an option for that ?
21:17qbgBecause it isn't important most of the time
21:17qbgBut sometimes it is
21:26TimMcThis is probably in line with how it doesn't affect equality semantics.
21:30ferd_after a few minutes, I now realize it does indeed get in the way... there is tons of metadata everywhere :-)
21:31nappingDoes installing CCW take a while? It's been sitting at "Calculating requirements and dependencies" for a minute or two, without the progress bar moving
21:32qbgnapping: Shouldn't
21:32TimMcnapping: Any hidden dialog boxes?
21:33nappingIt's finished now
21:33qbgI really like the CCW beta
22:07choffsteintechnomancy: You around? Is it alright if I PM you with a clojure / heroku related question?
22:09BlackavarHe's sitting on a couch about 6 feet away, but may be preoccupied.
22:12choffsteinWhich is totally okay :)
22:12choffsteinI can just submit a heroku ticket, I s'pose
22:14ferd_,(deftype ^{java.lang.SuppressWarnings "unchecked"} Annotated [x])
22:14clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:14BlackavarIs joint Seajure/Bay Area Clojure Group meeting.
22:16ferd_after that deftype: (-> (Annotated. nil) class .getAnnotations alength) ==> 0
22:16ferd_anybody knows what I'm doing wrong?
22:18qbgThat annotation is not retained at runtime
22:21TimMcaha
22:21ferd_duh
22:21qbgI assume you are interested in annotations for interop, correct?
22:22qbgHere's one that is retained at runtime: http://docs.oracle.com/javaee/6/api/javax/inject/Inject.html
22:23qbgThough that one isn't for types
22:24ferd_my issue: using deftype with annotations worked for me. Now, I wrong a macro that spits the deftype with the annotations... now the code that reads it fails to find it
22:24ferd_the SuppressWarnings example above was just an attempt to isolate my problem
22:36ferd_qbg: thanks... I couldn't either. Anyway, I think I can repro my problem in a small example
22:39TimMcqbg: Pretty much any SOAP annotation.
22:40TimMcJUnit annotations.
22:40TimMcSpring.
22:40ferd_he's my issue:
22:40ferd_(deftype ^{Goal "goal"} A [x])
22:40ferd_(-> (A. nil) class .getAnnotations alength) ;; => 1
22:41ferd_;; OK so far
22:41ferd_(defmacro deftypeM [T] `(deftype ~(with-meta T {Goal "goal"}) [x#]))
22:41ferd_(deftypeM M)
22:41ferd_(-> (M. nil) class .getAnnotations alength);; => 0 (!?)
22:42TimMc&(-> ^{String "foo"} 'hi meta keys first class)
22:42lazybot⇒ nil
22:43TimMcugh, I see my mistake
22:44accelis there a way to get visualvm to output clojure file line numbers / function names in it's profiler/sampler report?
22:44TimMc&(-> (with-meta [] {String "foo"}) meta keys first class)
22:44lazybot⇒ java.lang.Class
22:44accelI keep on getting a bunch of java.* and clojure.* classes, but not my own actual clojure sources
22:48TimMcferd_: Where is documentation on annotations and deftype?
22:49ferd_TimMc: you tell me ;-). Here's what I have: http://groups.google.com/group/clojure/browse_thread/thread/d2128e1505c0c117
22:50TimMcOooh, @Deprecated
22:51TimMcright now I'm thinking something about symbols vs. classes, give me a moment
22:55TimMcferd_: Yeah, I got nothing.
22:57ferd_I run out of ideas. Macroexpand-1 shows exactly what I need... but somehow the annotation is not retained
22:57TimMcferd_: Try symbols. {Goal "foo"} has a key that is the *class* Goal, and deftype is I think looking for the *symbol* 'Goal
22:57TimMcSo, (with-meta T {'Goal "goal"})
22:58TimMcThey print the same. :-/
22:58TimMc(Verified in own REPL.)
22:59ferd_holy sh*t, it worked!
22:59TimMchaha, yay!
22:59TimMcThat's a nasty thing to debug. I only figured it out because I was building some type hinting macros a couple weeks ago.
22:59qbgMetadata can be weird
23:00TimMc(most of which I had to scrap)
23:00ferd_TimMc: qbg: many many thanks again
23:01qbgI know when playing with defn, metadata has a tendency to be double evaluated
23:01ferd_I guess I called for way too many difficulties for my first non-trivial macro
23:01TimMcqbg: Right, the big lesson is that your metadata has to be a map of syntax, not values. :-P
23:05qbgMy issue was using lists in :arglists
23:06TimMchuh
23:06TimMcOh, should be vectors, right.
23:09ibdknoxanyone know of a decent text diffing lib for Clojure or Java?
23:14brehautibdknox: circulitous answer: bzr's diff3 via jython ;)
23:16ibdknox:p
23:17amalloyibdknox: what about whatever's used by cake test and lein difftest?
23:17amalloyi haven't looked into it, but i know they do diffs that include text
23:47brehautis there any way to get cljs to compile off standard input?
23:56choffsteinAnyone have any idea why I might be getting this when running my tests? "actual: java.lang.ClassCastException: com.newfoundresearch.ttm09.data.DataPoint cannot be cast to com.newfoundresearch.ttm09.data.DataPoint". I have a record that I am importing into two other namespaces, then type hinting. I pass an instantiation of DataPoint from one of those namespaces to the other and get this cropping up.
23:58choffsteinseems ... sort of odd.