#clojure logs

2010-09-26

00:02amalloyheh. too late, bhenry
00:09bhenrythat explains why it didn't tab complete his name.
00:09yayitswei,(+ 1 2)
00:09clojurebot3
00:09yayitsweijust testing clojurebot
00:09amalloyclojurebot: can you still add?
00:10clojurebotPardon?
00:10yayitsweiclojurebot: wow you have language processing too?
00:10clojurebotprocessing is a language/toolkit for visualizations. See the Clojure wrapper at http://github.com/rosado/clj-processing/
00:25kumarshantanuhi, is it possible to assign docstring to a def'ed var?
00:26kumarshantanu,(defn foo "Foo the arg" [x] (println "foos" x))
00:26clojurebotDENIED
00:26kumarshantanu(def bar foo)
00:26kumarshantanu(doc foo)
00:26clojurebotPardon?
00:26kumarshantanu(doc bar)
00:26clojurebotI don't understand.
00:36amalloykumarshantanu: you can't def things
00:36amalloywith clojurebot, i mean
00:37amalloykumarshantanu: and yes, it is possible to assign docstrings to arbitrary vars, but i don't know the syntax
00:38amalloy,(source doc)
00:38clojurebotjava.lang.Exception: Unable to resolve symbol: source in this context
00:38amalloy,(clojure.repl/source doc)
00:38clojurebotSource not found
00:38kumarshantanuamalloy: okay
00:39amalloyanyway try (with-meta) - it's one way to get what you want, if you figure out how
00:39kumarshantanuI found I can specify (def ^{:doc "The docstring"} bar foo)
00:40kumarshantanubut it (doc bar) is not the same as (doc foo) then
00:40amalloykumarshantanu: meta-data is attached to vars, not values
00:41amalloybut you could probably do (def {} foo foo) to attach meta to it
00:41technomancyamalloy: well, it's attached to both
00:41technomancybut doc examines the var
00:42amalloyah, here comes a real programmer to help out us bumblers
00:44technomancyactually, metadata on fn values is new to 1.2.0, so perhaps I'm being pedantic.
00:46kumarshantanuI am trying to create an alias for a function name -- hence the docstring thing
00:47technomancyI think you either need a macro for that or you must alter the metadata after defining the alias var
00:48technomancykumarshantanu: http://p.hagelb.org/metadata-on-aliases.html
00:49technomancythat should do the trick
00:51kumarshantanutechnomancy: ah....is that same as this? (def ^{:doc "foo doc" :arglists....} bar foo)
00:52kumarshantanuand where can I find a list of all keywords that applies to metadata?
00:52technomancykumarshantanu: it just ensures that the metadata on the second is a copy of the first; the result should be the same as if you put them in ^{} in the def
00:53technomancyI don't know of a list other than just checking an existing defn
00:53technomancy,(keys (meta #'comp))
00:53clojurebot(:ns :name :file :line :arglists :added :doc)
00:53technomancy:added is mostly just used in Clojure itself I think
00:53kumarshantanutechnomancy: thanks! that was helpful
00:54technomancyno problem
01:00brehautand enlive gurus present?
01:09amalloykumarshantanu: i poked around a bit and you can alsu use alter-meta!
01:10kumarshantanuamalloy: yeah true, that's technomancy: said as well
01:13amalloyoh, i didn't follow his link
01:18yayitsweiis there a way to use the latest version of a library in the project.clj file, or do I always have to specify the version?
01:22amalloySNAPSHOT
01:23amalloyput something like this in your :dependencies [cassandra-wrapper "0.6.3-SNAPSHOT"]
01:23amalloyyou still have to specify a version, but it will fetch the latest work done on that version, is my understanding
01:25yayitsweiamalloy: there's no way to say "use the latest stable version?" for example, I want to use appengine-local-runtime but I'm not sure where to check to see what version numbers are available
01:27jstirrell`test
01:27jstirrell`What's the best way to remove regex matches from a string in 1.2?
01:29technomancyyayitswei: you can use the lein-search plugin to update project.clj to include the latest
01:29technomancybut having a "LATEST" version is just asking for trouble
01:30technomancyeven regular SNAPSHOTs are really only acceptable in production for libraries you control yourself
01:36scottjjstirrell`: .replaceAll maybe
01:43yayitsweitechnomancy: ah, so I guess what I was asking was a standard way of looking up the latest version
01:49yayitsweisounds like lein-search does just that.. thank you
01:56dmeadhi channel
01:56dmeadi'm trying to run clojure in emacs with slime and clojure mode.
01:57dmeadand i keep getting an error saying inferior-lisp-proc is void
02:01klangdmead: http://github.com/vu3rdd/swank-clojure-extra
02:02klangdmead: or see how it is done in http://github.com/relevance/labrepl (probably better)
02:02dmeadah
02:02dmeadthanks
02:02dmeadi guess
02:03klangswank-clojure-extra will let you run with an inferior-lisp-proc .. labrepl woun't ..
02:04klangBut I have both ways running to my own satisfaction (function tips are showing, jumping around the code works, eval current sexp works)
02:05dmeadahh
02:06klangdid I help?
02:06dmeadi just don't understand why it isn't set to something in clojure-mode
02:06dmeadnot really :(
02:07klangAt least it doesn't complain when running labrepl ..
02:11dmeadblah
02:11klangwith labrepl, I connect to an external slime with slime-connect, with swank-clojure-extra (swank-clojure-project) I connect to an inferior slime running in emacs (starting up another repl)
02:12klangof course, lein is used to control the projects (cake could be used as well, I guess)
02:12dmeadi'm getting the impression that clojure-mode doesn't play nice if you have another lisp installed
02:13dmeadthats the problem, slime is fucking up
02:14klangah, custom emacs setup, eh? .. see http://github.com/briancarper/dotfiles
02:14dmeadgood lord.
02:15klangsearch for 'clojure' :-)
02:29slyrus_dmead: I use both clojure-mode and lisp-mode side by side
02:40amalloywow klang, that is a lot of emacs customization
02:40amalloybookmarking that so i can selectively import stuff once i figure out whether i want it
02:41klangamalloy: in my case? well .. you collect a few things after one and a half decade of emacs use .-)
02:45amalloyi have about two months of emacs use under my belt
02:45amalloyyou should have seen how excited i was last night when i found out i could get it to use color-blind-friendly colors over the tty
02:45klangit's a worthwile investment, in my oppinion
02:46amalloyoh, absolutely. i wouldn't write a lisp in anything else, and i'm using it at work for php too ever since eclipse crapped out on me
02:46klangI must admit that php is my bread and butter too (and perl, and bash and, and and)
02:49amalloyevery so often i shake my head when i realize how much time i wasted being just barely able to muddle my way through vi. i guess i wasn't using a lot of unix then, so it was excusable (no offense to vi users in the channel; i just never learned it right)
02:53klangWhen push comes to shove, I _can_ use vi, to open change and close a few files :-)
02:53amalloyyes. i know where undo, cut, and paste are
02:53clojurebotlisppaste8, url
02:54amalloyand everyone's favorite "augh what was that key i just pressed?" :q!
02:54klangvi would be my choice, if I had to connect to a running clojure instance via a smart phone .. emacs has too many keyboard modifiers, and vi is practical in that case
02:54klangamalloy: the "abort abort abort panic" key :-)
02:55amalloymaybe. i haven't yet found a shell app for my phone that's visually accessible, and i wouldn't torture myself by trying to write clojure on it anyway
02:56klangjust to show that you can?
02:57pomykI tried using vi on an iPod, doesn't work very well
02:58amalloywell, i wrote a list-sum program with the phone's text editor, to demonstrate lisp syntax to a friend. painful, but not as bad as trying to use shell/vi
02:59klangpomyk: but it does work .. as a coolness demonstration!
03:04pomykwith a better keyboard it would be usable actually
03:08klangpomyk: do you know if the bluetooth keyboard can be used on an iPhone?
03:16pomykklang: looks like iOS 4.0 has support for bluetooth keyboards
03:17klanginteresting! Then we might see some small bluetooth keyboards soon .. 3rd party
03:17kumarshantanuis it possible to get a list of all types that a var belongs to? unlike (type arg)
03:18amalloy,(supers (java.util.ArrayList.))
03:18clojurebotjava.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Class
03:18amalloy,(supers (class (java.util.ArrayList.)))
03:18clojurebot#{java.util.List java.lang.Cloneable java.io.Serializable java.util.Collection java.lang.Object java.util.RandomAccess java.util.AbstractCollection java.util.AbstractList java.lang.Iterable}
03:18kumarshantanuamalloy: thanks!
03:19amalloykumarshantanu: i make sure to always be right on exactly the second try :P
03:20kumarshantanuamalloy: he he...just added supers to "see also" for "type" on ClojureDocs
03:21amalloywhere is this ClojureDocs thing?
03:21amalloyclojurebot: ClojureDocs?
03:21clojurebotGabh mo leithscéal?
03:22kumarshantanuamalloy: http://clojuredocs.org/v/2068
03:50RaynesWhere did the clojure.java.* docs go?
04:03kumarshantanuis there any equivalent of Java instanceof in Clojure?
04:03jarpiain,(instance? String "foo")
04:03clojurebottrue
04:04kumarshantanujarpiain: thanks?
04:07kumarshantanus/?/!/
04:30kumarshantanucan I also cast a class as another in Clojure?
04:31tomojno reason to
04:31tomojwell, except maybe when calling java methods? there you use type hints
04:31kumarshantanutomoj: I have a use-case
04:32kumarshantanu(defprotocol IFoo)
04:32kumarshantanu(instance? IFoo something)
04:32kumarshantanuthis doesn't work because instance? expects a Class, and IFoo is a persistentArrayMap
04:34tomoj(doc extends?)
04:34clojurebot"([protocol atype]); Returns true if atype extends protocol"
04:36tomoj(instance? IFoo something) works in a different namespace if you import the interface
04:36tomojbut extends? is made for this
04:41kumarshantanutomoj: cool, thanks!
04:41kumarshantanu(extends? IFoo (type something)) it is
06:15quizmeanybody have suggestions as to how to get a clojure job ?
06:23LauJensenquizme: in which setting?
07:26LauJensenFYI this is not a unique machine ID
07:26LauJensen(->> (enumeration-seq (java.net.NetworkInterface/getNetworkInterfaces))
07:26LauJensen (map #(hash (.getHardwareAddress %)))
07:26LauJensen (apply str))
07:55coldheadcan anyone suggest why i cannot get (use '[clojure.contrib.duck-streams :only (spit)]) to work when for example (use '[clojure.contrib.str-utils :only (re-split)]) works happily?
07:56coldheadi get java.lang.NoClassDefFoundError: Could not initialize class clojure.contrib.duck_streams__init (NO_SOURCE_FILE:0)
07:57AWizzArdcoldhead: have a look into your clojure-contrib.jar file (it is just a .zip file with another extension), and see if duck-streams is present.
07:57raekstrange... what versions are you using?
07:57raekalso, clojure.contrib.duck-streams kinda changed into clojure.contrib.io and later clojure.java.io
07:58RaynesIf you're using Clojure 1.2, check out clojure.java.io
07:58raekbut the old ones should be fully functional in 1.2
07:58coldheadclojure/contrib/duck_streams.clj is present, apparently
07:58coldheadthis is c.c-1.1.0
07:59raekand you're using the same version of clojure and contrib?
08:00coldheadno, clojure-1.2.0-master-SNAPSHOT
08:00raekah
08:00coldheadi gather that's a likely cause
08:00coldheadi'll downgrade
08:00raekdifferent versions of clojure are not binary compatible with each other
08:00Raynesc.c is AOT compiled.
08:00RaynesSo, if you use mismatched versions.
08:00RaynesBoom.
08:01coldheadbut not boom everywhere, which is what confused me
08:01coldheadthanks for the wisdom
08:01RaynesI've never had that sort of boom before.
08:01Raynes:\
08:01RaynesMine are usually loud and resounding.
08:02raekcode written for 1.1 should work with 1.2 too
08:02raekso, you could upgrade both
08:08coldheadmucho gracias, friends, all is well now
08:10Raynescoldhead: De nada.
08:21klangRaynes: Hablas Español de puta madre! :-)
08:23Raynesklang: I don't speak Spanish, but but I do know what those words mean. :p
08:24klangRaynes: They are not negative, just so you know ;-)
08:24RaynesRight.
08:24Raynes;)
09:07fliebelgood afternoon everyone :)
09:07fliebel(dependfing on you timezone of course)
09:28raekfliebel: good afternoon (CEST)
10:02v-alexhi all
10:03v-alexthis is probably a dumb question, but is there a way to unquote-splice a form that is *not* inside a syntax-quote?
10:04RaynesYou could probably just use the apply function.
10:05v-alexRaynes: with identity? don't know
10:05RaynesShow me what you're trying to do.
10:05v-alexRaynes: i'm trying to write a macro without using syntax-quote
10:06RaynesOh.
10:06v-alexRaynes: i could point you to the specific example :)
10:06RaynesI misunderstood what you were trying to do.
10:06v-alexRaynes: yeah, don't know exactly how to describe it
10:14Raynesv-alex: http://gist.github.com/597962 You just have to be a little creative.
10:18RaynesWell, I should have quoted +, but nonetheless. http://gist.github.com/597964
10:18v-alexRaynes: i see
10:18v-alexRaynes: yeah, np
10:19Raynesv-alex: If you need any help with your specific case, don't be afraid to ask.
10:20v-alexRaynes: thx; i'm still trying to comprehend this.
10:21RaynesIt helps to realize that you're simply working with data structures. You can back away from your macro and see how they are being constructed. Just doing stuff like (list '+ 1 2 3) and seeing the output can be enlightening.
10:23v-alexRaynes: yeah, seems obvious know
10:23v-alexRaynes: that's my case: http://gist.github.com/597967
10:25v-alexRaynes: apply is also a nice trick
10:26RaynesIndeed, but cons tends to do the trick in macros, and probably makes more sense.
10:28RaynesUnless of course, you enjoy redundancy. :p
10:28Raynes-> (apply list '(+ 1 2 3))
10:28sexpbot⟹ (+ 1 2 3)
10:28Raynes(+ 1 2 3)
10:28clojurebot*suffusion of yellow*
10:28Raynesfailpaste
10:29v-alexRaynes: macros are still mystified for me
10:30v-alexRaynes: I guess working with non-homoiconic languages makes that to you
10:30RaynesIt'll all become clear.
10:31v-alexRaynes: i guess so. Thank you :)
10:32fliebelHas anyone in here read this? http://lambda-the-ultimate.org/node/4088 And if so, what do you think about it?
11:29fliebelhrm, what is a sensible thing to do when I need apply for a macro? A nonsensical thing would be syntax-quoting and evaling. Another thing could be a macro for the macro. Basically I need ~@var outside of a macro.
11:30fliebelI'm making an enlive template on-the-fly, using the list of expressions.
11:31RaynesThat sort of thing typically needs to be done in a macro.
11:32fliebelRaynes: The point is that I have as huge macro as it is now, and I want to split it up in readable chunks.
11:32RaynesUnless you use eval, I'm doubtful you'll find a way to do exactly what you want.
11:33fliebelokay, so since eval is evil, I'll use a macro.
11:34RaynesYou could do the splicing inside of your huge macro and pass it to the readable chunk that needs it, if possible.
11:35fliebelYea… plausible option.
11:35fliebelHey, isn't there just macro, like there is fn?
11:36woobyfliebel: na, macros aren't first class like fns are
11:52fliebelOh, another apply-related question. Or -> rather. -> inserts the result in the second position, but in my case the result is a function. Should I use apply, go for nesting, or is there another trick?
11:58Raynesfliebel: I'm not sure what you mean. Are you trying to do something like this: (-> 1 #(+ % 3))?
12:00fliebelRaynes: Rather (-> + (1 1)
12:01Raynes-> (-> '+ '(1 1))
12:01sexpbot⟹ (quote +)
12:01RaynesHeh.
12:02fliebel,(-> '+ (list 1 1))
12:02clojurebot(+ 1 1)
12:02RaynesIndeed.
12:02fliebel,(-> + (list 1 1) eval)
12:02clojurebotDENIED
12:05fliebelBut is that any better than this?
12:06fliebel,(-> + (eval [1 1]))
12:06clojurebotDENIED
12:06fliebel,(-> + (apply [1 1]))
12:06clojurebot2
12:06fliebelI mean
12:08raek-> forms can be nested
12:08sexpbotjava.lang.Exception: Unable to resolve symbol: forms in this context
12:09fliebelraek: What are you aiming at?
12:10raek(-> x (a b) (-> (p q) (r s)) (c d)) => (c (r (p (a x b) q) s) d)
12:10raekoh, I misinterpreted the question
12:11fliebelnp
12:11raekapply sounds resonable to me
12:11RaynesDon't see anything wrong with apply here.
12:11fliebelokay :)
12:47jk_can you have a namespace across multiple files?
12:48jk_there must be a way to "continue" the namespace in another file but i don't see it
12:49fliebeljk_: Maybe in-ns? Just guessing.
12:50jk_fliebel: thanks, that looks like it.
12:52fliebeljk_: I don't think requiring that ns will load both files though.
12:53jk_fliebel: in the repl, i just pasted in the second file (the one using in-ns)
12:53jk_fliebel: kind of gross but it worked at least
12:54jk_fliebel: now i need to find the command to load in a file (probably "load"!) :)
12:54fliebelyea, load. Takes a filename without extansion
12:55Raynesjk_: There is also load-file.
12:56RaynesBut, depending on what you mean by "load in a file", you might be looking for require or use.
12:57fliebelRaynes: I think he needs load, because require is going to error out when he loads the second file without a ns of itself.
12:58jk_Raynes: sure, i'll look at that. basically i want the contents of the file read in and the contents to be available for evaluation
12:59Raynesjk_: Curious: why do you want to have a namespace over multiple files?
13:00jk_Raynes: well... mainly for when a file is getting overly big. i suppose the counterargument is to break it up in to sub-namespaces if there is a common theme
13:00jk_Raynes: is it considered idiomatic to have only one file in a namespace?
13:01fliebeljk_: Considering the amount of effort it takes to get it sreapd over 2 files I'd say yes.
13:01RaynesI do believe so. Except in extraordinary circumstances.
13:01RaynesAnd a file getting too large isn't an extraordinary circumstance, because it can be easily mended by throwing related stuff into other related namespaces.
13:03quizmeare function dependencies detectable within the clojure language ?
13:03LauJensenI think this is a solid way to generate a unique machine-ID, all who disagree say aye!
13:03LauJensen(def userid (->> (enumeration-seq (java.net.NetworkInterface/getNetworkInterfaces))
13:03LauJensen (map #(apply str (.getHardwareAddress %)))
13:03LauJensen (apply str)))
13:03jk_Raynes: yes, that's pretty much what i meant by breaking it up into sub-namespaces. some sort of refactoring :)
13:03jk_Raynes: fliebel: thanks for your input. not going to fuss with this cross-file namespace issue then
13:04quizmei guess you could write a parser to detect them
13:05fliebel*fumbles around in clojure internals* Huh, what is spread?
13:05fliebel,(#'clojure.core/spread [[1 2 3] [4 5 6]])
13:05clojurebot([1 2 3] 4 5 6)
13:07jk_quizme: are you asking whether the reader would accept a form with an unbound symbol?
13:08quizmejk_ i was just thinking if there was some language-level support for understanding a code base as a graph
13:09fliebelquizme: You mean like making a graph which function calls which?
13:09jk_quizme: you mean for somehow viewing or traversing the dependency graph?
13:13quizmefliebel, jk_ yeah.
13:14quizmeso that when loading a project during runtime, you could make the loading of disjoint chunks of the graph atomic.
13:15quizmeso that you don't have run-time breakages due to function dependencies
13:15quizmethen we could be like erlang
13:15quizme:)
13:15jk_quizme: i'm a lisp/clojure newbie but i think that's an interesting question - i'll just listen to others. you're trying to prevent the run-time evaluating something before it gets loaded in, right?
13:17quizmejk_ trying to load code in independent chunks automatically
13:18jk_quizme: well you can't load something into the reader that refers to symbols that are undefined, to the best of my knowledge. but that definition doesn't need to be bound to something useful :) , like (def x) (defn call-x [] (x))
13:19jk_quizme: forward references that are unbound will still cause breakage taht you're trying to avoid, if i understand you
13:22quizmeanyway
13:22quizmeit's just my add kicking in
13:22quizmegood night
13:24gcv,(let [v ^{:tag :key} ['surname]] (meta v))
13:24clojurebot{:tag :key}
13:24gcv,(let [v ^:key 'surname] (meta v))
13:24clojurebotnil
13:24gcvCan someone explain why the metadata reader macro doesn't work for a bare symbol here?
13:26gcv,(let [v ^:key ['surname]] (meta v))
13:26clojurebot{:tag :key}
13:27gcvDocumentation says symbols support metadata, but the reader macro shorthand doesn't work with them.
13:29gcv,(let [v (with-meta 'surname {:tag :key})] (meta v))
13:29clojurebot{:tag :key}
13:34raek,(let [v ^:key (quote surname)] (meta v))
13:34clojurebotnil
13:35raekthe metadata is added to the list containing quote surname, I think...
13:36raekif you pass "^:key surname" to a macro, it should get the symbol with the correct metadata
13:36raekso, in normal code, use with-meta
13:37gcvGood point, thanks.
13:37raek(let [l '(foo ^:key surname)] (meta (second l)))
13:37raek,(let [l '(foo ^:key surname)] (meta (second l)))
13:37clojurebot{:tag :key}
13:37gcvI ran into trouble doing this with a macro across namespaces.
13:43gcvyup, I get a compile-time exception when I try this across namespaces: java.lang.VerifyError: (class: cv-test-1/core/Family, method: <clinit> signature: ()V) Incompatible argument to function
13:43raek,(let [v (quote ^:key surname)] (meta v))
13:43clojurebot{:tag :key}
13:44raekah, you can put the metadata inside the quote too
13:44raekhm, that smells incompatible versions of libraries...
13:45raekare you sure you have, for example, matching versions clojure and conrtrib?
13:45gcvinteresting point
13:46raekAOT libraries are not binary compatible between clojure versions
13:46raekthe differences might be small, so in some cases it works most of the time
13:47gcvI double-checked, this isn't the problem...
13:47gcvI'm working on a library of my own, and this problem comes up when when I test using it from another project. I thought maybe I didn't "lein install" it, but that wasn't it.
13:48gcvIt's related to using defrecord somehow, though.
13:48raektry clearing the classes/ directory of all the involved projects
13:50raekgcv: if you use leinginen, you might be interested in the "checkouts" feature
13:50raekcreate a checkouts/ dir and put a symlink in there to the other project
13:51raekhrm, do both of your projects use the same clojure versions?
13:51gcvraek: got it, that sounds awesome
13:52gcvraek: I'd better go dig some more and try to narrow down where the error happens; thanks for the hints.
14:03raek,(let [v ' ^:key surname] (meta v))
14:03clojurebot{:tag :key}
14:03raekheh, that worked :-)
14:07gcvdefinitely cool
14:22solussd_,(empty? nil)
14:22clojurebottrue
14:23solussd_,(next '(5))
14:23clojurebotnil
14:32gcvAll right, I have a reproducible case for the weird metadata problem. http://gist.github.com/598174
14:32gcvraek: What do you think? Just a remarkably unhelpful error message or an actual Clojure bug?
14:35raekthe mac1 call looks strange
14:35raekthe macro takes two arguments, but you give it one
14:35raekoh
14:35raeksorry
14:35raekdisregard that
14:36raek,(keyword (first (filter #(meta %) [' ^:key one 'two])))
14:36clojurebot:one
14:38raekgcv: I suggest that you post this one the clojure google group
14:38raekadding the str call shouldn't change things, I think
14:38raekso something strange is going on
14:38raekfrom what I can tell
14:40gcvraek: thanks, I'll go post it right now
15:29klangdoes anybody know, for a fact, that :jar-behavior :symlink has been deprecated from leiningen? There is some indication that it should be possible to use symlinks in http://github.com/technomancy/leiningen/blob/master/src/leiningen/deps.clj, it's tweaked into place here: http://github.com/technomancy/leiningen/commit/0df6f8477d88a3d606c8b9d2f33f2ee55ff5fdd8 and then removed from the example one commit later here:
15:29klanghttp://github.com/technomancy/leiningen/commit/b3a794c60473a1c03098bfb608e4a9d1ec6af89d, I am trying to decide how to go about implementing the :jar-behavior :symlink (or optimally :hardlink) functionality in either leiningen or cake (or both).
15:31lypanovany vim + clojure users around if so, which ext do you use for editing?
15:31lypanovslimv looks need but i've heard some negative povs
15:31lypanovneat*
15:35klang.. a shell script that proves, that it is possible to work with hardlinks in leiningen controlled projects is available here: http://gist.github.com/598251
15:35LauJensenlypanov: weren't you the clever guy using both arch and emacs way back when ?
15:36lypanovLauJensen: yes and both drove me completely nuts and i gave up on clojure. :)
15:36lypanovnow back with vim on osx.
15:36LauJensenha
15:36v-alexlypanov: i'm using vimclojure. ext to edit what?
15:36lypanovv-alex: extension - as in, vimclojure, :) thx for answer
15:37v-alexlypanov: np
15:37lypanovstarted with that also. like the rainbow parens.
15:37v-alexlypanov: sweetest thing =)
15:38lypanovLauJensen: i guess that editor switch + lang switch + wm switch + os switch + vmware was a bit much. i don't blame any given thing. i do know that viper drove me crazy and i can't put my wrists through emacs again though.
15:40lypanovLauJensen: amusingly something did come out of the whole thing though, found a tiling "wm" for osx which makes life less miserable
15:40LauJensenWell thats something for your trouble
15:41klanglypanov: you just need to move Ctrl to CapsLock and you will be golden :-)
15:41lypanovklang: been that way for a decade :)
15:42klanglypanov: I wish I had found out about that a decade ago .. 15 years using emacs does things to your hands ..
15:42lypanovklang: at 24 i couldn't type anymore. don't envy it :)
15:43LauJensenlypanov: I think you need to hit the gym
15:44klanglypanov: oh, I don't :)
15:44lypanovLauJensen: ?
15:44klangExercise the fingers, right?
15:44LauJensenlypanov: I think the ratio between actual physical activity and typing must be pretty skewed, if typing can wreck your body so much that you cant type
15:45andyfingerhut Kinesis keyboards are not cheap, but they are cheaper than wrist surgery. They help me out when I'm doing heavy typing.
15:45LauJensenIts just a hunch though, I have no evidence
15:45lypanovLauJensen: back then i was a heavy swimmer.
15:45lypanovnow i don't do a damn thingy and am in no pain.
15:45LauJensenlypanov: by that you mean fat swimmer? like a floater? :)
15:45lypanovthing*
15:45andyfingerhuthttp://www.kinesis-ergo.com/
15:45lypanovjust coding environment and genes.
15:46klangLauJensen: I've taxed my fingers more climbing, than from using emacs, so you might be right.
15:46lypanov(alum ones, not the old pieces of !@#%)
15:47andyfingerhutAnd I've been using viper in emacs almost since I started using emacs. Like to keep fingers on home row.
15:48lypanovandyfingerhut: dvorak?
15:49andyfingerhutI was touch-typing for 10 years before I heard of dvorak, and didn't want to do that to myself.
15:49lypanovah.
15:49lypanovi had to. had to quit my work otherwise.
15:49lypanovdid the trick luckily.
15:50LauJensenlypanov: Did you have a look at Neo ?
15:50andyfingerhutI'm fine with a normal keyboard if I do light enough typing, but when I'm in it heavy, I pull out the Kinesis. Fully remappable, and by default space, enter/return, and control/command/alt keys are under your thumbs.
15:51andyfingerhutTakes a week or so to get used to, but I found it worthwhile.
15:52technomancyklang: in the next version of Leiningen we'll have the ability to skip lib/ entirely and just construct a classpath that uses ~/.m2
15:53technomancyklang: but if you want to work on symlink support that's great too. it was contributed a while ago, but I don't think anyone uses it, and it didn't come with tests, so it's possible it doesn't work quite right in the latest version.
15:53bmhis there an assoc'ish equivalent to merge-with?
15:55lypanovLauJensen: neo?
15:55LauJensenlypanov: http://www.neo-layout.org/
15:56lpetittechnomancy: thoughts on "enhancing" support for multi-project simultaneous work ?
15:57klangtechnomancy: It doesn't quite work in the latest version. Skipping /lib entirely, would be even better, as nothing at all would be copied around on the disk. Is there any indication of this work in the source yet?
15:58RaynesI wish I spoke German.
15:59bmhRaynes: Study it.
15:59Raynesbmh: I'd rather use Google Translate.
16:00andyfingerhutI wish brains had pluggable modules that let you learn things like German overnight. I'm not asking for much :)
16:00bmhandyfingerhut: I was just going to suggest that.
16:00lypanovgerman is teh easy.
16:00klangandyfingerhut: would you dare to be the first to try out a new module?
16:00andyfingerhutWhoever invents it either becomes a billionaire, dead, or sued out of existence.
16:01bmhWe already have pluggable brain modules. We interact with them using keyboards, though.
16:01andyfingerhutThey don't let you learn German overnight, though :)
16:02lypanovLauJensen: seems built for german?
16:02bmhandyfingerhut: Natürlich tun sie. Ich kann Deutsch sprechen jetzt!
16:02LauJensenlypanov: Im told by AWizzArd thats its suited for German, English and Programming
16:02andyfingerhutklang: Almost certainly no. I haven't even done lasik surgery. I'd think about it, though.
16:03bmhso to my earlier question: Is there a function in core that works like assoc with a combining function?
16:04klangandyfingerhut: laser surgery, for the eyes .. I have a big "no thank you" on that count as well
16:04raekthere is a gap in the family of assoc - assoc-in, dissoc - dissoc-in (contrib) and (update) - update-in
16:04LauJensenklang: why?
16:04raek+ get - get-in
16:04arkhif there's an if-let, why not if-not-let ?
16:05raekand when-first but not if-first?
16:05fliebelarkh: What would there be to let? false or nil?
16:05lypanovklang: my aunty got it done. i'm waiting 10 more years. if hers is still fine, may get mine done.
16:06lypanovmy wife hates me without glasses though. so yeah...
16:06raekI sometimes want something like if-let, but with the order of the branches swapped
16:06raekto get the special cases first
16:06arkhfliebel: what raek said ; )
16:06bmhI wouldn't get lasik. 1) My vision isn't bad enough, 2) Beck Weathers's eyes went to hell at 8000m
16:07LauJensenbmh: ?
16:07arkhfliebel: point well made, though
16:07klangLauJensen: why to the "taxed fingers"? .. because hanging from your fingertips a suitable amount of distance from the ground, knowing that you have to yank yourself a bit further up to avoid a fall comes back a four o'clock in the morning in the form of a yelp and hurting fingers .. why to the :symlink question?, because I want to limit disk use.
16:07LauJensenklang: why no thanks to laser surgery ?
16:08LauJensen(sorry for not qualifying the first time)
16:09klangLauJensen: oh, that one. I sort of need my vision, and would rather live with glasses than without vision (i.e. I am a pussy)
16:10klanglypanov: We don't hear about too many failed surgeries, to be fair, do we?
16:10LauJensenI've never heard of a singe eye laser surgery that didn't go well
16:11lypanovklang: nope. else there is no way they'd be allowed to do it.
16:11arkhI've never heard of a single eye surgery that resulted in disaster - my mom's eye surgery didn't go well but it just means she still needs to wear glasses
16:11klang..well, that certainly does not make me less of a pussy for not wanting it done .. :-)
16:12arkh... and you don't have the option to wear hard/gas-permeable contacts after the surgery
16:12lypanovas soon as i can convince my insurance company to pay, i'll go for it. until then, naah.
16:13technomancyklang: just a TODO entry (re: classpath that uses ~/.m2 only)
16:14klangtechnomancy: no wonder I couldn't find anything (I was looking for symlinks)
16:26technomancyklang: if you're interested in implementing it, I can provide details on the mailing list later
16:32klangtechnomancy: I think it makes more sense to implement classpaths based on ~/.m2 than the symlinking stuff, so yes.
16:37technomancyklang: briefly, it would be done by taking the same approach as leiningen.jar/script-classpath-for
16:37technomancytake a look at that code and let me know if you need more details
16:38klangtechnomancy: will do, thanks!
16:51LauJensentechnomancy: Actually the symlinks will likely be alot easier to work with in case you have to debug something
16:53technomancyLauJensen: yeah, this will be optional
16:54technomancysome people even still use M-x swank-clojure-project, which would never work with it
16:56jjidowhat kind of "def" should I use to create a new Exception class?
16:56technomancyjjido: generally you don't need to
16:56technomancytry c.c.condition instead
16:57jjido,(doc condition)
16:57clojurebotNo entiendo
16:58technomancyclojure.contrib.condition, that is
16:59LauJensentechnomancy: So you're still keeping the door open for swank-clojure-project?
17:01technomancyas long as I don't have to support it
17:01technomancyit's not the only thing that assumes a lib full of jars though
17:02technomancy(support meaning maintain and answer questions about it)
17:03jjidowhat does AOT compilation mean?
17:03LauJensenjjido: Attack Of Toasters Compilation
17:03LauJensenCan get pretty dangerous
17:03jjidoare there ducks?
17:03LauJensenNo
17:03LauJensenjjido: In Clojure it means Ahead of Time :)
17:04LauJensenGotta jet, good night all ya'll
17:05jjidoI don't even know how to compile Clojure programs :/
17:05bmhI'm loathe to preface a question with a disclaimer that the question might be foolish, but: Where the heck are queues in clojure.core?
17:06raekPersistentQueue? undocumented.
17:06ShereKahnGuys, I am running in an issue with Emacs.app + slime (2010-07-22) + swank (20100404). Slime works well with SBCL, but with swank-clojure, whenever I enter an sexp, return does not evaluate it and block the repl. An atom works fine though. Rings any bell
17:06raek,(into clojure.lang.PersistentQueue/EMPTY [1 2 3])
17:06clojurebot#<PersistentQueue clojure.lang.PersistentQueue@6b58d153>
17:07technomancyjjido: you don't need to
17:07technomancy95% of the time
17:07bmhraek: Is there a reason why it's undocumented/I shouldn't use it?
17:07jjidotechnomancy: can I use contrib condition without it?
17:07raekit's fairly undocumented probably because it doesn't have its own syntax
17:07technomancyjjido: yeah
17:07raekbut you should not hesitate to use it, I think
17:08raekThe Joy of Clojure mentions it...
17:10technomancyjjido: c.c.condition is already AOT'd for you; you don't need to do anything special to use it
17:10bmhraek: http://clojure-log.n01se.net/date/2008-07-23.html straight from the man's mouth himself (search on Persistent)
17:14raekwhoa, chouser learning rather than teaching stuff regarding data structures... this must be ancient.
17:14bmhJune 2008.
17:14bmherm July
17:19woobycool quote at the end of that page
17:19AWizzArd~seen rhickey
17:19clojurebotrhickey was last seen quiting IRC, 1529 minutes ago
17:22bmhraek: Is there an efficient way to convert a PersistentQueue into a list?
17:22technomancybmh: you can call seq on it, which is almost the same thing
17:23bmhtechnomancy: lovely!
17:26hsuhi'm a beginner... i ran lein deps inside my clone of "ring"
17:26hsuhand then i got 7 artifacts are missing..
17:28raekfor me it has happened that the artifact downloading thingy can't download obviously existing artifacts
17:28raekat those times, deleting ~/.m2 solved the problem
17:28hsuhall of it ?
17:28raekyes
17:29raekmaybe moving it would be a better option
17:29hsuhits gone
17:29hsuh:)
17:29raekI have no idea if this will work, but it has worked for me when it says that, for example, clojure-1.2 can't be downloaded
17:50amalloyany of the cake maintainers around?
17:51hsuhraek: that worked, so it was something with the state of .m2
17:51AWizzArdamalloy: I think this could be ninjudd
17:52amalloywhoa, a second ago he wasn't here
17:54amalloyanyway ninjudd, how do you recommend managing swank on multiple projects? i could put them on different ports, but that's kinda a hassle; with lein i have a script that kills the existing swank process and starts a new one in the cwd. but that seems to lose me the benefits of cake's fast startup
17:55amalloy(assuming that i'm willing to work on only one at a time, and it's just the act of switching from one to the other that's awkward)
18:57amalloywow, (new SomeStruct arg1 arg2) is a *lot* faster than (into empty-struct {:x arg1 :y arg2})
19:02ninjuddamalloy: I'd recommend separate ports with shortcuts in emacs to connect to each
19:21amalloyninjudd: i don't quite get the cake metaphor yet. is it correct (or close enough to be useful) to say that each directory is associated with a different cake process/jvm, and commands like cake swank, cake stop, etc, will only operate on processes started from the cwd?
19:22amalloyand if so, how do i shut down jvms if i don't remember where i was when i started them?
19:28ilya_sI'm having some issues with lein repl. Regular clojure repl works fine with (read-line), it collects a line of input, then reads it and continues. With lein repl this is not so, (read-line) goes to new line and never returns even after new line. There must be some mingling with *in* and possibly *out*, was wondering if anyone knew of the issue and if there is a way to fix/remedy it?
19:29amalloyilya_s: hm, i have the same issue. but it works in cake repl and in swank
19:30ilya_sI haven't tried cake repl, but lein swank does the same thing, so I take it that lein generally mingles with *in*.
19:31amalloyreally? i've never had trouble with lein swank
19:31ataggartanyone know the trick to call a ^:static function from the repl?
19:31amalloyotoh i guess i haven't tried read-line in swank :P
19:32ilya_slein swank works great, until you want to collect stdin. Does (read-line) work for you in slime connected to lein swank?
19:32amalloyno, just tried it
19:33ilya_s:-)
19:33amalloydoesn't behave the same as what you describe though
19:33amalloyit immediately returns nil
19:33amalloy(cake swank doesn't work either; it immediately returns "")
19:34ilya_syeah, mine hangs, actually let me try again
19:35ilya_sbut either way, even regular lein repl doesn't work correctly. clojure repl works fine though
19:36amalloyheh. i don't even know how to open a repl without lein/cake
19:37amalloyhm, i guess you're right. i wonder what the build tools are doing that makes this so hard for them
19:39amalloyilya_s: (.readLine (reader (System/in))) to go behind lein's back
19:39ilya_swell, I quickly looked at lein source the other day (for about a minute) and definitely saw *in* being rebound. I didn't have enough time to really check it out and before I got too deep, was wondering if anyone knew and/or maybe there is a reason for this and it can't be fixed.
19:39amalloythat is, using (reader) from clojure.java.io
19:42alpheusI'm inserting two apparently equal maps into a set. Obviously my idea of equivalence for maps is different than what set uses. What does set use to determine whether a set member already exists?
19:43andyfingerhutIt should be Java equals, or Clojure =, but I'm not an expert on that point.
19:44andyfingerhutHave you tried comparing the two apparently equal maps with Clojure =?
19:44ilya_samalloy, ah, cool, yeah, I can use that for now, at least during development when I need my repl. Thanks a bunch
19:44amalloyandyfingerhut: i think it's not actually either of those, but something that behaves a lot like clojure =
19:45alpheusI just realized I'm lying. The values are not maps.
19:45amalloyalpheus: the repl knows all! it sees through your transparent lies!
19:46amalloy,(conj #{} {:a 1} {:a 1})
19:46clojurebot#{{:a 1}}
19:46alpheusFWIW the "maps" are something created by defrecord, and I've been thinking of them as maps. So the comparison is probably based on object identity, or a pointer.
19:47amalloyalpheus: no, defrecords compare by value
19:47alpheusThen I'm really baffled.
19:47amalloyuser=> (defrecord A [a]) (conj #{} (A. 1) (A. 1))
19:47amalloy#{#:user.A{:a 1}}
19:47andyfingerhutYeah, Clojure strives to use value equality on immutable values.
19:47amalloyso give us a gist to look at alpheus, and we'll try and see what's really going on
19:48alpheusI'll try to extract the relevant parts. What's a gist?
19:48amalloyor a pastie or whatever. http://gist.github.com/
19:49bhenrygist is superior in my opinion
19:49amalloybhenry: agreed. but if he happens to be familiar with pastie or something, who am i to argue
19:50bhenryi hear ya. some of the layouts of those sites are so horrible. i just think gist combines all the best features of any one of them.
19:51bhenryplus the git history stuff is excellent. i did see one awhile back that let you live test your javascript which i thought was pretty neat.
19:51amalloypersonally i don't much care; i just like that gist (a) has clojure font-lock, and (b) knows who i am and keeps track of my gists
19:51bhenryindeed
19:52amalloyi'm not at all influenced by the emacs gist plugin...
20:04ninjuddamalloy: cake searches backward up the path for a project.clj. if it finds one, it starts the jvm in that dir. otherwise it uses ~/.cake
20:12bhenryamalloy: do i sense sarcasm?
20:12amalloybhenry: maybe. but it might just be the emacs user's casual smugness
20:14bhenryhaha. i've been learning emacs and clojure at the same time for the last few months, and i already don't want to ever go back to anything else.
20:14amalloythat's about my time scale too, except i had a little emacs experience from my experimentation with CL earlier this year
20:16amalloyit's helped that i've also started working at a company that develops on ubuntu
20:18bhenryif you use emacs in terminal mode gist-buffer and gist-region are the only sane way to get from IDE to IRC, because copying is wonky from the terminal with split screens, and i always have split screens.
20:19amalloyi haven't tried erc yet; i bet that would make it fairly easy
20:19bhenryamalloy: yes. the fact that my very smart coworkers told me i should learn clojure really helps.
20:20amalloyheh. mine snort in disbelief when i mention clojure. bunch of bigoted rubyists
20:21bhenryamalloy: never thought of that. i actually used gmail in emacs for a day. maybe i should give chat in emacs another shot.
20:22amalloyyeah, i should try it out. pidgin is really a terrible irc client
20:28amalloybhenry: hello from emacs. it's not *great*, but it's usable and convenient
20:37bhenryi remember chatting to my friends in gtalk. i think i didn't like it, because it was hard to know if things were failing silently (i.e. my friends didn't get all the messages which i thought went out)
20:38bhenryamalloy ^^
20:42alpheusRegarding the duplicate set members problem earlier: http://upholsters.us/set-dupes.txt
20:43amalloyalpheus: that's a set containint one item, which is a list containing two rows
20:43amalloysorry, that's a lie
20:45amalloyalpheus: it has to be something wrong with row-of (which you didn't upload). if i run it with Record. in place of row-of, it works just like you'd want
20:47amalloyon second thought, maybe i should think about the problem before offering two bogus suggestions
20:47alpheushttp://upholsters.us/row-of.clj
20:48alpheusSorry, I don't have a web browser available, so I can't use one of the nice colorizing paste things.
20:50bhenryqa.setup> (= (Row. "brands" "id" 1) (Row. "brands" "id" 1))
20:50bhenryfalse
20:50bhenryqa.setup> alpheus ^ the problem goes beyond it being in a set. two calls to Row. create different things.
20:53amalloybhenry: i don't think that's the issue: http://gist.github.com/598451
20:53alpheusSure. That's why I originally asked about set's equivalence model. I assumed it was based on identity, but amalloy says it's by value. And the two values look alike (from my naive viewpoint).
20:54amalloyalpheus: maybe they have different metadata from the SQL select?
20:54bhenrysomething like that. i don't know for sure, but even in your gist you're making two calls to row. so (= f r) would return false, meaning the set would allow both of them.
20:55amalloybut it doesn't
20:55amalloybhenry: (= r f) is false, but (.euqls r f) is true
20:55amalloys/euqls/equals
20:55bhenryah.
20:56amalloyalpheus: try (map meta (list row1 row2))
20:57alpheus(nil nil)
20:57amalloyso much for that idea. (.equals row1 row2)?
20:58alpheusfalse
20:59amalloyand if you try it with two Rows constructed just via (Row.) it will be true. so something we don't understand about (fetch) is causing them to not be equal
21:01amalloysince you're using rs's values directly via %, i'm guessing that the Row class your SQL library is using doesn't implement .equals intuitively
21:01amalloyalpheus: i bet it works if you change % to (into {} %)
21:05alpheusUsing set to remove duplicates is a band-aid anyway. The duplicates are a side effect of a sub-optimal graph traversal. It just seemed good enough for the time being.
21:06amalloybut now you've got me curioue! does my fix work?
21:07alpheusno
21:08amalloywild. well, go fix your algorithm instead then :)
21:08alpheusYes, I will. Thanks for your help.
21:13alpheusReplacing the defrecord form with this works: (defn make-row "Replacement for defrecord Row "[table values scrubs] (hash-map :table table :values values :scrubs scrubs))
21:13alpheusBy works, I mean, two calls to row-of result in values that compare equal
21:13amalloybaffling
21:14amalloyyou don't have to call hash-map, by the way; the body of your fn can just be {:table table...}
21:15alpheusI'm afraid that a map in that position will be taken as a condition-map
21:15alpheusunless that's impossible without any keys named :pre or :post
21:16amalloy(defn) is smart enough to figure out how many forms you've passed
21:16alpheusah, ok
21:30gfrlogdoes anybody know why c.c.shell[-out] is deprecated?
21:32amalloyalpheus: by the way, "that position" isn't just pre- and post-conditions; arbitrary metadata for the function goes there
21:37alpheusamalloy: I didn't know that. Thanks.
21:38amalloyyou're ahead of me, though; i haven't tried to get the hang of pre- and post-conditions. how useful have you found them to be?
21:38alpheusAnother typical day of clojure. My program has more features and fewer lines of code.
21:38amalloyhaha
21:38alpheusI just found out about pre/post conditions a couple of days ago. I've replaced all my comments about them with actual condition-maps.
21:39alpheusSince I've had Eiffel-envy for years, they seem pretty cool.
21:48bhenryamalloy: do you use ring with wrap params?
21:48amalloybhenry: i haven't done any web development yet
21:49amalloymy pet project is all back-end and AI, so i'm not worried about ring for the moment. but maybe alpheus can help?
21:49bhenryanyone watching right now who has done development with ring and ring middleware?
21:56brianstamandWhat's the best way to make a compojure/jetty http daemon?
22:07TheBusbySo what is necessary to enable UTF-8 (Unicode support) when using $lein swank and slime-connect?
22:11hsuhthere is a very interesting post on the mailing list titled "State of web development"
22:50brianstamandthanks hsuh that thread is very helpful
23:12bhenrydang
23:48scottjbrianstamand: not sure, might look for term coding-system, such as slime-net-coding-system
23:48scottjopps, TheBusby ^