#clojure logs

2010-08-05

01:14zkimanybody have a good temp directory macro?
01:17taliosnope - even in java I don't. I tend to use File.createTempFile() - then delete it, then mkdir it.
01:18talioswhy theres no createTempDir() method I don't no - there might be on the forthcoming java7 APIs tho
01:18zkimgot it, thanks anyway
01:51SlantIs there a streaming JSON API?
01:53hiredmanstreaming in what sense?
01:53hiredmanin that it can read and write to io streams?
01:53hiredmanall json libs I know of can do that
01:54SlantIn that it doesn't consume all the data off the stream and convert to objects in-mass.
01:54SlantIn that I can read the objects as they come off the stream, incrementally.
01:55hiredmanclojure-json will read one json form from a stream at a time
01:57SlantIs that danlarkin's github one? Or the one in contrib?
02:00zkimtalios: ugly but works, temp directory macro: http://gist.github.com/509311
02:00hiredmanSlant: github
02:01hiredmanthe one from contrib might too, never used it
02:01lancepantz_member:Slant: i'd check out clj-json while you're at it's something like 20x faster than the pure clojure implementations
02:02slyruslancepantz_: that's depressing
02:05lancepantz_i'm anxious to see if closer ever passes java in performance
02:05SlantAhh, it uses Jackson.
02:05lancepantz_yep
02:05lancepantz_is jackson native?
02:05SlantThat's pure-Java.
02:05slyruslancepantz_: closer?
02:05SlantNo. Jackson is pure-Java.
02:05lancepantz_clojure :)
02:05SlantAlso, it's incremental.
02:05SlantSweet.
02:05SlantThat might work perfectly, thanks!
02:05lancepantz_np
02:05slyruspassing is one thing, 20x worse is another
02:06Slanthttp://github.com/mmcgrana/clj-json/blob/master/src/clj/clj_json/core.clj - Small.
02:06tomojwhy is pure-java 20x faster than clojure? :(
02:07lancepantz_there's a jvm folder in there too, to be fair
02:07BahmanHi all!
02:07lancepantz_but mcgranaghan does write insanely good code
02:09SlantThat's true.
02:10SlantPlaying with that now.
02:10SlantSince its lazy seq seems to be *exactly* what I wanted.
02:29notsonerdysunnywhat is a good symbolic-math library for clojure?
02:30notsonerdysunnyI want to do basic algebra,differentiation, integration and some tensor-calculus
02:38Slantnotsonerdysunny, free?
02:38notsonerdysunnyfree would be good .. but paid is also ok
02:47SandGorgonnotsonerdysunny, try http://data-sorcery.org/contents/ (Incanter).
02:49SlantHow are module constants usually defined?
02:49Slantnotsonerdysunny, or Clojure w/ Mathematica?
02:51Slant(def CONSTANT value) ?
02:52tomojdon't use uppercase
02:52SlantRight.
02:52tomojbut, yeah
02:52SlantOf course. Clojure everything is immutable.
02:53tomojincanter can't do any symbolic math, can it?
02:55tomojtechnomancy: ok, harmless is good :)
03:02SlantSo only defns and not defs enter a namespace when you use?
03:03raekno, defs are public by default too
03:03raekthere is a lot of def* macros ending in a hyphen that does the same as the un-huphened, but makes them private
03:04raeke.g. defn and defn-
03:04SlantBut for variables?
03:04raekclojure.contrib.def has some extra macros
03:04Slant(def some-internal-helper-constant 1234)
03:04raek(defvar- internal-constant 1234 "the number of foos in bar")
03:05raekyou can also do this with metadata
03:05SlantAhh.
03:05raek(def ^{:private true, :doc "some docs"} name value)
03:05raekthe defvar and defvar- forms are in c.c.def
03:06SlantGotcha.
03:06SlantHow are def and defvar different
03:06Slant?
03:06raekvalues that are intended to be rebounded usually have *earmuffs*
03:06raekdefvar has a dosctring arg
03:07raekbut that's pretty much it :)
03:07raek(def *default-something* 1)
03:07raek(binding [*default-something* 2] ...)
03:08raekbut save the earmuffs for things that should be dynamically rebound
03:17Slant(Is there a way to local mirror clojuredocs or some other doc site?)
03:17SlantI'm going on an airplane soon and would like to take them with me. :-D
03:18raekthe http://clojure.github.com/clojure/ is generated with autodoc
03:19raekmaybe there is a build task for generating the docs html in the clojure and contrib source
03:21raekSlant: http://tomfaulhaber.github.com/autodoc/
03:21raekyou should be able to run that on the sources
03:23raekI haven't tried it though... so take that witha grain of salt
03:28Slantghuhughg. Lein repl.
03:28SlantSo painful sometimes. One pair of mismatched parens, and it's crash city.
03:36DeranderSlant: give me paredit or give me death
03:38raek"I’m now convinced that choosing a language based on how easy it is to read or write is a very bad idea. What if we chose musical instruments based on how easy they are to play? Everyone would playing kazoos. You can’t think deeply about music if all you know is a kazoo."
03:38raek(from http://blog.fogus.me/2010/08/03/take-5-brenton-ashworth/ )
03:41lancepantz_i thought that was very insightful as well
03:42lancepantz_anyone know of any resources for documentation on the innards of the slime protocol
03:43lancepantz_it looks like i uses some type of generic sexp
03:43lancepantz_but i cant find any solid docs
03:47lpetitlancepantz_: when I started the work on ccw (the eclipse plugin for clojure), I wanted to use the swank/slime protocol, and rewrite a client in "pure clojure". Alas, I searched very hard, but the only answers I got were: "no doc, you should reverse engineer". Since that I've turned my back to swank/slime :-( and implemented a quick proprietary solution for ccw.
03:48lpetitlancepantz_: but maybe I've not searched hard enough, of course.
03:48lancepantz_:(
03:50lancepantz_i suppose im kinda taking a shot at what you did
03:50lancepantz_but slightly different
03:52lpetityes ?
03:53lancepantz_i'm working on this new project that everyone hates :)
03:53lancepantz_it has a persistent jvm
03:53lancepantz_with the persistent jvm, one could theoretically make slime calls to it through the command line
03:54lancepantz_david nolen suggested that it could be used to get clojure integration into text mate
03:54lancepantz_so i'm trying to create the proper abstractions that will pass command line options into swank
03:56lpetitlancepantz_: I would love the idea of eventually switching to a common standard for accessing clojure envs remotely.
03:57lancepantz_yeah, it would work for any idea, even vim
03:57lancepantz_you can see what we have at http://github.com/ninjudd/cake
03:58lancepantz_a good example is just to do cake eval '(+1 1)'
03:58lancepantz_you'll get 2 at your command prompt
03:58lpetitlancepantz_: but if it's from the command line *only*, it's a shame : will be OS dependent, more difficult to integrate into an existing IDE written in clojure/java, etc.
03:59lpetitI'll look at it later (I'm in my workplace right now), thanks for the input
03:59lancepantz_what would be better?
03:59lancepantz_i mean a socket would be the same thing that swank already provides
04:01lpetitlancepantz_: if it works via socket it's ok. But will you provide the "client" part of slime/swank ? That's what I'm interested in, not just "yet another remote text based repl implementation" ;-)
04:02lancepantz_well, obviously the client would have to be build for each ide
04:03lancepantz_maybe i'm missing something, why do ide's not connect to swank as it exists now?
04:05lpetitlancepantz_: as for ccw, it's because I don't know how to speak with swank. If there was a proper documentation, it'll be ok. The only "API" for slime is in emacs lisp
04:06lancepantz_i see
04:06lancepantz_yeah, it looks pretty hairy
04:07lancepantz_state machines and automatons
04:07lancepantz_maybe i should just create a simpler protocol for evals, documentation, tab completion etc
04:08cais2002hi, for string processing like finding occurrence of substring, should I use the java function directly or are there some library in clojure syntax?
04:09lancepantz_cais2002: clojure.string exists, but most of the time the java methods work best
04:09lancepantz_or is it still in contrib, it may be clojure.contrib.string
04:12cais2002lancepantz_: I saw contrib.string, but there is even an author associated with it. a bit skeptical
04:12cais2002there are also str-utils and str-utils2
04:12lancepantz_contrib.string is what you want
04:12lancepantz_str-utilsx was deprecated in 1.2
04:13lancepantz_and merged into contrib.string
04:13lancepantz_it's maintained by the core commiters
04:14lpetitlancepantz_: look at what is done in enclojure for remote ccw environment invocation. In the mailing list, you'll see that Eric Thorsen posted about it: in order to allow the future unification of this for both enclojure and counterclockwise, he made a proper repository for the client and server code
04:14lancepantz_lpetit: oh wow, thanks for the lead, looking into it now
04:14lpetitlancepantz_: oh, no, it's more for REPL stuff than for "IDE-backend purpose" stuff. Or maybe I'm wrong and it can serve both
04:15lancepantz_we've got our repl with tab completion and readline support :D
04:15lpetitlancepantz_: I invite you to ask on the enclojure ml to get precisions on what they use for "IDE-backend communication purpose"
04:15lpetitif that's the only thing you want, then yes, this part is solved for you :)
04:16lancepantz_so the enclojure mailing list
04:16lancepantz_guess we had some duplicated work there then
04:18lancepantz_oo, that repl does look nice
04:18lancepantz_we don't even get syntax highlighting in the slime repl
04:25SlantDerander, paredit?
04:26Deranderemacs mode that makes paren matching trivial
04:26Deranderand lets you do operations on sexps
04:27SlantAhh.
04:30lancepantz_Slant: you have to use paraedit
04:30lancepantz_biggest single productivity boost i found for working with clojure
04:31Deranderhighlight-parenthesis-mode is my second favorite ;-)
04:31lancepantz_i use rainbow parens too
04:32SlantSadly, I'm a vim user.
04:32SlantStuck in that ghetto.
04:32SlantTrying out vimclojure. Trying to get the repl mode up and running.
04:32DeranderI learned emacs for clojure
04:32Deranderit can be done!
04:32Deranderstill love vim though.
04:33SlantDerander, I don't have years to commit just to get to an equal level. I think in vim, you know?
04:33SlantI respect emacs.
04:33Deranderyeah.
04:33lancepantz_i used to be, i just bit the bullet and switched
04:33DeranderI had that problem for like 8 months :-P
04:33Derandernow I can work equally well in either with a few minutes to adjust fingers
04:33lancepantz_i dropped vim altogether
04:33lancepantz_after about a week i was comfortable
04:34DeranderI had to learn elisp so that I could get emacs to a usable state for ruby/rails coding
04:34Derandermumamo didn't work very well, so I had to figure out how to get rhtml-mode working, and then that was insufficient so I had to learn how to customize syntax highlighting, etc.
04:37SlantToo many yaks, at the moment.
04:37SlantI'll play with vimclojure. Get to hate it. Learn me some clojure.
04:37SlantThen switch. :_D
04:37DeranderI am a professional yak shaver.
04:43lpetitSlant: vimclojure is good enough for a respectable number of users. No need to blame the concurrency to make your preferred choice much appealing.
04:43lpetitSlant: e.g. chouser, one of the co-authors of "Joy of Clojure", is using vim / vimclojure, and likes it, AFAIK
04:54cais2002suppose I want to aggregate members of 2 different namespaces into one, is there a way to do it?
05:00Slantcais2002, use both?
05:00raekthere is clojure.contrib.ns-utils/immigrate
05:00raekbut there are some issues
05:00cais2002,(doc immigrate)
05:00clojurebot"clojure.contrib.ns-utils/immigrate;[[& ns-names]]; Create a public var in this namespace for each public var in the namespaces named by ns-names. The created vars have the same name, root binding, and metadata as the original except that their :ns metadata value is this namespace."
05:01cais2002raek: that seems to be the perfect one I need
05:01raekit creates new vars that are not the same vars as the immigrated ones
05:01raekit works for simple cases
05:02raekdynamic rebinding of the var in the ns that was immigrated to does not affect the one in the namespace that was immigrated from, and vice versa
05:30SlantWhat's wrong with this? (ns none.search
05:30Slant (:use [clojure.contrib.duck-streams :only reader]])
05:30Slant (:require (clj-json [core :as json])))
05:30SlantAre the vectors not correct?
05:31Slant(remove the excess ])
05:31Slant(Bad copy-pasta)
05:33hoeck(:use [foo.bar :only [baz]])
05:35Slanthoeck, only vectors? Not lists?
05:35hoecknot sure, but definitely something seq-like after :only :)
05:36SlantAnd to the :use ?
05:36SlantThat is (:use ?foo.bar :only [baz]?)
05:36SlantIt is always supposed to be a vector?
05:38SlantUgh.
05:38hoeckSlant: yes
05:38SlantI keep getting these IllegalStateExceptions about defining "spit"
05:38hoeckat least using () dos not work for me
05:38SlantJust from using duck-streams.
05:38SlantI thought doing :only [reader] would solve it.
05:38SlantApparently not.
05:39raekSlant: do a (ns-unmap 'you-ns 'spit)
05:39hoeckmaybe you evaluated the ns before without the :only option?
05:39Slanthoeck, even after I restart the interpreter...
05:42hoeckwhich clojure are you using? for me, spit is in core
05:42hoeck,spit
05:42clojurebot#<core$spit clojure.core$spit@24fade>
05:42hoeckand not in duck-streams anymore
05:43hoeck(ns foo.bar (:refer-clojure :exclude [spit]) .... ) should help then
05:44Slanthoeck, whatever lein pulled down.
05:45hoeckthen its probably some snaphsot :)
05:45SlantYay. :-D
05:46hoeckif you eval spit on the repl, and the result looks like the one from clojurebot above, use the refer-clojure :exclude form to avoid refering to spit in your namespace
05:52SlantGot it cleaned up.
05:52SlantOn to the next problem. :-D
05:53SlantI tried doing a (drop 1 (reader ...))
05:53SlantBut, since a reader isn't a sequence, of course that doesn't work.
05:54SlantIdeas on alternate ways of accomplishing the same? I'm trying to drop the first (and later, the last) bytes of a bufferedreader.
05:55cais2002is the naming convention to use capitalization for protocol name?
05:55raekSlant: you'll gave to make a sequence in some what
05:56raek*way
05:56raekfor example
05:58raek(defn byte-seq [input-stream] (lazy-seq (let [value (.read input-stream)] (if (= value -1) nil (cons val (byte-seq input-stream))))))
05:58raekthat takes a InputStream, not a Reader
05:58raekStreams = bytes, Readers/Writers = characters
05:59raeka similar thing for characters:
06:01raek(defn character-seq [reader] (lazy-seq (let [value (.read reader)] (if (= value -1) nil (cons (char val) (character-seq reader))))))
06:01raeks/(char val)/(char value)/
06:01sexpbot(defn character-seq [reader] (lazy-seq (let [value (.read reader)] (if (= value -1) nil (cons ((char value)) (character-seq reader))))))
06:02SlantGotcha.
06:02SlantHmm.
06:02raekcais2002: as far as I can tell, yes
06:03raekthis is probably because they generate java interfaces
06:03raekhrm, sexpbot added an exta pair of parens in that substitution...
06:03tomojanyone using org-babel with clojure?
06:03Slantraek, character-seq isn't in contrib or anything? Seems like something that must be ran into often.
06:03tomojlooks like it requires swank-clojure.el :(
06:05raekthere is line-seq, but I don't think the ones I wrote are there
06:06raekI'm making a small library that splits these things in two parts: Sources that kan take one thing at a time, and source-seq that lazily takes item from a Source and present them as a seqeuence
06:06raekjust because I find myself writing these lazy sequences every now and theen
06:09raeka slightly outdated version of it http://gist.github.com/460527
06:09raekand a less outdated api reference http://raek.se/stream-seq/
06:11SlantVery interesting. Thanks.
06:11SlantGood to read good code right now. :-)
06:13raekI don't know if this lib will simplify things in the end
06:13raekbut experiments are good. some of them fails, but that's fine.
06:38LauJensenGood morning all
06:39esjsalute !
06:39neotyk'morning
07:09lpetithello
07:13lpetitLauJensen: Hello, La-ô
07:14LauJensenBonjour mon petit :)
07:14lpetitLauJensen: everytime Christophe pronounces your first name, I don't understand how he's talking about, 'cause I'm not used to pronounce it "La-ô" :-)
07:15LauJensenWell - You guys are french, so Im very forgiving when you fail to pronounce an ancient danish name :)
07:15lpetit:)
07:45lpetit~source clojure.lang.Delay
08:05aldebrnGood morning all
08:05LauJensenMorning
08:06aldebrnForgive me if this is the second time I've asked this but, I'm looking for a "Java for Clojure/Lisp programmers" resource because my attempts to learn as little Java as possible to use existing Java libraries (something I only consider thanks to Clojure <3) is not working, and traditional Java pedagogy seems to be overkill for this
08:06aldebrnAdvice?
08:06clojurebotlive every week, like it is shark week!
08:10rhudsonaldebrn: The book "Java in a Nutshell" might be a good resource. The first part of the book is a quick introduction to the language. The bulk of it (and it's bulky!) is a compact reference to the standard libraries. (When I'm trying to get the lay of the land, this is often more useful than javadocs.) There's also references to the standard tools.
08:12rhudsonI think a lot of Java intros try to tell you how to program in Java, which isn't what you want.
08:14rhudsonThe indexes are also good. If you see some mention of, say, "annotations", it's easy to find the part of the book that explains what that's about.
08:16aldebrnGreat, thanks rhudson
08:19rhudsonThe latest published edition is for Java 5, but the language and library differences between that an the current Java 6 are really minor.
08:25aldebrnWow, it is a big book
08:26aldebrn'the Java language has proved popular with programmers, who typically find it a pleasure to work with Java after struggling with more difficult, less powerful languages' <-- this should be good :) thanks again rhudson
08:28bortrebhi everyone
08:30bortrebanyone have a good emacs color scheme for hacking during the day? I use zenburn at night but it's not working too well in the sun.
08:32tomojare you going to hook it up so that it auto-switches based on sunrise/sunset data for your current location? ;)
08:35raekday hacking => black on white, high contrast?
08:35bortrebyep
08:35bortrebI was thinking about making it switch depending on the time :)
08:35raeknice
08:36raekI use a variant on a scheme called something like dark-tango and the default emacs colors if I need something more bright
08:37tomojI just a couple hours ago switched from my custom dark to the default emacs
08:38sid3kis the function named "refer" function deprecated?
08:38tomojnope
08:38bortrebbut is there an uber cool there like zenburn except light?
08:39tomoj-> (:deprecated (meta #'refer))
08:39sexpbotjava.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/refer)
08:39tomojoh, yeah
08:40raek,(:deprecated (meta #'refer))
08:40clojurebotnil
08:41raek,(:deprecated (meta #'add-classpath)
08:41clojurebotEOF while reading
08:41raek,(:deprecated (meta #'add-classpath))
08:41clojurebot"1.1"
08:44raek;;; Color theme based on Tango Palette. Based on a color theme by danranx@gmail.com
08:44raek(defun color-theme-dark-clojure ()
08:44raek "A color theme based on Tango Palette."
08:44raek (interactive)
08:44raek (color-theme-install
08:44raek '(color-theme-dark-clojure
08:44raek ((background-color . "#2e3436")
08:44raek (background-mode . dark)
08:44raek (border-color . "#888a85")
08:44raek (cursor-color . "#fce94f")
08:45raek (foreground-color . "#eeeeec")
08:45raek (mouse-color . "#8ae234"))
08:45raek ((help-highlight-face . underline)
08:45raek (ibuffer-dired-buffer-face . font-lock-function-name-face)
08:45raek (ibuffer-help-buffer-face . font-lock-comment-face)
08:45raek (ibuffer-hidden-buffer-face . font-lock-warning-face)
08:45raek (ibuffer-occur-match-face . font-lock-warning-face)
08:45raek (ibuffer-read-only-buffer-face . font-lock-type-face)
08:45raek (ibuffer-special-buffer-face . font-lock-keyword-face)
08:45raek (ibuffer-title-face . font-lock-type-face))
08:45raek (border ((t (:background "#888a85"))))
08:45raek (fringe ((t (:background "grey10"))))
08:45raek (mode-line ((t (:foreground "#eeeeec" :background "#555753"))))
08:45raek (region ((t (:background "#555753"))))
08:45raek (font-lock-builtin-face ((t (:foreground "#729fcf"))))
08:45tomojbad raek
08:45raek (font-lock-comment-face ((t (:foreground "#888a85"))))
08:45raek (font-lock-constant-face ((t (:foreground "#8ae234"))))
08:45raek (font-lock-doc-face ((t (:foreground "#888a85"))))
08:45raek (font-lock-keyword-face ((t (:foreground "#729fcf"))))
08:45raek (font-lock-string-face ((t (:foreground "#ad7fa8"))))
08:45raek (font-lock-type-face ((t (:foreground "#8ae234"))))
08:45raek (font-lock-variable-name-face ((t (:foreground "#eeeeec"))))
08:45raek (font-lock-warning-face ((t (:bold t :foreground "#f57900"))))
08:45raek (font-lock-function-name-face ((t (:foreground "#edd400"))))
08:46raek (comint-highlight-input ((t (:italic t :bold t))))
08:46raek (comint-highlight-prompt ((t (:foreground "#8ae234"))))
08:46bozhidargrrrr
08:46raek (isearch ((t (:background "#f57900" :foreground "#2e3436"))))
08:46raek (isearch-lazy-highlight-face ((t (:foreground "#2e3436" :background "#e9b96e"))))
08:46raek (show-paren-match-face ((t (:foreground "#2e3436" :background "#73d216"))))
08:46bozhidarwon't someone kick him already...
08:46raek (show-paren-mismatch-face ((t (:background "#ad7fa8" :foreground "#2e3436"))))
08:46raek (minibuffer-prompt ((t (:foreground "#729fcf" :bold t))))
08:46raek (info-xref ((t (:foreground "#729fcf"))))
08:46Chousukeeep :P
08:46raek (info-xref-visited ((t (:foreground "#ad7fa8"))))
08:46raek )))
08:46raek(provide 'color-theme-dark-clojure)
08:46raekwhoa!
08:46raekSOOOOOORYYYY!
08:46raekam I banned?
08:46raekopera does not copy text when I select it every time
08:46Chousukenah, :P
08:46tomojheh
08:46bozhidarraek: haven't you heard of a paste service ;-)
08:46tomojyour irc client should warn you or require you to press enter after pasting
08:47Chousukeirssi does that. it has saved me a number of times
08:47raekmy usual routine is: select URL in browser, middleclick in terminal
08:47raekhowever
08:47sid3kopera is worse than even internet explorer
08:47raekopera does not always copy the text into the PRIMARY buffer
08:47sid3kp.s: 6
08:47tomojerc just requires you to press enter, so every once in a while I'll accidentally copy some of the history, including the ERC> prompt, and then not realize that I've pasted it :(
08:48raekso I end up pasting what was there since the last time
08:48raekwell irssi does that too
08:48raekbut I accidentally hit the wrong key
08:48raeksomebody, please, revoke my IRC license...
08:48tomojjust cut a corner off it
08:49AWizzArdraek: I hope for you it was not copyrighted closed source code from your company :)
08:49raekman I feel so stupid...
08:50tomojdon't worry about it, no one was injured afaik
08:51raekI'm impressed that the server did not filter some of it
08:51tomojlooked like your client was rate-limiting?
08:51raekor maybe it did for you
08:51bozhidarI'm impressed nobody kicked you this long, this shows what a friendly environment is built around Clojure :-)
08:52ChousukeI haven't actually seen anyone ever get kicked from here :P
08:52tomojare there even any ops?
08:52Chousukemaybe? I don't know.
08:52bozhidarI guess Rich might be an op, but he's quite busy to moderate an irc channel
08:53raekiirc, rich isn't an op
08:53raekbut the channel owner still hangs here
08:53bozhidarwho registered the channel?
08:54raeksome nick beginning with j, i think. maybe chanserv can tell
08:54tomojjcowan? :D
08:54bozhidarbefore I came to freenode I didn't use irc for 10 years
08:54bozhidarand I don't remember most of the commands
08:54bozhidarI used to know them all back in the day...
08:54AWizzArdChousuke: yes, they can not get kicked, because this channel has no operator :)
08:55bozhidarI cannot even remember how to check the channel info...
08:55tomojyep, /q chanserv info #clojure, it was jcowan
08:55AWizzArdYes, but he logs in only every 10 months or so (:
08:55rhudson,seen jcowan
08:55clojurebotjava.lang.Exception: Unable to resolve symbol: seen in this context
08:55ChousukeAWizzArd: chanserv can op people who have the rights though.
08:55AWizzArdChousuke: yes, but it is only that one guy who registered this chan and never was seen again
08:56Chousukeheh
08:56tomojnever seen again?
08:56AWizzArdOkay, he joined some months ago, and for a few days chouser got ops
08:56tomojI thought he was pretty active in the early days
08:56AWizzArd~seen jcowan
08:56clojurebotno, I have not seen jcowan
08:56AWizzArdYes, back in 2008
08:56Chousukeif the channel ever gets overrun by trolls I suppose Freenode staff can transfer ownership to someone more active.
08:56tomoj.i jy. jbocre .iosai
08:57AWizzArdAnyway, I really don't see why operators are needed. Practically zero incidents, plus what Chousuke said.
08:57AWizzArdAnd there is always /ignore
08:57bozhidarit's better to be safe than sorry...
08:57sid3khi all, I've upgraded my system and slime/swank doesn't work anymore. firstly it asks the "versions differ" message, if I say yes and continue, this time it doesn't execute the commands I type, when I press enter, it creates a new line
08:58bozhidarI remember some good forums ruined by lack of moderation
08:58rhudsonWe're all pretty moderate here
08:58bozhidarthe community is still small, but this will certainly change
08:58bozhidaras Clojure is growing in popularity
08:59bozhidarand early adopters tend to be much more civilized ;-)
08:59sid3kbozhidar: I know lots of good not moderated communities, seriously
08:59sid3knot moderated and hq
08:59bozhidarsid3k: I know some as well, but accidents do happen
08:59sid3kbtw, any ideas about the question I've asked?
08:59bozhidarand many people are idiots
08:59sid3kbozhidar: don't worry
09:00tomojsid3k: are you M-x slime-connect ing?
09:00sid3ktomoj: yeah
09:00tomojand the repl is in REPL mode?
09:00tomoj#emacs might be more help
09:00sid3kyeah, I see REPL, Autodoc text in the status line
09:01sid3karright
09:01raeksid3k: which version of slime do you use? a recent?
09:01sid3kI guess
09:02raekI've seen that problem some time, but it disappeared when I updated slime and swank
09:02sid3kraek: version of the slime I'm running is 2010-07-21
09:03raekwhich version of swank?
09:03raekhow did you start it? lein swank?
09:05raekalso, if the encodnings of swank and slime don't match, it will freeze when you enter a non-ascii char
09:06raekbut unless you fiddle with those settings, that should be fine
09:07rhickeyhas anyone tried the latest from git (yesterday)? esp people with custom IPersistentMap impls
09:09raekdoes one get equality-with-maps automatically whith records now?
09:09sid3kraek: sorry for long delay, I lost my internet connection
09:09sid3kmy wank version is 20100404
09:09sid3k*swank
09:11raeksid3k: do you have [swank-clojure "1.2.0"] in you project.clj?
09:12sid3kraek: I've 1.2.1
09:12raekthen I have no idea... :)
09:12sid3karright
09:13sid3kI'm trying to fetch latest version of swank from its repo
09:13raekusing [clojure "1.2.0-RC1"] also?
09:14raekmy hunch is that this could be some version incompability issue
09:16tomojsid3k: you're not using ELPA slime, I guess?
09:17sid3kelpa slime?
09:18raek...instaled from M-x package-list-packages
09:18sid3kyeah, I've installed it from debian testing repository
09:19raekhttp://tromey.com/elpa/install.html <-- instruction on how to install elpa
09:20sid3kI've got elpa already, now trying to reinstall slime
09:20raekthen simply do a M-x package-list-packages, select slime and slime-repl and install
09:20raekah, good
09:20tomojif you have slime installed from somewhere else, things will go badly I think
09:21sid3ktomoj: bingo
09:21sid3kelpa displays slime as disabled
09:21sid3kbut I've already remvoed slime
09:43rhickeyaargh, the 2 Clojure talks at Java One are scheduled for the same time slot
10:06LauJensen:(
10:07LauJensenrhickey: perhaps a quick email to the organizers would help
10:08rhickeyLauJensen: not likely
10:08LauJensenYou wont know if you dont try :)
10:09fogusPerhaps they expect that people will attend both ... on different timelines. (groan)
10:11sid3kwhy clojure projects uses "com" in their directory names?
10:12rhickeyLauJensen: not true: "Session Schedule is Final:
10:12rhickeyThe Oracle Content Team will not be able to accommodate requests for schedule changes."
10:12xkbdo inner functions have a different behavior regarding concurrency then "normal" defn functions?
10:12AWizzArdsid3k: authors following Oracles guidelines for namespace names.
10:12LauJensenrhickey: alright, your call
10:12sid3kAWizzArd: is it necessary?
10:13AWizzArdrhickey: and will you be the one who is supposed to give those both talks?
10:13rhickeyAWizzArd: no
10:14AWizzArdMaybe this is a good sign: Oracle accepts Clojure now as one of the main langs for the JVM and says that also some Java talks are scheduled at the same time.
10:17LauJensenOracle liking Clojure... I dont know if thats good or bad
10:18bozhidarLauJensen: Oracle likes only money, they have no respect for technology
10:18bozhidarSun was a totally different beast, but sadly they never managed to capitalize on their great technology...
11:25AWizzArdDid Clojure always throw error messages for (byte 200)?
11:27AWizzArdOr was byte silent in previous versions?
11:28LauJensenAWizzArd: try git-blame on RT.java line 904. I cant remember if its always been this way
11:30danlarkinit did not always
11:30danlarkinI think that has only been the case for a few months?
11:31AWizzArdIs there a built-in fn to convert unsigned-bytes into bytes?
11:34sid3kI'm reinstalling Clojure following these instructions; http://riddell.us/ClojureOnUbuntu.html
11:34sid3ksomehow, mvn package command doesn't create a jar file in clojure-contrib directory
11:35sid3kany ideas?
11:36lpetitsid3k: if you're "following instructions to install clojure", then you'd better use something pre-packaged. use cljr
11:37sid3klpetit: sorry but I'm not familiar with java world
11:37raekthere are jars on http://build.clojure.org/releases/ and http://build.clojure.org/snapshots/
11:37lpetitsid3k: my point is that if you feel the need to "follow instruction" "to install", then you should not rebuild it yourself.
11:38sid3klpetit: what do you mean? I'm trying to do what that page says?
11:38sid3kraek: thanks
11:38raeka common way to get started it to get and install leiningen, lein new, tweak dependencies in project.clj, lein deps, lein swank
11:39raekonly requires java, I think
11:39lpetitsid3k: you don't need to build things yourself. There are already packaged jars, and if you don't know java world well, there are also things wrapped up if you use cljr
11:39lpetitraek, sid3k: really, for starting to play with clojure, the easiest way today is cljr.
11:40lpetit~cljr
11:40clojurebotIt's greek to me.
11:40dpritchettIs there a preferred way to provision Clojure instances on EC2? Crane from Flightcaster is all I've seen so far. A nice AMI would be good too.
11:40sid3kI'm googling it
11:40lpetit~google cljr
11:40clojurebotFirst, out of 1990 results is:
11:40clojurebotCLJR - Cirrus Logic YUV 4:1:1 (vids:CLJR)
11:40clojurebothttp://abcavi.kibi.ru/fourcc.php?fcc=CLJR&amp;title=CLJR+-+Cirrus+Logic+YUV+4:1:1
11:40lpetit~google cljr clojure
11:40clojurebotFirst, out of 116 results is:
11:40clojurebotliebke&#39;s cljr at master - GitHub
11:40clojurebothttp://github.com/liebke/cljr
11:40raekyeah, cljr sounds really neat
11:40lpetitclojurebot: cljr is http://github.com/liebke/cljr
11:40clojurebotc'est bon!
11:40lpetit~cljr
11:40clojurebotcljr is http://github.com/liebke/cljr
11:40tcrayfordlpetit: refactoring mode has just got a working rename across multiple vars. I'll probably be introducing parsley to it tomorrow
11:40lpetitgreat
11:40raekhaven't tried it yet, so how to get started with lein is the only simple instructions I can give
11:41lpetitraek, sid3k: I'm not speaking "in theory", I've installed it and use it on a regular basis
11:42tcrayfordlpetit: renaming over a load of vars is kinda annoying when your code gets reformatted each time.
11:42sid3karright, does it worth to remove current installation and start using it?"
11:42lpetittcrayford: then I'll have to push my paredit.clj branch tonight.
11:42lpetitsid3k: certainly
11:42sid3kit seems promising, I'm confused
11:43sid3kthen I'm removing all of the current installation
11:43raekthere are too many complicated tutorials that havr high google rankings...
11:43tcrayfordlpetit: my current plans with parsley is to only use it for modifying existing code. I can just my existing stuff for analysis
11:44lpetitsid3k: don't be confused. The path is clear: if you want to start with clojure without the hassle of having to install plugins on ideas, etc., start with cljr. When you want to write projects with dependencies, etc., enter the lein world. Then you can add an IDE to your toolkit, and you'll have a lot of choices: vim, emacs, eclipse, netbeans, intellij IDEA
11:44lpetittcrayford: be aware that parsley isn't very well documented currently
11:45dnolensid3k: there's also cake, if you have ruby installed. I find it a far friendlier experience than cljr esp. on OS X.
11:45tcrayfordlpetit: nor is it on clojars/etc (which means I'll probably install it to maven locally)
11:46lpetitsid3k, dnolen: there's a clear progression path from cljr to lein to an IDE. I don't know about cake, but I guess it does not enable this "iterative" feeling
11:46sid3klpetit: some guys at here know, I installed and configured this stuff and started to learn using emacs clojure already but yesterday I got a new notebook and here I am
11:47lpetitsid3k: what is the IDE you're the most effective with
11:47lpetitcurrently
11:47sid3kemacs and vim both
11:47dnolenlpetit: with cake those two steps are collapsed. You get a very usable REPL and a lein compat project oriented tool
11:49lpetitdnolen: :/ cake compat with lein compat with maven :/ :/ :/ . I'll keep this simple and just ignore cake for the sake of simplicity (one less dependency on ruby, no accumulation of project management tools and configuration files)
11:49dnolensid3k: ah, then lein will work you just fine. Emacs + Lein is tasty.
11:51sid3kI've got lein as well
11:51lpetitsid3k: how to choose between cljr and lein ? The fact is you don't have to choose. cljr is for quickly opening a REPL for experiments, without having to create a project skeleton, etc. lein is for managing projects, with project dependencies, etc.
11:54sid3klpetit: but why did you think that I need to open a repl quickly?
11:54lpetitsid3k: 'cause it's the simplest use case :-p
11:55sid3klpetit: not funny dude, as I said, I'm reinstalling my environment, my aim is not to open a repl quickly
11:55lpetitsid3k: and while I'm using an IDE, I often quickly open an indenpendent REPL in my console to try out totally independent things from what I'm currently doing
11:55sid3kand all the stuff I've prepared is removed because of your wonderful cljr promotion
11:55sid3k:)
11:55lpetitsid3k: part of my environment is being able to open a repl quickly
11:56sid3kthanks anyway, I'm trying cljr now
11:57lpetitsid3k: if you have lein and cljr installed, you don't need to follow the web page with the hints on how to compile things (unless you really want to compile your own clojure and contrib, but it's generally overrated to do so)
11:57cemerickdpritchett: Clojure instances?
11:58cemerickWe use pallet for EC2 provisioning and app deployment/admin.
11:58cemerickFWIW, of course.
12:00sid3klpetit: it raises "Exception in thread "main" java.lang.NoClassDefFoundError: cljr/App" for every command
12:00sid3kbut this way works: java -jar ~/.cljr/cljr.jar list
12:02sid3ksorry, it just raises that exception for repl command
12:02sid3klist command works in both way
12:03dnolensid3k: another thing that's painful about cljr is JVM boot time for every command. I find that unbearable. but to each his own.
12:04sid3kdnolen: I'm removing it
12:04lpetitok guys, I'll stop promoting concurrent stuff then.
12:05dnolensid3k: if you're already comfortable with Emacs why not just setup SLIME? it's pretty easy now.
12:06sid3kI didn't say "I need clojure repl" already?
12:06sid3kmy problem was, ant didn't generate jar file for clojure-contrib
12:06lpetitsid3k: fact is, I didn't read when you said "I need ...".
12:07sid3klpetit: np
12:08tridd3llsid3k: I saw you referenced one of my tutorials a bit ago... Here is one I put together a while back but haven't blogged about: http://riddell.us/ClojureSwankLeiningenWithEmacsOnArch.html
12:08lpetitsid3k: so your problem is to reinstall a development environment for creating projects with clojure, that's it ?
12:08tridd3llMight be more recent, replace apt-get install where necessary
12:08sid3klpetit: yeah
12:09tridd3llsid3k: I'm going to try today to make sure if it's actually up to date with the latest 1.2 and lein stuff
12:09lpetittridd3ll: is it more accurate than what can be grapped from the clojure's wiki Getting Started page ?
12:09sid3ktridd3ll: thanks
12:10tridd3lllpetit: well, it's much more specific... I need to preface all of these tutorials with the link to the wiki... just haven't had the time
12:12tridd3llsid3k: also, the repository locations have changed I believe... I don't think they are under /richhickey any longer but under /clojure on github
12:13sid3kright
12:13tridd3llsid3k: of course when using lein it pulls down its own version
12:13dpritchettThanks cemerick! I wanted to try something like Heroku for Clojure but since I couldn't find it I finally signed up for EC2. It helps that Amit's Runa.com docs reference EC2 as well.
12:13dpritchettcemerick: Do you have any blog posts or info on the Clojure you do on ec2?
12:14cemerickdpritchett: CloudFoundry is the current best bet for a java-universe heroku
12:14cemerickNever used it myself.
12:14technomancylpetit: cljr may merge with lein in the future
12:15dpritchettThe only other thing I've seen out there is the clj-gae stuff. I could try that too but I am starting to get interested in the idea of doing some hands-on EC2 work anyway.
12:15cemerickdpritchett: Keep in mind, w.r.t. deployment, what works for Java works for Clojure -- so all of the solutions, servers, processes for deploying Java apps can be reused.
12:16cemerickdpritchett: see http://muckandbrass.com/web/x/CoBZ
12:16dpritchettOh hey I already had that open in another tab :)
12:16cemerickThat is (minus a smattering of details) all that's necessary to deploy our clojure-based appllication.
12:17lpetittechnomancy: good news
12:17technomancyI've been planning to add cljr-like features to lein for quite a while
12:17cemerickThere's a lot of people rolling their own deployment stuffs...running compojure via emacs screen, homebrew scripts, etc etc. None of that makes any sense to me. *shrug*
12:18LauJensencemerick: hmm, sounds interesting, got link to those scripts?
12:18LauJensen:)
12:18dpritchettMy personal clojure work is done using a Ubuntu 10.04 VM on virtualbox. It can't be that hard to get an AMI from there I hope.
12:19cemerickdpritchett: Every flavour of ubuntu has an AMI already. No need to package your own.
12:20cemerickThat is, if you're using any of the deployment tools out there (e.g. pallet, chef, puppet, cap, fabric, etc)
12:20dpritchettThere's one named 677194410155/Ubuntu 9.04 64-bit base jdk6 git-core; I guess that's close enough
12:20cemerickdpritchett: this is the canonical (hah!) source for ubuntu AMI info AFAIK: http://alestic.com/
12:22cemerickThose won't have the jdk installed already, but they're official AMI builds from canonical (starting with karmic, I think). I don't trust AMIs build by random passers-by.
12:22cemerickLauJensen: I think Brian Carper has the screen deployment stuffs in a blog post.
12:23LauJensencemerick: I was just kidding - I prefer to automated approach as well
12:23dpritchettSo I'd take one of those, quickly apt-get install the jdk and get lein/cljr/whatever, and then save that as my base Clojure AMI that I can clone for various tests?
12:24cemerickdpritchett: IMO, you're far better off ensuring that everything that isn't in the default AMIs is configured in at runtime, including the JDK install, tomcat/jetty/whatever, etc.
12:24dpritchettMeaning I'll stick with the Canonical AMI and then add install/config scripts that run at boot time for any additional AMIs?
12:26cemerickRoughly, but the "scripts" aren't installed or necessarily run at boot-time. In pallet's case, it connects to the newly-provisioned server over ssh, and applies your configuration.
12:27cemerickChef is similar, but it has an agent that plings a Chef server for configuration changes periodically.
12:28cemerick+1 to technomancy: you should have a CI environment that spits out war files (or whatever the appropriate deployable unit is), and then use a deployment tool to push that along with whatever other config goes into a new/updated node.
12:31technomancyneed to blog about that...
12:34dpritchettSo when I discover a bug in my ec2 clojure app I'll fix it locally, rebuild jars with lein, and then overwrite the old jars on ec2 and restart the jvm?
12:35dpritchettOr use pallet to kill the AMI, start a fresh one, and push my new jars automagically
12:36dpritchettIn which jars are sshed and images are spun
12:36cemerickdpritchett: the former, yes. Going from zero to a fully configured EC2 node isn't the fastest thing in the world.
12:37technomancyyou should be able to do it easily when you need to, but not for every deployment.
12:37cemerickright
12:37dpritchettMakes sense, thanks
12:37dpritchettI've never had the privilege of working on a CI environment
12:37dpritchettHopefully this EC2 fun will give me the excuse to beef up in that area
12:38cemerickdpritchett: It's not strictly necessary, but the more automation you have in your build/deployment/rollback process, the better your life gets. :-)
12:38cemerickFYI, there's a #pallet channel. You can bother hugod there. ;-)
12:38dpritchettOh certainly I have read plenty of persuasive blog posts to that effect. IMVU -> Lean Startup stuff and the Joel test and all that
12:39cemerickIMVU is the modern hipster-geek example. Flickr's been doing continuous deployment for years and years.
12:41dpritchettEh, the IMVU post (http://news.ycombinator.com/item?id=475017) made a big impact on me last February and I can't remember having read such an interesting thing about Flickr. I don't get practical consumer web app experience at my job so I find what I can to learn from.
12:44cemerickdpritchett: That was tongue-in-cheek. :-) IMVU's a great example. And yeah, flickr's never been out there talking about how they do things nearly as much as they could have.
12:46dpritchettI think as long as I can claim that I read it before the Lean Startup wikipedia page was created I'm safe ;)
12:46cemerickheh
12:47cemerickdpritchett: http://www.slideshare.net/jallspaw/10-deploys-per-day-dev-and-ops-cooperation-at-flickr is a decent deck about it. I remember first seeing code.flickr.com some years ago and being floored by "...last deployed XX minutes ago, deployed YY times last month" or something like that.
12:47dpritchettThank you!
12:48hugoddpritchett: there is also the kaching blog post http://eng.kaching.com/2010/05/deployment-infrastructure-for.html
12:53sid3kI'm having trouble with lein this time: Unable to resolve artifact: Missing: 1) org.clojure:clojure-contrib:jar:1.2.0-SNAPSHOT
12:53sid3kany ideas?
12:54dpritchettLein deps can't find the jar you wanted?
12:54sid3kexactly
12:55sid3kI've downloaded latest jar from build.clojure.org and put [[org.clojure/clojure "1.2.0-master-SNAPSHOT"] in the project file
12:56dpritchettYou could try [org.clojure/clojure-contrib "1.2.0-RC1"] maybe?
12:57sid3ksame error dpritchett
12:57dpritchettDidja try lein clean?
12:58dpritchettThat's about all I can think of. I'm sure technomancy will be along shortly
12:58sid3kdpritchett: trie
12:58sid3ktried
12:59dpritchettHere's a bug report on the same thing - turned out to be a typo in project.clj I think: http://github.com/technomancy/leiningen/issues/issue/47#issue/47
13:01dpritchettEh, that one wasn't about contrib
13:02sid3kdpritchett: thanks
13:02sid3kgood evening everyone, sid3k goes
13:10arohnerthis amuses me: http://gist.github.com/510026
13:33notsonerdysunnyI am trying to build and get familiar with lein-build system .. I tried to build a project for the ants.clj that Rich wrote to demonstrate the power of stm. I divided the file into three peices core.clj, stm_ui.clj(contains the ui stuff) and stm_ants.clj(contains the agents and related stuff) .. http://dl.dropbox.com/u/7271654/ants.tgz
13:35notsonerdysunnywhen I try to run "lein uberjar" it gives me a "JFrame" and stops the process there .. it does not complete .. can anybody help me to get this done right ..
13:36notsonerdysunnyI have been able to use lein on simpler things .. this is the first swinp-app I am trying ...
13:37qbgLink is broken
13:39LauJensennotsonerdysunny: From your description I dont know whats wrong, but if I remember correctly you can do $ export DEBUG=VERBOSE and rerun lein uberjar to get a proper error
13:39technomancynotsonerdysunny: move things into a -main function. having UI launched in the toplevel is ok for experiments but not the way to do it in projects.
13:41Raynesnotsonerdysunny: uberjar only creates an executable jar when you have a namespace that is :gen-class'd, has a -main function that is the entry-point to the application, and the :main namespace is specified in the project.clj.
13:43notsonerdysunnyqbg .. sorry .. my dropbox is still synchronizing ..
13:43notsonerdysunnytechnomancy: yea .. I will try moving the creation of the JFrame into the main function ..
13:44notsonerdysunnyRaynes: I have done that ..
13:45RaynesThe -main function, as technomancy pointed out, has to contain the code that actually *runs* the application, such as launching the UI and such.
13:51SandGorgondoes clojure have formal specification semantics - just curious, based on a related thread on reddit
15:04timcharperI just ran into an issue with leiningen regarding the installation of multiple versions of the same dependency
15:04timcharpermy project.clj specifies to install clj-stacktrace 1.3
15:04timcharperHowever, in one of my development dependencies, clj-stacktrace 1.2 was specified as a dependency.
15:05timcharperIn the end, I ended up with two versions of clj-stacktrace
15:06timcharperThe issue was when I started up the environment, I ended up getting the 1.3 version of clj-stacktrace/core.clj, and the 1.2 version of clj-stacktrace/utils.clj
15:07timcharperTo make even things more strange, I opened up the clj-stacktrace 1.3 jar, modified clj-stacktrace/utils.clj by adding a space, saved it (which caused the timestamp to update on it), and that small little change caused the 1.3 version of clj-stacktrace/utils.clj to be loaded instead
15:07timcharperSo:
15:07timcharperA couple of questions
15:08timcharperWhose responsibility is it (or should it even be a desired behavior) to prevent the installation of multiple versions of the same dependency within a project
15:08timcharperFor instance, with bundler, you can only have one version of the dependency in an instance. If, for whatever reason, there are conflict in dependencies, errors are raised
15:09timcharperThe other question: if it's desirable that multiple versions of the same dependency are installed in the same projects simultaneously, whose responsibility is it to ensure that the latest version is consistently loaded every time?
15:17timcharperWell, I went ahead and posted a ticket:
15:17timcharperhttp://github.com/technomancy/leiningen/issues/issue/90
15:17timcharperIf anybody else has run into something similar, it may be helpful to get your input on it.
15:18technomancytimcharper: in this case it's easy; you probably shouldn't specify clj-stacktrace as a regular dependency; it's clearly a dev-dependenciy. in general: right now duplication is possible only across dependency/dev-dependency boundaries. in this case a manual :exclude should be used. this may be able to be improved in lein.
15:18timcharperAdditionally, is this experienced with maven? Does maven do anything to prevent you from installing conflicting versions of a dependency?
15:19timcharpertechnomancy: unfortunately, I think we had to make it a production dependency because our code won't run without it (we have manually inserted places to catch an output the pretty stack trace)
15:19timcharperI will look into what we can do to change that
15:19timcharper(Thank you for responding :-) )
15:19timcharperIs there any way warnings could be added? Or is there any way to predictably enforce a load order?
15:20timcharperThis issue only manifested on my machine because I was unlucky enough to get that failing combination
15:20timcharper(Which further added to the mystery of why it was failing, as you might understand :-) )
15:24technomancyload precedence is defined by order on the classpath. according to leiningen/classpath.clj the regular deps should always have precedence over dev deps.
15:24timcharperyeah... that's what I would think.
15:25timcharperAny idea how I got 1.3 core.clj, and 1.2 utils.clj ?
15:25timcharperThat's what caused the issue that caused us all to scratch our heads.
15:25timcharperIf I got a homogenous set of either 1.3 or 1.2, the issue would not have manifested.
15:26timcharperalso, if I got 1.2 core.clj and 1.3 utils.clj, I would've been okay. It's just that specific combination :-) 25% chance
15:26timcharperI recorded a video of that issue manifesting, if you would like to watch it:
15:26timcharper^that^the
15:29timcharperPart 1: http://screencast.com/t/NjExMDUzYjQt
15:29timcharperPart 2: http://screencast.com/t/YjE0Nzc1OTkt
15:29timcharperI realized at the end what the real issue was, but the manifestation is clearly captured
15:31timcharperI can produce a more consolidated video of the issue, one second
15:41timcharperhere it is :) - http://screencast.com/t/ZmY5MjA2YjQt
15:44timcharper(don't watch part 1 and 2... just the last video, if you decide to watch it at all)
15:59LauJensentimcharper: I hadn't seen jing before - amazing quality
16:01LauJenseninteresting catch
16:08timcharperyeah... it's weird, isn't it? (the issue). Jing rocks.
16:12LauJensentimcharper: extremely. I cant make out what you're doing when you're selecting, are you using some kind of key which sometimes highlights the current word (up until next space) and other times something which highlights an entire function?
16:19timcharperc-m-space - mark-sexp
16:19LauJensenthanks
16:47timcharpertechnomancy: you here still?
16:57timcharpercase closed with regards to the multiple versions issue
17:01timcharperon July 28th, clj-stacktrace-0.1.2/utils.clj was compiled and living in my classes folder.
17:01timcharperit took preference over clj-stacktrace-0.1.3/utils.clj, because the timestamp of the compiled files was newer.
17:02timcharperbasically, this translates to: you should probably never run `lein deps` without running `lein clean` first. Ever. It creates a possibility for an unpredictable environment.
17:04timcharperIE, consider this scenario:
17:04timcharperyou install version 1 of a jar, "core.clj" is dated July 14th, "utils.clj" is dated July 20th
17:05technomancytimcharper: sorry, gotta get back to work. sounds like the thread needs to continue on the lein list.
17:05technomancycemerick's non-transitive AOT patch will help a lot here; hope it gets applied soon.
17:05timcharperthen on July 21, everything gets compiled
17:05timcharpertechnomancy: ok
17:05timcharperI'll finish here then send to list
17:06timcharper... (continued) on July 28th, say, you update to version 2 of a jar. In the jar, "core.clj" is dated July 23rd, but "utils.clj" is dated July 20th.
17:07timcharperin this case, the compiled version 1 of utils.clj would still be used, since it's seen as newer than the version 2 utils.clj
17:07timcharperhowever, the version 2 of core.clj would be used
17:07timcharpercreating a screnario not unlike the one I encountered today
17:09LauJensentimcharper: thanks for sharing
17:20helinohi everyone! is there some standard way to mark functions which has side-effects (for example reading from a socket)?
17:21helinohi everyone! is there some standard way to mark functions which has side-effects (for example reading from a socket)?
17:22timcharperhttp://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/io!
17:22timcharperyou can has side-effect marking like that
17:23helinoby using an exclamation mark?
17:23timcharperby calling that macro
17:23timcharperand wrapping your io side-effecty logic in there
17:24timcharperso, if says an I/O code is called within a transaction, and is at risk of being repeated, an exception is raised (as opposed to your I/O operation occurring twice in a circumstance that would probably be very rare and hard to reproduce)
17:25helinotimcharper: I understand, thanks for your help!
17:26timcharperSure thing!
17:32jlf`using clojure+slime, if some-var contains an object, i'd expect user> (. some-var TAB to show me that object's methods but it does not. how can i see what methods are implemented for a given object?
17:33tridd3llFYI: I've released a new tutorial for those linux users wanting to roll their own clojure, swank, leiningen and emacs environment: http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html
17:33technomancyjlf`: use the slime-inspector on it: C-c S-i.
17:34raekjlf`: this might not answer your question, but clojure.contrib.repl-utils/show lists all methods for a class or object (I don't remember which)
17:34raekooh, didn't know about that one... :)
17:34tridd3lland I updated my current and older tutorial to point first to the Clojure wiki page as well as leiningen to avoid confusion for users hitting the page via google
17:35jlf`technomancy: thanks -- i see only fields there, no methods. am i missing them?
17:36jlf`raek: will take a look, ty
17:36callen-nycI just wrote this up for someone
17:36callen-nychttp://gist.github.com/510409 does that look correct?
17:36callen-nycand just a reminder
17:36callen-nyc->> is called "The Winchester"
17:36sexpbot=> #<core$_GT_ clojure.core$_GT_@11286929>
17:36callen-nyc,->>
17:36clojurebotjava.lang.Exception: Can't take value of a macro: #'clojure.core/->>
17:37raektridd3ll: very kind of you :) your tutorials seem to be very popular
17:38callen-nyctridd3ll: for clojure mode and slime, why not ELPA?
17:38raek,#'->>
17:38clojurebot#'clojure.core/->>
17:38raek,(meta #'->>)
17:38clojurebot{:macro true, :ns #<Namespace clojure.core>, :name ->>, :file "clojure/core.clj", :line 1284, :arglists ([x form] [x form & more]), :added "1.1", :doc "Threads the expr through the forms. Inserts x as the\n last item in the first form, making a list of it if it is not a\n list already. If there are more forms, inserts the first form as the\n last item in second form, etc."}
17:38callen-nycright. the winchester.
17:39tridd3llcallen-nyc: I've just always done it this way (although I have tried ELPA in the past.) Works for me. Sometimes I just like to have a bit more control.
17:40callen-nyctridd3ll: going the git clone route always involved more pain for me.
17:40raekI'm definitely for pronounceable names... "The Winchester" could work (in a more informal context, at least)
17:40callen-nyctridd3ll: I'm an impatient hammer-and-go guy though.
17:40callen-nycraek: excellent. Keep telling people to call it that.
17:40callen-nycraek: the best part is the name describes what it does, in a sense :D
17:42raekhow many of the existing build/repl/project/deps tools (like leiningen, cljr, cake) have appeared from a year ago to now?
17:42tridd3llcallen-nyc: well, some people are new to git even, this tutorial introduces how to use more than just the clojure stuff I think.. others might not even be familiar with the linux command line package management stuff... so for clojure, this looks complicated, but it's really outlining quite a few things
17:42callen-nyctridd3ll: good point.
17:42callen-nyctridd3ll: I'm familiar, just impatent and obsessed with automation.
17:43tridd3llcallen-nyc: I might be the opposite... I'm obsessed with knowing how is was done, probably to the point of less productivity.
17:43callen-nyctridd3ll: well, I value grokking
17:44callen-nyctridd3ll: I think you're misunderstanding what I mean
17:44callen-nyctridd3ll: I don't mean skating across a thin-ice patch of cargo cult
17:44callen-nyctridd3ll: I mean getting to a position where you're learning something valuable ASAP.
17:44callen-nyctridd3ll: I've been using emacs much longer than I've been programming in most languages I actually use these days, there's not any value in my screwing around outside of ELPA
17:45technomancyjlf`: you need to inspect the class rather than the instance to see the methods
17:45arohnermacro expansion order is the same as function evaluation order, right?
17:46jlf`technomancy: ah, that makes sense. do you know if any plans are afoot to make tab completion dtrt in contexts such as . and .. ?
17:48tridd3llcallen-nyc: I'm not where you are with emacs, and I don't get to spend the time I'd want with clojure either.
17:48tridd3llcallen-nyc: so this is more foundational understanding for me
17:49callen-nyctridd3ll: okie dokie. was just wondering. thanks for contributing to the community :D
17:49tridd3llcallen-nyc: :-)
17:49jlbHi all, is there a "canonical" Clojure HTTP client? (I'm looking at clojure-http-client)
17:50callen-nycjlb: technomancy's
17:50technomancyjlf`: it would only work with top-level vars, not locals, so probably not
17:50technomancythat said, patches welcome. =)
17:50callen-nycjlb: I think you're looking at it.
17:50jlbcallen-nyc: ok cool, thanks
17:51callen-nyctechnomancy: what would be needed to make the http client contrib ready?
17:51technomancycallen-nyc: a convincing reason why contrib would be a better place for it? =)
17:51technomancyplus a lot of copyright assignment busywork
17:52callen-nyctechnomancy: good point, but it would be nice if it was easier to people to know what the 'canonical' http client is.
17:52callen-nyceasier for
17:52jlf`ah, (use '[clojure.contrib.repl-utils :only (show)]) + (show some-var) = win
17:52technomancycontrib's a bit of a mess. I'd rather people trust something like pagerank or something for judging between libs.
17:53callen-nyctechnomancy: mess?
18:02mebaran151how would one get the generated primary key in clojure.contrib.sql from an insert statement
18:11mebaran151also, if I wanted to replace a library function in clojure.contrib in just my applicaiton, is there anyway just to evilly change its internal definitions
18:15raekI guess you could use some combo of in-ns and def
18:15raekor maybe alter-var-root
18:18mebaran151I'm just trying to get the generated primary key in clojure.contrib.sql
18:18mebaran151it seems like this is buried in stmt metadata somewhere
18:19gfrlogwhat's the clojure word for compose?
18:19raekI haven't used c.c.sql yet, but I suspect that there should be a better way
18:20mebaran151it's a pretty basic library
18:20lancepantzmebaran151: it's not possible with one sql statement in mysql
18:20mebaran151compose I think is comp
18:20raekthere is a more advanced library too, I think
18:20lancepantzit is in postgres though
18:20mebaran151I'm using h2
18:20mebaran151where it definitely is
18:20lancepantzi don't know what that is
18:20gfrlog,((comp not zero?) 8)
18:20clojurebottrue
18:21mebaran151H2 is like a less broken embedded Derby
18:21mebaran151mysql doesn't return the row metadata? I feel I've used libraries that at least made it appear so
18:21lancepantzi looked into, php has a function for it
18:21lancepantzit actually does a second select stmnt
18:22lancepantzhere's what i do in postgres http://gist.github.com/443115
18:22mebaran151http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html
18:22mebaran151in jdbc you can
18:22mebaran151.getGeneratedKeys is your friend
18:22mebaran151if you can get a handle on the stmt object, JDBC handles the C library calls for you
18:23lancepantzright, looks like that is just an abstraction that fires off a second select statment though
18:23lancepantzi imagine it would do it in 1, using returning in psql
18:23mebaran151I think getGeneratedKeys is actually lower level than that
18:23mebaran151though it mght not be transactionally secure
18:25lancepantzi guess if jdbc supports it, then it would make sense for contrib.sql to support it
18:25mebaran151yeah
18:26mebaran151MySQL is just horribly broken 95 percent of the time
18:27mebaran151well I think that instead of closing the statements for you, it should return the statement object, or return the lazy seq with the statement object in metadata
18:27lancepantzwell, if you put a patch together, ping me and i'll try it on my setup
18:27mebaran151then you could call close on it, which would look for the stmt key in the metadata
18:27mebaran151however that would break most of its design, and people might forget that come lazy-seqs need to be closed
18:28mebaran151*some
18:33seancorfieldany bay area folks going to the clojure meetup in SF tonight?
18:34jlf`seancorfield: link? i see only balisp on meetup.com...
18:34seancorfieldjust a second
18:35seancorfieldhttp://www.meetup.com/The-Bay-Area-Clojure-User-Group/calendar/13747349/
18:36jlf`huh, i searched clojure in SF and it didn't show up
18:36jlf`i guess mountain view is too far to be considered relevant
18:37seancorfieldi get lots of meetup alerts about groups in mt view et al - i'm in the east bay
18:37seancorfieldso mt view is a painful commute for me for a UG, SF less so
18:37jlf`yeah, i'm up in the back country of sonoma county :)
18:40seancorfieldah, right, because the group's based in MV... but often meets in SF... gotcha
18:44jlf`it might make sense to base the group somewhere closer to the population center of the bay area, like san mateo or something, so it shows up in searches from SF/Oakland/etc. in additino to metro SJ
18:44jlf`addition even
18:52seancorfieldjlf`: yeah, i could make it to san mateo for a 6pm meeting, as i can to SF... it's just going further south that gets really hard for me
18:52seancorfieldamit who runs the group is based in Mt View tho' so that's why it tends to alternate between SF and Mt View
18:53seancorfieldsince he moves it around, i can suggest to him tonight that he change the group's location on meetup
18:53jlf`i wasn't suggesting changing the actual meeting locations, just the group's location for the purposes of being close enough to show up in searches
18:54seancorfieldright that's what i meant
18:54seancorfieldbetter to show the group somewhere between its main two meeting locations :)
19:07gfrlog,(time (do (reverse (range 1 1000000)) :ok))
19:22slyrustechnomancy: can I make a clojure-mode request?
19:25technomancyslyrus: sure, but I can't promise a timely response/implementation
19:26slyrusoh, I was mistaken anyway. nvm... for the moment.
19:53pdk(doc unless)
19:53clojurebotNo entiendo
19:54tomoj(doc when-not)
19:54clojurebot"([test & body]); Evaluates test. If logical false, evaluates body in an implicit do."
19:55rhudson'unless is reserved for showing how to write macros :)
19:56timcharperchouser: we believe we've found a memory leak issue with fill-queue... but can't explain exactly why fill-queue would be leaking
19:56timcharperhttp://gist.github.com/510601
19:56timcharper(we being timcharper and mabes)
19:56mabeswell, it is either a bug or our misuse of it..
19:57timcharperyeah :)
19:58mabesby memory leak, we mean that the collection (dates) that is being operated on is never released. as far as we can tell doseq and fill-queue should not be retaining the head of the seq, but something is...
20:03timcharperhmm.. actually... on further inspection, I'm not really sure if it has anything to do with fill-queue at all.
20:05pdk(doc defonce)
20:05clojurebot"([name expr]); defs name to have the root value of the expr iff the named var has no root value, else expr is unevaluated"
20:12timcharperok, it's not an issue with fill-queue, although fill-queue inherits the problem. It appears to be an issue with doseq inside of a future
20:19pdk(doc unless)
20:19clojurebotHuh?
20:49timcharper,(doc unless)
20:49clojurebotTitim gan éirí ort.
20:49timcharper,unless
20:49clojurebotjava.lang.Exception: Unable to resolve symbol: unless in this context
20:50timcharper,(+ 1 1)
20:50clojurebot2
20:50timcharper,(doc "unless")
20:50clojurebotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Symbol
20:50timcharper,(doc unless)
20:50clojurebotIt's greek to me.
20:50pdkit doesnt understand if you try to do doc on a string and you don't need , for doc
20:51timcharper(doc println)
20:51clojurebot"([& more]); Same as print followed by (newline)"
20:51timcharper(doc unless)
20:51clojurebotPardon?
21:12pdkoh god
21:12pdkvim =% is gold
21:12pdkthis stuff is exactly what i was looking for, something modest to edit code that still understood lisp indentation
21:16rbarraudmeh - emacs rulz ;-)
21:17rbarraudhuge learning curve if you are thrown in the deep end though
21:17rbarraudI recommend O'Reilly 'Learning GNU Emacs' book - makes sense of it all
21:17rbarraudbefore that it made not a lot of coherent sense for me
21:22pdkprobably get around to learning either one of them in depth if i come up with a more ambitious project idea :p
21:22flintfyea, I'm talking learning Emacs and Clojure at the same time
21:23flintfit can be a bit much
21:30pdkright now im basically happy to use vim in a basic way and try to find some commands for handling indenting/forms
21:48pdk(doc partition)
21:48clojurebot"([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complete last partition upto n items. In case there are not enough padding elements, return a partition with less than n items."
23:04pdk,(/ 2)
23:04clojurebot1/2
23:05pdk,(= (/ 2) 0.5)
23:05clojurebottrue
23:05pdk,(= (/ 3) 0.33)
23:05clojurebotfalse
23:05pdk,(double (/ 3))
23:05clojurebot0.3333333333333333
23:05pdk,(- 1)
23:05clojurebot-1
23:05pdk,-1
23:05clojurebot-1