#clojure logs

2010-05-21

00:01Licensernice :) now the ident token is faster then the space token
00:05Licenserwell thank you all for the help so now I got to go to bed
00:15mmarczykLicenser: see you next time :-)
00:15mmarczyk(even though it's a bit of a pleonasm ;-))
00:33mmarczykLicenser: got a non-regex solution for (re-find basic-identifier-re some-string) which appears to be twice as fast in some cases, need to squeeze it a bit more :-)
00:34mmarczyk(well actually it is partly regex based at this proof-of-concept stage, but it won't stay this way long)
00:47tomojb
00:47tomojoops
01:21mmarczykgot it down to up to 16x faster, but I am in fact still using regexes... oh well.
01:22remleduffDarn ;)
01:26mmarczykactually, I found a bug
01:26mmarczykso it's not going to be quite that nice :-(
01:47Blackfootcan i use :as in (import)? I want to refer to SomeCrazy$InnerClass as just Inner
01:59mmarczykBlackfoot: nope :-(
01:59mmarczykis this for the purpose of calling static methods?
02:00mmarczykor for construction etc. too?
02:00Blackfootmostly a static method and it's enums
02:01mmarczykin this case I think I'll plug an answer I posted on SO
02:01mmarczykmaybe it'll be useful to you
02:01mmarczykand I'd love to hear some feedback ("it's insane" etc.)
02:01Blackfootha, sure
02:02mmarczykhttp://stackoverflow.com/questions/2852133/clojure-vars-and-java-static-methods
02:02sexpbot"Clojure vars and Java static methods - Stack Overflow"
02:02mmarczykit's the accepted answer
02:03mmarczykactually it has occurred to me that creating the "gensymed" ns is probably pointless as written there
02:03mmarczykI meant to use a dot in the ns name
02:04mmarczyk(should be "adapter.")
02:07Blackfootmmarczyk: i think i understand it, thought not sure how it would work with the enums. since i'm only using it in a few places, i'll probably use the whole name for now, but try it out if usage grows
02:07Blackfootthanks
02:07mmarczyksure
03:07bartjhi
03:08bartjcan anyone please tell me the difference between doseq and for in clojure?
03:09bartjer is anyone there?
03:10bartjhello?
03:10clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline bartj
03:11technomancybartj: for is lazy, doseq is used for side effects
03:17bartj(defn t[i] (for [j i] (println j) (inc i))) - how is this wrong?
03:17bartj(defn t [i] (for [j i] (println j)))
03:18technomancybartj: "i" would need to be a seq or "for" can't work on it
03:18technomancyand you can't inc a seq
03:18technomancy,((fn [i] (for [j i] (println j) (inc j))) [1 2 3])
03:18clojurebotjava.lang.RuntimeException: java.lang.IllegalArgumentException: Wrong number of args passed to: core$for
03:18technomancy,((fn [i] (for [j i] (do (println j) (inc j)))) [1 2 3])
03:18clojurebot(2 3 4)
03:19technomancy,(map inc [1 2 3]) ; <= essentially the same thing
03:19clojurebot(2 3 4)
03:22danlarkinclojurebot: donkeyballs
03:22clojurebotTitim gan éirí ort.
03:22bartjwell that actually returns: (1 \n 2 \n 2 3 \n3 4)
03:22bartj"\n" = equals
03:22bartj,((fn [i] (for [j i] (do (inc j)))) [1 2 3])
03:22clojurebot(2 3 4)
03:23technomancybartj: I think the output getting interleaved with the return value is confusing you
03:24bartjtechnomancy: yes
03:24bartjtechnomancy: which is why I removed it :)
03:24technomancyyou don't need the "do" if you're only performing one function call in the body of the "for"
03:25bartjtechnomancy: yes, thanks
03:25bartjis the usage of doseq instead of "for" purely idiomatic - to indicate that side-effects occur?
03:27technomancybartj: it's more than just a style thing--doseq returns nil, while for returns a lazy sequence
03:27technomancyso side-effects simply don't happen with "for" until the return value gets forced
03:29bartjtechnomancy: thank you so much
03:29technomancysure
03:31bartjtechnomancy: I was confused because the doc string for "for" does not mention anything about the return value. :)
03:50vegaihmm, isn't there a simple split function in core?
03:50vegai(split "a,b,c,d" ",") => [a b c d] sorta thing
03:51bartjvegai: you need to use ".split"
03:51cgrand,(vec (.split "a,b,c,d" ","))
03:51clojurebot["a" "b" "c" "d"]
03:52cgrand,(vec (.split #"," "a,b,c,d"))
03:52clojurebot["a" "b" "c" "d"]
03:52vegaiah, through Java?
03:52bartjyeah - atleast that is what I know
03:53vegaithanks
03:53vegaiI'm finally starting to regret that I ignored Java for so many years..
03:55vegaianother one: strip?
03:55vegai(strip " abc ") => "abc"
03:55Chousukevegai: you only need to learn to read javadoc :(
03:55Chousuke:) even :P
03:56vegaiyea..
03:56Chousukeanyway, there's the .trim method
03:56Chousukehttp://java.sun.com/javase/6/docs/api/java/lang/String.html
03:56sexpbot"String (Java Platform SE 6)"
03:56ChousukeThose are good to know
03:56vegaiah, great. I'll read that
03:57technomancyslime inspector will show you the methods at least: C-c S-i
03:58Chousuketechnomancy: is that a pun of CSI by accident or intentionally? :P
03:58technomancyCSI?
03:58technomancyoh, the television show?
03:58technomancyheh
03:58technomancyprobably coincidence; I think slime is pretty old
03:59eevar2i for inspect, not investigate ;)
03:59eevar2or whatever the csi folks do
04:00ChousukeSlime isn't as powerful as the CSI guys' computer systems though.
04:00ChousukeI think they zoomed in behind a corner in one episode
04:00technomancyyeah, it needs to get ported to visual basic
04:01technomancyso it can be used to create a GUI to track IP addresses
04:01eevar2lolpics.se has a few nice csi pictures
04:01eevar2among a lot of nsfw stuff ;)
04:03ravaThere's gotta be a cleaner/more idiomatic way of doing this: http://gist.github.com/408610
04:03ravaAny thoughts?
04:03eevar2http://www.m5board.com/vbulletin/off-topic-forum/151964-csi-lol-pics.html
04:03sexpbot"CSI lol pics.. - The Unofficial BMW M5 Messageboard (m5board.com)"
04:04Chousukerava: not using a struct map would be more idiomatic, unless you really need one :)
04:05Chousukerava: also, calling vec on the file list is unnecessary.
04:06Chousukerava: other than that, I think the code
04:06Chousukeis perfectly idiomatic
04:06defn^what he said.
04:06defnjust use a plain vector of maps, no need for the struct-map, unless of course there is ;)
04:06ravamore like habbit :)
04:07ravai'm used to having to declare some kind of data type
04:07Chousukeheh
04:08Chousukein Clojure, data types declare themselves ;P
04:08ravastill getting used to that :)
04:08ravahrm, what's the syntax for this: (map #{:fname (.getName %)} (.listFiles (File. *enc-files-dir*)))
04:09defnoops
04:09bartj, (doc file-map)
04:09clojurebotexcusez-moi
04:09defnyou don't want #{}
04:09defnyou want #()
04:09rdsr Also would file-seq on path would be better that (.listFiles ...) ???
04:09ravai'm all sorts of hazy on using the % for args
04:09defnrdsr: file-seq will recurse subdirectories IIRC
04:09Chousuke#{} is set syntax
04:09ravaerk
04:10Chousuke#() is for function shortcuts :)
04:10ravalol yes indeed it is../doh
04:10rdsryes
04:20mmarczykyou don't need the vec around .fileList
04:21mmarczykoh, Chousuke mentioned that already... noticed the moment I hit ret :-/
04:27ravaAnyone have trouble compiling a clj file in emacs with slime-compile-file?
04:30defnnot I
04:30defnif that's C-k
04:30defnI never use the M-x slime-compile-file
04:31mmarczykan alternate version: http://gist.github.com/408622
04:31defnrava: im still working on your code
04:32defnmmarczyk: i like the destructuring inside the fn inside the fn
04:32defn;)
04:32mmarczyk:-)
04:32defni was using a ref in my version
04:32defnnot as nice as yours :\
04:33defnmmarczyk: the file-info-extractors thing is beautiful too
04:33defnreally nice
04:33ravaindeed
04:35mmarczyk:-)
04:35defnmmarczyk: im trying to improve on that, but it's just too good
04:35defndamn you, damn you to hell!
04:35defnrava: do you see how it all works
04:36mmarczyk:-D
04:36ravadefn: file-info-extractors is fairly straight forward
04:36mmarczykI had a version based on comp, partial, zipmap & juxt, but I thought it was ridiculous
04:37mmarczykit's actually shorter, though
04:37ravadefn: i THINK i've eval'ed the map reduce call, its a bit of black magic for my newbness
04:37mmarczykupdated the gist to include it, for weirdness' sake
04:38defnrava: do you understand the destructuring
04:39vegaimm, split works weirdly
04:39mmarczykplus you could put type hints on % -- #^java.io.File % -- to avoid reflection...
04:39vegai,(vec (.split #"," "aoe, aoecrh,aho,a"))
04:39clojurebot["aoe" " aoecrh" "aho" "a"]
04:39vegaioh?
04:39ravayar the type hints are a nice touch
04:39vegai,(vec (.split #"|" "aoe| aoecrh|aho|a"))
04:39clojurebot["" "a" "o" "e" "|" " " "a" "o" "e" "c" "r" "h" "|" "a" "h" "o" "|" "a"]
04:39vegaiaha!
04:40vegai,(vec (.split #"\|" "aoe| aoecrh|aho|a"))
04:40clojurebot["aoe" " aoecrh" "aho" "a"]
04:40vegaiah, I see :)
04:40mmarczykohhh, so I have hinted % in the gist :-)
04:40mmarczykthought I haven't
04:40defnit makes it a bit less concise
04:41mmarczyktrue
04:41defnbut it's good auto-documentation :)
04:41ravalol, that last one is fairly nuts
04:43defna nice lesson though
04:43ravaindeed
04:43defnthe partial zipmap [:foo :bar] is really concise
04:43ravathe partial zipmap into the rest of the function calls is so very slick
04:44defn;)
04:46mmarczykthat's the one thing I *really* miss from Haskell
04:46mmarczykall functions taking one argument
04:46mmarczykof course as soon as I'm actually writing Haskell
04:46mmarczykI hate the fact that it's not a Lisp :-P
04:48defni cant write code in other languages anymore
04:48defni start every single bit of code with (
04:48defnespecially in ruby:
04:49mmarczykyeah :-)
04:49defn(class Foo (def initialize (puts "omg")))
04:49mmarczykI don't recall ever typing an infix expression in a Lisp
04:49mmarczykexcept maybe when mixing up repls with small prompts
04:49defnthe incanter guys made it possible to do infix
04:50mmarczykbut I actually try to write prefix in other languages occasionally
04:50defnmmarczyk: how do you do prefix in other languages
04:50defnlike ruby...how would you do that?
04:50mmarczykoh, you just do it
04:50mmarczykthen the compiler complains ;-)
04:50defnohhh, heh
04:51mmarczykHaskell is seriously cool in many ways, though
04:51mmarczykso I get over the syntax eventually, if I give it some time
04:51mmarczykthe effect seems regrettably to wear off between sittings ;-)
04:51defni use xmonad -- i will go in and tinker with my config file -- i find some of the syntax awfully ugly, and the monadic stuff is a headache
04:52mmarczykXMonad!
04:52mmarczykpart of my plan for the summer is to give that a shot
04:52ravaodd...
04:52defnoh man -- do it. you will never look back.
04:52mmarczykheh, I feel like you may be right :-)
04:52defnmmarczyk: recipe for success: urxvtd + urxvtc + xmonad
04:52mmarczykbut, um, what about a Web browser, say?
04:53mmarczykwouldn't it be impractical to have that in the left half of the screen?
04:53defnyou can resize
04:53ravaanyone around familiar with compojure?
04:53defnM-h makes the left side smaller, M-l does the opposite
04:54mmarczykrava: not really, but I might remember relevant SO questions and the like
04:54defnmmarczyk: you can also define layouts for specific windows, so when you start firfox it locks it into the position you prefer
04:54defnmmarczyk: you can't even imagine all the stuff you can do with it :)
04:54ravaxmonad is amazingly cool
04:54mmarczykdefn: ohhh, that sounds really good
04:54ravacheck out stumpwm aswell
04:55defnmmarczyk: http://devinwalters.com/?page=3
04:55sexpbot"'(Devin Walters)"
04:55ravalike xmonad but written common-lisp
04:55defnxmonad will be undoubtedly faster
04:55rava (GET "/files" []
04:55rava (str (print-json (file-list *enc-files-dir*))))
04:55mmarczykwow -- wow -- wow :-)
04:55defnive used a lot of tiled wms, and xmonad was the only one that kept up with me
04:55mmarczykthanks, for both pointers :-)
04:55ravathat should be rendered to the :body no?
04:56ravait's printing to the log for some reason
04:56defnmmarczyk: actually that's sort of useless without something else ill show you...
04:57mmarczykdefn: oh? :-)
04:57ravaactually, lemme bug #compojure on this one
04:57spariev,(doc print-json)
04:57clojurebot"clojure.contrib.json.write/print-json;[[x]]; Prints x as JSON. Nil becomes JSON null. Keywords become strings, without the leading colon. Maps become JSON objects, all other collection types become JSON arrays. Java arrays become JSON arrays. Unicode characters in strings are escaped as \\uXXXX. Numbers print as with pr."
04:57defnmmarczyk: i have a cheat sheet so you can see what does what at a glance
04:57defnjust have to find it
04:58mmarczykdefn: cool!
04:58spariev,(print-json [1 2 3])
04:58clojurebotjava.lang.Exception: Unable to resolve symbol: print-json in this context
04:58defnbrb
04:59spariev,(clojure.contrib.json.write/print-json [1 2 3])
04:59clojurebotjava.lang.ClassNotFoundException: clojure.contrib.json.write
04:59mmarczykrava: last time I tried Compojure was before 0.4, and then I believe GET expected to get the whole html
04:59mmarczyknot just the part to go in body
04:59ravai just want to return a json string
04:59mmarczykyeah
04:59mmarczykno idea why it would print to log instead :-(
05:00mmarczykand where does print-json come from?
05:00ravaclojoure.contrib.json.write
05:00sparievhm, it looks like print-json just, well, print it to strout
05:00mmarczykaha!
05:00mmarczyk:-)
05:01ravathat doesn't seem to make sense, i mean wouldn't that function make more sense to return a string?
05:01sparievrava: try something like (with-out-str (clojure.contrib.json.write/print-json [1 2 3]))
05:02mmarczykor actually
05:03mmarczykmaybe try write-json
05:03mmarczykwith a (java.io.StringWriter.) argument
05:04sparievbtw, I'm using clj-json, wrapper around jackson java lib, it kinda faster by my unscientific measurements
05:04ravawhere are you getting write-json?
05:05mmarczykhm, maybe that's a new thing from 1.2
05:05mmarczykjson-str then
05:05mmarczykmuch simpler
05:06mmarczykand it's in 1.2 also... hm
05:06vegaiwill it be horribly slow to add to a vector one by one in a (dosync...)?
05:07ravammarczyk: print-json is in 1.1 aswell
05:07Chousukevegai: probably.
05:08mmarczykrava: yeah
05:08mmarczykjson-str should return as string
05:08ravathere any way to see what threads are running in a repl and kill it?
05:08mmarczykwhat print-json prints
05:08mmarczykso that's what you'd want to put in your route, I guess
05:08ravai've a jetty instance running now in my emacs repl and trying to find a way to kill and restart the instance
05:09mmarczykhave you got it bound to a Var or sth?
05:10Chousukevegai: or rather, it'll be as fast as adding to a vector one by one, plus the overhead of the STM
05:10mmarczykhttp://stackoverflow.com/questions/2706044/how-do-i-stop-jetty-server-in-clojure
05:10sexpbot"How do I stop jetty server in clojure? - Stack Overflow"
05:11ravahmm..
05:11rava (GET "/files" []
05:11rava ((json-str (file-list *enc-files-dir*)))
05:11ravais the route now
05:11ravaand i'm getting this in log: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn
05:12sparievlooks like you've got one paren more than needed in ((json-str ...
05:12mmarczykrava: one level of parens too many
05:12mmarczykright.
05:12ravadoh, this is what happens when you're running off of 2 hours of sleep 12 hours ago
05:13mmarczyk:-)
05:16ravawoot
05:16ravaits silly how long i've been hacking at this ...
05:16vegai(for [line (read-lines file)] (println line)) => no output
05:17vegaiwhat am I doing wrong there
05:17Chousukefor is lazy
05:17Chousukeuse doseq
05:17vegaiaah
05:18vegaithank you, again
05:23bartjChousuke: but, the "control" does return after executing "for"? so why is the output of "for" not printed?
05:26Lajla,((set \a \b \c \d) \b)
05:26clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$set
05:26Lajla,((set "abcd") \b)
05:26clojurebot\b
05:26mmarczykbartj: presumably it's being run from a script, in which case return values for expressions aren't printed by default
05:27vegai,(.trim " a bc \n ")
05:27clojurebot"a bc"
05:27vegai,(map .trim [" a bc \n "])
05:27clojurebotjava.lang.Exception: Unable to resolve symbol: .trim in this context
05:27bartjmmarczyk: ok, is there any way to print them then?
05:27mmarczykor possibly it's a non-final expression in a function
05:28mmarczykI mean, a "do"
05:28mmarczykpossibly implicit
05:28mmarczykbartj: sure, wrap them in print :-)
05:28mmarczykif you really want to see the Java-ish string representation, then (print (.toString ...))
05:28mmarczyk,(.toString (lazy-seq nil))
05:28clojurebot"clojure.lang.LazySeq@0"
05:29vegaiah, I need to wrap .trim inside a clojure trim
05:29vegaiwhat's the reason for this again?
05:30mmarczyk.foo-style symbols are treated specially only in the operator position
05:31Chousukemmarczyk: you can use str instead of .toString
05:32mmarczykChousuke: ah, I thought it would force the seq
05:32mmarczyknot so, apparently
05:32Chousukeit's just a wrapper for toString/StringBuilder :)
05:33mmarczykyup, good catch, thanks :-)
05:40ravathanks for the help. rest easy everyone
05:50LauJensenHi all
05:50esjGood Morning Mr Jensen
05:50unfo-(hi)
06:02angermanWhen using the decomp-eigenvalue function from incanter, I get two lists one with the vectors and one with the values.
06:02angermanHow would I get the vector that corresponds to the absolute maximum of the values?
06:03angermanbasically some index-return on the max function
06:03angermane.g. vectors = ( v1 v2 v3 v4 ) values = ( 1 2 4 3 )
06:04angermanahh. I've an idea, I compute the maximum, interleave them and filter for the one with the maximum value. and then run take 1 on them
06:17hoeck,(apply max-key second (map vector [:v1 :v2 :v3 :v4] [1 3 4 2]))
06:17clojurebot[:v3 4]
06:18hoeckbut I don't like the packing together the pairs in those solutions
06:19angermanwell,
06:20vegaiis there a nice way to update a map so that either a new value is inserted
06:20vegaior a new value is computed based on the old value if it exists
06:20Chousukevegai: update-in
06:20Chousuke(update-in {:a 1} [:a] inc). though you need to handle the nil case separately
06:22Chousukeyou can define a function called fnil like so: (defn fnil [f val] (fn [x] (if-not (nil? x) (f x) val))) and then do (update-in m [:key] (fnil inc 0))
06:22vegaiok...
06:23vegaiand how to coerce a string into a number?
06:23Chousukewhat kind of a number? :)
06:23angermanhoeck: yep, that seems to work, though it takes the last (if multiple ones with the same key) ...
06:23angermanstill kinda ugly :D
06:23ChousukeYou can use the java static methods: Integer/parseInt etc.
06:23vegaiCaused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
06:24vegaito make this go away :)
06:24vegaiyeah, that might work
06:25ChousukeI still wonder why fnil is not in core. it's very useful.
06:38LauJensensilly name though Chousuke, "fnil" :)
06:47mmarczykhttp://groups.google.com/group/clojure/msg/f251cfd9baab440a
06:47mmarczyk:-)
06:47mmarczykhi Lau
06:50mmarczykI've been looking at "Approaching Productivity" again (apparently you're really onto sth with that post ;-)) and noticed that you're not using -> / ->> in your elisp! :-)
06:50mmarczykhttp://gist.github.com/408702
06:51mmarczykthere. I also have -> & ->> written as r5rs macros somewhere
06:52mmarczykI *can't imagine* how I lived without these two.
06:56defnwait, what's fnil?
06:57mmarczyksee above
06:57mmarczykor click the link ;-)
07:00vegai.split is weird for working differently based on the type of the first argument
07:00vegai,(vec (.split #"," "1,2"))
07:00clojurebot["1" "2"]
07:00vegai,(vec (.split "1,2" ","))
07:00clojurebot["1" "2"]
07:00vegaijava limitation?
07:01vegaior what...
07:04mmarczyk(.split foo ...) means "call method split on object foo with args ..."
07:04mmarczykjava.util.regex.Pattern has a difference implementation to that of java.lang.String
07:04mmarczykdifferent.
07:07LauJensenmmarczyk: hey, sorry for the late reply, my highlighter didn't pick up 'Lau' for some reason
07:07LauJensenodd
07:08LauJensenah cool
07:08mmarczyknp :-)
07:16LauJensenIn java terms, what is for(; ;) ?
07:18hoecklike while true { }
07:18hoeckan infinite loop
07:18LauJensenk
07:18LauJensenthx
07:19LauJensenSure is nice to see Clojure atoms based on sun.misc.Unsafe, titled "The Unsafe service"
08:03defnmmarczyk: approaching productivity?
08:04defnmmarczyk: ah nevermind, you were referring to LauJensen's post
08:04LauJensenChousuke: ping
08:09ChousukeLauJensen: pong
08:09LauJensenChousuke: Im thinking of picking up Magit again and was wondering if you would share your top-10 hotkeys, workflow tricks etc ?
08:11ChousukeLauJensen: my use of magit is really simple. I mostly just use s/u for stage/unstage and tab to expand files to chunk view so I can stage individual chunks. and then I just commit and sometimes push/change branches
08:12Chousukeoh, and k is useful for deleting trash files in the status view as well
08:12ChousukeI haven't even tried to do anything more complicated with magit like rebases
08:12ChousukeI'm still more comfortable using the git command line UI for those
08:13LauJensentcrayford: in magit?
08:13tcrayfordnah, command line
08:13tcrayford-i is essential
08:13LauJensenChousuke: Ok cool, commit is C-c C-c ? and push / pull is ?
08:13tcrayfordLauJensen: C-h m describes the current mode, then just search for magi
08:13tcrayford*magit
08:14Chousukeactually "c" commits in the status view
08:14bozhidarP is push
08:14bozhidarF is pull
08:14LauJensentcrayford: the reason Im asking Chousuke is to avoid the docs and learn first hand from a user
08:14ChousukeC-c C-c is just when you're finished typing the message
08:14LauJensenAh ok, Egg copied that bit
08:15LauJensenThanks a lot Chousuke and bozhidar , I'll give it a whirl :)
08:15Chousukeif you use menu mode in emacs you can get pretty far by just looking through the magit menus
08:16bozhidarno menus for me :-)
08:16ChousukeLauJensen: it's also useful to bind a key to 'magit-status
08:17ChousukeLauJensen: I have meta-f12
08:17LauJensenF2 is all fired up and ready to go :)
08:17Chousukealso I apparently have set magit-save-some-buffers to nil
08:18LauJensenChousuke: Isnt it desirable to have all buffers save once you pull up the status view ?
08:18Chousukewell, that depends
08:18ChousukeI switch over to the status view so often that it just annoys me
08:20bozhidarI have advised switch-to-buffer to save my buffers at switch anyways
08:20bozhidarI'm too paranoid about losing changes
08:20bartjwhat is the difference between "->" and "->>"
08:21LauJensenbartj: thread as second argument, or last argument
08:21bartj,(doc ->>)
08:21clojurebot"([x form] [x form & more]); Threads the expr through the forms. Inserts x as the last item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the last item in second form, etc."
08:21LauJensen(-> 5 (+ 2)) = (+ 5 2), (->> 5 (+ 2)) = (+ 2 5)
08:21tcrayford,(-> 1 (/ 2))
08:21clojurebot1/2
08:21tcrayford,(->> 1 (/ 2))
08:21clojurebot2
08:23tcrayfordhaha
08:23tcrayford`gut status`
08:24bartj, (-> 5 (+ 2))
08:24clojurebot7
08:24LauJensen,(print (str \$ "(-> 5 (+ 2))"))
08:24clojurebot$(-> 5 (+ 2))
08:24sexpbotresult: 7
08:25bartj, (->> 5 (+ 2))
08:25clojurebot7
08:25bartj, (--> 5 (* 2) (* 3))
08:25clojurebotjava.lang.Exception: Unable to resolve symbol: --> in this context
08:25bozhidarfor plus the order doesn't really matter
08:26bartj, (->> 5 (* 2) (* 3))
08:26clojurebot30
08:26LauJensenbozhidar: I know, just thought it would be fun to let clojurebot start off sexpbot
08:26bartj, (-> 5 (* 2) (* 3))
08:26clojurebot30
08:27bartj, (-> 5 (- 2) (- 3))
08:27clojurebot0
08:27bartj, (->> 5 (- 2) (- 3))
08:27clojurebot6
08:27bozhidarLauJensen: I noticed your intent, I was saying this because of bartj experiments
08:27LauJensenah
08:27LauJensenbartj: there's also tryclojure.org I think
08:27bozhidarand SLIME of course ;-)
08:28bozhidara SLIME REPL I meant
08:30bartj, (-> 5 (- 2))
08:30clojurebot3
08:31bartj, (->> 5 (- 2))
08:31clojurebot-3
08:31bozhidarbartj: don't flood the channel with your experiments...
08:32LauJensendefn: wow, cool way to waste your life :)
08:32defnLauJensen: :) Just started on it -- I had never heard of Malbolge. I have a feeling this will take me a long..long time. Very interesting though...
08:32bozhidardefn: you should proceed with BrainFuck :-)
08:33defnbozhidar: Malbolge is way...way harder.
08:33defn(IMO)
08:33bozhidardefn: you're probably right, I just remember brainfuck was created for a similar purpose
08:34defnMalbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The program was not even written by a human being: it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.
08:34defn^lol^
08:34bozhidarhahaha
08:34LauJensendefn: There's a 99 bottles of beer on the wall program written in Malbolge
08:34bartjthanks guys for explaining "->" and "->>"
08:35defnLauJensen: no way! Is it in that 99bottles github repo?
08:35LauJensenhttp://99-bottles-of-beer.net/language-malbolge-995.html
08:35sexpbot"99 Bottles of Beer | Language Malbolge"
08:35defnOh...my...God...
08:35LauJensenbut it looks like a Perl version, just with changed names
08:35bartjis there any use-case (experiment) you can think of for "->>"
08:35defnLauJensen: yeah that looks awfully perl-esque
08:36tcrayfordbartj: if you're nesting lots of filter/map/reduce calls, ->> is useful
08:36LauJensen,(->> (range 10) (filter odd?) (map inc))
08:36clojurebot(2 4 6 8 10)
08:36defnI wonder if that crypto puzzle outside of the NSA could be solved with malbolge...
08:36defnKrypto, is it?
08:37LauJensenMalbolge, much like Perl, does not solve problems it creates them
08:37tcrayfordI find that that above form easier to read than the nested version
08:37defnLauJensen: *chuckle*
08:37defntcrayford: really? I rather like the nested version to be honest...
08:37tcrayforddefn: I prefer using ->> a lot of the time
08:38defntcrayford: I write everything nested, and then i use clojure-refactoring where it makes sense ;)
08:38tcrayforddefn: you're actually using clojure-refactoring on stuff? cool.
08:38bartjcan some one tell me why I cannot do this: "->>"
08:39bartjI get a "Unable to resolve symbol" on my system
08:39tcrayfordyou just entered ->> at the repl?
08:39bartjdo I need to check the version of my clojure installation?
08:39bartjI mean on my system
08:39tcrayfordbartj: use *clojure-version*
08:39bartj:major 1
08:39tcrayfordand minor?
08:40defntcrayford: yeah i include it on all my little projects -- it's cool to use it on code i wrote all nested that contains java interop
08:40defnit's like...oh yeah.../that's/ what I meant
08:40tcrayforddefn: are you unit testing that? I know refactoring-mode blows up occasionally
08:41defntcrayford: it does occasionally explode and delete the preceding sexp or some craziness, but that's what C-_ is for :)
08:41bartj:minor 0
08:41bartj{:interim true, :major 1, :minor 0, :incremental 0, :qualifier ""}
08:41defn->> isn't in 1.0 is it?
08:41tcrayforddefn: if you find stuff when it does eplode (and you're ok posting the code somewhere), then message me on github with what broke
08:42tcrayfordnope
08:42defnthat's a 1.1.0 isn't it?
08:42tcrayfordpretty sure
08:42defnyeah
08:42bartjso I need to upgrade that's all, right?
08:42tcrayforddefn: I'm more than welcome for bug reports, apart from those that involve the newline problem
08:43defntcrayford: yeah i'll definitely do that, i should have been doing that all along, but i assumed you were aware, and i had been using your major mode which you stated you were trying to boil down to a minor mode so I figured it was just known beta limitations
08:44tcrayforddefn: the other thing is that I'm considering moving refactoring-mode so that it changes files on disk instead of doing stuff with emacs. You got any thoughts on that?
08:45defnwell, like I said, being able to just step back and undo in case something naughty happens is nice, and it's neat to see how something will look threaded and then just step back out of it
08:45defni think for certain operations disk probably makes more sense, but for others maybe not, you know?
08:45tcrayforddefn: aye. The problem with doing stuff on disk is that I'd need to rework how undo works
08:46bartjtcrayford: I just need to upgrade right?
08:46defnbartj: yes
08:46defnto 1.1.0
08:46bartjcool, thanks
08:46tcrayforddefn: I'm considering doing it for all the refactorings, to get rid of the newline problem
08:46defntcrayford: im assuming that's where, wherever a \n exists, it explodes?
08:46tcrayforddefn: yeah
08:47tcrayfordit doesn't explode hugely, it just prints the \n as an actual newline in emacs
08:47defnthat's sort of a surprise that you cant get around that
08:48defnwhat's the issue in making that work correctly?
08:48defn(if you dont mind me asking)
08:48tcrayfordhow I move data between emacs and clojure
08:48defnahhh, do you remove the \n's and treat it like a one-liner sexp?
08:48tcrayfordgo look at the tests
08:48defnlooking now...
08:50tcrayfordthe real downside of disk stuff is that I'd have to work out some system of stubbing out the filesystem AND namespaces so that I could test it. I'd hate to not have tests for this kinda stuff :/
08:50defnyeah tests here are crucial
08:52tcrayfordand the whole having undo be a seperate function thing :/
08:52defnyeah, makes the problem harder... refactoring libraries are /hard/
08:52defnyou're a braver man than me
08:52tcrayfordheh, I've been putting off doing the rename refactoring for *ages* because of this
08:53defnhehe, yeah i knew someone who was working on a refactoring library for ruby, and he got rename done, but...that's it
08:53defnlol
08:53tcrayfordrenames are damn near impossible in ruby anyway
08:54defnive often wondered if turning ruby into s-exps would make refactoring "easier"
08:54tcrayfordpeople have done it, but its still pretty much impossible in certain situations
08:54defnyeah
08:55tcrayfordlike, given three classes, A B & C, where A & B both have method "foo", and class C calls "foo" somewhere. If you want to rename foo from inside C, how do you know to rename A or B
08:56defngotta follow those singletons to hell and back
08:57defnbut the context there could change everything, sure
08:57tcrayfordyep
09:00tcrayforddefn: atm I'm going to work on having rename-fn refactor to disk, and see how that goes
09:00defntcrayford: so without knowing how all the pieces fit together, could a "perfect" anti-pprint library of some sort be useful?
09:01defnin order to get it into a more malleable form prior to transform?
09:01tcrayfordmaybe
09:02tcrayfordI think clojure.pprint works well enough for me right now
09:02defni just look at what little ive done with the pprint lib for reformating long one-line sexps
09:02defnand i wonder about doing the opposite
09:02tcrayfordwhat I *really* need is a clojure-reader that tags every sexp with metadata of offset from the start of the sexp (in the string)
09:03defnyell at hiredman and Chousuke :)
09:03tcrayfordmm?
09:03defnive just been told they're the reader gurus
09:03tcrayfordI think its a lot of work, so meh for now
09:04defnperhaps they'd have a suggestion to some successful end
09:04tcrayfordperhaps
09:04tcrayfordchouser showed me how to use the compiler to get all bound vars out of a sexp the other day, is pretty cool
09:05defntcrayford: yeah, either way, i have to say: great work. these are the sorts of projects (refactoring) that can make a tremendous difference in a language.
09:05defntcrayford: whoa. that is cool.
09:05defnthat's mad scientist talk, even.
09:05defn:)
09:05tcrayforddefn: the problem is that you have to use eval, and that makes it pretty messy
09:05bartjone newbie question: why is it called "s-expression", I always thought clojure statements were just "expressions"
09:06defnbartj: bartj http://en.wikipedia.org/wiki/S-expression
09:06sexpbot"S-expression - Wikipedia, the free encyclopedia"
09:06ChousukeI think technically clojure expressions are a superset of s-exprs
09:06tcrayfordseeing as they use things other than lists
09:07chousertcrayford: wait, what requires using 'eval'?
09:07tcrayfordchouser: that compiler analysis thing used eval
09:07tcrayford,(->> (clojure.lang.Compiler/analyze clojure.lang.Compiler$C/EVAL
09:07tcrayford '(let [a 3 b 4] a)) .fexpr .methods first .locals keys (map #(.sym
09:07tcrayford %)))
09:07clojurebotEOF while reading
09:07tcrayfordfail
09:08chouserthat's not using eval
09:08tcrayfordso when I run it, why do I get a warning about replacing vars in whatever namespace I run it in?
09:08chouserah. yes, well...
09:08tcrayfordif its analysing a `def` form
09:08defnbtw, maybe this is a ridiculous question considering how long ago it was, but are there any videos of McCarthy's lecture when he presented lisp?
09:09defnlike of the actual black and white presentation?
09:09chouserThe compiler analysis phase does define vars, though it doesn't bind any values to them.
09:09tcrayfordchouser: right, which ended up being problematic a lot of the time
09:09chouserI can believe that. hmph.
09:10chouseryou can bind *ns* to something throw-away...
09:10chousermeh. I wonder if anything cleaner can be done for c-in-c.
09:10tcrayfordI hope so
09:11tcrayfordrefactoring-mode does something similar (but I do the analysis myself, using recursion), which would be much better done via talking to the compiler
09:11chouserI believe it's done so that the definition of the var can refer to the var being defined.
09:12chouserbut ... actually, I wonder if that's even necessary anymore.
09:13tcrayfordI'm looking forward to c-in-c for this kinda stuff, should make it a bit easier to understand
09:13chouseryes
09:13chouserI think the next step, or at least the one I'd like to see, is a tool to convert a CompilerExpr tree to a tree of defrecord objects
09:14tcrayfordare there actual plans for c-in-c yet, or is thinking about that on hold until 1.2 is released?
09:14chouserspecifically, a tree of records that rhickey approves as being the official target for cinc when it is implemented.
09:15chouseronce such a converter exists (and its output documented), work could proceed independently on both a analyzer producing that format using clojure instead of java code, and also various tools using that tree
09:16defntcrayford: i know there's been talk about c-in-c for the last few months -- specifically i remember rich or someone close to the action saying "soon"
09:16chousertools that could include emitters for other host platforms, lint-like tools, other code analysis tools, etc.
09:16tcrayfordyep. I'm interested in writing a lint tool as well
09:18chouserthe only reason I'm not working on a converter is because I'm supposed^W working on a book.
09:18tcrayfordthe joy of clojure has been a pretty good read so far though
09:18chousergreat, glad you're enjoying it.
09:21defnchouser: ditto to tcrayford's comment -- lots of the right kind of depth
09:21tcrayfordchouser: also I'm finding on lisp to be *really* good, even if it is in common lisp
09:21chouseryes, "on lisp" is solid.
09:22tcrayfordthough bits of it keep on flying over my head, I think I'm on my third go through now
09:22chouserbefore reading that, I wasn't sure why lisp was so venerated. After, I knew: I must have macros.
09:23defnbefore PG became Mr. 2.0
09:23tcrayfordis there a way to create a var on the fly?
09:24defnlike...gensym you mean?
09:24defnor lower level?
09:25tcrayfordno, something like (var 'foo), that actually returns a var object that I've just made
09:25defnoh, no idea..
09:25tcrayfordoh, you can do it with var
09:25bartjchouser: I wrote a glowing review of your book here: http://rubylearning.org/class/mod/forum/discuss.php?d=3839
09:25sexpbot"A Ruby Learning Hub: Login to the site"
09:25tcrayford,(var foo)
09:25clojurebotjava.lang.Exception: Unable to resolve var: foo in this context
09:25chousertcrayford: with-local-vars
09:26chouserwriting that section this week.
09:26bartjchouser: Thank you a million times. I just love your book a million times (compared to Programming Clojure)
09:26chouserbartj: wow! thanks!
09:27lpetitbartj: Programming clojure starts to show its age, but for what I've read of it (a quarter, maybe), it's very well written. (I have not yet read chouser's one, though ;-) )
09:28tcrayfordhttp://gist.github.com/408827 for some reason defining that var on the fly always ends up with it on a line of 19
09:28bartjlpetit: If I had money, I would pay you to go read it right now. Seriously.
09:29chouserfirst chapter is free. :-)
09:29bartjchouser: have you written any other books? :)
09:29chouserha! no.
09:29bartjchouser: and your co-author fogus?
09:30chousersorry, laughing was probably rude. This is hard work.
09:30chouserno, this is Fogus's first as well
09:31bartjchouser: I profusely apologize...I was just being greedy and cheeky to read all your books...Sorry again...
09:31chouseroh, please don't apologize.
09:32bartjchouser: like i said, i just wanted to read your other books...I was so impressed by your "Joy of Clojure" book. That is all.
09:32bozhidarchouser: when is the book expected - I don't see it for preorder on amazon
09:33tcrayfordbozhidar: see manning.com
09:33tcrayford(which, funnily enough uses yahoo store)
09:34bozhidarfall 2010 - not very specific :-)
09:34defnit's on amazon?
09:34defni thought it was only available via manning?
09:34chouserbartj: it was a perfectly reasonable question.
09:34bozhidardefn: it's not
09:34chouserbartj: so, do I need an enrollment key to read that link you posted?
09:35bartjchouser: is it ok to post it here?
09:36bartjAnyway, the enrollment key is: BPCE101
09:36chouserI was just curious to see what you said, but it doesn't seem to let me.
09:36tcrayfordchouser: I can gist it if you want
09:36defnchouser: actually, i dont know if you have any interest -- but there are quite a few "students" in rubylearning who post quite regularly. it's kind of a mixed bag, but im sure some of the folks would appreciate a cameo from the famous chouser :)
09:36tcrayfordwhen I get rubylearning's terrible website working
09:37bartjtcrayford: can you gist the full page?
09:39chouserwell, I'm giving up for now. Can't seem to get anything beyond "This course is not enrollable at the moment"
09:39tcrayfordchouser: yeah, the course has started an all
09:39tcrayfordbartj: shouldn't there be more exercises than week 1?
09:39defnchouser: it's a really poor site
09:40bartjtcrayford: I am afraid, I don't understand
09:40tcrayfordon the rubylearning course?
09:41defnI am afraid also
09:41tcrayfordI only see exercises for week 1 (which I completed ages ago), and I was under the impression that there were more weeks than that
09:41defntcrayford: yeah i thought so too :\
09:41tcrayfordchouser: http://gist.github.com/408841
09:41defnMichael Fogus will be online on our forum from 25-27 May 2010 to answer questions related to Clojure and his forth-coming book "The Joy of Clojure".
09:41defnah, cool
09:42bartjtcrayford: yes there are
09:42tcrayfordbartj: really? how do I get to them??
09:42tcrayfordoh, got it
09:42bartjer, you need to be enrolled in the course
09:42tcrayfordI am
09:42tcrayfordI'm debating dropping out though, the site is *so* bad
09:43chousernice, thanks.
09:43bartjer, sorry guys may be it is just my taste but, I liked the site!
09:44tcrayfordI'm not so worried about the looks, just the fact that navigating around it is really annoying, and working out what's going on on the course is annoying
09:45bartjtcrayford: you go here http://rubylearning.org/class/course/view.php?id=53 - which gives you a nice overview
09:45sexpbot"A Ruby Learning Hub: Login to the site"
09:45tcrayfordbartj: see, when I clicked the link to the course I only ever got to week 1's stuff
09:46bartjbeats me. i see four weeks listed here
09:46tcrayfordyeah, that link you gave me has 4 weeks, but when I clicked on the link to the clojure course from the homepage I only ever got to week 1
09:47ChousukeSomeone needs to invent a device to control the sun's heat. I'm melting here ;/
09:47tcrayfordI think I'll learn more from working through "on lisp" anyway
09:48Chousukeand it's "only" 26 degrees celsius
09:48bartjtcrayford: can you post the link here please?
09:48tcrayfordbartj: it seems to be fixed now, maybe I was doing something wrong before
09:49defntcrayford: it's polite to stay on the list and help people out from time to time -- there are some pretty 'green' folks on there who have a real desire to learn clojure -- the more we can do to encourage them the better :)
09:50defnim preaching a bit, and it's not really directed at you, more of a PSA than anything
09:50defnalthough i think this community has had the right feeling from day one
09:51tcrayfordI'm pretty lazy with sticking to stuff like that course atm, I prefer learning from myself/friends/colleagues/this channel
09:51defntcrayford: yeah same here, but again, not everyone has been on IRC for 10 years, and some even find it scary or intimidating
09:52defngotta keep that human connection alive! :)
09:52tcrayforddefn: I've only really been on irc for a couple of months
09:52defnreally? i've been on IRC since I was...gosh...13
09:52esjdefn: truedat, as an 'eager green' I'm most grateful for the skilled in this channel
09:52defnesj: it's difficult i think to learn the irc cultural dynamic
09:52tcrayforddefn: I've only been into programming a couple of years, and the first year and a half were spent in hermit mode
09:53defnsome folks pour their heart out on irc and get discouraged when everyone doesnt fall over to explain every detail -- i remember asking questions in #c and #c++ and basically getting laughed at
09:53tcrayfordnot to mention #emacs and #git :/
09:54defnthe first "good" experience I had on irc was in #ruby-lang -- i'd actually say (surprisingly) that the culture on IRC has really matured over the last few years in particular
09:54defni think people finally got hip to the fact that helping other people learn about their favorite things was as beneficial to them as it was to the people they are helping
09:54defns/are/were
09:55esjyup, until you've explained it, you don't understand it
09:55underdevyeah, fr33n0de rulzrz!
09:55defnbut then again, i used to be on EFnet -- freenode is a whole 'nother animal of irc
09:55underdev;)
09:56esjcareful, you'll make CB and SB jealous
09:57bartjhow do I know which function belongs to which library?
09:58bartjfor example on my REPL, it says "Unable to resolve var" when I use the "re-split" function
09:58tcrayford(find-doc "re-split")
09:58tcrayford,(find-doc "re-split")
09:58clojurebotnil
09:58bartjer, nil?
09:59tcrayfordtry that at a repl
09:59bartjyes did that
09:59tcrayfordI get a printout of re-split
09:59bartjhave currently loaded both clojure.jar and clojure-contrib.jar on the classpath
10:01tcrayford(vals (apply merge (map ns-publics (all-ns)))) gets you a list of all the vars currently loaded (I think), and you can go through it using filter
10:01tcrayford,(filter #(.contains % "re-split") (map #(.toString %) (vals (apply merge (map ns-publics (all-ns))))))
10:01clojurebot()
10:03bartjtcrayford: get an empty list
10:04defn,(ns-public 'clojure.core)
10:04clojurebotjava.lang.Exception: Unable to resolve symbol: ns-public in this context
10:04defn,(ns-publics 'clojure.core)
10:04defndid i break clojurebot? :X
10:04tcrayforddefn: clojurebot will timeout that, (I think)
10:04tcrayford,(+ 1 1)
10:05defnuh oh...
10:05tcrayfordhaha
10:05defn,*clojure-version*
10:05tcrayfordthat's funny, because ns-publics on clojure.core doesn't take any time whatsoever here
10:05defnyeah i've done it in here before i think
10:06defnhiredman: I think clojurebot choked...
10:06arkahn$(ns-public 'clojure.core)
10:06sexpbotclojure.core
10:07tcrayford$(ns-publics 'clojure.core)
10:07defn$(ns-publics 'clojure.core)
10:07sexpbotclojure.core
10:07sexpbotclojure.core
10:07defnwhaaaa?
10:07bartjdefn: was my question the culprit?
10:07arkahn$(filter #(.contains % "re-split") (map #(.toString %) (vals (apply merge (map ns-publics (all-ns)))))) ;credits tcrayford
10:07sexpbotDENIED!
10:07sparievdefn, the bot crusher :)
10:08defnlol -- i want that for my official title
10:08defn,(+ 1 2)
10:08defnman he is really dead...surprising
10:08defnclojurebot is battle-tested, mother approved
10:09bartjoff home, while clojurebot someone administers CPR
10:10defnbartj: wanna wait one second so i can answer your question before you go?
10:10tcrayforddefn: put an issue on hiredman's github repo for clojurebot
10:10bartjdefn: definitely!
10:12clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, find-protocol-impl #'clojure.core/find-protocol-impl, vector-of #'clojure.core/vector-of, object-array #'clojure.core/object-array, *compile-path* #'clojure.core/*compile-path*, max-key #'clojure.core/max-key, lis
10:12clojurebot3
10:12defnhaha!
10:12clojurebot{:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"}
10:12tcrayfordhe lives!
10:12defnclojurebot: welcome back!
10:13clojurebot2
10:13clojurebotExcuse me?
10:14bartjdefn: ?
10:14defn,(ns-publics 'clojure.core)
10:14defnsorry all, just testing again to make sure it wasnt just lag on clojurebot's side
10:15tcrayford,(+ 1 1)
10:15tcrayfordyeah, seems to be dead
10:15tcrayfordI'm surprised clojurebot doesn't fire up a thread for every request
10:15defnyeah... anyway, bartj -- tcrayford's advice is good
10:16defn(map ns-publics (all-ns)) should give you all the functions in all the namespaces
10:16tcrayforddefn, don't forget to apply merge to that
10:16defnoh right
10:17defnbartj: (apply merge (map ns-publics (all-ns)))
10:17defnrun that at your REPL
10:17bartjdefn: yes
10:17defnbartj: or if you just want to see all of the functions, without their namespaces you could do:
10:18clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, find-protocol-impl #'clojure.core/find-protocol-impl, vector-of #'clojure.core/vector-of, object-array #'clojure.core/object-array, *compile-path* #'clojure.core/*compile-path*, max-key #'clojure.core/max-key, lis
10:18clojurebot2
10:18bartjdefn: I can't find "re-split" function listed when I do that
10:18AWizzArdA clojure fn similar to the (get ..) map, but which returns the key/value pair, and not only the value?
10:18defn(map str (map first (apply merge (map ns-publics (all-ns)))))
10:19tcrayfordAWizzArd: I don't know of any, but you can write one pretty easily
10:19defn(sort (map str (map first (apply merge (map ns-publics (all-ns))))))
10:19defnbartj: are you still on 1.0?
10:19bartjno 1.2
10:19AWizzArdtcrayford: without iterating over the collection?
10:20bartj{:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"}
10:20tcrayfordAWizzArd: yeah
10:20AWizzArdtcrayford: how?
10:20defnbartj: weird.
10:20tcrayford(defn a-clojure-fn [k mp] (conj [k] (k mp)))
10:20defnbartj: how are you running your REPL?
10:20bartjdefn: java -cp "clojure/clojure.jar:clojure-contrib/target/clojure-contrib-1.2.0-SNAPSHOT.jar" clojure.main $1
10:20tcrayford(a-clojure-fn :foo {:foo 1}) ;; ouputs [:foo 1]
10:21AWizzArdtcrayford: that does return the k which I provided, which will be = but not identical.
10:21AWizzArdI want something that is identical to the key, not just =
10:21tcrayford,(identical? :foo :foo)
10:21clojurebottrue
10:22tcrayfordkeywords are interned (so it works for keywords anyway)
10:23bartjdefn: I am leaving now
10:23AWizzArdtcrayford: what if my keys are strings or instances of defrecords?
10:23bartjbye and thank you all very much guys! you guys are awesome. seriously.
10:23AWizzArd(identical? (MyRecord. 1 2 3) (MyRecord. 1 2 3)) ==> false
10:23tcrayfordstrings are fine though
10:23AWizzArdor when my keys are java.util.Date instances?
10:24defni have no idea why he doesnt have split-with
10:24tcrayfordyeah it doesn't work all the time. I don't think there's anything that I know about in clojure that does that
10:24hoeckAWizzArd: what about find?
10:24AWizzArdhoeck: ah yes, that was the fn I was looking for.
10:24AWizzArdI keep forgetting it.
10:25defnwait wait, what do you mean find?
10:25tcrayford,(find {:foo 1} :foo)
10:25clojurebot[:foo 1]
10:25defnahhhhh i see
10:26hoeck,(meta (first (find {(with-meta 'a {:meta :t}) :a} 'a)))
10:26clojurebot{:meta :t}
10:26hoeckfind returns the maps MapEntry, so it preservers key metadata
10:26hoeck*preserves
10:28AWizzArdfor me it is important that I get the key which sits in the map, and with find I can do that
10:28AWizzArd,(let [d1 (java.util.Date.), d2 (java.util.Date.), m {d1 10}] [(= d1 d2) (identical? d1 d2)])
10:28clojurebot[true false]
10:29AWizzArdI can not just say [d2 (get m d2)], because I need it to be d1
10:29AWizzArd(find m d2) ==> [d1 (get m d1)]
10:30AWizzArdhoeck: do you know if find is O(1)?
10:30defn,(+ 1 2)
10:30clojurebot3
10:30hoeckits the same O as get
10:32defnwould someone else try the ns-publics thing and see if it behaves the same?
10:32AWizzArdhoeck: ok fine, that makes sense
10:32tcrayford,(ns-publics 'clojure.core)
10:32tcrayford,(+ 1 2)
10:32defnk just checking. my nick is 'defn' so i just wanted to make sure that had absolutely nothing to do with it
10:33defni dont know why it would but well...it's a keyword so
10:33tcrayforddefn: have you reported that on clojurebot's repo yet?
10:33defnyeah just did
10:33defni just wanted it to be properly tested before i reported intermittent lag as an issue
10:34tcrayfordits better for people to know about it than not, even if nowt gets done
10:35defnyeah i know that deep in my hacker heart
10:35defnbut i still hate being the bearer of bad news :)
10:35tcrayfordso that's why you haven't bug reported much on refactoring :P
10:35defn:D
10:36defnyou're going to be singing a different tune when you wake up to 100 emails from github tomorrow ;)
10:36tcrayfordI'll be happy with that
10:36tcrayfordI don't actually use refactoring-mode very much, so I don't see many bugs
10:37defntcrayford: i cant say i use it /all/ the time -- once there is a minor mode id use it all the time
10:37tcrayforddefn: coming right up
10:40clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, find-protocol-impl #'clojure.core/find-protocol-impl, vector-of #'clojure.core/vector-of, object-array #'clojure.core/object-array, *compile-path* #'clojure.core/*compile-path*, max-key #'clojure.core/max-key, lis
10:40clojurebot3
10:40tcrayforddefn: what key are you binding to refactoring-mode's menu?
10:43tcrayfordI'm going with "C-c C-r" for the moment
10:43tcrayforddefn: see github for a minor mode
10:45Licensermmarczyk: neat code for the ident thing!
10:46tcrayfordLicenser: see the issue on clojurebot regarding ns-publics and clojure.core. Not sure if that's your end or hiredman's though
10:47Licensertcrayford: hiredmans since he does not use clj-sandbox ;)
10:47tcrayfordah, k
10:47tcrayfordwe had a 7 minute lag with clojurebot earlier doing that
10:48Licenseroha
10:48Licensercan you try that with sexpbot?
10:48tcrayfordnot sure how to invoke sexpbot
10:48Licenser$(+ 1 1)
10:48sexpbotresult: 2
10:48tcrayford$(ns-publics 'clojure.core)
10:48sexpbotclojure.core
10:48Licenser$(+ 1 1)
10:48sexpbotresult: 2
10:48Licenserhmm I see no lag
10:48tcrayfordthat's not even the right result for ns-publics
10:49Licenser:P
10:49tcrayford,(ns-publics 'clojure.core)
10:49tcrayford(this will take a while)
10:50Licenserhmm it should time out usually
10:50tcrayforddoesn't in this case
10:50tcrayfordthat expression executs instantly at the repl though
10:50tcrayford/s/excuts/executes
10:51Licenserhmm then it will be likely a clojurebot issue
10:51tcrayfordyeah, I'll talk to hiredman next time he's aboot
10:51tcrayfordthough sexpbot fails with it as well (as seen earlier)
10:52Licenser$mail Raynes Why does sexpbot not return the right result for $(ns-publics 'clojure.core)?
10:52sexpbotMessage saved.
10:52tcrayfordthat's neat
10:53tcrayford$mail hiredman Why does clojurebot take ages (but not time out) when running ,(ns-publics 'clojure.core)?
10:53sexpbotMessage saved.
10:53Licenser,(loop [i 1] (recur (inc i)))
10:54Licenser$(loop [i 1] (recur (inc i)))
10:54chouseroops
10:54sexpbotExecution Timed Out!
10:54tcrayfordchouser: oops?
10:54Licenserhmm sexpbot times out
10:54chouser$(Thread/sleep 20000)
10:54sexpbotDENIED!
10:54Licenserthen again clojurebot isn't back from the ns stuff
10:54chouser*sigh*
10:54tcrayfordno its not
10:54tcrayford:/
10:55Licenserchouser: I wrote that sandbox so simple tricks as sleep don#t work :P
10:55chouserI was thinking that sleep was a gentler test
10:55chouseruseful for playing with thread-interaction stuff besides
10:57clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, find-protocol-impl #'clojure.core/find-protocol-impl, vector-of #'clojure.core/vector-of, object-array #'clojure.core/object-array, *compile-path* #'clojure.core/*compile-path*, max-key #'clojure.core/max-key, lis
10:57chouserbut since you can't use agents or futures either, I guess it doesn't matter.
10:57clojurebotExecution Timed Out
10:57tcrayfordthat was around 8 minutes again
10:57tcrayford:/
10:57tcrayfordtiming out with loop works fine though
10:58tcrayfordchouser: do you have any tips for reading on lisp? I've been struggling to understand some of the stuff in there
10:58chousertcrayford: hm, none that I can think of. Maybe I should try reading it again.
10:58tcrayforddid you just read it like a novel?
10:59chouserI think I read it on my palm device.
10:59Licensertcrayford: I have the feeling that it is a formating thing
11:00chouserwhich has since died
11:00chouserpresumably that's unrelated
11:00jweisscemerick: i am still trying to figure out what's wrong w my clutch view server. put in some extra debugging to print out stuff - does this mean anything to you: No implementation of method: :read-json-from of protocol: #'clojure.contrib.json/Read-JSON-From found for class: nil
11:00tcrayfordchouser: maybe it couldn't handle the power of lisp :/
11:01tcrayfordI have myself a printed copy, which is somewhat better, but its still hard work to actually understand everything
11:01Licensersee you later
11:02chousertoward the end I might have given up trying to understand every example in detail, just trying to understand the gist. It's been a while, I'm not sure.
11:02tcrayfordaye, I don't really struggle until he gets to the query compier
11:02tcrayfords/compier/compiler
11:03tcrayfordand then the continuations and prolog stuff goes over my head
11:18notsonerdysunnyhttp://clojure.pastebin.com/6ymswkty
11:18notsonerdysunnyI am a newbie to clojure and java
11:18notsonerdysunnyI am trying to get slime and clojure working
11:19notsonerdysunnyI saw the errors and realize that it is not looking for the clojure.jar in the correct directory ..
11:19notsonerdysunnycan anybody help me to fix this..?
11:19notsonerdysunnycan I take care of this with some java classpath environment variable?
11:21Blackfooti recommend using lein for setting class path
11:22Blackfootfor example, http://github.com/jochu/swank-clojure
11:22Blackfootbut i have not used swank specifically
11:31arohnerdid defn get support for destructuring maps in the & args position, or am I crazy?
11:31arohnerI'm trying to find documentation / github commit for it, and I can't
11:31arohneraha
11:31arohnerhttp://github.com/richhickey/clojure/commit/29389970bcd41998359681d9a4a20ee391a1e07c
11:32notsonerdysunnyBlackfoot: would you be able to help me as to how I could do that..?
11:35alpheusnotsonerdysunny: as a total newb, I followed the instructions at http://github.com/jochu/swank-clojure last night with no problems
11:38cemerickthe distinction between send and send-off is a little more subtle than blocking vs. nonblocking. I'm finding that using send-off for just about everything is better for my purposes, so as to "oversubscribe" the cores in my compute nodes, thereby ensuring full utilization.
11:38alpheus(doc require) mentions "classpath". Is that the same as the value passed to java in the "-cp" option?
11:38clojurebot"([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents define a library of Cloju
11:39cemericke.g. if your send fn is a mix of 75/25 CPU/IO, you want three of those running on a 2-core box to max things out
11:39cemerick...or maybe my thinking here is muddled.
11:39cemerickalpheus: in 99% of the cases, yes
11:42alpheusThanks. I'm trying to use a clojure image started with lein and require sample code from a book that doesn't mention swank or lein.
11:55arkahnis there a way for a function to 1) create something the first time it's called and 2) have it persist and be available between invocations ?
11:55arkahnspecifically, I want to have a file opened and available through function invocations
11:59Chousukearkahn: put a reference to it in an atom or something
11:59arkahnChousuke: ok - I wasn't sure what was idiomatic either, but I'll take that route. Thanks.
12:00cemericka delay would probably be easier -- no explicit checking
12:00Chousukearkahn: it's not particularly idiomatic. more idiomatic would be creating the file, returning it, and then passing it as a parameter later :P
12:00arkahnChousuke: I can do that : )
12:00arkahncemerick
12:01arkahn: what's a delay?
12:01cemerick,(doc delay)
12:01clojurebot"([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls."
12:01arkahnsweet
12:02cemerickso, (def some-open-resource (delay (init-resource))), and then just use @some-open-resource in the fn body
12:03arkahncemerick: I'll check that out - thank you
12:08arkahndelay is interesting but I think I'll create a (BufferedReader. (FileReader. f)) ahead of time and pass that around.
12:12alpheusI expected that after evaluating (def trigger (delay (println "you got me"))) in the repl, I could evaluate trigger without printing anything (until force or deref was used). What's wrong with my understanding?
12:34riddochcHey, doesn't emacs provide some function like "close-all-open-parens-or-bracets-or-etc" by some different name? Anybody know what that function is?
12:34tcrayfordjust use paredit and you'll be fine
12:35alpheusThere's slime-repl-closing-return
12:54bartjer, are there any libraries to connect to webkit rendering engine using clojure?
12:55RaynesI think I've seen some Java stuff for that.
12:56KirinDavecgrand did a really good job on his most recent blog post.
12:56clojurebotwhose job is it to rule the world
13:04bartjKirinDave: link?
13:05jfieldswhy would you use (some identity coll) instead of (seq coll) when determining if there are any elements of coll?
13:05jfields(for example, the impl of merge-with)
13:06KirinDavebartj: http://clj-me.cgrand.net/2010/05/08/destructuring-records-prototypes-and-named-arguments/
13:06sexpbot"Clojure and me » Destructuring, records, protocols and named arguments"
13:09jfieldsanyone care to write a (diff ) function that makes this true: (= {:a [100 250] :c [0 300] :d [220 0]} (diff {:a 100 :b 200 :d 220} {:a 250 :b 200 :c 300}))
13:10jfieldsI'm working on something, but haven't found anything I really like yet
13:10cemerickbartj: there's a gecko java wrapper
13:10cemerickand swt has webkit integration, I think
13:11bartjcemerick: thanks, I check it out
13:12stuarthallowaytechnomancy: you around?
13:13bartjcemerick: looks like it is jrex
13:13cemerickbartj: there's another one, too...don't remember the name tho
13:16bartjcemerick: I was leaning more towards webkit wrappers
13:18stuarthalloway"lein test" has a crippling perf bug, and I would love to discuss it with someone before pushing the fix
13:18stuarthallowayI'll just explain it then :-)
13:19cemerickbartj: I know that swt has support for using webkit as a backend to its Browser component, but that's as far as my understanding goes.
13:19cemerickthere may be other java-webkit wrappers floating around, I have to imagine it's a common inclination
13:20stuarthallowayback in late January, the innocuous looking refactoring commit http://github.com/technomancy/leiningen/commit/a9936d22 causes the entire world to be recompiled between every test
13:20bartjcemerick: I am not actually looking to use a java component to display a webpage on an app
13:20cemerickbartj: what's the use case then?
13:20stuarthallowaythis makes tests an order of magnitude slower, and doesn't make sense--code won't change while you are running your tests non-interactively
13:21bartjcemerick: this is for information extraction purposes - the task being getting the size of each rendered HTML element...
13:21cemerickah, ok
13:22bartjcemerick: ... to deduce their importance and see where they "occur" on the web-page
13:22cemerickI'd certainly hope that a good wrapper would provide a pipe into the DOM, but I can see that being a tall order
13:23chouserI'm using rssowl these days, which appears to be a java app with gecko embedded rather seamlessly.
13:23chouserdoes that help? :-)
13:25chouserDunno if it uses this or something else: http://jrex.mozdev.org/
13:25sexpbot"JRex - The Java Browser Component"
13:27bartjchouser: that was probably rude. Finding a wrapper to a rendering engine is hard. :)
13:29bartjchouser: is rssowl open source?
13:29bartjI think it is definitely possible to use the webkit rendering engine from java because android uses webkit
13:30KirinDaveAndroid also uses jni.
13:37stuarthallowaycemerick: I have submitted a patch for last-var-wins that limits its scope to clojure.core, per discussion here. Mostly happy?
13:37cemerickheh
13:38cemerickstuarthalloway: I'm satisficed, yes.
13:38stuarthallowaygood enough for me
13:39cemerickOver time, I really really want to get to the point where ns declarations really are declarative. Not sure what the impl would look like for that, but that instinct remains constant.
13:39ninjuddstuarthalloway: what's a guy gotta do to get access to the assembla spaces?
13:47stuarthallowayninjudd: lemme check
13:48stuarthallowayninjudd: it is done
13:49ninjuddstuarthalloway: thanks
13:51ninjuddstuarthalloway: are you the same Stuart Halloway who wrote http://www.amazon.com/Component-Development-Java-TM-Platform/dp/0201753065?
13:51sexpbot"Amazon.com: Component Development for the Java(TM) Platform (9780201753066): Stuart Dabbs Halloway: Books"
13:56technomancystuarthalloway: it's the :reload-all, isn't it.
13:57lpetithttp://www.amazon.com/Stuart-Halloway/e/B002BWYVRI/ref=sr_ntt_srch_lnk_1?_encoding=UTF8&amp;qid=1274464448&amp;sr=1-1
13:57sexpbot"Amazon.com: Stuart Halloway: Books, Biography, Blog, Audiobooks, Kindle"
13:57lpetityep, or they are both with the same name and the same face :)
13:59technomancystuarthalloway: thanks
14:00jfieldsIs there a function that will, given a map and a pred, return a map with all the entires that pass the pred?
14:02alpheusdoesn't map do that?
14:04jfieldsalpheus: I don't think so.
14:04Raynes$(map (fn [[key val]] [val key]) {:key :val :key2 :val2})
14:04sexpbotDENIED!
14:04RaynesUh.
14:05RaynesWhat could possibly be denied in that.
14:05Raynes$(map (fn [[k v]] [v k]) {:key :val :key2 :val2})
14:05sexpbotresult: clojure.lang.LazySeq@f333e02e
14:05RaynesOh.
14:05RaynesThe key and val functions.
14:05Raynes$(into {} (map (fn [[k v]] [v k]) {:key :val :key2 :val2}))
14:05sexpbotresult: {:val2 :key2, :val :key}
14:05Raynesjfields: ^
14:05jfieldsraynes, thanks
14:06jfieldsI think I need filter not map, but the idea is the same. thanks.
14:06ninjuddlpetit: thanks, two clicks was too far for me to find that page on amazon
14:08bartjRaynes: I think clojurebot, sexpbot are not functional
14:09bartj, (+ 1 2)
14:09clojurebot3
14:09Raynesbartj: Huh?
14:09bartj, (map (fn [ [key val] ] [val key]) {:key :val :key2 :val2})
14:09clojurebot([:val :key] [:val2 :key2])
14:10bartjRaynes: you need to prefix it with a comma
14:10RaynesI was using sexpbot, not clojurebot. sexpbot is very functional. The only problem is that key and val aren't whitelisted in clj-sandbox, something I'm remedying as we speak.
14:13RaynesAnd I think I've fixed that damned LazySeq problem.
14:15RaynesYep, I did.
14:15Raynes $(map (fn [[k v]] [v k]) {:key :val :key2 :val2})
14:16Raynes$(map (fn [[k v]] [v k]) {:key :val :key2 :val2})
14:16sexpbot=> ([:val2 :key2] [:val :key])
14:16Raynesspacefail
14:16Raynes:)
14:40ninjuddtechnomancy: when you get a minute, i have something i wanted to show you
14:43ninjuddtechnomancy: with regard to leiningen hooks
14:43BorkdudeIs there a guide somewhere how to upgrade an elpa installed swank-clojure to the next version?
14:45Borkdudebrb
14:46Borkdudemy swank-clojure-project doesn't work with a new lein project I just made
14:47BorkdudeEmacs just keeps polling and polling
14:47lancepantzBorkdude: swank-clojure is actually deprecated
14:47AWizzArdAnyone here who is pretty familiar with the (current) Java implementation of sorted maps and sets?
14:47lancepantzjust use lein swank, then slime-connect
14:48rseniortechnomancy: is there any xref setups needed for the slime-who-calls function to work with the latest swank?
14:48Borkdudeshould I manually add the swank dependency to my project.clj still?
14:49Borkdudeif I want to do lein swank
14:49BorkdudeJust did a lein upgrade fyi
14:50BorkdudeI mean, is there a reason why lein new doesn't add it automatically now?
14:52Borkdudelancepantz: I hope you mean swank-clojure-project
14:55Borkdudehmm, ok, I added it to my dev-dependencies. when I do slime-connect, I get: version differ (slime, swank), do you want to continue?
14:56Borkdudewhat is that about?
15:02lancepantzBorkdude: i get the same after upgrading in elpa, my guess it's because we're not using the master of lein-swank
15:04rseniorBorkdude and lancepantz I get that as well after the 1.2.1 upgrade
15:05Borkdudein elpa, if I want to upgrade something, like clojure-mode, can I just D the old one and I the new one?
15:07rseniornot sure if it's right or wrong, but I installed the new version, then later went in and removed the old
15:08lancepantzi have to mark it d, then execute, then package-list-packages again and install, but i use aquamacs which may be making it wonky
15:11technomancylancepantz: there's a bug in package.el that makes it a little awkward; it's fixed in my fork of package.el, but the upstream maintainer is a slacker
15:12lancepantzi see
15:13rseniortechnomancy: is there any additional setup needed to use slime-who-calls? beyond the regular slime/swank setup?
15:13Borkdudeah, also upgraded some other things now
15:13technomancyrsenior: shouldn't be
15:13rseniorI am getting a wrong-type-argument error from slime and am wondering if I'm doing something wrong
15:14rseniorlet me past the backtrace into gist real quick
15:14BorkdudeI upgraded slime also
15:14Borkdudebut it still complains about the versions
15:17rseniorunfortunately there's some crazy characters below the 5th line that gist doesn't like, so I removed them http://gist.github.com/409296
15:18Borkdudehow can I see which slime version I'm actually using?
15:27lancepantzdo you guys run clojure-mode in your slime repl?
15:27lancepantzwhen i enable it, enter is a line break instead of return
15:32nachtalphmm, could anybody give me a clue why this doesn't succeed in extracting values from a map given a vector of keys? http://www.pastie.org/971576
15:36rseniornachtalp: your code works for me
15:38Borkdudenachtalp: also works here
15:41nachtalprsenior, Borkdude: thanks, i just found out that it works for me in a fresh repl as well... strange, i thought i had my problem isolated...
15:47Borkdudestill no clue, what version differ means when I do slime-connect, it mentions a version nr that is different from my slime, if I did the upgrade correct, that is
15:52patrkrisrhickey: you there?
15:52rhickeyyes
15:53patrkrisrhickey: can I disturb you with a few questions about clojure's stm? :)
15:53rhickeymaybe
15:53rhickey:)
15:54patrkrisrhickey: thanks! just wanted to make sure I understand exactly why clojure's stm is obstruction-free. I have a theory and just want you to say yes or no to whether that (in part) makes it not-obstruciton-free.
15:54rhickeyit's not obstruction free
15:54Fossithat was an easy answer
15:55patrkrisrhickey: yes, I know. But I just wanted to make sure that I understand what makes it not obstruction-free.
15:55patrkrisrhickey: One reason is that writing setting a ref during a transaction takes a lock on the ref, yes?
15:56rhickeyall the locking and blocking are obstructions
15:56patrkrisrhickey: well maybe more generally that Clojure's STM employs locks, which may cause other transactions to block and retry (bail).
15:57patrkrisok yes
15:58patrkrisrhickey: well, thanks then :) I was just confused by the definition of obstruction-freedom and why clojure is not obstruction-free. I know I shouldn't be, but I'm born with a small brain.
16:02Borkdudedoes Clojure have a function that composes the or of two functions that take the same kind of args? like (or-comp f1 f2) => (fn [args] (or (f1 args) (f2 args)))?
16:02AWizzArdrhickey: Hi! I was looking for someone who is familiar with the implementations of sorted sets and maps, and just saw that you are here. Do you see an “easy way” to implement a mechanism to construct a sorted set/map much faster, by bypassing the sorting mechanism, when we can insert in already the correct order?
16:04rhickeyAWizzArd: the sorted sets/maps are red-black trees. any literature on building them from sorted might apply
16:07AWizzArdokay
16:26remleduffBorkdude: My attempt is (defn or-comp [args & fns] (let [f (apply juxt fns)] (some true? (f args)))) ;)
16:29Borkduderemleduff, is juxt lazy?
16:30BorkdudeI mean, is the result it returns a lazy seq, so it won't actually evaluate all the fns?
16:30remleduffNo, I don't think so
16:33remleduffOK, take 2 :). (defn or-comp [args & fns] (let [results (for [fn fns] (fn args))] (some true? results)))
16:35remleduffOK, take 2 :). (defn or-comp [args & fns] (let [results (for [fn fns] (fn args))] (some (complement nil?) results)))
16:35remleduffI wish there was a truthy? function
16:39Borkduderemleduff: how am I supposed to provde the args, in a vector?
16:39AWizzArdwhy not (some #(% arg1 arg2) [fn1 fn2 fn3 fn4]) ?
16:39AWizzArdinstead of or-comp
16:39Borkdudebrilliant
16:40remleduffBecause I was stuck in the "answering his question" mental space ;)
16:41BorkdudeAWizzArd: but can I make a version of or-comp, without specifying the args?
16:42Borkdude(defn or-comp [fns] (apply some #(% ...) fns))
16:42remleduffIf you're ok with putting multiple args in a vector or something, do that then do (apply fn args)
16:43BorkdudeI can do (comp f1 f2) without saying what the args of f1 and f2 are
16:43BorkdudeI should also be able to do this with or-comp
16:44bmasonI think I'm not understanding something about importing java classes...
16:44bmasonI searched jarvana for the class I want to use, I found the correct package and got that set up as a lein dependency
16:45AWizzArdyou can #(apply % args) or if you have not args you can use %&
16:45bmasonit's pulling the jar down into libs, but I'm still not able to (import 'classname) from clojure...
16:46AWizzArdbmason: do you do (import 'ClassName) or (import 'the.package.name.ClassName) ?
16:46bmason(import 'javax.mail.internet.MimeMultipart)
16:46AWizzArdWhat happens after you typed this?
16:46BorkdudeAWizzArd: how would you write comp-or then?
16:46remleduffAha: (defn or-comp [& fns] (fn [& args] (some #(apply % args) fns)))
16:47bmasonclass not found
16:47AWizzArdbmason: then this class is indeed not on your CP. Have a look at (System/getProperty "java.class.path")
16:47AWizzArdBorkdude: I would not write it, but what remleduff presented looks fine.
16:48BorkdudeAWizzArd: then I would still have to specify the args
16:48AWizzArdnot at the moment when you call or-comp
16:49AWizzArdwhat remleduff showed you is something that produces a fn
16:49bmasonAWizzArd: indeed, there is no mention of javax at all in my classpath
16:49AWizzArd(def your-or-fn (or-comp + - * /))
16:49AWizzArdAnd later you could (your-or-fn 10 20 30)
16:49bmasonAWizzArd: my project.clj has [javax/javaee-api "6.0"] under dependencies and it's successfully copying this from a repo to my libs folder...
16:50AWizzArdbmason: the expert for Leiningen is technomancy.
16:50BorkdudeAWizzArd: maybe I missed something but remleduff 's or-comp takes args as an argument
16:50bmasonAWizzArd: k :)
16:50clojurebothaskell is Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you don't compute.
16:51remleduffBorkdude: The anonymous function that is returned by or-comp takes args, you don't need them when just calling or-comp
16:51bmasonclojurebot is funny guy today
16:51technomancybmason: is there a javax/mail/internet/MimeMultipart.class inside one of the jars in the lib directory?
16:51AWizzArdAs I see it remleduffs or-comp takes fns
16:51AWizzArdnot args
16:51Borkdude remleduff: which version are we talking about, can you type it again?
16:51remleduff(defn or-comp [& fns] (fn [& args] (some #(apply % args) fns)))
16:52Borkdudeah ok I think I indeed missed that one... sorry!
16:52bmasontechnomancy: will check
16:52Borkdudethat version does indeed look fine, tnx remleduff and AWizzArd :)
16:53bmasontechnomancy: yes, that path exists inside the jar "java-api-6.0.jar" which is in my lib directory
16:55bmasontechnomancy: ok, I may not have properly reloaded the environment... now I get "Absent Code attribute in method that is not native or abstract in class file javax/mail/internet/MimeMultipart" when I do (import 'javax.mail.internet.MimeMultipart)
16:56bmasonwhich I think means I'm missing a dependency...
16:56AWizzArdAfter the import, when you just type MimeMultipart in the repl it should return javax.mail.internet.MimeMultipart if the import worked.
16:57bmasonyeah, the import is throwing an exception though... have to fix that first
16:58bmasontechnomancy: incidentally, is there a way to restart swank/slime with 1 command? right now adding a dependency is a multiple step process for me
16:59AWizzArdmaybe javax.mail needs this support class? I don't remember it, on my system I can import that Multipart class
17:00bmasonAWizzArd: http://dominikdorn.com/2010/05/maven-junit-classformaterror-absent-code-attribute/
17:00sexpbot"Maven + JUnit + ClassFormatError: Absent Code attribute in method that is not native or abstract in class file | dominikdorn.com"
17:00drewrurg
17:00danlarkinugh is right
17:01danlarkinno one likes those stupid link titles
17:01AWizzArdjust /ignore sexpbot then ;)
17:02bmasonok... now adding javax/mail as a dep, I still get the absent code attribute error
17:02bmasonhow do I figure out what it needs?
17:03remleduffjavax/mail or javax.mail/mail ?
17:04bmason[javax.mail/mail "1.4.1"]
17:05bmasonit seems like voodoo magic to find the dependency with an error message like that
17:06remleduffDoes java -verbose help at all?
17:07bmasonhmm... how would I use that in context of a slime repl?
17:08remleduffI think you can do JAVA_OPTS=-verbose before you do lein swank
17:08remleduffIt may not be any help at all though
17:10bmasonremleduff: you mean like this? http://www.javalobby.org/java/forums/t76635.html
17:10sexpbot"Overwrite java parameters with environment variables or other mechanism???"
17:11bmasontechnomancy: does swank use the JAVA_OPTS variable when it starts the clojure repl?
17:12bmasonthat's great if it does... that would help me attach a JSwat session to it :)
17:12technomancyit does
17:12bmasonSWEET
17:13bmasonnoted :)
17:13technomancyyou can also set :java-opts in project.clj if you want them to apply to everyone using your project
17:13technomancybut it forces the JVM to fork, so you pay a perf price
17:14bmasonoh, that's good to know
17:20bmasonok, so now I'm trying (import 'javax.mail.Multipart) and I get the absent code attribute error here as well
17:21bmasonweird thing is, I thought that message had to do with a superclass not being imported... javax.mail.Multipart derives directly from java.lang.Object
17:29remleduffDid you restart swank after you added javax.mail to your project?
17:29remleduffbmason: ^^
17:30bmasonI'm sure I... lemme double check :)
17:31bmasonremleduff: yeah, that's not the issue
17:32bmasonI'm reading up more about what the error actually means
17:32remleduffPossibly, the problem is that javax.mail needs to be loaded _before_ javaee-api
17:33remleduffBut lein I think just looks at the order the jar files are in your lib directory when adding them to the classpath
17:34remleduffSo try renaming mail-1.4.1.jar to something like 00mail-1.4.1.jar to see if it helps
17:35bmasonok, I think the issue may be the jar I got
17:35bmasonapparently there are some jars floating around in MVN repos that only have the API stubbed out, with no implementation: http://weblogs.java.net/blog/ludo/archive/2007/01/java_ee_5_apis.html
17:35sexpbot"Java EE 5 APIs now in a Maven repository... | Java.net"
17:35remleduffThat's not confusing
17:35bmasonoh no, not at all
17:36bmasonand it's its not like I've wasted several days trying to figure it out either
17:36bmasonnor am I bitter... moving on :)
17:36remleduffhaha
17:37bmasonI guess I need to find out what the correct jars are then
17:37bmasonhttp://jarvana.com/jarvana/search?search_type=class&amp;java_class=javax.mail.internet.MimeMultipart
17:37sexpbot"javax.mail.internet.MimeMultipart - Class Search - Jarvana"
17:37bmasonpretty big list to go through, and I'm not familiar with java conventions
17:38danlarkinI hate you sexpbot!!!!!
17:39bmasonwhat was the point of those titles?
17:39bmasonjust to give people context on links?
17:39AWizzArdbmason: you should ask Raynes (:
17:39bmason:D
17:40remleduffbmason: The way I read it, those classes are provided by whatever application server your service runs in
17:40remleduffThe jars you have are just stubs to allow it to compile, you can't actually use it outside of something like glassFish or BEA Weblogic
17:41bmasonremleduff: that makes sense I suppose... but I need something to do development with
17:42bmasonso the question is where do I find a complete implementation
17:43bmasonanyone know what "plugin" means in the context of maven repos?
17:43bmasonall the jetty stuff has plugin icons next to it... maybe that means it's a full implementation
17:51remleduffActually, I think javax.mail is a complete implementation. It's the javaee-api that is stubs
17:51remleduffBut you probably actually have to run a web server and deploy to it to do testing
17:51bmasonsweet
17:51bmasonyeah I got it
17:52remleduffWhat did you do, remove javaee-api entirely?
17:52bmasonjavax.mail has what I need, but the javaee-api stubs were overriding them
17:52bmasonyeah, I just removed javaee-api
17:53remleduffThis is why "enterprise Java" has always seemed like such a strange goal to strive for to me ;)
17:53bmason:-D
17:54bmasonyeah... I plan to get more into Java
17:54bmasoneasy way to get a day job, and it will have fringe benefits for my clojure programming
17:55bmasoncus yeah... things are a little rough around the edges
18:11defn,(ns-publics 'clojure.core)
18:11defn,(+ 1 2)
18:11lancepantzrejected.
18:11defnnah, i submitted an issue on this earlier today but hiredman just closed it with no comment
18:11defnhis bot, i guess
18:12lancepantz,(println "hi")
18:12defnit'll come back in about 5min or so
18:12lancepantzns-publics crashes it?
18:12lancepantzatleast it doesn't barf a bunch of exceptions to the channel :)
18:12defnnah, not a crash, just very slow to return for some odd reason
18:12lancepantzhmm
18:15defnany second now...
18:19clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, val #'clojure.core/val, chunked-seq? #'clojure.core/chunked-seq?, find-protocol-impl #'clojure.core/find-protocol-impl, vector-of #'clojure.core/vector-of, object-array #'clojure.core/object-array, *compile-path* #'clojure.core/*compile-path*, max-key #'clojure.core/max-key, lis
18:19clojurebothi
18:19clojurebot3
18:27scottjWhat's required to make a runnable jar with lein? I mean, do you create a -main function, lein jar, and then java -cp foo.jar what-class-goes-here?
18:28AWizzArdscottj: read about jar files, specifically the manifest file
18:28AWizzArdwhen you mention the right main class there you can simply do java -jar foo.jar
18:28AWizzArdor doubleclick the .jar
18:31technomancyscottj: set the ns containing the -main function as :main in project.clj, then do lein uberjar
18:31defnscottj: also note that you want to use the standalone.jar
18:31defnsince it includes clojure
18:32Raynesbmason: Indeed, to give context on those links. sexpbot has pretty sophisticated url scraping, in order to make it suitable for channels like this one. It doesn't follow github or paste links and such.
18:34Raynesdanlarkin: He's pretty fond of you. You've broken his heart.
18:34bmasonlol
18:34sexpbotdanlarkin: </3 :(
18:34stribbhi there
18:35stribbI'm still very much learning my way around clojure.core and wondered if you were willing to critique this line? I want it to be idiomatic (and ideally shorter)
18:35stribbhttp://pastebin.org/262500
18:37stribbthat is, (apply str (cons \newline (flatten (interpose \+(repeat 3 (repeat (* width 3) \-)))))
18:38Raynes$(apply str (cons \newline (flatten (interpose \+(repeat 3 (repeat (* width 3) \-)))))
18:38sexpbotEOF while reading
18:38Raynes$(apply str (cons \newline (flatten (interpose \+(repeat 3 (repeat (* width 3) \-))))))
18:38sexpbotDENIED!
18:38stribboops, maybe add another right paren
18:39RaynesProbably width.
18:39Raynes$(apply str (cons \newline (flatten (interpose \+(repeat 3 (repeat (* 5 3) \-))))))
18:39sexpbot=> "\n---------------+---------------+---------------"
18:39RaynesYep.
18:40stribbto my eyes it's so full of lispisms that it hides the meaning. apply, flatten, cons are obscuring the thing I'm trying to show
18:41stribbI'm translating http://norvig.com/sudoku.html and here's the relevant line in Python
18:41sexpbot"Solving Every Sudoku Puzzle"
18:41stribb line = '\n' + '+'.join(['-'*(width*3)]*3)
18:41danlarkinsexpbot: your html parsing is so impressive
18:42joshua-choiQuestion: Is there a function for forcing a lazy sequence to fully evaluate? (I need to do this because resolve uses a re-bind-ed var.)
18:42moshisushiit's not possible to do pattern matchin (out-of-the-box, that is) in clojure, right?
18:42Raynesdanlarkin: When I said sophisticated, I was referring to the blacklisting. :p
18:43joshua-choimoshisushi: Clojure has support for Java's regular expressions. The literal syntax is #"...".
18:43RaynesI need to get around to writing in something that checks the title and URL for similarities, in case of redundant titles.
18:43remleduffjoshua-choi: doall ?
18:44joshua-choiremleduff: Eh. I need the whole evaluated sequence, not to do some side effect.
18:44moshisushijoshua-choi: hum.. i mean pattern matching as in Haskell / ML
18:44pjstadig~meap
18:44clojurebotManning missed the opportunity to call it Manning Early Access Trial
18:44joshua-choimoshisushi: Ah. Don't know as much about that. Clojure does have destructuring in let and let-like forms, though.
18:46joshua-choiremleduff: I am super frustrated, because I found that the source of a bug I've been searching for the past four hours is because 1. map is lazy and 2. resolve uses *ns*. If you have (map resolve vars) in one namespace and happen to evaluate the sequence in another, you will get a lot of strange NullPointerExceptions. :(
18:46remleduffdoall is intended to do that, it returns the fully realized sequence
18:46Raynes$learn meap http://www.manning.com/fogus/
18:46sexpbotMy memory is more powerful than M-x butterfly. I wont forget it.
18:47joshua-choiremleduff: Oh, does it? Excellent. I confused it with doseq.
18:47joshua-choiI'm still seething about that bug though
18:47remleduffYeah, a lot of people have been caught by map and for being lazy
18:47remleduffWorth it in the end though
18:48Borkdudemaybe it should be called smth with "force"
18:48Borkdudeit's the first thing I would search for
18:48Borkdudeforce-all
18:49joshua-choiremleduff: No, I don't have a problem at all with lazy map; I love it. My problem is much more with binding-context-sensitive resolve. Functions that depend on variables are a huge source of accidental complexity in Clojure. :(
18:49joshua-choiOh well, I'm just glad I figured it out. :)
18:49joshua-choi(And when I say "functions that depend on variables", I mean mutable variables to be bound.)
18:50remleduffYeah, I think binding is my current uncertainty with clojure
18:51remleduffYour other option if you had wanted to keep laziness is to do (let [*ns* *ns*] (map... etc))
18:52joshua-choiYeah. I'm thinking that I probably want to not use resolve at all if I can help it
18:52remleduffBorkdude: force is already with delay (which I've not used yet)
18:54duncanmhmm, i'm running jvisualvm on a batch job that i wrote in clojure
18:54duncanmthe loaded class count just keeps going up and up
18:54duncanmis that a good thing? bad thing?
18:54remleduffDo you use "eval" a lot?
18:55remleduffIf the class count goes up and not down, you can run out of PermGen
18:55clojurebotAOT genclass is http://paste.lisp.org/display/70665 and http://clojure-log.n01se.net/date/2008-11-18.html#14:19
18:55stribbbah, I hate my broadband
18:55duncanmremleduff: i don't use any eval
18:55Borkduderemleduff: that's true, but there is some similarity between lazy seq and delay/force maybe?
18:56BorkdudeI only just read about it
18:56remleduffgotta run, later all, happy weekend :)
18:56duncanmhmm
18:56Borkdudeok bye remleduff
19:01danlarkin$((fn this [] (try :foo (finally (this)))))
19:01sexpbotExecution Timed Out!
19:02pjstadig$meap
19:02sexpbotCommand not found. No entiendo lo que estás diciendo.
19:02pjstadig$recall meap
19:02sexpbotCommand not found. No entiendo lo que estás diciendo.
19:02danlarkin((fn this [] (try :foo (finally (this)))))
19:02danlarkin((fn this [] (try :foo (finally (this)))))
19:03danlarkin$((fn this [] (try :foo (finally (this)))))
19:03danlarkin$((fn this [] (try :foo (finally (this)))))
19:03danlarkin$((fn this [] (try :foo (finally (this)))))
19:03danlarkin$((fn this [] (try :foo (finally (this)))))
19:03sexpbotExecution Timed Out!
19:03sexpbotExecution Timed Out!
19:03sexpbotExecution Timed Out!
19:03sexpbotExecution Timed Out!
19:04KirinDave...
19:05KirinDavepoor sexpbot
19:05RaynesHe's spammed it in PM, and got it stuck in a loop.
19:05danlarkinpoor us to have to suffer its link titling!
19:05RaynesEh?
19:05stribbok, cheerio chaps
19:06RaynesMore people like it or don't mind it than people dislike it.
19:07pjstadigi think the link titling is a bit spamish
19:07RaynesHow so?
19:07bmasonRaynes: or they just don't want to hurt sexpbot's feelings
19:07RaynesNot nearly enough links are posted in here, and the titles aren't nearly long enough to be "spamish".
19:07pjstadigif i want to see a title, i will click on the link
19:08pjstadigusually there is enough context when someone posts a link to know what it is about
19:08Borkdudeas long as it's not doing ads, I'm find with the titles... and it saves me a click if the title doesn't sound interesting to me
19:08RaynesIf people want it off, I'll happily turn it off, but several people have told me it's useful in here, and that's why it's on.
19:08AWizzArdyou can just /ignore the bot
19:08RaynesIf rhickey wants it off, I'll turn it off. I'm not unfair.
19:08bmason:-)
19:08pjstadigpeople want it off
19:08RaynesIt just doesn't seem to bother anyone. :\
19:08RaynesUntil now anyway.
19:09Raynespjstadig: I mean more than two.
19:09RaynesOr Rich. Rich is more than two.
19:09pjstadighow many?
19:09RaynesIn a poll, the person with the most votes wins.
19:09pjstadigwe'll get a petition
19:09bmasonlol
19:09RaynesGo for it.
19:09scgilardipolling is not idiomatic in clojure
19:10BorkdudeRaynes: why don't you make $upvote title, when it's positive, the titles appear ;)
19:10pjstadigfirst you have to tell me how many we need to get
19:10Borkdudeand of course $downvote title
19:10bmasonmaybe it will be a lazy poll
19:10Raynespjstadig: 15-20. Even chouser said he doesn't mind it/hasn't formed an opinion.
19:10RaynesYou aren't actually going to start a petition, are you?
19:11duncanmi know how to write Scheme macros, but i don't know them in Clojure
19:11duncanmi'm tyring to write a macro so that (write some-form-here) expands into (.add writer some-form-here)
19:11bmason(defmacro name form)
19:11bmason,(doc defmacro)
19:11clojurebot"([name doc-string? attr-map? [params*] body] [name doc-string? attr-map? ([params*] body) + attr-map?]); Like defn, but the resulting function name is declared as a macro and will be used as a macro by the compiler when it is called."
19:11duncanmi tried macroexpanding to test, how do i make sure i get the binding of 'writer' correctly?
19:12duncanmi want it to bind to the local binding of 'writer', not some global binding
19:12zakwilsonThe docs for defmacro are not very helpful for someone not familiar with CL-style macros.
19:12bmasonis writer a stream?
19:12pjstadigi'm not sure we need two bots in here
19:12pjstadigmaybe we should have a bot cage fight
19:12RaynesI'll also point out that clojurebot has some rather random comments sometimes. At least sexpbot's are useful to /some/ people. ;)
19:13duncanmbmason: it's an XMLEventWriter
19:13Raynessexpbot has been here for like 2 months. :\
19:13pjstadigso you're saying that clojurebot's comments are not useful to anyone?
19:13Borkdudeduncanm: (defmacro dude [w f] `(.add ~w ~@ f)) ?
19:14Borkdudesorry, no space between ~@ and f
19:14Raynespjstadig: I'm talking about the comments that aren't invoked purposely. clojurebot says stuff when people say certain things. If we're going to have this conversation, come to #clojure-casual so we stop disrupting conversation here. :(
19:14bmasonyeah, Borkdude's suggestion would work if you want to provide the writer as an argument
19:14duncanmBorkdude: i don't want to explicitly pass the 'w'
19:15duncanmbmason: i have (let [writer ..., write #(.add writer %)] ...) in my code right now
19:15duncanmand i think that #(...) is generating a lot of unnecessary code, cuz this is being called inside a loop
19:15bmasonso you're saying a var bound in the surrounding context isn't available?
19:15danlarkinno dudes come to #clojure-awesome
19:15danlarkinit's way better
19:16AWizzArdduncanm: btw, you can add a type hint there
19:16duncanmAWizzArd: but that same Fn will still get generated every time, right?
19:16bmasonoh, well "let" doesn't do a binding... that may be your problem
19:16AWizzArdyes
19:17Raynesdanlarkin: Thanks for clojure-json by the way. sexpbot uses it all over the place. <3
19:17Borkdudewasn't &env invented for this problem?
19:19bmasondanlarkin: might be easier to see what you're doing with a full example
19:20hiredman~foo
19:20clojurebotfoo is is Short, Self Contained, Correct (Compilable), Example http://sscce.org/
19:24remleduff$eval *ns*
19:24sexpbotDENIED!
19:24RaynesI hate that "Hey, you can't change your nick until you identify" but you can't identify until you change your nick.
19:26remleduffjoshua-choi: I think I lied earlier about (let [*ns* *ns*]...) actually doing anything you'd want
19:28remleduffThat's fine if you're using *ns* locally, but wouldn't have any effect when calling resolve
19:49kencauseyI don't suppose anyone has any idea if it is possible to run a clojure/compojure app under GoDaddy basic web hosting? The mention Java in some places, JSP in others, I'm not much of a Java guru and am not clear on whether I would be able to run a clojure app in the environment. Anyone have any experience here?
19:54lancepantzkencausey: http://help.godaddy.com/article/67
19:54sexpbot"Can I deploy my application using a war file? - Search the Go Daddy Help Center"
19:55lancepantzlooks like you better have it how you want it at 1am, messed up
19:58kencauseythanks, am I safe in assuming they have new enough versions for it to work? they tend to lag a bit
20:00lancepantzyeah, build a war file that complies with the servlet spec and it shouldn't be a problem
20:01lancepantzi have a basic example with compojure 0.4 on github, http://github.com/lancepantz/lein-war-example
20:01kencauseyok, thanks
20:25_brian2_noob question> Hi , I'm trying to grok the relationship between handlers and routes in compojure, ( http://clojure.pastebin.com/rijB4Fag ) according to the author the new compojure defers handlers to Ring, but uses routes, which do more or less the same thing, (returning a response map), however as far as I can tell, you cant call a handler function in a route
20:41joshua-choiremleduff: Yeah, I figured as much. I would really like someone close to Hickey to write how binding's large disadvantages don't outweigh whatever advantages it does give. But now I think I'll watch out for this error better.
20:58remleduff_brian2_: Which are you calling a handler and which are you calling a route?
20:59_brian2_on the pastebin, app is the handler, and defroutes are routes, as I undersand it
21:02remleduffhandlers take a request map, and return a response map. defroutes, returns a handler. The route macros return various things and has a multimethod that can format it into a response map, but they don't use straight ring maps
21:03remleduffYou could wrap! your routes with app though in your example
21:04remleduffBut you'd only get hello world after that ;0
21:04remleduffThere's a #compojure channel as well
21:04_brian2_oh, cool!
21:09_brian2_remleduff : at first, (I probably need to read more about the request map), but I just want to send user input into a database retrieval function
21:10_brian2_Its just 10 categories of finite responses I was going to use routes, but thats probably not the best way
21:10_brian2_?
21:10remleduffRing works by having a list of handlers, they each get a shot at the request map and return a response map if they want to handle it
21:10remleduffdefroutes abstracts that, the (GET) macro returns a handler
21:13_brian2_ok, but like (GET "/" [] app) ; where 'app' is handler compojure doesn't seem to like this
21:14remleduffGET creates handlers
21:14remleduffIt doesn't call them
21:14_brian2_ok
21:16_brian2_so I can call a an ordinary function (GET "/" [] funct[state1] ) ?
21:17_brian2_that returns some renedring?
21:17_brian2_rendering
21:17remleduffYep
21:18_brian2_oh, ok. Thanks!
21:19_brian2_remleduff : thank you
22:11lancepantzalexyk: jiraph is now using lein and on clojars
22:16remleduffDo you know of a good tutorial about graph databases, including when you'd want to use one?
22:18alexyklancepantz: awesome! you guys won
22:19alexykt believe which other functional language supports tokyo cabinet and google protocol buffers too
22:19alexyk:)
22:20lancepantzremleduff: ignoring the implementation, http://neo4j.org/doc/ has some good resources
22:20sexpbot"neo4j open source nosql graph database » Documentation"
22:20alexyklancepantz: I was thinking of using the interoperable format to speed up huge walks, and looked for a compiled language with both bindings
22:20alexykalas ocaml has neither
22:20lancepantzremleduff: this one is informative http://dist.neo4j.org/neo-technology-introduction.pdf
22:21alexykbut some language git them :)
22:21alexykgot them
22:21lancepantzremleduff: note that jiraph has different pros and cons than neo4j, namely that it does not support transactions and is roughly 10x faster than the benchmarks published
22:22alexykjiraph rocks
22:22remleduffThanks :)
22:22lancepantzalexyk: c++ :)
22:22alexyklancepantz: well, that's like an assembly... FP!
22:23alexyksome formidable and glorious language!
22:23alexykto which we all aspire to
22:23lancepantzhahaha
22:23alexykwhen we're not going drinking
22:23alexykok it's Haskell
22:23alexykand it just got an LLVM back end which makes it numerically beat C
22:24alexykso I'll need to teach Haskell to read map and set extensions and then it'll eat jiraphs for breakfast
22:24alexykfirst I need to learn it though :)
22:24alexykI like interop
22:25lancepantzalexyk: it has tc and protobuf support?
22:25alexyklancepantz: yep!
22:25alexykhttp://hackage.haskell.org/package/tokyocabinet-haskell
22:25alexykhttp://hackage.haskell.org/package/protocol-buffers
22:26alexykthe protobufs understand extensions, but I guess I need to teach it what map and set are
22:27alexyklancepantz: so I guess geni will run on HAppS stack soon :)
22:27alexykand be hosted at patch-tag.com :)
22:28lancepantzhahaha
22:28lancepantzhaskell just looks like gobldey gook to me
22:34alexykbut, liebke joined! :)
23:04riddochcOpinions requested: which of the editors with Clojure support *least* requires the use of a keyboard?
23:07riddochcI tried emacs again yesterday for the first time in a few years, and it just isn't very accessible for someone who's mostly limited to using pointer-based interfaces.
23:11riddochcOh, well. Trying netbeans+enclojure now...
23:17bmasonif I have a java object with methods getCount and getPart(n) is there an idiomatic way to convert the parts to a sequence?
23:19bmasone.g. in java it would be for (i = 0; i < obj.getCount(); i++) {obj.getPart(i);}
23:19bmasonI'd prefer not to have to iterate a variable, but it looks like that's the interface I'm given...
23:20riddochcbmason: I'd probably make loop/recur returning a lazy-seq, given the lack of any other iterator over your collection.
23:21bmasonk
23:28riddochcAlternatively... hm. you could (map #(.getPart %) (range ...))
23:29riddochcOr something similar, mapping over the seq of numbers up to .getCount.
23:55bmasonriddochc: I like that