#clojure logs

2010-01-23

00:17DeusExPikachuanyone know any libraries to communicate with web servers for the purpose of automating logging in and filling out forms?
00:25hiredmanDeusExPikachu: htmlunit
00:26DeusExPikachuhiredman, thanks, checking it out
00:39tomojDeusExPikachu: there's also webdriver
00:39tomojwhich can use htmlunit or real browsers, if that matters
00:40DeusExPikachutomoj, interesting, thanks
05:46esbenaI'm writing a plugin for Eclipse, but the plugin functionality could also be used in VisualStudio. Would it be an option to write the plugin backend in language neutral clojure, which is then capable of reading the plugin data-structures seamlessly as the backend could be either .NET or Java?
08:27LauJensenHow many data visualization libs do we have yet? I need something quick and pretty for a chart rendering - dejartes perhaps?
08:35chouserLauJensen: have you looked at Incanter?
08:35LauJensenYes - Need something else
08:35chouseroh
08:58angermanHmm. Is there a lib that serializes/deserialized clojure data-structures? I know clojure can create a string-representation of an object (sans Java classes) that can be recreated by parsing it. But is there a libe that combines that with spit and slurp? E.g. given a structure and a file?
08:58odrzutI have problems with emacs 23 + swank-clojure-project - it doesn't add jars from project/lib to classpath
08:59odrzutwhen I've changed elisp code in this function swank-clojure-project it prints classpath properly
09:00odrzutbut when I try from slime-repl (-> "java.class.path" System/getProperty (.split ,,, ":") seq) it return only standard jars
09:01angermanodrzut: even though what I'm about to suggest is not perfect, what I do is to use "lein swank" + slime-connect
09:01the-kennyodrzut: wait.. let me try your snippet
09:02the-kennyodrzut: hm.. can't reproduce. Are the jars in lib/? Where have you got swank-clojure? elpa?
09:03odrzutyes - I've installed from elpa
09:03odrzutand when I try lein swank + slime-connect I have the same problem
09:03the-kennythat's really strange
09:04odrzutI've probabyl broken emacs configuration somehow
09:04odrzutso it changes classpath after loading it by swank-clojure-project
09:08odrzuthere is my .emacs - I've fiddled with it a little trying to add native libs by hand
09:08odrzuthttp://www.nopaste.pl/l9c
09:08odrzutbut I'm noob with elisp
09:11the-kennyodrzut: I'd try commenting out the swank-clojure-*-path stuff
09:11the-kennyYou don't need this if you use leiningen and swank-clojure-project
09:13the-kennyIf this doesn't work, you should double-check (or show us) the project you're using
09:17jlbangerman: You can do something like (with-in-str (slurp filename) (read)) or you could use with-in-reader from duck-streams
09:17angermanjlb: exactly. I was just wonderig if there was a library already that provided that functionallity out of the box
09:21jlbangerman: that is out of the box, IMO. :) If you want to process data structures as they come in, use with-in-reader. If you're just reading the whole file into a var, use the first form.
09:23angermanjlb: I do get your point. I guess I'll write my own wrappers. It's just like having (let [struct (read "file")]) (write "file" struct) were nice conviniences.
09:30LauJensenCan someone please explain this phenomena to me. When I start heavy computations single threadedly, core#1 goes to about 100% while core#2 idles at 20% presumable keeping the OS running. After about 120 seconds they switch, so c#2 goes to 100% while c#1 idles at 20% - They keep doing this at random intervals between 15 - 120 seconds throughout the computation
09:32odrzutmaybe it's to keep temperatures more equal ?
09:34LauJensenSo you suspect the OS is moving it ?
09:34angermanLauJensen: sure. It must be the os scheduler. I hadly think java's internal reach so far as to selec the cpu.
09:34odrzutI don't know how to move thread from one core to the other programmaticaly
09:35the-kennyI'd also blame the os.
09:35LauJensenMakes sense
09:35the-kennyYou should try it with a similiar program in python or so
09:38odrzutthanks to all, my emacs saw the Classpath :)
09:38odrzutI've removed everything except elpa stuff from .emacs, and tried with slime-connect
09:49somejan,(. Short TYPE)
09:49clojurebotshort
09:49somejan,(let [t Short] (. Short TYPE))
09:49clojurebotshort
09:49somejan,(let [t Short] (. t TYPE))
09:49clojurebotjava.lang.IllegalArgumentException: No matching field found: TYPE for class java.lang.Class
09:50somejanany way to make such a construction work? with the type passed in as an argument?
10:07LauJensensomejan: You're calling TYPE as if it were a method of Short, which its not, its a public static final field
10:07LauJensenI'm not sure if there's a way to alias that
10:08krumholtyou could do (let [t Short] (Class/forName (.getName t)))
10:08krumholt,(let [t Short] (Class/forName (.getName t)))
10:08clojurebotjava.lang.Short
10:09somejan,(let [t Short] (. (Class/forName (.getName t)) TYPE))
10:09clojurebotjava.lang.IllegalArgumentException: No matching field found: TYPE for class java.lang.Class
10:09somejanhmm
10:09somejannot yet
10:10somejan,(Class/forName (.getName Short))
10:10clojurebotjava.lang.Short
10:10somejan,(Class/forName (.getName Short/TYPE))
10:10clojurebotjava.lang.ClassNotFoundException: short
10:10somejanIt doesnt seem to work with primitives
10:11somejanAny way to pass (some representation of) primitive types around in parameters?
10:14the-kennyI don't think so. As far as I know, parameters are always boxed
10:16somejanWhat I want is some kind of representation of the primitive type, so I can pass that to (make-array type [stuff])
10:17the-kennyOh, you mean the class?
10:17the-kennyTry something like (make-array Integer/TYPE)
10:17the-kenny,(class Integer/TYPE)
10:17clojurebotjava.lang.Class
10:18slava,(class (fn ()))
10:18clojurebotjava.lang.NullPointerException
10:18slava,(class (fn []))
10:18clojurebotsandbox$eval__5151$fn__5153
10:18somejanThat's what I was trying, but can the class be passed in by a parameter?
10:18the-kennysomejan: Yes
10:20the-kennyhm.. wait
10:20somejanhow? this doesn't work:
10:20somejan,(let [t Integer/TYPE] (make-array t [1 2 3]))
10:20clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Character
10:21somejan,(let [t Integer] (make-array (. t TYPE) [1 2 3]))
10:21clojurebotjava.lang.IllegalArgumentException: No matching field found: TYPE for class java.lang.Class
10:23krumholt,(let [t java.lang.Integer] (make-array t 10))
10:23clojurebot#<Integer[] [Ljava.lang.Integer;@1774e9>
10:24krumholtor also
10:24krumholt,(let [t Integer/TYPE] (make-array t 10))
10:24clojurebot#<int[] [I@c71b37>
10:24the-kennysomejan: there you are :)
10:24somejanthx
10:25somejanso
10:25somejan,(let [t Integer/TYPE] (make-array t 10))
10:25clojurebot#<int[] [I@150c82>
10:25somejanworks, but
10:25somejan,(let [t Integer/TYPE] (make-array t [10 11 12]))
10:25clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Character
10:25somejandoesn't
10:25somejan???
10:25krumholtbecause if you need more dimesnsion you need to do
10:26somejanno, i meant
10:26krumholt,(let [t Integer/TYPE] (make-array t 10 11 12))
10:26clojurebot#<int[][][] [[[I@f1369f>
10:26krumholtmake-array is not filling the array
10:26krumholtit is just creating it
10:26somejanah, wait
10:26krumholt,(doc make-array)
10:26clojurebot"([type len] [type dim & more-dims]); Creates and returns an array of instances of the specified class of the specified dimension(s). Note that a class object is required. Class objects can be obtained by using their imported or fully-qualified name. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
10:26somejanim confusing make-array and into-array
10:27somejan,(let [t Integer/TYPE] (into-array t [1 2 3]))
10:27clojurebot#<int[] [I@b053b>
10:37tmountainis there a way to alias a function to another name within the current namespace?
10:38the-kennytmountain: There's def-alias in contrib?
10:38Chousuke(doc alias)
10:38clojurebot"([alias namespace-sym]); Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly."
10:38Chousukehmm
10:38tmountainI'm familiar with the alias function, which aliases a namespace
10:38the-kenny,(use 'clojure.contrib.def)
10:38clojurebotnil
10:38the-kenny,(doc defalias)
10:38clojurebot"([name orig] [name orig doc]); Defines an alias for a var: a new var with the same root binding (if any) and similar metadata. The metadata of the alias is its initial metadata (as provided by def) merged into the metadata of the original."
10:39tmountainso defalias is the solution?
10:39Chousukeor just (def foo bar)
10:40Chousukeif you don't mind losing the metadata
10:40tmountaincool, thanks guys ;-)
10:41tmountainshould've thought of using def
10:41Chousukeit's not a true alias though. it creates a new var
10:41tmountainthis is mainly for DSL purposes
10:41Chousukeshould be fine then
10:41tmountainI want to duplicate a function with a couple of names that make sense for the context they're called in
10:42tmountainhave a nice weekend
10:45datkaDoes anyone know what this error means? java.lang.VerifyError: class clojure.contrib.duck_streams$loading__4757__auto____1893 overrides final method meta.()Lclojure/lang/IPersistentMap; (http.clj:1)
10:45datkaI'm trying to build a pom file for a library that doesn't have one
10:48duck1123my pom file is at http://gist.github.com/284653 if it helps
10:49the-kennyduck1123: ugh... why not use leiningen?
10:51duck1123I haven't really messed much with leiningen yet. This was someone elses project I wanted to play with, and I'm used to maven
10:53duck1123does leiningen do swank servers yet?
10:54the-kenny"lein swank"?
10:54the-kennyYes
10:54the-kennyYou can also do M-x swank-clojure-project
13:22tolstoyIf you have a raw form in your ns, like, say, (init), that'll get evaluated and run at compile time AND load time (in an AOT context), right?
13:23tolstoyCan you do something like (if-not *compile-files* (init)) so that it doesn't run during compilation, but have it still work when run after AOT compilation?
13:23Chousukehmm
13:23Chousuke,*compiling*
13:23clojurebotjava.lang.Exception: Unable to resolve symbol: *compiling* in this context
13:24Chousukesome var like that exists but I don't remember what it was called
13:24tolstoy*compile-files*
13:24tolstoy*compile-files*
13:24tolstoyvar
13:24tolstoySet to true when compiling files, false otherwise.
13:24Chousukeah, duh
13:25tolstoyI was just wondering if "loading" the code (when it's compiled into a jar) would actually do the init.
13:25Chousukewhy don't you test? :/
13:25tolstoyI guess I can crank up this app and see. ;)
13:25AndiXnghi
13:26AndiXngsorry for this newbie question, but I could not find enough information: I am looking for a vector or list where it is possible to insert/remove elements in the middle
13:26AndiXngwhat is the best way to do that? zippers?
13:27Chousukeno efficient collection supporting that exists right now. :/
13:27Chousukeyou might want to try using maps
13:27AndiXnghm
13:28AndiXngbut with trees, this should be easy (O(log n) is ok for me)
13:29AndiXngdo you know any clojure lib that provides structures with insert/remove?
13:29Chousukewell, maps are your best bet.
13:29Chousukevectors are trees but they don't support efficient insertion in the middle
13:30Chousukechouser is working on finger trees but I don't think it's ready yet :/
13:30AndiXngI don't understand yet, how to use maps. should I select indices "with gaps" and fill them over time, any, if necessary, recompute all keys?
13:31AndiXng-any +and
13:31Chousukedon't understand maps?
13:31AndiXngI understand maps
13:31Chousukethey're just, well, maps.
13:31Chousuke:P
13:32AndiXngbut give me an example, please. let's say we have a list 1,2,4,5 and want to insert 3
13:32Chousukeyou could emulate a vector with one by using integer keys
13:32AndiXnghow to represent 1,2,4,5 as a map?
13:32Chousukewell, the map would be indexed of course
13:32Chousukehmm
13:32AndiXng{0 1, 1 2, 2 4, 3 5}?
13:33ChousukeI suppose that wouldn't help /:
13:33AndiXngyeah
13:34Chousukehm. I guess you're out of luck
13:34AndiXngi thought about using sorted-set with pair items: [position-information, content]
13:34AndiXngabsolutely.
13:34AndiXng:-D
13:34Chousukeclojurebot: finger trees
13:34clojurebotTitim gan éirí ort.
13:34Chousukepsh
13:36Chousukehttp://github.com/Chouser/finger-tree apparently finger trees could be of use for you, but I don't know if chouser's implementation is at all ready for use yet (or even how to use it)
13:37AndiXngas already said, my idea would be to use a sorted-set with pair items [position-information, content]. i would use gaps inbetween and fill them over time, and when necessary, recompute all keys.
13:37AndiXngexample: #{[0 1] [100 2] [200 4] [300 5]} . when 3 is added at position 2, then #{[0 1] [100 2] [150 3] [200 4] [300 5]}
13:37AndiXngI think this could be "ok"
13:37AndiXngbut still O(n)
13:37AndiXng:-/
13:37AndiXngok I'll have a look at finger trees, thanks
13:38AndiXngbut I wonder why nobody else had this problem before... o_O
13:38AndiXngit's very common to insert and remove elements I think...
13:38AndiXngat least if you come from an imperative language
13:38Chousukewell, you're not the first one to have this problem, but it's apparently not common enough
13:39Chousukeotherwise Clojure would have some data structure for efficient insertion and removal from the middle I guess. :)
13:40Chousukeare you sure you can't come up with another algorithm that doesn't require insertions or removals? :/
13:42AndiXngwell, that's part of the application domain
13:42AndiXngif I have a list where elements can be inserted and removed, I should implement this with a list where elments can be inserted and removed
13:43AndiXngI just found out how pcollections (Java persistent data structures lib) does it
13:43AndiXnglogarithmic time, like in "Glasgow Haskell Compiler"
13:43AndiXnghm
13:43AndiXngprobably I'll use that
13:44AndiXngI could also write a clojure lib with that algorithm
13:44AndiXnghmmmm
13:44AndiXngwhat do you think, would that be useful for anybody but me?
14:23tolstoychouser: Yes, you can use *compile-files* to NOT evaluate forms when AOT compiling, but the forms DO get evaluated when the code is loaded.
14:24LauJensenIs that 'Practical Clojure' by Luke Vanderhart any good?
14:24tolstoyNow, if I can just figure out how to close a buffer in text-mode emacs....
14:25LauJensenM-x kill-buffer
14:25tolstoyAh "kill" was the word.
14:25tolstoyC-x k seems to work, too.
14:49tolstoyWhen you access @atom, is that a synchronized read?
15:34somejan,(def x 1)
15:34clojurebotDENIED
15:45somejan`{ ~@'(:a 1) }
15:45somejan,`{ ~@'(:a 1) }
15:45clojurebot1
15:46somejan,`{ ~b }
15:46clojurebot1
15:46somejanOn my console that says "java.lang.ArrayIndexOutOfBoundsException: 1"
15:48chousersomejan: yeah, that's not really supported
15:49somejan,{1}
15:49clojurebotjava.lang.ArrayIndexOutOfBoundsException: 1
15:50somejan,`{~b}
15:50clojurebot1
15:54dnolensomejan: if you wan to splice into a hashmap in a macro use hash-map and not the literal syntax
15:54somejanIs the literal syntax supposed to not work in macros?
15:55dnolensomejan: I haven't been able to get it to work, but only when trying to splice in values, but perhaps someone else knows different
15:58chouserI think the problem is that we're forgetting this code is actually data
15:59chouserit doesn't quite work like this today, but `{~@b} could be read as (syntax-quote {(unquote-splice b)})
16:08chouserwhich means an outer list with two elements, the first the symbol syntax-quote, the second a map
16:08chouserbut that map only has a single item in it, a list. That's not legal
16:09ChousukeI tried to implement syntax-quote like that.
16:09ChousukeI wasn't very succesfull :P
16:10chouseroh, yeah? I think rhickey wants it, or at least wanted to know if anyone knew if it was possible.
16:10chouserhm...
16:10Chousukeit's possible, but nesting and autogensyms complicate it a fair bit
16:11chouserah, interesting.
16:11Chousukeand implementing the symbol resolution wasn't exactly pleasant either (I think I have working code for that, at least, but it's very ugly)
16:12chouserdid you still try to do the autogensym at read time?
16:13Chousukemy current reader just runs the syntax-quote function at read-time
16:14Chousukeit works, as far as I can tell, but if I turn it into a macro I run into problems :/
16:15Chousukeas far as I can tell it works because running the function at read time expands the inner syntax quotes first,
16:16chouserI can certainly beilieve that it all gets very hairy very quickly.
16:16chouserhow did you handle autogensym? b# reads as (autogensym b) or as b_123 ?
16:16chouseror just as b# ?
16:16chouser,b#
16:16clojurebotjava.lang.Exception: Unable to resolve symbol: b# in this context
16:17chouser,'b#
16:17clojurebotb#
16:17Chousukeit expands to b_234, but only within `
16:17Chousuke,'`f#
16:17clojurebot(quote f__5223__auto__)
16:17ChousukeI guess I should find some time to work on the reader again
16:17chouserok, so you do it at read time like Clojure does now.
16:18Chousukeyeah
16:20Chousukehttp://github.com/Chousuke/clojure/blob/new/clojure-reader/src/clj/clojure/lang/reader/internal.clj this is how it is at the moment
16:21Chousukestill uses the ^ reader macro, too :P
16:33somejan,{:a}
16:33clojurebotjava.lang.ArrayIndexOutOfBoundsException: 1
16:34somejanIs this supposed to be an IOBE instead of an IllegalArgumentException?
16:34somejan,(hash-map :a)
16:34clojurebotjava.lang.IllegalArgumentException: No value supplied for key: :a
16:36somejanThe exception comes from PersistentArrayMap.java:217, where the code is actually trying to index an array
16:36somejanIt looks like a bug to me, but maybe someone knows if it's a feature before I make an issue?
16:43tolstoydoes defmacro actually pay attention to its attr-map?
16:43tolstoyAs in, (defmacro name "doc" #{:private true}....)?
16:46tolstoyAh, the arglist documentation for defmacro is wrong.
16:46Chousukesomejan: it's a "feature"
16:47Chousukesomejan: {:a} is not a valid literal in any case.
16:47Chousukesomejan: and it doesn't really matter what exception it generates :)
16:48somejanhmm, I'd say clojure also needs to give the right error messages
16:48Chousukewell, yeah
16:49somejanat the very least a descriptive message, instead of just "1"
16:49ChousukeI guess it's the "no-one wants to work on the compiler" excuse again :P
16:50Chousukethough this one is actually generated within the reader
16:50somejanah, but then it is in fact a bug :)
16:50somejanand not a feature
16:51somejanSo, is this the kind of thing that should go in the bugtracker?
16:59hiredmansomejan: it's undefined behaviour
17:00somejanI didn't know Clojure had a language specification, even one which allows undefined behaviour :P
17:01hiredman,{:a}
17:01clojurebotjava.lang.ArrayIndexOutOfBoundsException: 1
17:01somejanBut I still think undefined behaviour should produce a descriptive error message
17:01hiredman*shrug*
17:02somejan{:a} isn't a real problem, but when it is in a macro it can be hard to find
17:02somejan(which is where I first ran into this)
17:04hiredmansure, but how big of an issue?
17:04hiredmanclojurebot: ticket search ArrayIndexOutOfBoundsException
17:04clojurebot()
17:04hiredman:|
17:05hiredmanclojurebot: ticket search map literal
17:05clojurebot("#87: GC Issue 83: \t PersistentArrayMap trust the reader (map literals) too much")
17:05hiredmanclojurebot: ticket #87
17:05clojurebot{:url http://tinyurl.com/y92lmv8, :summary "GC Issue 83: PersistentArrayMap trust the reader (map literals) too much", :status :new, :priority :low, :created-on "2009-06-17T20:36:09+00:00"}
17:33alexykis there a method to get the number of day, whether in the year or Julian/Gregorian, from the old silly java.util.Date?
17:33chouserday of the year, or something else?
17:33alexykand can somenody with the sysop please do -R on this channel?
17:33alexykchouser: day of year is a good start
17:34alexykJoda Time has dayOfYear, and with juDate I'm at a loss, some stupid calendar and <whatnot>
17:38chouser,(.get (java.util.Calendar/getInstance) java.util.Calendar/DAY_OF_YEAR)
17:38clojurebot23
17:38alexykok
17:42hiredmanI have a patch for #87 and the {:a} issue: http://www.thelastcitadel.com/lab/map-literals-error.diff
17:43hiredmanchouser: maybe you could take a look at put it in assembla :)
17:44chouserhiredman: if it's a fix to an accepted bug, you should go ahead and attach it.
17:45hiredmanI guess this is as good a time as any to send and email to ask to be allowed to do that sort of thing
17:47hiredmanI send an email to dev right?
17:50alexykno car and cdr in core??
17:50chouserfirst rest
17:50alexykchouser: yeah, but no car and cdr?! :)
17:51chousernope
17:51the-kennycar and cdr is to old-school for a modern lisp
17:51alexykwell just as an homage to lisp they'd better be there
17:52alexyksounds like a bow to the general dumbing0down of the universe
17:52alexykto help Britney Spears learn a lisp
17:53hiredmancar and cdr are the names of registers on machines no one uses anymore
17:53krumholt_it seems that with 1.1 "apply" has changed and i can no longer do (apply foo) but i have to do (apply foo nil) why is that?
17:54hiredmanare you sure?
17:54hiredmanI don't think (apply foo) ever worked
17:54krumholt_it did
17:54krumholt_i used it a lot and now i have to change a lot :)
17:56alexyknever mind...
17:56hiredmanwell I'll be damned
17:57hiredmanthere is a commit that mentions apply back in august
17:58krumholt_well i haven't upated in a while :) i just see no reason to change the behaviour
17:58hiredmanok
17:58alexykchouser: so you get day of year for a calendar, not an existing java.util.Date. Is one supposed to create a Calendar of juDate? Or get the Calendar from juDate?
17:58chouseractually, 'cdr' would be pretty misleading. Clojure's 'rest' is not the same thing
17:58hiredmanapply got arity overloads, and has no arity for the zero arg case
17:59krumholt_could that be redone?
17:59krumholt_(apply foo) also seems even prettier then ((foo))
18:00the-kennyIsn't (apply foo) different to ((foo))?
18:00alexykchouser: I just think that car and cdr may co-exist with first and rest, to claim the lisp's inheritance
18:00the-kennyShould be (apply (foo))
18:01chouser,(.get (doto (java.util.Calendar/getInstance) (.setTime (java.util.Date.))) java.util.Calendar/DAY_OF_YEAR)
18:01clojurebot23
18:01hiredmanthe-kenny: right (apply foo) would just be (foo)
18:02hiredmanhttp://github.com/richhickey/clojure/commit/5ca86e045bd5742566c647dcc46b8e546a6a7c06 is the commit
18:03hiredmanyour best shot would be taking it to the mailing list since rhickey doesn't appear to be in
18:03alexykchouser: right... Do you think that crating one instance and then setTime/get day of year for each of a gazillion juDate's is faster than converting each to a DateTime and calling getDayOfYear on each? I guess I'll have to benchmark.
18:03chouserbeats me
18:04alexykcan't wait when they induct DateTime into core Java so we can forget the nightmarish juDate/Calendar crap
18:15the-kennyWhich contrib should I use with clojure 1.1.0 (leiningen)
18:15the-kenny+? :)
18:53somejanIs there a way to make compiled clojure code be in a specific package, so it can access protected methods on java classes in the package?
18:54somejanThe :gen-class thing apparently just puts the stub class in the package, but not the real code
18:54the-kennysomejan: There's a hack in contrib: wall-hack-method
18:55the-kennyIt uses reflection to call protected (or private) methods
18:55somejanah, I'll have a look
18:55the-kennyI think it's in java-utils
19:07somejanIt works, but only to read fields, not to write them. I don't see anything in that namespace that will write fields, so guess I'll have to hack it myself
19:14tomojsay you've got a big tsv file and you want to treat it as a lazy seq of structmaps
19:15somniumso, is there a standard way to load somefile.txt off the classpath? Ive only been able to get duckstreams to work with absolute paths/paths relative to pwd
19:15tomojdoes writing a macro with-tsv which with-opens the file, binds the lazy seq of structmaps, then checks what the body returns and wraps a doall if it's a seq sound like a reasonable approach?
19:16tomojit seems kind of strange.. this macro must be used at the top level of whatever processing you're doing, to ensure the file doesn't close before you're done
19:16tomojread-lines is cool but what if we don't consume the entire seq? :/
19:17tomojsomnium: you can make it a "resource"
19:18somniumtomoj: how to do that? (I only seem to find some java idiom (-> this .getClass .getClassLoader ...) on google)
19:18tomojyep, that's what I meant
19:18tomojexcept
19:18tomoj(.getResource (clojure.lang.RT/baseLoader) "foo.txt")
19:18tomojgives you a URL
19:19somniumah, nice
19:19somniumthx!
19:19tomojmight be good to stuff everything into a resources/ subdir and add that to the classpath
19:19tomojif the paths are coming from users
19:20tomojI think lein adds resources/ to the classpath by default
19:20krumholt_anyone know where i can find some information on protocols? preferably a screencast
19:21tomojif you find a screencast let me know!
19:21tomojI still don't understand them
19:25AWizzArdCurrently Clojure has the EP License. Could Rich in principle change the license if he wanted without the agreement of other contributors?
19:26hiredmanyes
19:26hiredmanthe CA assigns joint copyright
19:26AWizzArdIs this because he is the initial contributor?
19:27AWizzArdah ok
19:27AWizzArdOtherwise I would understand the EPL in such a way that as soon some other author publishes any code and the initial contributor includes this in his code base it would not be possible anymore to get rid of the EPL
19:30AWizzArdhiredman: do you know if Rich used an existing license as his CA, or did he wrote it himself?
19:31AWizzArdnevermind
19:31AWizzArdjust saw it at the bottom, that he used something that Suns lawyers wrote
19:40hiredmanthe ability to change licenses if needed is the whole point of the CA
19:54alexyk,(let [{:keys [a b]} {:a 1}] (println a))
19:54clojurebot1
19:54alexyk,(let [{:keys ["a" b]} {"a" 1}] (println a))
19:54clojurebotjava.lang.Exception: Unsupported binding form: a
19:54alexyk,(let [{:keys [a b]} {"a" 1}] (println a))
19:54clojurebotnil
19:54alexykso, does :keys only support keywords?
19:55the-kennyalexyk: I think so
19:57alexykis there a fascinating tour of data massage you can type into a repl before a group of noobs to bedazzle them?
20:00the-kennySomething with a lazy-seq would be cool
20:00the-kennylike (take 100 (small-function-for-calculating-fibonaccis)
20:00the-kenny+)
20:18krumholt_hi i created a simple protocol for a list. could someone take a look if thats how one would use a protocol? especially my use of new seems strange.
20:18krumholt_http://paste.lisp.org/display/93815
21:29AWizzArdwhen I have a sorted set of 1000 elements, can i then get a subset or subseq of the elements 450 to 500?
21:34chouserAWizzArd: put them in a sorted set (or map) and use 'subseq'
21:35AWizzArdthey already are in a sorted set
21:35chouserthere you go. subseq.
21:35chouseroh
21:35chousersubseq is based on the value, not the position
21:35AWizzArdyes
21:36chouserif you want position, I guess I'd put them in a vector and use subvec.
21:36AWizzArdprobably
21:36AWizzArdoki
21:45blbrown_win'
21:45blbrown_win,(/ 5 9)
21:45clojurebot5/9
21:46blbrown_win,(/ 5.0 9.0)
21:46clojurebot0.5555555555555556
23:05datkaIf I invoke "lein swank" shouldn't my source code (or the jar) be on the classpath somewhere?
23:06datkaI'm printing out the urls in my classpath, and I'm seeing the root of the project, but not the src/ directory
23:09tomojhmm, I wonder if we can deal with the no threads restriction on app engine :(
23:26alexykchouser: check it out: http://paste.pocoo.org/show/169141/
23:28datkaso does anyone uses leiningen with swank that knows what I might be doing wrong?
23:36chouseralexyk: oh, my. DateTime is from JodaTime?
23:56quotemstrWhy does clojure use type hints instead of CL-style DECLARE?