#clojure logs

2009-04-10

00:28somethingI'm trying to get clojure mode running in emacs. I added (require 'clojure-auto), but I'm getting the following error: File error: Cannot open load file, clojure-auto
00:28somethingactually I'm using Aquaemacs.
00:30somethingI don't actually see a file named clojure-auto in the clojure-mode git clone.
01:28dakrone_hb,(size '(1 2 3))
01:28clojurebotjava.lang.Exception: Unable to resolve symbol: size in this context
01:28dakrone_hb,(len '(1 2 3))
01:28clojurebotjava.lang.Exception: Unable to resolve symbol: len in this context
01:28dakrone_hb,(length '(1 2 3))
01:28clojurebotjava.lang.Exception: Unable to resolve symbol: length in this context
01:28dakrone_hbbah, what is it...
01:28slashus2,(count '(1 2 3))
01:28clojurebot3
01:29dakrone_hbslashus2, that's it! thanks :)
01:37bradfordsuppose i have many key value pairs in a map like this {"open" (rand) "high" (rand) "low"}
01:37clojurebotmap is *LAZY*
01:37bradfordand i want a small function to pass a key to and get back a key value pair (i.e. extract that rand bit
01:37bradfordwhat does that function return?
01:38hiredman,(:open {:open (rand) :high (rand) :low (rand)})
01:38clojurebot0.021964224049019876
01:43bradfordhiredman, what is the colon doing htere?
01:43bradfordi know - stupid questions, but bear with me :-)
01:43slashus2bradford: Makes them keywords.
01:44slashus2Which represent themselves.
01:44hiredmanhttp://clojure.org/data_structures#toc8
01:44hiredmanclojurebot: keywords?
01:44clojurebotexcusez-moi
01:44hiredmanclojurebot: keywords is <reply>http://clojure.org/data_structures#toc8
01:44clojurebotOk.
01:45bradfordyea, i'm reading about keywords and the reader
01:46bradfordso these keywords evaluate to themselves and have a name, which is the string
01:47bradfordso it is always idiomatic clojrue to use these as keys rather than strings in maps and suhc, correct?
01:47durka42yes
01:47durka42and you can do tricks like calling them as functions (and pass the map in which they are a key)
01:48bradfordcould you give me a simple example of such a trick?
01:48durka42what hiredman did
01:48hiredmanit's what I did with :open
01:48durka42of course you can do it the other way
01:48durka42,({:a 1 :b2 } :a)
01:48clojurebotjava.lang.ArrayIndexOutOfBoundsException: 3
01:48hiredman,({:a 1} :a)
01:48clojurebot1
01:48hiredman,(:a {:a 1})
01:48clojurebot1
01:49hiredmanmaps are functions of their keys, keywords are functions of maps
01:49hiredmansimilar with vectors
01:49hiredman,([1] 0)
01:49clojurebot1
01:50bradfordok, let me try to testate "maps are functions of their keys, keywords are functions of maps" to see if i understand
01:50clojurebotmaps are functions
01:50dakrone_hbcan maps contain functions as the values also?
01:50hiredmansure
01:51dakrone_hb,({:fn (fn [] (println "foo"))})
01:51clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: PersistentArrayMap
01:51hiredmanor even as keys
01:51bradforda key can be used as a function that takes a map and returns the value associated with the key?
01:51hiredman,{:fn (fn [] (println "foo"))}
01:51clojurebot{:fn #<sandbox$eval__2222$fn__2224 sandbox$eval__2222$fn__2224@5ba0d9>}
01:51hiredmanbradford: a keyword can, and so can a symbol, but not any other kind of key you might use
01:52bradfordright, such as in my initial code when i sued strings
01:52hiredmanthere is also get
01:52hiredman,(get {:a 1} :a)
01:52clojurebot1
01:52bradfordright, i have been using get but now it seems inferior
01:53bradfordand so it works the other way around as well...,({:a 1} :a)
01:53hiredmanyes
01:54bradfordbecause the map is a function ath when applied to a key (or keyword?) retuns the value associated with that key
01:54bradforddo I ahve it right?
01:54hiredmanyes
01:54bradforddamn, that is pretty powerful
01:54hiredmana map as a function can take any kind of key
01:54hiredman,({"foo" 1} "foo")
01:54clojurebot1
01:54hiredmanyou can also provide defaults
01:54hiredman,({"foo" 1} :bar 3)
01:54clojurebot3
01:55hiredmanreturns 3 because :bar is not in the map
01:55hiredman,(:bar {"foo" 1} 3)
01:55clojurebot3
01:56bradfordand what is going on there with those commas?
01:56hiredmanthey just get clojurebot's attention
01:56hiredmancommas are white space in clojure
01:56bradfordah, i see
01:57bradfordso this works regardless ,({"foo" 1} :bar 3) map as a function applied to a key
01:57hiredmanyes
01:58bradfordbut (:a {:a 1}) that is only valid if the key is a function or a keyword (which you can use as a function) ?
01:58hiredmanyes
01:58hiredmansymbols too
01:58hiredman,('a {'a 1})
01:58clojurebot1
01:58durka42,(ifn? :a)
01:58clojurebottrue
01:59durka42,(ifn? {})
01:59clojurebottrue
01:59durka42,(ifn? 3)
01:59clojurebotfalse
01:59bradfordah, neat
01:59durka42~def ifn?
02:01bradfordok, now that i get this, back to the initial question: {:open (rand) :high (rand) :low (rand) :close (rand)}
02:02bradfordhow would i am stract a little function that produces the pair for the keyword and a rand?
02:02hiredman(seq {:open (rand) :high (rand) :low (rand) :close (rand)})
02:02hiredman,(seq {:open (rand) :high (rand) :low (rand) :close (rand)})
02:02clojurebot([:open 0.8407993627078036] [:high 0.7140756192186338] [:low 0.39123758183484647] [:close 0.7588801724644191])
02:03hiredmanwait
02:03hiredmanI know this set
02:03hiredmanyou doing markets?
02:03bradfordindeed :-)
02:04bradfordright now starting out building a time series database on tp of hbase
02:04bradfordseems like a good starter porject to learn clojure
02:04hiredman,(let [a (java.util.ArrayList. (seq {:open (rand) :high (rand) :low (rand) :close (rand)}))](java.util.Collections/shuffle a) (first a))
02:04clojurebot[:open 0.6810614330271418]
02:05hiredman,(let [a (java.util.ArrayList. (seq {:open (rand) :high (rand) :low (rand) :close (rand)}))](java.util.Collections/shuffle a) (first a))
02:05clojurebot[:close 0.08798164520592999]
02:05hiredmanthat might not be the best way to pick a random item
02:07bradfordah, right. my ultiamte goal is to create random time series
02:07bradfordso this map will be the value in another map where the keys are data/time
02:07bradford
02:07bradfordERC>
02:07bradfordERC> (defn random-trades [count] (for [x (range count)] [{:price (rand) :volume 1000}]))
02:08bradfordsomething liek that
02:15bradfordso now I ahve this: (defn random-trades-starting-at [count]
02:15bradford (for [x (range count)] [{:price (rand) :volume 1000}])
02:16bradfordif I want to generate a sequence that is a map of key-vales wher ehte key is a date and the value is the {:price :volume} - what sould I do?
02:24hiredman,(java.util.Date.)
02:24clojurebot#<Date Thu Apr 09 23:26:21 PDT 2009>
02:24bradfordright
02:24bradfordmy problem is to generate a mp using the for macro
02:24hiredmanyou need into
02:24bradford,(defn random-trades-starting-at [count]
02:24clojurebotEOF while reading
02:24bradford (for [x (range count)] {:price (rand) :volume 1000}))
02:25bradfordresults in a big list
02:25hiredman,(into {} '([:a 1]))
02:25clojurebot{:a 1}
02:25hiredman,(into {} '([:a 1] [:b 2]))
02:25clojurebot{:b 2, :a 1}
02:25hiredmanor reduce
02:29bradford(defn random-trades-starting-at [count]
02:29bradford (into {} (for [x (range count)] [x {:price (rand) :volume 1000}])))
02:29bradfordcool
02:29cp2yeah
05:10Carstenhi
05:11CarstenDoes anynoe know how to call a macro from clojure and get the evaluated result and not just the expanded expr
05:21Neronususe it like a function
05:23AWizzArd_Carsten: how are you trying this right now?
05:23AWizzArd_For example, AND is a macro
05:23AWizzArd_,(and (= 5 5) true true)
05:23clojurebottrue
05:24CarstenI defined my own macro to get the arglists of a function
05:25Carstenand it only returns a Cons
05:25Carsten((clojure.core/meta (var #'org.enclojure.ide.nb.editor.ClojureSourceTemplate/abb)) :arglists)
05:25Carstenabb is the function, in the REPL it returns ([a [b] [& c]])
05:26Neronuscould you paste the code defining the macro somewhere?
05:26Carsten(defmacro extr [fun] `((meta (var ~fun)) :arglists))
05:27Carstenrats - I meant: how to call a macro from _Java_
05:27Neronusahhh.. sorry, I can't help you there. Maybe someone else can
05:29ChousukeCarsten: call it, get the form, then eval the form?
05:30NeronusQuestion is, though, why this doens't happen transparently
05:30CarstenThis is what I am looking for: How to I eval the form returned?
05:31ChousukeI'm pretty sure there should be a java .eval function somewhere.
05:31Chousuke~source eval
05:31NeronusWell, macros are just functions which get and return s-exprs, and are treated specially by the compiler
05:31Chousukeclojure.lang.Compiler.eval
05:33ChousukeNeronus: I guess it's because it's not really a macro call; what you have in java is the function object :/
05:33Chousukehmm
05:33Chousuke,#^->
05:33clojurebotEOF while reading
05:33Chousukemeh
05:33Chousuke,(var ->)
05:33clojurebot#'clojure.core/->
05:33Chousuke,((var ->) 'test 'moretest)
05:33clojurebot(moretest test)
05:34Chousukethat's what happens with java I guess.
05:36Neronusprobably
05:42Carstentryied both Compiler.eval and eval.invoke -> ClassCastException: clojure.lang.Var cannot be cast to clojure.lang.Symbol
05:46Chousukehmmh
05:46Chousukeremember that eval takes a form
05:46Chousuke,(eval '(+ 1 1))
05:46clojurebotDENIED
05:46Chousuke... oh, right.
05:47CarstenIt must be something special with the macro - this macro works like a function
05:47Carsten(defmacro iif [test clause]
05:47Carsten `(if ~test
05:47Carsten ~clause
05:47Carsten ))
05:47Chousukeum, isn't that just when
05:48Carstensomething wrong with (defmacro extr [fun] `((meta (var ~fun)) :arglists)) ?
05:49Chousukenah
05:50CarstenFor my problem I can work around it (RT.meta works fine)
05:50CarstenBut might it be a bug?
05:57ChousukeI have no idea :/
05:57ChousukeI haven't used clojure from java.
06:33csaagerI created issue 104 for this problem
08:08Neronusignore = Name *spool
08:10Neronussorry
09:56alinphi
09:56alinpthere is a function in clojure like haskell's [1..]
09:56alinp?
09:56alinpor haskell's [1..9]
09:57hiredman,(range 10)
09:57clojurebot(0 1 2 3 4 5 6 7 8 9)
09:57hiredman,(take 10 (iterate inc 0))
09:57clojurebot(0 1 2 3 4 5 6 7 8 9)
09:57alinpoh, ok
09:57alinpthanks
10:05alinpwhy range is not giving all the elements from start to end ?
10:05alinpI mean:
10:05alinp,(range 1 9)
10:05clojurebot(1 2 3 4 5 6 7 8)
10:06alinpshouldn't give (1 2 3 4 5 6 7 8 9) ?
10:06hiredmanrange is sort of like array or vector indexing like that
10:06hiredman,(doc range)
10:06clojurebot"([end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0 and step to 1."
10:06alinpoh, end (exclusive), skipped that
10:06alinpthank you
10:26marklarIs there any function that takes a vector and an index/value and returns a vector with that index/value removed?
10:36NeronusI guess compojure is listening to 127.0.0.1 per default?
10:37cconstantine,(doc disj)
10:37clojurebot"([set] [set key] [set key & ks]); disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain key(s)."
10:38Neronusah, no. Its 0.0.0.0
10:55marklarcconstantine: thank you
11:08storkmeHEY GUISE
11:08storkmewhat's going on in this thread
11:09Hunthread?
11:11storkmewat?
11:11Hundat!
11:18storkmewat
12:04Cark~def send
12:57eyerisI have a (defn main [] ...) in my clj file but clojure.lang.Compiler still raises java.lang.NoSuchMethodError: main
12:58hiredman~compilation
12:58clojurebotcompilation is see compile
12:58hiredman~compile
12:58clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
13:07eyerisOkay. I change main to -main [s] and I'm trying to compile the namespace instead of the file, but I still get the NoSuchMethodError exception
13:08hiredmanpastebin
13:08lisppaste8ozzilee pasted "Messy Assoc" at http://paste.lisp.org/display/78368
13:09hiredman,(doc update-in)
13:09clojurebot"([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."
13:09ozzileehiredman: Cool, that will help.
13:10eyerishttp://pastebin.ca/1388133
13:13hiredmandon't do that
13:14hiredmanjava clojure.main -e "(compile 'wiscaid.reporting)"
13:14hiredmanthat exception is because clojure.lang.Compiler does not have a main()
13:17eyerisOh!
13:17ozzileehiredman: Hmm. Is there a way for update-in to work on all values in a vector? (update-in document [:sections * :items * :quantity] inc) ?
13:18hiredmannope
13:18hiredmanalso keep in mind, that using standard sequence functions (filter,map,etc) you will end up with a sequence instead of a vector
13:18ozzileehiredman: Is there another way to clean that pasted mess up, then? The update-in only helps the innermost assoc.
13:18ozzileehiredman: Crap, you're right.
13:19ozzileehiredman: Maybe I should be using zip?
13:19hiredmanwriting a vector map wouldn't be too hard
13:20hiredman,(keys [1])
13:20clojurebotjava.lang.Integer cannot be cast to java.util.Map$Entry
13:20hiredmanbah
13:20ozzileehiredman: No, it's not, I've done that once already. Still doesn't help the overall mess though.
13:21hiredmanmy attack would be to decompose the operations into several functions
13:23hiredmanalthough, I do like the zippers
13:26ozzileeYeah... it seems like an issue I've run into a number of times. There should be a simple jQuery-esque solution somewhere.
13:28hiredmanthe jquery-esque solution would be zippers, I guess
13:28ozzilee(update-in foo [:bar [] :baz [:one :two]] inc)
13:29ozzileeTo update keys :one and :two in :baz in every map in the vector :bar in foo.
13:29ozzileeEh maybe that's too compicated of a syntax.
13:31hiredmanis there a reason you are using vectors instead of just seqs for :items?
13:32ozzileehiredman: clojure-json uses vectors, not sure if it will encode seqs correctly, I'll give it a shot.
13:33duncanmla la la
13:34ozzileehiredman: Yeah, it will. So that doesn't matter.
13:34hiredman,(org.danlarkin.json/encode '(foo bar))
13:34clojurebotjava.lang.Exception: No such var: org.danlarkin.json/encode
13:35ozzilee,(org.danlarkin.json/encode-to-str '(foo bar))
13:35clojurebot"[\"foo\",\"bar\"]"
13:37hiredman(update-in document [:sections] (partial map update-items))
13:38hiredmanor something
13:40ozzileehiredman: Yeah, I suppose that would work. I need to do a number of updates to each item, so that would be more effecient than walking the document for each one, using the imaginary update-in with wildcards multiple times.
13:42hiredmanyou could always write the update with wild cards :P
13:43hiredman,:*
13:43clojurebot:*
13:43lisppaste8ozzilee annotated #78368 "Less Messy Assoc" at http://paste.lisp.org/display/78368#1
13:44ozzileehiredman: Yeah, that's an option :-) I was thinking a vector of keys to mean "all of these keys", not sure what to mean "all keys" though. Don't want to use something that could actually be a key.
13:45eyerisDoes the latest clojureql 03Feb work with the latest Clojure 30Mar?
13:45ozzileeMaybe I'll drop a message on the google group. I'm going to grab some lunch now, thanks for the help.
13:46eyerisI get an Exception "Unable to resolve symbol: lazy-cons in this context"
13:47hiredmanthat would be a no
13:48eyerisDarn. It doesn't work with the 20080217 Clojure release either (Unable to resolve condp).
13:49hiredmanLau_of_DK: well, whats the deal with clojureql?
13:50Lau_of_DKWe're a few hours of work away from 1.0, but hestitant to put that work into it
13:51eyerisLau_of_DK What Clojure revision are you using to develop?
13:52Lau_of_DKWe're always working on the HEAD
13:52dakrone_hbI'm having trouble accessing the Field.Store.YES from this javadoc: http://lucene.apache.org/java/2_4_1/api/org/apache/lucene/document/Field.Store.html I've tried (Field.Store/YES) and (Field/Store/YES), but it still isn't correct, what's the right way to access the static field?
13:52Lau_of_DKeyeris, you submitted limits right?
13:52hiredmandakrone_hb: $
13:52eyerisLau_of_DK Yeah
13:52hiredmanor not
13:53Lau_of_DKeyeris, Thank you for that - The code looked good and Im sorry I havent taken the time to implement it, its on the top of my list
13:53dakrone_hbhiredman, like (Field$Store/YES)?
13:53hiredmanpossibly
13:53dreishNo parens, right?
13:53dakrone_hbwhat's the rule of thumb for putting in the '$'?
13:53hiredmanthe javadoc doesn't make a whole lof of sense
13:53stuhoodyea... you need the $ for inner classes
13:53hiredman$ is for inner classes
13:53eyerisLau_of_DK np, I've been keeping a private copy for that project.
13:53stuhoodeven static inner classes
13:54dakrone_hbokay, so since I imported Field, Field.Store is an inner class right?
13:54hiredmanyou have to import Field$Store
13:55hiredmanbut yeah
13:55hiredmanField.Store
13:55hiredmanjust does not compute
13:55hiredmanit seems like the class name is Field.Store
13:55dakrone_hbhiredman, got it, importing Field$Store worked, I didn't realize I needed to import the inner class also
13:55dakrone_hbthanks!
13:56dreishI think the actual class Java compiles Field.Store to is Field$Store.
13:56dreishI'm guessing you'd see that in the .class binary.
13:56dakrone_hbis that a java-ism or a clojure-ism then?
13:56hiredmanbut the javadoc is so unhelpful
13:56dreishI believe it's a Javaism.
13:57dreishClojure just isn't doing the namespace->name translation that Java would do.
13:59blbrown_lt,(list nil nil nil)
13:59clojurebot(nil nil nil)
13:59blbrown_lthow do I condense that list so that the list is empty
14:00blbrown_lt,(zip (list nil nil nil))
14:00clojurebotjava.lang.Exception: Unable to resolve symbol: zip in this context
14:00dreish(filter identity '(nil nil nil))
14:00blbrown_ltthere you go
14:01hiredman,(remove nil? (list nil nil nil))
14:01clojurebot()
14:01blbrown_lt,(filter identity '(nil nil nil))
14:01clojurebot()
14:01dreishhiredman's is better -- mine also removes false.
14:01hiredmanI actualy use filter identity
14:02blbrown_lthiredman, just curious, are you from a lisp background or java background or neither
14:03hiredmanneither, I guess
14:03blbrown_ltdreish, in terms of self documenting code, hiredman's seems a little better
14:03hiredmanclojure is my first lisp (besides trying to write one in ruby with cons cells based on lambdas after watching sicp)
14:03dreishblbrown_lt: Way to twist the knife, guy.
14:04blbrown_ltshrug, no feelings hurt
14:04dreishI kid, of course.
14:04blbrown_ltI was the one that through zip in there
14:04hiredmanthe java I have written was just enough to pass CS142 and 143 (intro to Programming^W Java)
14:05st3fani would like to use clojure to write some web services that i would normally do in java
14:05hiredmanall though I do think my java had a certain flare
14:05st3fanjust haven't found the time to make a good start with that
14:06blbrown_ltst3fan, I plan on using json-lib with google appengine and clojure pretty soon
14:06blbrown_ltst3fan, use json-lib and axis2 if you want web services and a json library
14:06hiredmanblbrown_lt: are you using json-lib just cause it's in contrib?
14:07st3fanblbrown_lt: i wrote a framework to do rest style + json result kind of web services
14:08blbrown_ltcontrib has a json library or is contrib using json-lib? and how complete is it
14:08st3fanblbrown_lt: just add some annotations to a pojo and you expose a bean as a service action .. want to do something similar in clojure
14:08st3fanhttp://code.google.com/p/polarrose-wsf-examples/w/list
14:09danlarkinall hail clojure-json!
14:09st3fanyeah i will look into it soon
14:09st3fani think it will be a good project for me to get into clojure
14:11hiredmanblbrown_lt: maybe I am confusing contrib's json with json-lib
14:12hiredmanthe only json lib I've used is danlarkin's
14:13cadsI'd like to create a browser based repl tutorial similar in spirit to Why's interactive ruby tutorial at http://tryruby.hobix.com
14:13cadsand I was wondering first if you guys have already run across something like that
14:14gnuvinceIt's funny that #clojure has more users than #scala ;)
14:14hiredmanit has come up, I think Chouser was working on an applet based repl?
14:15Chouserhaven't touched it in a while: http://clojurescript.n01se.net/
14:15hiredmandepending on how involved a tutorial you might get away with just clojurescript :P
14:15Chouserbut it's the javascript runtime, so no agents, no real stm, etc...
14:16hiredmanthe other option I guess would be something like clojurebot
14:17hiredman(running code in a sandbox)
14:17gnuvinceThat would probably be the best choice
14:17cadsyeah, a friend already told me about the limitations of of java in browsers, how many are coming with it disabled these days
14:18cadsI thought to have the complete repl running in an applet, but feel like having it serverside in a sandboxed VM would be better
14:18hiredmanI wonder if appengine's jvm has the security manager enabled
14:18cadswell there's another thing, there are all the different implementations, could be hard to get working right
14:19cadson the other hand I feel like it would be easier for me to create an interface in an applet
14:21Chouserwell, that would be another option -- pure java applet (or web start)
14:21hiredmanthere was some javascript terminal widget thing
14:21drewolsoncan anyone help me out with some vim clojure questions?
14:22Chouserthat gets you argents, stm, etc.
14:22Chouserappengine for java doesn't currently allow spawning threads
14:23cadsChouser, your repl would be a good starting point
14:24cadscan you describe its implementation a bit?
14:25Chouserdom+javascript to collect the repl input, which is sent as a string (via liveconnect) to the applet.
14:25ChouserThe applet includes all of clojure plus the clojurescript compiler -- it translates the given repl string to javascript and returns that.
14:26Chouserthe javascript in the page then evals the returned javascript and displays the output via the dom
14:27Chouserall the javascript I just mentioned is actually also compiled from clojure sources
14:27Chouserall the code for this is in contrib
14:28cadsvery nice
14:29dakrone_hbdrewolson, probably best just to ask and see if anyone can help
14:29Chouserso you could just cut out the clojurescript stuff and get more features, better performance, and a smaller applet
14:30cadsI think so too
14:31cadsthat's pretty fantastic, kudos
14:43blbrown_ltonly bad thing about the new lazy sequences is that it can hard to detect errors. E.g. before it seem like you could navigate to line 123 and that is where the error is. Now we have to remember a seq is lazy
14:44marklarIs there a way to control the output of find-doc? i.e. How many items are returned?
14:55eyerisCould someone interpret this compile exception for me? http://pastebin.ca/1388243
14:56hiredmanclojurebot: compile
14:56clojurebotthe unit of compilation in clojure is the namespace. namespaces are compiled (not files). to compile a namspace the namespace needs to be on the classpath and so does ./classes/ (and the directory needs to exist) because clojure writes the class files to that directory. http://clojure.org/compilation
14:57hiredmanI know this is the second time I have referenced that
14:57hiredmanbut I need you to read it
14:58eyerisI know. I did read it. I just can't find the answer.
14:58dakrone_hbit doesn't look like you have ./classes in your classpath
14:58eyerisI'm pretty jvm-ignorant, so most of the gen-class stuff is over my head.
14:59dakrone_hbdoes ./classes/ exist and is it in your classpath?
14:59clojurebotclasspath is (System/getProperty "java.class.path")
14:59hiredman~botsnack
14:59clojurebotthanks; that was delicious. (nom nom nom)
14:59eyerisI see. It needs ./classes for the intermediate steps.
14:59eyerisI thought that was in the example cmd line simply for other .class files
15:00hiredmannot intermediate steps
15:00radarsat1hi, is there an easy way to do a lazy reduce in clojure?
15:00hiredmanthe compiled classes are written to ./classes/
15:01hiredmanradarsat1: reduce as a lazy operation is, like unpossible
15:01radarsat1okay
15:01hiredmanreduce by it's nature consumes a whole sequence and outputs one value
15:01hiredmanyou could wrap it in a (delay ...)
15:02radarsat1i want to translate '((0 1 2) (3 4 5)) into '(0 1 2 3 4 5) lazily
15:02hiredmanreplaca: that is not reduce
15:02radarsat1it works with (reduce concat...) but that's not lazy
15:02hiredman,(apply concat '((0 1 2) (3 4 5)))
15:02clojurebot(0 1 2 3 4 5)
15:03dreish,(flatten '((0 1 2) (3 4 5)))
15:03clojurebotjava.lang.Exception: Unable to resolve symbol: flatten in this context
15:03dreishI guess that's in seq-utils.
15:03dreishIt's lazy, anyway.
15:03radarsat1apply is lazy?
15:03clojurebotlazy is hard
15:04dreish(apply concat '((0 1 2) (3 4 5))) is equivalent to (concat '(0 1 2) '(3 4 5)), and concat is lazy.
15:05radarsat1okay thanks
15:05radarsat1ah i see my problem here
15:05radarsat1i was using '(0 1 2) as examples but they are also calculated lazily
15:06radarsat1anyways i'll think about it thanks
15:06dreishYou probably want seq-utils/flatten
15:06radarsat1i'll try that
15:13radarsat1i just tried with a few more list items and found that applying concat is lazy, its just that it starts by calculating the first 3 or 4 in advance, that's why i was confused. thanks.
15:14radarsat1the 5th and 6th entries are being evaluated as needed.
15:44__mj__Has the route function been removed in clojure?
15:44__mj__I mean compojure?
15:58lisppaste8thickey pasted "show-doc" at http://paste.lisp.org/display/78375
15:58marklarThat is great
15:59thickeymarklar: it was based on your comment earlier, i've been wanting the same
15:59marklarthickey: Thank you! It will be incredibly helpful learning
16:00thickeynp
16:04duncanmis there a way to access the binding vector inside a LET?
16:04hiredmaninteresting
16:04hiredmanuh
16:04hiredmanfor why?
16:05duncanmi want to check that they're not zero
16:05rsynnottsounds like the sort of thing you don't really WANT to do
16:05hiredman,(show-doc "vec")
16:05duncanmi have something like this
16:05clojurebot[ 0] org.danlarkin.json.decoder/decode-array [ 1] clojure.contrib.seq-utils/flatten [ 2] clojure.contrib.seq-utils/group-by [ 3] clojure.contrib.seq-utils/separate [ 4] clojure.core/assoc [ 5] clojure.core/contains? [ 6] clojure.core/for [ 7] clojure.core/letfn [ 8] clojure.core/peek [ 9] clojure.core/pop [10] clojure.core/proxy [11] clojure.core/re-groups [12] clojure.core/replace [13] clojure.core/require [14] clojure.core/rseq [15] clojure.core/spli
16:06hiredman,(show-doc "vec" 0)
16:06clojurebot------------------------- org.danlarkin.json.decoder/decode-array ([b-reader]) Decodes a JSON array and returns a vector.
16:06duncanm(let [x (f) y (g)] (if (some zero? (list x y)) 'boo 'woohoo))
16:06duncanmi was just thinking of a way to not have to write (list x y)
16:06hiredmanah, uses print-doc
16:07hiredmanif you want a list, make a list
16:07hiredman(let [x (list (f) (g))] ...
16:07hiredmanactually
16:07hiredman(let [l (list (f) (g)) [x y] l] ...
16:10Chouserduncanm: would the 'if' always be the first thing inside the 'let'?
16:10Chouserif so, a macro do to that would be pretty reasonable.
16:13twansitquick question... how do you remove a symbol from a namspace?
16:13twansitremove/unload
16:13hiredmanclojurebot: namespaces
16:13clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
16:14hiredmaner
16:14hiredmanwait
16:14hiredmannot what I was looking for
16:14hiredmanclojure.org/namespaces
16:14hiredmanfunctions for doing stuff with namespaces
16:15twansitcool thanks
16:15twansiti know the function that does this exists but its not on that page
16:16twansitcause the issue is im trying require a clj library using an alias
16:16hiredman...
16:17twansiti would like to switch to another library but still using the same alias
16:17twansitdo i have to remove-ns
16:17twansitor is there a fuction that just removes the alias
16:17pjstadiglook under 'n' at http://clojure.org/api
16:17pjstadigns-unalias
16:17pjstadigns-unmap
16:18hiredmanor look under "Remove" on clojure.org/namespaces
16:18hiredmanwell
16:18hiredman"Removing things"
16:19twansitah
16:19twansitdidnt see that for some reason
16:19twansitthanks guys
16:21twansitdanlarkin: you here?
16:22danlarkintwansit: yessir
16:22twansitI'm using your json library
16:22twansitactually the decode-from-reader fn
16:23danlarkincool
16:23twansitwhats the difference if i pass a BufferedReader or InputStreamReader, is there a preference?
16:24twansitdanlarkin: ?
16:25twansitdanlarkin: right now i pass (BufferedReader. (InputStreamReader. stream *default-encoding*))
16:26danlarkinyou don't necessarily need to wrap it in a BufferedReader yourself
16:27hiredmanthere is a seperate decode-from-buffered-reader
16:27danlarkindecode-from-reader checks if the reader you pass is a BufferedReader, and if it's not it wraps it itself
16:27twansitcool thanks
16:27twansiti should have just looked at the src... but im lazy :)
16:31hiredman,(show-doc "decode-from-reader")
16:31clojurebot[ 0] org.danlarkin.json/decode-from-reader
16:31hiredman,(show-doc "decode-from-reader" 0)
16:31clojurebot------------------------- org.danlarkin.json/decode-from-reader ([reader]) Takes a java.io.Reader pointing to JSON-encoded data and returns a clojure datastructure.
16:31hiredmanhmmm
16:31hiredmanif I am going to use that, print-doc needs a rebinding
16:32dakrone_hbwhy does it print all the '-'s?
16:32hiredman,(doc print-doc)
16:32clojurebot"([v]); "
16:32hiredmannice
16:32hiredmanprint-doc is used and print-doc prints all the dashes and the heading
16:33drewolsonhey all, i'm having an issue with vimclojure. syntax highlighting seems fine, ngserver runs cleanly and ng runs fine, however none of the key mappings seem to have any effect.
16:35hiredmanis clj_want_gorilla set?
16:35drewolsonyep, it is
16:35drewolsonit's almost as if nothing is mapped
16:35drewolsoni try \sr, and it simply does a replacement of the current character with r
16:35hiredmanactaully
16:35hiredmanI had that too
16:36drewolsonreally?
16:36drewolsonand how did you solve it
16:36drewolsonthanks :)
16:36drewolsonwait, is it clj_want_gorilla or clj_wants_gorilla?
16:37hiredmanwant, I think
16:37drewolsonwow, that was it :)
16:38drewolsonugh, now back to the issue i was seeing earlier
16:38drewolsonError detected while processing function vimclojure#ExecuteNailWithInput:
16:38drewolsonline 23:
16:38drewolsonE605: Exception not caught: Couldn't execute Nail! ng de.kotka.vimclojure.nails.NamespaceOfFile </var/folders/+e/+eeVZjm3E+y-FujQq60a8U+++TM/-Tmp-/v396957/0
16:38drewolsonError detected while processing function <SNR>12_activateNode:
16:38drewolsonline 12:
16:38drewolsonE171: Missing :endif
16:38hiredmanuh
16:38hiredmanpastbin
16:38hiredmanthe ng binary needs to be in your path
16:38drewolsonit is
16:38hiredmanis it in the path of vim?
16:39hiredman:!ng
16:39drewolson$ which ng
16:39drewolsonlet me check
16:39drewolsonyep, sure is
16:39hiredmanis the fail you are editing all namespaced up?
16:40hiredmanfile
16:40hiredman:P
16:40drewolsonlet me try with a simple empty file
16:40drewolsonbreaks on an empty file as well
16:41hiredmanwhat kind of classpath are you starting the ngserver with?
16:41drewolsonlet me find the command
16:41drewolsonhttp://pastie.org/443200
16:41drewolsonthat's the ngserver command
16:42hiredman*shrug*
16:42hiredmanI have found vimclojure to be very finicky about classpaths
16:43drewolsonyeah, apparently...i had the old version working with gorilla, would love to get this back up and running
16:44hiredmanI would make sure the file you are editing is in the classpath
16:45drewolsonhrm, really? i suppose then i would need to create a separate launcher for every project i was working on
16:45pjstadigor just have a huge classpath that includes everything you'd need
16:46drewolsonlet me give that a quick shot
16:47drewolsonstill fails if the file i'm editing is in the classpath
16:47drewolsonof the server
16:51dakrone_hb,(show-doc "xml")
16:51clojurebot[ 0] clojure.core/xml-seq [ 1] clojure.zip/xml-zip [ 2] clojure.xml/parse [ 3] hiredman.clojurebot.svn/summary
16:52dakrone_hb,(show-doc "xml" 2)
16:52clojurebot------------------------- clojure.xml/parse ([s] [s startparse]) Parses and loads the source s, which can be a File, InputStream or String naming a URI. Returns a tree of the xml/element struct-map, which has the keys :tag, :attrs, and :content. and accessor fns tag, attrs, and content. Other parsers can be supplied by passing startparse, a fn taking a source and a ContentHandler and returning a parser
17:01dakrone_hb,(show-doc "json")
17:01clojurebot[ 0] org.danlarkin.json.decoder/json-ws?
17:03twansiti need a clojure sticker for my notebook
17:03twansitwhere can I cop one?
17:07twansitor a large clojure icon will do?
17:09pjstadigthere are some files at the google group
17:09pjstadighttp://clojure.googlegroups.com/web/Clojure-glyph.svg?gda=4BZz8kMAAAC2LrkjeC7f10uHiY7GOiyxp_O1uqTqpaVnLTdRwwRk4Xcahxnv5uvgTxaQgfZeUAYytiJ-HdGYYcPi_09pl8N7FWLveOaWjzbYnpnkpmxcWg
17:09stuhoodhttp://clojure.org/file/detail/clojure_cake.png
17:11stuhoodoh... svg
17:11stuhoodthat works
17:11twansitthanks!
17:11pjstadignp
17:12stuhoodheh, that svg is on wikipedia too
17:12stuhoodbut it has some copyright restrictions http://en.wikipedia.org/wiki/File:Clojure-glyph.svg
17:14pjstadigyeah i'm not sure what the restrictions are
17:14pjstadigis there something published somewhere that would say
17:14pjstadigi mean i wouldn't go selling stickers or anything else
17:15pjstadigi think thickey made the logo, maybe he could shed some light?
17:18twansitnah i wouldnt sell them anyways
17:22pjstadighttp://groups.google.com/group/clojure/browse_thread/thread/7f179c79f0d0bb3e/e065944bbbcb84e9
17:22pjstadigsome discussion, but the status of the logo was never specified
17:25twansit,(java.net.URLEncoder/encode. "string" "UTF-8")
17:25clojurebotjava.lang.IllegalArgumentException: No matching method: encode.
17:26twansit,(.java.net.URLEncoder/encode "string" "UTF-8")
17:26clojurebotjava.lang.Exception: No such namespace: .java.net.URLEncoder
17:26hiredmanerm
17:27hiredman,(java.net.URLEncoder/encode. "string")
17:27clojurebotjava.lang.IllegalArgumentException: No matching method: encode.
17:27hiredmanbah
17:27twansit,(java.net.URLEncoder/encode "string" "UTF-8")
17:27clojurebot"string"
17:27hiredman,(java.net.URLEncoder/encode "string")
17:27clojurebot"string"
17:27hiredmanI live in the future
17:27hiredmaneverything is UTF-8
17:27twansitoh ok
17:27twansitthanks man
18:29lisppaste8Neronus pasted "compiling clauses" at http://paste.lisp.org/display/78380
18:31NeronusHow efficient is function compilation in clojure? Say, I want to write a function which compiles a clause, e.g. what I just pasted. How often do I have to evaluate that function to make compiling this thing worthwile in comparison to just "interpreting" such a clause
18:31Neronusfor example via every?
18:31hiredmanclojure does interpret anything
18:31hiredmaner
18:31hiredmandoesn't
18:31hiredmaneverytyhing is compiled
18:32hiredmanand using eval is horrible
18:32hiredmanso don't, ever
18:32Neronusright, I know that. What I mean by interpretation: (fn check [clause assignment] (every? #(assignment %1) clause))
18:33hiredmanI am not going to bother and figure what you are doing
18:33hiredmanhave fun
18:33NeronusI'll do my best
18:35zakwilsonUsing eval is likely the right thing if you're doing genetic programming or writing a REPL.
18:37Neronuswhy for genetic programming?
18:39lisppaste8Neronus annotated #78380 "macro instead of evil eval" at http://paste.lisp.org/display/78380#1
18:40Neronusclojurebot: eval?
18:40clojureboteval is evil
18:40Neronusthought as much
18:42durka42clojurebot: macros?
18:42clojurebotHoly Crap.
18:42dakrone_hbVn1m4ith
18:42dakrone_hbbleh
18:42durka42whoops
18:42durka42change that password
18:42dakrone_hbheh
18:43dakrone_hbonly my screen password, so no worries
18:43durka42don't worry, all i saw was ********
18:44dakrone_hbheh
18:44Neronusyou mean, if I enter my password, everybody sees just stars? OK, I'll try it
18:44Neronusoldbutbeautifuljoke
18:44Neronusthere, all stars
18:54mek`Hi all, I'm just switching to clojure from common lisp and I'd really like to start by writing code correctly (conventionally). Does anyone know of an authoritative resource on clojure commenting and programming conventions? And links to resources would be greatly appreciated.
18:55mek`Any* links, rather.
18:56hiredmancore.clj :P
18:56hiredman~def quote
18:56hiredmanah
18:56mek`Thank you kindly. :o)
18:56hiredman~def unquote
18:57hiredmanactually
18:57hiredmancore.clj is kind of dated
18:58hiredman(. clojure.lang.RT (toArray coll)) would be (clojure.lang.RT/toArray coll) these days
18:58hiredmanexample of calling a static java method
18:59hiredman,(macroexpand '(clojure.lang.RT/toArray coll))
18:59clojurebot(. clojure.lang.RT toArray coll)
18:59hiredmanhmm
18:59hiredman,(macroexpand '(. clojure.lang.RT (toArray coll)))
18:59clojurebot(. clojure.lang.RT (toArray coll))
18:59hiredman,(. clojure.lang.RT (toArray []))
18:59clojurebot#<Object[] [Ljava.lang.Object;@11c0dc6>
19:00hiredman,(. clojure.lang.RT toArray [])
19:00clojurebot#<Object[] [Ljava.lang.Object;@1f96306>
19:01hiredmantowards the end you get some more modern style
19:08mek`This is just what I was looking for. Thank you kindly, hiredman.
19:16elgwhat would be the idiomatic way to do the equivalent to this ruby code? ARGF.each_line{|l| foo, bar, baz = l.split}
19:16elg(and obviously do something with them, stuff them into an array or something - but that's irrelevant)
19:16hiredmanmap
19:17hiredmanuh
19:17hiredmanwell you would not stuff into an array
19:17elgnaturally
19:17hiredmanor do assignment
19:17elgi was speaking about the ruby side - that code by itself is pointless
19:18elgI assume there's something more elegant than java.util.Scanner
19:18hiredmanruby .each* is somekind of map
19:18elgyes. ARGF is stdin/files on ARGV
19:19hiredmanI've never used Scanner
19:19elgit's not pretty
19:19gnuvince_Those who know something about compilers: my Clojure code is spend a large majority of its time in clojure.lang.Var.deref and get; do you think it would be possible to "change" those to let-vars if the compiler could determine that they're used not for their threading semantics, but just for naming things?
19:20hiredmanwell, I guess .each* could be doseq as well
19:20hiredmanelg: what do you want to do? loop over lines in something?
19:21elgi want to create a data structure from the lines in a file
19:21hiredmanso if you have a bufferedreader you can use line-seq
19:21hiredmanand doseq or map
19:21hiredman,(doc line-seq)
19:21clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
19:22slashus2gnuvince_: Maybe you should write the part that is slow in java, and the rest in clojure.
19:23gnuvince_slashus2: the part that is slow (or at least, I think is slow if I'm reading those profiling figures right) is the one I *really* want to write in Clojure :)
19:23slashus2:-(
19:24eevar__gnuvince: considered using let?
19:24gnuvince_eevar__: I'm trying now, but it does not seem to have a lot of effect
19:24eevar__assuming you don't _have_ to dereference, that is
19:24gnuvince_Went down from 113 seconds to 111
19:24gnuvince_Which is probably just a question of margin of error
19:26gnuvince_Not to mention that it makes some code really ugly; (def my-func (let [; 20 lines of local function definitions ] (fn [...] ...)))
19:27Neronusgnuvince_: You could pack it all into a map, if you always use it together; only one deref that way
19:27gnuvince_If anyone's interested in doing some tests of their own, the code is here: http://github.com/gnuvince/clj-starcraft/tree/master
19:27NeronusDoesn't seem you real performance bottleneck, though. What do you use for profiling?
19:27gnuvince_I could provide you with the data I'm testing against.
19:28gnuvince_Neronus: -Xrunhprof:cpu=times
19:29NeronusThanks. I'm still looking for a nice profiling solution
19:30gnuvince_Neronus: there's also -Xprof
19:30gnuvince_Faster, but less precise
19:32eevar__yea, i'd go with cpu=samples
19:32NeronusBut the benchmarks I did also indicated that dynamic variable lookup is slow. Which is sad, as defn'd functions are variables
19:33NeronusWell, got to go
19:33Neronusbye
19:34Neronusor maybe profiling influences the outcome a lot, because the overhead induced by profiling is bigger than the time needed for the lookup of variables
19:35elghiredman: essentially what I'm trying to do is http://pastie.org/443376
19:35gnuvince_eevar__: what's samples?
19:35elgi'm still very new at clojure, and trying to feel out the standard idioms
19:35elgi can see how to do it by naively porting equivalent java code, but i doubt that's idiomatic
19:36hiredmanelg: do you have contrib?
19:38hiredmanit contrib's duckstreams there is a reader function that will turn just about anthing into some kind of BufferedReader
19:38hiredmanthen you call lazy-seq on it, then you just call map
19:38hiredmanand you can use String's split method
19:39hiredman"structs" and hashs are the samething in clojure
19:39eevar__gnuvince_: periodic sampling of the stack frame, rather than trying to time every method call or whatever 'times' does. way way faster
19:39eevar__and still reasonably accurate
19:39hiredmanstructs are just hashes optimized for a smaller number of keys
19:40gnuvince_eevar__: very nice, I'll try it in a few minutes
19:40elghiredman: thanks, I'll look at duckstreams
19:40hiredman,(doc defstruct)
19:40clojurebot"([name & keys]); Same as (def name (create-struct keys...))"
19:48lisppaste8gnuvince pasted "For elg" at http://paste.lisp.org/display/78384
19:48hiredmanoh jesus
19:49hiredmannext thing he'll be in here asking why elg won't compile
19:49hiredman:(
19:49gnuvince_hmmm?
19:49hiredmangnuvince_: foo.elg
19:50hiredmanor something, not a single segment namespace
19:51gnuvince_Why would he name the file foo.elg?
19:51hiredmanI have no idea
19:51gnuvince_It runs fine here
19:51gnuvince_Dunno about AOT compilation
19:51gnuvince_but that's for another time.
19:51hiredmansure it'll run, but after he has been using it for a few days, and tries to compile, he'll be back in here
19:52hiredmanand I'll have to do this
19:52hiredman~namespaces
19:52clojurebotnamespaces are (more or less, Chouser) java packages. they look like foo.bar; and corresponde to a directory foo/ containg a file bar.clj in your classpath. the namespace declaration in bar.clj would like like (ns foo.bar). Do not try to use single segment namespaces. a single segment namespace is a namespace without a period in it
19:52hiredmanor even breakout ~compile
20:04mattreplsingle segment namespace not allowed because compiled classes would be in default package?
20:58dysingerStrange I am getting 502 on several google code svn repos @app_engine outage related I wonder.
20:59dysingerclojure & clojure-contrib = 502
21:08hiredmanclojurebot's svn watcher is throw exceptions
21:14dysingerclojure should be on git not svn /ducks
21:15dysingerpoorman's alternative would be hg /ducks again
21:16dysinger:P
21:17cmvkkyou can get clojure off of github if you want
21:17cmvkkit's just a clone of the svn version
21:18gnuvince_I prefer Mercurial myself, but I don't have a problem with Clojure being managed with Subversion if that's what Rich likes/knows.
21:20gnuvince_eevar__: cpu=samples is pretty nice.
21:21gnuvince_It's giving me very different results.
21:21gnuvince_WHich make more sense I think and are more consistent with results from -Xprof
21:23rlbIs is very easy to create new container types?
21:23rlbs/Is is/Is it/
21:24rlbi.e. something that can be used as a container but with a custom implementation?
21:25hiredmanYes
21:25hiredmanwhat do you mean by "container"
21:26Carki would say no =P
21:26hiredmanI would say Yes
21:26Carkfor what value of yes ?
21:26hiredmanthey are just java classes
21:27Carkright, you have to go to genclass or java
21:27hiredmanyou can gen-class, write java, or use proxy
21:27hiredmanit depends
21:27Carkah proxy might be cool indeed
21:27clojurebotproxy is <Chouser> proxy teases with its ease of use, then suddenly betrays.
21:27hiredmanclojurebot: shove off
21:27clojurebotNo entiendo
21:27hiredman~you heard me
21:27clojurebothiredman: I'm just giving you a second chance
21:29hiredmanlike I said, it depends
21:29hiredmanrlb: what do you mean by "container"
21:29hiredmana Collection type?
21:29hiredmanI don't see why you would
21:30Carkhum making a trie for instance ?
21:30Carki'm working with telephone number and prefixes a lot
21:31hiredmanit's possible to do that using vectors
21:31Carki think i read somewhere that rich was thinking about mmoving more of the implementation to clojure code
21:31Carkhiredman : what do you mean ?
21:32hiredmanyou can make tree structures using vectors like cons cells
21:33Carki have my implementation of a trie in clojure ....but it's neither a map nor a seq
21:33Carktrie /= tree
21:33hiredmanit is a tree
21:34hiredmanare you kidding?
21:34Carkright it's a tree ...just not your vanilla binary tree
21:35Carkanyways i didn't think about using proxy
21:35hiredmanwhy would you?
21:35Carkso that i can use my trie as a seq and as a map
21:35rlbI was thinking about something like a very large disk-backed container.
21:35rlbbbiab.
21:35Carki wonder what's the performance penalty
21:35hiredmanI guess he must mean Collection
21:36hiredmanthey have those, called "files"
21:37Carkfile based persitent data structures .... pray that the gc never collects
21:37hiredmanit's an idea that keeps coming up
21:38Carkthat's i beleive how some db engine are doing transactions
21:38hiredmanbecause people never get tired of fighting with virtual memory systems?
21:39hiredmanmost operating systems implement a type of "disk-backed container" called a file
21:41Carki'm not sur how good is java when running on the virtual memory
21:41Cark*not sure
22:14slashus2Is there a Java framework like the python framework twisted?
22:15hiredmanthere are many
22:16hiredman#java recomends xnio or netty
22:16slashus2Thank you. I will check them out.
22:16hiredman(netty seems to be higher level built ontop of xnio)
22:16hiredmanthe apache foundation has there own, mina
22:16hiredmantheir
22:17hiredmanwhich is what twitter used with scala for thei message queue thing
22:17hiredmanbut #java seems to look down on it
22:17hiredman(the primary author of xnio hangs out in #java)
22:18slashus2I think I will take a close look at Netty
22:19slashus2I was going to play around and try to write an IRC server or something.
22:21rlbhiredman: I'll have to go investigate this "File" thing you speak of. Thanks.
22:25hiredmannetty seems to use annotations, which could be a problem
22:26slashus2hiredman: Looks like Netty uses annotations a lot, how do you deal with that in clojure? They are just properties, right?
22:26hiredmanI don't know
22:30rlbFor anyone who actually cares, what I was thinking of was something that would allow you to use something like filter on very large homogeneous vectors -- say a 3GB file of 64-bit integers.
22:31rlbPerhaps something like line-seq, but customizable.
22:41mattreplslashus2: the java compiler emits bytecode for class and runtime annotations, so gen-class would need to mimic that
22:41rlbAhh, OK, after looking at the source, it looks like it might be pretty easy to just create something that does at least part of what I wanted.
23:02nzkozHey guys, do you have any pointers to a good example application using clojure's concurrency support? I'm looking to build something really simple where a few UI threads feed a few more worker threads. But I want to make sure I approach it 'right' rather than just 'java with parens) ;)
23:03Carkhave a look to the ants simulation
23:04Cark~ants?
23:04clojurebotExcuse me?
23:04Carki think the code is on the google group
23:04mattrepl~ants
23:04clojurebotExcuse me?
23:05Carkmight be based on an old version of clojure though
23:05mattrepl(thought it was question mark)
23:05hiredmanit gets updated
23:05nzkoz?ants
23:05nzkozirc bots never liked me anyway :)
23:05Carkclojurebot does not like anybody
23:05nzkozfrom the google group homepage?
23:06Carkin the file section
23:06Carklet me check
23:07Carkclojurebot : ants is http://clojure.googlegroups.com/web/ants.clj
23:07Carkclojurebot: ants is http://clojure.googlegroups.com/web/ants.clj
23:07clojurebotRoger.
23:07Cark~ants?
23:07clojurebotants is http://clojure.googlegroups.com/web/ants.clj
23:08nzkozthanks
23:09Carkmzkoz : you should watch the videos too
23:09nzkozyeah, saw the boston lisp ones, really good. if somewhat long :)
23:16gnuvince_nzkoz: as I understand it, it was supposed to be 90 minutes, but went over 3 hours :)
23:16gnuvince_And people didn't seem to mind
23:17hiredmanwhich vidoes are those?
23:17gnuvince_Boston Lisp User Group
23:17hiredman~google boston lisp user group videos
23:17clojurebotFirst, out of 13800 results is:
23:17clojurebotFind a Meetup Group Near You! - Ruby Meetups - Boston
23:17clojurebothttp://ruby.meetup.com/cities/us/ma/boston/
23:18hiredman*blink*
23:18cmvkkgoogle: it's not perfect.
23:19hiredmanthis is the clojure for lisp programmers stuff?
23:20slashus2mattrepl: I see an example in the group of how to annotations for methods inside of a class, but how do you do it for a class itself.
23:20gnuvince_hiredman: yes.
23:21mattreplslashus2: if you're talking about the thread I started, that hasn't been implemented. there so far hasn't been much interest in it. for classes, we'd just need to add another option to gen-class to define all the class annotations
23:24replacaBoston Lisp Group videos are at http://clojure.blip.tv
23:25replacalook at "Clojure for Lisp Programmers" part 1 & 2
23:25replacawatching that video was, for me, like a junkie's first taste of heroin
23:30hiredmanI can't wait for the qcon videos
23:39RaynesIt's 10:36pm. I've had 4 hours of sleep in the last 36. I've been monitoring a severe weather event all day. I have a fried porkchop in my mouth, a cold Coca-Cola in my hand I'm trying to concentrate on learning Scala with little object oriented background. This must be what the life of a programmer is really like.
23:41Carkthat's the life of a bug writer
23:43RaynesCark: That was offensive :(
23:43Carkah sorry ...
23:43Carkbut you know
23:43Carkyou have to be carefull with your body if you want to write great software using your mind
23:44Carki don't quite know how to formulate this in english
23:44clojurebotthis is not a bug
23:44Carkin a non offensive way =P
23:45RaynesCark: I'm competent. I'm just sleepy. I'm in one of those states where I can read an entire chapter before realizing I haven't been paying attention to what I was reading. Then have to re-read the whole thing.
23:45RaynesAnd I was just joking about it being offensive.
23:45Raynes\o/
23:45Carkhehe ok
23:45Carkanyways that's bad habits i had too back then
23:46Carkthen i became older, and i have to sleep now =P
23:47gnuvince_Raynes: any thoughts on Scala? I was considering translating my Starcraft program to it to compare its speed and ease of use with Clojure.
23:47RaynesI normally /do/ sleep. I intended on going to sleep last night then the first complex of storms that came through caught me off guard and I monitored that severe weather until 5AM and slept for 4 hours before the next wave of storms. Those lasted all day so here I am.
23:47Raynesgnuvince_: I'm only on the first actually-learning-something chapter.
23:48gnuvince_ok
23:48cmvkkif sleeplessness and junk food were good enough for john carmack, then they're good enough for me :)
23:48RaynesWhen they say Programming in Scala is a slow-paced book they mean it. They spend 2 chapters just running random crap by you.
23:48gnuvince_heh
23:48RaynesI'm on the second introduction chapter :|
23:49gnuvince_From what I've seen, I most likely know that I prefer Clojure (more liberal, less concepts), but I don't dislike static typing and really like to try new languages
23:49Carkcmvkk : looks like i'm not the next john carmack =(
23:49gnuvince_So.. :)
23:49RaynesI'm learning it because I need Object Orientation, but I don't want to learn Java.
23:49RaynesNot now anyway.
23:49Cark~OOP?
23:49clojurebotGabh mo leithsc�al?
23:49Cark~oop
23:49clojurebotHuh?
23:49Cark~oop?
23:49clojurebotGabh mo leithsc�al?
23:50Carkbah
23:50gnuvince_object oriented programming
23:50Raynes~OOP
23:50clojurebotHuh?
23:50hiredman~mock objects
23:50clojurebotYour mock object is a joke; that object is mocking you. For needing it. -- rhickey
23:51Carkthere need to be some sarcastic oop definition in clojurebot
23:51danlarkinRaynes: you don't need OO
23:51RaynesI really want to learn Factor. But I can't bring myself to do it with absolutely /no/ beginner material.
23:51Raynesdanlarkin: I need better knowledge of OO.
23:51Carkfactor looks nice
23:52Carkbut i don't like to have these stack manipulation words in the code
23:53gnuvince_Factor *is* nice, but I guess my brain's just not made for concatenative code
23:53gnuvince_I guess I'll just you Haskell and (.) if I want point-free programming :)
23:53gnuvince_s/you/Use/
23:54Carkthere definetly is some commonality between these 2
23:55Cark(-> data action1 action2 action3)
23:55Carkthere's a stack in there too
23:56Cark(-> data action1 (action2 avalue) action3)
23:56Carkwhat if the parameter that should be passed to avalue was in second position ?
23:56RaynesI love everything about Factor, besides the fact that the creator makes this wonderful language and can't even write something of a comprehensive introduction to the language to help people learn it. :\
23:57Cark(-> data action1 (switch action2 avalue) action3)
23:57hiredmandoesn't work
23:57Cark(-> data action1 ((switch action2 avalue)) action3)
23:57Cark!
23:57hiredman-> is a macro so it happens before the function switch
23:57Carkhow about that last form ?
23:58hiredmanit might
23:58hiredmanclojurebot: pl?
23:58clojurebothave you heard about the bird? is<reply>The bird, bird, bird, the bird is the word.
23:58hiredmanclojurebot: transform
23:58clojurebottransform is http://github.com/hiredman/odds-and-ends/blob/8a84e6ddbad9d71f714ba16c3e1239633228a7eb/functional.clj
23:58hiredmanI have a few odds and ends there
23:58hiredmanuncurry and flip
23:59Carkah flip that's the correct name !
23:59Carkuncurry ....i don't understand that one
23:59hiredman,(doc pl)
23:59clojurebot"([& forms]); replaces a $ b with (a b) walking right to left replaces a � b with (comp a b) left to right ?a with (uncurry a) left to right ?a with (flip a) left to right"