#clojure logs

2010-04-18

00:01_brian2_hi, i am trying to grok the enlive tutorial better, have question about selectors , ie how this works: http://clojure.pastebin.com/5v4GKYUE
00:07falconair[newbie] hi, i started the repl through "lein repl" for a project that has clojure-contrib as a dependency, but (doc create-server) gives "Unable to resolve var" error
00:07falconairI also tried (doc clojure-contrib/create-server), same thing...how can i resolve this?
00:09schemer999is compojure the most developed clojure web framework?
00:10_brian2_schemer999> you might want to look at enlive and the enlive tutorial, which is built on top of compojure
00:11schemer999_brian2_: thanks, i'll look into that.
00:12_atofalconair: what
00:12_atos
00:12_atocreate-server
00:12_atooh right, server-sock
00:12falconair_ato create-server is a function in clojure-contrib (http://richhickey.github.com/clojure-contrib/server-socket-api.html)
00:12_atoyou first need to require/use it:
00:13_ato(use 'clojure.contrib.server-socket)
00:13falconairi tried (use clojure-contrib)
00:13_brian2_you need '
00:14falconairhm...just tried (use 'clojure-contrib.server-socket) and it told me "Could not locate clojure_contrib/server_socket_init.class or ...)
00:14_atonot dash
00:14_ato.
00:14_atoclojure.contrib
00:15schemer999i'm getting ready to start a slightly involved web app. def don't want to use php again. rails looks interesting, but clojure looks fun.
00:15falconair_ato: so I need to use ' for repl but not when i am writing in a clj file?
00:15_atoyou need to use ' when you just do a bare (use '...). You don't need it when you're putting a (:use ...) inside an (ns ...)
00:16falconair_ato, hm...ok, thanks
00:17_brian2_<schemer999> i'm not an expert, but compojure is based om sinatra (ruby)which is a much simplified web framework
00:17_brian2_easier to prototype
00:20_atofalconair: it's because bare (use ...) is a function while (ns ...) is a macro. The whole import thing often comes up as one of the messier parts of Clojure, there's been a lot of talk of simplifying it, but it's a tricky issue
00:21falconair_ato...so if I had to call (use (clojure.blash)), then I understand needing a tick to tell clojure that (clojure.blah) is not a function, but why do I need a tick when clojure.contrib... is clearly an argument to use?
00:22falconairI don't have to do (+ '1 '2) afterall
00:23_atonumbers evaluate to themselves
00:23_ato,1
00:23clojurebot1
00:23_atosymbols don't
00:23_ato,blagh
00:23clojurebotjava.lang.Exception: Unable to resolve symbol: blagh in this context
00:23_ato,'blagh
00:23clojurebotblagh
00:23_atoso they need to be quoted when you pass them to a function
00:24falconair_ato..hm...ok, i'm starting my first project, hopefully i'll get over these basics soon :)
00:28defnwas clojure.lang.ArrayStream deprecated with 1.2?
00:36defnjava.lang.ClassNotFoundException: clojure.lang.ArrayStream (safe_fns.clj:124)
00:36hiredmanthe Stream stuff was an idea rich was working, but never was used anywhere as far as I know, so if it dispeared I would not be surprised
00:36defnhiredman: okay, thanks
00:39technomancydefn: http://www.assembla.com/spaces/clojure/tickets/247-remove-clojure-lang-stream-streamable-and-all-uses
00:39sexpbot"#247 - Remove clojure.lang.Stream/Streamable and all uses (Fixed) | Clojure | Assembla"
00:46defntechnomancy: thanks -- i was going to try to go to 1.2 with my project, but it looks like too many deps will break
00:47defnjava.io.FileNotFoundException: Could not locate clojure/contrib/java_utils__init.class or clojure/contrib/java_utils.clj on classpath: (core.clj:9) --- Looks like this is Ring's fault
00:48cemerickdefn: I just pushed a 1.2-compatible changeset to my compojure fork FWIW
00:49cemerick0.3.2 though, not 0.4.0
00:49defncemerick: thanks i found sergey miryanov made a 1.2.0 compat version
00:49cemericksheesh, right
00:50technomancynever heard of anyone actually trying to use streams =)
00:51cemerickIt seems like lazy seqs are streams++, IIUC
00:51cemerickNever used streams myself either.
00:59defnman i cannot figure out where this include of java-utils is coming from
01:51ynIs there a place where I can download all clojure docs (reference, clojure api, clojure-contrib api) in one large archive? Can't find it through google, and want to make sure before I start running a big wget job
02:07nipra_yn, I don't think so it's available as a tarball. Clojure and contrib API docs are available at http://github.com/richhickey/clojure/tree/gh-pages and http://github.com/richhickey/clojure-contrib/tree/gh-pages respectively.
02:10defnyn: use autodoc
02:11defnif you grab the autodoc source i think you'll be able to build all of the API docs for c.contrib and core without any wgetting
02:23ynanyone here?
02:27Hali_303hi!
02:28Hali_303is there a safe parse-integer function in some namespace? I mean if Integer/parseInt throws exception it returns nil
02:29tomojseems doubtful
02:30tomojwell, perhaps in some namespace, but not in core or contrib, afaik
02:32Hali_303tomoj: ok, thanks
02:37tomojHali_303: I'm not actually sure, but people have asked for a clojure version of Integer/parseInt before only to be told to just use Integer/parseInt, which suggests that you'll have to write it yourself
02:38Hali_303I did already, just curious if there is an official one
02:42falconairis there a good vim syntax file for clojure, i know there is vimclojure that does all kinds of fancy stuff, but i'd like to start with just a syntax file
02:46cheezeymm... so im so lost on that lazy seq thing =_=
02:46defncheezey: that one takes a little bit to wrap your brain around :)
02:46bozhidartomoj: it's useless to wrap stuff like Inteter/parseInt imo
02:47bozhidarafter all one of clojure's core ideas is not to fix parts of java that aren't broken
02:47cheezeydefn: is there a good tutorial? im just trying to use the string library from clojure-contrib but it returns a lazy seq instead of a string and im like ... blahhhh
02:49defncheezey: oh, well, that might not be as hard to work with as you think
02:49defncheezey: what are you trying to accomplish
02:50cheezeyuse (take n s) and actually get a string :p
02:50cheezeyalthough i'd still like to learn about lazy seqs so .. :\
02:51defncheezey: you want to be lazy
02:51cheezeyi know about lazy evaluations. is that all it is?
02:52defnbasically yea, it just is a sequence which is evaluated lazily
02:54cheezeyright. so what is the thing returned? why is it a sequence?
02:55defncheezey: if you have a specific example of some code and an objective that'd be helpful
02:55tomojbozhidar: sure, unless you want it not to throw an exception :)
02:55defn,(+ 1 2)
02:55clojurebot3
02:55defnyou can evaluate code using clojurebot by prefixing a , to your expression
02:55cheezey,(take 2 "asdf")
02:55clojurebot(\a \s)
02:55cheezeythat was my earlier code
02:58tomoj,(doc subs)
02:58clojurebot"([s start] [s start end]); Returns the substring of s beginning at start inclusive, and ending at end (defaults to length of string), exclusive."
02:58tomojperhaps?
02:58defn,(apply str (take 2 "asdf"))
02:58clojurebot"as"
02:58bozhidartomoj: you're right, many time i've wished that this particular method simply returned null on bad output(although this is rarely a good idea) :-)
02:59tomojhmm, why does subs exist?
02:59bozhidars/output/input/
02:59tomojjava.lang.String/substring is perfectly good, after all :P
02:59defn,(subs "asdf" 0 1)
02:59clojurebot"a"
02:59defn,(subs "asdf" 0 2)
02:59clojurebot"as"
02:59tomojer, hmm.. I wonder what the java convention for denoting instance methods is
03:00cheezeyumm... so which would be better to use :o
03:01cheezeyor i could just use java's string methods
03:01bozhidartomoj: denoting in which sense?
03:03defncheezey: i suggest using clojure, but it is up to you
03:03tomojbozhidar: I mean, if I want to refer to the substring method in java.lang.String, what do I write?
03:04tomojjava.lang.String/substring looks like a clojurian talking about a class method
03:13cemerick,(.substring "asdf" 0 2)
03:13clojurebot"as"
03:24defni prefer clojurist! :)
04:01defnis there any way to use old clojure.contrib and new clojure.contrib (1.2) stuff together?
04:17_atoxgnu
04:37defn_ato: ?
04:43_msta missed alt key in an attempt to start gnus? :)
04:49_atoyep
04:50_atoI really need to bind that
05:00_mstfunny how you can recognise the typos you make yourself...
05:38LauJensen~seen etate
05:38clojurebotetate was last seen quiting IRC, 28918 minutes ago
06:31BorkdudeCan I evaluate in a clj file in emacs slime mode and have the result inserted in my file directly ?
06:38tcrayfordyes
06:38tcrayfordI have something like that setup somewhere in my emacs
06:39tcrayfordthe function you're looking for is 'slime-eval-print-last-expression
06:42Borkdudeah tnx
06:42Borkdudeit's not bound to a key by default I guess?
06:45Borkdudeanyway, this is what I searched for, tnx a lot!
06:46tcrayfordyeah its not bound to anything by default
06:46tcrayfordyou can learn a lot about slime just by doing apropos "slime"
06:48tcrayforddoes anybody know the syntax for using :only inside of ns declarations
06:48tcrayford?
06:49BorkdudeWhy is eval defun called eval defun? A top level element is not nec. a defun?
06:50tcrayfordhold over from common lisp
06:50tcrayfordI think
06:50Borkdudein common lisp top level elts are neither always defuns
06:50tcrayfordfrom the guys who originally wrote slime anyway
06:53tomojtcrayford: (:use [foo.bar :only (baz)]) should work
06:53LauJensenchouser: I really liked your last blogpost, but I found a redundant comment which you might as well remove "It's not obivous from the error message, [whats going on]"
06:53tcrayfordtomoj: I had to give that up because the thing I want to import is private
06:53tomojah
06:53tcrayford:(
07:49nurGood morning.
07:50AWizzArdGood afternoon nur.
08:02cYmenSomewhere in labrepl the missed telling me what the % in (filter #(.contains % "root") words) does.
08:04tomojcYmen: are you asking, or just noting the flaw?
08:06cYmentomoj: both :)
08:07tcrayfordit is an argument to the anonymous function made by #()
08:07tcrayfordyou can write that fn as (fn [thing] (.contains thing "root"))
08:07tomoj#(foo %) and #(foo %1) are abbreviations for (fn [x] (foo x))
08:08tomoj(though those are both silly...)
08:09tcrayfordman I wish emacs' stringp would tell me what I passed to it that throws an error
08:10tomoj"wrong argument type stringp" or something?
08:10tcrayfordyeah
08:11tcrayfordI can't see why its wanting a string for this, when I'm obviously sending it data (that should be a list)
08:12tomojode
08:12tomojoops
08:16defntcrayford: thanks for the slime-eval-print-last-expression -- ive been meaning to make something like that myself
08:16defntcrayford: how about a function which lets you take the most recent sexp evaluated in the repl and insert at your point in an open file?
08:17cYmenWhat's the clojure equivalent of a python dictionary?
08:18tcrayfordCymen: a map
08:18tcrayforddefn: there isn't anything like that in slime
08:18tcrayforddefn: although I've been meaning to make one
08:19defn,(:a {:a 1 :b 2})
08:19clojurebot1
08:19defn,({:a 1 :b 2} :a)
08:19clojurebot1
08:19cYmendefn: Can I make one that has a default value?
08:20cYmen,(set {} a 3)
08:20clojurebotjava.lang.Exception: Unable to resolve symbol: a in this context
08:20cYmen,(set {} \a 3)
08:20clojurebotjava.lang.IllegalArgumentException: Wrong number of args passed to: core$set
08:20cYmenI should be trying crap like that somewhere else. :P
08:20defncYmen: im firing up my repl for that reason :)
08:20tcrayfordif you use emacs, you can have a repl in IRC that nobody else can see
08:20tcrayfordwop
08:21cYmenI'm trying to do that "write your own 'frequencies' function using reduce" exercise from labrepl...
08:21tcrayfordyou want assoc
08:21tcrayford,(assoc {} :a 1)
08:21clojurebot{:a 1}
08:21tcrayfordnote that that returns a new map, and doesn't modify the old one (immutable data, harf)
08:21defncYmen: you definitely want assoc, but you can do:
08:22defn,(into {:a 1} {:b 2})
08:22clojurebot{:a 1, :b 2}
08:22defnjust a for example, not necessarily specific to your problem...
08:26defn,(let [{a 1, b 2} (take 4 (iterate inc 1))] [a b])
08:26clojurebot[nil nil]
08:27defnweird -- i got [2, nil] somehow -- maybe my version of clojure?
08:46tomojr
08:46tomojdammit, I need to turn off click-to-focus
08:49defnis there any way to do (doc ~) and be referred to documentation for it?
08:54cYmenWhat's your preferred paste tool?
08:54bozhidarcYmen: gist & lisppaste
08:55bozhidarI prefer lisppaste for irc channel having the lisppaste bot
08:55bozhidarotherwise gist
08:55bozhidarboth have great Emacs integration which is very important
08:55bozhidarat least to me...
08:56cYmenI'm trying not to use emacs.
08:58cYmenThis is what I tried for writing my own frequencies function:
08:58cYmenhttp://gist.github.com/370211
08:58cYmenSomething is wrong with the let but I don't see it...
09:03mfexthe let form should be with brackets: (let [a 1 b 2] (+ a b))
09:03cYmenoh
09:03cYmenheh
09:04neotykHi *
09:04mfexand you could combine the let and if form with if-let
09:05mikemI have a map with integer keys. I'd like to find the first integer, starting from 1, which is not already in the map. what's the best way to do this?
09:05mikemI have this: (first (filter #(not (contains? v %)) (take java.lang.Integer/MAX_VALUE (iterate inc 1)))) -- where v is the map with integer keys
09:05mikemis there something simpler, perhaps?
09:06cYmenmfex: never heard of if-let
09:06cYmenAny other advice on that code? Feels a bit clumsy...
09:06neotykwhere I can read what is difference between ':' and '::' ?
09:08defncYmen: name it with a .clj :)
09:10cYmendefn: hrhr
09:10cYmendefn: Didn't even notice. Just wanted gist to be able to do the highlighting.
09:10defnmikem: what do you mean by map with integer keys? like {1 2, 3 4}? or do you mean [1 2 3 4 5]?
09:11mfexcYmen, (defn addi [tehmap val] (assoc tehmap val (+ (tehmap val 0) 1)))
09:11mikemdefn: like {1 2, 3 4}
09:11mfexcYmen, but that's perhaps a bit less readable
09:12mikemdefn: or more likely for my use case: {4 "something", 29 "something else", 33 "one more"}
09:13tomojmikem: why are you taking MAX_VALUE??
09:14defnyeah im kind of trying to figure out that as well :)
09:14tcrayford,(inc (last (sort (keys {1 2, 3 4}))))
09:14clojurebot4
09:14mikemtomoj: if I don't take anything, then (iterate inc 1) could go on forever
09:14tcrayfordmikem: see that
09:14tomojmikem: ok, but you're willing to sit there and wait while it goes through every single positive integer?
09:15mikemtcrayford: the keys may not necessarily be in increasing order, there may be gaps. otherwise I'd use (max (keys {1 2, 3 4}))
09:15tomojanyway, it won't go on forever unless your map has an infinite number of keys, right?
09:15tcrayfordyeah, just figured that out
09:15mikemtomoj: exactly, if all the keys are taken I probably have other issues ;)
09:16tcrayford~seen technomancy
09:16clojurebottechnomancy was last seen in #clojure, 506 minutes ago saying: never heard of anyone actually trying to use streams =)
09:17tomoj,(first (remove {1 2, 3 4} (iterate inc 1)))
09:17clojurebot2
09:17tomojcan your map have nil or false values?
09:18mikemno, the map will only have integer keys starting with 1
09:18tomojbut what about values
09:18mikemvalues will be vectors, so it's unlikely to be false or nil
09:18mikemif it is, it's a bug
09:18tcrayford,(first (filter #(not (contains? {1 :a, 2 :b} %)) (iterate inc 1)))
09:18clojurebot3
09:18tomojthen the above should work
09:19mikemtcrayford: that's what I have, except I (take java.lang.Integer/MAX_VALUE (iterate inc 1)) so I don't run on forever... :)
09:19tcrayfordmikem: thing is, you won't ever run on forever
09:20mikemI also don't want anything that's a BigInteger
09:20tomojthat would only happen, again, if your map has every single Integer stuffed in it
09:20tcrayfordyep
09:20tcrayfordwhich is probably unlikely
09:21LaPingvino,(take java.lang.Integer/MAX_VALUE (iterate inc 1))
09:21clojurebotExecution Timed Out
09:22mikemcool, the remove method would work
09:22mikemtomoj, tcrayford: thanks
09:23tcrayforddoes anybody know their way around a common lisp implementation of swank?
09:23tomojI think you'd only need 8GB of RAM to store every positive Integer assuming no overhead
09:25defntcrayford: is there a minor mode now for clojure-refactoring?
09:25tcrayfordnot yet
09:25LaPingvino,1
09:25clojurebot1
09:25tcrayfordI've been working on getting proper renaming going
09:25tcrayfordvia slimes xref feature
09:25defntcrayford: i looked into it tcrayford but i just don't know about my way around elisp well enough to do much with it
09:25tcrayfordyeah
09:25tcrayfordme neither
09:26defnill keep poking at it but dont count on me :)
09:26tcrayfordmost of the stuff in refactoring-mode comes from test-mode
09:26tcrayfordby the looks of things though, proper renaming support should come in sometime this week
09:27defntcrayford: this is a question you might know the answer to... is there any existing code out there for indenting clojure code presented in a single long line, and placing appropriate newlines etc.?
09:27tcrayforddefn: no
09:27tcrayfordI've been meaning to write one, its not that hard
09:27tomojhow could you possibly guess where to put newlines?
09:27defnlol
09:27tomojit's a delicate art
09:27tcrayfordyep
09:27defngotta treat the #() right
09:28tcrayfordI'd do a naive one with newlines after vectors that are binding vectors (refactoring-mode can already work that out for me)
09:28tcrayfordoh
09:28tcrayfordbetter idea
09:28tcrayfordbayesian inference across the whole clojure codebase
09:29defntcrayford: that's a great idea actually
09:29tomojis that different than a markov chain
09:29tcrayfordsomewhat, yeah
09:29tcrayfordbut similar principle (I think)
09:30defnhowever, the style would be a bit biased
09:30defnit'd be cooler to run it on open source projects :)
09:31tcrayfordI'd probably run it across contrib rather than clojure itself
09:31tcrayfordI think
09:32tomojnot at a character level, right?
09:32tcrayfordat a sexp level
09:33tcrayfordcode is data, remember
09:33tomojbut do you include extra info like "this is a binding vector" somehow?
09:33tcrayfordI think so
09:33tcrayfordrefactoring-mode can work that out itself
09:33tcrayfordroughly anyway
09:34tcrayfordit won't work for new macros that take binding forms that people have defined
09:35tomojthe data seem too sparse to me
09:35tcrayfordoh awesome
09:35tcrayfordcross referencing works now in slime/swank
09:35clojurebothttp://haacked.com/images/haacked_com/WindowsLiveWriter/IConfigMapPathIsInaccessibleDueToItsProt_1446B/works-on-my-machine-starburst.png
09:35tcrayfordso you can hover over a function name
09:36tcrayfordM-x who-calls and get a list of all the functions that call your function
09:36tomojawesome!
09:36defntcrayford: that's fantastic
09:37tcrayfordit'll be a big boost to refactoring
09:37tcrayfordsince you can then rename a function properly
09:38tcrayfordand have the rename work across files
09:39tcrayfordI'm not happy with one function in it though
09:39tcrayford(defn- recursive-contains? [coll obj]
09:39tcrayford "True if coll contains obj at some level of nesting"
09:39tcrayford (some #(= % true)
09:39tcrayford (flatten
09:39tcrayford (postwalk
09:39tcrayford (fn [node]
09:39tcrayford (if (= node obj) true node))
09:39tcrayford coll))))
09:39tcrayfordthat one
09:39tcrayfordit checks if a tree contains obj somewhere
09:39tcrayfordand I don't think it is anywhere near as clean as it could be
09:42tcrayford(it needs clojure.walk and contrib.seq-utils)
09:43defni feel dirty when i use flatten most of the time
09:43defnit feels like im patching a mistake i dont know i made
09:44defnis that neurotic?
09:45tcrayfordI feel about the same
09:45tcrayfordthat fn really bugs me as well
09:46tcrayfordrefactoring-mode uses it all over the place, but I can't see how to make it better
09:47defngeez i dont know... hmm
09:48defntcrayford: you could roll your own postwalk
09:48defninstead of replacing the original do something else
09:48tcrayfordthat's what I used to have
09:49tcrayfordit was uglier than using postwalk
09:49defnyeah youre probably right
09:50tcrayfordgrrr
09:50defntcrayford: why postwalk instead of walk?
09:51tcrayfordI think walk confuses me a bit
09:51defnoh nvm, i think im confused
09:52defnpostwalk certainly /sounds/ like what you want
09:58tcrayfordgrr namespacing is confusing
10:00tcrayfordswank seems to be failing to find a namespace I KNOW is there
10:01tcrayford [null] #<CompilerException java.lang.ClassNotFoundException: swank.commands.xref (basic.clj:411)>
10:01tcrayford
10:01tcrayfordis the error I get
10:02tcrayfordaha fixed
10:03tomojtcrayford: what's (some #(= true %) ...) for?
10:03tcrayfordcurrently, it replaces all the values in the tree that match obj with true
10:03tcrayfordand leaves the others the same
10:03tomojah
10:04tcrayfordthere's a bug there that you just made me think of
10:04arbschtliteral true
10:04tcrayfordif 'true' is already in the tree
10:04tcrayfordthen recursive-contains will always return true
10:04tomojis something wrong with the naive way?
10:04tomoji.e. recursion
10:04tcrayfordwhat's the naive way?
10:04tcrayfordit was more code :/
10:05arbschtwhy not just flatten and filter?
10:05tcrayfordthat should actually work fine for this use case
10:06tcrayfordseeing as I'm only looking for symbols
10:06tcrayfordoriginal use case has to find seqs as well
10:06tomojooh, I see
10:07tcrayfordcheers for that flatten/filter thing though
10:07tcrayfordthat's better for swank, but not for refactoring mode
10:10defntcrayford: when you mentioned bayesian inference were you thinking for "outcome" values? like the number of []s found, nested and un-nested? the number of ()s found, nested and un-nested?
10:11defnas input i mean...
10:11tcrayfordsomething like that
10:11tcrayfordI haven't actually thought about it beyond thinking that bayesian inference would make sense for this
10:13tcrayforddamn
10:13tcrayfordnow I've broken something in swank :(
10:13defntcrayford: is it something youd put into refactoring?
10:13tcrayfordthe pretty code printing?
10:13tcrayfordthat's probably a separate lib, that refactoring relies on
10:13defnyeah, is that at all interesting to you?
10:13tcrayfordyeah its interesting
10:13tcrayfordI'm unsatisfied with refactorings way of printing code atm
10:14defni think i might try to do something with it
10:15tcrayfordgo for it
10:15defnid like something like it to take something like: (defn x [k, z, p] (+ k z p (map #(+ 3 %) [1 2 3 4]))) <-literally
10:15defnand turn it into (defn x [k, z, p]\n (+ k z p...
10:15defnis that what you had in mind?
10:16tcrayfordsomething like that, yeah
10:16defncool
10:17tcrayfordpretty much just pretty printing of code
10:17tcrayfordcontrib already has a pretty code printer that I use in refactoring
10:17tcrayfordbut it ain't great
10:17tcrayfordjust newlines after binding forms would be fantastic
10:18defndoes it do indentation and all of that? i toyed with pprint and didn't see it do any newlines. hm -- what function is that in pprint?
10:19tcrayford(with-pprint-dispatch *code-dispatch*
10:19tcrayford (pprint node))
10:19tcrayfordis the call I use in refactoring-mode
10:19tcrayfordit does newlines if your expr goes over 80 chars
10:20cYmenDoes anybody have a working vimclojure with nailgun features?
10:20cYmenI can't get it to work. :/
10:20tcrayfordwhat's the problem
10:21tcrayford?
10:22cYmenWhen I start vim I get an error in the messages. I can't make heads or tails of it but it seems to be a classpath problem.
10:22cYmenWould you like me to paste it?
10:22tcrayfordpaste it into a gist or summat if its big
10:22tcrayfordotherwise, sure
10:22cYmenhttp://paste.pocoo.org/show/203255/
10:23cYmenSorry about the formatting, that's the way I get it.
10:23tcrayfordits fine
10:23tcrayforddo you have a (ns test) thing at the top of the file?
10:23tcrayfordfrom the looks of it vimclojure might need/want that
10:24cYmenoh
10:25tcrayfordpull request sent
10:25tcrayfordwop
10:26cYmentcrayford: doesn't seem to make a difference if I add that
10:27tcrayfordinteresting
10:27tcrayfordsame error still?
10:27cYmenI can't see a difference.
10:28cYmennew: http://paste.pocoo.org/show/203257/
10:28tcrayfordyou saved the file?
10:28cYmenI only added (ns test) at the top.
10:28cYmenYes.
10:28tcrayfordand no syntax errors?
10:29tcrayford(paste the file into your pastebin as well?)
10:29cYmenthe file says (ns test) and (+ 1 2 3) :)
10:30cYmenI don't even know how to send it yet. It seems the keybindings don't work because it fails with that error.
10:32tcrayfordaye
10:32tcrayford:(
10:32tcrayfordI don't really have anything more to suggest
10:33cYmenI'll email the author.
10:38nurvEvening.
11:09JevgeniHi, I have desided to try clojure in emacs and I have a problem installing swank-clojure with ELPA. I have installed the ELPA (it modified my init.el), then I used package-list-packages and installed swank-clojure. I had few warnings the buffer and "hack-local-variables: Local variables entry is missing the suffix" in the mini-buffer. After that I still don't have alt+x slime available.. Any...
11:09Jevgeni...hints or directions?
11:11rfgDid you install slime and slime-repl as well?
11:11Jevgenino, do I use the same procedure for these packages?
11:11rfgYes, you'll want clojure-mode too.
11:12Jevgeniit's strange, ELPA shows me that slime is installed
11:12Jevgenislime-repl not
11:12Jevgenican it be that one package installs others as well?
11:12Jevgeniclojure-more is said to be installed as well
11:14rfgIs swank-clojure definitely installed?
11:15Jevgenielpa shows that is not. strange
11:16rfgJevgeni: I had the same problem.
11:16rfgTry again and it should work.
11:18Jevgenirfg: okay, thanks. I had to install it three time (& restart emacs), now it offered me to install clojure..
11:18rfgCool
11:18Jevgenistrange :) but cool
11:19Jevgenioh. I don't have slime anymore available after restart :S
11:19Jevgenido I have to require it manually somehow?
11:19rfgNo you shouldn't.
11:21rfgCould you paste your .emacs somwhere?
11:22JevgeniI have init.el in .emacs.d.
11:22Jevgenirfg: http://pastebin.com/LY4VW5qE
11:23rfgCan you paste package-list-packages?
11:24Jevgenirfg: http://pastebin.com/Sgzq0wSx
11:25rfgAh, installed packages are greyed out, that doesn't help much. :)
11:25rfgOh there is an installed column.
11:26Jevgenithere is status "installed">)
11:26rfgI would have thought it would just work.
11:27rfgWhat does your *Messages* buffer say after loading up emacs?
11:27Jevgenirfg: http://pastebin.com/ZgQYqUa1
11:28JevgeniI guess the problem happens during the installation.. maybe autoload generation fails.
11:30Jevgenithis is what happening during the swank-clojure installation in the messages : http://pastebin.com/HB33kebF and in the compile-log buffer: http://pastebin.com/0wNYrVbT
11:32rfgI had a few errors when installing but it should still work.
11:32Jevgeniright after the installation m-x slime works, but dissapears after restart
11:36rfgOkay M-x slime doesn't work, but can you M-x package-list-packages?
11:36Jevgeniyes, I can
11:37rfgHave you tried reinstalling multiple times?
11:37Jevgeniyes
11:38Jevgenieach time I install - m-x slime starts working, but after restart it is no longer available
11:42Jevgenipackage-activated-list = (swank-clojure clojure-mode slime-repl slime emacs package erc url nxml bubbles)
11:47rfgI'll have a go at installing it on Windows.
11:49Jevgeni(package-activate 'slime '(20091016)) --> t
11:49Jevgenibut no m-x slime
12:03rfgJevgeni: Right, on windows I'm having the same problem as you.
12:04Jevgenirfg: do you have any hints how to solve it? Or I should use manual installation instead? (I have slime+sbcl installed previously)
12:04Jevgenihad*
12:06rfgI don't know how to fix this problem. Have you tried Clojure Box?
12:08kzarIf you create a server with create-server in contrib how do you stop the server?
12:09Jevgenirfg: clojurebox worked, probably I have to see what's done there..
12:15kzarOK for some reason (find-doc "server") didn't find it but the answer was just (close-server servername)
13:02Sgeo_Bye all! Homework now
13:04Jevgenirfg: just for information, it was an ELPA bug in windows. had to patch package.el to fix it (http://groups.google.com/group/clojure/browse_thread/thread/c4d00ba0f1614c49)
14:15JevgeniI've installed leiningen on vista. lein swank gives an exception - No matching field found: getCommandLine for class org.apache.tools.ant.taskdefs.Java . Have googled for it, but no luck. Any hints?
14:19Jevgeniah, updated lib to [leiningen/lein-swank "1.2.0-SNAPSHOT"] to solve it...
14:27cYmenhm...so meikel hasn't responded so far..anybody here who's got a running vimclojure with nailgun and might be able to answer some questions?
15:14Luyt,(doc doc)
15:14clojurebot"([name]); Prints documentation for a var or special form given its name"
15:55OForeroanyone using IntelliJ EAP with clojure?
15:56sattvikcYmen: What's your problem?
15:57OForeroI do not find the La Clojure plugin in the latest EAP version
15:58OForerois not the plugin to use any more?
16:08Jevgenidoes clojure mode support highlighting errors/warning in the code as lisp mode does? Is it some hidden setting I have to tweak?
16:12dnolenJevgeni: you won't see errors or warnings as you type, only when you compile, and that's a feature of swank-clojure not clojure-mode
16:12Jevgenidnolen: okay, does swank-clojure enables it?
16:13dnolenJevgeni: it should yes. You may need to build lein-swank from source.
16:13dnolenI'm not sure if the one on Clojars has those changes yet.
16:14dnolenpretty easy to do tho, clone the leiningen repo, cd into lein-swank, lein install
16:14JevgeniI use the swank directly, from the m-x slime right now. do I have to use lein-swank for this?
16:16tcrayfordyou want m-x swank-clojure-project for that if you're dir is using lein
16:16tcrayfordand you need swank-clojure in your lib directory
16:17Jevgeniokay, I see. I'll try this, thanks
16:18tcrayfordthough if you get to that point, you might as well use lein-swank
16:20Jevgeniyes, I do have installed it. I will try that as well
16:57Jevgeniwhat about the debugger in the emacs - do you know - are there plans to hide the JVM frames and to show clojure code first in the buffer?
16:57Jevgenior, is it possible already somehow?
16:58tcrayfordI don't think its possible atm
17:01hiredmanlook at clojure.stacktrace
17:02tcrayfordI wish clojure had a proper proper debugger.
17:02tcrayfordatm I mostly copy out the function that I'm debugging and replace bound values with actual ones, then evaluate it
17:03dnolenswank-clojure master has (swank/break) which is pretty useful
17:04Jevgenitcrayford: yes, tracing does not show the [let] values either
17:04dnolen(swank/break) lets you move from breakpoint break, run code on that frame and inspect locals
17:04dnolenbreakpoint to breakpoint i mean
17:10tcrayforddnolen: is there a decent article on that anywhere?
17:11dnolentcrayford: http://hugoduncan.org/post/2010/swank_clojure_gets_a_break_with_the_local_environment.xhtml
17:13Jevgenidnolen: it's said there that JDPA integration is been tackled.. is it?
17:14dnoleni don't know of anyone that's working on that yet.
17:19cYmensattvik: let me pastebin that for you. I can start everything but I get errors when vim tries to use nailgun
17:23cYmenhrmpf now I can't start the nailgun server anymore
17:23cYmengo burn in hell classpath!
17:25cYmensattvik: here you go http://paste.pocoo.org/show/203408/
17:29sattvikcYmen: Which version of VimClojure are you using?
17:30cYmenthis is from 2.1.2
17:30cYmenI tried getting the mercurial version but it doesn't come with the nailgun server only a dead clojars link...
17:31sattvikcYmen: What version of Clojure are you using?
17:32cYmensattvik: 1.1.0
17:33sattvikcYmen: Well, your versions shoule work together fine. Judging from the error message, the vimclojure.jar or one of its dependencies is not in the server's classpath.
17:34sattvikcYmen: The server should have Clojure 1.1, Clojure-contrib 1.1, VimClojure, all of the class/source directories for your project in its classpath.
17:36cYmensattvik: http://paste.pocoo.org/show/203413/
17:37cYmenI simply start nailgun using: java com.martiansoftware.nailgun.NGServer 127.0.0.1
17:43sattvikcYmen: Assuming that all of the paths in your classpath are correct, it should work… How about trying the classpath as command line argument: java -cp /Users…:/Users… com.martiansoftware.nailgun.NGServer 127.0.0.1
17:43cYmensattvik: tried that
17:50sattvikcYmen: I'm experimenting a bit…
17:55cYmenI don't have a clue. I'm afraid my java experience isn't enough to figure out the error message.
17:58harblcathi all
17:59harblcatI'm looking to replace a (cond ...) with something a little more concise, and thought that a map like string -> function would work, but I've hit a snag.
18:00hiredmanuse a multimethod
18:01cYmenharblcat: depends on the cond I guess but it's pretty concise in most cases
18:02harblcatwell, see, I was doing a commandline thing, and the cond is where I was switching out for different actions, but I wanted to be able to add other actions at whim while the program is running.
18:02harblcatit was something like (cond (= "foo" input) ...)
18:03harblcatI was thinking why not use a hash, so I could say (actions input) instead?
18:03harblcatbut I can't get it to work like I think it should.
18:04hiredmanmutltimethod
18:04hiredmanmultimethods are great for interpreters
18:04harblcatreally?
18:04hiredmanyes
18:05hiredmanhttp://clojure.org/multimethods
18:06hiredmana lot of that is more complex than you will most likely need
18:07sattvikcYmen: What happens when you: echo "doc" | ng de.kotka.vimclojure.nails.DocLookup
18:07harblcatwell, I'd like to know more about this map full of functions. I know that (actions input) returns a function, but if I try to wrap it so that the function is evaluated I get a NullPointerException
18:07hiredmanyou mean called?
18:08harblcatah, nevermind on that, I figured out why.
18:08harblcatI can't do (nil)
18:08harblcatwhich is what (actions input) returns if input isn't in the map
18:08hiredmanfunctions evaluate to themselves
18:08harblcatnil isn't callable
18:08hiredmanto run a function you apply it
18:09hiredmanyou can evaluate the application of a function
18:09harblcatwell, I'm trying to catch invalid commands using an (or ...), so I can get either a good command, or an error like "Command not found: foo"
18:09cYmensattvik: java.lang.ExceptionInInitializerError [...]
18:10cYmenWould you like to see the details? Do I need to set anything? CLASSPATH? CLOJURE_EXT?
18:11harblcaton a different note, how do I change an atom to another thing?
18:11sattvikharblcat: You can add a third argument to your (action input) to return a default function.
18:12hiredman~blip.tv
18:12clojurebotblip.tv is http://clojure.blip.tv/
18:12harblcatso (actions input #(str "foo: " %)) ?
18:12harblcatI'll have to try that.
18:12sattvikcYmen: Hmm... That stack trace would be goo, to start.
18:13cYmenhm..somehow lisppaste is broken
18:14cYmensattvik: http://gist.github.com/370587
18:15dnolenharblcat: multimethod + a macro so you can write something like (add-action "some-str" some-fn) is the idiomatic approach. and then you don't have to mess with atoms, you can also provide a default function.
18:16dnolenharblcat: multimethod's are there for a reason. putting fns in maps is not encouraged.
18:16harblcatah
18:18cYmensattvik: I managed to fix that stacktrace by recompiling clojure-contrib while specifying where clojure is.
18:19cYmenecho "doc" | ng de.kotka.vimclojure.nails.DocLookup works now
18:19sattvikcYmen: OK, so you can try doing something from Vim then.
18:20cYmensattvik: That still doesn't work...
18:20sattvik cYmen Hmmm.. same error, or something different?
18:22cYmennope same error
18:24sattvikcYmen: Are you sure that the files in your ~/.vim directory are for VimClojure 2.1.2? I just noticed your error is looking for vimclojure.Nail, which is from the current hg head.
18:27cYmensattvik: oh..that's odd maybe it didn't overwrite something I had the hg version installed before
18:28cYmenlet me manually delete stuff
18:31cYmenwehee
18:31cYmensattvik: the error is gone
18:31cYmennow I only have to figure out how to actually get a repl :)
18:33cYmenDONE.
18:33cYmensattvik: Thank you, I would never have figured this out on my own!
18:33cYmensattvik: Are you using hg head?
18:35sattvikcYmen: Your welcome. I have used both the released and development versions.
18:35cYmensattvik: I have to go now but if you're around tomorrow I would love to hear about building the dev version.
18:37sattvikcYmen: OK. I am usually around, just ping me here. I might not respond immediately, as I am often in some other window doing something.
18:38cYmenGreat, thanks again and good night. :)
19:54jweisscan anyone suggest a way to expose some clojure functions I've written (say, in a namespace) via xmlrpc (or some other language agnostic protocol)? I figure I could use a java xmlrpc lib and dispatch the calls with a multimethod... there's probably an easy way to map a string xmlrpc method name to a clojure fn (assuming they have the same name)- or is there a more idiomatic or easy way?
19:56hiredmanif you trust your channel you can just use eval
19:57hiredman(doseq [msg (repeatedly get-message)] (eval msg))
20:29chessguydoes clojure have an equivalent to lisp's "atom?" predicat?
20:29jweissanyone know if there are plans to address common errors such as "java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn (NO_SOURCE_FILE:0)" with a clojure oriented message rather than java's message, perhaps by wrapping the exception with "attempted function call on a java.lang.Integer" . there's probably lots of places this could be done
20:30jweissor is there some rationale for exposing java guts to clojure programs?
20:31dnolenchessguy: (complement coll?) is probably the closest thing
20:31jweissseems like clojure users should not need to know what an IFn is.
20:31chessguydnolen, would coll? be true for a regular list?
20:31chessguyas in, '(a b c)
20:32dnolenjweiss: I imagine that story will improve much more quickly when the compiler is written in Clojure instead of Java.
20:32dnolen,(coll? '(a b c))
20:32clojurebottrue
20:32chessguythat answers that. thanks
20:32dnolen,(coll? 'a)
20:32clojurebotfalse
20:32chessguy,(coll? true)
20:32clojurebotfalse
20:33jweissdnolen: ah so there are plans to address it although indirectly :) didn't know there was going to be a clojure ->clojure compiler
20:33chessguy,(coll? 'coll?)
20:33clojurebotfalse
20:34chouserI don't know that much effort will be put into manual handling of various error messages anytime soon.
20:35chouserand IFn is a specific and important abstraction. Fits with then 'ifn?' predicate.
20:36hiredmanright, I mean, do we really want to instrument every single possible fn call?
20:37jweisschouser: important beyond java integration?
20:37jweissi suppose there's a balance that needs to be struck between tight java integration and standalone clojure
20:38dnolenjweiss: IFn is an interface. Clojure is built on interfaces, they just happen to implemented in Java at the moment, they might be implemented in Clojure later.
20:38hiredmanthere is no standalone clojure
20:38hiredmanclojure "embraces a platform"
20:39jweissisn't there a clr implementation?
20:39hiredmanit's clojureclr, not clojure
20:39jweissi see
20:39dnolenjweiss: but I agree the error messages suck. it's a good thing Clojure is simple and encourages FP or it would be unbearable.
20:40jweissit's not that big a deal, just off-putting to newcomers (which for a new language, is most people)
20:40chouserjweiss: yeah, IFn is Clojure's "callable" interface. If an object implements IFn, you can call it like a function.
20:40dnolenjweiss: totally. it's a good thing Clojure is so cool.
20:41chouserI do think it would be nice for the error messages to be simpler, clearer, more direct. But I see now that the language is changing at a rate that would make most effort in that direction rapidly obsolete.
20:41jweisschouser: i have no problem with the existence of IFn, it's just not at all obvious what you've done wrong when you accidentally put an integer value where an IFn shoud be
20:42dnolenfor what it's worth, Clojure error messages or no less painful then GCC error message in my opinion. What Clojure needs is really good debugging support in all the main IDEs.
20:42jweisschouser: understood
20:42glogicchouser: same as it ever was
20:42chouserpresumably the language's rate of change will slow down eventually, and then it'd be great to see some tidier error messages.
20:42hiredmanbut to do what you want would mean extra code generated for every call site
20:42chouserhiredman: just to fix the error messages?
20:42jweisshiredman: how do you figure?
20:43hiredmanchouser: right
20:43jweissseems like you could just edit that 1 line in the java implementation
20:43chouserI've thought about some kind of top-level error handler that maps common but complex exceptions to "easy to understand" messages.
20:43jweissor can that same error be thrown from lots of different places?
20:43hiredman,(let [a 1] (a 1))
20:43clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
20:44chouserit could catch the error, examine the stack trace, and print something pleasant. ...or even just link to a page of example errors and likely fixes.
20:44hiredman,(let [a (+ 1 2)] (a 1))
20:44clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
20:44chouserthe benefit of that kind of solution would be that it could be done entirely outside of clojure core -- no need to get in rhickey's way
20:44nurvGood night.
20:44hiredmanevery possible call is potentially that exception
20:44chouserthe downside is it would take constant effort to keep it even slightly useful. -/
20:44chouser:-/
20:45hiredmanso to really deal with it you have to add code to call sites
20:45chouserthe excpetion hanlder could be at the top of the repl call stack -- no need to muck with call sites.
20:45hiredman:(
20:45dnolen"java.lang.Integer 3 cannot be invoked as a function" would be more illuminating.
20:46jweissdnolen: yeah that's what i would have thought would be wrapped around the CCE
20:46hiredman,(let [a (rand-int 10)] (a 1))
20:46clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
20:46jweisshiredman: how many different call sites are there?
20:46hiredmanjweiss: every function call is a call site
20:47jweisshiredman: but, i would've thought that's handled by a single piece of java code
20:47hiredmanclojure generates bytecode for invokevirtual clojure.lang.IFn etc etc
20:47chouserI still don't see what's wrong with a top-level exception handler "fixing up" the error message.
20:47hiredmanjweiss: there is some common stuff in AFn but not all IFns are AFns
20:47jweisshiredman: i see
20:47dnolenchouser: inc
20:47hiredmanchouser: like clojure.stacktrace
20:48jweisshah, is that new?
20:48hiredmanno
20:48jweissi've been doing (.printStackTrace *e)
20:49jweisslike my book says to do
20:49glogicok you'rea ll officiall freaking me out now
20:49chouserglogic: ?
20:49jweissok, by "new" i mean, in the last 3-6 months?
20:49jweissthat's not new in clojure world, i suppose :)
20:50hiredmanDate: Wed Jun 24 00:46:54 2009 -0400
20:50jweisshow bout that
20:50hiredmanmoved from contrib to clojure almost a year ago
20:53jweissthat's good to know about but still doesn't help newbs understand this
20:53jweiss,(1)
20:53clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
20:53hiredman*shrug*
20:53hiredmanmakes sense to me (works on my machine)
20:53jweissyeah i know, the reason i mention it is a coworker is trying out clojure (he's a java and python guy), he didn't know what that meant
20:53dnolenclojure.stacktrace is used by all the main environments. it's not that helpful.
20:53hiredmanuh
20:54hiredmandnolen: is it? I am not aware of any that use it
20:54hiredmanjweiss: how can a java guy not get that?
20:54dnolenswank-clojure uses it as far as I can tell
20:54dnolenso does counterclockwise and I think enclojure
20:54jweisshiredman: i dunno, i guess either you get the I in IFn is for interface, and Fn is for function, or you don't. kinda hit or miss with just 3 letters.
20:55hiredmanFn is for fn
20:55hiredmanfn, defn, fn?, ifn?, bound-fn, etc
20:56jweissi know, i know, you can only cater to noobs so much
20:56jweissbut i thought it might have been an easy fix, apparently not
20:58jweissby the way, anyone here use the clutch couchdb lib?
20:59dnolenjweiss: rhickey rarely makes mistakes so he doesn't need the error messaging to improve ;) but he might be open to a patch.
20:59dnolenjweiss: I have a little
21:00jweissdnolen: my view server keeps exiting after about 3 seconds with a JSON error. i'm pretty sure this used to work, so i'm wondering if maybe there's some version incompatibility
21:00jweiss3 seconds after i start couchdb i mean
21:00dnolenI never went so far as to use clojure as the view server.
21:01jweissdnolen: yeah, i may reconsider that design decision in my app
21:01dnolenviews tend to be so simple I didn't see much of advantage of using a different lang than JS.
21:01jweissdnolen: good point
21:02chouserhiredman: yeah, like clojure.stacktrace, except (e) sometimes obscures important details, and doesn't point to more helpful messages.
21:02glogicdnolen: what if i make tons of mistakes though
21:02jweissalthough, i thought i might at some point create views dynamically, and so it was tempting to use clojure
21:03jweissbut i really don't know if i'll need to do that
21:03hiredmanchouser: sure, I don't use it myself, I just point people who don't like reading stack traces to it
21:04chouserah
21:04dnolenjweiss: you have to wait for the view the build so I don't see the advantage of them being dynamic.
21:05jweissdnolen: well, my app is a defect tracker (among other things), lets say a user creates a new project, it might need its own views
21:05jweissmaybe not though
21:06dnolenjweiss: ah yeah, that would be convenient. if a project has it's database.
21:06dnolenproject has it's own db
21:06jweissdnolen: no, it'd all be in one db
21:07jweissbut there might be something different about that project where other views were not sufficient, i don't know yet. i haven't done that design yet
21:08jweissseems like a user's saved searches might be nice to do as views?
21:08dnolenproblem with views is that they operate on the entire db, so depending on your app and database size might not be nice.
21:09dnolenfilter replication into smaller dbs with their own views is useful in that case
21:09dnolenfilter -> filtered
21:09jweissdnolen: good point
21:10jweissi thought defect tracking, how many records are we talking about here? i've never seen a db with more than 500k records (top level).
21:10jweissi have no idea how much cpu it would take to create a view on that date
21:11jweissdata
21:11jweissred hat's has about 500k and that dates back many years. i think ubuntu's is in the several 100k range now
21:12jweissthen again, if the db is small enough it won't matter if i use views or not :)
21:48falconairdo clojure's sequences include stream based data, in other words, could I map or reduce over jms streams or network streams?
21:52hiredmanfalconair: you can generate a seq on top of a function call
21:53hiredman,(take 10 (repeatedly #(rand-int 10)))
21:53clojurebot(0 6 0 8 4 5 0 4 3 3)
21:53falconairhiredman: could you explain a bit please?
21:53Raynes$(let [x 1 x x x x x x x x x x x x x x] (println x))
21:53falconairdo you mean use function as a generator (like range)?
21:53sexpbot1
21:55hiredmanfalconair: no
21:56hiredmanI mean you can take a function that each time you calls it returns a Thing and you can very easily turn it into a seq of Things
21:56hiredmansee my example with rand-int
21:58falconairhm...so there is no concept of "push-based" collections where map/reduce/filter are fed data, rather than them "pulling" on a datastructure with first/rest?
22:00hiredmanfalconair: if you function blocks it will block
22:02falconairok, different question: it looks like many functions for sequences (every?/not-any?/etc.) are not implemented using map/reduce/filter, rather they travese sequences themselves...am I correct? shouldn't every? and not-any? use map?
22:09dnolenfalconair: can reduce be made to short circuit? (genuine question which I don't know the answer to)
22:09_atofalconair: take a look at fill-queue in clojure.contrib.seq-utils, that allows you to create a seq which is pushed onto in another thread, which you could then pass to map/reduce/filter etc
22:11dnolen_ato: ah and map/reduce/filter will block while waiting for data?
22:11falconairdnolen: don't know, i'm somewhat new to functional programming myself...i didn't know any of clojure's sequence combinators could short circuit (i assume short circuit means not evaluating the whole sequence due to some exception)
22:11_atoyep
22:12dnolen_ato: nice, I finally understand the point of fill-queue.
22:13falconair_ato: do they actually block (as in 'blocking on locks') or is the relationship inverted where map/reduce/filter a pushed their data rather than them pulling?
22:16_atofalconair: a blocking queue is created and they block waiting for it to be filled by the other thread. I'm having trouble envisioning how an inverted map/reduce/filter would otherwise work... they're pull things... they take one seq and transform it into another returning the new seq
22:18falconair_ato, i am thinking (in part) of F#'s Rx framework, which inverts the relationship between sequences and their combinators
22:19_atofalconair: and the reason 'every?' and friends aren't implemented in terms of map/filter may be for efficiency -- to avoid the overhead of creating a temporary lazy sequence
22:20falconair_ato: in other words, instead of passing a seq to map, which then takes items off of seq and passes them through a transform function, a push-map would 'subscribe' to a 'producer' and as new data is received, it is passed through the same transform function
22:21hiredmanwhat is the different between that and a seq over a blocking queue?
22:21hiredmanprocessing of the seq is blocked and does nothing until something is placed in the queue
22:23falconairthe problem i see with blocking is scalability, i don't think blocking queues could scales to tens of thousands of connections
22:24hiredmanwhy not?
22:26falconairif i'm not mistaken, a blocked function is holding up a thread, and each thread takes up certain amount of memory...tens of thousands of such threads would eat up uncessary ram
22:26hiredmanfalconair: if your event handlers are all running on a single thread that is not going to scale either
22:28_atoyou can only have a few thousand threads before their stacks exhaust memory, but this Rx thing could use a thread pool for sending its events
22:28falconairi suppose in a basic implementation they would be on the same thread, but usually new events are dispatched off to an executor
22:29hiredmanright, and you can do similar processing seqs, see pmap
22:30hiredmanmy Repl spins up 23 threads that just sit around blocking on seqs on queues :P
22:31falconairhiredman: but i am talking about processing network streams as if they were seq, which they (apparently) are not. blocking queue is one way to solve this problem, having a more general definition of seq is another...and I think better
22:32falconairbut i'll admit, this discussion became more academic than practical :)
23:05falconairha! regarding my earlier questions about stream type sequences...looks like Rich is already working on them: http://clojure.org/streams
23:07dnolenfalconair: that's fairly old work (pre 1.0 even?) that's never made it into the mainline. cells might supercede them, but I don't think rhickey is super psyched about where that went either.
23:08falconairdnolen: that is disappointing, is this work simply dormant or has it been abandoned?
23:09dnolenfrom what he said at the NY Clojure Meetup, pushing 1.2 out the door is the main thing he's working on at the moment. And the next big thing will probably be allowing fns to return primitives.
23:10dnolenfalconair: he wasn't happy with the implementation, I don't remember the details, but they're somewhere in the IRC logs. cells does what streams was supposed to do and more, but I think they provide too leaky of an abstraction for rhickey's tastes.
23:11falconairwell, i guess i'll have to keep an eye on newer versions then, thx
23:58MadWombatI am trying to setup emacs with slime and swank-clojure, I keep getting Debugger entered--Lisp error: (file-error "Cannot open load file" "slime") error
23:58MadWombatwhat am I doing wrong?